unixcw-3.4.2/0000755000175000017500000000000012540354302012655 5ustar acerionacerionunixcw-3.4.2/README0000644000175000017500000001143512540070732013543 0ustar acerionacerionThis is README file for unixcw project. unixcw is a project providing libcw library and a set of programs using the library: cw, cwgen, cwcp and xcwcp. The programs are intended for people who want to learn receiving and sending Morse code. unixcw is developed and tested primarily on GNU/Linux system. For general description of changes see HISTORY file. For detailed description of changes see NEWS file. For details on building unixcw from sources see INSTALL file. For acknowledgements see THANKS file. For full text of software license see COPYING file. The heart of the unixcw package is libcw library. It offers the following basic CW services to a caller program: - Morse code character translation tables, and lookup functions - Morse code low-level timing calculations - A 'sidetone' generation and queueing system, using either the system sound card or the console speaker - Optional keying control for an external device, say a transmitter, or an oscillator - CW character and string send routines, tied in with the character lookup - CW receive routines, also tied in to the character lookup - Adaptive speed tracking of received CW - An iambic keyer, with both Curtis 8044 types A and B timing - Straight key emulation The library uses signals and threads to create a background task in which it performs the majority of its work, leaving the main program free to handle other tasks. For example, the simplest CW sending program that uses the library looks like this (compile it with "gcc -lcw example.c"): #include int main () { /* Library initialization */ cw_generator_new(CW_AUDIO_SOUNDCARD, NULL); cw_generator_start(); /* Start the string sending in the background. */ cw_send_string("Hello, world"); /* Wait for the string send to complete. */ cw_wait_for_tone_queue(); /* Library cleanup */ cw_generator_stop(); cw_generator_delete(); return 0; } Instead of the cw_wait_for_tone_queue() call, this program could instead handle any other work it has to do, asynchronously from the CW library's sending. As well as the handful of applications included in unixcw, the following types of programs might also use libcw as their core: - a fully graphical CW send and receive station - a 'CWbiff' that announces incoming email sender in CW - an offline CW reader program, capable of decoding CW from MP3 or other audio file formats - a simple Iambic keyer for an external transmitter, using the mouse buttons as the keyer paddles - a more comprehensive CW tutor program - an automated Morse Code testing application libcw is written in C for easy portability and use. In addition to libcw, the package comes with four basic applications: - cw: a CW sending 'engine' that reads characters from stdin, sounds them on either the sound card or the console speaker, and echoes them to stdout. - cwgen: a simple random character generator that can be used as a feed for cw. For example: cwgen | cw - cwcp: a curses-based program that generates groups of characters from selected sets, words, and CW abbreviations randomly, and sounds them using libcw. It owes much to CP222.EXE, by VU2ZAP. - xcwcp: a CW tutor program for X Window environment. It offers the same random and keyboard sending as 'cwcp', and in addition can read CW that sent to it using the keyboard or mouse as a keyer, making it useful for sending as well as receiving practice. Relationship between version of unixcw package and version of libcw is following: unixcw libcw release date 3.0 3.0.0 2011.12.13 3.0.1 3.0.1 2012.01.08 3.0.2 3.0.1 2012.06.18 3.1.0 4.0.0 2012.06.30 3.1.1 4.1.1 2012.07.04 3.2.0 5.0.0 2013.01.11 3.3.0 6.0.1 2013.12.10 3.3.1 6.1.1 2014-04-23 3.4.0 6.2.1 2014-11-11 3.4.1 6.3.1 2015-01-02 3.4.2 6.4.1 2015-06-XX Primary development platform for unixcw is Debian GNU/Linux. An effort has been made to compile and test at least parts of some versions of unixcw package on following platforms: - FreeBSD 9.3 - FreeBSD 10.0 - OpenBSD 5.5 - Alpine Linux 3.1 See INSTALL file for more information about compilation on different OSes. unixcw is distributed under the terms of GNU GPL license, version 2 or later. See COPYING for details. unixcw was developed by Simon Baldwin, G0FRD . unixcw is developed by Kamil Ignacak . Website: unixcw.sf.net Comments, questions, bug reports: - create ticket: http://sourceforge.net/p/unixcw/tickets/, or - write directly to acerion@wp.pl I reserve a right to two months of delay to reply. unixcw-3.4.2/AUTHORS0000644000175000017500000000006212373716203013731 0ustar acerionacerion See THANKS for authorship and acknowledgements. unixcw-3.4.2/config.sub0000755000175000017500000010563412352133042014646 0ustar acerionacerion#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-05-01' # 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 with a ChangeLog entry to config-patches@gnu.org. # # 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: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -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 ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: unixcw-3.4.2/aclocal.m40000644000175000017500000127462712536122127014543 0ustar acerionacerion# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 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'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2013 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.14' 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.14.1], [], [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.14.1])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-2013 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-2013 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-2013 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-2013 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 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 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_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([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. 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 ]) 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 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-2013 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}" != 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-2013 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])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 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 to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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-2013 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-2013 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-2013 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-2013 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-2013 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-2013 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-2013 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-2013 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 unixcw-3.4.2/po/0000755000175000017500000000000012540354302013273 5ustar acerionacerionunixcw-3.4.2/po/UnixCW.po0000644000175000017500000006655710455365575015054 0ustar acerionacerion# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2006-07-12 23:43-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/cw/cw.c:234 #, c-format msgid "%d HZ " msgstr "" #: src/cw/cw.c:238 src/cw/cw.c:250 #, c-format msgid "%d PERCENT " msgstr "" #: src/cw/cw.c:242 #, c-format msgid "%d WPM " msgstr "" #: src/cw/cw.c:246 #, c-format msgid "%d DOTS " msgstr "" #: src/cw/cw.c:254 #, c-format msgid "ECHO %s " msgstr "" #: src/cw/cw.c:258 #, c-format msgid "ERRORS %s " msgstr "" #: src/cw/cw.c:262 #, c-format msgid "COMMANDS %s " msgstr "" #: src/cw/cw.c:266 #, c-format msgid "COMBINATIONS %s " msgstr "" #: src/cw/cw.c:270 #, c-format msgid "COMMENTS %s " msgstr "" #: src/cw/cw.c:288 msgid "ON" msgstr "" #: src/cw/cw.c:288 msgid "OFF" msgstr "" #: src/cw/cw.c:572 src/cwcp/cwcp.c:1261 src/cwgen/cwgen.c:159 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "" #: src/cw/cw.c:573 src/cwcp/cwcp.c:1262 src/cwgen/cwgen.c:160 #, c-format msgid "Try '%s -h' for more information.\n" msgstr "" #: src/cw/cw.c:599 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -s, --sound=SOURCE generate sound on SOURCE [default 'soundcard']\n" " one of 's[oundcard]', 'c[onsole]', or 'b[oth]'\n" " -x, --sdevice=SDEVICE use SDEVICE for soundcard [default %s]\n" " -y, --mdevice=MDEVICE use MDEVICE for sound mixer [default %s]\n" " -d, --cdevice=CDEVICE use CDEVICE for sound ioctl [default %s]\n" " -f, --file=FILE read from FILE [default stdin]\n" msgstr "" #: src/cw/cw.c:608 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -s SOURCE generate sound on SOURCE [default 'console']\n" " one of 'c[onsole]', 's[oundcard]', or 'b[oth]'\n" " -x SDEVICE use SDEVICE for soundcard [default %s]\n" " -y MDEVICE use MDEVICE for sound mixer [default %s]\n" " -d CDEVICE use CDEVICE for sound ioctl [default %s]\n" " -f FILE read from FILE [default stdin]\n" msgstr "" #: src/cw/cw.c:622 #, c-format msgid "" " -w, --wpm=WPM set initial words per minute [default %d]\n" " valid WPM values are between %d and %d\n" " -t, --hz,--tone=HZ set initial tone to HZ [default %d]\n" " valid HZ values are between %d and %d\n" " -v, --volume=PERCENT set initial volume to PERCENT [default %d]\n" " valid PERCENT values are between %d and %d\n" msgstr "" #: src/cw/cw.c:628 #, c-format msgid "" " -w WPM set initial words per minute [default %d]\n" " valid WPM values are between %d and %d\n" " -t HZ set initial tone to HZ [default %d]\n" " valid HZ values are between %d and %d\n" " -v PERCENT set initial volume to PERCENT [default %d]\n" " valid PERCENT values are between %d and %d\n" msgstr "" #: src/cw/cw.c:641 #, c-format msgid "" " -g, --gap=GAP set extra gap between letters [default %d]\n" " valid GAP values are between %d and %d\n" " -k, --weighting=WEIGHT set weighting to WEIGHT [default %d]\n" " valid WEIGHT values are between %d and %d\n" " -e, --noecho don't echo sending to stdout [default echo]\n" " -m, --nomessages don't write messages to stderr [default messages]\n" msgstr "" #: src/cw/cw.c:648 #, c-format msgid "" " -g GAP set extra gap between letters [default %d]\n" " valid GAP values are between %d and %d\n" " -k WEIGHT set weighting to WEIGHT [default %d]\n" " valid WEIGHT values are between %d and %d\n" " -e don't echo sending to stdout [default echo]\n" " -m don't write messages to stderr [default messages]\n" msgstr "" #: src/cw/cw.c:660 msgid "" " -c, --nocommands don't execute embedded commands [default commands]\n" " -o, --nocombinations don't allow [...] combinations [default combos]\n" " -p, --nocomments don't allow {...} comments [default comments]\n" " -h, --help print this message\n" " -V, --version output version information and exit\n" "\n" msgstr "" #: src/cw/cw.c:667 msgid "" " -c don't execute embedded commands [default commands]\n" " -o don't allow [...] combinations [default combinations]\n" " -p don't allow {...} comments [default comments]\n" " -h print this message\n" " -V output version information and exit\n" "\n" msgstr "" #: src/cw/cw.c:696 msgid "" "s:|sound,d:|cdevice,x:|sdevice,y:|mdevice,f:|file,t:|tone,t:|hz,v:|volume,w:|" "wpm,g:|gap,k:|weighting,e|noecho,m|nomessages,c|nocommands,o|nocombinations," "p|nocomments,h|help,V|version" msgstr "" #: src/cw/cw.c:707 src/cwcp/cwcp.c:1391 src/xcwcp/main.cc:208 msgid "console" msgstr "" #: src/cw/cw.c:708 src/cwcp/cwcp.c:1392 src/xcwcp/main.cc:208 msgid "c" msgstr "" #: src/cw/cw.c:713 src/cwcp/cwcp.c:1397 src/xcwcp/main.cc:213 msgid "soundcard" msgstr "" #: src/cw/cw.c:714 src/cwcp/cwcp.c:1398 src/xcwcp/main.cc:132 #: src/xcwcp/main.cc:213 msgid "s" msgstr "" #: src/cw/cw.c:719 src/cwcp/cwcp.c:1403 src/xcwcp/main.cc:218 msgid "both" msgstr "" #: src/cw/cw.c:720 src/cwcp/cwcp.c:1404 src/xcwcp/main.cc:218 msgid "b" msgstr "" #: src/cw/cw.c:727 src/cwcp/cwcp.c:1411 #, c-format msgid "%s: invalid sound source\n" msgstr "" #: src/cw/cw.c:747 #, c-format msgid "%s: error opening input file\n" msgstr "" #: src/cw/cw.c:757 src/cwcp/cwcp.c:1448 #, c-format msgid "%s: invalid tone value\n" msgstr "" #: src/cw/cw.c:766 src/cwcp/cwcp.c:1457 #, c-format msgid "%s: invalid volume value\n" msgstr "" #: src/cw/cw.c:775 src/cwcp/cwcp.c:1466 #, c-format msgid "%s: invalid wpm value\n" msgstr "" #: src/cw/cw.c:784 src/cwcp/cwcp.c:1475 #, c-format msgid "%s: invalid gap value\n" msgstr "" #: src/cw/cw.c:793 #, c-format msgid "%s: invalid weighting value\n" msgstr "" #: src/cw/cw.c:822 src/cwcp/cwcp.c:1511 src/cwgen/cwgen.c:304 #, c-format msgid "%s version %s, %s\n" msgstr "" #: src/cw/cw.c:830 #, c-format msgid "%s: getopts returned '%c'\n" msgstr "" #: src/cw/cw.c:840 src/cwcp/cwcp.c:1530 #, c-format msgid "%s: no console sound: -d invalid\n" msgstr "" #: src/cw/cw.c:847 src/cwcp/cwcp.c:1535 #, c-format msgid "%s: no soundcard sound: -x invalid\n" msgstr "" #: src/cw/cw.c:852 src/cwcp/cwcp.c:1540 #, c-format msgid "%s: no soundcard sound: -y invalid\n" msgstr "" #: src/cw/cw.c:864 src/cwcp/cwcp.c:1551 #, c-format msgid "%s: cannot set up soundcard sound\n" msgstr "" #: src/cw/cw.c:880 src/cwcp/cwcp.c:1567 #, c-format msgid "%s: cannot set up console sound\n" msgstr "" #: src/cw/cw.c:906 msgid "CW_OPTIONS" msgstr "" #: src/cwcp/cwcp.c:454 msgid "Keyboard" msgstr "" #: src/cwcp/cwcp.c:458 msgid "Exit (F12)" msgstr "" #: src/cwcp/cwcp.c:556 msgid "Sending(F9 or Esc to exit)" msgstr "" #: src/cwcp/cwcp.c:589 src/cwcp/cwcp.c:902 msgid "Start(F9)" msgstr "" #: src/cwcp/cwcp.c:691 msgid "" "\n" "UNIX/Linux Morse Tutor v2.3, (C) 1997-2006 Simon Baldwin\n" "--------------------------------------------------------\n" "\n" "Cwcp is an interactive Morse code tutor program, designed\n" "both for learning Morse code for the first time, and for\n" "experienced Morse users who want, or need, to improve\n" "their receiving speed.\n" "\n" msgstr "" #: src/cwcp/cwcp.c:698 msgid "" "\n" "To use the program, select a mode from those listed on\n" "the left, and begin sending by pressing Return or F9.\n" "\n" "You can vary the speed, tone, volume, and spacing of the\n" "Morse code at any time using the appropriate keys.\n" "\n" "To stop sending, press F9. To stop the program, select\n" "Exit from the Mode menu, or use F12 or ^C.\n" msgstr "" #: src/cwcp/cwcp.c:889 msgid "Mode(F10v,F11^)" msgstr "" #: src/cwcp/cwcp.c:917 src/cwcp/cwcp.c:1044 #, c-format msgid "%2d WPM" msgstr "" #: src/cwcp/cwcp.c:918 msgid "Speed(F1-,F2+)" msgstr "" #: src/cwcp/cwcp.c:921 src/cwcp/cwcp.c:1065 #, c-format msgid "%4d Hz" msgstr "" #: src/cwcp/cwcp.c:922 msgid "Tone(F3-,F4+)" msgstr "" #: src/cwcp/cwcp.c:925 src/cwcp/cwcp.c:1084 #, c-format msgid "%3d %%" msgstr "" #: src/cwcp/cwcp.c:926 msgid "Vol(F5-,F6+)" msgstr "" #: src/cwcp/cwcp.c:930 src/cwcp/cwcp.c:1104 #, c-format msgid "%2d dot " msgstr "" #: src/cwcp/cwcp.c:930 src/cwcp/cwcp.c:1104 #, c-format msgid "%2d dots" msgstr "" #: src/cwcp/cwcp.c:931 msgid "Gap(F7-,F8+)" msgstr "" #: src/cwcp/cwcp.c:935 #, c-format msgid " 0/%2d min " msgstr "" #: src/cwcp/cwcp.c:935 #, c-format msgid " 0/%2d mins" msgstr "" #: src/cwcp/cwcp.c:936 msgid "Time(Dn-,Up+)" msgstr "" #: src/cwcp/cwcp.c:1124 #, c-format msgid "%2d min " msgstr "" #: src/cwcp/cwcp.c:1124 #, c-format msgid "%2d mins" msgstr "" #: src/cwcp/cwcp.c:1288 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -s, --sound=SOURCE generate sound on SOURCE [default 'soundcard']\n" " one of 's[oundcard]', 'c[onsole]', or 'b[oth]'\n" " -x, --sdevice=SDEVICE use SDEVICE for soundcard [default %s]\n" " -y, --mdevice=MDEVICE use MDEVICE for sound mixer [default %s]\n" " -d, --cdevice=CDEVICE use CDEVICE for sound ioctl [default %s]\n" msgstr "" #: src/cwcp/cwcp.c:1296 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -s SOURCE generate sound on SOURCE [default 'soundcard']\n" " one of 's[oundcard]', 'c[onsole]', or 'b[oth]'\n" " -x SDEVICE use SDEVICE for soundcard [default %s]\n" " -y MDEVICE use MDEVICE for sound mixer [default %s]\n" " -d CDEVICE use CDEVICE for sound ioctl [default %s]\n" msgstr "" #: src/cwcp/cwcp.c:1309 #, c-format msgid "" " -i, --inifile=INIFILE load practice words from INIFILE\n" " -w, --wpm=WPM set initial words per minute [default %d]\n" " valid WPM values are between %d and %d\n" " -t, --hz,--tone=HZ set initial tone to HZ [default %d]\n" " valid HZ values are between %d and %d\n" " -v, --volume=PERCENT set initial volume to PERCENT [default %d]\n" " valid PERCENT values are between %d and %d\n" msgstr "" #: src/cwcp/cwcp.c:1317 #, c-format msgid "" " -i INIFILE load practice words from INIFILE\n" " -w WPM set initial words per minute [default %d]\n" " valid WPM values are between %d and %d\n" " -t HZ set initial tone to HZ [default %d]\n" " valid HZ values are between %d and %d\n" " -v PERCENT set initial volume to PERCENT [default %d]\n" " valid PERCENT values are between %d and %d\n" msgstr "" #: src/cwcp/cwcp.c:1331 #, c-format msgid "" " -g, --gap=GAP set extra gap between letters [default %d]\n" " valid GAP values are between %d and %d\n" " -p, --time=TIME set initial practice time [default %d mins]\n" " valid TIME values are between %d and %d\n" " -c, --colo[u]rs=CSET set initial display colors where available\n" " [default %d,%d,%d,%d]\n" msgstr "" #: src/cwcp/cwcp.c:1337 #, c-format msgid "" " -g GAP set extra gap between letters [default %d]\n" " valid GAP values are between %d and %d\n" " -p TIME set initial practice time [default %d mins]\n" " valid TIME values are between %d and %d\n" " -c CSET set initial display colors where available\n" " [default %d,%d,%d,%d]\n" msgstr "" #: src/cwcp/cwcp.c:1351 msgid "" " -m, --mono specify no colors [default colors]\n" " -h, --help print this message\n" " -V, --version output version information and exit\n" "\n" msgstr "" #: src/cwcp/cwcp.c:1354 msgid "" " -m specify no colors [default colors]\n" " -h print this message\n" " -V output version information and exit\n" "\n" msgstr "" #: src/cwcp/cwcp.c:1381 msgid "" "s:|sound,d:|cdevice,x:|sdevice,y:|mdevice,i:|inifile,t:|tone,t:|hz,v:|volume," "w:|wpm,g:|gap,p:|time,c:|colours,c:|colors,m|mono,h|help,V|version,#:|#" msgstr "" #: src/cwcp/cwcp.c:1431 #, c-format msgid "%s: error loading practice words\n" msgstr "" #: src/cwcp/cwcp.c:1439 #, c-format msgid "%s: error writing practice words\n" msgstr "" #: src/cwcp/cwcp.c:1484 #, c-format msgid "%s: invalid time value\n" msgstr "" #: src/cwcp/cwcp.c:1498 #, c-format msgid "%s: invalid colors value\n" msgstr "" #: src/cwcp/cwcp.c:1519 src/cwgen/cwgen.c:312 #, c-format msgid "%s: getopts returned %c\n" msgstr "" #: src/cwcp/cwcp.c:1629 #, c-format msgid "" "\n" "Caught signal %d, exiting...\n" msgstr "" #: src/cwcp/cwcp.c:1652 msgid "CWCP_OPTIONS" msgstr "" #: src/cwgen/cwgen.c:178 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -g, --groups=GROUPS send GROUPS groups of chars [default %d]\n" " GROUPS values may not be lower than %d\n" " -n, --groupsize=GS make groups GS chars [default %d]\n" " GS values may not be lower than %d, or\n" " -n, --groupsize=GL-GH make groups between GL and GH chars\n" " valid GL, GH values are as for GS above\n" msgstr "" #: src/cwgen/cwgen.c:185 #, c-format msgid "" "Usage: %s [options...]\n" "\n" " -g GROUPS send GROUPS groups of chars [default %d]\n" " GROUPS values may not be lower than %d\n" " -n GS make groups GS chars [default %d]\n" " GS values may not be lower than %d, or\n" " -n GL-GH make groups between GL and GH chars\n" " valid GL, GH values are as for GS above\n" msgstr "" #: src/cwgen/cwgen.c:198 #, c-format msgid "" " -r, --repeat=COUNT repeat each group COUNT times [default %d]\n" " COUNT values may not be lower than %d\n" " -c, --charset=CHARSET select chars to send from this set\n" " [default %s]\n" " -x, --limit=LIMIT stop after LIMIT characters [default %d]\n" " a LIMIT of zero indicates no set limit\n" " -h, --help print this message\n" " -v, --version output version information and exit\n" "\n" msgstr "" #: src/cwgen/cwgen.c:206 #, c-format msgid "" " -r COUNT repeat each group COUNT times [default %d]\n" " COUNT values may not be lower than %d\n" " -c CHARSET select chars to send from this set\n" " [default %s]\n" " -x LIMIT stop after LIMIT characters [default %d]\n" " a LIMIT of zero indicates no set limit\n" " -h print this message\n" " -v output version information and exit\n" "\n" msgstr "" #: src/cwgen/cwgen.c:237 msgid "g:|groups,n:|groupsize,r:|repeat,x:|limit,c:|charset,h|help,v|version" msgstr "" #: src/cwgen/cwgen.c:247 #, c-format msgid "%s: invalid groups value\n" msgstr "" #: src/cwgen/cwgen.c:258 #, c-format msgid "%s: invalid groupsize range\n" msgstr "" #: src/cwgen/cwgen.c:266 #, c-format msgid "%s: invalid groupsize value\n" msgstr "" #: src/cwgen/cwgen.c:277 #, c-format msgid "%s: invalid repeat value\n" msgstr "" #: src/cwgen/cwgen.c:286 #, c-format msgid "%s: invalid limit value\n" msgstr "" #: src/cwgen/cwgen.c:294 #, c-format msgid "%s: charset cannot be empty\n" msgstr "" #: src/cwgen/cwgen.c:336 msgid "CWGEN_OPTIONS" msgstr "" #: src/cwutils/dictionary.c:435 msgid "Letter Groups" msgstr "" #: src/cwutils/dictionary.c:436 msgid "Number Groups" msgstr "" #: src/cwutils/dictionary.c:437 msgid "Alphanum Groups" msgstr "" #: src/cwutils/dictionary.c:438 msgid "All Char Groups" msgstr "" #: src/cwutils/dictionary.c:439 msgid "English Words" msgstr "" #: src/cwutils/dictionary.c:440 msgid "CW Words" msgstr "" #: src/cwutils/dictionary.c:441 msgid "PARIS Calibrate" msgstr "" #: src/cwutils/dictionary.c:442 msgid "EISH5 Groups" msgstr "" #: src/cwutils/dictionary.c:443 msgid "TMO0 Groups" msgstr "" #: src/cwutils/dictionary.c:444 msgid "AUV4 Groups" msgstr "" #: src/cwutils/dictionary.c:445 msgid "NDB6 Groups" msgstr "" #: src/cwutils/dictionary.c:446 msgid "KX=-RP Groups" msgstr "" #: src/cwutils/dictionary.c:447 msgid "FLYQC Groups" msgstr "" #: src/cwutils/dictionary.c:448 msgid "WJ1GZ Groups" msgstr "" #: src/cwutils/dictionary.c:449 msgid "23789 Groups" msgstr "" #: src/cwutils/dictionary.c:450 msgid ",?.;)/ Groups" msgstr "" #: src/cwutils/dictionary.c:451 msgid "\"'$(+:_ Groups" msgstr "" #: src/cwutils/copyright.h:28 msgid "" "Copyright (C) 2001-2006 Simon Baldwin\n" "\n" "This program comes with ABSOLUTELY NO WARRANTY; for details please see\n" "the file 'COPYING' supplied with the source code. This is free software,\n" "and you are welcome to redistribute it under certain conditions; again,\n" "see 'COPYING' for details. This program is released under the GNU General\n" "Public License.\n" msgstr "" #: src/xcwcp/main.cc:60 msgid "Try '" msgstr "" #: src/xcwcp/main.cc:61 msgid "--help" msgstr "" #: src/xcwcp/main.cc:61 msgid "-h" msgstr "" #: src/xcwcp/main.cc:62 msgid "' for more information." msgstr "" #: src/xcwcp/main.cc:100 src/xcwcp/main.cc:107 msgid " [default " msgstr "" #: src/xcwcp/main.cc:117 msgid "valid " msgstr "" #: src/xcwcp/main.cc:117 msgid " values are between " msgstr "" #: src/xcwcp/main.cc:118 msgid " and " msgstr "" #: src/xcwcp/main.cc:131 msgid "Usage: " msgstr "" #: src/xcwcp/main.cc:131 msgid " [options...]" msgstr "" #: src/xcwcp/main.cc:132 msgid "sound" msgstr "" #: src/xcwcp/main.cc:132 msgid "SOURCE" msgstr "" #: src/xcwcp/main.cc:133 msgid "generate sound on SOURCE" msgstr "" #: src/xcwcp/main.cc:133 msgid "'soundcard'" msgstr "" #: src/xcwcp/main.cc:135 msgid "one of 's[oundcard]', 'c[onsole]', or 'b[oth]'" msgstr "" #: src/xcwcp/main.cc:136 msgid "x" msgstr "" #: src/xcwcp/main.cc:136 msgid "sdevice" msgstr "" #: src/xcwcp/main.cc:136 msgid "SDEVICE" msgstr "" #: src/xcwcp/main.cc:138 msgid "use SDEVICE for soundcard" msgstr "" #: src/xcwcp/main.cc:139 msgid "y" msgstr "" #: src/xcwcp/main.cc:139 msgid "mdevice" msgstr "" #: src/xcwcp/main.cc:139 msgid "MDEVICE" msgstr "" #: src/xcwcp/main.cc:141 msgid "use MDEVICE for sound mixer" msgstr "" #: src/xcwcp/main.cc:143 msgid "d" msgstr "" #: src/xcwcp/main.cc:143 msgid "cdevice" msgstr "" #: src/xcwcp/main.cc:143 msgid "CDEVICE" msgstr "" #: src/xcwcp/main.cc:145 msgid "use CDEVICE for sound ioctl" msgstr "" #: src/xcwcp/main.cc:146 msgid "i" msgstr "" #: src/xcwcp/main.cc:146 msgid "inifile" msgstr "" #: src/xcwcp/main.cc:146 msgid "INIFILE" msgstr "" #: src/xcwcp/main.cc:147 msgid "load practice words from INIFILE" msgstr "" #: src/xcwcp/main.cc:151 msgid "w" msgstr "" #: src/xcwcp/main.cc:151 msgid "wpm" msgstr "" #: src/xcwcp/main.cc:151 src/xcwcp/main.cc:155 msgid "WPM" msgstr "" #: src/xcwcp/main.cc:153 msgid "set initial words per minute" msgstr "" #: src/xcwcp/main.cc:157 msgid "t" msgstr "" #: src/xcwcp/main.cc:157 msgid "hz,--tone" msgstr "" #: src/xcwcp/main.cc:157 src/xcwcp/main.cc:160 msgid "HZ" msgstr "" #: src/xcwcp/main.cc:158 msgid "set initial tone to HZ" msgstr "" #: src/xcwcp/main.cc:162 msgid "v" msgstr "" #: src/xcwcp/main.cc:162 msgid "volume" msgstr "" #: src/xcwcp/main.cc:162 src/xcwcp/main.cc:165 msgid "PERCENT" msgstr "" #: src/xcwcp/main.cc:163 msgid "set initial volume to PERCENT" msgstr "" #: src/xcwcp/main.cc:167 msgid "g" msgstr "" #: src/xcwcp/main.cc:167 msgid "gap" msgstr "" #: src/xcwcp/main.cc:167 src/xcwcp/main.cc:170 msgid "GAP" msgstr "" #: src/xcwcp/main.cc:168 msgid "set extra gap between letters" msgstr "" #: src/xcwcp/main.cc:172 msgid "h" msgstr "" #: src/xcwcp/main.cc:172 msgid "help" msgstr "" #: src/xcwcp/main.cc:173 msgid "print this message" msgstr "" #: src/xcwcp/main.cc:174 msgid "V" msgstr "" #: src/xcwcp/main.cc:174 msgid "version" msgstr "" #: src/xcwcp/main.cc:175 msgid "output version information and exit" msgstr "" #: src/xcwcp/main.cc:196 msgid "" "s:|sound,d:|cdevice,x:|sdevice,y:|mdevice,i:|inifile,t:|tone,t:|hz,v:|volume," "w:|wpm,g:|gap,h|help,V|version,#:|#" msgstr "" #: src/xcwcp/main.cc:225 msgid ": invalid sound source" msgstr "" #: src/xcwcp/main.cc:246 msgid ": error loading words list" msgstr "" #: src/xcwcp/main.cc:255 msgid ": error writing words list" msgstr "" #: src/xcwcp/main.cc:264 msgid ": invalid tone value" msgstr "" #: src/xcwcp/main.cc:273 msgid ": invalid volume value" msgstr "" #: src/xcwcp/main.cc:282 msgid ": invalid wpm value" msgstr "" #: src/xcwcp/main.cc:291 msgid ": invalid gap value" msgstr "" #: src/xcwcp/main.cc:300 msgid " version " msgstr "" #: src/xcwcp/main.cc:308 msgid ": getopts returned " msgstr "" #: src/xcwcp/main.cc:319 msgid ": no console sound: -d invalid" msgstr "" #: src/xcwcp/main.cc:324 msgid ": no soundcard sound: -x invalid" msgstr "" #: src/xcwcp/main.cc:329 msgid ": no soundcard sound: -y invalid" msgstr "" #: src/xcwcp/main.cc:341 msgid ": cannot set up soundcard sound" msgstr "" #: src/xcwcp/main.cc:358 msgid ": cannot set up console sound" msgstr "" #: src/xcwcp/main.cc:373 msgid "Caught signal " msgstr "" #: src/xcwcp/main.cc:374 msgid ", exiting..." msgstr "" #: src/xcwcp/main.cc:403 msgid "XCWCP_OPTIONS" msgstr "" #: src/xcwcp/main.cc:423 src/xcwcp/application.cc:147 #: src/xcwcp/application.cc:384 src/xcwcp/application.cc:419 #: src/xcwcp/application.cc:518 msgid "Xcwcp" msgstr "" #: src/xcwcp/application.cc:75 src/xcwcp/application.cc:78 msgid "Xcwcp version " msgstr "" #: src/xcwcp/application.cc:83 msgid "" "When this button shows , click it to begin sending or " "receiving. Only one window may send at a time.

When the button shows " ", click it to finish sending or receiving.\n" "\n" msgstr "" #: src/xcwcp/application.cc:89 msgid "" "This allows you to change what Xcwcp does. Most of the available selections " "will probably generate random CW characters of one form or another." "

The exceptions are Send Keyboard CW, which sends the characters that " "you type at the keyboard, and Receive Keyed CW, which will decode CW that " "you key in using the mouse or keyboard.

To key CW into Xcwcp for " "receive mode, use either the mouse or the keyboard. On the mouse, the left " "and right buttons form an Iambic keyer, and the middle mouse button works as " "a straight key.

On the keyboard, use the Left and Right cursor keys " "for Iambic keyer control, and the Up or Down cursor keys, or the Space, " "Enter, or Return keys, as a straight key." msgstr "" #: src/xcwcp/application.cc:103 msgid "" "This controls the CW sending speed. If you deselect adaptive receive speed, " "it also controls the CW receiving speed." msgstr "" #: src/xcwcp/application.cc:107 msgid "" "This sets the frequency of the CW tone on the system sound card or console." "

It affects both sent CW and receive sidetone." msgstr "" #: src/xcwcp/application.cc:112 msgid "" "This sets the volume of the CW tone on the system sound card. It is not " "possible to control console sound volume, so in this case, all values other " "than zero produce tones.

The volume control affects both sent CW and " "receive sidetone." msgstr "" #: src/xcwcp/application.cc:118 msgid "" "This sets the \"Farnsworth\" gap used in sending CW. This gap is an extra " "number of dit-length silences between CW characters." msgstr "" #: src/xcwcp/application.cc:122 msgid "" "This is the main display for Xcwcp. The random CW characters that Xcwcp " "generates, any keyboard input you type, and the CW that you key into Xcwcp " "all appear here.

You can clear the display contents from the File " "menu.

The status bar shows the current character being sent, any " "character received, and other general error and Xcwcp status information." msgstr "" #: src/xcwcp/application.cc:151 src/xcwcp/application.cc:152 msgid "Xcwcp Operations" msgstr "" #: src/xcwcp/application.cc:162 src/xcwcp/application.cc:164 msgid "Start/Stop" msgstr "" #: src/xcwcp/application.cc:165 msgid "Start/stop" msgstr "" #: src/xcwcp/application.cc:174 src/xcwcp/application.cc:175 msgid "Mode" msgstr "" #: src/xcwcp/application.cc:193 msgid "Speed:" msgstr "" #: src/xcwcp/application.cc:193 msgid "Speed Label" msgstr "" #: src/xcwcp/application.cc:195 src/xcwcp/application.cc:196 msgid "Speed" msgstr "" #: src/xcwcp/application.cc:197 src/xcwcp/receiver.cc:290 #: src/xcwcp/receiver.cc:309 src/xcwcp/sender.cc:144 msgid " WPM" msgstr "" #: src/xcwcp/application.cc:202 msgid "Tone:" msgstr "" #: src/xcwcp/application.cc:202 msgid "Frequency Label" msgstr "" #: src/xcwcp/application.cc:205 src/xcwcp/application.cc:206 msgid "Frequency" msgstr "" #: src/xcwcp/application.cc:207 msgid " Hz" msgstr "" #: src/xcwcp/application.cc:213 msgid "Volume:" msgstr "" #: src/xcwcp/application.cc:213 msgid "Volume Label" msgstr "" #: src/xcwcp/application.cc:215 src/xcwcp/application.cc:216 msgid "Volume" msgstr "" #: src/xcwcp/application.cc:217 msgid " %" msgstr "" #: src/xcwcp/application.cc:222 msgid "Gap:" msgstr "" #: src/xcwcp/application.cc:222 msgid "Gap Label" msgstr "" #: src/xcwcp/application.cc:224 msgid "Gap" msgstr "" #: src/xcwcp/application.cc:225 msgid "Farnsworth gap" msgstr "" #: src/xcwcp/application.cc:226 msgid " dot(s)" msgstr "" #: src/xcwcp/application.cc:233 msgid "start" msgstr "" #: src/xcwcp/application.cc:234 msgid "stop" msgstr "" #: src/xcwcp/application.cc:244 msgid "File" msgstr "" #: src/xcwcp/application.cc:245 msgid "&File" msgstr "" #: src/xcwcp/application.cc:247 msgid "&New Window" msgstr "" #: src/xcwcp/application.cc:250 msgid "Clear &Display" msgstr "" #: src/xcwcp/application.cc:252 msgid "Synchronize S&peed" msgstr "" #: src/xcwcp/application.cc:256 msgid "&Start" msgstr "" #: src/xcwcp/application.cc:259 msgid "S&top" msgstr "" #: src/xcwcp/application.cc:263 msgid "&Close" msgstr "" #: src/xcwcp/application.cc:265 msgid "&Quit" msgstr "" #: src/xcwcp/application.cc:275 msgid "Settings" msgstr "" #: src/xcwcp/application.cc:276 msgid "&Settings" msgstr "" #: src/xcwcp/application.cc:278 src/xcwcp/application.cc:279 msgid "Reverse Paddles" msgstr "" #: src/xcwcp/application.cc:281 src/xcwcp/application.cc:282 msgid "Curtis Mode B Timing" msgstr "" #: src/xcwcp/application.cc:286 src/xcwcp/application.cc:287 msgid "Adaptive CW Receive Speed" msgstr "" #: src/xcwcp/application.cc:293 msgid "&Font Settings..." msgstr "" #: src/xcwcp/application.cc:294 msgid "&Color Settings..." msgstr "" #: src/xcwcp/application.cc:297 msgid "Help" msgstr "" #: src/xcwcp/application.cc:299 msgid "&Help" msgstr "" #: src/xcwcp/application.cc:301 msgid "&About" msgstr "" #: src/xcwcp/application.cc:309 src/xcwcp/application.cc:506 msgid "Ready" msgstr "" #: src/xcwcp/application.cc:320 msgid "PollTimer" msgstr "" #: src/xcwcp/application.cc:385 msgid "Busy - are you sure?" msgstr "" #: src/xcwcp/application.cc:386 msgid "&Exit" msgstr "" #: src/xcwcp/application.cc:386 src/xcwcp/application.cc:421 msgid "&Cancel" msgstr "" #: src/xcwcp/application.cc:420 msgid "Another Xcwcp window is busy." msgstr "" #: src/xcwcp/application.cc:421 msgid "&Stop Other" msgstr "" #: src/xcwcp/display.cc:80 msgid "Display" msgstr "" #: src/xcwcp/receiver.cc:267 msgid "Badly formed CW element" msgstr "" #: src/xcwcp/receiver.cc:268 msgid "Receive buffer overrun" msgstr "" #: src/xcwcp/receiver.cc:289 msgid "Received '" msgstr "" #: src/xcwcp/receiver.cc:290 src/xcwcp/sender.cc:144 msgid "' at " msgstr "" #: src/xcwcp/receiver.cc:308 msgid "Unknown character received at " msgstr "" #: src/xcwcp/sender.cc:143 msgid "Sending '" msgstr "" unixcw-3.4.2/Makefile.am0000644000175000017500000000021512536117733014721 0ustar acerionacerionSUBDIRS=src EXTRA_DIST = \ icon_unixcw.svg icon_unixcw.xpm \ unixcw-2.3.spec unixcw-3.4.2.lsm \ po/UnixCW.po \ THANKS HISTORY \ debian unixcw-3.4.2/ltmain.sh0000644000175000017500000105202211760446200014501 0ustar acerionacerion # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 unixcw-3.4.2/unixcw-3.4.2.lsm0000644000175000017500000000242612536121164015360 0ustar acerionacerionBegin4 Title: UnixCW Version: 3.4.2 Entered-date: 2012-01-08 Description: UnixCW is a package of UNIX-based programs that fit together to form a CW tutor program similar to CP222 by VU2ZAP. The core of the package is libcw, a general-purpose CW functions library. There are four programs in the package built around this library: a simple Morse code sounding program; a small random character generator; a curses-based Morse code tutor; and a Qt4-based (X Window) Morse code tutor. The Qt4-based tutor program offers send practice as well as receive. The package includes complete man pages. Keywords: CW Morse amateur radio ham tutor Author: simon_baldwin@yahoo.com (Simon Baldwin, G0FRD) acerion@wp.pl (Kamil Ignacak) Maintained-by: acerion@wp.pl (Kamil Ignacak) Primary-site: http://unixcw.sourceforge.net Alternate-site: none Original-site: none Platforms: unixcw/libcw recommends libasound2 and PulseAudio library; unixcw/cwcp requires Ncurses library; unixcw/xcwcp requires QT4 library; GNU/Linux; may work on OpenBSD, FreeBSD; Copying-policy: GPL 2.0 End unixcw-3.4.2/test-driver0000755000175000017500000001027712256065661015075 0ustar acerionacerion#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixcw-3.4.2/config.guess0000755000175000017500000012355012352133042015200 0ustar acerionacerion#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 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. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; 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". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -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 # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $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 [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[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 [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; 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*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$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 fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: unixcw-3.4.2/src/0000755000175000017500000000000012540354303013445 5ustar acerionacerionunixcw-3.4.2/src/libcw/0000755000175000017500000000000012540354302014544 5ustar acerionacerionunixcw-3.4.2/src/libcw/libcw.3.m40000644000175000017500000001416212536122012016247 0ustar acerionacerion.\" .\" UnixCW CW Tutor Package - LIBCW .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH LIBCW 3 "CW Tutor Package" "libcw ver. 6.4.1" \" -*- nroff -*- .SH NAME .\" libcw \- general purpose Morse code functions library .\" .\" .\" .SH SYNOPSIS .\" .nf .B #include .sp .fi include(signatures) .PP .\" .\" .\" .SS DESCRIPTION .\" .B libcw is a general purpose CW (Morse code) functions library. It contains routines for converting characters into Morse code representations and back again, for sending Morse code characters, and for receiving characters. It also contains routines to emulate an Iambic Morse keyer, and a straight key. .PP The library can be included in any program that wishes to make use of these features. It forms the heart of three Morse code tutor applications that accompany the package in which it is distributed. .PP See the \fBcw\fP(7) man page for information on Morse code timings, and the dot and dash representations for the various Morse characters. .\" .\" .\" .SS TONE QUEUE .\" .B libcw contains an inbuilt tone queue. The queue is emptied by background processing, using SIGALRM calls and itimers, so a caller program can continue with other tasks while the library sends tones and keys any external device. .PP As well as being used by the library functions that sound Morse code characters and provide a keyer sidetone, the primitive tone queue functions are publicly available to caller programs. .PP .\" .\" .\" .SS CONTROLLING AN EXTERNAL DEVICE .\" .B libcw may be passed the address of a function that controls external keying. This function is called each time the library changes the keying state, either as a result of sending a Morse character or representation, or as a result of an iambic keyer or straight key state change. The argument passed is a single integer, TRUE for key-down, and FALSE for key-up. .PP .B libcw calls the external keying function only when the keying state changes. A call is likely each time a tone is taken off the tone queue. .PP .\" .\" .\" .SS SENDING CW CHARACTERS AND STRINGS .\" .B libcw offers several functions that send individual characters and character strings as Morse code. It also offers functions that allow specialized 'representations' to be sent. A 'representation' is an ASCII string that consists of only the characters '.' and '-'. .PP Characters and strings are converted into representations, and then the correct tones for the dots and dashes in these representations are queued on the tone queue, for action by the background queue emptying process. .PP .\" .\" .\" .SS RECEIVING CW CHARACTERS AND REPRESENTATIONS .\" .B libcw contains functions to allow it to receive Morse code. To receive, the library must be told when a tone start is detected, and when a tone end is detected. It then determines whether the tone was a dot or a dash depending on the timing difference between the two. After the required silence gap has passed, the library may be queried to see what the received representation or character was. .PP Errors in receiving may be detected by means of the flags passed back on receive character functions. .PP .\" .\" .\" .SS IAMBIC KEYER .\" .B libcw offers functions to simulate an Iambic Morse keyer. The caller program needs to tell the library of paddle state changes. Iambic keyer functions are mutually exclusive with character send and straight key functions. .PP .\" .\" .\" .SS STRAIGHT KEY .\" .B libcw offers simple functions to allow effective pass-through of straight key information. The caller program needs to tell the library of key state changes. Straight key functions are mutually exclusive with character send and iambic keyer functions. .PP .\" .\" .\" .SS RETURN CODES .\" Some of the library's function return a return code of type int. The return code has two values, as defined in libcw.h: \fBCW_SUCCESS\fP or \fBCW_FAILURE\fP. The two symbolic constants are guaranteed to be identical to boolean \fBtrue\fP and \fBfalse\fP. .PP .\" .\" .\" .SS FUNCTIONS The following list describes the functions available to a \fBlibcw\fP caller: include(functions) .PP .\" .\" .\" .SH NOTES .\" Despite the fact that this manual page constantly and consistently refers to Morse code elements as dots and dashes, DO NOT think in these terms when trying to learn Morse code. Always think of them as 'dit's and 'dah's. .PP .B libcw uses system itimers for its internal timing. On most UNIX flavours, itimers are not guaranteed to signal a program exactly at the specified time, and they generally offer a resolution only as good as the normal system 'clock tick' resolution. An itimer SIGALRM usually falls on a system clock tick, making it accurate to no better than 10mS on a typical 100Hz kernel. .PP The effect of this is that an itimer period is generally either exactly as specified, or, more likely, slightly longer. At higher WPM settings, the cumulative effect of this affects timing accuracy, because at higher speeds, there are fewer 10mS clock ticks in a dot period. For example, at 12 WPM, the dot length is 100mS, enough to contain five kernel clock ticks; at 60 WPM, the dot length is 20mS, or just two kernel clock ticks. So at higher speeds, the effect of itimer resolutions becomes more pronounced. .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBcw\fP(7,LOCAL), \fBcw\fP(1,LOCAL), \fBcwgen\fP(1,LOCAL), \fBcwcp\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/libcw/libdoc.awk0000644000175000017500000001551012451007257016513 0ustar acerionacerion#!/bin/awk -f # # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # # Simple AWK script to produce documentation suitable for processing into # man pages from a C source file. # Feed output of this script to libsigs.awk and libfuncs.awk to get # file with function signatures, and file with function # signatures+documentation respectively. # # Initialize the states, tags, and indexes BEGIN { IDLE = 0 DOCUMENTATION = 1 FUNCTION_SPECIFICATION = 2 FUNCTION_BODY = 3 state = IDLE DOCUMENTATION_TAG = "D" FUNCTION_TAG = "F" END_TAG = "E" # line counter, starting from zero for every # block output_line = 0 } function handle_global_space() { do { # print "GLO" $0 > "/dev/stderr" if ($0 ~ /^static /) { # potentially a static function declaration start = match($0, /[a-zA-Z0-9_\* ]+ \**([a-zA-Z0-9_]+)\(/); if (RSTART > 0) { len = RLENGTH name = substr($0, start, len); static_functions[name] = name; # print name > "/dev/stderr" } } } while ($0 !~ /^\/\*\*/ && getline) # print "GLO LEAVING" > "/dev/stderr" # Caught beginning of documentation block (or end of file). # # Beware, line starting with "/**" may be function's top level # comment (documentation block), but it may also be a file's # Doxygen top level comment. output_line = 0; } # Erase documentation lines from output[] function delete_documentation(line) { while (line >= 0) { output[line--] = ""; } } function handle_function_specification() { # catch function's name start = match($0, /[a-zA-Z0-9_\* ]+ \**([a-zA-Z0-9_]+)\(/); if (RSTART > 0) { len = RLENGTH name = substr($0, start, len); # print name > "/dev/stderr" } else { # This is not a function specification. delete_documentation(output_line - 1) output_line = 0 while ($0 == "" && getline) { # read and discard } return 0 } if (static_functions[name]) { # specification of static function; # no point in processing it delete_documentation(output_line - 1) output_line = 0 while ($0 !~ /\)$/ && getline) { # read and discard } return 0 } else if (name ~ /_internal\(/) { # Internal function, don't allow passing it # to documentation of public API. delete_documentation(output_line - 1) output_line = 0 while ($0 !~ /\)$/ && getline) { # read and discard } return 0 } else if (name ~ /test_/) { # Internal function, don't allow passing it # to documentation of public API. delete_documentation(output_line - 1) output_line = 0 while ($0 !~ /\)$/ && getline) { # read and discard } return 0 } else if (name ~ /main\(/) { # Internal function, don't allow passing it # to documentation of public API. delete_documentation(output_line - 1) output_line = 0 while ($0 !~ /\)$/ && getline) { # read and discard } return 0 } else { # read and save function's specification # (possibly multi-line) do { output[output_line++] = FUNCTION_TAG" "$0 } while ($0 !~ /\)$/ && getline) return 1 } } function handle_function_documentation() { while ($0 !~ /^\*\/$/) { # print "DOC" $0 > "/dev/stderr" # Some documentation texts still have " * " at the # beginning sub (/^ \* /," *") sub(/^ \* */,"") # Handle Doxygen tags: # \brief at the very beginning of top-level function comment, # \param in function's parameters specification, # \return in function's return values specification. sub(/^ *\\brief /, "Brief: ") sub(/^ *\\param /, "Parameter: ") sub(/^ *\\return /, " Returns: ") # Handle my "testedin::" tag if ($0 ~ /^ *testedin::/) { getline continue } # Handle Doxygen tag: # \p in the body of top-level function comment start = match($0, /\\p ([0-9a-zA-Z_]+)/); if (RSTART > 0) { len = RLENGTH # 3 - strlen(\\p ) param_name = substr($0, start + 3, len - 3); param_name = "\\fB"param_name"\\fP" gsub(/(\\p [0-9a-zA-Z_]+)/, param_name, $0) # print param_name > "/dev/stderr" } output[output_line++] = DOCUMENTATION_TAG" "$0 getline } # print "DOC LEAVING" > "/dev/stderr" } function handle_function_body() { # Ignore function body lines, but watch for a bracket that # closes a function while ($0 !~ /^\}/) { # read and discard lines of function body getline } } function print_documentation_and_specification() { # Print out the specification and documentation lines we have found; # reorder documentation and specification so that documentation # lines come after the function signatures. for (i = 0; i < output_line; i++) { if (index(output[i], DOCUMENTATION_TAG) == 0) { print output[i] } } for (i = 0; i < output_line; i++) { if (index(output[i], DOCUMENTATION_TAG) != 0) { print output[i] } } return i } # Ignore all blank lines outside of comments and function bodies /^[[:space:]]*$/ { if (state == IDLE) { next } } # Handle every other line in the file according to the state; # This is the main 'loop' of the script. { # Process static function declarations and change # state on '^/**' if (state == IDLE) { handle_global_space() state = DOCUMENTATION next } # Process function documentation blocks, stopping on ' */'. if (state == DOCUMENTATION) { handle_function_documentation() state = FUNCTION_SPECIFICATION next } # Process function specification line(s), stopping on ')$'. if (state == FUNCTION_SPECIFICATION) { if (handle_function_specification() == 1) { # print "GOING FUN BODY" > "/dev/stderr" state = FUNCTION_BODY next } else { # print "GOING IDLE" > "/dev/stderr" state = IDLE } } # Process function body, stopping on '^}' if (state == FUNCTION_BODY) { handle_function_body() state = IDLE } # Print function's documentation and specification, # i.e. the data accumulated in above functions print_documentation_and_specification() print END_TAG # prepare for next 'documentation + specification' section state = IDLE output_line = 0 } # Simply dump anything we have so far on end of file. END { i = print_documentation_and_specification() if (i > 0) { print END_TAG } } unixcw-3.4.2/src/libcw/libcw_rec.c0000644000175000017500000024363712475674120016672 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_rec.c \brief Receiver. Receive a series of marks and spaces. Interpret them as characters. There are two ways of feeding marks and spaces to receiver. First of them is to notify receiver about "begin of mark" and "end of mark" events. Receiver then tries to figure out how long a mark or space is, what type of mark (dot/dash) or space (inter-mark, inter-character, inter-word) it is, and when a full character has been received. This is done with cw_start_receive_tone() and cw_end_receive_tone() functions. The second method is to inform receiver not about start and stop of marks (dots/dashes), but about full marks themselves. This is done with cw_receive_buffer_dot() and cw_receive_buffer_dash() - two functions that are one level of abstraction above functions from first method. Currently there is only one method of passing received data (characters) from receiver to client code. This is done by client code cyclically polling the receiver with cw_receive_representation() or with cw_receive_character() which is built on top of cw_receive_representation(). Duration (length) of marks, spaces and few other things is in microseconds [us], unless specified otherwise. */ #include "config.h" #include #include #include #include #include /* sqrt(), cosf() */ #if (defined(__unix__) || defined(unix)) && !defined(USG) # include #endif #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "libcw_rec.h" #include "libcw_data.h" #include "libcw_utils.h" #include "libcw_debug.h" #include "libcw_test.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* See also enum of int values, declared in libcw_rec.h. */ static const char *cw_receiver_states[] = { "RS_IDLE", "RS_MARK", "RS_SPACE", "RS_EOC_GAP", "RS_EOW_GAP", "RS_EOC_GAP_ERR", "RS_EOW_GAP_ERR" }; /* Receive and identify a mark. */ static int cw_rec_identify_mark_internal(cw_rec_t *rec, int mark_len, char *representation); /* Functions handling receiver statistics. */ static void cw_rec_update_stats_internal(cw_rec_t *rec, stat_type_t type, int len); static double cw_rec_get_stats_internal(cw_rec_t *rec, stat_type_t type); /* Functions handling averaging data structure in adaptive receiving mode. */ static void cw_rec_update_average_internal(cw_rec_averaging_t *avg, int mark_len); static void cw_rec_update_averages_internal(cw_rec_t *rec, int mark_len, char mark); static void cw_rec_reset_average_internal(cw_rec_averaging_t *avg, int initial); static void cw_rec_poll_representation_eoc_internal(cw_rec_t *rec, int space_len, char *representation, bool *is_end_of_word, bool *is_error); static void cw_rec_poll_representation_eow_internal(cw_rec_t *rec, char *representation, bool *is_end_of_word, bool *is_error); /** \brief Allocate and initialize new receiver variable Before returning, the function calls cw_rec_sync_parameters_internal() for the receiver. Function may return NULL on malloc() failure. testedin::test_cw_rec_identify_mark_internal() \return freshly allocated, initialized and synchronized receiver on success \return NULL pointer on failure */ cw_rec_t *cw_rec_new_internal(void) { cw_rec_t *rec = (cw_rec_t *) malloc(sizeof (cw_rec_t)); if (!rec) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: malloc()"); return (cw_rec_t *) NULL; } rec->state = RS_IDLE; rec->speed = CW_SPEED_INITIAL; rec->tolerance = CW_TOLERANCE_INITIAL; rec->gap = CW_GAP_INITIAL; rec->is_adaptive_receive_mode = CW_REC_ADAPTIVE_MODE_INITIAL; rec->noise_spike_threshold = CW_REC_NOISE_THRESHOLD_INITIAL; /* TODO: this variable is not set in cw_rec_reset_receive_parameters_internal(). Why is it separated from the four main variables? Is it because it is a derivative of speed? But speed is a derivative of this variable in adaptive speed mode. */ rec->adaptive_speed_threshold = CW_REC_SPEED_THRESHOLD_INITIAL; rec->mark_start.tv_sec = 0; rec->mark_start.tv_usec = 0; rec->mark_end.tv_sec = 0; rec->mark_end.tv_usec = 0; rec->representation[0] = '\0'; rec->representation_ind = 0; rec->dot_len_ideal = 0; rec->dot_len_min = 0; rec->dot_len_max = 0; rec->dash_len_ideal = 0; rec->dash_len_min = 0; rec->dash_len_max = 0; rec->eom_len_ideal = 0; rec->eom_len_min = 0; rec->eom_len_max = 0; rec->eoc_len_ideal = 0; rec->eoc_len_min = 0; rec->eoc_len_max = 0; rec->additional_delay = 0; rec->adjustment_delay = 0; rec->parameters_in_sync = false; rec->statistics[0].type = 0; rec->statistics[0].delta = 0; rec->statistics_ind = 0; rec->dot_averaging.cursor = 0; rec->dot_averaging.sum = 0; rec->dot_averaging.average = 0; rec->dash_averaging.cursor = 0; rec->dash_averaging.sum = 0; rec->dash_averaging.average = 0; cw_rec_sync_parameters_internal(rec); return rec; } /** \brief Delete a generator Deallocate all memory and free all resources associated with given receiver. \parma rec - pointer to receiver */ void cw_rec_delete_internal(cw_rec_t **rec) { cw_assert (rec, "\"rec\" argument can't be NULL\n"); if (!*rec) { return; } free(*rec); *rec = (cw_rec_t *) NULL; return; } /** \brief Set receiving speed of receiver See documentation of cw_set_send_speed() for more information. See libcw.h/CW_SPEED_{INITIAL|MIN|MAX} for initial/minimal/maximal value of receive speed. errno is set to EINVAL if \p new_value is out of range. errno is set to EPERM if adaptive receive speed tracking is enabled. Notice that internally the speed is saved as float, and its value may be internally a non-integer. testedin::test_cw_rec_identify_mark_internal() \param rec - receiver \param new_value - new value of receive speed to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_rec_set_speed_internal(cw_rec_t *rec, int new_value) { if (rec->is_adaptive_receive_mode) { errno = EPERM; return CW_FAILURE; } if (new_value < CW_SPEED_MIN || new_value > CW_SPEED_MAX) { errno = EINVAL; return CW_FAILURE; } /* TODO: verify this comparison. */ float diff = abs((1.0 * new_value) - rec->speed); if (diff >= 0.5) { rec->speed = new_value; /* Changes of receive speed require resynchronization. */ rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); } return CW_SUCCESS; } float cw_rec_get_speed_internal(cw_rec_t *rec) { return rec->speed; } /** \brief Set tolerance for receiver See libcw.h/CW_TOLERANCE_{INITIAL|MIN|MAX} for initial/minimal/maximal value of tolerance. errno is set to EINVAL if \p new_value is out of range. testedin::test_parameter_ranges() \param new_value - new value of tolerance to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_rec_set_tolerance_internal(cw_rec_t *rec, int new_value) { if (new_value < CW_TOLERANCE_MIN || new_value > CW_TOLERANCE_MAX) { errno = EINVAL; return CW_FAILURE; } if (new_value != rec->tolerance) { rec->tolerance = new_value; /* Changes of tolerance require resynchronization. */ rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); } return CW_SUCCESS; } /** \brief Get tolerance from receiver \param rec - receiver \return current value of receiver's tolerance */ int cw_rec_get_tolerance_internal(cw_rec_t *rec) { return rec->tolerance; } /** \brief Get timing parameters for receiving, and adaptive threshold Return the low-level timing parameters calculated from the speed, gap, tolerance, and weighting set. Parameter values are returned in microseconds. Use NULL for the pointer argument to any parameter value not required. TODO: reconsider order of these function arguments. \param *rec \param dot_len_ideal \param dash_len_ideal \param dot_len_min \param dot_len_max \param dash_len_min \param dash_len_max \param eom_len_min \param eom_len_max \param eom_len_ideal \param eoc_len_min \param eoc_len_max \param eoc_len_ideal */ void cw_rec_get_parameters_internal(cw_rec_t *rec, int *dot_len_ideal, int *dash_len_ideal, int *dot_len_min, int *dot_len_max, int *dash_len_min, int *dash_len_max, int *eom_len_min, int *eom_len_max, int *eom_len_ideal, int *eoc_len_min, int *eoc_len_max, int *eoc_len_ideal, int *adaptive_threshold) { cw_rec_sync_parameters_internal(rec); /* Dot mark. */ if (dot_len_min) *dot_len_min = rec->dot_len_min; if (dot_len_max) *dot_len_max = rec->dot_len_max; if (dot_len_ideal) *dot_len_ideal = rec->dot_len_ideal; /* Dash mark. */ if (dash_len_min) *dash_len_min = rec->dash_len_min; if (dash_len_max) *dash_len_max = rec->dash_len_max; if (dash_len_ideal) *dash_len_ideal = rec->dash_len_ideal; /* End-of-mark. */ if (eom_len_min) *eom_len_min = rec->eom_len_min; if (eom_len_max) *eom_len_max = rec->eom_len_max; if (eom_len_ideal) *eom_len_ideal = rec->eom_len_ideal; /* End-of-character. */ if (eoc_len_min) *eoc_len_min = rec->eoc_len_min; if (eoc_len_max) *eoc_len_max = rec->eoc_len_max; if (eoc_len_ideal) *eoc_len_ideal = rec->eoc_len_ideal; if (adaptive_threshold) *adaptive_threshold = rec->adaptive_speed_threshold; return; } /** \brief Set noise spike threshold for receiver Set the period shorter than which, on receive, received marks are ignored. This allows the "receive mark" functions to apply noise canceling for very short apparent marks. For useful results the value should never exceed the dot length of a dot at maximum speed: 20000 microseconds (the dot length at 60WPM). Setting a noise threshold of zero turns off receive mark noise canceling. The default noise spike threshold is 10000 microseconds. errno is set to EINVAL if \p new_value is out of range. \param new_value - new value of noise spike threshold to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_rec_set_noise_spike_threshold_internal(cw_rec_t *rec, int new_value) { if (new_value < 0) { errno = EINVAL; return CW_FAILURE; } rec->noise_spike_threshold = new_value; return CW_SUCCESS; } /** \brief Get noise spike threshold from receiver See documentation of cw_set_noise_spike_threshold() for more information \param rec - receiver \return current value of receiver's threshold */ int cw_rec_get_noise_spike_threshold_internal(cw_rec_t *rec) { return rec->noise_spike_threshold; } /* TODO: this function probably should have its old-style version in libcw.h as well. */ int cw_rec_set_gap_internal(cw_rec_t *rec, int new_value) { if (new_value < CW_GAP_MIN || new_value > CW_GAP_MAX) { errno = EINVAL; return CW_FAILURE; } if (new_value != rec->gap) { rec->gap = new_value; /* Changes of gap require resynchronization. */ rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); } return CW_SUCCESS; } /* Functions handling average lengths of dot and dashes in adaptive receiving mode. */ /** \brief Reset averaging data structure Reset averaging data structure to initial state. \param avg - averaging data structure (for dot or for dash) \param initial - initial value to be put in table of averaging data structure */ void cw_rec_reset_average_internal(cw_rec_averaging_t *avg, int initial) { for (int i = 0; i < CW_REC_AVERAGING_ARRAY_LENGTH; i++) { avg->buffer[i] = initial; } avg->sum = initial * CW_REC_AVERAGING_ARRAY_LENGTH; avg->cursor = 0; return; } /** \brief Update value of average "length of mark" Update table of values used to calculate averaged "length of mark". The averaged length of a mark is calculated with moving average function. The new \p mark_len is added to \p avg, and the oldest is discarded. New averaged sum is calculated using updated data. \param avg - averaging data structure (for dot or for dash) \param mark_len - new "length of mark" value to add to averaging data */ void cw_rec_update_average_internal(cw_rec_averaging_t *avg, int mark_len) { /* Oldest mark length goes out, new goes in. */ avg->sum -= avg->buffer[avg->cursor]; avg->sum += mark_len; avg->average = avg->sum / CW_REC_AVERAGING_ARRAY_LENGTH; avg->buffer[avg->cursor++] = mark_len; avg->cursor %= CW_REC_AVERAGING_ARRAY_LENGTH; return; } /* Functions handling receiver statistics. */ /** \brief Add a mark or space length to statistics Add a mark or space length \p len (type of mark or space is indicated by \p type) to receiver's circular statistics buffer. The buffer stores only the delta from the ideal value; the ideal is inferred from the type \p type passed in. \p type may be: CW_REC_STAT_DOT or CW_REC_STAT_DASH or CW_REC_STAT_IMARK_SPACE or CW_REC_STAT_ICHAR_SPACE \param rec - receiver \param type - mark type \param len - length of a mark or space */ void cw_rec_update_stats_internal(cw_rec_t *rec, stat_type_t type, int len) { /* Synchronize parameters if required. */ cw_rec_sync_parameters_internal(rec); /* Calculate delta as difference between given length (len) and the ideal length value. */ int delta = len - ((type == CW_REC_STAT_DOT) ? rec->dot_len_ideal : (type == CW_REC_STAT_DASH) ? rec->dash_len_ideal : (type == CW_REC_STAT_IMARK_SPACE) ? rec->eom_len_ideal : (type == CW_REC_STAT_ICHAR_SPACE) ? rec->eoc_len_ideal : len); /* Add this statistic to the buffer. */ rec->statistics[rec->statistics_ind].type = type; rec->statistics[rec->statistics_ind].delta = delta; rec->statistics_ind++; rec->statistics_ind %= CW_REC_STATISTICS_CAPACITY; return; } /** \brief Calculate and return length statistics for given type of mark or space \p type may be: CW_REC_STAT_DOT or CW_REC_STAT_DASH or CW_REC_STAT_IMARK_SPACE or CW_REC_STAT_ICHAR_SPACE \param rec - receiver \param type - type of mark or space for which to return statistics \return 0.0 if no record of given type were found \return statistics of length otherwise */ double cw_rec_get_stats_internal(cw_rec_t *rec, stat_type_t type) { /* Sum and count values for marks/spaces matching the given type. A cleared buffer always begins refilling at zeroth mark, so to optimize we can stop on the first unoccupied slot in the circular buffer. */ double sum_of_squares = 0.0; int count = 0; for (int i = 0; i < CW_REC_STATISTICS_CAPACITY; i++) { if (rec->statistics[i].type == type) { int delta = rec->statistics[i].delta; sum_of_squares += (double) delta * (double) delta; count++; } else if (rec->statistics[i].type == CW_REC_STAT_NONE) { break; } } /* Return the standard deviation, or zero if no matching mark. */ return count > 0 ? sqrt (sum_of_squares / (double) count) : 0.0; } /** \brief Calculate and return receiver's timing statistics These statistics may be used to obtain a measure of the accuracy of received CW. The values \p dot_sd and \p dash_sd contain the standard deviation of dot and dash lengths from the ideal values, and \p element_end_sd and \p character_end_sd the deviations for inter element and inter character spacing. Statistics are held for all timings in a 256 element circular buffer. If any statistic cannot be calculated, because no records for it exist, the returned value is 0.0. Use NULL for the pointer argument to any statistic not required. \param rec - receiver \param dot_sd \param dash_sd \param element_end_sd \param character_end_sd */ void cw_rec_get_statistics_internal(cw_rec_t *rec, double *dot_sd, double *dash_sd, double *element_end_sd, double *character_end_sd) { if (dot_sd) { *dot_sd = cw_rec_get_stats_internal(rec, CW_REC_STAT_DOT); } if (dash_sd) { *dash_sd = cw_rec_get_stats_internal(rec, CW_REC_STAT_DASH); } if (element_end_sd) { *element_end_sd = cw_rec_get_stats_internal(rec, CW_REC_STAT_IMARK_SPACE); } if (character_end_sd) { *character_end_sd = cw_rec_get_stats_internal(rec, CW_REC_STAT_ICHAR_SPACE); } return; } /** \brief Clear the receive statistics buffer Clear the receive statistics buffer by removing all records from it and returning it to its initial default state. */ void cw_rec_reset_receive_statistics_internal(cw_rec_t *rec) { for (int i = 0; i < CW_REC_STATISTICS_CAPACITY; i++) { rec->statistics[i].type = CW_REC_STAT_NONE; rec->statistics[i].delta = 0; } rec->statistics_ind = 0; return; } /* ******************************************************************** */ /* Section:Receiving */ /* ******************************************************************** */ /* * The CW receive functions implement the following state graph: * * +-----------<------- RS_EOW_GAP_ERR ------------<--------------+ * |(clear) ^ | * | (pull() + | | * | space len > eoc len)| | * | | | * +-----------<-------- RS_EOC_GAP_ERR <---------------+ | * |(clear) ^ | | | * | | +---------------------+ |(error, * | | (pull() + |space len > eoc len) * | | space len = eoc len) | * v (error,| | * | space len = eoc len)| +------------->-----------------+ * | | | * +-----------<------------+ | | * | | | | * | (is noise)| | | * | | | | * v (begin mark) | | | (end mark,noise) * --> RS_IDLE ------->----------- RS_MARK ------------>----------> RS_SPACE <------------- + * v ^ ^ v v v ^ | | * | | | (begin mark) | | | | | | * | | (pull() + +-------------<------------+ | | | +---------------+ * | | space len = eoc len) | | | (not ready, * | | +-----<------------+ (pull() + | | | buffer dot, * | | | | space len = eoc len) | | | buffer dash) * | | +-----------> RS_EOC_GAP <-------------<--------------+ | | * | | | | | | * | |(clear) | | | | * | +-----------<---------+ | | | * | | | | | * | | (pull() + | | | * | | space len > eoc len)| | | * | | | (pull() + | | * | |(clear) v space len > eoc len) | | * | +-----------<------ RS_EOW_GAP <-------------<----------------+ | * | | * | | * | (buffer dot, | * | buffer dash) | * +------------------------------->----------------------------------+ */ #define CW_REC_SET_STATE(m_rec, m_new_state, m_debug_object) \ { \ cw_debug_msg ((m_debug_object), \ CW_DEBUG_RECEIVE_STATES, CW_DEBUG_INFO, \ "libcw: receive state %s -> %s", \ cw_receiver_states[m_rec->state], cw_receiver_states[m_new_state]); \ m_rec->state = m_new_state; \ } /** \brief Enable or disable receiver's "adaptive receiving" mode Set the mode of a receiver (\p rec) to fixed or adaptive receiving mode. In adaptive receiving mode the receiver tracks the speed of the received Morse code by adapting to the input stream. testedin::test_cw_rec_identify_mark_internal() \param rec - receiver for which to set the mode \param adaptive - value of receiver's "adaptive mode" to be set */ void cw_rec_set_adaptive_mode_internal(cw_rec_t *rec, bool adaptive) { /* Look for change of adaptive receive state. */ if (rec->is_adaptive_receive_mode != adaptive) { rec->is_adaptive_receive_mode = adaptive; /* Changing the flag forces a change in low-level parameters. */ rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); /* If we have just switched to adaptive mode, (re-)initialize the averages array to the current dot/dash lengths, so that initial averages match the current speed. */ if (rec->is_adaptive_receive_mode) { cw_rec_reset_average_internal(&rec->dot_averaging, rec->dot_len_ideal); cw_rec_reset_average_internal(&rec->dash_averaging, rec->dash_len_ideal); } } return; } /** \brief Get adaptive receive speed tracking flag The function returns state of "adaptive receive enabled" flag. See documentation of cw_enable_adaptive_receive() for more information \return true if adaptive speed tracking is enabled \return false otherwise */ bool cw_rec_get_adaptive_mode_internal(cw_rec_t *rec) { return rec->is_adaptive_receive_mode; } /* For top-level comment see cw_start_receive_tone(). */ int cw_rec_mark_begin_internal(cw_rec_t *rec, const struct timeval *timestamp) { /* If the receive state is not idle or inter-mark-space, this is a state error. A start of mark can only happen while we are idle, or in inter-mark-space of a current character. */ if (rec->state != RS_IDLE && rec->state != RS_SPACE) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: receive state not idle and not inter-mark-space: %s", cw_receiver_states[rec->state]); errno = ERANGE; return CW_FAILURE; } /* Validate and save the timestamp, or get one and then save it. This is a beginning of mark. */ if (!cw_timestamp_validate_internal(&(rec->mark_start), timestamp)) { return CW_FAILURE; } if (rec->state == RS_SPACE) { /* Measure inter-mark space (just for statistics). rec->mark_end is timestamp of end of previous mark. It is set at going to the inter-mark-space state by cw_end_receive tone() or by cw_rec_add_mark_internal(). */ int space_len = cw_timestamp_compare_internal(&(rec->mark_end), &(rec->mark_start)); cw_rec_update_stats_internal(rec, CW_REC_STAT_IMARK_SPACE, space_len); /* TODO: this may have been a very long space. Should we accept a very long space inside a character? */ } /* Set state to indicate we are inside a mark. We don't know yet if it will be recognized as valid mark (it may be shorter than a threshold). */ CW_REC_SET_STATE (rec, RS_MARK, (&cw_debug_object)); return CW_SUCCESS; } /* For top-level comment see cw_end_receive_tone(). */ int cw_rec_mark_end_internal(cw_rec_t *rec, const struct timeval *timestamp) { /* The receive state is expected to be inside of a mark. */ if (rec->state != RS_MARK) { errno = ERANGE; return CW_FAILURE; } /* Take a safe copy of the current end timestamp, in case we need to put it back if we decide this mark is really just noise. */ struct timeval saved_end_timestamp = rec->mark_end; /* Save the timestamp passed in, or get one. */ if (!cw_timestamp_validate_internal(&(rec->mark_end), timestamp)) { return CW_FAILURE; } /* Compare the timestamps to determine the length of the mark. */ int mark_len = cw_timestamp_compare_internal(&(rec->mark_start), &(rec->mark_end)); #if 0 fprintf(stderr, "------- %d.%d - %d.%d = %d (%d)\n", rec->mark_end.tv_sec, rec->mark_end.tv_usec, rec->mark_start.tv_sec, rec->mark_start.tv_usec, mark_len, cw_timestamp_compare_internal(&(rec->mark_start), &(rec->mark_end))); #endif if (rec->noise_spike_threshold > 0 && mark_len <= rec->noise_spike_threshold) { /* This pair of start()/stop() calls is just a noise, ignore it. Revert to state of receiver as it was before complementary cw_rec_mark_begin_internal(). After call to mark_begin() the state was changed to mark, but what state it was before call to start()? Check position in representation buffer (how many marks are in the buffer) to see in which state the receiver was *before* mark_begin() function call, and restore this state. */ CW_REC_SET_STATE (rec, (rec->representation_ind == 0 ? RS_IDLE : RS_SPACE), (&cw_debug_object)); /* Put the end-of-mark timestamp back to how it was when we came in to the routine. */ rec->mark_end = saved_end_timestamp; cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw: '%d [us]' mark identified as spike noise (threshold = '%d [us]')", mark_len, rec->noise_spike_threshold); errno = EAGAIN; return CW_FAILURE; } /* This was not a noise. At this point, we have to make a decision about the mark just received. We'll use a routine that compares length of a mark against pre-calculated dot and dash length ranges to tell us what it thinks this mark is (dot or dash). If the routing can't decide, it will hand us back an error which we return to the caller. Otherwise, it returns a mark (dot or dash), for us to put in representation buffer. */ char mark; int status = cw_rec_identify_mark_internal(rec, mark_len, &mark); if (!status) { return CW_FAILURE; } if (rec->is_adaptive_receive_mode) { /* Update the averaging buffers so that the adaptive tracking of received Morse speed stays up to date. */ cw_rec_update_averages_internal(rec, mark_len, mark); } else { /* Do nothing. Don't fiddle about trying to track for fixed speed receive. */ } /* Update dot and dash length statistics. It may seem odd to do this after calling cw_rec_update_averages_internal(), rather than before, as this function changes the ideal values we're measuring against. But if we're on a speed change slope, the adaptive tracking smoothing will cause the ideals to lag the observed speeds. So by doing this here, we can at least ameliorate this effect, if not eliminate it. */ if (mark == CW_DOT_REPRESENTATION) { cw_rec_update_stats_internal(rec, CW_REC_STAT_DOT, mark_len); } else { cw_rec_update_stats_internal(rec, CW_REC_STAT_DASH, mark_len); } /* Add the mark to the receiver's representation buffer. */ rec->representation[rec->representation_ind++] = mark; /* We just added a mark to the receive buffer. If it's full, then we have to do something, even though it's unlikely. What we'll do is make a unilateral declaration that if we get this far, we go to end-of-char error state automatically. */ if (rec->representation_ind == CW_REC_REPRESENTATION_CAPACITY - 1) { CW_REC_SET_STATE (rec, RS_EOC_GAP_ERR, (&cw_debug_object)); cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: receiver's representation buffer is full"); errno = ENOMEM; return CW_FAILURE; } /* All is well. Move to the more normal inter-mark-space state. */ CW_REC_SET_STATE (rec, RS_SPACE, (&cw_debug_object)); return CW_SUCCESS; } /** \brief Analyze a mark and identify it as a dot or dash Identify a mark (dot/dash) represented by a duration of mark. The duration is provided in \p mark_len. Identification is done using the length ranges provided by the low level timing parameters. On success function returns CW_SUCCESS and sends back either a dot or a dash through \p mark. On failure it returns CW_FAILURE with errno set to ENOENT if the mark is not recognizable as either a dot or a dash, and sets the receiver state to one of the error states, depending on the length of mark passed in. Note: for adaptive timing, the mark should _always_ be recognized as a dot or a dash, because the length ranges will have been set to cover 0 to INT_MAX. testedin::test_cw_rec_identify_mark_internal() \param rec - receiver \param mark_len - length of mark to analyze \param mark - variable to store identified mark (output variable) \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_rec_identify_mark_internal(cw_rec_t *rec, int mark_len, /* out */ char *mark) { cw_assert (mark, "Output parameter is NULL"); /* Synchronize parameters if required */ cw_rec_sync_parameters_internal(rec); /* If the length was, within tolerance, a dot, return dot to the caller. */ if (mark_len >= rec->dot_len_min && mark_len <= rec->dot_len_max) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_INFO, "libcw: mark '%d [us]' recognized as DOT (limits: %d - %d [us])", mark_len, rec->dot_len_min, rec->dot_len_max); *mark = CW_DOT_REPRESENTATION; return CW_SUCCESS; } /* Do the same for a dash. */ if (mark_len >= rec->dash_len_min && mark_len <= rec->dash_len_max) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_INFO, "libcw: mark '%d [us]' recognized as DASH (limits: %d - %d [us])", mark_len, rec->dash_len_min, rec->dash_len_max); *mark = CW_DASH_REPRESENTATION; return CW_SUCCESS; } /* This mark is not a dot or a dash, so we have an error case. */ cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: unrecognized mark, len = %d [us]", mark_len); cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: dot limits: %d - %d [us]", rec->dot_len_min, rec->dot_len_max); cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: dash limits: %d - %d [us]", rec->dash_len_min, rec->dash_len_max); /* We should never reach here when in adaptive timing receive mode - a mark should be always recognized as dot or dash, and function should have returned before reaching this point. */ if (rec->is_adaptive_receive_mode) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: unrecognized mark in adaptive receive"); } /* TODO: making decision about current state of receiver is out of scope of this function. Move the part below to separate function. */ /* If we can't send back any result through \p mark, let's move to either "end-of-character, in error" or "end-of-word, in error" state. We will treat \p mark_len as length of space. Depending on the length of space, we pick which of the error states to move to, and move to it. The comparison is against the expected end-of-char delay. If it's larger, then fix at word error, otherwise settle on char error. TODO: reconsider this for a moment: the function has been called because client code has received a *mark*, not a space. Are we sure that we now want to treat the mark_len as length of *space*? And do we want to move to either RS_EOW_GAP_ERR or RS_EOC_GAP_ERR pretending that this is a length of *space*? */ CW_REC_SET_STATE (rec, (mark_len > rec->eoc_len_max ? RS_EOW_GAP_ERR : RS_EOC_GAP_ERR), (&cw_debug_object)); /* Return ENOENT to the caller. */ errno = ENOENT; return CW_FAILURE; } /** \brief Update receiver's averaging data structures with most recent data When in adaptive receiving mode, function updates the averages of dot and dash lengths with given \p mark_len, and recalculates the adaptive threshold for the next receive mark. \param rec - receiver \param mark_len - length of a mark (dot or dash) \param mark - CW_DOT_REPRESENTATION or CW_DASH_REPRESENTATION */ void cw_rec_update_averages_internal(cw_rec_t *rec, int mark_len, char mark) { /* We are not going to tolerate being called in fixed speed mode. */ if (!rec->is_adaptive_receive_mode) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_WARNING, "Called \"adaptive\" function when receiver is not in adaptive mode\n"); return; } /* Update moving averages for dots or dashes. */ if (mark == CW_DOT_REPRESENTATION) { cw_rec_update_average_internal(&rec->dot_averaging, mark_len); } else if (mark == CW_DASH_REPRESENTATION) { cw_rec_update_average_internal(&rec->dash_averaging, mark_len); } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "Unknown mark %d\n", mark); return; } /* Recalculate the adaptive threshold. */ int avg_dot_len = rec->dot_averaging.average; int avg_dash_len = rec->dash_averaging.average; rec->adaptive_speed_threshold = (avg_dash_len - avg_dot_len) / 2 + avg_dot_len; /* We are in adaptive mode. Since ->adaptive_speed_threshold has changed, we need to calculate new ->speed with sync(). Low-level parameters will also be re-synchronized to new threshold/speed. */ rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); if (rec->speed < CW_SPEED_MIN || rec->speed > CW_SPEED_MAX) { /* Clamp the speed. */ rec->speed = rec->speed < CW_SPEED_MIN ? CW_SPEED_MIN : CW_SPEED_MAX; /* Direct manipulation of speed in line above (clamping) requires resetting adaptive mode and re-synchronizing to calculate the new threshold, which unfortunately recalculates everything else according to fixed speed. So, we then have to reset adaptive mode and re-synchronize one more time, to get all other parameters back to where they should be. */ rec->is_adaptive_receive_mode = false; rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); rec->is_adaptive_receive_mode = true; rec->parameters_in_sync = false; cw_rec_sync_parameters_internal(rec); } return; } /** \brief Add dot or dash to receiver's representation buffer Function adds a \p mark (either a dot or a dash) to the receiver's representation buffer. Since we can't add a mark to the buffer without any accompanying timing information, the function also accepts \p timestamp of the "end of mark" event. If the \p timestamp is NULL, the timestamp for current time is used. The receiver's state is updated as if we had just received a call to cw_end_receive_tone(). \param rec - receiver \param timestamp - timestamp of "end of mark" event \param mark - mark to be inserted into receiver's representation buffer \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_rec_add_mark_internal(cw_rec_t *rec, const struct timeval *timestamp, char mark) { /* The receiver's state is expected to be idle or inter-mark-space in order to use this routine. */ if (rec->state != RS_IDLE && rec->state != RS_SPACE) { errno = ERANGE; return CW_FAILURE; } /* This routine functions as if we have just seen a mark end, yet without really seeing a mark start. It doesn't matter that we don't know timestamp of start of this mark: start timestamp would be needed only to determine mark length (and from the mark length to determine mark type (dot/dash)). But since the mark type has been determined by \p mark, we don't need timestamp for beginning of mark. What does matter is timestamp of end of this mark. This is because the receiver representation routines that may be called later look at the time since the last end of mark to determine whether we are at the end of a word, or just at the end of a character. */ if (!cw_timestamp_validate_internal(&rec->mark_end, timestamp)) { return CW_FAILURE; } /* Add the mark to the receiver's representation buffer. */ rec->representation[rec->representation_ind++] = mark; /* We just added a mark to the receiver's buffer. As above, if it's full, then we have to do something, even though it's unlikely to actually be full. */ if (rec->representation_ind == CW_REC_REPRESENTATION_CAPACITY - 1) { CW_REC_SET_STATE (rec, RS_EOC_GAP_ERR, (&cw_debug_object)); cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: receiver's representation buffer is full"); errno = ENOMEM; return CW_FAILURE; } /* Since we effectively just saw the end of a mark, move to the inter-mark-space state. */ CW_REC_SET_STATE (rec, RS_SPACE, (&cw_debug_object)); return CW_SUCCESS; } int cw_rec_poll_representation_internal(cw_rec_t *rec, const struct timeval *timestamp, /* out */ char *representation, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { if (rec->state == RS_EOW_GAP || rec->state == RS_EOW_GAP_ERR) { /* Until receiver is notified about new mark, its state won't change, and representation stored by receiver's buffer won't change. Repeated calls of the cw_receive_representation() function when receiver is in this state will simply return the same representation over and over again. Because the state of receiver is settled, \p timestamp is uninteresting. We don't expect it to hold any useful information that could influence receiver's state or representation buffer. */ cw_rec_poll_representation_eow_internal(rec, representation, is_end_of_word, is_error); return CW_SUCCESS; } else if (rec->state == RS_IDLE || rec->state == RS_MARK) { /* Not a good time/state to call this get() function. */ errno = ERANGE; return CW_FAILURE; } else { /* Pass to handling other states. */ } /* Four receiver states were covered above, so we are left with these three: */ cw_assert (rec->state == RS_SPACE || rec->state == RS_EOC_GAP || rec->state == RS_EOC_GAP_ERR, "Unknown receiver state %d", rec->state); /* Stream of data is in one of these states - inter-mark space, or - end-of-character gap, or - end-of-word gap. To see which case is true, calculate length of this space by comparing current/given timestamp with end of last mark. */ struct timeval now_timestamp; if (!cw_timestamp_validate_internal(&now_timestamp, timestamp)) { return CW_FAILURE; } int space_len = cw_timestamp_compare_internal(&rec->mark_end, &now_timestamp); if (space_len == INT_MAX) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_ERROR, "libcw: space len == INT_MAX"); errno = EAGAIN; return CW_FAILURE; } /* Synchronize parameters if required */ cw_rec_sync_parameters_internal(rec); if (space_len >= rec->eoc_len_min && space_len <= rec->eoc_len_max) { //fprintf(stderr, "EOC: space len = %d (%d - %d)\n", space_len, rec->eoc_len_min, rec->eoc_len_max); /* The space is, within tolerance, an end-of-character gap. We have a complete character representation in receiver's buffer and we can return it. */ cw_rec_poll_representation_eoc_internal(rec, space_len, representation, is_end_of_word, is_error); return CW_SUCCESS; } else if (space_len > rec->eoc_len_max) { // fprintf(stderr, "EOW: space len = %d (> %d) ------------- \n", space_len, rec->eoc_len_max); /* The space is too long for end-of-character state. This should be end-of-word state. We have to inform client code about this, too. We have a complete character representation in receiver's buffer and we can return it. */ cw_rec_poll_representation_eow_internal(rec, representation, is_end_of_word, is_error); return CW_SUCCESS; } else { /* space_len < rec->eoc_len_min */ /* We are still inside a character (inside an inter-mark space, to be precise). The receiver can't return a representation, because building a representation is not finished yet. So it is too early to return a representation, because it's not complete yet. */ errno = EAGAIN; return CW_FAILURE; } } /** \brief Prepare return values at end-of-character Return representation and receiver's state flags after receiver has encountered end-of-character gap. Update receiver's state (\p rec) so that it matches end-of-character state. Since this is _eoc_function, \p is_end_of_word is set to false. \p rec - receiver \p representation - representation of character from receiver's buffer \p is_end_of_word - end-of-word flag \p is_error - error flag */ void cw_rec_poll_representation_eoc_internal(cw_rec_t *rec, int space_len, /* out */ char *representation, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { if (rec->state == RS_SPACE) { /* State of receiver is inter-mark-space, but real length of current space turned out to be a bit longer than acceptable inter-mark-space. Update length statistics for space identified as end-of-character gap. */ cw_rec_update_stats_internal(rec, CW_REC_STAT_ICHAR_SPACE, space_len); /* Transition of state of receiver. */ CW_REC_SET_STATE (rec, RS_EOC_GAP, (&cw_debug_object)); } else { /* We are already in RS_EOC_GAP or RS_EOC_GAP_ERR, so nothing to do. */ cw_assert (rec->state == RS_EOC_GAP || rec->state == RS_EOC_GAP_ERR, "unexpected state of receiver: %d / %s", rec->state, cw_receiver_states[rec->state]); } cw_debug_msg ((&cw_debug_object), CW_DEBUG_RECEIVE_STATES, CW_DEBUG_INFO, "libcw: receive state -> %s", cw_receiver_states[rec->state]); /* Return the representation from receiver's buffer. */ if (is_end_of_word) { *is_end_of_word = false; } if (is_error) { *is_error = (rec->state == RS_EOC_GAP_ERR); } *representation = '\0'; /* TODO: why do this? */ strncat(representation, rec->representation, rec->representation_ind); rec->representation[rec->representation_ind] = '\0'; return; } /** \brief Prepare return values at end-of-word Return representation and receiver's state flags after receiver has encountered end-of-word gap. Update receiver's state (\p rec) so that it matches end-of-word state. Since this is _eow_function, \p is_end_of_word is set to true. \p rec - receiver \p representation - representation of character from receiver's buffer \p is_end_of_word - end-of-word flag \p is_error - error flag */ void cw_rec_poll_representation_eow_internal(cw_rec_t *rec, /* out */ char *representation, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { if (rec->state == RS_EOC_GAP || rec->state == RS_SPACE) { CW_REC_SET_STATE (rec, RS_EOW_GAP, (&cw_debug_object)); /* Transition of state. */ } else if (rec->state == RS_EOC_GAP_ERR) { CW_REC_SET_STATE (rec, RS_EOW_GAP_ERR, (&cw_debug_object)); /* Transition of state with preserving error. */ } else if (rec->state == RS_EOW_GAP_ERR || rec->state == RS_EOW_GAP) { ; /* No need to change state. */ } else { cw_assert (0, "unexpected receiver state %d / %s", rec->state, cw_receiver_states[rec->state]); } /* Return the representation from receiver's buffer. */ if (is_end_of_word) { *is_end_of_word = true; } if (is_error) { *is_error = (rec->state == RS_EOW_GAP_ERR); } *representation = '\0'; /* TODO: why do this? */ strncat(representation, rec->representation, rec->representation_ind); rec->representation[rec->representation_ind] = '\0'; return; } int cw_rec_poll_character_internal(cw_rec_t *rec, const struct timeval *timestamp, /* out */ char *c, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { /* TODO: in theory we don't need these intermediate bool variables, since is_end_of_word and is_error won't be modified by any function on !success. */ bool end_of_word, error; char representation[CW_REC_REPRESENTATION_CAPACITY + 1]; /* See if we can obtain a representation from receiver. */ int status = cw_rec_poll_representation_internal(rec, timestamp, representation, &end_of_word, &error); if (!status) { return CW_FAILURE; } /* Look up the representation using the lookup functions. */ char character = cw_representation_to_character_internal(representation); if (!character) { errno = ENOENT; return CW_FAILURE; } /* If we got this far, all is well, so return what we received. */ if (c) { *c = character; } if (is_end_of_word) { *is_end_of_word = end_of_word; } if (is_error) { *is_error = error; } return CW_SUCCESS; } void cw_rec_clear_buffer_internal(cw_rec_t *rec) { rec->representation_ind = 0; CW_REC_SET_STATE (rec, RS_IDLE, (&cw_debug_object)); return; } /** \brief Get the number of elements (dots/dashes) the receiver's buffer can accommodate The maximum number of elements written out by cw_receive_representation() is the capacity + 1, the extra character being used for the terminating NUL. \return number of elements that can be stored in receiver's representation buffer */ int cw_rec_get_receive_buffer_capacity_internal(void) { return CW_REC_REPRESENTATION_CAPACITY; } int cw_rec_get_buffer_length_internal(cw_rec_t *rec) { return rec->representation_ind; } /** \brief Clear receive data Clear the receiver's representation buffer, statistics, and any retained receiver's state. This function is suitable for calling from an application exit handler. TODO: this function should do much more than it is doing now. Verify and - if necessary - revise the function. \param rec - receiver */ void cw_rec_reset_internal(cw_rec_t *rec) { rec->representation_ind = 0; CW_REC_SET_STATE ((rec), RS_IDLE, (&cw_debug_object)); cw_rec_reset_receive_statistics_internal(rec); return; } /** \brief Reset essential receive parameters to their initial values */ void cw_rec_reset_receive_parameters_internal(cw_rec_t *rec) { cw_assert (rec, "receiver is NULL"); rec->speed = CW_SPEED_INITIAL; rec->tolerance = CW_TOLERANCE_INITIAL; rec->is_adaptive_receive_mode = CW_REC_ADAPTIVE_MODE_INITIAL; rec->noise_spike_threshold = CW_REC_NOISE_THRESHOLD_INITIAL; /* FIXME: consider resetting ->gap as well. */ rec->parameters_in_sync = false; return; } void cw_rec_sync_parameters_internal(cw_rec_t *rec) { cw_assert (rec, "receiver is NULL"); /* Do nothing if we are already synchronized. */ if (rec->parameters_in_sync) { return; } /* First, depending on whether we are set for fixed speed or adaptive speed, calculate either the threshold from the receive speed, or the receive speed from the threshold, knowing that the threshold is always, effectively, two dot lengths. Weighting is ignored for receive parameters, although the core unit length is recalculated for the receive speed, which may differ from the send speed. */ /* FIXME: shouldn't we move the calculation of unit_len (that depends on rec->speed) after the calculation of rec->speed? */ int unit_len = CW_DOT_CALIBRATION / rec->speed; if (rec->is_adaptive_receive_mode) { rec->speed = CW_DOT_CALIBRATION / (rec->adaptive_speed_threshold / 2.0); } else { rec->adaptive_speed_threshold = 2 * unit_len; } /* Calculate the basic receiver's dot and dash lengths. */ rec->dot_len_ideal = unit_len; rec->dash_len_ideal = 3 * unit_len; /* For statistical purposes, calculate the ideal "end of mark" and "end of character" lengths, too. */ rec->eom_len_ideal = unit_len; rec->eoc_len_ideal = 3 * unit_len; /* These two lines mimic calculations done in cw_gen_sync_parameters_internal(). See the function for more comments. */ rec->additional_delay = rec->gap * unit_len; rec->adjustment_delay = (7 * rec->additional_delay) / 3; /* Set length ranges of low level parameters. The length ranges depend on whether we are required to adapt to the incoming Morse code speeds. */ if (rec->is_adaptive_receive_mode) { /* Adaptive receiving mode. */ rec->dot_len_min = 0; rec->dot_len_max = 2 * rec->dot_len_ideal; /* Any mark longer than dot is a dash in adaptive receiving mode. */ /* FIXME: shouldn't this be '= rec->dot_len_max + 1'? now the length ranges for dot and dash overlap. */ rec->dash_len_min = rec->dot_len_max; rec->dash_len_max = INT_MAX; #if 0 int debug_eoc_len_max = rec->eoc_len_max; #endif /* Make the inter-mark space be anything up to the adaptive threshold lengths - that is two dots. And the end-of-character gap is anything longer than that, and shorter than five dots. */ rec->eom_len_min = rec->dot_len_min; rec->eom_len_max = rec->dot_len_max; rec->eoc_len_min = rec->eom_len_max; rec->eoc_len_max = 5 * rec->dot_len_ideal; #if 0 if (debug_eoc_len_max != rec->eoc_len_max) { fprintf(stderr, "eoc_len_max changed from %d to %d --------\n", debug_eoc_len_max, rec->eoc_len_max); } #endif } else { /* Fixed speed receiving mode. */ /* 'int tolerance' is in [%]. */ int tolerance = (rec->dot_len_ideal * rec->tolerance) / 100; rec->dot_len_min = rec->dot_len_ideal - tolerance; rec->dot_len_max = rec->dot_len_ideal + tolerance; rec->dash_len_min = rec->dash_len_ideal - tolerance; rec->dash_len_max = rec->dash_len_ideal + tolerance; /* Make the inter-mark space the same as the dot length range. */ rec->eom_len_min = rec->dot_len_min; rec->eom_len_max = rec->dot_len_max; /* Make the end-of-character gap, expected to be three dots, the same as dash length range at the lower end, but make it the same as the dash length range _plus_ the "Farnsworth" delay at the top of the length range. */ rec->eoc_len_min = rec->dash_len_min; rec->eoc_len_max = rec->dash_len_max + rec->additional_delay + rec->adjustment_delay; /* Any gap longer than eoc_len_max is by implication end-of-word gap. */ } cw_debug_msg ((&cw_debug_object), CW_DEBUG_PARAMETERS, CW_DEBUG_INFO, "libcw: receive usec timings <%.2f [wpm]>: dot: %d-%d [ms], dash: %d-%d [ms], %d-%d[%d], %d-%d[%d], thres: %d [us]", rec->speed, rec->dot_len_min, rec->dot_len_max, rec->dash_len_min, rec->dash_len_max, rec->eom_len_min, rec->eom_len_max, rec->eom_len_ideal, rec->eoc_len_min, rec->eoc_len_max, rec->eoc_len_ideal, rec->adaptive_speed_threshold); /* Receiver parameters are now in sync. */ rec->parameters_in_sync = true; return; } #ifdef LIBCW_UNIT_TESTS #define TEST_CW_REC_DATA_LEN_MAX 30 /* There is no character that would have data that long. */ struct cw_rec_test_data { char c; /* Character. */ char *r; /* Character's representation (dots and dashes). */ float s; /* Send speed (speed at which the character is incoming). */ int d[TEST_CW_REC_DATA_LEN_MAX]; /* Data points - time information for marks and spaces. */ int nd; /* Number of data points. */ bool is_last_in_word; /* Is this character a last character in a word? (is it followed by end-of-word space?) */ }; static struct cw_rec_test_data *test_cw_rec_new_data(const char *characters, float speeds[], int fuzz_percent); static struct cw_rec_test_data *test_cw_rec_new_base_data_fixed(int speed, int fuzz_percent); static struct cw_rec_test_data *test_cw_rec_new_random_data_fixed(int speed, int fuzz_percent); static struct cw_rec_test_data *test_cw_rec_new_random_data_adaptive(int speed_min, int speed_max, int fuzz_percent); static void test_cw_rec_delete_data(struct cw_rec_test_data **data); __attribute__((unused)) static void test_cw_rec_print_data(struct cw_rec_test_data *data); static void test_cw_rec_test_begin_end(cw_rec_t *rec, struct cw_rec_test_data *data); /* Functions creating tables of test values: characters and speeds. Characters and speeds will be combined into test (timing) data. */ static char *test_cw_rec_new_base_characters(void); static char *test_cw_rec_new_random_characters(int n); static float *test_cw_rec_new_speeds_fixed(int speed, size_t n); static float *test_cw_rec_new_speeds_adaptive(int speed_min, int speed_max, size_t n); /** tests::cw_rec_identify_mark_internal() Test if function correctly recognizes dots and dashes for a range of receive speeds. This test function also checks if marks of lengths longer or shorter than certain limits (dictated by receiver) are handled properly (i.e. if they are recognized as invalid marks). Currently the function only works for non-adaptive receiving. */ unsigned int test_cw_rec_identify_mark_internal(void) { int p = fprintf(stdout, "libcw/rec: cw_rec_identify_mark_internal() (non-adaptive):"); cw_rec_t *rec = cw_rec_new_internal(); cw_assert (rec, "Failed to get new receiver\n"); cw_rec_set_adaptive_mode_internal(rec, false); int speed_step = (CW_SPEED_MAX - CW_SPEED_MIN) / 10; for (int i = CW_SPEED_MIN; i < CW_SPEED_MAX; i += speed_step) { int rv = cw_rec_set_speed_internal(rec, i); cw_assert (rv, "Failed to set receive speed = %d [wpm]\n", i); char representation; /* Test marks of length within allowed lengths of dots. */ int len_step = (rec->dot_len_max - rec->dot_len_min) / 10; for (int j = rec->dot_len_min; j < rec->dot_len_max; j += len_step) { rv = cw_rec_identify_mark_internal(rec, j, &representation); cw_assert (rv, "failed to identify dot for speed = %d [wpm], len = %d [us]", i, j); cw_assert (representation == CW_DOT_REPRESENTATION, "got something else than dot for speed = %d [wpm], len = %d [us]", i, j); } /* Test mark shorter than minimal length of dot. */ rv = cw_rec_identify_mark_internal(rec, rec->dot_len_min - 1, &representation); cw_assert (!rv, "incorrectly identified short mark as a dot for speed = %d [wpm]", i); /* Test mark longer than maximal length of dot (but shorter than minimal length of dash). */ rv = cw_rec_identify_mark_internal(rec, rec->dot_len_max + 1, &representation); cw_assert (!rv, "incorrectly identified long mark as a dot for speed = %d [wpm]", i); /* Test marks of length within allowed lengths of dashes. */ len_step = (rec->dash_len_max - rec->dash_len_min) / 10; for (int j = rec->dash_len_min; j < rec->dash_len_max; j += len_step) { rv = cw_rec_identify_mark_internal(rec, j, &representation); cw_assert (rv, "failed to identify dash for speed = %d [wpm], len = %d [us]", i, j); cw_assert (representation == CW_DASH_REPRESENTATION, "got something else than dash for speed = %d [wpm], len = %d [us]", i, j); } /* Test mark shorter than minimal length of dash (but longer than maximal length of dot). */ rv = cw_rec_identify_mark_internal(rec, rec->dash_len_min - 1, &representation); cw_assert (!rv, "incorrectly identified short mark as a dash for speed = %d [wpm]", i); /* Test mark longer than maximal length of dash. */ rv = cw_rec_identify_mark_internal(rec, rec->dash_len_max + 1, &representation); cw_assert (!rv, "incorrectly identified long mark as a dash for speed = %d [wpm]", i); } cw_rec_delete_internal(&rec); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /* Test a receiver with small and simple set of all characters supported by libcw. The test is done with fixed speed. */ unsigned int test_cw_rec_with_base_data_fixed(void) { int p = fprintf(stdout, "libcw/rec: test begin/end functions base data/fixed speed:"); cw_rec_t *rec = cw_rec_new_internal(); cw_assert (rec, "Failed to get new receiver\n"); for (int speed = CW_SPEED_MIN; speed <= CW_SPEED_MAX; speed++) { struct cw_rec_test_data *data = test_cw_rec_new_base_data_fixed(speed, 0); //test_cw_rec_print_data(data); /* Reset. */ cw_rec_reset_internal(rec); cw_rec_clear_buffer_internal(rec); cw_rec_set_speed_internal(rec, speed); cw_rec_set_adaptive_mode_internal(rec, false); float diff = cw_rec_get_speed_internal(rec) - speed; cw_assert (diff < 0.1, "incorrect receive speed: %f != %d", cw_rec_get_speed_internal(rec), speed); /* Actual tests of receiver functions are here. */ test_cw_rec_test_begin_end(rec, data); test_cw_rec_delete_data(&data); } cw_rec_delete_internal(&rec); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief The core test function, testing receiver's "begin" and "end" functions As mentioned in file's top-level comment, there are two main methods to add data to receiver. This function tests first method: using cw_start_receive_tone() and cw_end_receive_tone() functions (or cw_rec_mark_begin_internal() and cw_rec_mark_end_internal() functions that are used to implement them). Other helper functions are used/tested here as well, because adding marks and spaces to receiver is just half of the job necessary to receive Morse code. You have to interpret the marks and spaces, too. \param rec - receiver variable used during tests \param data - table with timings, used to test the receiver */ void test_cw_rec_test_begin_end(cw_rec_t *rec, struct cw_rec_test_data *data) { struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 0; for (int i = 0; data[i].r; i++) { #ifdef LIBCW_UNIT_TESTS_VERBOSE printf("\nlibcw: input test data #%d: <%c> / <%s> @ %.2f [wpm] (%d time values)\n", i, data[i].c, data[i].r, data[i].s, data[i].nd); #endif /* Start sending every character at the beginning of a new second. TODO: here we make an assumption that every character is sent in less than a second. Which is a good assumption when we have a speed of tens of WPM. If the speed will be lower, the assumption will be false. */ //tv.tv_sec = 0; //tv.tv_usec = 0; /* This loop simulates "key down" and "key up" events in specific moments, and in specific time intervals. key down -> call to cw_rec_mark_begin_internal() key up -> call to cw_rec_mark_end_internal(). First "key down" event is at 0 seconds 0 microseconds. Time of every following event is calculated by iterating over tone lengths specified in data table. */ int tone; for (tone = 0; data[i].d[tone] > 0; tone++) { /* Here we just assume that cw_rec_mark_bein{start|end}_receive_tone() functions just work. No checking of return values. */ if (tone % 2) { int rv = cw_rec_mark_end_internal(rec, &tv); cw_assert (rv, "cw_rec_mark_end_internal(): %d.%d", (int) tv.tv_sec, (int) tv.tv_usec); } else { int rv = cw_rec_mark_begin_internal(rec, &tv); cw_assert (rv, "cw_rec_mark_begin_internal(): %d.%d", (int) tv.tv_sec, (int) tv.tv_usec); } tv.tv_usec += data[i].d[tone]; if (tv.tv_usec >= CW_USECS_PER_SEC) { /* Moving event to next second. */ tv.tv_sec += tv.tv_usec / CW_USECS_PER_SEC; tv.tv_usec %= CW_USECS_PER_SEC; } /* If we exit the loop at this point, the last 'tv' with length of end-of-character space will be used below in cw_receive_representation(). */ } /* Test: length of receiver's buffer (only marks!) after adding a representation of a single character to receiver's buffer. */ { int n = cw_rec_get_buffer_length_internal(rec); cw_assert (n == (int) strlen(data[i].r), "cw_rec_get_buffer_length_internal() : %d != %zd", n, strlen(data[i].r)); } /* Test: getting representation from receiver's buffer. */ char representation[CW_REC_REPRESENTATION_CAPACITY + 1]; { /* Get representation (dots and dashes) accumulated by receiver. Check for errors. */ bool is_word, is_error; /* Notice that we call the function with last timestamp (tv) from input data. The last timestamp in the input data represents end of final space (end-of-character space). With this final passing of "end of space" timestamp to libcw the test code informs receiver, that end-of-character space has occurred, i.e. a full character has been passed to receiver. The space length in input data is (3 x dot + jitter). In libcw maximum recognizable length of "end of character" space is 5 x dot. */ cw_assert (cw_rec_poll_representation_internal(rec, &tv, representation, &is_word, &is_error), "cw_rec_poll_representation_internal() returns false"); cw_assert (strcmp(representation, data[i].r) == 0, "cw_rec_poll_representation_internal(): polled representation does not match test representation:" \ "\"%s\" != \"%s\"", representation, data[i].r); cw_assert (!is_error, "cw_rec_poll_representation_internal() sets is_error to true"); /* If the last space in character's data is end-of-word space (which is indicated by is_last_in_word), then is_word should be set by poll() to true. Otherwise both values should be false. */ cw_assert (is_word == data[i].is_last_in_word, "'is_word' flag error: function returns '%d', data is tagged with '%d'\n" \ "'%c' '%c' '%c' '%c' '%c'", is_word, data[i].is_last_in_word, data[i - 2].c, data[i - 1].c, data[i].c, data[i + 1].c, data[i + 2].c ); #if 0 /* Debug code. Print times of character with end-of-word space to verify length of the space. */ if (data[i].is_last_in_word) { fprintf(stderr, "------- character '%c' is last in word\n", data[i].c); for (int m = 0; m < data[i].nd; m++) { fprintf(stderr, "#%d: %d\n", m, data[i].d[m]); } } #endif } char c; /* Test: getting character from receiver's buffer. */ { bool is_word, is_error; /* The representation is still held in receiver. Ask receiver for converting the representation to character. */ cw_assert (cw_rec_poll_character_internal(rec, &tv, &c, &is_word, &is_error), "cw_rec_poll_character_internal() returns false"); cw_assert (c == data[i].c, "cw_rec_poll_character_internal(): polled character does not match test character:" \ "'%c' != '%c':", c, data[i].c); } /* Test: getting length of receiver's representation buffer after cleaning the buffer. */ { /* We have a copy of received representation, we have a copy of character. The receiver no longer needs to store the representation. If I understand this correctly, the call to clear() is necessary to prepare the receiver for receiving next character. */ cw_rec_clear_buffer_internal(rec); int length = cw_rec_get_buffer_length_internal(rec); cw_assert (length == 0, "cw_rec_get_buffer_length_internal(): length of cleared buffer is non zero (is %d)", length); } #ifdef LIBCW_UNIT_TESTS_VERBOSE float speed = cw_rec_get_speed_internal(rec); printf("libcw: received data #%d: <%c> / <%s> @ %.2f [wpm]\n", i, c, representation, speed); #endif #if 0 if (adaptive) { printf("libcw: adaptive speed tracking reports %d wpm\n", ); } #endif } return; } /* Generate small test data set with all characters supported by libcw and a fixed speed. */ struct cw_rec_test_data *test_cw_rec_new_base_data_fixed(int speed, int fuzz_percent) { /* All characters supported by libcw. Don't use get_characters_random(): for this test get a small table of all characters supported by libcw. This should be a quick test, and it should cover all characters. */ char *base_characters = test_cw_rec_new_base_characters(); cw_assert (base_characters, "test_cw_rec_new_base_characters() failed"); size_t n = strlen(base_characters); /* Fixed speed receive mode - speed is constant for all characters. */ float *speeds = test_cw_rec_new_speeds_fixed(speed, n); cw_assert (speeds, "test_cw_rec_new_speeds_fixed() failed"); /* Generate timing data for given set of characters, each character is sent with speed dictated by speeds[]. */ struct cw_rec_test_data *data = test_cw_rec_new_data(base_characters, speeds, fuzz_percent); cw_assert (data, "failed to get test data"); free(base_characters); base_characters = NULL; free(speeds); speeds = NULL; return data; } /* Test a receiver with large set of random data. The test is done with fixed speed. */ unsigned int test_cw_rec_with_random_data_fixed(void) { int p = fprintf(stdout, "libcw/rec: test begin/end functions random data/fixed speed:"); cw_rec_t *rec = cw_rec_new_internal(); cw_assert (rec, "Failed to get new receiver\n"); for (int speed = CW_SPEED_MIN; speed <= CW_SPEED_MAX; speed++) { struct cw_rec_test_data *data = test_cw_rec_new_random_data_fixed(speed, 0); //test_cw_rec_print_data(data); /* Reset. */ cw_rec_reset_internal(rec); cw_rec_clear_buffer_internal(rec); cw_rec_set_speed_internal(rec, speed); cw_rec_set_adaptive_mode_internal(rec, false); float diff = cw_rec_get_speed_internal(rec) - speed; cw_assert (diff < 0.1, "incorrect receive speed: %f != %d", cw_rec_get_speed_internal(rec), speed); /* Actual tests of receiver functions are here. */ test_cw_rec_test_begin_end(rec, data); test_cw_rec_delete_data(&data); } cw_rec_delete_internal(&rec); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /* Test a receiver with large set of random data. The test is done with varying speed. */ unsigned int test_cw_rec_with_random_data_adaptive(void) { int p = fprintf(stdout, "libcw/rec: test begin/end functions random data/adaptive:"); struct cw_rec_test_data *data = test_cw_rec_new_random_data_adaptive(CW_SPEED_MIN, CW_SPEED_MAX, 0); //test_cw_rec_print_data(data); cw_rec_t *rec = cw_rec_new_internal(); cw_assert (rec, "Failed to get new receiver\n"); /* Reset. */ cw_rec_reset_internal(rec); cw_rec_clear_buffer_internal(rec); cw_rec_set_speed_internal(rec, CW_SPEED_MAX); cw_rec_set_adaptive_mode_internal(rec, true); float diff = cw_rec_get_speed_internal(rec) - CW_SPEED_MAX; cw_assert (diff < 0.1, "incorrect receive speed: %f != %d", cw_rec_get_speed_internal(rec), CW_SPEED_MAX); /* Actual tests of receiver functions are here. */ test_cw_rec_test_begin_end(rec, data); test_cw_rec_delete_data(&data); cw_rec_delete_internal(&rec); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /* This function generates a large set of data using characters from base set. The characters in data are randomized and space characters are added. Size of data set is tens of times larger than for base data. Speed of data is constant for all characters. */ struct cw_rec_test_data *test_cw_rec_new_random_data_fixed(int speed, int fuzz_percent) { int n = cw_get_character_count() * 30; char *characters = test_cw_rec_new_random_characters(n); cw_assert (characters, "test_cw_rec_new_random_characters() failed"); /* Fixed speed receive mode - speed is constant for all characters. */ float *speeds = test_cw_rec_new_speeds_fixed(speed, n); cw_assert (speeds, "test_cw_rec_new_speeds_fixed() failed"); /* Generate timing data for given set of characters, each character is sent with speed dictated by speeds[]. */ struct cw_rec_test_data *data = test_cw_rec_new_data(characters, speeds, fuzz_percent); cw_assert (data, "failed to get test data"); free(characters); characters = NULL; free(speeds); speeds = NULL; return data; } /* This function generates a large set of data using characters from base set. The characters in data are randomized and space characters are added. Size of data set is tens of times larger than for base data. Speed of data is varying. */ struct cw_rec_test_data *test_cw_rec_new_random_data_adaptive(int speed_min, int speed_max, int fuzz_percent) { int n = cw_get_character_count() * 30; char *characters = test_cw_rec_new_random_characters(n); cw_assert (characters, "test_cw_rec_new_random_characters() failed"); /* Adaptive speed receive mode - speed varies for all characters. */ float *speeds = test_cw_rec_new_speeds_adaptive(speed_min, speed_max, n); cw_assert (speeds, "test_cw_rec_new_speeds_adaptive() failed"); /* Generate timing data for given set of characters, each character is sent with speed dictated by speeds[]. */ struct cw_rec_test_data *data = test_cw_rec_new_data(characters, speeds, fuzz_percent); cw_assert (data, "failed to get test data"); free(characters); characters = NULL; free(speeds); speeds = NULL; return data; } /** \brief Get a string with all characters supported by libcw Function allocates and returns a string with all characters that are supported/recognized by libcw. \return allocated string. */ char *test_cw_rec_new_base_characters(void) { int n = cw_get_character_count(); char *base_characters = (char *) malloc((n + 1) * sizeof (char)); cw_assert (base_characters, "malloc() failed"); cw_list_characters(base_characters); return base_characters; } /** \brief Generate a set of characters of size \p n. Function allocates and returns a string of \p n characters. The characters are randomly drawn from set of all characters supported by libcw. Spaces are added to the string in random places to mimic a regular text. Function makes sure that there are no consecutive spaces (two or more) in the string. \param n - number of characters in output string \return string of random characters (including spaces) */ char *test_cw_rec_new_random_characters(int n) { /* All characters supported by libcw - this will be an input set of all characters. */ char *base_characters = test_cw_rec_new_base_characters(); cw_assert (base_characters, "test_cw_rec_new_base_characters() failed"); size_t length = strlen(base_characters); char *characters = (char *) malloc ((n + 1) * sizeof (char)); cw_assert (characters, "malloc() failed"); for (int i = 0; i < n; i++) { int r = rand() % length; if (!(r % 3)) { characters[i] = ' '; /* To prevent two consecutive spaces. */ i++; characters[i] = base_characters[r]; } else { characters[i] = base_characters[r]; } } /* First character in input data can't be a space - we can't start a receiver's state machine with space. Also when a end-of-word space appears in input character set, it is added as last time value at the end of time values table for "previous char". We couldn't do this for -1st char. */ characters[0] = 'K'; /* Use capital letter. libcw uses capital letters internally. */ characters[n] = '\0'; //fprintf(stderr, "%s\n", characters); free(base_characters); base_characters = NULL; return characters; } /** \brief Generate a table of fixed speeds Function allocates and returns a table of speeds of constant value specified by \p speed. There are \p n valid (non-negative) values in the table. After the last valid value there is a small negative value at position 'n' in the table that acts as a guard. \param speed - a constant value to be used as initializer of the table \param n - size of table (function allocates additional one cell for guard) \return table of speeds of constant value */ float *test_cw_rec_new_speeds_fixed(int speed, size_t n) { cw_assert (speed > 0, "speed must be larger than zero"); float *speeds = (float *) malloc((n + 1) * sizeof (float)); cw_assert (speeds, "malloc() failed"); for (size_t i = 0; i < n; i++) { /* Fixed speed receive mode - speed is constant for all characters. */ speeds[i] = (float) speed; } speeds[n] = -1.0; return speeds; } /** \brief Generate a table of varying speeds Function allocates and returns a table of speeds of varying values, changing between \p speed_min and \p speed_max. There are \p n valid (non-negative) values in the table. After the last valid value there is a small negative value at position 'n' in the table that acts as a guard. \param speed_min - minimal speed \param speed_max - maximal speed \param n - size of table (function allocates additional one cell for guard) \return table of speeds */ float *test_cw_rec_new_speeds_adaptive(int speed_min, int speed_max, size_t n) { cw_assert (speed_min > 0, "speed_min must be larger than zero"); cw_assert (speed_max > 0, "speed_max must be larger than zero"); cw_assert (speed_min <= speed_max, "speed_min can't be larger than speed_max"); float *speeds = (float *) malloc((n + 1) * sizeof (float)); cw_assert (speeds, "malloc() failed"); for (size_t i = 0; i < n; i++) { /* Adaptive speed receive mode - speed varies for all characters. */ float t = (1.0 * i) / n; speeds[i] = (1 + cosf(2 * 3.1415 * t)) / 2.0; /* 0.0 - 1.0 */ speeds[i] *= (speed_max - speed_min); /* 0.0 - 56.0 */ speeds[i] += speed_min; /* 4.0 - 60.0 */ // fprintf(stderr, "%f\n", speeds[i]); } speeds[n] = -1.0; return speeds; } /** \brief Create timing data used for testing a receiver This is a generic function that can generate different sets of data depending on input parameters. It is to be used by wrapper functions that first specify parameters of test data, and then pass the parameters to this function. The function allocates a table with timing data (and some other data as well) that can be used to test receiver's functions that accept timestamp argument. All characters in \p characters must be valid (i.e. they must be accepted by cw_character_is_valid()). All values in \p speeds must be valid (i.e. must be between CW_SPEED_MIN and CW_SPEED_MAX, inclusive). Size of \p characters and \p speeds must be equal. The data is valid and represents valid Morse representations. If you want to generate invalid data or to generate data based on invalid representations, you have to use some other function. For each character the last timing parameter represents end-of-character space or end-of-word space. The next timing parameter after the space is zero. For character 'A' that would look like this: .- == 40000 (dot); 40000 (space); 120000 (dash); 240000 (end-of-word space); 0 (guard, zero timing) Last element in the created table (a guard "pseudo-character") has 'r' field set to NULL. Use test_cw_rec_delete_data() to deallocate the timing data table. \brief characters - list of characters for which to generate table with timing data \brief speeds - list of speeds (per-character) \return table of timing data sets */ struct cw_rec_test_data *test_cw_rec_new_data(const char *characters, float speeds[], __attribute__((unused)) int fuzz_percent) { size_t n = strlen(characters); /* +1 for guard. */ struct cw_rec_test_data *test_data = (struct cw_rec_test_data *) malloc((n + 1) * sizeof(struct cw_rec_test_data)); cw_assert (test_data, "malloc() failed"); /* Initialization. */ for (size_t i = 0; i < n + 1; i++) { test_data[i].r = (char *) NULL; } size_t out = 0; /* For indexing output data table. */ for (size_t in = 0; in < n; in++) { int unit_len = CW_DOT_CALIBRATION / speeds[in]; /* Dot length, [us]. Used as basis for other elements. */ // fprintf(stderr, "unit_len = %d [us] for speed = %d [wpm]\n", unit_len, speed); /* First handle a special case: end-of-word space. This long space will be put at the end of table of time values for previous representation. */ if (characters[in] == ' ') { /* We don't want to affect current output character, we want to turn end-of-char space of previous character into end-of-word space, hence 'j - 1'. */ int ilast = test_data[out - 1].nd - 1; /* Index of last space (end-of-char, to become end-of-word). */ test_data[out - 1].d[ilast] = unit_len * 6; /* unit_len * 5 is the minimal end-of-word space. */ test_data[out - 1].is_last_in_word = true; continue; } else { /* A regular character, handled below. */ } test_data[out].c = characters[in]; test_data[out].r = cw_character_to_representation(test_data[out].c); cw_assert (test_data[out].r, "cw_character_to_representation() failed for input char #%zu: '%c'\n", in, characters[in]); test_data[out].s = speeds[in]; /* Build table of times (data points) 'd[]' for given representation 'r'. */ size_t nd = 0; /* Number of data points in data table. */ size_t rep_length = strlen(test_data[out].r); for (size_t k = 0; k < rep_length; k++) { /* Length of mark. */ if (test_data[out].r[k] == CW_DOT_REPRESENTATION) { test_data[out].d[nd] = unit_len; } else if (test_data[out].r[k] == CW_DASH_REPRESENTATION) { test_data[out].d[nd] = unit_len * 3; } else { cw_assert (0, "unknown char in representation: '%c'\n", test_data[out].r[k]); } nd++; /* Length of space (inter-mark space). Mark and space always go in pair. */ test_data[out].d[nd] = unit_len; nd++; } /* Every character has non-zero marks and spaces. */ cw_assert (nd > 0, "number of data points is %zu for representation '%s'\n", nd, test_data[out].r); /* Mark and space always go in pair, so nd should be even. */ cw_assert (! (nd % 2), "number of times is not even"); /* Mark/space pair per each dot or dash. */ cw_assert (nd == 2 * rep_length, "number of times incorrect: %zu != 2 * %zu\n", nd, rep_length); /* Graduate that last space (inter-mark space) into end-of-character space. */ test_data[out].d[nd - 1] = (unit_len * 3) + (unit_len / 2); /* Guard. */ test_data[out].d[nd] = 0; test_data[out].nd = (size_t ) nd; /* This may be overwritten by this function when a space character (' ') is encountered in input string. */ test_data[out].is_last_in_word = false; out++; } /* Guard. */ test_data[n].r = (char *) NULL; return test_data; } /** \brief Deallocate timing data used for testing a receiver \param data - pointer to data to be deallocated */ void test_cw_rec_delete_data(struct cw_rec_test_data **data) { int i = 0; while ((*data)[i].r) { free((*data)[i].r); (*data)[i].r = (char *) NULL; i++; } free(*data); *data = NULL; return; } /** \brief Pretty-print timing data used for testing a receiver \param data timing data to be printed */ void test_cw_rec_print_data(struct cw_rec_test_data *data) { int i = 0; fprintf(stderr, "---------------------------------------------------------------------------------------------------------------------------------------------------------\n"); while (data[i].r) { /* Debug output. */ if (!(i % 10)) { /* Print header. */ fprintf(stderr, "char repr [wpm] mark space mark space mark space mark space mark space mark space mark space\n"); } fprintf(stderr, "%c %-7s %02.2f", data[i].c, data[i].r, data[i].s); for (int j = 0; j < data[i].nd; j++) { fprintf(stderr, "%9d ", data[i].d[j]); } fprintf(stderr, "\n"); i++; } return; } unsigned int test_cw_get_receive_parameters(void) { cw_rec_t *rec = cw_rec_new_internal(); cw_assert (rec, "Failed to get new receiver\n"); cw_rec_reset_receive_parameters_internal(rec); cw_rec_sync_parameters_internal(rec); int dot_len_ideal = 0, dash_len_ideal = 0, dot_len_min = 0, dot_len_max = 0, dash_len_min = 0, dash_len_max = 0, eom_len_min = 0, eom_len_max = 0, eom_len_ideal = 0, eoc_len_min = 0, eoc_len_max = 0, eoc_len_ideal = 0, adaptive_speed_threshold = 0; cw_rec_get_parameters_internal(rec, &dot_len_ideal, &dash_len_ideal, &dot_len_min, &dot_len_max, &dash_len_min, &dash_len_max, &eom_len_min, &eom_len_max, &eom_len_ideal, &eoc_len_min, &eoc_len_max, &eoc_len_ideal, &adaptive_speed_threshold); cw_rec_delete_internal(&rec); printf("libcw/rec: cw_get_receive_parameters():\n" \ "libcw/rec: dot/dash: %d, %d, %d, %d, %d, %d\n" \ "libcw/rec: eom: %d, %d, %d\n" \ "libcw/rec: eoc: %d, %d, %d\n" \ "libcw/rec: threshold: %d\n", dot_len_ideal, dash_len_ideal, dot_len_min, dot_len_max, dash_len_min, dash_len_max, eom_len_min, eom_len_max, eom_len_ideal, eoc_len_min, eoc_len_max, eoc_len_ideal, adaptive_speed_threshold); cw_assert (dot_len_ideal > 0 && dash_len_ideal > 0 && dot_len_min > 0 && dot_len_max > 0 && dash_len_min > 0 && dash_len_max > 0 && eom_len_min > 0 && eom_len_max > 0 && eom_len_ideal > 0 && eoc_len_min > 0 && eoc_len_max > 0 && eoc_len_ideal > 0 && adaptive_speed_threshold > 0, "One of parameters is non-positive\n"); cw_assert (dot_len_max < dash_len_min, "Maximum dot length is no smaller than minimum dash length: %d - %d\n", dot_len_max, dash_len_min); cw_assert (dot_len_min < dot_len_ideal && dot_len_ideal < dot_len_max, "Inconsistency in dot lengths: %d - %d - %d\n", dot_len_min, dot_len_ideal, dot_len_max); cw_assert (dash_len_min < dash_len_ideal && dash_len_ideal < dash_len_max, "Inconsistency in dash lengths: %d - %d - %d\n", dash_len_min, dash_len_ideal, dash_len_max); cw_assert (eom_len_max < eoc_len_min, "Maximum eom length is no smaller than minimum eoc length: %d - %d\n", eom_len_max, eoc_len_min); cw_assert (eom_len_min < eom_len_ideal && eom_len_ideal < eom_len_max, "Inconsistency in eom lengths: %d - %d - %d\n", eom_len_min, eom_len_ideal, eom_len_max); cw_assert (eoc_len_min < eoc_len_ideal && eoc_len_ideal < eoc_len_max, "Inconsistency in eoc lengths: %d - %d - %d\n", eoc_len_min, eoc_len_ideal, eoc_len_max); int n = printf("libcw/rec: cw_rec_get_parameters_internal():"); CW_TEST_PRINT_TEST_RESULT (false, n); return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libcw_pa.c0000644000175000017500000002727712451073736016521 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_pa.c \brief PulseAudio audio sink. */ #include "config.h" #ifdef LIBCW_WITH_PULSEAUDIO #include #include #include #include #include /* dlopen() and related symbols */ #include #include #include #include #include #include "libcw.h" #include "libcw_pa.h" #include "libcw_debug.h" #include "libcw_utils.h" #include "libcw_gen.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; static pa_simple *cw_pa_simple_new_internal(pa_sample_spec *ss, pa_buffer_attr *ba, const char *device, const char *stream_name, int *error); static int cw_pa_dlsym_internal(void *handle); static int cw_pa_open_device_internal(cw_gen_t *gen); static void cw_pa_close_device_internal(cw_gen_t *gen); static int cw_pa_write_internal(cw_gen_t *gen); static struct { void *handle; pa_simple *(* pa_simple_new)(const char *server, const char *name, pa_stream_direction_t dir, const char *dev, const char *stream_name, const pa_sample_spec *ss, const pa_channel_map *map, const pa_buffer_attr *attr, int *error); void (* pa_simple_free)(pa_simple *s); int (* pa_simple_write)(pa_simple *s, const void *data, size_t bytes, int *error); pa_usec_t (* pa_simple_get_latency)(pa_simple *s, int *error); int (* pa_simple_drain)(pa_simple *s, int *error); size_t (* pa_usec_to_bytes)(pa_usec_t t, const pa_sample_spec *spec); char *(* pa_strerror)(int error); } cw_pa = { .handle = NULL, .pa_simple_new = NULL, .pa_simple_free = NULL, .pa_simple_write = NULL, .pa_simple_get_latency = NULL, .pa_simple_drain = NULL, .pa_usec_to_bytes = NULL, .pa_strerror = NULL }; static const pa_sample_format_t CW_PA_SAMPLE_FORMAT = PA_SAMPLE_S16LE; /* Signed 16 bit, Little Endian */ static const int CW_PA_BUFFER_N_SAMPLES = 1024; /** \brief Check if it is possible to open PulseAudio output Function first tries to load PulseAudio library, and then does a test opening of PulseAudio output, but it closes it before returning. \param device - sink device, NULL for default PulseAudio device \return true if opening PulseAudio output succeeded; \return false if opening PulseAudio output failed; */ bool cw_is_pa_possible(const char *device) { const char *library_name = "libpulse-simple.so"; if (!cw_dlopen_internal(library_name, &(cw_pa.handle))) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: can't access PulseAudio library \"%s\"", library_name); return false; } int rv = cw_pa_dlsym_internal(cw_pa.handle); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: failed to resolve PulseAudio symbol #%d, can't correctly load PulseAudio library", rv); dlclose(cw_pa.handle); return false; } const char *dev = (char *) NULL; if (device && strcmp(device, CW_DEFAULT_PA_DEVICE)) { dev = device; } pa_sample_spec ss; pa_buffer_attr ba; int error = 0; pa_simple *s = cw_pa_simple_new_internal(&ss, &ba, dev, "cw_is_pa_possible()", &error); if (!s) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: can't connect to PulseAudio server: %s", cw_pa.pa_strerror(error)); if (cw_pa.handle) { dlclose(cw_pa.handle); } return false; } else { cw_pa.pa_simple_free(s); s = NULL; return true; } } int cw_pa_configure(cw_gen_t *gen, const char *dev) { assert (gen); gen->audio_system = CW_AUDIO_PA; cw_gen_set_audio_device_internal(gen, dev); gen->open_device = cw_pa_open_device_internal; gen->close_device = cw_pa_close_device_internal; gen->write = cw_pa_write_internal; return CW_SUCCESS; } int cw_pa_write_internal(cw_gen_t *gen) { assert (gen); assert (gen->audio_system == CW_AUDIO_PA); int error = 0; size_t n_bytes = sizeof (gen->buffer[0]) * gen->buffer_n_samples; int rv = cw_pa.pa_simple_write(gen->pa_data.s, gen->buffer, n_bytes, &error); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: pa_simple_write() failed: %s", cw_pa.pa_strerror(error)); } else { //cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "libcw_pa: written %d samples with PulseAudio", gen->buffer_n_samples); } return CW_SUCCESS; } /** \brief Wrapper for pa_simple_new() Wrapper for pa_simple_new() and related code. The code block contained in the function is useful in two different places: when first probing if PulseAudio output is available, and when opening PulseAudio output for writing. On success the function returns pointer to PulseAudio sink open for writing (playback). The function tries to set up buffering parameters for minimal latency, but it doesn't try too hard. The function *does not* set size of audio buffer in libcw's generator. \param ss - sample spec data, non-NULL pointer to variable owned by caller \param ba - buffer attributes data, non-NULL pointer to variable owned by caller \param device - name of PulseAudio device to be used, or NULL for default device \param stream_name - descriptive name of client, passed to pa_simple_new \param error - output, pointer to variable storing potential PulseAudio error code \return pointer to new PulseAudio sink on success \return NULL on failure */ pa_simple *cw_pa_simple_new_internal(pa_sample_spec *ss, pa_buffer_attr *ba, const char *device, const char *stream_name, int *error) { ss->format = CW_PA_SAMPLE_FORMAT; ss->rate = 44100; ss->channels = 1; const char *dev = (char *) NULL; /* NULL - let PulseAudio use default device */ if (device && strcmp(device, CW_DEFAULT_PA_DEVICE)) { dev = device; /* non-default device */ } // http://www.mail-archive.com/pulseaudio-tickets@mail.0pointer.de/msg03295.html ba->tlength = cw_pa.pa_usec_to_bytes(50*1000, ss); ba->minreq = cw_pa.pa_usec_to_bytes(0, ss); ba->maxlength = cw_pa.pa_usec_to_bytes(50*1000, ss); /* ba->prebuf = ; */ /* ? */ /* ba->fragsize = sizeof(uint32_t) -1; */ /* not relevant to playback */ pa_simple *s = cw_pa.pa_simple_new(NULL, /* server name (NULL for default) */ "libcw", /* descriptive name of client (application name etc.) */ PA_STREAM_PLAYBACK, /* stream direction */ dev, /* device/sink name (NULL for default) */ stream_name, /* stream name, descriptive name for this client (application name, song title, etc.) */ ss, /* sample specification */ NULL, /* channel map (NULL for default) */ ba, /* buffering attributes (NULL for default) */ error); /* error buffer (when routine returns NULL) */ return s; } /** \brief Resolve/get symbols from PulseAudio library Function resolves/gets addresses of few PulseAudio functions used by libcw and stores them in cw_pa global variable. On failure the function returns negative value, different for every symbol that the funciton failed to resolve. Function stops and returns on first failure. \param handle - handle to open PulseAudio library \return 0 on success \return negative value on failure */ int cw_pa_dlsym_internal(void *handle) { *(void **) &(cw_pa.pa_simple_new) = dlsym(handle, "pa_simple_new"); if (!cw_pa.pa_simple_new) return -1; *(void **) &(cw_pa.pa_simple_free) = dlsym(handle, "pa_simple_free"); if (!cw_pa.pa_simple_free) return -2; *(void **) &(cw_pa.pa_simple_write) = dlsym(handle, "pa_simple_write"); if (!cw_pa.pa_simple_write) return -3; *(void **) &(cw_pa.pa_strerror) = dlsym(handle, "pa_strerror"); if (!cw_pa.pa_strerror) return -4; *(void **) &(cw_pa.pa_simple_get_latency) = dlsym(handle, "pa_simple_get_latency"); if (!cw_pa.pa_simple_get_latency) return -5; *(void **) &(cw_pa.pa_simple_drain) = dlsym(handle, "pa_simple_drain"); if (!cw_pa.pa_simple_drain) return -6; *(void **) &(cw_pa.pa_usec_to_bytes) = dlsym(handle, "pa_usec_to_bytes"); if (!cw_pa.pa_usec_to_bytes) return -7; return 0; } /** \brief Open PulseAudio output, associate it with given generator You must use cw_gen_set_audio_device_internal() before calling this function. Otherwise generator \p gen won't know which device to open. \param gen - current generator \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_pa_open_device_internal(cw_gen_t *gen) { const char *dev = (char *) NULL; /* NULL - let PulseAudio use default device */ if (gen->audio_device && strcmp(gen->audio_device, CW_DEFAULT_PA_DEVICE)) { dev = gen->audio_device; /* non-default device */ } int error = 0; gen->pa_data.s = cw_pa_simple_new_internal(&gen->pa_data.ss, &gen->pa_data.ba, dev, gen->client.name ? gen->client.name : "app", &error); if (!gen->pa_data.s) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: can't connect to PulseAudio server: %s", cw_pa.pa_strerror(error)); return false; } gen->buffer_n_samples = CW_PA_BUFFER_N_SAMPLES; gen->sample_rate = gen->pa_data.ss.rate; if ((gen->pa_data.latency_usecs = cw_pa.pa_simple_get_latency(gen->pa_data.s, &error)) == (pa_usec_t) -1) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: pa_simple_get_latency() failed: %s", cw_pa.pa_strerror(error)); } #if CW_DEV_RAW_SINK gen->dev_raw_sink = open("/tmp/cw_file.pa.raw", O_WRONLY | O_TRUNC | O_NONBLOCK); #endif assert (gen && gen->pa_data.s); return CW_SUCCESS; } /** \brief Close PulseAudio device associated with current generator */ void cw_pa_close_device_internal(cw_gen_t *gen) { if (gen->pa_data.s) { /* Make sure that every single sample was played */ int error; if (cw_pa.pa_simple_drain(gen->pa_data.s, &error) < 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_pa: pa_simple_drain() failed: %s", cw_pa.pa_strerror(error)); } cw_pa.pa_simple_free(gen->pa_data.s); gen->pa_data.s = NULL; } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "libcw_pa: called the function for NULL PA sink"); } if (cw_pa.handle) { dlclose(cw_pa.handle); } #if CW_DEV_RAW_SINK if (gen->dev_raw_sink != -1) { close(gen->dev_raw_sink); gen->dev_raw_sink = -1; } #endif return; } #else /* #ifdef LIBCW_WITH_PULSEAUDIO */ #include #include "libcw_pa.h" bool cw_is_pa_possible(__attribute__((unused)) const char *device) { return false; } int cw_pa_configure(__attribute__((unused)) cw_gen_t *gen, __attribute__((unused)) const char *device) { return CW_FAILURE; } #endif /* #ifdef LIBCW_WITH_PULSEAUDIO */ unixcw-3.4.2/src/libcw/libcw_alsa.h0000644000175000017500000000103612365203675017030 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_ALSA #define H_LIBCW_ALSA #include "config.h" #ifdef LIBCW_WITH_ALSA #include typedef struct cw_alsa_data_struct { snd_pcm_t *handle; /* Output handle for audio data. */ } cw_alsa_data_t; #endif /* #ifdef LIBCW_WITH_ALSA */ #include "libcw_gen.h" int cw_alsa_configure(cw_gen_t *gen, const char *device); void cw_alsa_drop(cw_gen_t *gen); #endif /* #ifndef H_LIBCW_ALSA */ unixcw-3.4.2/src/libcw/libcw_key.h0000644000175000017500000001216012501051672016666 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_KEY #define H_LIBCW_KEY #include #include "libcw_gen.h" #include "libcw_rec.h" /* KS stands for Keyer State. */ enum { KS_IDLE, KS_IN_DOT_A, KS_IN_DASH_A, KS_AFTER_DOT_A, KS_AFTER_DASH_A, KS_IN_DOT_B, KS_IN_DASH_B, KS_AFTER_DOT_B, KS_AFTER_DASH_B }; struct cw_key_struct { /* Straight key and iambic keyer needs a generator to produce a sound on "Key Down" events. Maybe we don't always need a sound, but sometimes we do want to have it. Additionally iambic keyer needs a generator for timing purposes. In any case - a key needs to have access to a generator (but a generator doesn't need a key). This is why the key data type has a "generator" field, not the other way around. */ cw_gen_t *gen; /* There should be a binding between key and a receiver. The receiver can get it's properly formed input data (key down/key up events) from any source, so it's independent from key. On the other hand the key without receiver is rather useless. Therefore I think that the key should contain reference to a receiver, not the other way around. */ cw_rec_t *rec; /* External "on key state change" callback function and its argument. It may be useful for a client to have this library control an external keying device, for example, an oscillator, or a transmitter. Here is where we keep the address of a function that is passed to us for this purpose, and a void* argument for it. */ void (*key_callback)(void*, int); void *key_callback_arg; /* Straight key. */ struct { int key_value; /* Open/Closed, Space/Mark, NoSound/Sound. */ } sk; /* Iambic keyer. The keyer functions maintain the current known state of the paddles, and latch false-to-true transitions while busy, to form the iambic effect. For Curtis mode B, the keyer also latches any point where both paddle states are true at the same time. */ struct { int graph_state; /* State of iambic keyer state machine. */ int key_value; /* Open/Closed, Space/Mark, NoSound/Sound. */ bool dot_paddle; /* Dot paddle state */ bool dash_paddle; /* Dash paddle state */ bool dot_latch; /* Dot false->true latch */ bool dash_latch; /* Dash false->true latch */ /* Iambic keyer "Curtis" mode A/B selector. Mode A and mode B timings differ slightly, and some people have a preference for one or the other. Mode A is a bit less timing-critical, so we'll make that the default. */ bool curtis_mode_b; bool curtis_b_latch; /* Curtis Dot&Dash latch */ bool lock; /* FIXME: describe why we need this flag. */ struct timeval *timer; /* Timer for receiving of iambic keying, owned by client code. */ /* Generator associated with the keyer. Should never be NULL as iambic keyer *needs* a generator to function properly (and to generate audible tones). Set using cw_key_register_generator_internal(). */ /* No separate generator, use cw_key_t->gen. */ } ik; /* Tone-queue key. */ struct { int key_value; /* Open/Closed, Space/Mark, NoSound/Sound. */ } tk; }; typedef struct cw_key_struct cw_key_t; void cw_key_tk_set_value_internal(volatile cw_key_t *key, int key_state); void cw_key_register_generator_internal(volatile cw_key_t *key, cw_gen_t *gen); void cw_key_register_receiver_internal(volatile cw_key_t *key, cw_rec_t *rec); int cw_key_ik_update_graph_state_internal(volatile cw_key_t *keyer); void cw_key_ik_increment_timer_internal(volatile cw_key_t *keyer, int usecs); void cw_key_register_keying_callback_internal(volatile cw_key_t *key, void (*callback_func)(void*, int), void *callback_arg); void cw_key_ik_register_timer_internal(volatile cw_key_t *key, struct timeval *timer); void cw_key_ik_enable_curtis_mode_b_internal(volatile cw_key_t *key); void cw_key_ik_disable_curtis_mode_b_internal(volatile cw_key_t *key); bool cw_key_ik_get_curtis_mode_b_state_internal(volatile cw_key_t *key); int cw_key_ik_notify_paddle_event_internal(volatile cw_key_t *key, int dot_paddle_state, int dash_paddle_state); int cw_key_ik_notify_dash_paddle_event_internal(volatile cw_key_t *key, int dash_paddle_state); int cw_key_ik_notify_dot_paddle_event_internal(volatile cw_key_t *key, int dot_paddle_state); void cw_key_ik_get_paddles_internal(volatile cw_key_t *key, int *dot_paddle_state, int *dash_paddle_state); void cw_key_ik_get_paddle_latches_internal(volatile cw_key_t *key, int *dot_paddle_latch_state, int *dash_paddle_latch_state); bool cw_key_ik_is_busy_internal(volatile cw_key_t *key); int cw_key_ik_wait_for_element_internal(volatile cw_key_t *key); int cw_key_ik_wait_for_keyer_internal(volatile cw_key_t *key); void cw_key_ik_reset_internal(volatile cw_key_t *key); int cw_key_sk_notify_event_internal(volatile cw_key_t *key, int key_state); int cw_key_sk_get_state_internal(volatile cw_key_t *key); bool cw_key_sk_is_busy_internal(volatile cw_key_t *key); void cw_key_sk_reset_internal(volatile cw_key_t *key); #endif // #ifndef H_LIBCW_KEY unixcw-3.4.2/src/libcw/libcw_tq.h0000644000175000017500000001755712501055335016541 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_TQ #define H_LIBCW_TQ #include /* uint32_t */ #include /* pthread_mutex_t */ #include /* bool */ /* Right now there is no function that would calculate number of tones representing given character or string, so there is no easy way to present exact relationship between capacity of tone queue and number of characters that it can hold. TODO: perhaps we could write utility functions to do that calculation? */ /* TODO: create tests that validate correctness of handling of tone queue capacity. See if we really handle the capacity correctly. */ enum { /* Default and maximum values of two basic parameters of tone queue: capacity and high water mark. The parameters can be modified using suitable function. */ /* Tone queue will accept at most "capacity" tones. */ CW_TONE_QUEUE_CAPACITY_MAX = 3000, /* ~= 5 minutes at 12 WPM */ /* Tone queue will refuse to accept new tones (characters?) if number of tones in queue (queue length) is already equal or larger than queue's high water mark. */ CW_TONE_QUEUE_HIGH_WATER_MARK_MAX = 2900 }; /* Tone queue states. */ enum cw_queue_state { CW_TQ_IDLE = 0, CW_TQ_BUSY = 1 }; /* Return values from dequeue function. */ enum { CW_TQ_DEQUEUED = 10, CW_TQ_NDEQUEUED_EMPTY = 11, CW_TQ_NDEQUEUED_IDLE = 12 }; typedef struct { /* Frequency of a tone. */ int frequency; /* Length of a tone, in microseconds. */ int len; /* Is this "forever" tone? See libcw_tq.c for more info about "forever" tones. */ bool forever; /* Type of slope. */ int slope_mode; /* Duration of a tone, in samples. This is a derived value, a function of lenght and sample rate. */ /* TODO: come up with thought-out, consistent type system for samples and tone length. The type system should take into consideration very long duration of tones in QRSS. */ int64_t n_samples; /* Counter of samples in whole tone. */ int sample_iterator; /* a tone can start and/or end abruptly (which may result in audible clicks), or its beginning and/or end can have form of slopes (ramps), where amplitude increases/decreases less abruptly than if there were no slopes; using slopes reduces audible clicks at the beginning/end of tone, and can be used to shape spectrum of a tone; AFAIK most desired shape of a slope looks like sine wave; most simple one is just a linear slope; slope area should be integral part of a tone, i.e. it shouldn't make the tone longer than len/n_samples; a tone with rising and falling slope should have this length (in samples): rising_slope_n_samples + (n_samples - 2 * slope_n_samples) + falling_slope_n_samples libcw allows following slope area scenarios (modes): 1. no slopes: tone shouldn't have any slope areas (i.e. tone with constant amplitude); 1.a. a special case of this mode is silent tone - amplitude of a tone is zero for whole duration of the tone; 2. tone has nothing more than a single slope area (rising or falling); there is no area with constant amplitude; 3. a regular tone, with area of rising slope, then area with constant amplitude, and then falling slope; currently, if a tone has both slopes (rising and falling), both slope areas have to have the same length; */ int rising_slope_n_samples; /* Number of samples on rising slope. */ int falling_slope_n_samples; /* Number of samples on falling slope. */ } cw_tone_t; /* Set values of tone's fields. Some field are set with values given as arguments to the macro. Other are initialized with default values. The macro should be used like this: cw_tone_t my_tone; CW_TONE_INIT(&tone, 200, 5000, CW_SLOPE_MODE_STANDARD_SLOPES); */ #define CW_TONE_INIT(m_tone, m_frequency, m_len, m_slope_mode) { \ (m_tone)->frequency = m_frequency; \ (m_tone)->len = m_len; \ (m_tone)->slope_mode = m_slope_mode; \ (m_tone)->forever = false; \ (m_tone)->n_samples = 0; \ (m_tone)->sample_iterator = 0; \ (m_tone)->rising_slope_n_samples = 0; \ (m_tone)->falling_slope_n_samples = 0; \ } /* Copy values of all fields from one variable of cw_tone_t type to the other. The macro accepts pointers to cw_tone_t variables as arguments. */ #define CW_TONE_COPY(m_dest, m_source) { \ (m_dest)->frequency = (m_source)->frequency; \ (m_dest)->len = (m_source)->len; \ (m_dest)->slope_mode = (m_source)->slope_mode; \ (m_dest)->forever = (m_source)->forever; \ (m_dest)->n_samples = (m_source)->n_samples; \ (m_dest)->sample_iterator = (m_source)->sample_iterator; \ (m_dest)->rising_slope_n_samples = (m_source)->rising_slope_n_samples; \ (m_dest)->falling_slope_n_samples = (m_source)->falling_slope_n_samples; \ }; struct cw_gen_struct; typedef struct { volatile cw_tone_t queue[CW_TONE_QUEUE_CAPACITY_MAX]; /* Tail index of tone queue. Index of last (newest) inserted tone, index of tone to be dequeued from the list as a last one. The index is incremented *after* adding a tone to queue. */ volatile uint32_t tail; /* Head index of tone queue. Index of first (oldest) tone inserted to the queue. Index of the tone to be dequeued from the queue as a first one. */ volatile uint32_t head; volatile enum cw_queue_state state; uint32_t capacity; uint32_t high_water_mark; uint32_t len; /* It's useful to have the tone queue dequeue function call a client-supplied callback routine when the amount of data in the queue drops below a defined low water mark. This routine can then refill the buffer, as required. */ volatile uint32_t low_water_mark; void (*low_water_callback)(void*); void *low_water_callback_arg; /* Set to true when conditions for calling low water callback are true. The flag is set in cw_tq module, but the callback itself may be called outside of the module, e.g. by cw_gen code. */ bool call_callback; pthread_mutex_t mutex; /* Generator associated with a tone queue. */ struct cw_gen_struct *gen; } cw_tone_queue_t; cw_tone_queue_t *cw_tq_new_internal(void); void cw_tq_delete_internal(cw_tone_queue_t **tq); void cw_tq_flush_internal(cw_tone_queue_t *tq); uint32_t cw_tq_get_capacity_internal(cw_tone_queue_t *tq); uint32_t cw_tq_length_internal(cw_tone_queue_t *tq); int cw_tq_enqueue_internal(cw_tone_queue_t *tq, cw_tone_t *tone); int cw_tq_dequeue_internal(cw_tone_queue_t *tq, cw_tone_t *tone); int cw_tq_wait_for_level_internal(cw_tone_queue_t *tq, uint32_t level); int cw_tq_register_low_level_callback_internal(cw_tone_queue_t *tq, void (*callback_func)(void*), void *callback_arg, int level); bool cw_tq_is_busy_internal(cw_tone_queue_t *tq); int cw_tq_wait_for_tone_internal(cw_tone_queue_t *tq); int cw_tq_wait_for_tone_queue_internal(cw_tone_queue_t *tq); void cw_tq_reset_internal(cw_tone_queue_t *tq); bool cw_tq_is_full_internal(cw_tone_queue_t *tq); #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_tq_new_delete_internal(void); unsigned int test_cw_tq_init_internal(void); unsigned int test_cw_tq_get_capacity_internal(void); unsigned int test_cw_tq_prev_index_internal(void); unsigned int test_cw_tq_next_index_internal(void); unsigned int test_cw_tq_length_internal(void); unsigned int test_cw_tq_enqueue_dequeue_internal(void); unsigned int test_cw_tq_enqueue_internal_2(void); unsigned int test_cw_tq_is_full_internal(void); unsigned int test_cw_tq_test_capacity_1(void); unsigned int test_cw_tq_test_capacity_2(void); unsigned int test_cw_queue_tone(void); #endif /* #ifdef LIBCW_UNIT_TESTS */ #endif /* #ifndef H_LIBCW_TQ */ unixcw-3.4.2/src/libcw/libcw_console.h0000644000175000017500000000062512365202441017543 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_CONSOLE #define H_LIBCW_CONSOLE #include "libcw_gen.h" #include "libcw_tq.h" int cw_console_configure(cw_gen_t *gen, const char *device); int cw_console_write(cw_gen_t *gen, cw_tone_t *tone); void cw_console_silence(cw_gen_t *gen); #endif /* #ifndef H_LIBCW_CONSOLE */ unixcw-3.4.2/src/libcw/libcw_debug.c0000644000175000017500000002437612451074154017177 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ /** \file libcw_debug.c \brief An attempt to create some smart debugging facility to libcw and applications using the library. */ #include "config.h" #define _BSD_SOURCE /* usleep() */ #define _POSIX_SOURCE /* sigaction() */ #define _POSIX_C_SOURCE 200112L /* pthread_sigmask() */ #include #include #include #include #include #include #include "libcw.h" #include "libcw_debug.h" #include "libcw_gen.h" #include "libcw_utils.h" struct { int flag; const char *message; } cw_debug_event_strings[] = { { CW_DEBUG_EVENT_TONE_LOW, "CW_DEBUG_EVENT_TONE_LOW" }, { CW_DEBUG_EVENT_TONE_MID, "CW_DEBUG_EVENT_TONE_MID" }, { CW_DEBUG_EVENT_TONE_HIGH, "CW_DEBUG_EVENT_TONE_HIGH" }, { CW_DEBUG_EVENT_TQ_JUST_EMPTIED, "CW_DEBUG_EVENT_TQ_JUST_EMPTIED" }, { CW_DEBUG_EVENT_TQ_NONEMPTY, "CW_DEBUG_EVENT_TQ_NONEMPTY" }, { CW_DEBUG_EVENT_TQ_STILL_EMPTY, "CW_DEBUG_EVENT_TQ_STILL_EMPTY" } }; /* Human-readable labels for debug levels. Other modules can access the table only through pointer in debug object. I don't expose this table (by making it globally visible) to decrease number of 'extern' declarations. */ static const char *cw_debug_level_labels[] = { "DD", "II", "WW", "EE" }; cw_debug_t cw_debug_object = { .flags = CW_DEBUG_STDLIB | CW_DEBUG_SOUND_SYSTEM, //CW_DEBUG_TONE_QUEUE; //CW_DEBUG_KEYER_STATES | CW_DEBUG_STRAIGHT_KEY | CW_DEBUG_KEYING; // | CW_DEBUG_TONE_QUEUE;, .n = 0, .n_max = 1, .level = CW_DEBUG_NONE, .level_labels = cw_debug_level_labels }; cw_debug_t cw_debug_object_dev = { .flags = CW_DEBUG_SOUND_SYSTEM, .n = 0, .n_max = 1, .level = CW_DEBUG_NONE, .level_labels = cw_debug_level_labels }; cw_debug_t cw_debug_object_ev = { .flags = 0, .n = 0, .n_max = CW_DEBUG_N_EVENTS_MAX, .level = CW_DEBUG_NONE, .level_labels = cw_debug_level_labels }; static void cw_debug_flush(cw_debug_t *debug_object); /** \brief Write all events from the debug object to a file Function writes all events stored in the \p debug object to file associated with the object, and removes the events. List of events is preceded with "FLUSH START\n" line, and followed by "FLUSH END\n" line. \param debug - debug object */ void cw_debug_flush(cw_debug_t *debug) { if (debug->n <= 0) { return; } long long int diff = debug->events[debug->n - 1].sec - debug->events[0].sec; diff = debug->events[debug->n - 1].sec - diff - 1; fprintf(stderr, "FLUSH START\n"); for (int i = 0; i < debug->n; i++) { fprintf(stderr, "libcwevent:\t%06lld%06lld\t%s\n", debug->events[i].sec - diff, debug->events[i].usec, cw_debug_event_strings[debug->events[i].event].message); } fprintf(stderr, "FLUSH END\n"); fflush(stderr); return; } /** \brief Set a value of internal debug flags variable Assign specified value to library's internal debug flags variable. Note that this function doesn't *append* given flag to the variable, it erases existing value and assigns new one. Use cw_get_debug_flags() if you want to OR new flag with existing ones. \param new_value - new value to be assigned to the library */ void cw_set_debug_flags(uint32_t flags) { cw_debug_object.flags = flags; return; } /** testedin::test_cw_debug_flags() */ void cw_debug_set_flags(cw_debug_t *debug_object, uint32_t flags) { debug_object->flags = flags; return; } /** \brief Get current library's debug flags Function returns value of library's internal debug variable. \return value of library's debug flags variable */ uint32_t cw_get_debug_flags(void) { /* TODO: extract reading LIBCW_DEBUG env variable to separate function. */ static bool is_initialized = false; if (!is_initialized) { /* Do not overwrite any debug flags already set. */ if (cw_debug_object.flags == 0) { /* * Set the debug flags from LIBCW_DEBUG. If it is an invalid * numeric, treat it as 0; there is no error checking. */ const char *debug_value = getenv("LIBCW_DEBUG"); if (debug_value) { cw_debug_object.flags = strtoul(debug_value, NULL, 0); } } is_initialized = true; } return cw_debug_object.flags; } /** testedin::test_cw_debug_flags() */ uint32_t cw_debug_get_flags(cw_debug_t *debug_object) { /* FIXME: what about initialization? */ return debug_object->flags; } /** \brief Check if given debug flag is set Function checks if a specified debug flag is set in internal variable of libcw library. \param flag - flag to be checked. \return true if given flag is set \return false if given flag is not set */ bool cw_debug_has_flag(cw_debug_t *debug_object, uint32_t flag) { if (debug_object) { return debug_object->flags & flag; } else { return false; } } #ifdef LIBCW_WITH_DEV void cw_dev_debug_print_generator_setup(cw_gen_t *gen) { fprintf(stderr, "audio system: %s\n", cw_get_audio_system_label(gen->audio_system)); if (gen->audio_system == CW_AUDIO_OSS) { fprintf(stderr, "OSS version %X.%X.%X\n", gen->oss_version.x, gen->oss_version.y, gen->oss_version.z); } fprintf(stderr, "audio device: \"%s\"\n", gen->audio_device); fprintf(stderr, "sample rate: %d Hz\n", gen->sample_rate); #ifdef LIBCW_WITH_PULSEAUDIO if (gen->audio_system == CW_AUDIO_PA) { fprintf(stderr, "PulseAudio latency: %llu us\n", (unsigned long long int) gen->pa_data.latency_usecs); if (gen->pa_data.ba.prebuf == (uint32_t) -1) { fprintf(stderr, "PulseAudio prebuf: (not set)\n"); } else { fprintf(stderr, "PulseAudio prebuf: %u bytes\n", (uint32_t) gen->pa_data.ba.prebuf); } if (gen->pa_data.ba.tlength == (uint32_t) -1) { fprintf(stderr, "PulseAudio tlength: (not set)\n"); } else { fprintf(stderr, "PulseAudio tlength: %u bytes\n", (uint32_t) gen->pa_data.ba.tlength); } if (gen->pa_data.ba.minreq == (uint32_t) -1) { fprintf(stderr, "PulseAudio minreq: (not set)\n"); } else { fprintf(stderr, "PulseAudio minreq: %u bytes\n", (uint32_t) gen->pa_data.ba.minreq); } if (gen->pa_data.ba.maxlength == (uint32_t) -1) { fprintf(stderr, "PulseAudio maxlength: (not set)\n"); } else { fprintf(stderr, "PulseAudio maxlength: %u bytes\n", (uint32_t) gen->pa_data.ba.maxlength); } #if 0 /* not relevant to playback */ if (gen->pa_data.ba.fragsize == (uint32_t) -1) { fprintf(stderr, "PulseAudio fragsize: (not set)\n"); } else { fprintf(stderr, "PulseAudio fragsize: %u bytes\n", (uint32_t) gen->pa_data.ba.fragsize); } #endif } #endif // #ifdef LIBCW_WITH_PULSEAUDIO fprintf(stderr, "send speed: %d wpm\n", gen->send_speed); fprintf(stderr, "volume: %d %%\n", gen->volume_percent); fprintf(stderr, "frequency: %d Hz\n", gen->frequency); fprintf(stderr, "audio buffer size: %d\n", gen->buffer_n_samples); fprintf(stderr, "debug sink file: %s\n", gen->dev_raw_sink != -1 ? "yes" : "no"); return; } int cw_dev_debug_raw_sink_write_internal(cw_gen_t *gen) { if (gen->audio_system == CW_AUDIO_NONE || gen->audio_system == CW_AUDIO_NULL || gen->audio_system == CW_AUDIO_CONSOLE) { return CW_SUCCESS; } if (gen->dev_raw_sink != -1) { #if CW_DEV_RAW_SINK_MARKERS /* FIXME: this will cause memory access error at the end, when generator is destroyed in the other thread */ gen->buffer[0] = 0x7fff; gen->buffer[1] = 0x7fff; gen->buffer[samples - 2] = 0x8000; gen->buffer[samples - 1] = 0x8000; #endif int n_bytes = sizeof (gen->buffer[0]) * gen->buffer_n_samples; int rv = write(gen->dev_raw_sink, gen->buffer, n_bytes); if (rv == -1) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw_debug: write error: %s (gen->dev_raw_sink = %ld, gen->buffer = %ld, n_bytes = %d)", strerror(errno), (long) gen->dev_raw_sink, (long) gen->buffer, n_bytes); return CW_FAILURE; } } return CW_SUCCESS; } void cw_debug_event_internal(cw_debug_t *debug_object, uint32_t flag, uint32_t event, const char *func, int line) { if (!debug_object) { return; } if (!cw_debug_has_flag(debug_object, flag)) { return; } struct timeval now; gettimeofday(&now, NULL); debug_object->events[debug_object->n].event = event; debug_object->events[debug_object->n].sec = (long long int) now.tv_sec; debug_object->events[debug_object->n].usec = (long long int) now.tv_usec; debug_object->n++; if (debug_object->n >= debug_object->n_max) { cw_debug_flush(debug_object); debug_object->n = 0; } return; } #endif /* #ifdef LIBCW_WITH_DEV */ /* Unit tests. */ #ifdef LIBCW_UNIT_TESTS #include #include "libcw_test.h" /** \brief Test getting and setting of debug flags. tests::cw_debug_set_flags() tests::cw_debug_get_flags() */ unsigned int test_cw_debug_flags_internal(void) { /* Store current flags for period of tests. */ uint32_t flags_backup = cw_debug_get_flags(&cw_debug_object); for (uint32_t i = 1; i <= CW_DEBUG_MASK; i++) { cw_debug_set_flags(&cw_debug_object, i); cw_assert ((&cw_debug_object)->flags & i, "Failed to set debug flag %"PRIu32"\n", i); cw_assert (cw_debug_get_flags(&cw_debug_object) == i, "Failed to get debug flag %"PRIu32"\n", i); } int n = printf("libcw/debug: cw_debug_set/get_flags():"); CW_TEST_PRINT_TEST_RESULT (false, n); /* Restore original flags. */ cw_debug_set_flags(&cw_debug_object, flags_backup); return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libcw_utils.h0000644000175000017500000000253112475413003017237 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_UTILS #define H_LIBCW_UTILS #include "config.h" #include #include /* Microseconds in a second, for struct timeval handling. */ enum { CW_USECS_PER_SEC = 1000000 }; /* Nanoseconds in a second, for struct timespec. */ enum { CW_NSECS_PER_SEC = 1000000000 }; int cw_timestamp_compare_internal(const struct timeval *earlier, const struct timeval *later); int cw_timestamp_validate_internal(struct timeval *out_timestamp, const struct timeval *in_timestamp); void cw_usecs_to_timespec_internal(struct timespec *t, int usecs); void cw_nanosleep_internal(struct timespec *n); #if (defined(LIBCW_WITH_ALSA) || defined(LIBCW_WITH_PULSEAUDIO)) bool cw_dlopen_internal(const char *name, void **handle); #endif void cw_finalization_schedule_internal(void); void cw_finalization_cancel_internal(void); #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_timestamp_compare_internal(void); unsigned int test_cw_timestamp_validate_internal(void); unsigned int test_cw_usecs_to_timespec_internal(void); unsigned int test_cw_version_internal(void); unsigned int test_cw_license_internal(void); unsigned int test_cw_get_x_limits_internal(void); #endif /* #ifdef LIBCW_UNIT_TESTS */ #endif /* #ifndef H_LIBCW_UTILS */ unixcw-3.4.2/src/libcw/libcw_null.c0000644000175000017500000000466012501056107017047 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_null.c \brief Null audio sink. No sound is being played, but time periods necessary for generator to operate are being measured. */ #include #include #include #include #include "libcw_null.h" #include "libcw_utils.h" #include "libcw_gen.h" static int cw_null_open_device_internal(cw_gen_t *gen); static void cw_null_close_device_internal(cw_gen_t *gen); int cw_null_configure(cw_gen_t *gen, const char *device) { assert (gen); gen->audio_system = CW_AUDIO_NULL; cw_gen_set_audio_device_internal(gen, device); gen->open_device = cw_null_open_device_internal; gen->close_device = cw_null_close_device_internal; // gen->write = cw_null_write; /* The function is called in libcw.c explicitly/directly, not by a pointer. */ gen->sample_rate = 48000; /* Some asserts may check for non-zero value of sample rate or its derivatives. */ return CW_SUCCESS; } bool cw_is_null_possible(__attribute__((unused)) const char *device) { return true; } int cw_null_open_device_internal(cw_gen_t *gen) { gen->audio_device_is_open = true; return CW_SUCCESS; } void cw_null_close_device_internal(cw_gen_t *gen) { gen->audio_device_is_open = false; return; } void cw_null_write(__attribute__((unused)) cw_gen_t *gen, cw_tone_t *tone) { assert (gen); assert (gen->audio_system == CW_AUDIO_NULL); assert (tone->len >= 0); /* TODO: shouldn't the condition be "tone->len > 0"? */ struct timespec n = { .tv_sec = 0, .tv_nsec = 0 }; cw_usecs_to_timespec_internal(&n, tone->len); cw_nanosleep_internal(&n); return; } unixcw-3.4.2/src/libcw/libcw_utils.c0000644000175000017500000006506112502643660017246 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_utils.c \brief Utility functions that should be put in a common place. One of the utilities is cw_dlopen_internal() - a function that allowed me to drop compile-time dependency on ALSA libs and PulseAudio libs, and replace it with run-time dependency. You will find calls to dlclose() in libcw_alsa.c and libcw_pa.c. */ #include "config.h" #include #include #include #include #include #include /* dlopen() and related symbols */ #include /* strtol() */ #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #if (defined(__unix__) || defined(unix)) && !defined(USG) # include #endif #include "libcw.h" #include "libcw_gen.h" #include "libcw_test.h" #include "libcw_debug.h" #include "libcw_utils.h" #include "libcw_signal.h" #include "cw_copyright.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* Human-readable labels of audio systems. Indexed by values of "enum cw_audio_systems". */ static const char *cw_audio_system_labels[] = { "None", "Null", "Console", "OSS", "ALSA", "PulseAudio", "Soundcard" }; /* Finalization and cleanup. */ static void cw_finalization_clock_internal(void); /** \brief Return version number of libcw library Return the version number of the library. Version numbers (major and minor) are returned as an int, composed of major_version << 16 | minor_version. testedin::test_cw_version() \return library's major and minor version number encoded as single int */ int cw_version(void) { char *endptr = NULL; /* LIBCW_VERSION: "current:revision:age", libtool notation. */ long int current = strtol(LIBCW_VERSION, &endptr, 10); long int revision = strtol(endptr + 1, &endptr, 10); __attribute__((unused)) long int age = strtol(endptr + 1, &endptr, 10); // fprintf(stderr, "current:revision:age: %ld:%ld:%ld\n", current, revision, age); /* TODO: Return all three parts of library version. */ return ((int) current) << 16 | ((int) revision); } /** \brief Print libcw's license text to stdout testedin::test_cw_license() Function prints information about libcw version, followed by short text presenting libcw's copyright and license notice. */ void cw_license(void) { int version = cw_version(); int current = version >> 16; int revision = version & 0xff; printf("libcw version %d.%d\n", current, revision); printf("%s\n", CW_COPYRIGHT); return; } /** \brief Get a readable label of given audio system The function returns one of following strings: None, Null, Console, OSS, ALSA, PulseAudio, Soundcard Returned pointer is owned and managed by the library. TODO: change the declaration to "const char *const cw_get_audio_system_label(...)"? \param audio_system - ID of audio system \return audio system's label */ const char *cw_get_audio_system_label(int audio_system) { return cw_audio_system_labels[audio_system]; } /** \brief Convert microseconds to struct timespec Function fills fields of struct timespec \p t (seconds and nanoseconds) based on value of \p usecs. \p usecs should be non-negative. This function is just a simple wrapper for few lines of code. testedin::test_cw_usecs_to_timespec_internal() \param t - pointer to existing struct to be filled with data \param usecs - value to convert to timespec */ void cw_usecs_to_timespec_internal(struct timespec *t, int usecs) { assert (usecs >= 0); assert (t); int sec = usecs / 1000000; int usec = usecs % 1000000; t->tv_sec = sec; t->tv_nsec = usec * 1000; return; } /** \brief Sleep for period of time specified by given timespec Function sleeps for given amount of seconds and nanoseconds, as specified by \p n. The function uses nanosleep(), and can handle incoming SIGALRM signals that cause regular nanosleep() to return. The function calls nanosleep() until all time specified by \p n has elapsed. The function may sleep a little longer than specified by \p n if it needs to spend some time handling SIGALRM signal. Other restrictions from nanosleep()'s man page also apply. \param n - period of time to sleep */ void cw_nanosleep_internal(struct timespec *n) { struct timespec rem = { .tv_sec = n->tv_sec, .tv_nsec = n->tv_nsec }; int rv = 0; do { struct timespec req = { .tv_sec = rem.tv_sec, .tv_nsec = rem.tv_nsec }; //fprintf(stderr, " -- sleeping for %ld s, %ld ns\n", req.tv_sec, req.tv_nsec); rv = nanosleep(&req, &rem); if (rv) { //fprintf(stderr, " -- remains %ld s, %ld ns\n", rem.tv_sec, rem.tv_nsec); } } while (rv); return; } #if (defined(LIBCW_WITH_ALSA) || defined(LIBCW_WITH_PULSEAUDIO)) /** \brief Try to dynamically open shared library Function tries to open a shared library specified by \p name using dlopen() system function. On sucess, handle to open library is returned via \p handle. Name of the library should contain ".so" suffix, e.g.: "libasound.so.2", or "libpulse-simple.so". \param name - name of library to test \param handle - output argument, handle to open library \return true on success \return false otherwise */ bool cw_dlopen_internal(const char *name, void **handle) { assert (name); dlerror(); void *h = dlopen(name, RTLD_LAZY); char *e = dlerror(); if (e) { cw_debug_msg (((&cw_debug_object_dev)), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: dlopen() fails for %s with error: %s", name, e); return false; } else { *handle = h; cw_debug_msg (((&cw_debug_object_dev)), CW_DEBUG_STDLIB, CW_DEBUG_DEBUG, "libcw: dlopen() succeeds for %s", name); return true; } } #endif /** \brief Validate and return timestamp If an input timestamp \p in_timestamp is given (non-NULL pointer), validate it for correctness, and if valid, copy contents of \p in_timestamp into \p out_timestamp and return CW_SUCCESS. If \p in_timestamp is non-NULL and the timestamp is invalid, return CW_FAILURE with errno set to EINVAL. If \p in_timestamp is not given (NULL), get current time (with gettimeofday()), put it in \p out_timestamp and return CW_SUCCESS. If call to gettimeofday() fails, return CW_FAILURE. \p out_timestamp cannot be NULL. testedin::test_cw_timestamp_validate_internal() \param out_timestamp - timestamp to be used by client code after the function call \param in_timestamp - timestamp to be validated \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_timestamp_validate_internal(struct timeval *out_timestamp, const struct timeval *in_timestamp) { cw_assert (out_timestamp, "pointer to output timestamp is NULL"); if (in_timestamp) { if (in_timestamp->tv_sec < 0 || in_timestamp->tv_usec < 0 || in_timestamp->tv_usec >= CW_USECS_PER_SEC) { errno = EINVAL; return CW_FAILURE; } else { *out_timestamp = *in_timestamp; return CW_SUCCESS; } } else { if (gettimeofday(out_timestamp, NULL)) { if (out_timestamp->tv_usec < 0) { // fprintf(stderr, "Negative usecs in %s\n", __func__); } perror ("libcw: gettimeofday"); return CW_FAILURE; } else { return CW_SUCCESS; } } } /** \brief Compare two timestamps Compare two timestamps, and return the difference between them in microseconds, taking care to clamp values which would overflow an int. This routine always returns a positive integer in the range 0 to INT_MAX. testedin::test_cw_timestamp_compare_internal() \param earlier - timestamp to compare \param later - timestamp to compare \return difference between timestamps (in microseconds) */ int cw_timestamp_compare_internal(const struct timeval *earlier, const struct timeval *later) { /* Compare the timestamps, taking care on overflows. At 4 WPM, the dash length is 3*(1200000/4)=900,000 usecs, and the word gap is 2,100,000 usecs. With the maximum Farnsworth additional delay, the word gap extends to 20,100,000 usecs. This fits into an int with a lot of room to spare, in fact, an int can represent 2,147,483,647 usecs, or around 33 minutes. This is way, way longer than we'd ever want to differentiate, so if by some chance we see timestamps farther apart than this, and it ought to be very, very unlikely, then we'll clamp the return value to INT_MAX with a clear conscience. Note: passing nonsensical or bogus timevals in may result in unpredictable results. Nonsensical includes timevals with -ve tv_usec, -ve tv_sec, tv_usec >= 1,000,000, etc. To help in this, we check all incoming timestamps for "well-formedness". However, we assume the gettimeofday() call always returns good timevals. All in all, timeval could probably be a better thought-out structure. */ /* Calculate an initial delta, possibly with overflow. */ int delta_usec = (later->tv_sec - earlier->tv_sec) * CW_USECS_PER_SEC + later->tv_usec - earlier->tv_usec; /* Check specifically for overflow, and clamp if it did. */ if ((later->tv_sec - earlier->tv_sec) > (INT_MAX / CW_USECS_PER_SEC) + 1 || delta_usec < 0) { delta_usec = INT_MAX; // fprintf(stderr, "earlier = %10ld : %10ld\n", earlier->tv_sec, earlier->tv_usec); // fprintf(stderr, "later = %10ld : %10ld\n", later->tv_sec, later->tv_usec); } /* TODO: add somewhere a debug message informing that we are returning INT_MAX. */ return delta_usec; } /* Morse code controls and timing parameters. */ /** \brief Get speed limits Get (through function's arguments) limits on speed of morse code that can be generated by generator. See CW_SPEED_MIN and CW_SPEED_MAX in libcw.h for values. testedin::test_cw_get_x_limits() \param min_speed - minimal allowed speed \param max_speed - maximal allowed speed */ void cw_get_speed_limits(int *min_speed, int *max_speed) { if (min_speed) { *min_speed = CW_SPEED_MIN; } if (max_speed) { *max_speed = CW_SPEED_MAX; } return; } /** \brief Get frequency limits Get (through function's arguments) limits on frequency that can be generated by generator. See CW_FREQUENCY_MIN and CW_FREQUENCY_MAX in libcw.h for values. testedin::test_cw_get_x_limits() \param min_frequency - minimal allowed frequency \param max_frequency - maximal allowed frequency */ void cw_get_frequency_limits(int *min_frequency, int *max_frequency) { if (min_frequency) { *min_frequency = CW_FREQUENCY_MIN; } if (max_frequency) { *max_frequency = CW_FREQUENCY_MAX; } return; } /** \brief Get volume limits Get (through function's arguments) limits on volume of sound generated by generator. See CW_VOLUME_MIN and CW_VOLUME_MAX in libcw.h for values. testedin::test_cw_get_x_limits() testedin::test_volume_functions() \param min_volume - minimal allowed volume \param max_volume - maximal allowed volume */ void cw_get_volume_limits(int *min_volume, int *max_volume) { if (min_volume) { *min_volume = CW_VOLUME_MIN; } if (max_volume) { *max_volume = CW_VOLUME_MAX; } return; } /** \brief Get gap limits Get (through function's arguments) limits on gap in cw signal generated by generator. See CW_GAP_MIN and CW_GAP_MAX in libcw.h for values. testedin::test_cw_get_x_limits() \param min_gap - minimal allowed gap \param max_gap - maximal allowed gap */ void cw_get_gap_limits(int *min_gap, int *max_gap) { if (min_gap) { *min_gap = CW_GAP_MIN; } if (max_gap) { *max_gap = CW_GAP_MAX; } return; } /** \brief Get tolerance limits Get (through function's arguments) limits on "tolerance" parameter of generator. See CW_TOLERANCE_MIN and CW_TOLERANCE_MAX in libcw.h for values. testedin::test_cw_get_x_limits() \param min_tolerance - minimal allowed tolerance \param max_tolerance - maximal allowed tolerance */ void cw_get_tolerance_limits(int *min_tolerance, int *max_tolerance) { if (min_tolerance) { *min_tolerance = CW_TOLERANCE_MIN; } if (max_tolerance) { *max_tolerance = CW_TOLERANCE_MAX; } return; } /** \brief Get weighting limits Get (through function's arguments) limits on "weighting" parameter of generator. See CW_WEIGHTING_MIN and CW_WEIGHTING_MAX in libcw.h for values. testedin::test_cw_get_x_limits() \param min_weighting - minimal allowed weighting \param max_weighting - maximal allowed weighting */ void cw_get_weighting_limits(int *min_weighting, int *max_weighting) { if (min_weighting) { *min_weighting = CW_WEIGHTING_MIN; } if (max_weighting) { *max_weighting = CW_WEIGHTING_MAX; } return; } /* Finalization and cleanup. */ /* We prefer to close the soundcard after a period of library inactivity, so that other applications can use it. Ten seconds seems about right. We do it in one-second timeouts so that any leaked pending timeouts from other facilities don't cause premature finalization. */ static const int CW_AUDIO_FINALIZATION_DELAY = 10000000; /* Counter counting down the number of clock calls before we finalize. */ static volatile bool cw_is_finalization_pending = false; static volatile int cw_finalization_countdown = 0; /* Use a mutex to suppress delayed finalizations on complete resets. */ static volatile bool cw_is_finalization_locked_out = false; /** \brief Tick a finalization clock If finalization is pending, decrement the countdown, and if this reaches zero, we've waited long enough to release sound and timeouts. */ void cw_finalization_clock_internal(void) { if (cw_is_finalization_pending) { /* Decrement the timeout countdown, and finalize if we reach zero. */ cw_finalization_countdown--; if (cw_finalization_countdown <= 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_FINALIZATION, CW_DEBUG_INFO, "libcw: finalization timeout, closing down"); cw_sigalrm_restore_internal(); // cw_gen_release_internal(&cw_generator); cw_is_finalization_pending = false; cw_finalization_countdown = 0; } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_FINALIZATION, CW_DEBUG_INFO, "libcw: finalization countdown %d", cw_finalization_countdown); /* Request another timeout. This results in a call to our cw_finalization_cancel_internal below; to ensure that it doesn't really cancel finalization, unset the pending flag, then set it back again after reqesting the timeout. */ cw_is_finalization_pending = false; cw_timer_run_with_handler_internal(CW_USECS_PER_SEC, NULL); cw_is_finalization_pending = true; } } return; } /** Set the finalization pending flag, and request a timeout to call the finalization function after a delay of a few seconds. */ void cw_finalization_schedule_internal(void) { if (!cw_is_finalization_locked_out && !cw_is_finalization_pending) { cw_timer_run_with_handler_internal(CW_USECS_PER_SEC, cw_finalization_clock_internal); /* Set the flag and countdown last; calling cw_timer_run_with_handler() * above results in a call to our cw_finalization_cancel_internal(), which clears the flag and countdown if we set them early. */ cw_is_finalization_pending = true; cw_finalization_countdown = CW_AUDIO_FINALIZATION_DELAY / CW_USECS_PER_SEC; cw_debug_msg ((&cw_debug_object), CW_DEBUG_FINALIZATION, CW_DEBUG_INFO, "libcw: finalization scheduled"); } return; } /** Cancel any pending finalization on noting other library activity, indicated by a call from the timeout request function telling us that it is setting a timeout. */ void cw_finalization_cancel_internal(void) { if (cw_is_finalization_pending) { /* Cancel pending finalization and return to doing nothing. */ cw_is_finalization_pending = false; cw_finalization_countdown = 0; cw_debug_msg ((&cw_debug_object), CW_DEBUG_FINALIZATION, CW_DEBUG_INFO, "libcw: finalization canceled"); } return; } /** \brief Reset all library features to their default states Clears the tone queue, receive buffers and retained state information, any current keyer activity, and any straight key activity, returns to silence, and closes soundcard and console devices. This function is suitable for calling from an application exit handler. */ void cw_complete_reset(void) { /* If the finalizer thinks it's pending, stop it, then temporarily lock out finalizations. */ cw_finalization_cancel_internal(); cw_is_finalization_locked_out = true; cw_generator_stop(); /* Call the reset functions for each subsystem. */ cw_reset_tone_queue(); cw_reset_receive(); cw_reset_keyer(); cw_reset_straight_key(); cw_generator_delete_internal(); cw_sigalrm_restore_internal(); /* Now we can re-enable delayed finalizations. */ cw_is_finalization_locked_out = false; return; } /* ******************************************************************** */ /* Section:Unit tests for internal functions */ /* ******************************************************************** */ #ifdef LIBCW_UNIT_TESTS /** tests::cw_timestamp_compare_internal() */ unsigned int test_cw_timestamp_compare_internal(void) { int p = fprintf(stdout, "libcw/utils: cw_timestamp_compare_internal():"); struct timeval earlier_timestamp; struct timeval later_timestamp; /* TODO: I think that there may be more tests to perform for the function, testing handling of overflow. */ int expected_deltas[] = { 0, 1, 1001, CW_USECS_PER_SEC - 1, CW_USECS_PER_SEC, CW_USECS_PER_SEC + 1, 2 * CW_USECS_PER_SEC - 1, 2 * CW_USECS_PER_SEC, 2 * CW_USECS_PER_SEC + 1, -1 }; /* Guard. */ earlier_timestamp.tv_sec = 3; earlier_timestamp.tv_usec = 567; int i = 0; while (expected_deltas[i] != -1) { later_timestamp.tv_sec = earlier_timestamp.tv_sec + (expected_deltas[i] / CW_USECS_PER_SEC); later_timestamp.tv_usec = earlier_timestamp.tv_usec + (expected_deltas[i] % CW_USECS_PER_SEC); int delta = cw_timestamp_compare_internal(&earlier_timestamp, &later_timestamp); cw_assert (delta == expected_deltas[i], "test #%d: unexpected delta: %d != %d", i, delta, expected_deltas[i]); i++; } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_timestamp_validate_internal() */ unsigned int test_cw_timestamp_validate_internal(void) { int p = fprintf(stdout, "libcw/utils: cw_timestamp_validate_internal():"); struct timeval out_timestamp; struct timeval in_timestamp; struct timeval ref_timestamp; /* Reference timestamp. */ int rv = 0; /* Test 1 - get current time. */ out_timestamp.tv_sec = 0; out_timestamp.tv_usec = 0; cw_assert (!gettimeofday(&ref_timestamp, NULL), "failed to get reference time"); rv = cw_timestamp_validate_internal(&out_timestamp, NULL); cw_assert (rv, "test 1: failed to get current timestamp with cw_timestamp_validate_internal(), errno = %d", errno); #if 0 fprintf(stderr, "\nINFO: delay in getting timestamp is %d microseconds\n", cw_timestamp_compare_internal(&ref_timestamp, &out_timestamp)); #endif /* Test 2 - validate valid input timestamp and copy it to output timestamp. */ out_timestamp.tv_sec = 0; out_timestamp.tv_usec = 0; in_timestamp.tv_sec = 1234; in_timestamp.tv_usec = 987; rv = cw_timestamp_validate_internal(&out_timestamp, &in_timestamp); cw_assert (rv, "test 2: failed to validate timestamp with cw_timestamp_validate_internal(), errno = %d", errno); cw_assert (out_timestamp.tv_sec == in_timestamp.tv_sec, "test 2: failed to correctly copy seconds: %d != %d", (int) out_timestamp.tv_sec, (int) in_timestamp.tv_sec); cw_assert (out_timestamp.tv_usec == in_timestamp.tv_usec, "test 2: failed to correctly copy microseconds: %d != %d", (int) out_timestamp.tv_usec, (int) in_timestamp.tv_usec); /* Test 3 - detect invalid seconds in input timestamp. */ out_timestamp.tv_sec = 0; out_timestamp.tv_usec = 0; in_timestamp.tv_sec = -1; in_timestamp.tv_usec = 987; rv = cw_timestamp_validate_internal(&out_timestamp, &in_timestamp); cw_assert (!rv, "test 3: failed to recognize invalid seconds"); cw_assert (errno == EINVAL, "failed to properly set errno, errno is %d", errno); /* Test 4 - detect invalid microseconds in input timestamp (microseconds too large). */ out_timestamp.tv_sec = 0; out_timestamp.tv_usec = 0; in_timestamp.tv_sec = 123; in_timestamp.tv_usec = CW_USECS_PER_SEC + 1; rv = cw_timestamp_validate_internal(&out_timestamp, &in_timestamp); cw_assert (!rv, "test 4: failed to recognize invalid microseconds"); cw_assert (errno == EINVAL, "test 4: failed to properly set errno, errno is %d", errno); /* Test 5 - detect invalid microseconds in input timestamp (microseconds negative). */ out_timestamp.tv_sec = 0; out_timestamp.tv_usec = 0; in_timestamp.tv_sec = 123; in_timestamp.tv_usec = -1; rv = cw_timestamp_validate_internal(&out_timestamp, &in_timestamp); cw_assert (!rv, "test 5: failed to recognize invalid microseconds"); cw_assert (errno == EINVAL, "test 5: failed to properly set errno, errno is %d", errno); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_usecs_to_timespec_internal() */ unsigned int test_cw_usecs_to_timespec_internal(void) { int p = fprintf(stdout, "libcw/utils: cw_usecs_to_timespec_internal():"); struct { int input; struct timespec t; } input_data[] = { /* input in ms / expected output seconds : milliseconds */ { 0, { 0, 0 }}, { 1000000, { 1, 0 }}, { 1000004, { 1, 4000 }}, { 15000350, { 15, 350000 }}, { 73, { 0, 73000 }}, { -1, { 0, 0 }}, }; int i = 0; while (input_data[i].input != -1) { struct timespec result = { .tv_sec = 0, .tv_nsec = 0 }; cw_usecs_to_timespec_internal(&result, input_data[i].input); #if 0 fprintf(stderr, "input = %d usecs, output = %ld.%ld\n", input_data[i].input, (long) result.tv_sec, (long) result.tv_nsec); #endif assert(result.tv_sec == input_data[i].t.tv_sec); assert(result.tv_nsec == input_data[i].t.tv_nsec); i++; } CW_TEST_PRINT_TEST_RESULT (false, p); return 0; } /** tests::cw_version() */ unsigned int test_cw_version_internal(void) { int rv = cw_version(); int major = rv >> 16; int minor = rv & 0xff; /* Library's version is defined in LIBCW_VERSION. cw_version() uses three calls to strtol() to get three parts of the library version. Let's use a different approach to convert LIBCW_VERSION into numbers. */ int current = 0, revision = 0; __attribute__((unused)) int age = 0; #define VERSION_LEN_MAX 30 cw_assert (strlen(LIBCW_VERSION) <= VERSION_LEN_MAX, "LIBCW_VERSION longer than expected!\n"); char buffer[VERSION_LEN_MAX + 1]; strncpy(buffer, LIBCW_VERSION, VERSION_LEN_MAX); buffer[VERSION_LEN_MAX] = '\0'; #undef VERSION_LEN_MAX char *str = buffer; for (int i = 0; ; i++, str = NULL) { char *token = strtok(str, ":"); if (token == NULL) { break; } if (i == 0) { current = atoi(token); } else if (i == 1) { revision = atoi(token); } else if (i == 2) { age = atoi(token); } else { cw_assert (0, "too many tokens in \"%s\"\n", LIBCW_VERSION); } } cw_assert (major == current, "Incorrect \"current\": %d != %d\n", major, current); cw_assert (minor == revision, "Incorrect \"revision\": %d != %d\n", minor, revision); int n = fprintf(stdout, "libcw/utils: get version: %d.%d:", major, minor); CW_TEST_PRINT_TEST_RESULT (false, n); return 0; } /** tests::cw_license() */ unsigned int test_cw_license_internal(void) { /* Well, there isn't much to test here. The function just prints the license to stdout, and that's it. */ cw_license(); int n = fprintf(stdout, "libcw/utils: printing license:"); CW_TEST_PRINT_TEST_RESULT (false, n); return 0; } /** \brief Ensure that we can obtain correct values of main parameter limits tests::cw_get_speed_limits() tests::cw_get_frequency_limits() tests::cw_get_volume_limits() tests::cw_get_gap_limits() tests::cw_get_tolerance_limits() tests::cw_get_weighting_limits() */ unsigned int test_cw_get_x_limits_internal(void) { struct { void (* getter)(int *min, int *max); int min; /* Minimum hardwired in library. */ int max; /* Maximum hardwired in library. */ int get_min; /* Minimum received in function call. */ int get_max; /* Maximum received in function call. */ const char *name; } test_data[] = { /* initial values */ { cw_get_speed_limits, CW_SPEED_MIN, CW_SPEED_MAX, 10000, -10000, "speed" }, { cw_get_frequency_limits, CW_FREQUENCY_MIN, CW_FREQUENCY_MAX, 10000, -10000, "frequency" }, { cw_get_volume_limits, CW_VOLUME_MIN, CW_VOLUME_MAX, 10000, -10000, "volume" }, { cw_get_gap_limits, CW_GAP_MIN, CW_GAP_MAX, 10000, -10000, "gap" }, { cw_get_tolerance_limits, CW_TOLERANCE_MIN, CW_TOLERANCE_MAX, 10000, -10000, "tolerance" }, { cw_get_weighting_limits, CW_WEIGHTING_MIN, CW_WEIGHTING_MAX, 10000, -10000, "weighting" }, { NULL, 0, 0, 0, 0, NULL } }; for (int i = 0; test_data[i].getter; i++) { /* Get limits of a parameter. */ test_data[i].getter(&test_data[i].get_min, &test_data[i].get_max); /* Test that limits are as expected (values received by function call match those defined in library's header file). */ cw_assert (test_data[i].get_min == test_data[i].min, "Failed to get correct minimum of %s\n", test_data[i].name); cw_assert (test_data[i].get_max == test_data[i].max, "Failed to get correct maximum of %s\n", test_data[i].name); } int n = fprintf(stdout, "libcw/utils: cw_get_X_limits():"); CW_TEST_PRINT_TEST_RESULT (false, n); return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libpc.awk0000644000175000017500000000401112451007252016335 0ustar acerionacerion#!/bin/awk -f # # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # # AWK script to produce a pkg-config metadata file. # # If we're building under RPM, we need to strip the RPM_BUILD_ROOT from the # start of each of the prefixed items we use, passed in as strip. function adjust(path) { if (length (strip) > 0) { if (index (path, strip) == 1) return substr (path, length (strip) + 1) } return path } # Extract the package version from config.h, passed in as config_h. function version() { while ((status=getline line 0) { if (line ~ /\#define PACKAGE_VERSION ".*"/) { split (line, pieces) retval = pieces[3] gsub (/"/, "", retval) close (config_h) return retval } } return "[unknown]" } BEGIN { # Start with prefix preamble. printf ("prefix=%s\n", adjust(prefix)) printf ("exec_prefix=%s\n", adjust(exec_prefix)) printf ("libdir=%s\n", adjust(libdir)) printf ("includedir=%s\n\n", adjust(includedir)) # Print the remaining metadata. printf ("Name: libcw\nDescription: CW (Morse code) library.\n") printf ("Version: %s\nRequires: alsa\n", version()) printf ("Libs: -L${libdir} -lcw -lpthread -lm\nCflags: -I${includedir}\n") } unixcw-3.4.2/src/libcw/libcw_test.h0000644000175000017500000000202612475657267017103 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_TEST #define H_LIBCW_TEST #include /* size_t */ /* Total width of test name + test status printed in console. Remember that some consoles have width = 80. Not everyone works in X. */ static const int cw_test_print_width = 75; /* Notice that failure status string ("FAIL!") is visually very different than "success". This makes finding failed tests easier. */ #define CW_TEST_PRINT_TEST_RESULT(m_failure, m_n) { \ printf("%*s\n", (cw_test_print_width - m_n), m_failure ? " FAIL! " : "success"); \ } #define CW_TEST_PRINT_FUNCTION_COMPLETED(m_func_name) { \ int m = printf("libcw: %s(): ", m_func_name); \ printf("%*s\n\n", cw_test_print_width - m, "completed"); \ } int cw_test_args(int argc, char *const argv[], char *sound_systems, size_t systems_max, char *modules, size_t modules_max); void cw_test_print_help(const char *progname); #endif /* #ifndef H_LIBCW_TEST */ unixcw-3.4.2/src/libcw/libcw_signal.h0000644000175000017500000000074412472367133017371 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_SIGNAL #define H_LIBCW_SIGNAL #include int cw_sigalrm_install_top_level_handler_internal(void); bool cw_sigalrm_is_blocked_internal(void); int cw_signal_wait_internal(void); int cw_sigalrm_restore_internal(void); int cw_timer_run_with_handler_internal(int usecs, void (*sigalrm_handler)(void)); #endif /* #ifndef H_LIBCW_SIGNAL */ unixcw-3.4.2/src/libcw/libcw_alsa.c0000644000175000017500000005733512451074037017032 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_alsa.c \brief ALSA audio sink. */ #include "config.h" #ifdef LIBCW_WITH_ALSA #include /* dlopen() and related symbols */ #include #include "libcw.h" #include "libcw_alsa.h" #include "libcw_debug.h" #include "libcw_utils.h" #include "libcw_gen.h" #define CW_ALSA_HW_BUFFER_CONFIG 0 /* set up hw buffer/period parameters; unnecessary and probably harmful */ extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; extern const unsigned int cw_supported_sample_rates[]; /* Constants specific to ALSA audio system configuration */ static const snd_pcm_format_t CW_ALSA_SAMPLE_FORMAT = SND_PCM_FORMAT_S16; /* "Signed 16 bit CPU endian"; I'm guessing that "CPU endian" == "native endianess" */ static int cw_alsa_set_hw_params_internal(cw_gen_t *gen, snd_pcm_hw_params_t *params); static int cw_alsa_dlsym_internal(void *handle); static int cw_alsa_write_internal(cw_gen_t *gen); static int cw_alsa_debug_evaluate_write_internal(cw_gen_t *gen, int rv); static int cw_alsa_open_device_internal(cw_gen_t *gen); static void cw_alsa_close_device_internal(cw_gen_t *gen); #ifdef LIBCW_WITH_DEV static int cw_alsa_print_params_internal(snd_pcm_hw_params_t *hw_params); #endif static struct { void *handle; int (* snd_pcm_open)(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode); int (* snd_pcm_close)(snd_pcm_t *pcm); int (* snd_pcm_prepare)(snd_pcm_t *pcm); int (* snd_pcm_drop)(snd_pcm_t *pcm); snd_pcm_sframes_t (* snd_pcm_writei)(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); const char *(* snd_strerror)(int errnum); int (* snd_pcm_hw_params_malloc)(snd_pcm_hw_params_t **ptr); int (* snd_pcm_hw_params_any)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); int (* snd_pcm_hw_params_set_format)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); int (* snd_pcm_hw_params_set_rate_near)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); int (* snd_pcm_hw_params_set_access)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access); int (* snd_pcm_hw_params_set_channels)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); int (* snd_pcm_hw_params)(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); int (* snd_pcm_hw_params_get_periods)(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); int (* snd_pcm_hw_params_get_period_size)(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); int (* snd_pcm_hw_params_get_period_size_min)(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); int (* snd_pcm_hw_params_get_buffer_size)(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); } cw_alsa = { .handle = NULL, .snd_pcm_open = NULL, .snd_pcm_close = NULL, .snd_pcm_prepare = NULL, .snd_pcm_drop = NULL, .snd_pcm_writei = NULL, .snd_strerror = NULL, .snd_pcm_hw_params_malloc = NULL, .snd_pcm_hw_params_any = NULL, .snd_pcm_hw_params_set_format = NULL, .snd_pcm_hw_params_set_rate_near = NULL, .snd_pcm_hw_params_set_access = NULL, .snd_pcm_hw_params_set_channels = NULL, .snd_pcm_hw_params = NULL, .snd_pcm_hw_params_get_periods = NULL, .snd_pcm_hw_params_get_period_size = NULL, .snd_pcm_hw_params_get_period_size_min = NULL, .snd_pcm_hw_params_get_buffer_size = NULL }; /** \brief Check if it is possible to open ALSA output Function first tries to load ALSA library, and then does a test opening of ALSA output, but it closes it before returning. \param device - name of ALSA device to be used; if NULL then library will use default device. \return true if opening ALSA output succeeded; \return false if opening ALSA output failed; */ bool cw_is_alsa_possible(const char *device) { const char *library_name = "libasound.so.2"; if (!cw_dlopen_internal(library_name, &(cw_alsa.handle))) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't access ALSA library \"%s\"", library_name); return false; } int rv = cw_alsa_dlsym_internal(cw_alsa.handle); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: failed to resolve ALSA symbol #%d, can't correctly load ALSA library", rv); dlclose(cw_alsa.handle); return false; } const char *dev = device ? device : CW_DEFAULT_ALSA_DEVICE; snd_pcm_t *alsa_handle; rv = cw_alsa.snd_pcm_open(&alsa_handle, dev, /* name */ SND_PCM_STREAM_PLAYBACK, /* stream (playback/capture) */ 0); /* mode, 0 | SND_PCM_NONBLOCK | SND_PCM_ASYNC */ if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't open ALSA device \"%s\"", dev); dlclose(cw_alsa.handle); return false; } else { cw_alsa.snd_pcm_close(alsa_handle); return true; } } int cw_alsa_configure(cw_gen_t *gen, const char *device) { gen->audio_system = CW_AUDIO_ALSA; cw_gen_set_audio_device_internal(gen, device); gen->open_device = cw_alsa_open_device_internal; gen->close_device = cw_alsa_close_device_internal; gen->write = cw_alsa_write_internal; return CW_SUCCESS; } int cw_alsa_write_internal(cw_gen_t *gen) { assert (gen); assert (gen->audio_system == CW_AUDIO_ALSA); /* Send audio buffer to ALSA. Size of correct and current data in the buffer is the same as ALSA's period, so there should be no underruns */ int rv = cw_alsa.snd_pcm_writei(gen->alsa_data.handle, gen->buffer, gen->buffer_n_samples); cw_alsa_debug_evaluate_write_internal(gen, rv); /* cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: written %d/%d samples with ALSA", rv, gen->buffer_n_samples); */ return CW_SUCCESS; } /** \brief Open ALSA output, associate it with given generator You must use cw_gen_set_audio_device_internal() before calling this function. Otherwise generator \p gen won't know which device to open. \param gen - current generator \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_alsa_open_device_internal(cw_gen_t *gen) { int rv = cw_alsa.snd_pcm_open(&gen->alsa_data.handle, gen->audio_device, /* name */ SND_PCM_STREAM_PLAYBACK, /* stream (playback/capture) */ 0); /* mode, 0 | SND_PCM_NONBLOCK | SND_PCM_ASYNC */ if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't open ALSA device \"%s\"", gen->audio_device); return CW_FAILURE; } /* rv = snd_pcm_nonblock(gen->alsa_data.handle, 0); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set block for ALSA handle"); return CW_FAILURE; } */ /* TODO: move this to cw_alsa_set_hw_params_internal(), deallocate hw_params */ snd_pcm_hw_params_t *hw_params = NULL; rv = cw_alsa.snd_pcm_hw_params_malloc(&hw_params); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't allocate memory for ALSA hw params"); return CW_FAILURE; } rv = cw_alsa_set_hw_params_internal(gen, hw_params); if (rv != CW_SUCCESS) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set ALSA hw params"); return CW_FAILURE; } rv = cw_alsa.snd_pcm_prepare(gen->alsa_data.handle); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't prepare ALSA handler"); return CW_FAILURE; } /* Get size for data buffer */ snd_pcm_uframes_t frames; /* period size in frames */ int dir = 1; rv = cw_alsa.snd_pcm_hw_params_get_period_size_min(hw_params, &frames, &dir); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: rv = %d, ALSA buffer size would be %u frames", rv, (unsigned int) frames); /* The linker (?) that I use on Debian links libcw against old version of get_period_size(), which returns period size as return value. This is a workaround. */ if (rv > 1) { gen->buffer_n_samples = rv; } else { gen->buffer_n_samples = frames; } #if CW_DEV_RAW_SINK gen->dev_raw_sink = open("/tmp/cw_file.alsa.raw", O_WRONLY | O_TRUNC | O_NONBLOCK); #endif return CW_SUCCESS; } /** \brief Close ALSA device associated with current generator */ void cw_alsa_close_device_internal(cw_gen_t *gen) { /* "Stop a PCM dropping pending frames. " */ cw_alsa.snd_pcm_drop(gen->alsa_data.handle); cw_alsa.snd_pcm_close(gen->alsa_data.handle); gen->audio_device_is_open = false; if (cw_alsa.handle) { dlclose(cw_alsa.handle); } #if CW_DEV_RAW_SINK if (gen->dev_raw_sink != -1) { close(gen->dev_raw_sink); gen->dev_raw_sink = -1; } #endif return; } int cw_alsa_debug_evaluate_write_internal(cw_gen_t *gen, int rv) { if (rv == -EPIPE) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: underrun"); cw_alsa.snd_pcm_prepare(gen->alsa_data.handle); } else if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: writei: %s", cw_alsa.snd_strerror(rv)); cw_alsa.snd_pcm_prepare(gen->alsa_data.handle); } else if (rv != gen->buffer_n_samples) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: short write, %d != %d", rv, gen->buffer_n_samples); } else { return CW_SUCCESS; } return CW_FAILURE; } /** \brief Set up hardware buffer parameters of ALSA sink \param gen - current generator with ALSA handle set up \param params - allocated hw params data structure to be used \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_alsa_set_hw_params_internal(cw_gen_t *gen, snd_pcm_hw_params_t *hw_params) { /* Get current hw configuration. */ int rv = cw_alsa.snd_pcm_hw_params_any(gen->alsa_data.handle, hw_params); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: get current hw params: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } /* Set the sample format */ rv = cw_alsa.snd_pcm_hw_params_set_format(gen->alsa_data.handle, hw_params, CW_ALSA_SAMPLE_FORMAT); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set sample format: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } int dir = 0; /* Set the sample rate (may set/influence/modify "period size") */ unsigned int rate = 0; bool success = false; for (int i = 0; cw_supported_sample_rates[i]; i++) { rate = cw_supported_sample_rates[i]; int rv = cw_alsa.snd_pcm_hw_params_set_rate_near(gen->alsa_data.handle, hw_params, &rate, &dir); if (!rv) { if (rate != cw_supported_sample_rates[i]) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: imprecise sample rate:"); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: asked for: %u", cw_supported_sample_rates[i]); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_alsa: got: %u", rate); } success = true; gen->sample_rate = rate; break; } } if (!success) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't get sample rate: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: sample rate: %d", gen->sample_rate); } /* Set PCM access type */ rv = cw_alsa.snd_pcm_hw_params_set_access(gen->alsa_data.handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set access type: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } /* Set number of channels */ rv = cw_alsa.snd_pcm_hw_params_set_channels(gen->alsa_data.handle, hw_params, CW_AUDIO_CHANNELS); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set number of channels: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } /* Don't try to over-configure ALSA, it would be a pointless exercise. See comment from this article, starting with "This is my soundcard initialization function": http://stackoverflow.com/questions/3345083/correctly-sizing-alsa-buffers-weird-api Poster sets basic audio playback parameters (channels, sampling rate, sample format), saves the config (with snd_pcm_hw_params()), and then only queries ALSA handle for period size and period time. It turns out that it works in our case: basic hw configuration plus getting period size (I don't need period time). Period size seems to be the most important, and most useful data that I need from configured ALSA handle - this is the size of audio buffer which I can fill with my data and send it down to ALSA internals (possibly without worrying about underruns; if I understand correctly - if I send to ALSA chunks of data of proper size then I don't have to worry about underruns). */ #if CW_ALSA_HW_BUFFER_CONFIG && defined(HAVE_SND_PCM_HW_PARAMS_TEST_BUFFER_SIZE) && defined(HAVE_SND_PCM_HW_PARAMS_TEST_PERIODS) /* http://equalarea.com/paul/alsa-audio.html: Buffer size: This determines how large the hardware buffer is. It can be specified in units of time or frames. Interrupt interval: This determines how many interrupts the interface will generate per complete traversal of its hardware buffer. It can be set either by specifying a number of periods, or the size of a period. Since this determines the number of frames of space/data that have to accumulate before the interface will interrupt the computer. It is central in controlling latency. http://www.alsa-project.org/main/index.php/FramesPeriods " "frame" represents the unit, 1 frame = # channels x sample_bytes. In case of stereo, 2 bytes per sample, 1 frame corresponds to 2 channels x 2 bytes = 4 bytes. "periods" is the number of periods in a ring-buffer. In OSS, called "fragments". So, - buffer_size = period_size * periods - period_bytes = period_size * bytes_per_frame - bytes_per_frame = channels * bytes_per_sample The "period" defines the frequency to update the status, usually via the invocation of interrupts. The "period_size" defines the frame sizes corresponding to the "period time". This term corresponds to the "fragment size" on OSS. On major sound hardwares, a ring-buffer is divided to several parts and an irq is issued on each boundary. The period_size defines the size of this chunk." OSS ALSA definition fragment period basic chunk of data sent to hw buffer */ { /* Test and attempt to set buffer size */ snd_pcm_uframes_t accepted = 0; /* buffer size in frames */ dir = 0; for (snd_pcm_uframes_t val = 0; val < 10000; val++) { rv = cw_alsa.snd_pcm_hw_params_test_buffer_size(gen->alsa_data.handle, hw_params, val); if (rv == 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: accepted buffer size: %u", (unsigned int) accepted); /* Accept only the smallest available buffer size */ accepted = val; break; } } if (accepted > 0) { rv = cw_alsa.snd_pcm_hw_params_set_buffer_size(gen->alsa_data.handle, hw_params, accepted); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set accepted buffer size %u: %s", (unsigned int) accepted, cw_alsa.snd_strerror(rv)); } } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: no accepted buffer size"); } } { /* Test and attempt to set number of periods */ dir = 0; unsigned int accepted = 0; /* number of periods per buffer */ /* this limit should be enough, "accepted" on my machine is 8 */ const unsigned int n_periods_max = 30; for (unsigned int val = 1; val < n_periods_max; val++) { rv = cw_alsa.snd_pcm_hw_params_test_periods(gen->alsa_data.handle, hw_params, val, dir); if (rv == 0) { accepted = val; cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: accepted number of periods: %d", accepted); } } if (accepted > 0) { rv = cw_alsa.snd_pcm_hw_params_set_periods(gen->alsa_data.handle, hw_params, accepted, dir); if (rv < 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't set accepted number of periods %d: %s", accepted, cw_alsa.snd_strerror(rv)); } } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: no accepted number of periods"); } } { /* Test period size */ dir = 0; for (snd_pcm_uframes_t val = 0; val < 100000; val++) { rv = cw_alsa.snd_pcm_hw_params_test_period_size(gen->alsa_data.handle, hw_params, val, dir); if (rv == 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: accepted period size: %lu", val); // break; } } } { /* Test buffer time */ dir = 0; for (unsigned int val = 0; val < 100000; val++) { rv = cw_alsa.snd_pcm_hw_params_test_buffer_time(gen->alsa_data.handle, hw_params, val, dir); if (rv == 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: accepted buffer time: %d", val); // break; } } } #endif /* #if CW_ALSA_HW_BUFFER_CONFIG */ /* Save hw parameters to device */ rv = cw_alsa.snd_pcm_hw_params(gen->alsa_data.handle, hw_params); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't save hw parameters: %s", cw_alsa.snd_strerror(rv)); return CW_FAILURE; } else { return CW_SUCCESS; } } #ifdef LIBCW_WITH_DEV /* debug function */ int cw_alsa_print_params_internal(snd_pcm_hw_params_t *hw_params) { unsigned int val = 0; int dir = 0; int rv = cw_alsa.snd_pcm_hw_params_get_periods(hw_params, &val, &dir); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't get 'periods': %s", cw_alsa.snd_strerror(rv)); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: 'periods' = %u", val); } snd_pcm_uframes_t period_size = 0; rv = cw_alsa.snd_pcm_hw_params_get_period_size(hw_params, &period_size, &dir); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't get 'period size': %s", cw_alsa.snd_strerror(rv)); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: 'period size' = %u", (unsigned int) period_size); } snd_pcm_uframes_t buffer_size; rv = cw_alsa.snd_pcm_hw_params_get_buffer_size(hw_params, &buffer_size); if (rv < 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_alsa: can't get buffer size: %s", cw_alsa.snd_strerror(rv)); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_alsa: 'buffer size' = %u", (unsigned int) buffer_size); } return CW_SUCCESS; } #endif // #ifdef LIBCW_WITH_DEV /** \brief Resolve/get symbols from ALSA library Function resolves/gets addresses of few ALSA functions used by libcw and stores them in cw_alsa global variable. On failure the function returns negative value, different for every symbol that the funciton failed to resolve. Function stops and returns on first failure. \param handle - handle to open ALSA library \return 0 on success \return negative value on failure */ static int cw_alsa_dlsym_internal(void *handle) { *(void **) &(cw_alsa.snd_pcm_open) = dlsym(handle, "snd_pcm_open"); if (!cw_alsa.snd_pcm_open) return -1; *(void **) &(cw_alsa.snd_pcm_close) = dlsym(handle, "snd_pcm_close"); if (!cw_alsa.snd_pcm_close) return -2; *(void **) &(cw_alsa.snd_pcm_prepare) = dlsym(handle, "snd_pcm_prepare"); if (!cw_alsa.snd_pcm_prepare) return -3; *(void **) &(cw_alsa.snd_pcm_drop) = dlsym(handle, "snd_pcm_drop"); if (!cw_alsa.snd_pcm_drop) return -4; *(void **) &(cw_alsa.snd_pcm_writei) = dlsym(handle, "snd_pcm_writei"); if (!cw_alsa.snd_pcm_writei) return -5; *(void **) &(cw_alsa.snd_strerror) = dlsym(handle, "snd_strerror"); if (!cw_alsa.snd_strerror) return -10; *(void **) &(cw_alsa.snd_pcm_hw_params_malloc) = dlsym(handle, "snd_pcm_hw_params_malloc"); if (!cw_alsa.snd_pcm_hw_params_malloc) return -20; *(void **) &(cw_alsa.snd_pcm_hw_params_any) = dlsym(handle, "snd_pcm_hw_params_any"); if (!cw_alsa.snd_pcm_hw_params_any) return -21; *(void **) &(cw_alsa.snd_pcm_hw_params_set_format) = dlsym(handle, "snd_pcm_hw_params_set_format"); if (!cw_alsa.snd_pcm_hw_params_set_format) return -22; *(void **) &(cw_alsa.snd_pcm_hw_params_set_rate_near) = dlsym(handle, "snd_pcm_hw_params_set_rate_near"); if (!cw_alsa.snd_pcm_hw_params_set_rate_near) return -23; *(void **) &(cw_alsa.snd_pcm_hw_params_set_access) = dlsym(handle, "snd_pcm_hw_params_set_access"); if (!cw_alsa.snd_pcm_hw_params_set_access) return -24; *(void **) &(cw_alsa.snd_pcm_hw_params_set_channels) = dlsym(handle, "snd_pcm_hw_params_set_channels"); if (!cw_alsa.snd_pcm_hw_params_set_channels) return -25; *(void **) &(cw_alsa.snd_pcm_hw_params) = dlsym(handle, "snd_pcm_hw_params"); if (!cw_alsa.snd_pcm_hw_params) return -26; *(void **) &(cw_alsa.snd_pcm_hw_params_get_periods) = dlsym(handle, "snd_pcm_hw_params_get_periods"); if (!cw_alsa.snd_pcm_hw_params_get_periods) return -27; *(void **) &(cw_alsa.snd_pcm_hw_params_get_period_size) = dlsym(handle, "snd_pcm_hw_params_get_period_size"); if (!cw_alsa.snd_pcm_hw_params_get_period_size) return -28; *(void **) &(cw_alsa.snd_pcm_hw_params_get_period_size_min) = dlsym(handle, "snd_pcm_hw_params_get_period_size_min"); if (!cw_alsa.snd_pcm_hw_params_get_period_size_min) return -29; *(void **) &(cw_alsa.snd_pcm_hw_params_get_buffer_size) = dlsym(handle, "snd_pcm_hw_params_get_buffer_size"); if (!cw_alsa.snd_pcm_hw_params_get_buffer_size) return -30; return 0; } void cw_alsa_drop(cw_gen_t *gen) { cw_alsa.snd_pcm_drop(gen->alsa_data.handle); return; } #else /* #ifdef LIBCW_WITH_ALSA */ #include #include "libcw_alsa.h" bool cw_is_alsa_possible(__attribute__((unused)) const char *device) { return false; } int cw_alsa_configure(__attribute__((unused)) cw_gen_t *gen, __attribute__((unused)) const char *device) { return CW_FAILURE; } void cw_alsa_drop(__attribute__((unused)) cw_gen_t *gen) { return; } #endif /* #ifdef LIBCW_WITH_ALSA */ unixcw-3.4.2/src/libcw/Makefile.am0000644000175000017500000001310112477673504016615 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # -include $(top_builddir)/Makefile.inc # targets to be built in this directory lib_LTLIBRARIES=libcw.la check_PROGRAMS=libcw_test_public libcw_test_internal libcw_test_simple_gen man_MANS=libcw.3 cw.7 pkgconfig_DATA=libcw.pc EXTRA_DIST=include.awk libdoc.awk libfuncs.awk libpc.awk libsigs.awk \ libcw.3.m4 \ libcw.pc.in \ cw.7 \ libcw_gen.h libcw_rec.h \ libcw_tq.h libcw_data.h libcw_key.h libcw_utils.h libcw_signal.h \ libcw_null.h libcw_console.h libcw_oss.h libcw_alsa.h libcw_pa.h \ libcw_test.h # These files are used to build two different targets - list them only # once. I can't compile these files into an utility library because # the two targets are compiled with different CPPFLAGS. LIBCW_BASE_C_FILES = \ libcw.c \ libcw_gen.c libcw_rec.c \ libcw_tq.c libcw_data.c libcw_key.c libcw_utils.c libcw_signal.c \ libcw_null.c libcw_console.c libcw_oss.c libcw_alsa.c libcw_pa.c \ libcw_debug.c # target: shared library # source code files used to build libcw shared library libcw_la_SOURCES = $(LIBCW_BASE_C_FILES) # target-specific linker flags (objects to link) libcw_la_LIBADD=-lm -lpthread $(DL_LIB) $(OSS_LIB) # target-specific linker flags (additional flags) # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # LIBCW_VERSION is defined in configure.ac libcw_la_LDFLAGS = -version-number $(LIBCW_VERSION) # target-specific compiler flags libcw_la_CFLAGS = -rdynamic # target-specific preprocessor flags (#defs and include dirs) # # $(LIBCW_NDEBUG) activates asserts in base libcw for dev builds, and # deactivates asserts in base libcw for regular builds. libcw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCW_NDEBUG) libcw_includedir=$(includedir) libcw_include_HEADERS = libcw.h libcw_debug.h # target: libcw_test_public: a test program testing only public API of libcw library; # main() is defined in libcw_test_public.c # Source code files used to build libcw_test_public program. # This test tests library's public API, so the target should depend on # a regular shared library file found in build directory. It shouldn't # compile all *.c files that are used to create library, it should # compile only test files and "link" them with this library file. libcw_test_public_SOURCES = $(LIBCW_BASE_C_FILES) libcw_test_public.c libcw_test.c # target-specific preprocessor flags (#defs and include dirs) libcw_test_public_CPPFLAGS = $(AM_CPPFLAGS) -DLIBCW_UNIT_TESTS # target-specific linker flags (objects to link) libcw_test_public_LDADD = -lm -lpthread $(DL_LIB) -L./.libs -lcw # target: libcw_test_internal, a test program invoking unit tests for # (internal) functions defined in libcw_xyz.c files; # main() is defined in libcw_test_internal.c. # source code files used to build libcw_test_internal program libcw_test_internal_SOURCES = $(LIBCW_BASE_C_FILES) libcw_test_internal.c # target-specific preprocessor flags (#defs and include dirs) libcw_test_internal_CPPFLAGS = $(AM_CPPFLAGS) -DLIBCW_UNIT_TESTS # target-specific linker flags (objects to link) libcw_test_internal_LDADD=-lm -lpthread $(DL_LIB) $(OSS_LIB) # target-specific compiler flags libcw_test_internal_CFLAGS = -rdynamic # target: libcw_test_simple_gen, yet another test program; # main() is defined in libcw_test_simple_gen.c # The file defines a very simple set of tests that make only a basic # use of libcw's generator facilities. # source code files used to build libcw_test_simple_gen program libcw_test_simple_gen_SOURCES = libcw_test_simple_gen.c libcw_test.c # target-specific linker flags (objects to link) libcw_test_simple_gen_LDADD=-lm -lpthread $(DL_LIB) $(OSS_LIB) -L./.libs -lcw # target-specific compiler flags libcw_test_simple_gen_CFLAGS = -rdynamic # target: libcw man page libcw.3: libcw.3.m4 cat $(top_srcdir)/src/libcw/*.c | $(AC_AWK) -f $(top_srcdir)/src/libcw/libdoc.awk | $(AC_AWK) -f $(top_srcdir)/src/libcw/libsigs.awk > signatures cat $(top_srcdir)/src/libcw/*.c | $(AC_AWK) -f $(top_srcdir)/src/libcw/libdoc.awk | $(AC_AWK) -f $(top_srcdir)/src/libcw/libfuncs.awk > functions $(AC_AWK) -f $(top_srcdir)/src/libcw/include.awk < $(top_srcdir)/src/libcw/libcw.3.m4 >libcw.3 rm -f signatures functions # target: libcw.pc pkgconfigdir = $(libdir)/pkgconfig # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = libcw_test_internal.sh libcw.3 TESTS = $(check_SCRIPTS) # run test programs (only libcw_test_internal unit tests suite) check_SCRIPTS = libcw_test_internal.sh libcw_test_internal.sh: echo './libcw_test_internal | grep "test result: success"' > libcw_test_internal.sh chmod +x libcw_test_internal.sh # sources, references # # source of snippet related to "check_SCRIPTS" and related sh script: # http://www.freesoftwaremagazine.com/books/agaal/automatically_writing_makefiles_with_autotools unixcw-3.4.2/src/libcw/libcw_debug.h0000644000175000017500000001143112475657046017205 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef H_LIBCW_DEBUG #define H_LIBCW_DEBUG #include #include #include #if defined(__cplusplus) extern "C" { #endif #include /* uint32_t */ #define CW_DEBUG_N_EVENTS_MAX (1024 * 128) typedef struct { uint32_t flags; /* Unused at the moment. */ int n; /* Event counter. */ int n_max; /* Flush threshold. */ /* Current debug level. */ int level; /* Human-readable labels for debug levels. */ const char **level_labels; struct { uint32_t event; /* Event ID. One of values from enum below. */ long long sec; /* Time of registering the event - second. */ long long usec; /* Time of registering the event - microsecond. */ } events[CW_DEBUG_N_EVENTS_MAX]; } cw_debug_t; void cw_debug_set_flags(cw_debug_t *debug_object, uint32_t flags); uint32_t cw_debug_get_flags(cw_debug_t *debug_object); void cw_debug_print_flags(cw_debug_t *debug_object); bool cw_debug_has_flag(cw_debug_t *debug_object, uint32_t flag); void cw_debug_event_internal(cw_debug_t *debug_object, uint32_t flag, uint32_t event, const char *func, int line); void cw_set_debug_flags(uint32_t flags) __attribute__ ((deprecated)); uint32_t cw_get_debug_flags(void) __attribute__ ((deprecated)); #define cw_debug_msg(debug_object, flag, debug_level, ...) { \ if (debug_level >= debug_object->level) { \ if (debug_object->flags & flag) { \ fprintf(stderr, "%s:", debug_object->level_labels[debug_level]); \ if (debug_level == CW_DEBUG_DEBUG) { \ fprintf(stderr, "%s: %d: ", __func__, __LINE__); \ } \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, "\n"); \ } \ } \ } #define cw_debug_ev(debug_object, flag, event) \ { \ cw_debug_event_internal(debug_object, flag, event, __func__, __LINE__); \ } enum { CW_DEBUG_EVENT_TONE_LOW = 0, /* Tone with non-zero frequency. */ CW_DEBUG_EVENT_TONE_MID, /* A state between LOW and HIGH, probably unused. */ CW_DEBUG_EVENT_TONE_HIGH, /* Tone with zero frequency. */ CW_DEBUG_EVENT_TQ_JUST_EMPTIED, /* A last tone from libcw's queue of tones has been dequeued, making the queue empty. */ CW_DEBUG_EVENT_TQ_NONEMPTY, /* A tone from libcw's queue of tones has been dequeued, but the queue is still non-empty. */ CW_DEBUG_EVENT_TQ_STILL_EMPTY /* libcw's queue of tones has been asked for tone, but there were no tones on the queue. */ }; /** \brief Print debug message - verbose version This macro behaves much like fprintf(stderr, ...) function, caller only have to provide format string with converesion specifiers and list of arguments for this format string. Each message is preceeded with name of function that called the macro. See "C: A Reference Manual", chapter 3.3.10 for more information on variable argument lists in macros (it requires C99). Macro copied from my cdw project. */ #ifndef NDEBUG #define cw_vdm(...) fprintf(stderr, "%s():%d: ", __func__, __LINE__); fprintf(stderr, __VA_ARGS__); #else #define cw_vdm(...) #endif /** \brief Assert macro with message Macro copied from my cdw project. */ #ifndef NDEBUG #define cw_assert(expr, ...) \ if (! (expr)) { \ fprintf(stderr, "\n\nassertion failed in:\n"); \ fprintf(stderr, "file %s\n", __FILE__); \ fprintf(stderr, "line %d\n", __LINE__); \ cw_vdm (__VA_ARGS__); \ fprintf(stderr, "\n\n"); \ assert (expr); \ } #else /* "if ()" expression prevents compiler warnings about unused variables. */ #define cw_assert(expr, ...) { if (expr) {} } #endif #ifdef LIBCW_WITH_DEV int cw_dev_debug_raw_sink_write_internal(cw_gen_t *gen); void cw_dev_debug_print_generator_setup(cw_gen_t *gen); #endif #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_debug_flags_internal(void); #endif /* #ifdef LIBCW_UNIT_TESTS */ #if defined(__cplusplus) } #endif #endif /* H_LIBCW_DEBUG */ unixcw-3.4.2/src/libcw/libcw_gen.c0000644000175000017500000025362112502644374016663 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_gen.c \brief Generate pcm samples according to tones from tone queue, and send them to audio sink. Functions operating on one of core elements of libcw: a generator. Generator is an object that has access to audio sink (soundcard, console buzzer, null audio device) and that can play dots and dashes using the audio sink. You can request generator to produce audio by using *_play_*() functions. The inner workings of the generator seem to be quite simple: 1. dequeue tone from tone queue 2. recalculate tone length in usecs into length in samples 3. for every sample in tone, calculate sine wave sample and put it in generator's constant size buffer 4. if buffer is full of sine wave samples, push it to audio sink 5. since buffer is shorter than (almost) any tone, you will push the buffer multiple times per tone 6. if you iterated over all samples in tone, but you still didn't fill up that last buffer, dequeue next tone from queue, go to #2 7. if there are no more tones in queue, pad the buffer with silence, and push the buffer to audio sink. Looks simple, right? But it's the little details that ruin it all. One of the details is tone's slopes. */ #include "config.h" #include #include #include #include #include #include #include /* uint32_t */ #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw_gen.h" #include "libcw_debug.h" #include "libcw_utils.h" #include "libcw_signal.h" #include "libcw_data.h" #include "libcw_null.h" #include "libcw_console.h" #include "libcw_oss.h" #ifndef M_PI /* C99 may not define M_PI */ #define M_PI 3.14159265358979323846 #endif /* From libcw_debug.c. */ extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* Most of audio systems (excluding console) should be configured to have specific sample rate. Some audio systems (with connection with given hardware) can support several different sample rates. Values of supported sample rates are standardized. Here is a list of them to be used by this library. When the library configures given audio system, it tries if the system will accept a sample rate from the table, starting from the first one. If a sample rate is accepted, rest of sample rates is not tested anymore. */ const unsigned int cw_supported_sample_rates[] = { 44100, 48000, 32000, 22050, 16000, 11025, 8000, 0 /* guard */ }; /* Every audio system opens an audio device: a default device, or some other device. Default devices have their default names, and here is a list of them. It is indexed by values of "enum cw_audio_systems". */ static const char *default_audio_devices[] = { (char *) NULL, /* CW_AUDIO_NONE */ CW_DEFAULT_NULL_DEVICE, /* CW_AUDIO_NULL */ CW_DEFAULT_CONSOLE_DEVICE, CW_DEFAULT_OSS_DEVICE, CW_DEFAULT_ALSA_DEVICE, CW_DEFAULT_PA_DEVICE, (char *) NULL }; /* just in case someone decided to index the table with CW_AUDIO_SOUNDCARD */ /* Generic constants - common for all audio systems (or not used in some of systems). */ static const long int CW_AUDIO_VOLUME_RANGE = (1 << 15); /* 2^15 = 32768 */ static const int CW_AUDIO_SLOPE_LEN = 5000; /* Length of a single slope (rising or falling) in standard tone. [us] */ /* Shortest length of time (in microseconds) that is used by libcw for idle waiting and idle loops. If a libcw function needs to wait for something, or make an idle loop, it should call usleep(N * gen->quantum_len) This is also length of a single "forever" tone. */ static const int CW_AUDIO_QUANTUM_LEN_INITIAL = 100; /* [us] */ static int cw_gen_new_open_internal(cw_gen_t *gen, int audio_system, const char *device); static void *cw_gen_dequeue_and_play_internal(void *arg); static int cw_gen_calculate_sine_wave_internal(cw_gen_t *gen, cw_tone_t *tone); static int cw_gen_calculate_amplitude_internal(cw_gen_t *gen, cw_tone_t *tone); static int cw_gen_write_to_soundcard_internal(cw_gen_t *gen, cw_tone_t *tone, int queue_rv); static int cw_gen_play_valid_character_internal(cw_gen_t *gen, char character, int partial); static void cw_gen_recalculate_slopes_internal(cw_gen_t *gen); /** \brief Get a copy of readable label of current audio system Get a copy of human-readable string describing audio system associated currently with given \p gen. The function returns newly allocated pointer to one of following strings: "None", "Null", "Console", "OSS", "ALSA", "PulseAudio", "Soundcard". The returned pointer is owned by caller. Notice that the function returns a new pointer to newly allocated string. cw_generator_get_audio_system_label() returns a pointer to static string owned by library. \param gen - generator for which to check audio system label \return audio system's label */ char *cw_gen_get_audio_system_label_internal(cw_gen_t *gen) { char *s = strdup(cw_get_audio_system_label(gen->audio_system)); if (!s) { cw_vdm ("failed to strdup() audio system label for audio system %d\n", gen->audio_system); } return s; } /** \brief Start a generator */ int cw_gen_start_internal(cw_gen_t *gen) { gen->phase_offset = 0.0; /* This should be set to true before launching cw_gen_dequeue_and_play_internal(), because loop in the function run only when the flag is set. */ gen->do_dequeue_and_play = true; gen->client.thread_id = pthread_self(); if (gen->audio_system == CW_AUDIO_NULL || gen->audio_system == CW_AUDIO_CONSOLE || gen->audio_system == CW_AUDIO_OSS || gen->audio_system == CW_AUDIO_ALSA || gen->audio_system == CW_AUDIO_PA) { /* cw_gen_dequeue_and_play_internal() is THE function that does the main job of generating tones. */ int rv = pthread_create(&gen->thread.id, &gen->thread.attr, cw_gen_dequeue_and_play_internal, (void *) gen); if (rv != 0) { gen->do_dequeue_and_play = false; cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: failed to create %s generator thread", cw_get_audio_system_label(gen->audio_system)); return CW_FAILURE; } else { gen->thread.running = true; /* For some yet unknown reason you have to put usleep() here, otherwise a generator may work incorrectly */ usleep(100000); #ifdef LIBCW_WITH_DEV cw_dev_debug_print_generator_setup(gen); #endif return CW_SUCCESS; } } else { gen->do_dequeue_and_play = false; cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw: unsupported audio system %d", gen->audio_system); return CW_FAILURE; } } /** \brief Set audio device name or path Set path to audio device, or name of audio device. The path/name will be associated with given generator \p gen, and used when opening audio device. Use this function only when setting up a generator. Function creates its own copy of input string. \param gen - generator to be updated \param device - device to be assigned to generator \p gen \return CW_SUCCESS on success \return CW_FAILURE on errors */ int cw_gen_set_audio_device_internal(cw_gen_t *gen, const char *device) { /* this should be NULL, either because it has been initialized statically as NULL, or set to NULL by generator destructor */ assert (!gen->audio_device); assert (gen->audio_system != CW_AUDIO_NONE); if (gen->audio_system == CW_AUDIO_NONE) { gen->audio_device = (char *) NULL; cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw: no audio system specified"); return CW_FAILURE; } if (device) { gen->audio_device = strdup(device); } else { gen->audio_device = strdup(default_audio_devices[gen->audio_system]); } if (!gen->audio_device) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: malloc()"); return CW_FAILURE; } else { return CW_SUCCESS; } } /** \brief Silence the generator Force an audio sink currently used by generator \p gen to go silent. The function does not clear/flush tone queue, nor does it stop the generator. It just makes sure that audio sink (console / OSS / ALSA / PulseAudio) does not produce a sound of any frequency and any volume. You probably want to call cw_tq_flush_internal(gen->tq) before calling this function. \param gen - generator using an audio sink that should be silenced \return CW_SUCCESS on success \return CW_FAILURE on failure to silence an audio sink */ int cw_gen_silence_internal(cw_gen_t *gen) { if (!gen) { /* this may happen because the process of finalizing usage of libcw is rather complicated; this should be somehow resolved */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_WARNING, "libcw: called the function for NULL generator"); return CW_SUCCESS; } if (!(gen->thread.running)) { /* Silencing a generator means enqueueing and playing a tone with zero frequency. We shouldn't do this when a "dequeue-and-play-a-tone" function is not running (anymore). This is not an error situation, so return CW_SUCCESS. */ return CW_SUCCESS; } int status = CW_SUCCESS; if (gen->audio_system == CW_AUDIO_NULL) { ; /* pass */ } else if (gen->audio_system == CW_AUDIO_CONSOLE) { /* sine wave generation should have been stopped by a code generating dots/dashes, but just in case... */ cw_console_silence(gen); } else if (gen->audio_system == CW_AUDIO_OSS || gen->audio_system == CW_AUDIO_ALSA || gen->audio_system == CW_AUDIO_PA) { cw_tone_t tone; CW_TONE_INIT(&tone, 0, gen->quantum_len, CW_SLOPE_MODE_NO_SLOPES); status = cw_tq_enqueue_internal(gen->tq, &tone); /* allow some time for playing the last tone */ usleep(2 * gen->quantum_len); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: called silence() function for generator without audio system specified"); } if (gen->audio_system == CW_AUDIO_ALSA) { /* "Stop a PCM dropping pending frames. " */ cw_alsa_drop(gen); } //gen->do_dequeue_and_play = false; return status; } /** \brief Create new generator testedin::test_cw_gen_new_delete_internal() */ cw_gen_t *cw_gen_new_internal(int audio_system, const char *device) { #ifdef LIBCW_WITH_DEV fprintf(stderr, "libcw build %s %s\n", __DATE__, __TIME__); #endif cw_assert (audio_system != CW_AUDIO_NONE, "can't create generator with audio system \"NONE\""); cw_gen_t *gen = (cw_gen_t *) malloc(sizeof (cw_gen_t)); if (!gen) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: malloc()"); return (cw_gen_t *) NULL; } gen->tq = cw_tq_new_internal(); if (!gen->tq) { cw_gen_delete_internal(&gen); return (cw_gen_t *) NULL; } else { /* Because libcw_tq.c/cw_tq_enqueue_internal()/pthread_kill(tq->gen->thread.id, SIGALRM); */ gen->tq->gen = gen; } gen->audio_device = NULL; //gen->audio_system = audio_system; gen->audio_device_is_open = false; gen->dev_raw_sink = -1; /* Essential sending parameters. */ gen->send_speed = CW_SPEED_INITIAL, gen->frequency = CW_FREQUENCY_INITIAL; gen->volume_percent = CW_VOLUME_INITIAL; gen->volume_abs = (gen->volume_percent * CW_AUDIO_VOLUME_RANGE) / 100; gen->gap = CW_GAP_INITIAL; gen->weighting = CW_WEIGHTING_INITIAL; gen->parameters_in_sync = false; gen->do_dequeue_and_play = false; gen->buffer = NULL; gen->buffer_n_samples = -1; gen->oss_version.x = -1; gen->oss_version.y = -1; gen->oss_version.z = -1; gen->client.name = (char *) NULL; gen->tone_slope.len = CW_AUDIO_SLOPE_LEN; gen->tone_slope.shape = CW_TONE_SLOPE_SHAPE_RAISED_COSINE; gen->tone_slope.amplitudes = NULL; gen->tone_slope.n_amplitudes = 0; #ifdef LIBCW_WITH_PULSEAUDIO gen->pa_data.s = NULL; gen->pa_data.ba.prebuf = (uint32_t) -1; gen->pa_data.ba.tlength = (uint32_t) -1; gen->pa_data.ba.minreq = (uint32_t) -1; gen->pa_data.ba.maxlength = (uint32_t) -1; gen->pa_data.ba.fragsize = (uint32_t) -1; #endif gen->open_device = NULL; gen->close_device = NULL; gen->write = NULL; pthread_attr_init(&gen->thread.attr); /* Thread must be joinable in order to make a safe call to pthread_kill(thread_id, 0). pthreads are joinable by default, but I take this explicit call as a good opportunity to make this comment. */ pthread_attr_setdetachstate(&gen->thread.attr, PTHREAD_CREATE_JOINABLE); gen->thread.running = false; gen->dot_len = 0; gen->dash_len = 0; gen->eom_space_len = 0; gen->eoc_space_len = 0; gen->eow_space_len = 0; gen->additional_space_len = 0; gen->adjustment_space_len = 0; gen->quantum_len = CW_AUDIO_QUANTUM_LEN_INITIAL; gen->buffer_sub_start = 0; gen->buffer_sub_stop = 0; gen->key = (cw_key_t *) NULL; int rv = cw_gen_new_open_internal(gen, audio_system, device); if (rv == CW_FAILURE) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw: failed to open audio device for audio system '%s' and device '%s'", cw_get_audio_system_label(audio_system), device); cw_gen_delete_internal(&gen); return (cw_gen_t *) NULL; } if (audio_system == CW_AUDIO_NULL || audio_system == CW_AUDIO_CONSOLE) { ; /* the two types of audio output don't require audio buffer */ } else { gen->buffer = (cw_sample_t *) malloc(gen->buffer_n_samples * sizeof (cw_sample_t)); if (!gen->buffer) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: malloc()"); cw_gen_delete_internal(&gen); return (cw_gen_t *) NULL; } } /* Set slope that late, because it uses value of sample rate. The sample rate value is set in cw_gen_new_open_internal(). */ rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_RAISED_COSINE, CW_AUDIO_SLOPE_LEN); if (rv == CW_FAILURE) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: failed to set slope"); cw_gen_delete_internal(&gen); return (cw_gen_t *) NULL; } cw_sigalrm_install_top_level_handler_internal(); return gen; } /** \brief Delete a generator testedin::test_cw_gen_new_delete_internal() */ void cw_gen_delete_internal(cw_gen_t **gen) { cw_assert (gen, "generator is NULL"); if (!*gen) { return; } if ((*gen)->do_dequeue_and_play) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_DEBUG, "libcw: you forgot to call cw_generator_stop()"); cw_gen_stop_internal(*gen); } /* Wait for "write" thread to end accessing output file descriptor. I have come up with value 500 after doing some experiments. FIXME: magic number. I think that we can come up with algorithm for calculating the value. */ usleep(500); free((*gen)->audio_device); (*gen)->audio_device = NULL; free((*gen)->buffer); (*gen)->buffer = NULL; if ((*gen)->close_device) { (*gen)->close_device(*gen); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_DEBUG, "libcw: WARNING: NULL function pointer, something went wrong"); } pthread_attr_destroy(&((*gen)->thread.attr)); free((*gen)->client.name); (*gen)->client.name = NULL; free((*gen)->tone_slope.amplitudes); (*gen)->tone_slope.amplitudes = NULL; cw_tq_delete_internal(&((*gen)->tq)); (*gen)->audio_system = CW_AUDIO_NONE; free(*gen); *gen = NULL; return; } /** \brief Stop a generator Empty generator's tone queue. Silence generator's audio sink. Stop generator' "dequeue and play" thread function. If the thread does not stop in one second, kill it. You have to use cw_gen_start_internal() if you want to enqueue and play tones with the same generator again. It seems that only silencing of generator's audio sink may fail, and this is when this function may return CW_FAILURE. Otherwise function returns CW_SUCCESS. \return CW_SUCCESS if all four actions completed (successfully) \return CW_FAILURE if any of the four actions failed (see note above) */ int cw_gen_stop_internal(cw_gen_t *gen) { if (!gen) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_WARNING, "libcw: called the function for NULL generator"); /* Not really a runtime error, so return CW_SUCCESS. */ return CW_SUCCESS; } cw_tq_flush_internal(gen->tq); int rv = cw_gen_silence_internal(gen); if (rv != CW_SUCCESS) { return CW_FAILURE; } gen->do_dequeue_and_play = false; if (!gen->thread.running) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_INFO, "libcw: EXIT: seems that thread function was not started at all"); /* Don't call pthread_kill() on non-initialized thread.id. The generator wasn't even started, so let's return CW_SUCCESS. */ return CW_SUCCESS; } /* This is to wake up cw_signal_wait_internal() function that may be waiting idle for signal in "while ()" loop in thread function. */ pthread_kill(gen->thread.id, SIGALRM); /* This piece of comment was put before code using pthread_kill(), and may apply only to that version. But it may turn out that it will be valid for code using pthread_join() as well, so I'm keeping it for now. " Sleep a bit to postpone closing a device. This way we can avoid a situation when "do_dequeue_and_play" is set to false and device is being closed while a new buffer is being prepared, and while write() tries to write this new buffer to already closed device. Without this sleep(), writei() from ALSA library may return "File descriptor in bad state" error - this happened when writei() tried to write to closed ALSA handle. The delay also allows the generator function thread to stop generating tone (or for tone queue to get out of CW_TQ_IDLE state) and exit before we resort to killing generator function thread. " */ #if 0 /* Old code using pthread_kill() instead of pthread_join(). */ struct timespec req = { .tv_sec = 1, .tv_nsec = 0 }; cw_nanosleep_internal(&req); /* Check if generator thread is still there. Remember that pthread_kill(id, 0) is unsafe for detached threads: if thread has finished, the ID may be reused, and may be invalid at this point. */ rv = pthread_kill(gen->thread.id, 0); if (rv == 0) { /* thread function didn't return yet; let's help it a bit */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_WARNING, "libcw: EXIT: forcing exit of thread function"); rv = pthread_kill(gen->thread.id, SIGKILL); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_WARNING, "libcw: EXIT: pthread_kill() returns %d/%s", rv, strerror(rv)); } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_INFO, "libcw: EXIT: seems that thread function exited voluntarily"); } gen->thread.running = false; return CW_SUCCESS; #else #define CW_DEBUG_TIMING_JOIN 1 #if CW_DEBUG_TIMING_JOIN /* Debug code to measure how long it takes to join threads. */ struct timeval before, after; gettimeofday(&before, NULL); #endif rv = pthread_join(gen->thread.id, NULL); #if CW_DEBUG_TIMING_JOIN /* Debug code to measure how long it takes to join threads. */ gettimeofday(&after, NULL); cw_debug_msg ((&cw_debug_object), CW_DEBUG_GENERATOR, CW_DEBUG_INFO, "libcw/gen: joining thread took %d us", cw_timestamp_compare_internal(&before, &after)); #endif if (rv == 0) { gen->thread.running = false; return CW_SUCCESS; } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw/gen: failed to join threads: \"%s\"", strerror(rv)); return CW_FAILURE; } #endif } /** \brief Open audio system A wrapper for code trying to open audio device specified by \p audio_system. Open audio system will be assigned to given generator. Caller can also specify audio device to use instead of a default one. \param gen - freshly created generator \param audio_system - audio system to open and assign to the generator \param device - name of audio device to be used instead of a default one \return CW_SUCCESS on success \return CW_FAILURE otherwise */ int cw_gen_new_open_internal(cw_gen_t *gen, int audio_system, const char *device) { /* FIXME: this functionality is partially duplicated in src/cwutils/cw_common.c/cw_generator_new_from_config() */ /* This function deliberately checks all possible values of audio system name in separate 'if' clauses before it gives up and returns CW_FAILURE. PA/OSS/ALSA are combined with SOUNDCARD, so I have to check all three of them (because \p audio_system may be set to SOUNDCARD). And since I check the three in separate 'if' clauses, I can check all other values of audio system as well. */ if (audio_system == CW_AUDIO_NULL) { const char *dev = device ? device : default_audio_devices[CW_AUDIO_NULL]; if (cw_is_null_possible(dev)) { cw_null_configure(gen, dev); return gen->open_device(gen); } } if (audio_system == CW_AUDIO_PA || audio_system == CW_AUDIO_SOUNDCARD) { const char *dev = device ? device : default_audio_devices[CW_AUDIO_PA]; if (cw_is_pa_possible(dev)) { cw_pa_configure(gen, dev); return gen->open_device(gen); } } if (audio_system == CW_AUDIO_OSS || audio_system == CW_AUDIO_SOUNDCARD) { const char *dev = device ? device : default_audio_devices[CW_AUDIO_OSS]; if (cw_is_oss_possible(dev)) { cw_oss_configure(gen, dev); return gen->open_device(gen); } } if (audio_system == CW_AUDIO_ALSA || audio_system == CW_AUDIO_SOUNDCARD) { const char *dev = device ? device : default_audio_devices[CW_AUDIO_ALSA]; if (cw_is_alsa_possible(dev)) { cw_alsa_configure(gen, dev); return gen->open_device(gen); } } if (audio_system == CW_AUDIO_CONSOLE) { const char *dev = device ? device : default_audio_devices[CW_AUDIO_CONSOLE]; if (cw_is_console_possible(dev)) { cw_console_configure(gen, dev); return gen->open_device(gen); } } /* there is no next audio system type to try */ return CW_FAILURE; } /** \brief Dequeue tones and push them to audio output Function dequeues tones from tone queue associated with generator and then sends them to preconfigured audio output (soundcard, NULL or console). Function dequeues tones (or waits for new tones in queue) and pushes them to audio output as long as generator->do_dequeue_and_play is true. The generator must be fully configured before calling this function. \param arg - generator (casted to (void *)) to be used for generating tones \return NULL pointer */ void *cw_gen_dequeue_and_play_internal(void *arg) { cw_gen_t *gen = (cw_gen_t *) arg; cw_tone_t tone; CW_TONE_INIT(&tone, 0, 0, CW_SLOPE_MODE_STANDARD_SLOPES); while (gen->do_dequeue_and_play) { int tq_rv = cw_tq_dequeue_internal(gen->tq, &tone); if (tq_rv == CW_TQ_NDEQUEUED_IDLE) { /* Tone queue has been totally drained with previous call to dequeue(). No point in making next iteration of while() and calling the function again. So don't call it, wait for signal from enqueue() function informing that a new tone appeared in tone queue. */ /* A SIGALRM signal may also come from cw_gen_stop_internal() that gently asks this function to stop idling and nicely return. */ /* TODO: can we / should we specify on which signal exactly we are waiting for? */ cw_signal_wait_internal(); continue; } cw_key_ik_increment_timer_internal(gen->key, tone.len); #ifdef LIBCW_WITH_DEV cw_debug_ev ((&cw_debug_object_ev), 0, tone.frequency ? CW_DEBUG_EVENT_TONE_HIGH : CW_DEBUG_EVENT_TONE_LOW); #endif if (gen->audio_system == CW_AUDIO_NULL) { cw_null_write(gen, &tone); } else if (gen->audio_system == CW_AUDIO_CONSOLE) { cw_console_write(gen, &tone); } else { cw_gen_write_to_soundcard_internal(gen, &tone, tq_rv); } /* When sending text from text input, the signal: - allows client code to observe moment when state of tone queue is "low/critical"; client code then can add more characters to the queue; the observation is done using cw_wait_for_tone_queue_critical(); - ... */ pthread_kill(gen->client.thread_id, SIGALRM); /* Generator may be used by iambic keyer to measure periods of time (lengths of Mark and Space) - this is achieved by enqueueing Marks and Spaces by keyer in generator. At this point the generator has finished generating a tone of specified length. A duration of Mark or Space has elapsed. Inform iambic keyer that the tone it has enqueued has elapsed. (Whether iambic keyer has enqueued any tones or not, and whether it is waiting for the notification, is a different story. We will let the iambic keyer function called below to decide what to do with the notification. If keyer is in idle graph state, it will ignore the notification.) Notice that this mechanism is needed only for iambic keyer. Inner workings of straight key are much more simple, the straight key doesn't need to use generator as a timer. */ if (!cw_key_ik_update_graph_state_internal(gen->key)) { /* just try again, once */ usleep(1000); cw_key_ik_update_graph_state_internal(gen->key); } #ifdef LIBCW_WITH_DEV cw_debug_ev ((&cw_debug_object_ev), 0, tone.frequency ? CW_DEBUG_EVENT_TONE_LOW : CW_DEBUG_EVENT_TONE_HIGH); #endif } /* while (gen->do_dequeue_and_play) */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_INFO, "libcw: EXIT: generator stopped (gen->do_dequeue_and_play = %d)", gen->do_dequeue_and_play); /* Some functions in client thread may be waiting for the last SIGALRM from the generator thread to continue/finalize their business. Let's send the SIGALRM right before exiting. */ /* This small delay before sending signal turns out to be helpful. TODO: this is one of most mysterious comments in this code base. What was I thinking? */ struct timespec req = { .tv_sec = 0, .tv_nsec = CW_NSECS_PER_SEC / 2 }; cw_nanosleep_internal(&req); pthread_kill(gen->client.thread_id, SIGALRM); gen->thread.running = false; return NULL; } /** \brief Calculate a fragment of sine wave Calculate a fragment of sine wave, as many samples as can be fitted in generator buffer's subarea. There will be (gen->buffer_sub_stop - gen->buffer_sub_start + 1) samples calculated and put into gen->buffer[], starting from gen->buffer[gen->buffer_sub_start]. The function takes into account all state variables from gen, so initial phase of new fragment of sine wave in the buffer matches ending phase of a sine wave generated in previous call. \param gen - generator that generates sine wave \param tone - generated tone \return number of calculated samples */ int cw_gen_calculate_sine_wave_internal(cw_gen_t *gen, cw_tone_t *tone) { assert (gen->buffer_sub_stop <= gen->buffer_n_samples); /* We need two separate iterators to correctly generate sine wave: -- i -- for iterating through output buffer (generator buffer's subarea), it can travel between buffer cells delimited by start and stop (inclusive); -- t -- for calculating phase of a sine wave; 't' always has to start from zero for every calculated subarea (i.e. for every call of this function); Initial/starting phase of generated fragment is always retained in gen->phase_offset, it is the only "memory" of previously calculated fragment of sine wave (to be precise: it stores phase of last sample in previously calculated fragment). Therefore iterator used to calculate phase of sine wave can't have the memory too. Therefore it has to always start from zero for every new fragment of sine wave. Therefore a separate t. */ double phase = 0.0; int t = 0; for (int i = gen->buffer_sub_start; i <= gen->buffer_sub_stop; i++) { phase = (2.0 * M_PI * (double) tone->frequency * (double) t / (double) gen->sample_rate) + gen->phase_offset; int amplitude = cw_gen_calculate_amplitude_internal(gen, tone); gen->buffer[i] = amplitude * sin(phase); tone->sample_iterator++; t++; } phase = (2.0 * M_PI * (double) tone->frequency * (double) t / (double) gen->sample_rate) + gen->phase_offset; /* "phase" is now phase of the first sample in next fragment to be calculated. However, for long fragments this can be a large value, well beyond <0; 2*Pi) range. The value of phase may further accumulate in different calculations, and at some point it may overflow. This would result in an audible click. Let's bring back the phase from beyond <0; 2*Pi) range into the <0; 2*Pi) range, in other words lets "normalize" it. Or, in yet other words, lets apply modulo operation to the phase. The normalized phase will be used as a phase offset for next fragment (during next function call). It will be added phase of every sample calculated in next function call. */ int n_periods = floor(phase / (2.0 * M_PI)); gen->phase_offset = phase - n_periods * 2.0 * M_PI; return t; } /** \brief Calculate value of a single sample of sine wave This function calculates an amplitude (a value) of a single sample in sine wave PCM data. Actually "calculation" is a bit too big word. The function is just a three-level-deep decision tree, deciding which of precalculated values to return. There are no complicated arithmetical calculations being made each time the function is called, so the execution time should be pretty small. The precalcuated values depend on some factors, so the values should be re-calculated each time these factors change. See cw_generator_set_tone_slope() for list of these factors. A generator stores some of information needed to get an amplitude of every sample in a sine wave - this is why we have \p gen. If tone's slopes are non-rectangular, the length of slopes is defined in generator. If a tone is non-silent, the volume is also defined in generator. However, decision tree for getting the amplitude also depends on some parameters that are strictly bound to tone, such as what is the shape of slopes for a given tone - this is why we have \p tone. The \p also stores iterator of samples - this is how we know for which sample to calculate the amplitude. \param gen - generator used to generate a sine wave \param tone - tone being generated \return value of a sample of sine wave, a non-negative number */ int cw_gen_calculate_amplitude_internal(cw_gen_t *gen, cw_tone_t *tone) { #if 0 int amplitude = 0; /* Blunt algorithm for calculating amplitude; for debug purposes only. */ if (tone->frequency) { amplitude = gen->volume_abs; } else { amplitude = 0; } return amplitude; #else if (tone->frequency <= 0) { return 0; } int amplitude = 0; /* Every tone, regardless of slope mode (CW_SLOPE_MODE_*), has three components. It has rising slope + plateau + falling slope. There can be four variants of rising and falling slope length, just as there are four CW_SLOPE_MODE_* values. There can be also tones with zero-length plateau, and there can be also tones with zero-length slopes. */ if (tone->sample_iterator < tone->rising_slope_n_samples) { /* Beginning of tone, rising slope. */ int i = tone->sample_iterator; amplitude = gen->tone_slope.amplitudes[i]; assert (amplitude >= 0); } else if (tone->sample_iterator >= tone->rising_slope_n_samples && tone->sample_iterator < tone->n_samples - tone->falling_slope_n_samples) { /* Middle of tone, plateau, constant amplitude. */ amplitude = gen->volume_abs; assert (amplitude >= 0); } else if (tone->sample_iterator >= tone->n_samples - tone->falling_slope_n_samples) { /* Falling slope. */ int i = tone->n_samples - tone->sample_iterator - 1; assert (i >= 0); amplitude = gen->tone_slope.amplitudes[i]; assert (amplitude >= 0); } else { cw_assert (0, "->sample_iterator out of bounds:\n" "tone->sample_iterator: %d\n" "tone->n_samples: %"PRId64"\n" "tone->rising_slope_n_samples: %d\n" "tone->falling_slope_n_samples: %d\n", tone->sample_iterator, tone->n_samples, tone->rising_slope_n_samples, tone->falling_slope_n_samples); } assert (amplitude >= 0); return amplitude; #endif } /** \brief Set parameters of tones generated by generator Most of variables related to slope of tones is in tone data type, but there are still some variables that are generator-specific, as they are common for all tones. This function sets two of these variables. A: If you pass to function conflicting values of \p slope_shape and \p slope_len, the function will return CW_FAILURE. These conflicting values are rectangular slope shape and larger than zero slope length. You just can't have rectangular slopes that have non-zero length. B: If you pass to function '-1' as value of both \p slope_shape and \p slope_len, the function won't change any of the related two generator's parameters. C1: If you pass to function '-1' as value of either \p slope_shape or \p slope_len, the function will attempt to set only this generator's parameter that is different than '-1'. C2: However, if selected slope shape is rectangular, function will set generator's slope length to zero, even if value of \p slope_len is '-1'. D: Notice that the function allows non-rectangular slope shape with zero length of the slopes. The slopes will be non-rectangular, but just unusually short. The function should be called every time one of following parameters change: \li shape of slope, \li length of slope, \li generator's sample rate, \li generator's volume. There are four supported shapes of slopes: \li linear (the only one supported by libcw until version 4.1.1), \li raised cosine (supposedly the most desired shape), \li sine, \li rectangular. Use CW_TONE_SLOPE_SHAPE_* symbolic names as values of \p slope_shape. FIXME: first argument of this public function is gen, but no function provides access to generator variable. \param gen - generator for which to set tone slope parameters \param slope_shape - shape of slope: linear, raised cosine, sine, rectangular \param slope_len - length of slope [microseconds] \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_generator_set_tone_slope(cw_gen_t *gen, int slope_shape, int slope_len) { assert (gen); /* Handle conflicting values of arguments. */ if (slope_shape == CW_TONE_SLOPE_SHAPE_RECTANGULAR && slope_len > 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: requested a rectangular slope shape, but also requested slope len > 0"); return CW_FAILURE; } /* Assign new values from arguments. */ if (slope_shape != -1) { gen->tone_slope.shape = slope_shape; } if (slope_len != -1) { gen->tone_slope.len = slope_len; } /* Override of slope length. */ if (slope_shape == CW_TONE_SLOPE_SHAPE_RECTANGULAR) { gen->tone_slope.len = 0; } int slope_n_samples = ((gen->sample_rate / 100) * gen->tone_slope.len) / 10000; cw_assert (slope_n_samples >= 0, "negative slope_n_samples: %d", slope_n_samples); /* Reallocate the table of slope amplitudes only when necessary. In practice the function will be called foremost when user changes volume of tone (and then the function may be called several times in a row if volume is changed in steps). In such situation the size of amplitudes table doesn't change. */ if (gen->tone_slope.n_amplitudes != slope_n_samples) { /* Remember that slope_n_samples may be zero. In that case realloc() would equal to free(). We don't want to have NULL ->amplitudes, so don't modify ->amplitudes for zero-length slopes. Since with zero-length slopes we won't be referring to ->amplitudes[], it is ok that the table will not be up-to-date. */ if (slope_n_samples > 0) { gen->tone_slope.amplitudes = realloc(gen->tone_slope.amplitudes, sizeof(float) * slope_n_samples); if (!gen->tone_slope.amplitudes) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: failed to realloc() table of slope amplitudes"); return CW_FAILURE; } } gen->tone_slope.n_amplitudes = slope_n_samples; } cw_gen_recalculate_slopes_internal(gen); return CW_SUCCESS; } /** \brief Recalculate amplitudes of PCM samples that form tone's slopes TODO: consider writing unit test code for the function. \param gen - generator */ void cw_gen_recalculate_slopes_internal(cw_gen_t *gen) { /* The values in amplitudes[] change from zero to max (at least for any sane slope shape), so naturally they can be used in forming rising slope. However they can be used in forming falling slope as well - just iterate the table from end to beginning. */ for (int i = 0; i < gen->tone_slope.n_amplitudes; i++) { if (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_LINEAR) { gen->tone_slope.amplitudes[i] = 1.0 * gen->volume_abs * i / gen->tone_slope.n_amplitudes; } else if (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_SINE) { float radian = i * (M_PI / 2.0) / gen->tone_slope.n_amplitudes; gen->tone_slope.amplitudes[i] = sin(radian) * gen->volume_abs; } else if (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_RAISED_COSINE) { float radian = i * M_PI / gen->tone_slope.n_amplitudes; gen->tone_slope.amplitudes[i] = (1 - ((1 + cos(radian)) / 2)) * gen->volume_abs; } else if (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_RECTANGULAR) { /* CW_TONE_SLOPE_SHAPE_RECTANGULAR is covered before entering this "for" loop. */ cw_assert (0, "we shouldn't be here, calculating rectangular slopes"); } else { cw_assert (0, "unsupported slope shape %d", gen->tone_slope.shape); } } return; } /** \brief Write tone to soundcard */ int cw_gen_write_to_soundcard_internal(cw_gen_t *gen, cw_tone_t *tone, int queue_rv) { assert (queue_rv != CW_TQ_NDEQUEUED_IDLE); if (queue_rv == CW_TQ_NDEQUEUED_EMPTY) { /* All tones have been already dequeued from tone queue. \p tone does not represent a valid tone to play. At first sight there is no need to write anything to soundcard. But... It may happen that during previous call to the function there were too few samples in a tone to completely fill a buffer (see #needmoresamples tag below). We need to fill the buffer until it is full and ready to be sent to audio sink. Since there are no new tones for which we could generate samples, we need to generate silence samples. Padding the buffer with silence seems to be a good idea (it will work regardless of value (Mark/Space) of last valid tone). We just need to know how many samples of the silence to produce. Number of these samples will be stored in samples_to_write. */ /* We don't have a valid tone, so let's construct a fake one for purposes of padding. */ /* Required length of padding space is from end of last buffer subarea to end of buffer. */ tone->n_samples = gen->buffer_n_samples - (gen->buffer_sub_stop + 1);; tone->len = 0; /* This value matters no more, because now we only deal with samples. */ tone->frequency = 0; /* This fake tone is a piece of silence. */ /* The silence tone used for padding doesn't require any slopes. A slope falling to silence has been already provided by last non-fake and non-silent tone. */ tone->slope_mode = CW_SLOPE_MODE_NO_SLOPES; tone->rising_slope_n_samples = 0; tone->falling_slope_n_samples = 0; tone->sample_iterator = 0; //fprintf(stderr, "++++ length of padding silence = %d [samples]\n", tone->n_samples); } else { /* tq_rv == CW_TQ_DEQUEUED */ /* Recalculate tone parameters from microseconds into samples. After this point the samples will be all that matters. */ /* 100 * 10000 = 1.000.000 usecs per second. */ tone->n_samples = gen->sample_rate / 100; tone->n_samples *= tone->len; tone->n_samples /= 10000; //fprintf(stderr, "++++ length of regular tone = %d [samples]\n", tone->n_samples); /* Length of a single slope (rising or falling). */ int slope_n_samples= gen->sample_rate / 100; slope_n_samples *= gen->tone_slope.len; slope_n_samples /= 10000; if (tone->slope_mode == CW_SLOPE_MODE_RISING_SLOPE) { tone->rising_slope_n_samples = slope_n_samples; tone->falling_slope_n_samples = 0; } else if (tone->slope_mode == CW_SLOPE_MODE_FALLING_SLOPE) { tone->rising_slope_n_samples = 0; tone->falling_slope_n_samples = slope_n_samples; } else if (tone->slope_mode == CW_SLOPE_MODE_STANDARD_SLOPES) { tone->rising_slope_n_samples = slope_n_samples; tone->falling_slope_n_samples = slope_n_samples; } else if (tone->slope_mode == CW_SLOPE_MODE_NO_SLOPES) { tone->rising_slope_n_samples = 0; tone->falling_slope_n_samples = 0; } else { cw_assert (0, "unknown tone slope mode %d", tone->slope_mode); } tone->sample_iterator = 0; } /* Total number of samples to write in a loop below. */ int64_t samples_to_write = tone->n_samples; #if 0 fprintf(stderr, "++++ entering loop, tone->frequency = %d, buffer->n_samples = %d, tone->n_samples = %d, samples_to_write = %d\n", tone->frequency, gen->buffer_n_samples, tone->n_samples, samples_to_write); fprintf(stderr, "++++ entering loop, expected ~%f loops\n", 1.0 * samples_to_write / gen->buffer_n_samples); int debug_loop = 0; #endif // cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_DEBUG, "libcw: %lld samples, %d us, %d Hz", tone->n_samples, tone->len, gen->frequency); while (samples_to_write > 0) { int64_t free_space = gen->buffer_n_samples - gen->buffer_sub_start; if (samples_to_write > free_space) { /* There will be some tone samples left for next iteration of this loop. But this buffer will be ready to be pushed to audio sink. */ gen->buffer_sub_stop = gen->buffer_n_samples - 1; } else if (samples_to_write == free_space) { /* How nice, end of tone samples aligns with end of buffer (last sample of tone will be placed in last cell of buffer). But the result is the same - a full buffer ready to be pushed to audio sink. */ gen->buffer_sub_stop = gen->buffer_n_samples - 1; } else { /* There will be too few samples to fill a buffer. We can't send an unready buffer to audio sink. We will have to somehow pad the buffer. */ gen->buffer_sub_stop = gen->buffer_sub_start + samples_to_write - 1; } /* How many samples of audio buffer's subarea will be calculated in a given cycle of "calculate sine wave" code? */ int buffer_sub_n_samples = gen->buffer_sub_stop - gen->buffer_sub_start + 1; #if 0 fprintf(stderr, "++++ loop #%d, buffer_sub_n_samples = %d\n", ++debug_loop, buffer_sub_n_samples); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_DEBUG, "libcw: sub start: %d, sub stop: %d, sub len: %d, to calculate: %d", gen->buffer_sub_start, gen->buffer_sub_stop, buffer_sub_n_samples, samples_to_write); #endif int calculated = cw_gen_calculate_sine_wave_internal(gen, tone); cw_assert (calculated == buffer_sub_n_samples, "calculated wrong number of samples: %d != %d", calculated, buffer_sub_n_samples); if (gen->buffer_sub_stop == gen->buffer_n_samples - 1) { /* We have a buffer full of samples. The buffer is ready to be pushed to audio sink. */ gen->write(gen); gen->buffer_sub_start = 0; gen->buffer_sub_stop = 0; #if CW_DEV_RAW_SINK cw_dev_debug_raw_sink_write_internal(gen); #endif } else { /* #needmoresamples There is still some space left in the buffer, go fetch new tone from tone queue. */ gen->buffer_sub_start = gen->buffer_sub_stop + 1; cw_assert (gen->buffer_sub_start <= gen->buffer_n_samples - 1, "sub start out of range: sub start = %d, buffer n samples = %d", gen->buffer_sub_start, gen->buffer_n_samples); } samples_to_write -= buffer_sub_n_samples; #if 0 if (samples_to_write < 0) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_DEBUG, "samples left = %d", samples_to_write); } #endif } /* while (samples_to_write > 0) { */ //fprintf(stderr, "++++ left loop, %d loops, samples left = %d\n", debug_loop, (int) samples_to_write); return 0; } /** \brief Set sending speed of generator See libcw.h/CW_SPEED_{INITIAL|MIN|MAX} for initial/minimal/maximal value of send speed. errno is set to EINVAL if \p new_value is out of range. testedin::test_parameter_ranges() \param gen - generator for which to set the speed \param new_value - new value of send speed to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_set_speed_internal(cw_gen_t *gen, int new_value) { if (new_value < CW_SPEED_MIN || new_value > CW_SPEED_MAX) { errno = EINVAL; return CW_FAILURE; } if (new_value != gen->send_speed) { gen->send_speed = new_value; /* Changes of send speed require resynchronization. */ gen->parameters_in_sync = false; cw_gen_sync_parameters_internal(gen); } return CW_SUCCESS; } /** \brief Set frequency of generator Set frequency of sound wave generated by generator. The frequency must be within limits marked by CW_FREQUENCY_MIN and CW_FREQUENCY_MAX. See libcw.h/CW_FREQUENCY_{INITIAL|MIN|MAX} for initial/minimal/maximal value of frequency. errno is set to EINVAL if \p new_value is out of range. \param gen - generator for which to set new frequency \param new_value - new value of frequency to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_set_frequency_internal(cw_gen_t *gen, int new_value) { if (new_value < CW_FREQUENCY_MIN || new_value > CW_FREQUENCY_MAX) { errno = EINVAL; return CW_FAILURE; } else { gen->frequency = new_value; return CW_SUCCESS; } } /** \brief Set volume of generator Set volume of sound wave generated by generator. The volume must be within limits marked by CW_VOLUME_MIN and CW_VOLUME_MAX. Note that volume settings are not fully possible for the console speaker. In this case, volume settings greater than zero indicate console speaker sound is on, and setting volume to zero will turn off console speaker sound. See libcw.h/CW_VOLUME_{INITIAL|MIN|MAX} for initial/minimal/maximal value of volume. errno is set to EINVAL if \p new_value is out of range. \param gen - generator for which to set a volume level \param new_value - new value of volume to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_set_volume_internal(cw_gen_t *gen, int new_value) { if (new_value < CW_VOLUME_MIN || new_value > CW_VOLUME_MAX) { errno = EINVAL; return CW_FAILURE; } else { gen->volume_percent = new_value; gen->volume_abs = (gen->volume_percent * CW_AUDIO_VOLUME_RANGE) / 100; cw_generator_set_tone_slope(gen, -1, -1); return CW_SUCCESS; } } /** \brief Set sending gap of generator See libcw.h/CW_GAP_{INITIAL|MIN|MAX} for initial/minimal/maximal value of gap. errno is set to EINVAL if \p new_value is out of range. \param gen - generator for which to set gap \param new_value - new value of gap to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_set_gap_internal(cw_gen_t *gen, int new_value) { if (new_value < CW_GAP_MIN || new_value > CW_GAP_MAX) { errno = EINVAL; return CW_FAILURE; } if (new_value != gen->gap) { gen->gap = new_value; /* Changes of gap require resynchronization. */ gen->parameters_in_sync = false; cw_gen_sync_parameters_internal(gen); } return CW_SUCCESS; } /** \brief Set sending weighting for generator See libcw.h/CW_WEIGHTING_{INITIAL|MIN|MAX} for initial/minimal/maximal value of weighting. errno is set to EINVAL if \p new_value is out of range. \param gen - generator for which to set new weighting \param new_value - new value of weighting to be assigned for generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_set_weighting_internal(cw_gen_t *gen, int new_value) { if (new_value < CW_WEIGHTING_MIN || new_value > CW_WEIGHTING_MAX) { errno = EINVAL; return CW_FAILURE; } if (new_value != gen->weighting) { gen->weighting = new_value; /* Changes of weighting require resynchronization. */ gen->parameters_in_sync = false; cw_gen_sync_parameters_internal(gen); } return CW_SUCCESS; } /** \brief Get sending speed from generator \param gen - generator from which to get the parameter \return current value of the generator's send speed */ int cw_gen_get_speed_internal(cw_gen_t *gen) { return gen->send_speed; } /** \brief Get frequency from generator Function returns "frequency" parameter of generator, even if the generator is stopped, or volume of generated sound is zero. \param gen - generator from which to get the parameter \return current value of generator's frequency */ int cw_gen_get_frequency_internal(cw_gen_t *gen) { return gen->frequency; } /** \brief Get sound volume from generator Function returns "volume" parameter of generator, even if the generator is stopped. \param gen - generator from which to get the parameter \return current value of generator's sound volume */ int cw_gen_get_volume_internal(cw_gen_t *gen) { return gen->volume_percent; } /** \brief Get sending gap from generator \param gen - generator from which to get the parameter \return current value of generator's sending gap */ int cw_gen_get_gap_internal(cw_gen_t *gen) { return gen->gap; } /** \brief Get sending weighting from generator \param gen - generator from which to get the parameter \return current value of generator's sending weighting */ int cw_gen_get_weighting_internal(cw_gen_t *gen) { return gen->weighting; } /** \brief Get timing parameters for sending Return the low-level timing parameters calculated from the speed, gap, tolerance, and weighting set. Parameter values are returned in microseconds. Use NULL for the pointer argument to any parameter value not required. \param gen \param dot_len \param dash_len \param eom_space_len \param eoc_space_len \param eow_space_len \param additional_space_len \param adjustment_space_len */ void cw_gen_get_send_parameters_internal(cw_gen_t *gen, int *dot_len, int *dash_len, int *eom_space_len, int *eoc_space_len, int *eow_space_len, int *additional_space_len, int *adjustment_space_len) { cw_gen_sync_parameters_internal(gen); if (dot_len) *dot_len = gen->dot_len; if (dash_len) *dash_len = gen->dash_len; if (eom_space_len) *eom_space_len = gen->eom_space_len; if (eoc_space_len) *eoc_space_len = gen->eoc_space_len; if (eow_space_len) *eow_space_len = gen->eow_space_len; if (additional_space_len) *additional_space_len = gen->additional_space_len; if (adjustment_space_len) *adjustment_space_len = gen->adjustment_space_len; return; } /** \brief Play a mark (Dot or Dash) Low level primitive to play a tone for mark of the given type, followed by the standard inter-mark space. Function sets errno to EINVAL if an argument is invalid, and returns CW_FAILURE. Function also returns CW_FAILURE if adding the element to queue of tones failed. \param gen - generator to be used to play a mark and inter-mark space \param mark - mark to send: Dot (CW_DOT_REPRESENTATION) or Dash (CW_DASH_REPRESENTATION) \return CW_FAILURE on failure \return CW_SUCCESS on success */ int cw_gen_play_mark_internal(cw_gen_t *gen, char mark) { int status; /* Synchronize low-level timings if required. */ cw_gen_sync_parameters_internal(gen); /* TODO: do we need to synchronize here receiver as well? */ /* Send either a dot or a dash mark, depending on representation. */ if (mark == CW_DOT_REPRESENTATION) { cw_tone_t tone; CW_TONE_INIT(&tone, gen->frequency, gen->dot_len, CW_SLOPE_MODE_STANDARD_SLOPES); status = cw_tq_enqueue_internal(gen->tq, &tone); } else if (mark == CW_DASH_REPRESENTATION) { cw_tone_t tone; CW_TONE_INIT(&tone, gen->frequency, gen->dash_len, CW_SLOPE_MODE_STANDARD_SLOPES); status = cw_tq_enqueue_internal(gen->tq, &tone); } else { errno = EINVAL; status = CW_FAILURE; } if (!status) { return CW_FAILURE; } /* Send the inter-mark space. */ cw_tone_t tone; CW_TONE_INIT(&tone, 0, gen->eom_space_len, CW_SLOPE_MODE_NO_SLOPES); if (!cw_tq_enqueue_internal(gen->tq, &tone)) { return CW_FAILURE; } else { return CW_SUCCESS; } } /** \brief Play end-of-character space The function plays space of length 2 Units. The function is intended to be used after inter-mark space has already been played. In such situation standard inter-mark space (one Unit) and end-of-character space (two Units) form a full standard end-of-character space (three Units). Inter-character adjustment space is added at the end. \param gen \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_eoc_space_internal(cw_gen_t *gen) { /* Synchronize low-level timing parameters. */ cw_gen_sync_parameters_internal(gen); /* Delay for the standard end of character period, plus any additional inter-character gap */ cw_tone_t tone; CW_TONE_INIT(&tone, 0, gen->eoc_space_len + gen->additional_space_len, CW_SLOPE_MODE_NO_SLOPES); return cw_tq_enqueue_internal(gen->tq, &tone); } /** \brief Play end-of-word space The function should be used to play a regular ' ' character. The function plays space of length 5 Units. The function is intended to be used after inter-mark space and end-of-character space have already been played. In such situation standard inter-mark space (one Unit) and end-of-character space (two Units) and end-of-word space (five units) form a full standard end-of-word space (seven Units). Inter-word adjustment space is added at the end. \param gen \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_eow_space_internal(cw_gen_t *gen) { /* Synchronize low-level timing parameters. */ cw_gen_sync_parameters_internal(gen); /* Send silence for the word delay period, plus any adjustment that may be needed at end of word. Make it in two tones, and here is why. Let's say that 'tone queue low watermark' is one element (i.e. one tone). In order for tone queue to recognize that a 'low tone queue' callback needs to be called, the level in tq needs to drop from 2 to 1. Almost every queued character guarantees that there will be at least two tones, e.g for 'E' it is dash + following space. But what about a ' ' character? If we play ' ' character as single tone, there is only one tone in tone queue, and the tone queue manager can't recognize when the level drops from 2 to 1 (and thus the 'low level' callback won't be called). If we play ' ' character as two separate tones (as we do this in this function), the tone queue manager can recognize level dropping from 2 to 1. Then the passing of critical level can be noticed, and "low level" callback can be called. */ cw_tone_t tone; CW_TONE_INIT(&tone, 0, gen->eow_space_len, CW_SLOPE_MODE_NO_SLOPES); int rv = cw_tq_enqueue_internal(gen->tq, &tone); if (rv == CW_SUCCESS) { CW_TONE_INIT(&tone, 0, gen->adjustment_space_len, CW_SLOPE_MODE_NO_SLOPES); rv = cw_tq_enqueue_internal(gen->tq, &tone); } return rv; } /** \brief Play the given representation Function plays given \p representation using given \p generator. Every mark from the \p representation is followed by a standard inter-mark space. If \p partial is false, the representation is treated as a complete (non-partial) data, and a standard end-of-character space is played at the end (in addition to last inter-mark space). Total length of space at the end (inter-mark space + end-of-character space) is ~3 Units. If \p partial is true, the standard end-of-character space is not appended. However, the standard inter-mark space is played at the end. Function sets errno to EAGAIN if there is not enough space in tone queue to enqueue \p representation. Function validates \p representation using cw_representation_is_valid(). Function sets errno to EINVAL if \p representation is not valid. \param gen - generator used to play the representation \param representation - representation to play \param partial \return CW_FAILURE on failure \return CW_SUCCESS on success */ int cw_gen_play_representation_internal(cw_gen_t *gen, const char *representation, bool partial) { if (!cw_representation_is_valid(representation)) { errno = EINVAL; return CW_FAILURE; } /* Before we let this representation loose on tone generation, we'd really like to know that all of its tones will get queued up successfully. The right way to do this is to calculate the number of tones in our representation, then check that the space exists in the tone queue. However, since the queue is comfortably long, we can get away with just looking for a high water mark. */ if (cw_tq_length_internal(gen->tq) >= gen->tq->high_water_mark) { errno = EAGAIN; return CW_FAILURE; } /* Play the marks. Every mark is followed by end-of-mark space. */ for (int i = 0; representation[i] != '\0'; i++) { if (!cw_gen_play_mark_internal(gen, representation[i])) { return CW_FAILURE; } } /* Check if we should append end-of-character space at the end (in addition to last end-of-mark space). */ if (!partial) { if (!cw_gen_play_eoc_space_internal(gen)) { return CW_FAILURE; } } return CW_SUCCESS; } /** \brief Look up and play a given ASCII character as Morse code If \p partial is set, the end-of-character space is not appended after last mark of Morse code. Function sets errno to ENOENT if \p character is not a recognized character. \param gen - generator to be used to play character \param character - character to play \param partial \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_valid_character_internal(cw_gen_t *gen, char character, int partial) { if (!gen) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: no generator available"); return CW_FAILURE; } /* ' ' character (i.e. end-of-word space) is a special case. */ if (character == ' ') { return cw_gen_play_eow_space_internal(gen); } /* Lookup the character, and play it. */ const char *representation = cw_character_to_representation_internal(character); if (!representation) { errno = ENOENT; return CW_FAILURE; } if (!cw_gen_play_representation_internal(gen, representation, partial)) { return CW_FAILURE; } else { return CW_SUCCESS; } } /** \brief Look up and play a given ASCII character as Morse The end of character delay is appended to the Morse sent. On success the function returns CW_SUCCESS. On failure the function returns CW_FAILURE and sets errno. errno is set to ENOENT if the given character \p c is not a valid Morse character. errno is set to EBUSY if current audio sink or keying system is busy. errno is set to EAGAIN if the generator's tone queue is full, or if there is insufficient space to queue the tones for the character. This routine returns as soon as the character has been successfully queued for sending; that is, almost immediately. The actual sending happens in background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. \param gen - generator to play with \param c - character to play \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_character_internal(cw_gen_t *gen, char c) { /* The call to _is_valid() is placed outside of cw_gen_play_valid_character_internal() for performance reasons. Or to put it another way: cw_gen_play_valid_character_internal() was created to be called in loop for all characters of validated string, so there was no point in validating all characters separately in that function. */ if (!cw_character_is_valid(c)) { errno = ENOENT; return CW_FAILURE; } else { return cw_gen_play_valid_character_internal(gen, c, false); } } /** \brief Look up and play a given ASCII character as Morse code "partial" means that the "end of character" delay is not appended to the Morse code sent by the function, to support the formation of combination characters. On success the function returns CW_SUCCESS. On failure the function returns CW_FAILURE and sets errno. errno is set to ENOENT if the given character \p c is not a valid Morse character. errno is set to EBUSY if the audio sink or keying system is busy. errno is set to EAGAIN if the tone queue is full, or if there is insufficient space to queue the tones for the character. This routine queues its arguments for background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. \param gen - generator to use \param c - character to play \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_character_parital_internal(cw_gen_t *gen, char c) { /* The call to _is_valid() is placed outside of cw_gen_play_valid_character_internal() for performance reasons. Or to put it another way: cw_gen_play_valid_character_internal() was created to be called in loop for all characters of validated string, so there was no point in validating all characters separately in that function. */ if (!cw_character_is_valid(c)) { errno = ENOENT; return CW_FAILURE; } else { return cw_gen_play_valid_character_internal(gen, c, true); } } /** \brief Play a given ASCII string in Morse code errno is set to ENOENT if any character in the string is not a valid Morse character. errno is set to EBUSY if audio sink or keying system is busy. errno is set to EAGAIN if the tone queue is full or if the tone queue runs out of space part way through queueing the string. However, an indeterminate number of the characters from the string will have already been queued. For safety, clients can ensure the tone queue is empty before queueing a string, or use cw_gen_play_character_internal() if they need finer control. This routine queues its arguments for background processing, the actual sending happens in background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. \param gen - generator to use \param string - string to play \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_play_string_internal(cw_gen_t *gen, const char *string) { /* Check the string is composed of sendable characters. */ if (!cw_string_is_valid(string)) { errno = ENOENT; return CW_FAILURE; } /* Send every character in the string. */ for (int i = 0; string[i] != '\0'; i++) { if (!cw_gen_play_valid_character_internal(gen, string[i], false)) return CW_FAILURE; } return CW_SUCCESS; } /** \brief Reset essential sending parameters to their initial values \param gen */ void cw_gen_reset_send_parameters_internal(cw_gen_t *gen) { cw_assert (gen, "generator is NULL"); gen->send_speed = CW_SPEED_INITIAL; gen->frequency = CW_FREQUENCY_INITIAL; gen->volume_percent = CW_VOLUME_INITIAL; gen->volume_abs = (gen->volume_percent * CW_AUDIO_VOLUME_RANGE) / 100; gen->gap = CW_GAP_INITIAL; gen->weighting = CW_WEIGHTING_INITIAL; gen->parameters_in_sync = false; return; } /** \brief Synchronize generator's low level timing parameters \param gen - generator */ void cw_gen_sync_parameters_internal(cw_gen_t *gen) { cw_assert (gen, "generator is NULL"); /* Do nothing if we are already synchronized. */ if (gen->parameters_in_sync) { return; } /* Set the length of a Dot to be a Unit with any weighting adjustment, and the length of a Dash as three Dot lengths. The weighting adjustment is by adding or subtracting a length based on 50 % as a neutral weighting. */ int unit_length = CW_DOT_CALIBRATION / gen->send_speed; int weighting_length = (2 * (gen->weighting - 50) * unit_length) / 100; gen->dot_len = unit_length + weighting_length; gen->dash_len = 3 * gen->dot_len; /* End-of-mark space length is one Unit, perhaps adjusted. End-of-character space length is three Units total. End-of-word space length is seven Units total. WARNING: notice how the eoc and eow spaces are calculated. They aren't full 3 units and 7 units. They are 2 units (which takes into account preceding eom space length), and 5 units (which takes into account preceding eom *and* eoc space length). So these two lengths are *additional* ones, i.e. in addition to (already existing) eom and/or eoc space. Whether this is good or bad idea to calculate them like this is a separate topic. Just be aware of this fact. The end-of-mark length is adjusted by 28/22 times weighting length to keep PARIS calibration correctly timed (PARIS has 22 full units, and 28 empty ones). End-of-mark and end of character delays take weightings into account. */ gen->eom_space_len = unit_length - (28 * weighting_length) / 22; /* End-of-mark space, a.k.a. regular inter-mark space. */ gen->eoc_space_len = 3 * unit_length - gen->eom_space_len; gen->eow_space_len = 7 * unit_length - gen->eoc_space_len; gen->additional_space_len = gen->gap * unit_length; /* For "Farnsworth", there also needs to be an adjustment delay added to the end of words, otherwise the rhythm is lost on word end. I don't know if there is an "official" value for this, but 2.33 or so times the gap is the correctly scaled value, and seems to sound okay. Thanks to Michael D. Ivey for identifying this in earlier versions of libcw. */ gen->adjustment_space_len = (7 * gen->additional_space_len) / 3; cw_debug_msg ((&cw_debug_object), CW_DEBUG_PARAMETERS, CW_DEBUG_INFO, "libcw: send usec timings <%d [wpm]>: dot: %d, dash: %d, %d, %d, %d, %d, %d", gen->send_speed, gen->dot_len, gen->dash_len, gen->eom_space_len, gen->eoc_space_len, gen->eow_space_len, gen->additional_space_len, gen->adjustment_space_len); /* Generator parameters are now in sync. */ gen->parameters_in_sync = true; return; } /** Helper function intended to hide details of tone queue and of enqueueing a tone from cw_key module. 'key' is a verb here. The function should be called only on "key down" (begin mark) event from hardware straight key. The function is called in very specific context, see cw_key module for details. \param gen - generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_key_begin_mark_internal(cw_gen_t *gen) { /* In case of straight key we don't know at all how long the tone should be (we don't know for how long the key will be closed). Let's enqueue a beginning of mark (rising slope) + "forever" (constant) tone. The constant tone will be played until function receives CW_KEY_STATE_OPEN key state. */ cw_tone_t tone; CW_TONE_INIT(&tone, gen->frequency, gen->tone_slope.len, CW_SLOPE_MODE_RISING_SLOPE); int rv = cw_tq_enqueue_internal(gen->tq, &tone); if (rv == CW_SUCCESS) { CW_TONE_INIT(&tone, gen->frequency, gen->quantum_len, CW_SLOPE_MODE_NO_SLOPES); tone.forever = true; rv = cw_tq_enqueue_internal(gen->tq, &tone); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_DEBUG, "libcw: tone queue: len = %"PRIu32"", cw_tq_length_internal(gen->tq)); } return rv; } /** Helper function intended to hide details of tone queue and of enqueueing a tone from cw_key module. 'key' is a verb here. The function should be called only on "key up" (begin space) event from hardware straight key. The function is called in very specific context, see cw_key module for details. \param gen - generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_key_begin_space_internal(cw_gen_t *gen) { if (gen->audio_system == CW_AUDIO_CONSOLE) { /* Play just a bit of silence, just to switch buzzer from playing a sound to being silent. */ cw_tone_t tone; CW_TONE_INIT(&tone, 0, gen->quantum_len, CW_SLOPE_MODE_NO_SLOPES); return cw_tq_enqueue_internal(gen->tq, &tone); } else { /* For soundcards a falling slope with volume from max to zero should be enough, but... */ cw_tone_t tone; CW_TONE_INIT(&tone, gen->frequency, gen->tone_slope.len, CW_SLOPE_MODE_FALLING_SLOPE); int rv = cw_tq_enqueue_internal(gen->tq, &tone); if (rv == CW_SUCCESS) { /* ... but on some occasions, on some platforms, some sound systems may need to constantly play "silent" tone. These four lines of code are just for them. It would be better to avoid queueing silent "forever" tone because this increases CPU usage. It would be better to simply not to queue any new tones after "falling slope" tone. Silence after the last falling slope would simply last on itself until there is new tone on queue to play. */ CW_TONE_INIT(&tone, 0, gen->quantum_len, CW_SLOPE_MODE_NO_SLOPES); tone.forever = true; rv = cw_tq_enqueue_internal(gen->tq, &tone); } return rv; } } /** Helper function intended to hide details of tone queue and of enqueueing a tone from cw_key module. 'key' is a verb here. It indicates, that the function should be called on hardware key events only. Since we enqueue symbols, we know that they have limited, specified length. This means that the function should be called for events from iambic keyer. 'Pure' means without any end-of-mark spaces. The function is called in very specific context, see cw_key module for details. \param gen - generator \param symbol - symbol to enqueue (Space/Dot/Dash) \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_gen_key_pure_symbol_internal(cw_gen_t *gen, char symbol) { cw_tone_t tone; if (symbol == CW_DOT_REPRESENTATION) { CW_TONE_INIT(&tone, gen->frequency, gen->dot_len, CW_SLOPE_MODE_STANDARD_SLOPES); } else if (symbol == CW_DASH_REPRESENTATION) { CW_TONE_INIT(&tone, gen->frequency, gen->dash_len, CW_SLOPE_MODE_STANDARD_SLOPES); } else if (symbol == CW_SYMBOL_SPACE) { CW_TONE_INIT(&tone, 0, gen->eom_space_len, CW_SLOPE_MODE_NO_SLOPES); } else { cw_assert (0, "unknown key symbol '%d'", symbol); } return cw_tq_enqueue_internal(gen->tq, &tone); } /* *** Unit tests *** */ #ifdef LIBCW_UNIT_TESTS #include "libcw_test.h" /** tests::cw_gen_new_internal() tests::cw_gen_delete_internal() */ unsigned int test_cw_gen_new_delete_internal(void) { int p = fprintf(stdout, "libcw/gen: cw_gen_new/start/stop/delete_internal():\n"); fflush(stdout); /* Arbitrary number of calls to a set of tested functions. */ int n = 100; /* new() + delete() */ fprintf(stderr, "libcw/gen: generator test 1/4\n"); for (int i = 0; i < n; i++) { cw_gen_t *gen = cw_gen_new_internal(CW_AUDIO_NULL, NULL); cw_assert (gen, "failed to initialize generator (loop #%d)", i); /* Try to access some fields in cw_gen_t just to be sure that the gen has been allocated properly. */ cw_assert (gen->buffer_sub_start == 0, "buffer_sub_start in new generator is not at zero"); gen->buffer_sub_stop = gen->buffer_sub_start + 10; cw_assert (gen->buffer_sub_stop == 10, "buffer_sub_stop didn't store correct new value"); cw_assert (gen->client.name == (char *) NULL, "initial value of generator's client name is not NULL"); cw_assert (gen->tq, "tone queue is NULL"); cw_gen_delete_internal(&gen); cw_assert (gen == NULL, "delete() didn't set the pointer to NULL (loop #%d)", i); } n = 5; /* new() + start() + delete() (skipping stop() on purpose). */ for (int i = 0; i < n; i++) { fprintf(stderr, "libcw/gen: generator test 2/4, loop #%d/%d\n", i, n); cw_gen_t *gen = cw_gen_new_internal(CW_AUDIO_NULL, NULL); cw_assert (gen, "failed to initialize generator (loop #%d)", i); int rv = cw_gen_start_internal(gen); cw_assert (rv, "failed to start generator (loop #%d)", i); cw_gen_delete_internal(&gen); cw_assert (gen == NULL, "delete() didn't set the pointer to NULL (loop #%d)", i); } /* new() + stop() + delete() (skipping start() on purpose). */ fprintf(stderr, "libcw/gen: generator test 3/4\n"); for (int i = 0; i < n; i++) { cw_gen_t *gen = cw_gen_new_internal(CW_AUDIO_NULL, NULL); cw_assert (gen, "failed to initialize generator (loop #%d)", i); int rv = cw_gen_stop_internal(gen); cw_assert (rv, "failed to stop generator (loop #%d)", i); cw_gen_delete_internal(&gen); cw_assert (gen == NULL, "delete() didn't set the pointer to NULL (loop #%d)", i); } /* Inner loop. */ int m = n; /* new() + start() + stop() + delete() */ for (int i = 0; i < n; i++) { fprintf(stderr, "libcw/gen: generator test 4/4, loop #%d/%d\n", i, n); cw_gen_t *gen = cw_gen_new_internal(CW_AUDIO_NULL, NULL); cw_assert (gen, "failed to initialize generator (loop #%d)", i); for (int j = 0; j < m; j++) { int rv = cw_gen_start_internal(gen); cw_assert (rv, "failed to start generator (loop #%d-%d)", i, j); rv = cw_gen_stop_internal(gen); cw_assert (rv, "failed to stop generator (loop #%d-%d)", i, j); } cw_gen_delete_internal(&gen); cw_assert (gen == NULL, "delete() didn't set the pointer to NULL (loop #%d)", i); } p = fprintf(stdout, "libcw/gen: cw_gen_new/start/stop/delete_internal():"); CW_TEST_PRINT_TEST_RESULT(false, p); fflush(stdout); return 0; } unsigned int test_cw_generator_set_tone_slope(void) { int p = fprintf(stdout, "libcw/gen: cw_generator_set_tone_slope():"); int audio_system = CW_AUDIO_NULL; /* Test 0: test property of newly created generator. */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test 0"); cw_assert (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_RAISED_COSINE, "new generator has unexpected initial slope shape %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == CW_AUDIO_SLOPE_LEN, "new generator has unexpected initial slope length %d", gen->tone_slope.len); cw_gen_delete_internal(&gen); } /* Test A: pass conflicting arguments. "A: If you pass to function conflicting values of \p slope_shape and \p slope_len, the function will return CW_FAILURE. These conflicting values are rectangular slope shape and larger than zero slope length. You just can't have rectangular slopes that have non-zero length." */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test A"); int rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_RECTANGULAR, 10); cw_assert (!rv, "function accepted conflicting arguments"); cw_gen_delete_internal(&gen); } /* Test B: pass '-1' as both arguments. "B: If you pass to function '-1' as value of both \p slope_shape and \p slope_len, the function won't change any of the related two generator's parameters." */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test B"); int shape_before = gen->tone_slope.shape; int len_before = gen->tone_slope.len; int rv = cw_generator_set_tone_slope(gen, -1, -1); cw_assert (rv, "failed to set tone slope"); cw_assert (gen->tone_slope.shape == shape_before, "tone slope shape changed from %d to %d", shape_before, gen->tone_slope.shape); cw_assert (gen->tone_slope.len == len_before, "tone slope length changed from %d to %d", len_before, gen->tone_slope.len); cw_gen_delete_internal(&gen); } /* Test C1 "C1: If you pass to function '-1' as value of either \p slope_shape or \p slope_len, the function will attempt to set only this generator's parameter that is different than '-1'." */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test C1"); /* At the beginning of test these values are generator's initial values. As test progresses, some other values will be expected after successful calls to tested function. */ int expected_shape = CW_TONE_SLOPE_SHAPE_RAISED_COSINE; int expected_len = CW_AUDIO_SLOPE_LEN; /* At this point generator should have initial values of its parameters (yes, that's test zero again). */ cw_assert (gen->tone_slope.shape == expected_shape, "new generator has unexpected initial slope shape %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "new generator has unexpected initial slope length %d", gen->tone_slope.len); /* Set only new slope shape. */ expected_shape = CW_TONE_SLOPE_SHAPE_LINEAR; int rv = cw_generator_set_tone_slope(gen, expected_shape, -1); cw_assert (rv, "failed to set linear slope shape with unchanged slope length"); /* At this point only slope shape should be updated. */ cw_assert (gen->tone_slope.shape == expected_shape, "failed to set new shape of slope; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "failed to preserve slope length; length is %d", gen->tone_slope.len); /* Set only new slope length. */ expected_len = 30; rv = cw_generator_set_tone_slope(gen, -1, expected_len); cw_assert (rv, "failed to set positive slope length with unchanged slope shape"); /* At this point only slope length should be updated (compared to previous function call). */ cw_assert (gen->tone_slope.shape == expected_shape, "failed to preserve shape of slope; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "failed to set new slope length; length is %d", gen->tone_slope.len); /* Set only new slope shape. */ expected_shape = CW_TONE_SLOPE_SHAPE_SINE; rv = cw_generator_set_tone_slope(gen, expected_shape, -1); cw_assert (rv, "failed to set new slope shape with unchanged slope length"); /* At this point only slope shape should be updated (compared to previous function call). */ cw_assert (gen->tone_slope.shape == expected_shape, "failed to set new shape of slope; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "failed to preserve slope length; length is %d", gen->tone_slope.len); cw_gen_delete_internal(&gen); } /* Test C2 "C2: However, if selected slope shape is rectangular, function will set generator's slope length to zero, even if value of \p slope_len is '-1'." */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test C2"); /* At the beginning of test these values are generator's initial values. As test progresses, some other values will be expected after successful calls to tested function. */ int expected_shape = CW_TONE_SLOPE_SHAPE_RAISED_COSINE; int expected_len = CW_AUDIO_SLOPE_LEN; /* At this point generator should have initial values of its parameters (yes, that's test zero again). */ cw_assert (gen->tone_slope.shape == expected_shape, "new generator has unexpected initial slope shape %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "new generator has unexpected initial slope length %d", gen->tone_slope.len); /* Set only new slope shape. */ expected_shape = CW_TONE_SLOPE_SHAPE_RECTANGULAR; expected_len = 0; /* Even though we won't pass this to function, this is what we expect to get after this call. */ int rv = cw_generator_set_tone_slope(gen, expected_shape, -1); cw_assert (rv, "failed to set rectangular slope shape with unchanged slope length"); /* At this point slope shape AND slope length should be updated (slope length is updated only because of requested rectangular slope shape). */ cw_assert (gen->tone_slope.shape == expected_shape, "failed to set new shape of slope; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == expected_len, "failed to get expected slope length; length is %d", gen->tone_slope.len); cw_gen_delete_internal(&gen); } /* Test D "D: Notice that the function allows non-rectangular slope shape with zero length of the slopes. The slopes will be non-rectangular, but just unusually short." */ { cw_gen_t *gen = cw_gen_new_internal(audio_system, NULL); cw_assert (gen, "failed to initialize generator in test D"); int rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_LINEAR, 0); cw_assert (rv, "failed to set linear slope with zero length"); cw_assert (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_LINEAR, "failed to set linear slope shape; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == 0, "failed to set zero slope length; length is %d", gen->tone_slope.len); rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_RAISED_COSINE, 0); cw_assert (rv, "failed to set raised cosine slope with zero length"); cw_assert (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_RAISED_COSINE, "failed to set raised cosine slope shape; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == 0, "failed to set zero slope length; length is %d", gen->tone_slope.len); rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_SINE, 0); cw_assert (rv, "failed to set sine slope with zero length"); cw_assert (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_SINE, "failed to set sine slope shape; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == 0, "failed to set zero slope length; length is %d", gen->tone_slope.len); rv = cw_generator_set_tone_slope(gen, CW_TONE_SLOPE_SHAPE_RECTANGULAR, 0); cw_assert (rv, "failed to set rectangular slope with zero length"); cw_assert (gen->tone_slope.shape == CW_TONE_SLOPE_SHAPE_RECTANGULAR, "failed to set rectangular slope shape; shape is %d", gen->tone_slope.shape); cw_assert (gen->tone_slope.len == 0, "failed to set zero slope length; length is %d", gen->tone_slope.len); cw_gen_delete_internal(&gen); } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /* Test some assertions about CW_TONE_SLOPE_SHAPE_* Code in this file depends on the fact that these values are different than -1. I think that ensuring that they are in general small, non-negative values is a good idea. I'm testing these values to be sure that when I get a silly idea to modify them, the test will catch this modification. */ unsigned int test_cw_gen_tone_slope_shape_enums(void) { int p = fprintf(stdout, "libcw/gen: CW_TONE_SLOPE_SHAPE_*:"); cw_assert (CW_TONE_SLOPE_SHAPE_LINEAR >= 0, "CW_TONE_SLOPE_SHAPE_LINEAR is negative: %d", CW_TONE_SLOPE_SHAPE_LINEAR); cw_assert (CW_TONE_SLOPE_SHAPE_RAISED_COSINE >= 0, "CW_TONE_SLOPE_SHAPE_RAISED_COSINE is negative: %d", CW_TONE_SLOPE_SHAPE_RAISED_COSINE); cw_assert (CW_TONE_SLOPE_SHAPE_SINE >= 0, "CW_TONE_SLOPE_SHAPE_SINE is negative: %d", CW_TONE_SLOPE_SHAPE_SINE); cw_assert (CW_TONE_SLOPE_SHAPE_RECTANGULAR >= 0, "CW_TONE_SLOPE_SHAPE_RECTANGULAR is negative: %d", CW_TONE_SLOPE_SHAPE_RECTANGULAR); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /* Version of test_cw_gen_forever() to be used in libcw_test_internal test executable. It's not a test of a "forever" function, but of "forever" functionality. */ unsigned int test_cw_gen_forever_internal(void) { int seconds = 2; int p = fprintf(stdout, "libcw/gen: forever tone (%d seconds):", seconds); fflush(stdout); unsigned int rv = test_cw_gen_forever_sub(2, CW_AUDIO_NULL, (const char *) NULL); cw_assert (rv == 0, "\"forever\" test failed"); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } unsigned int test_cw_gen_forever_sub(int seconds, int audio_system, const char *audio_device) { cw_gen_t *gen = cw_gen_new_internal(audio_system, audio_device); cw_assert (gen, "ERROR: failed to create generator\n"); cw_gen_start_internal(gen); sleep(1); cw_tone_t tone; /* Just some acceptable values. */ int len = 100; /* [us] */ int freq = 500; CW_TONE_INIT(&tone, freq, len, CW_SLOPE_MODE_RISING_SLOPE); cw_tq_enqueue_internal(gen->tq, &tone); CW_TONE_INIT(&tone, freq, gen->quantum_len, CW_SLOPE_MODE_NO_SLOPES); tone.forever = true; int rv = cw_tq_enqueue_internal(gen->tq, &tone); #ifdef __FreeBSD__ /* Tested on FreeBSD 10. */ /* Separate path for FreeBSD because for some reason signals badly interfere with value returned through second arg to nanolseep(). Try to run the section in #else under FreeBSD to see what happens - value returned by nanosleep() through "rem" will be increasing. */ fprintf(stderr, "enter any character to end \"forever\" tone\n"); char c; scanf("%c", &c); #else struct timespec t; cw_usecs_to_timespec_internal(&t, seconds * CW_USECS_PER_SEC); cw_nanosleep_internal(&t); #endif CW_TONE_INIT(&tone, freq, len, CW_SLOPE_MODE_FALLING_SLOPE); rv = cw_tq_enqueue_internal(gen->tq, &tone); cw_assert (rv, "failed to enqueue last tone"); cw_gen_delete_internal(&gen); return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libcw_console.c0000644000175000017500000002331512501056151017534 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_console.c \brief Console buzzer audio sink. */ #include "config.h" #ifdef LIBCW_WITH_CONSOLE #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_SYS_KD_H) # include #elif defined(HAVE_SYS_VTKD_H) # include #elif defined(HAVE_SYS_KBIO_H) # include #endif #if (defined(__unix__) || defined(unix)) && !defined(USG) # include #endif #ifdef __FreeBSD__ #include #include #include #endif #include "libcw_console.h" #include "libcw_debug.h" #include "libcw_utils.h" #include "libcw_gen.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* Clock tick rate used for KIOCSOUND console ioctls. This value is taken from linux/include/asm-i386/timex.h, included here for portability. */ static const int KIOCSOUND_CLOCK_TICK_RATE = 1193180; static void cw_console_close_device_internal(cw_gen_t *gen); static int cw_console_open_device_internal(cw_gen_t *gen); static int cw_console_write_low_level_internal(cw_gen_t *gen, bool state); /** \brief Check if it is possible to open console output Function does a test opening and test writing to console device, but it closes it before returning. The function tests that the given console file exists, and that it will accept the KIOCSOUND ioctl. It unconditionally returns false on platforms that do no support the KIOCSOUND ioctl. Call to ioctl will fail if calling code doesn't have root privileges. This is the only place where we ask if KIOCSOUND is defined, so client code must call this function whenever it wants to use console output, as every other function called to perform console operations will happily assume that it is allowed to perform such operations. \param device - name of console device to be used; if NULL then library will use default device. \return true if opening console output succeeded; \return false if opening console output failed; */ bool cw_is_console_possible(const char *device) { /* no need to allocate space for device path, just a pointer (to a memory allocated somewhere else by someone else) will be sufficient in local scope */ const char *dev = device ? device : CW_DEFAULT_CONSOLE_DEVICE; int fd = open(dev, O_WRONLY); if (fd == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_console: open(%s): %s", dev, strerror(errno)); return false; } int rv = ioctl(fd, KIOCSOUND, 0); close(fd); if (rv == -1) { /* console device can be opened, even with WRONLY perms, but, if you aren't root user, you can't call ioctl()s on it, and - as a result - can't generate sound on the device */ return false; } else { return true; } } /** \brief Open console PC speaker device associated with given generator The function doesn't check if ioctl(fd, KIOCSOUND, ...) works, the client code must use cw_is_console_possible() instead, prior to calling this function. You must use cw_gen_set_audio_device_internal() before calling this function. Otherwise generator \p gen won't know which device to open. \param gen - current generator \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_console_open_device_internal(cw_gen_t *gen) { assert (gen->audio_device); if (gen->audio_device_is_open) { /* Ignore the call if the console device is already open. */ return CW_SUCCESS; } int console = open(gen->audio_device, O_WRONLY); if (console == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_console: open(%s): \"%s\"", gen->audio_device, strerror(errno)); return CW_FAILURE; } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "libcw_console: open successfully, console = %d", console); } /* It doesn't have any sense for console, but some code may depend on non-zero value of sample rate. */ gen->sample_rate = 44100; gen->audio_sink = console; gen->audio_device_is_open = true; return CW_SUCCESS; } void cw_console_silence(cw_gen_t *gen) { ioctl(gen->audio_sink, KIOCSOUND, 0); return; } /** \brief Close console device associated with current generator */ void cw_console_close_device_internal(cw_gen_t *gen) { close(gen->audio_sink); gen->audio_sink = -1; gen->audio_device_is_open = false; cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "libcw_console: console closed"); return; } /** \brief Pseudo-device for playing sound with console Function behaving like a device, to which one does a blocking write. It generates sound with parameters (frequency and duration) specified in \p tone.. After playing X microseconds of tone it returns. It is intended to behave like a blocking write() function. \param gen - current generator \param tone - tone to play with generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_console_write(cw_gen_t *gen, cw_tone_t *tone) { assert (gen); assert (gen->audio_system == CW_AUDIO_CONSOLE); assert (tone->len >= 0); /* TODO: shouldn't the condition be "tone->len > 0"? */ struct timespec n = { .tv_sec = 0, .tv_nsec = 0 }; cw_usecs_to_timespec_internal(&n, tone->len); int rv = cw_console_write_low_level_internal(gen, (bool) tone->frequency); cw_nanosleep_internal(&n); if (tone->slope_mode == CW_SLOPE_MODE_FALLING_SLOPE) { /* Falling slope causes the console to produce sound, so at the end of the slope - the console is left in "generate" state. We have to explicitly stop generating sound at the end of falling slope. */ rv &= cw_console_write_low_level_internal(gen, false); } else if (tone->slope_mode == CW_SLOPE_MODE_STANDARD_SLOPES) { /* It seems that it's a good idea to turn off the buzzer after playing standard tone. In theory the buzzer would be turned off by "silence" tone coming right after an after audible tone, but in practice it may not be always so.*/ rv &= cw_console_write_low_level_internal(gen, false); } else { ; } return rv; } /** \brief Start generating a sound using console PC speaker The function calls the KIOCSOUND ioctl to start a particular tone. Once started, the console tone generation needs no maintenance. The function only initializes generation, you have to do another function call to change the tone generated. \param gen - current generator \param state - flag deciding if a sound should be generated (> 0) or not (== 0) \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_console_write_low_level_internal(cw_gen_t *gen, bool state) { static bool local_state = false; if (local_state == state) { return CW_SUCCESS; } else { local_state = state; } /* TODO: take a look at KDMKTONE ioctl argument. */ /* Calculate the correct argument for KIOCSOUND. There's nothing we can do to control the volume, but if we find the volume is set to zero, the one thing we can do is to just turn off tones. A bit crude, but perhaps just slightly better than doing nothing. */ int argument = 0; if (gen->volume_percent > 0 && local_state) { argument = KIOCSOUND_CLOCK_TICK_RATE / gen->frequency; } cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "libcw_console: KIOCSOUND arg = %d (switch: %d, frequency: %d Hz, volume: %d %%)", argument, local_state, gen->frequency, gen->volume_percent); if (ioctl(gen->audio_sink, KIOCSOUND, argument) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw_console: ioctl KIOCSOUND: \"%s\"", strerror(errno)); return CW_FAILURE; } else { return CW_SUCCESS; } } int cw_console_configure(cw_gen_t *gen, const char *device) { assert (gen); gen->audio_system = CW_AUDIO_CONSOLE; cw_gen_set_audio_device_internal(gen, device); gen->open_device = cw_console_open_device_internal; gen->close_device = cw_console_close_device_internal; // gen->write = cw_console_write; // The function is called in libcw.c directly/explicitly, not through a pointer. */ return CW_SUCCESS; } #else /* #ifdef LIBCW_WITH_CONSOLE */ #include "libcw_console.h" bool cw_is_console_possible(__attribute__((unused)) const char *device) { return false; } int cw_console_configure(__attribute__((unused)) cw_gen_t *gen, __attribute__((unused)) const char *device) { return CW_FAILURE; } int cw_console_write(__attribute__((unused)) cw_gen_t *gen, __attribute__((unused)) cw_tone_t *tone) { return CW_FAILURE; } void cw_console_silence(__attribute__((unused)) cw_gen_t *gen) { return; } #endif /* #ifdef LIBCW_WITH_CONSOLE */ unixcw-3.4.2/src/libcw/libfuncs.awk0000644000175000017500000000520112451007016017051 0ustar acerionacerion#!/bin/awk -f # # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # # AWK script to produce function documentation strings from processed # C source. Pass output of libdoc.awk script to input of this script. # # Initialize states and tags BEGIN { IDLE = 0 TYPE = 1 SPECIFICATION = 2 DOCUMENTATION = 3 state = IDLE FUNCTION_TAG = "F" DOCUMENTATION_TAG = "D" END_TAG = "E" # For handling a series of Doxygen's "\li" tags in_list = 0 } # Handle each line containing function specification $1 == FUNCTION_TAG { sub(FUNCTION_TAG, "") sub(/^ */, "") gsub(/\t/, " ") if (state != SPECIFICATION) { # first line of specification; # print empty line before printing (possibly # multi-line) specification print("\n.sp\n"); } printf(".br\n.B \"%s\"\n", $0) if ($0 ~ /\)$/) { # newline line after last line of (possibly multi-line) # specification # printf(".sp\n", $0) } state = SPECIFICATION next } # Handle all documentation lines $1 == DOCUMENTATION_TAG { if (state == SPECIFICATION) { state = DOCUMENTATION # line break between function prototype and # function documentation print(".br"); } sub(DOCUMENTATION_TAG, "") sub(/^ +/, "") # line break for printing consecutive 'Returns: ' and 'Parameter: ' # in separate lines if ($0 ~ /^Returns:/ || $0 ~ /^Parameter:/) { print(".br") } # "\li" list item from Doxygen documentation. if ($0 ~ /^\\li /) { if (in_list == 0) { in_list = 1 # Opening indentation mark for a list. print(".RS") } print(".IP \\[bu]") print(substr($0, 4)) } else { print $0 } if ($0 == "") { # It is assumed that last item on a list is followed # with empty line. if (in_list == 1) { in_list = 0 # Closing indentation mark for a list. print(".RE") } } next } # On end of a function specification, reset state $1 == END_TAG { state = IDLE next } unixcw-3.4.2/src/libcw/libcw_test_simple_gen.c0000644000175000017500000001011412472604063021254 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ #include "config.h" #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include #include #include /* sleep() */ #include "libcw.h" #include "libcw_test.h" #include "libcw_debug.h" #include "libcw_data.h" #include "libcw_tq.h" #include "libcw_null.h" #include "libcw_console.h" #include "libcw_oss.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; typedef bool (*predicate_t)(const char *device); static void main_helper(int audio_system, const char *name, const char *device, predicate_t predicate); int main(int argc, char *const argv[]) { #define CW_SYSTEMS_MAX 5 char sound_systems[CW_SYSTEMS_MAX + 1]; /* TODO: modules aren't necessary here. Make cw_test_args() accept modules==NULL. */ #define CW_MODULES_MAX 5 char modules[CW_MODULES_MAX + 1]; if (!cw_test_args(argc, argv, sound_systems, CW_SYSTEMS_MAX, modules, CW_MODULES_MAX)) { cw_test_print_help(argv[0]); exit(EXIT_FAILURE); } if (strstr(sound_systems, "n")) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with null output\n"); main_helper(CW_AUDIO_NULL, "Null", CW_DEFAULT_NULL_DEVICE, cw_is_null_possible); } if (strstr(sound_systems, "c")) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with console output\n"); main_helper(CW_AUDIO_CONSOLE, "console", CW_DEFAULT_CONSOLE_DEVICE, cw_is_console_possible); } if (strstr(sound_systems, "o")) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with OSS output\n"); main_helper(CW_AUDIO_OSS, "OSS", CW_DEFAULT_OSS_DEVICE, cw_is_oss_possible); } if (strstr(sound_systems, "a")) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with ALSA output\n"); main_helper(CW_AUDIO_ALSA, "ALSA", CW_DEFAULT_ALSA_DEVICE, cw_is_alsa_possible); } if (strstr(sound_systems, "p")) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with PulseAudio output\n"); main_helper(CW_AUDIO_PA, "PulseAudio", CW_DEFAULT_PA_DEVICE, cw_is_pa_possible); } sleep(2); return 0; } void main_helper(int audio_system, const char *name, const char *device, predicate_t predicate) { int rv = CW_FAILURE; rv = predicate(device); if (rv == CW_SUCCESS) { rv = cw_generator_new(audio_system, device); if (rv == CW_SUCCESS) { cw_reset_send_receive_parameters(); cw_set_send_speed(12); cw_generator_start(); //cw_send_string("abcdefghijklmnopqrstuvwyz0123456789"); cw_send_string("eish "); cw_wait_for_tone_queue(); cw_send_string("two"); cw_wait_for_tone_queue(); cw_send_string("three"); cw_wait_for_tone_queue(); cw_wait_for_tone_queue(); cw_generator_stop(); cw_generator_delete(); } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_GENERATOR, CW_DEBUG_ERROR, "libcw: can't create %s generator", name); } } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "libcw: %s output is not available", name); } } unixcw-3.4.2/src/libcw/libcw_rec.h0000644000175000017500000002357512476700440016670 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_REC #define H_LIBCW_REC #include #include /* struct timeval */ #include "libcw.h" /* Dot length magic number. From PARIS calibration, 1 dot length [us] = 1200000 / speed [wpm]. This variable is used in generator code as well. */ enum { CW_DOT_CALIBRATION = 1200000 }; /* "RS" stands for "Receiver State" */ enum { RS_IDLE, /* Representation buffer is empty and ready to accept data. */ RS_MARK, /* Mark. */ RS_SPACE, /* Space (inter-mark-space). */ RS_EOC_GAP, /* Gap after a character, without error (EOC = end-of-character). */ RS_EOW_GAP, /* Gap after a word, without error (EOW = end-of-word). */ RS_EOC_GAP_ERR, /* Gap after a character, with error. */ RS_EOW_GAP_ERR /* Gap after a word, with error. */ }; /* Does receiver initially adapt to varying speed of input data? */ enum { CW_REC_ADAPTIVE_MODE_INITIAL = false }; /* TODO: it would be interesting to track (in debug mode) relationship between "speed threshold" and "noise threshold" parameters. */ enum { CW_REC_SPEED_THRESHOLD_INITIAL = (CW_DOT_CALIBRATION / CW_SPEED_INITIAL) * 2 }; /* Initial adaptive speed threshold. [us] */ enum { CW_REC_NOISE_THRESHOLD_INITIAL = (CW_DOT_CALIBRATION / CW_SPEED_MAX) / 2 }; /* Initial noise filter threshold. */ /* Receiver contains a fixed-length buffer for representation of received data. Capacity of the buffer is vastly longer than any practical representation. Don't know why, a legacy thing. Representation can be presented as a char string. This is the maximal length of the string. This value does not include string's ending NULL. */ enum { CW_REC_REPRESENTATION_CAPACITY = 256 }; /* TODO: what is the relationship between this constant and CW_REC_REPRESENTATION_CAPACITY? Both have value of 256. Coincidence? I don't think so. */ enum { CW_REC_STATISTICS_CAPACITY = 256 }; /* Length of array used to calculate average length of a mark. Average length of a mark is used in adaptive receiving mode to track speed of incoming Morse data. */ enum { CW_REC_AVERAGING_ARRAY_LENGTH = 4 }; /* Types of receiver's timing statistics. CW_REC_STAT_NONE must be zero so that the statistics buffer is initially empty. */ typedef enum { CW_REC_STAT_NONE = 0, CW_REC_STAT_DOT, /* Dot mark. */ CW_REC_STAT_DASH, /* Dash mark. */ CW_REC_STAT_IMARK_SPACE, /* Inter-mark space. */ CW_REC_STAT_ICHAR_SPACE /* Inter-character space. */ } stat_type_t; typedef struct { stat_type_t type; /* Record type */ int delta; /* Difference between actual and ideal length of mark or space. [us] */ } cw_rec_statistics_t; /* A moving averages structure - circular buffer. Used for calculating averaged length ([us]) of dots and dashes. */ typedef struct { int buffer[CW_REC_AVERAGING_ARRAY_LENGTH]; /* Buffered mark lengths. */ int cursor; /* Circular buffer cursor. */ int sum; /* Running sum of lengths of marks. [us] */ int average; /* Averaged length of a mark. [us] */ } cw_rec_averaging_t; struct cw_rec_struct { /* State of receiver state machine. */ int state; /* Essential parameters. */ /* Changing values of speed, tolerance, gap or is_adaptive_receive_mode will trigger a recalculation of low level timing parameters. */ /* 'speed' is float instead of being 'int' on purpose. It makes adaptation to varying speed of incoming data more smooth. This is especially important at low speeds, where change/adaptation from (int) 5wpm to (int) 4wpm would mean a sharp decrease by 20%. With 'float' data type the adjustment of receive speeds is more gradual. */ float speed; /* [wpm] */ int tolerance; int gap; /* Inter-character-gap, similar as in generator. */ bool is_adaptive_receive_mode; int noise_spike_threshold; /* Library variable which is automatically adjusted based on incoming Morse data stream, rather than being settable by the user. Not exactly a *speed* threshold, but for a lack of a better name... When the library changes internally value of this variable, it recalculates low level timing parameters too. */ int adaptive_speed_threshold; /* [microseconds]/[us] */ /* Retained timestamps of mark's begin and end. */ struct timeval mark_start; struct timeval mark_end; /* Buffer for received representation (dots/dashes). This is a fixed-length buffer, filled in as tone on/off timings are taken. The buffer is vastly longer than any practical representation. Along with it we maintain a cursor indicating the current write position. */ char representation[CW_REC_REPRESENTATION_CAPACITY + 1]; int representation_ind; /* Receiver's low-level timing parameters */ /* These are basic timing parameters which should be recalculated each time client code demands changing some higher-level parameter of receiver. How these values are calculated depends on receiving mode (fixed/adaptive). */ int dot_len_ideal; /* Length of an ideal dot. [microseconds]/[us] */ int dot_len_min; /* Minimal length of mark that will be identified as dot. [us] */ int dot_len_max; /* Maximal length of mark that will be identified as dot. [us] */ int dash_len_ideal; /* Length of an ideal dash. [us] */ int dash_len_min; /* Minimal length of mark that will be identified as dash. [us] */ int dash_len_max; /* Maximal length of mark that will be identified as dash. [us] */ int eom_len_ideal; /* Ideal end of mark, for stats. [us] */ int eom_len_min; /* Shortest end of mark allowable. [us] */ int eom_len_max; /* Longest end of mark allowable. [us] */ int eoc_len_ideal; /* Ideal end of char, for stats. [us] */ int eoc_len_min; /* Shortest end of char allowable. [us] */ int eoc_len_max; /* Longest end of char allowable. [us] */ /* These two fields have the same function as in cw_gen_t. They are needed in function re-synchronizing parameters. */ int additional_delay; /* More delay at the end of a char. [us] */ int adjustment_delay; /* More delay at the end of a word. [us] */ /* Are receiver's parameters in sync? After changing receiver's essential parameters, its low-level timing parameters need to be re-calculated. This is a flag that shows when this needs to be done. */ bool parameters_in_sync; /* Receiver statistics. A circular buffer of entries indicating the difference between the actual and the ideal length of received mark or space, tagged with the type of statistic held, and a circular buffer pointer. */ cw_rec_statistics_t statistics[CW_REC_STATISTICS_CAPACITY]; int statistics_ind; /* Data structures for calculating averaged length of dots and dashes. The averaged lengths are used for adaptive tracking of receiver's speed (tracking of speed of incoming data). */ cw_rec_averaging_t dot_averaging; cw_rec_averaging_t dash_averaging; }; typedef struct cw_rec_struct cw_rec_t; /* Creator and destructor. */ cw_rec_t *cw_rec_new_internal(void); void cw_rec_delete_internal(cw_rec_t **rec); /* Main receive functions. */ int cw_rec_mark_begin_internal(cw_rec_t *rec, const struct timeval *timestamp); int cw_rec_mark_end_internal(cw_rec_t *rec, const struct timeval *timestamp); int cw_rec_add_mark_internal(cw_rec_t *rec, const struct timeval *timestamp, char mark); /* Helper receive functions. */ int cw_rec_poll_representation_internal(cw_rec_t *rec, const struct timeval *timestamp, char *representation, bool *is_end_of_word, bool *is_error); int cw_rec_poll_character_internal(cw_rec_t *rec, const struct timeval *timestamp, char *c, bool *is_end_of_word, bool *is_error); void cw_rec_clear_buffer_internal(cw_rec_t *rec); /* Setters of receiver's essential parameters. */ int cw_rec_set_speed_internal(cw_rec_t *rec, int new_value); int cw_rec_set_tolerance_internal(cw_rec_t *rec, int new_value); int cw_rec_set_gap_internal(cw_rec_t *rec, int new_value); int cw_rec_set_noise_spike_threshold_internal(cw_rec_t *rec, int new_value); void cw_rec_set_adaptive_mode_internal(cw_rec_t *rec, bool adaptive); /* Getters of receiver's essential parameters. */ float cw_rec_get_speed_internal(cw_rec_t *rec); int cw_rec_get_tolerance_internal(cw_rec_t *rec); /* int cw_rec_get_gap_internal(cw_rec_t *rec); */ int cw_rec_get_noise_spike_threshold_internal(cw_rec_t *rec); bool cw_rec_get_adaptive_mode_internal(cw_rec_t *rec); /* Receiver's reset functions. */ void cw_rec_reset_receive_parameters_internal(cw_rec_t *rec); void cw_rec_reset_receive_statistics_internal(cw_rec_t *rec); void cw_rec_reset_internal(cw_rec_t *rec); /* Other helper functions. */ void cw_rec_sync_parameters_internal(cw_rec_t *rec); void cw_rec_get_parameters_internal(cw_rec_t *rec, int *dot_len_ideal, int *dash_len_ideal, int *dot_len_min, int *dot_len_max, int *dash_len_min, int *dash_len_max, int *eom_len_min, int *eom_len_max, int *eom_len_ideal, int *eoc_len_min, int *eoc_len_max, int *eoc_len_ideal, int *adaptive_threshold); void cw_rec_get_statistics_internal(cw_rec_t *rec, double *dot_sd, double *dash_sd, double *element_end_sd, double *character_end_sd); int cw_rec_get_buffer_length_internal(cw_rec_t *rec); int cw_rec_get_receive_buffer_capacity_internal(void); #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_rec_identify_mark_internal(void); unsigned int test_cw_rec_with_base_data_fixed(void); unsigned int test_cw_rec_with_random_data_fixed(void); unsigned int test_cw_rec_with_random_data_adaptive(void); unsigned int test_cw_get_receive_parameters(void); #endif /* #ifdef LIBCW_UNIT_TESTS */ #endif /* #ifndef H_LIBCW_REC */ unixcw-3.4.2/src/libcw/libcw.pc.in0000644000175000017500000000030212536367444016610 0ustar acerionacerionprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libcw Description: CW (Morse code) library Version: 6.4.1 Libs: -L${libdir} -lcw Cflags: -I${includedir} unixcw-3.4.2/src/libcw/cw.70000644000175000017500000001242512451007431015250 0ustar acerionacerion.\" .\" UnixCW CW Tutor Package - cw .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH CW 7 "CW Tutor Package" \" -*- nroff -*- .SH NAME .\" CW \- the international Morse code .\" .\" .\" .SH DESCRIPTION .\" CW is an abbreviation for "continuous wave", the commonly used technical term for Morse code communication. A basic knowledge or understanding of Morse code is a requirement for Radio Amateurs and Marine Radio Operators in many parts of the world. .PP .\" .\" .\" .SS MORSE CODE TIMINGS .\" In Morse code, a dot or dash is referred to as an element. The basic timing unit is the dot period. This is the time taken to send a dot, not including any space before or after the dot. The lengths of all other elements are then derived from this basic unit, using the following rules: .IP The duration of a dash is three dots. .IP The time between each element (dot or dash) is one dot length. .IP The space between characters is three dot lengths. .IP The space between words is seven dot lengths. .PP The following formula calculates the dot period in microseconds from the Morse code speed in words per minute: .IP .nf dot period = ( 1200000 / speed ) .fi .PP This formula arises from the use of the word PARIS as a 'standard' word for calibrating Morse code speed. PARIS is 50 units long when sent in Morse code. Analysis of English plain-text indicates that the average word is 50 units, including spaces. .PP .\" .\" .\" .SS MORSE CODE CHARACTERS .\" The following list shows the IS0 8859-1 (Latin-1) characters that have commonly understood representations in Morse code: .IP .\" \[u0022] = ", otherwise emacs syntax highlighting is messed up; ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\[u0022]$()+\-./:;=?_@ and space .PP In addition, following ISO 8859-1 and ISO 8859-2 accented characters are also part of the generally accepted international Morse code: .IP .\" ÜÄÇÖÉČŔŃŞŽ \[:U]\[:A]\[,C]\[:O]\['E]\[`E]\[`A]\[~N]\[S u0327] (S with cedilla), \[Z u030C] (Z with caron/hacek), .PP Finally, \fBlibcw\fP adds the following ASCII characters as extensions to single character procedural signals: .IP <>!&^~ .PP .\" .\" .\" .SS MORSE CODE CHARACTER TABLES .\" The following table shows the Morse code equivalents for the ISO 8859-1, accented ISO 8859-1, and accented ISO 8859-2 characters above. The ASCII portion of this table is taken from the \fIARRL Handbook\fP, and the accented extensions from various other sources: .\" .TS l l l l _ _ _ _ l l l l . Ch Code Ch Code A .- B -... C -.-. D -.. E . F ..-. G --. H .... I .. J .--- K -.- L .-.. M -- N -. O --- P .--. Q --.- R .-. S ... T - U ..- V ...- W .-- X -..- Y -.-- Z --.. .BR 0 ----- 1 .---- 2 ..--- 3 ...-- 4 ....- 5 ..... 6 -.... 7 --... 8 ---.. 9 ----. .BR .\" \[u0022] = ", otherwise emacs syntax highlighting is messed up; \[u0022] .-..-. ' .----. $ ...-..- ( -.--. ) -.--.- + .-.-. , --..-- - -....- .\" "\[char46]" is a dot \[char46] .-.-.- / -..-. : ---... ; -.-.-. \(eq -...- ? ..--.. \(ul ..--.- .TE .TS l l l l _ _ _ _ l l l l . Ch Code Ch Code \[:U] ..-- \[:A] .-.- \[,C] -.-.. \[:O] ---. \['E] ..-.. \[`A] .-..- \[`A] .--.- \[~N] --.-- \[S u0327] (S+cedilla) ---- \[vZ] (Z+caron/hacek) --..- .TE .PP In addition to the above standard characters, the following characters are conventionally used for punctuation and procedural signals as follows: .\" .TS l l l l _ _ _ _ l l l l. Ch Code Ch Code .\" \[u0022] = " \[u0022] .-..-. ' .----. $ ...-..- ( -.--. ) -.--.- + .-.-. , --..-- - -....- .\" "\[char46]" is a dot \[char46] .-.-.- / -..-. : ---... ; -.-.-. \(eq -...- ? ..--.. \(ul ..--.- @ .--.-. .TE .PP and the following are non-conventional extensions implemented by \fBlibcw\fP: .\" .TS l l l l _ _ _ _ l l l l. Ch Code Ch Code < ...-.- > -...-.- ! ...-. & .-... ^ -.-.- ~ .-.-.. .TE .PP An alternative view of punctuation and procedural signals is as combination Morse characters: .\" .TS l l l l _ _ _ _ l l l l. Ch Prosig Ch Prosig .\" \[u0022] = " \[u0022] [AF] ' [WG] $ [SX] ( [KN] ) [KK] + [AR] , [MIM] - [DU] .\" "\[char46]" is a dot \[char46] [AAA] / [DN] : [OS] ; [KR] \(eq [BT] ? [IMI] \(ul [IQ] @ [AC] < [VA],[SK] > [BK] ! [SN] & [AS] ^ [KA] ~ [AL] .TE .PP .\" .\" .\" .SH NOTES .\" Despite the fact that this manual page constantly and consistently refers to Morse code elements as dots and dashes, DO NOT think in these terms when trying to learn Morse code. Always think of them as 'dit's and 'dah's. .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBlibcw\fP(3,LOCAL), \fBcw\fP(1,LOCAL), \fBcwgen\fP(1,LOCAL), \fBcwcp\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/libcw/libcw_test_public.c0000644000175000017500000014326612500140346020416 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #define _XOPEN_SOURCE 600 /* signaction() + SA_RESTART */ #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "libcw_test.h" #include "libcw_debug.h" #include "libcw_tq.h" #include "libcw_utils.h" #include "libcw_gen.h" #ifdef LIBCW_UNIT_TESTS typedef struct { int successes; int failures; } cw_test_stats_t; static cw_test_stats_t cw_stats_indep = { .successes = 0, .failures = 0 }; static cw_test_stats_t cw_stats_null = { .successes = 0, .failures = 0 }; static cw_test_stats_t cw_stats_console = { .successes = 0, .failures = 0 }; static cw_test_stats_t cw_stats_oss = { .successes = 0, .failures = 0 }; static cw_test_stats_t cw_stats_alsa = { .successes = 0, .failures = 0 }; static cw_test_stats_t cw_stats_pa = { .successes = 0, .failures = 0 }; static void cw_test_setup(void); static int cw_test_dependent(const char *audio_systems, const char *modules); static int cw_test_dependent_with(int audio_system, const char *modules, cw_test_stats_t *stats); static void cw_test_print_stats(void); static void cw_test_helper_tq_callback(void *data); /* This variable will be used in "forever" test. This test function needs to open generator itself, so it needs to know the current audio system to be used. _NONE is just an initial value, to be changed in test setup. */ static int test_audio_system = CW_AUDIO_NONE; /* Tone queue module. */ static void test_tone_queue_1(cw_test_stats_t *stats); static void test_tone_queue_2(cw_test_stats_t *stats); static void test_tone_queue_3(cw_test_stats_t *stats); static void test_tone_queue_callback(cw_test_stats_t *stats); /* Generator module. */ static void test_volume_functions(cw_test_stats_t *stats); static void test_send_primitives(cw_test_stats_t *stats); static void test_send_character_and_string(cw_test_stats_t *stats); static void test_representations(cw_test_stats_t *stats); /* Morse key module. */ static void test_keyer(cw_test_stats_t *stats); static void test_straight_key(cw_test_stats_t *stats); /* Other functions. */ static void test_parameter_ranges(cw_test_stats_t *stats); static void test_cw_gen_forever_public(cw_test_stats_t *stats); // static void cw_test_delayed_release(cw_test_stats_t *stats); /*---------------------------------------------------------------------*/ /* Unit tests */ /*---------------------------------------------------------------------*/ /** Notice that getters of parameter limits are tested in test_cw_get_x_limits() tests::cw_set_send_speed() tests::cw_get_send_speed() tests::cw_set_receive_speed() tests::cw_get_receive_speed() tests::cw_set_frequency() tests::cw_get_frequency() tests::cw_set_volume() tests::cw_get_volume() tests::cw_set_gap() tests::cw_get_gap() tests::cw_set_tolerance() tests::cw_get_tolerance() tests::cw_set_weighting() tests::cw_get_weighting() */ void test_parameter_ranges(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); int txdot_usecs, txdash_usecs, end_of_element_usecs, end_of_character_usecs, end_of_word_usecs, additional_usecs, adjustment_usecs; /* Print default low level timing values. */ cw_reset_send_receive_parameters(); cw_get_send_parameters(&txdot_usecs, &txdash_usecs, &end_of_element_usecs, &end_of_character_usecs, &end_of_word_usecs, &additional_usecs, &adjustment_usecs); printf("libcw: cw_get_send_parameters():\n" "libcw: %d, %d, %d, %d, %d, %d, %d\n", txdot_usecs, txdash_usecs, end_of_element_usecs, end_of_character_usecs,end_of_word_usecs, additional_usecs, adjustment_usecs); /* Test setting and getting of some basic parameters. */ struct { /* There are tree functions that take part in the test: first gets range of acceptable values, seconds sets a new value of parameter, and third reads back the value. */ void (* get_limits)(int *min, int *max); int (* set_new_value)(int new_value); int (* get_value)(void); int min; /* Minimal acceptable value of parameter. */ int max; /* Maximal acceptable value of parameter. */ const char *name; } test_data[] = { { cw_get_speed_limits, cw_set_send_speed, cw_get_send_speed, 10000, -10000, "send_speed" }, { cw_get_speed_limits, cw_set_receive_speed, cw_get_receive_speed, 10000, -10000, "receive_speed" }, { cw_get_frequency_limits, cw_set_frequency, cw_get_frequency, 10000, -10000, "frequency" }, { cw_get_volume_limits, cw_set_volume, cw_get_volume, 10000, -10000, "volume" }, { cw_get_gap_limits, cw_set_gap, cw_get_gap, 10000, -10000, "gap" }, { cw_get_tolerance_limits, cw_set_tolerance, cw_get_tolerance, 10000, -10000, "tolerance" }, { cw_get_weighting_limits, cw_set_weighting, cw_get_weighting, 10000, -10000, "weighting" }, { NULL, NULL, NULL, 0, 0, NULL } }; for (int i = 0; test_data[i].get_limits; i++) { int status; bool failure; /* Get limits of values to be tested. */ /* Notice that getters of parameter limits are tested in test_cw_get_x_limits(). */ test_data[i].get_limits(&test_data[i].min, &test_data[i].max); /* Test out-of-range value lower than minimum. */ errno = 0; status = test_data[i].set_new_value(test_data[i].min - 1); failure = status || errno != EINVAL; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_set_%s(min - 1):", test_data[i].name); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Test out-of-range value higher than maximum. */ errno = 0; status = test_data[i].set_new_value(test_data[i].max + 1); failure = status || errno != EINVAL; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_set_%s(max + 1):", test_data[i].name); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Test in-range values. */ failure = false; for (int j = test_data[i].min; j <= test_data[i].max; j++) { test_data[i].set_new_value(j); if (test_data[i].get_value() != j) { failure = true; break; } } failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get/set_%s():", test_data[i].name); CW_TEST_PRINT_TEST_RESULT (failure, n); failure = false; } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** \brief Simple tests of queueing and dequeueing of tones Ensure we can generate a few simple tones, and wait for them to end. tests::cw_queue_tone() tests::cw_get_tone_queue_length() tests::cw_wait_for_tone() tests::cw_wait_for_tone_queue() */ void test_tone_queue_1(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); int l = 0; /* Measured length of tone queue. */ int expected = 0; /* Expected length of tone queue. */ int cw_min, cw_max; cw_set_volume(70); cw_get_frequency_limits(&cw_min, &cw_max); int N = 6; /* Number of test tones put in queue. */ int duration = 100000; /* Duration of tone. */ int delta_f = ((cw_max - cw_min) / (N - 1)); /* Delta of frequency in loops. */ /* Test 1: enqueue N tones, and wait for each of them separately. Control length of tone queue in the process. */ /* Enqueue first tone. Don't check queue length yet. The first tone is being dequeued right after enqueueing, so checking the queue length would yield incorrect result. Instead, enqueue the first tone, and during the process of dequeueing it, enqueue rest of the tones in the loop, together with checking length of the tone queue. */ int f = cw_min; bool failure = !cw_queue_tone(duration, f); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_queue_tone():"); CW_TEST_PRINT_TEST_RESULT (failure, n); /* This is to make sure that rest of tones is enqueued when the first tone is being dequeued. */ usleep(duration / 4); /* Enqueue rest of N tones. It is now safe to check length of tone queue before and after queueing each tone: length of the tone queue should increase (there won't be any decrease due to dequeueing of first tone). */ printf("libcw: enqueueing (1): \n"); for (int i = 1; i < N; i++) { /* Monitor length of a queue as it is filled - before adding a new tone. */ l = cw_get_tone_queue_length(); expected = (i - 1); failure = l != expected; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length(): pre:"); // n = printf("libcw: cw_get_tone_queue_length(): pre-queue: expected %d != result %d:", expected, l); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Add a tone to queue. All frequencies should be within allowed range, so there should be no error. */ f = cw_min + i * delta_f; failure = !cw_queue_tone(duration, f); failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_queue_tone():"); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Monitor length of a queue as it is filled - after adding a new tone. */ l = cw_get_tone_queue_length(); expected = (i - 1) + 1; failure = l != expected; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length(): post:"); // n = printf("libcw: cw_get_tone_queue_length(): post-queue: expected %d != result %d:", expected, l); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Above we have queued N tones. libcw starts dequeueing first of them before the last one is enqueued. This is why below we should only check for N-1 of them. Additionally, let's wait a moment till dequeueing of the first tone is without a question in progress. */ usleep(duration / 4); /* And this is the proper test - waiting for dequeueing tones. */ printf("libcw: dequeueing (1):\n"); for (int i = 1; i < N; i++) { /* Monitor length of a queue as it is emptied - before dequeueing. */ l = cw_get_tone_queue_length(); expected = N - i; //printf("libcw: cw_get_tone_queue_length(): pre: l = %d\n", l); failure = l != expected; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length(): pre:"); // n = printf("libcw: cw_get_tone_queue_length(): pre-dequeue: expected %d != result %d: failure\n", expected, l); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Wait for each of N tones to be dequeued. */ failure = !cw_wait_for_tone(); failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_tone():"); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Monitor length of a queue as it is emptied - after dequeueing. */ l = cw_get_tone_queue_length(); expected = N - i - 1; //printf("libcw: cw_get_tone_queue_length(): post: l = %d\n", l); failure = l != expected; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length(): post:"); // n = printf("libcw: cw_get_tone_queue_length(): post-dequeue: expected %d != result %d: failure\n", expected, l); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test 2: fill a queue, but this time don't wait for each tone separately, but wait for a whole queue to become empty. */ failure = false; printf("libcw: enqueueing (2):\n"); f = 0; for (int i = 0; i < N; i++) { f = cw_min + i * delta_f; if (!cw_queue_tone(duration, f)) { failure = true; break; } } failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_queue_tone(%08d, %04d):", duration, f); CW_TEST_PRINT_TEST_RESULT (failure, n); printf("libcw: dequeueing (2):\n"); failure = !cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_tone_queue():"); CW_TEST_PRINT_TEST_RESULT (failure, n); CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** Run the complete range of tone generation, at 100Hz intervals, first up the octaves, and then down. If the queue fills, though it shouldn't with this amount of data, then pause until it isn't so full. tests::cw_wait_for_tone() tests::cw_queue_tone() tests::cw_wait_for_tone_queue() */ void test_tone_queue_2(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); cw_set_volume(70); int duration = 40000; int cw_min, cw_max; cw_get_frequency_limits(&cw_min, &cw_max); bool wait_failure = false; bool queue_failure = false; for (int i = cw_min; i < cw_max; i += 100) { while (cw_is_tone_queue_full()) { if (!cw_wait_for_tone()) { wait_failure = true; break; } } if (!cw_queue_tone(duration, i)) { queue_failure = true; break; } } for (int i = cw_max; i > cw_min; i -= 100) { while (cw_is_tone_queue_full()) { if (!cw_wait_for_tone()) { wait_failure = true; break; } } if (!cw_queue_tone(duration, i)) { queue_failure = true; break; } } queue_failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_queue_tone():"); CW_TEST_PRINT_TEST_RESULT (queue_failure, n); wait_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_tone():"); CW_TEST_PRINT_TEST_RESULT (wait_failure, n); bool wait_tq_failure = !cw_wait_for_tone_queue(); wait_tq_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_tone_queue():"); CW_TEST_PRINT_TEST_RESULT (wait_tq_failure, n); cw_queue_tone(0, 0); cw_wait_for_tone_queue(); CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** Test the tone queue manipulations, ensuring that we can fill the queue, that it looks full when it is, and that we can flush it all again afterwards, and recover. tests::cw_get_tone_queue_capacity() tests::cw_get_tone_queue_length() tests::cw_queue_tone() tests::cw_wait_for_tone_queue() */ void test_tone_queue_3(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); /* Small setup. */ cw_set_volume(70); /* Test: properties (capacity and length) of empty tq. */ { fprintf(stderr, "libcw: -- initial test on empty tq:\n"); /* Empty tone queue and make sure that it is really empty (wait for info from libcw). */ cw_flush_tone_queue(); cw_wait_for_tone_queue(); int capacity = cw_get_tone_queue_capacity(); bool failure = capacity != CW_TONE_QUEUE_CAPACITY_MAX; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_get_tone_queue_capacity(): %d %s %d:", capacity, failure ? "!=" : "==", CW_TONE_QUEUE_CAPACITY_MAX); CW_TEST_PRINT_TEST_RESULT (failure, n); int len_empty = cw_get_tone_queue_length(); failure = len_empty > 0; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length() when tq empty: %d %s 0:", len_empty, failure ? "!=" : "=="); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: properties (capacity and length) of full tq. */ /* FIXME: we call cw_queue_tone() until tq is full, and then expect the tq to be full while we perform tests. Doesn't the tq start dequeuing tones right away? Can we expect the tq to be full for some time after adding last tone? Hint: check when a length of tq is decreased. Probably after playing first tone on tq, which - in this test - is pretty long. Or perhaps not. */ { fprintf(stderr, "libcw: -- test on full tq:\n"); int i = 0; /* FIXME: cw_is_tone_queue_full() is not tested */ while (!cw_is_tone_queue_full()) { cw_queue_tone(1000000, 100 + (i++ & 1) * 100); } int capacity = cw_get_tone_queue_capacity(); bool failure = capacity != CW_TONE_QUEUE_CAPACITY_MAX; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_get_tone_queue_capacity(): %d %s %d:", capacity, failure ? "!=" : "==", CW_TONE_QUEUE_CAPACITY_MAX); CW_TEST_PRINT_TEST_RESULT (failure, n); int len_full = cw_get_tone_queue_length(); failure = len_full != CW_TONE_QUEUE_CAPACITY_MAX; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length() when tq full: %d %s %d:", len_full, failure ? "!=" : "==", CW_TONE_QUEUE_CAPACITY_MAX); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: attempt to add tone to full queue. */ { errno = 0; int status = cw_queue_tone(1000000, 100); bool failure = status || errno != EAGAIN; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_queue_tone() for full tq:"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: check again properties (capacity and length) of empty tq after it has been in use. Empty the tq, ensure that it is empty, and do the test. */ { fprintf(stderr, "libcw: -- final test on empty tq:\n"); /* Empty tone queue and make sure that it is really empty (wait for info from libcw). */ cw_flush_tone_queue(); cw_wait_for_tone_queue(); int capacity = cw_get_tone_queue_capacity(); bool failure = capacity != CW_TONE_QUEUE_CAPACITY_MAX; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_get_tone_queue_capacity(): %d %s %d:", capacity, failure ? "!=" : "==", CW_TONE_QUEUE_CAPACITY_MAX); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Test that the tq is really empty after cw_wait_for_tone_queue() has returned. */ int len_empty = cw_get_tone_queue_length(); failure = len_empty > 0; failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_tone_queue_length() when tq empty: %d %s 0:", len_empty, failure ? "!=" : "=="); CW_TEST_PRINT_TEST_RESULT (failure, n); } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } static int cw_test_tone_queue_callback_data = 999999; static int cw_test_helper_tq_callback_capture = false; /** tests::cw_register_tone_queue_low_callback() */ void test_tone_queue_callback(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); for (int i = 1; i < 10; i++) { /* Test the callback mechanism for very small values, but for a bit larger as well. */ int level = i <= 5 ? i : 10 * i; int rv = cw_register_tone_queue_low_callback(cw_test_helper_tq_callback, (void *) &cw_test_tone_queue_callback_data, level); bool failure = rv == CW_FAILURE; sleep(1); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_register_tone_queue_low_callback(): %d:", level); CW_TEST_PRINT_TEST_RESULT (failure, n); /* Add a lot of tones to tone queue. "a lot" means three times more than a value of trigger level. */ for (int j = 0; j < 3 * level; j++) { int duration = 10000; int f = 440; rv = cw_queue_tone(duration, f); assert (rv); } /* Allow the callback to work only after initial filling of queue. */ cw_test_helper_tq_callback_capture = true; /* Wait for the queue to be drained to zero. While the tq is drained, and level of tq reaches trigger level, a callback will be called. Its only task is to copy the current level (tq level at time of calling the callback) value into cw_test_tone_queue_callback_data. Since the value of trigger level is different in consecutive iterations of loop, we can test the callback for different values of trigger level. */ cw_wait_for_tone_queue(); /* Because of order of calling callback and decreasing length of queue, I think that it's safe to assume that there may be a difference of 1 between these two values. */ int diff = level - cw_test_tone_queue_callback_data; failure = diff > 1; failure ? stats->failures++ : stats->successes++; n = printf("libcw: tone queue callback: %d", level); CW_TEST_PRINT_TEST_RESULT (failure, n); cw_reset_tone_queue(); } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } static void cw_test_helper_tq_callback(void *data) { if (cw_test_helper_tq_callback_capture) { int *d = (int *) data; *d = cw_get_tone_queue_length(); cw_test_helper_tq_callback_capture = false; } return; } /** \brief Test control of volume Fill tone queue with short tones, then check that we can move the volume through its entire range. Flush the queue when complete. tests::cw_get_volume_limits() tests::cw_set_volume() tests::cw_get_volume() */ void test_volume_functions(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); int cw_min = -1, cw_max = -1; /* Test: get range of allowed volumes. */ { cw_get_volume_limits(&cw_min, &cw_max); bool failure = cw_min != CW_VOLUME_MIN || cw_max != CW_VOLUME_MAX; failure ? stats->failures++ : stats->successes++; int n = fprintf(stderr, "libcw: cw_get_volume_limits(): %d, %d", cw_min, cw_max); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: decrease volume from max to low. */ { /* Fill the tone queue with valid tones. */ while (!cw_is_tone_queue_full()) { cw_queue_tone(100000, 440); } bool set_failure = false; bool get_failure = false; /* TODO: why call the cw_wait_for_tone() at the beginning and end of loop's body? */ for (int i = cw_max; i >= cw_min; i -= 10) { cw_wait_for_tone(); if (!cw_set_volume(i)) { set_failure = true; break; } if (cw_get_volume() != i) { get_failure = true; break; } cw_wait_for_tone(); } set_failure ? stats->failures++ : stats->successes++; int n = fprintf(stderr, "libcw: cw_set_volume() (down):"); CW_TEST_PRINT_TEST_RESULT (set_failure, n); get_failure ? stats->failures++ : stats->successes++; n = fprintf(stderr, "libcw: cw_get_volume() (down):"); CW_TEST_PRINT_TEST_RESULT (get_failure, n); } /* Test: increase volume from zero to high. */ { /* Fill tone queue with valid tones. */ while (!cw_is_tone_queue_full()) { cw_queue_tone(100000, 440); } bool set_failure = false; bool get_failure = false; /* TODO: why call the cw_wait_for_tone() at the beginning and end of loop's body? */ for (int i = cw_min; i <= cw_max; i += 10) { cw_wait_for_tone(); if (!cw_set_volume(i)) { set_failure = true; break; } if (cw_get_volume() != i) { get_failure = true; break; } cw_wait_for_tone(); } set_failure ? stats->failures++ : stats->successes++; int n = fprintf(stderr, "libcw: cw_set_volume() (up):"); CW_TEST_PRINT_TEST_RESULT (set_failure, n); get_failure ? stats->failures++ : stats->successes++; n = fprintf(stderr, "libcw: cw_get_volume() (up):"); CW_TEST_PRINT_TEST_RESULT (get_failure, n); } cw_wait_for_tone(); cw_flush_tone_queue(); CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** \brief Test enqueueing and playing most basic elements of Morse code tests::cw_send_dot() tests::cw_send_dash() tests::cw_send_character_space() tests::cw_send_word_space() */ void test_send_primitives(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); int N = 20; /* Test: sending dot. */ { bool failure = false; for (int i = 0; i < N; i++) { if (!cw_send_dot()) { failure = true; break; } } cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_dot():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending dash. */ { bool failure = false; for (int i = 0; i < N; i++) { if (!cw_send_dash()) { failure = true; break; } } cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_dash():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending character space. */ { bool failure = false; for (int i = 0; i < N; i++) { if (!cw_send_character_space()) { failure = true; break; } } cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_character_space():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending word space. */ { bool failure = false; for (int i = 0; i < N; i++) { if (!cw_send_word_space()) { failure = true; break; } } cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_word_space():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** \brief Playing representations of characters tests::cw_send_representation() tests::cw_send_representation_partial() */ void test_representations(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); /* Test: sending valid representations. */ { bool failure = !cw_send_representation(".-.-.-") || !cw_send_representation(".-") || !cw_send_representation("---") || !cw_send_representation("...-"); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_representation():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending invalid representations. */ { bool failure = cw_send_representation("INVALID") || cw_send_representation("_._") || cw_send_representation("-_-"); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_representation():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending partial representation of a valid string. */ { bool failure = !cw_send_representation_partial(".-.-.-"); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_representation_partial():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } cw_wait_for_tone_queue(); CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** Send all supported characters: first as individual characters, and then as a string. tests::cw_send_character() tests::cw_send_string() */ void test_send_character_and_string(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); /* Test: sending all supported characters as individual characters. */ { char charlist[UCHAR_MAX + 1]; bool failure = false; /* Send all the characters from the charlist individually. */ cw_list_characters(charlist); printf("libcw: cw_send_character():\n" "libcw: "); for (int i = 0; charlist[i] != '\0'; i++) { putchar(charlist[i]); fflush(stdout); if (!cw_send_character(charlist[i])) { failure = true; break; } cw_wait_for_tone_queue(); } putchar('\n'); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_character():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending invalid character. */ { bool failure = cw_send_character(0); int n = printf("libcw: cw_send_character():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending all supported characters as single string. */ { char charlist[UCHAR_MAX + 1]; cw_list_characters(charlist); /* Send the complete charlist as a single string. */ printf("libcw: cw_send_string():\n" "libcw: %s\n", charlist); bool failure = !cw_send_string(charlist); while (cw_get_tone_queue_length() > 0) { printf("libcw: tone queue length %-6d\r", cw_get_tone_queue_length()); fflush(stdout); cw_wait_for_tone(); } printf("libcw: tone queue length %-6d\n", cw_get_tone_queue_length()); cw_wait_for_tone_queue(); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_send_string():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: sending invalid string. */ { bool failure = cw_send_string("%INVALID%"); int n = printf("libcw: cw_send_string():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** tests::cw_notify_keyer_paddle_event() tests::cw_wait_for_keyer_element() tests::cw_get_keyer_paddles() */ void test_keyer(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); /* Perform some tests on the iambic keyer. The latch finer timing points are not tested here, just the basics - dots, dashes, and alternating dots and dashes. */ int dot_paddle, dash_paddle; /* Test: keying dot. */ { /* Seems like this function calls means "keyer pressed until further notice". First argument is true, so this is a dot. */ bool failure = !cw_notify_keyer_paddle_event(true, false); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_keyer_paddle_event(true, false):"); CW_TEST_PRINT_TEST_RESULT (failure, n); bool success = true; /* Since a "dot" paddle is pressed, get 30 "dot" events from the keyer. */ printf("libcw: testing iambic keyer dots "); fflush(stdout); for (int i = 0; i < 30; i++) { success = success && cw_wait_for_keyer_element(); putchar('.'); fflush(stdout); } putchar('\n'); !success ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_keyer_element():"); CW_TEST_PRINT_TEST_RESULT (!success, n); } /* Test: preserving of paddle states. */ { cw_get_keyer_paddles(&dot_paddle, &dash_paddle); bool failure = !dot_paddle || dash_paddle; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_keyer_get_keyer_paddles():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: keying dash. */ { /* As above, it seems like this function calls means "keyer pressed until further notice". Second argument is true, so this is a dash. */ bool failure = !cw_notify_keyer_paddle_event(false, true); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_keyer_paddle_event(false, true):"); CW_TEST_PRINT_TEST_RESULT (failure, n); bool success = true; /* Since a "dash" paddle is pressed, get 30 "dash" events from the keyer. */ printf("libcw: testing iambic keyer dashes "); fflush(stdout); for (int i = 0; i < 30; i++) { success = success && cw_wait_for_keyer_element(); putchar('-'); fflush(stdout); } putchar('\n'); !success ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_keyer_element():"); CW_TEST_PRINT_TEST_RESULT (!success, n); } /* Test: preserving of paddle states. */ { cw_get_keyer_paddles(&dot_paddle, &dash_paddle); bool failure = dot_paddle || !dash_paddle; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_get_keyer_paddles():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: keying alternate dit/dash. */ { /* As above, it seems like this function calls means "keyer pressed until further notice". Both arguments are true, so both paddles are pressed at the same time.*/ bool failure = !cw_notify_keyer_paddle_event(true, true); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_keyer_paddle_event(true, true):"); CW_TEST_PRINT_TEST_RESULT (failure, n); bool success = true; printf("libcw: testing iambic alternating "); fflush(stdout); for (int i = 0; i < 30; i++) { success = success && cw_wait_for_keyer_element(); putchar('#'); fflush(stdout); } putchar('\n'); !success ? stats->failures++ : stats->successes++; n = printf("libcw: cw_wait_for_keyer_element:"); CW_TEST_PRINT_TEST_RESULT (!success, n); } /* Test: preserving of paddle states. */ { cw_get_keyer_paddles(&dot_paddle, &dash_paddle); bool failure = !dot_paddle || !dash_paddle; failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_get_keyer_paddles():"); CW_TEST_PRINT_TEST_RESULT (failure, n); } /* Test: set new state of paddles: no paddle pressed. */ { bool failure = !cw_notify_keyer_paddle_event(false, false); failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_keyer_paddle_event(false, false):"); CW_TEST_PRINT_TEST_RESULT (failure, n); } cw_wait_for_keyer(); CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /** tests::cw_notify_straight_key_event() tests::cw_get_straight_key_state() tests::cw_is_straight_key_busy() */ void test_straight_key(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); { bool event_failure = false; bool state_failure = false; bool busy_failure = false; /* Not sure why, but we have N calls informing the library that the key is not pressed. TODO: why we have N identical calls in a row? */ for (int i = 0; i < 10; i++) { if (!cw_notify_straight_key_event(CW_KEY_STATE_OPEN)) { event_failure = true; break; } if (cw_get_straight_key_state()) { state_failure = true; break; } if (cw_is_straight_key_busy()) { busy_failure = true; break; } } event_failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_straight_key_event():"); CW_TEST_PRINT_TEST_RESULT (event_failure, n); state_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_straight_key_state():"); CW_TEST_PRINT_TEST_RESULT (state_failure, n); busy_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_straight_key_busy():"); CW_TEST_PRINT_TEST_RESULT (busy_failure, n); } { bool event_failure = false; bool state_failure = false; bool busy_failure = false; /* Again not sure why we have N identical calls in a row. TODO: why? */ for (int i = 0; i < 10; i++) { if (!cw_notify_straight_key_event(CW_KEY_STATE_CLOSED)) { event_failure = true; break; } if (!cw_get_straight_key_state()) { state_failure = true; break; } if (!cw_is_straight_key_busy()) { busy_failure = true; break; } } event_failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_straight_key_event():"); CW_TEST_PRINT_TEST_RESULT (event_failure, n); state_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_straight_key_state():"); CW_TEST_PRINT_TEST_RESULT (state_failure, n); busy_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_straight_key_busy():"); CW_TEST_PRINT_TEST_RESULT (busy_failure, n); } sleep(1); { bool event_failure = false; bool state_failure = false; /* Even more identical calls. TODO: why? */ for (int i = 0; i < 10; i++) { if (!cw_notify_straight_key_event(CW_KEY_STATE_OPEN)) { event_failure = true; break; } } event_failure ? stats->failures++ : stats->successes++; int n = printf("libcw: cw_notify_straight_key_event():"); CW_TEST_PRINT_TEST_RESULT (event_failure, n); /* The key should be open, the function should return false. */ int state = cw_get_straight_key_state(); state_failure = state != CW_KEY_STATE_OPEN; state_failure ? stats->failures++ : stats->successes++; n = printf("libcw: cw_get_straight_key_state():"); CW_TEST_PRINT_TEST_RESULT (state_failure, n); } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } # if 0 /* * cw_test_delayed_release() */ void cw_test_delayed_release(cw_test_stats_t *stats) { printf("libcw: %s():\n", __func__); int failures = 0; struct timeval start, finish; int is_released, delay; /* This is slightly tricky to detect, but circumstantial evidence is provided by SIGALRM disposition returning to SIG_DFL. */ if (!cw_send_character_space()) { printf("libcw: ERROR: cw_send_character_space()\n"); failures++; } if (gettimeofday(&start, NULL) != 0) { printf("libcw: WARNING: gettimeofday failed, test incomplete\n"); return; } printf("libcw: waiting for cw_finalization delayed release"); fflush(stdout); do { struct sigaction disposition; sleep(1); if (sigaction(SIGALRM, NULL, &disposition) != 0) { printf("libcw: WARNING: sigaction failed, test incomplete\n"); return; } is_released = disposition.sa_handler == SIG_DFL; if (gettimeofday(&finish, NULL) != 0) { printf("libcw: WARNING: gettimeofday failed, test incomplete\n"); return; } delay = (finish.tv_sec - start.tv_sec) * 1000000 + finish.tv_usec - start.tv_usec; putchar('.'); fflush(stdout); } while (!is_released && delay < 20000000); putchar('\n'); /* The release should be around 10 seconds after the end of the sent space. A timeout or two might leak in, reducing it by a bit; we'll be ecstatic with more than five seconds. */ if (is_released) { printf("libcw: cw_finalization delayed release after %d usecs\n", delay); if (delay < 5000000) { printf("libcw: ERROR: cw_finalization release too quick\n"); failures++; } } else { printf("libcw: ERROR: cw_finalization release wait timed out\n"); failures++; } CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /* * cw_test_signal_handling_callback() * cw_test_signal_handling() */ static int cw_test_signal_handling_callback_called = false; void cw_test_signal_handling_callback(int signal_number) { signal_number = 0; cw_test_signal_handling_callback_called = true; } void cw_test_signal_handling(cw_test_stats_t *stats) { int failures = 0; struct sigaction action, disposition; /* Test registering, unregistering, and raising SIGUSR1. SIG_IGN and handlers are tested, but not SIG_DFL, because that stops the process. */ if (cw_unregister_signal_handler(SIGUSR1)) { printf("libcw: ERROR: cw_unregister_signal_handler invalid\n"); failures++; } if (!cw_register_signal_handler(SIGUSR1, cw_test_signal_handling_callback)) { printf("libcw: ERROR: cw_register_signal_handler failed\n"); failures++; } cw_test_signal_handling_callback_called = false; raise(SIGUSR1); sleep(1); if (!cw_test_signal_handling_callback_called) { printf("libcw: ERROR: cw_test_signal_handling_callback missed\n"); failures++; } if (!cw_register_signal_handler(SIGUSR1, SIG_IGN)) { printf("libcw: ERROR: cw_register_signal_handler (overwrite) failed\n"); failures++; } cw_test_signal_handling_callback_called = false; raise(SIGUSR1); sleep(1); if (cw_test_signal_handling_callback_called) { printf("libcw: ERROR: cw_test_signal_handling_callback called\n"); failures++; } if (!cw_unregister_signal_handler(SIGUSR1)) { printf("libcw: ERROR: cw_unregister_signal_handler failed\n"); failures++; } if (cw_unregister_signal_handler(SIGUSR1)) { printf("libcw: ERROR: cw_unregister_signal_handler invalid\n"); failures++; } action.sa_handler = cw_test_signal_handling_callback; action.sa_flags = SA_RESTART; sigemptyset(&action.sa_mask); if (sigaction(SIGUSR1, &action, &disposition) != 0) { printf("libcw: WARNING: sigaction failed, test incomplete\n"); return failures; } if (cw_register_signal_handler(SIGUSR1, SIG_IGN)) { printf("libcw: ERROR: cw_register_signal_handler clobbered\n"); failures++; } if (sigaction(SIGUSR1, &disposition, NULL) != 0) { printf("libcw: WARNING: sigaction failed, test incomplete\n"); return failures; } printf("libcw: cw_[un]register_signal_handler tests complete\n"); return; } #endif /* Version of test_cw_gen_forever() to be used in libcw_test_internal test executable. Because the function calls cw_generator_delete(), it should be executed as last test in test suite (unless you want to call cw_generator_new/start() again). */ void test_cw_gen_forever_public(cw_test_stats_t *stats) { /* Make sure that an audio sink is closed. If we try to open an OSS sink that is already open, we may end up with "resource busy" error in libcw_oss.c module (that's what happened on Alpine Linux). Because of this call this test should be executed as last one. */ cw_generator_delete(); int seconds = 5; printf("libcw: %s() (%d seconds):\n", __func__, seconds); unsigned int rv = test_cw_gen_forever_sub(seconds, test_audio_system, NULL); rv == 0 ? stats->successes++ : stats->failures++; CW_TEST_PRINT_FUNCTION_COMPLETED (__func__); return; } /*---------------------------------------------------------------------*/ /* Unit tests drivers */ /*---------------------------------------------------------------------*/ /** \brief Set up common test conditions Run before each individual test, to handle setup of common test conditions. */ void cw_test_setup(void) { cw_reset_send_receive_parameters(); cw_set_send_speed(30); cw_set_receive_speed(30); cw_disable_adaptive_receive(); cw_reset_receive_statistics(); cw_unregister_signal_handler(SIGUSR1); errno = 0; return; } /* Tests that are dependent on a sound system being configured. Tone queue module functions */ static void (*const CW_TEST_FUNCTIONS_DEP_T[])(cw_test_stats_t *) = { test_tone_queue_1, test_tone_queue_2, test_tone_queue_3, test_tone_queue_callback, NULL }; /* Tests that are dependent on a sound system being configured. Generator module functions. */ static void (*const CW_TEST_FUNCTIONS_DEP_G[])(cw_test_stats_t *) = { test_volume_functions, test_send_primitives, test_send_character_and_string, test_representations, NULL }; /* Tests that are dependent on a sound system being configured. Morse key module functions */ static void (*const CW_TEST_FUNCTIONS_DEP_K[])(cw_test_stats_t *) = { test_keyer, test_straight_key, NULL }; /* Tests that are dependent on a sound system being configured. Other modules' functions. */ static void (*const CW_TEST_FUNCTIONS_DEP_O[])(cw_test_stats_t *) = { test_parameter_ranges, test_cw_gen_forever_public, //cw_test_delayed_release, //cw_test_signal_handling, /* FIXME - not sure why this test fails :( */ NULL }; /** \brief Run tests for given audio system. Perform a series of self-tests on library public interfaces, using audio system specified with \p audio_system. Range of tests is specified with \p testset. \param audio_system - audio system to use for tests \param modules - libcw modules to be tested \param stats - test statistics \return -1 on failure to set up tests \return 0 if tests were run, and no errors occurred \return 1 if tests were run, and some errors occurred */ int cw_test_dependent_with(int audio_system, const char *modules, cw_test_stats_t *stats) { test_audio_system = audio_system; int rv = cw_generator_new(audio_system, NULL); if (rv != 1) { fprintf(stderr, "libcw: can't create generator, stopping the test\n"); return -1; } rv = cw_generator_start(); if (rv != 1) { fprintf(stderr, "libcw: can't start generator, stopping the test\n"); cw_generator_delete(); return -1; } if (strstr(modules, "t")) { for (int test = 0; CW_TEST_FUNCTIONS_DEP_T[test]; test++) { cw_test_setup(); (*CW_TEST_FUNCTIONS_DEP_T[test])(stats); } } if (strstr(modules, "g")) { for (int test = 0; CW_TEST_FUNCTIONS_DEP_G[test]; test++) { cw_test_setup(); (*CW_TEST_FUNCTIONS_DEP_G[test])(stats); } } if (strstr(modules, "k")) { for (int test = 0; CW_TEST_FUNCTIONS_DEP_K[test]; test++) { cw_test_setup(); (*CW_TEST_FUNCTIONS_DEP_K[test])(stats); } } if (strstr(modules, "o")) { for (int test = 0; CW_TEST_FUNCTIONS_DEP_O[test]; test++) { cw_test_setup(); (*CW_TEST_FUNCTIONS_DEP_O[test])(stats); } } sleep(1); cw_generator_stop(); sleep(1); cw_generator_delete(); /* All tests done; return success if no failures, otherwise return an error status code. */ return stats->failures ? 1 : 0; } /** \brief Run a series of tests for specified audio systems Function attempts to run a set of testcases for every audio system specified in \p audio_systems. These testcases require some kind of audio system configured. The function calls cw_test_dependent_with() to do the configuration and run the tests. \p audio_systems is a list of audio systems to be tested: "ncoap". Pass NULL pointer to attempt to test all of audio systems supported by libcw. \param audio_systems - list of audio systems to be tested */ int cw_test_dependent(const char *audio_systems, const char *modules) { int n = 0, c = 0, o = 0, a = 0, p = 0; if (!audio_systems || strstr(audio_systems, "n")) { if (cw_is_null_possible(NULL)) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with null output\n"); n = cw_test_dependent_with(CW_AUDIO_NULL, modules, &cw_stats_null); } else { fprintf(stderr, "libcw: null output not available\n"); } } if (!audio_systems || strstr(audio_systems, "c")) { if (cw_is_console_possible(NULL)) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with console output\n"); c = cw_test_dependent_with(CW_AUDIO_CONSOLE, modules, &cw_stats_console); } else { fprintf(stderr, "libcw: console output not available\n"); } } if (!audio_systems || strstr(audio_systems, "o")) { if (cw_is_oss_possible(NULL)) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with OSS output\n"); o = cw_test_dependent_with(CW_AUDIO_OSS, modules, &cw_stats_oss); } else { fprintf(stderr, "libcw: OSS output not available\n"); } } if (!audio_systems || strstr(audio_systems, "a")) { if (cw_is_alsa_possible(NULL)) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with ALSA output\n"); a = cw_test_dependent_with(CW_AUDIO_ALSA, modules, &cw_stats_alsa); } else { fprintf(stderr, "libcw: Alsa output not available\n"); } } if (!audio_systems || strstr(audio_systems, "p")) { if (cw_is_pa_possible(NULL)) { fprintf(stderr, "========================================\n"); fprintf(stderr, "libcw: testing with PulseAudio output\n"); p = cw_test_dependent_with(CW_AUDIO_PA, modules, &cw_stats_pa); } else { fprintf(stderr, "libcw: PulseAudio output not available\n"); } } if (!n && !c && !o && !a && !p) { return 0; } else { return -1; } } void cw_test_print_stats(void) { printf("\n\nlibcw: Statistics of tests:\n\n"); printf("libcw: Tests not requiring any audio system: "); if (cw_stats_indep.failures + cw_stats_indep.successes) { printf("errors: %03d, total: %03d\n", cw_stats_indep.failures, cw_stats_indep.failures + cw_stats_indep.successes); } else { printf("no tests were performed\n"); } printf("libcw: Tests performed with NULL audio system: "); if (cw_stats_null.failures + cw_stats_null.successes) { printf("errors: %03d, total: %03d\n", cw_stats_null.failures, cw_stats_null.failures + cw_stats_null.successes); } else { printf("no tests were performed\n"); } printf("libcw: Tests performed with console audio system: "); if (cw_stats_console.failures + cw_stats_console.successes) { printf("errors: %03d, total: %03d\n", cw_stats_console.failures, cw_stats_console.failures + cw_stats_console.successes); } else { printf("no tests were performed\n"); } printf("libcw: Tests performed with OSS audio system: "); if (cw_stats_oss.failures + cw_stats_oss.successes) { printf("errors: %03d, total: %03d\n", cw_stats_oss.failures, cw_stats_oss.failures + cw_stats_oss.successes); } else { printf("no tests were performed\n"); } printf("libcw: Tests performed with ALSA audio system: "); if (cw_stats_alsa.failures + cw_stats_alsa.successes) { printf("errors: %03d, total: %03d\n", cw_stats_alsa.failures, cw_stats_alsa.failures + cw_stats_alsa.successes); } else { printf("no tests were performed\n"); } printf("libcw: Tests performed with PulseAudio audio system: "); if (cw_stats_pa.failures + cw_stats_pa.successes) { printf("errors: %03d, total: %03d\n", cw_stats_pa.failures, cw_stats_pa.failures + cw_stats_pa.successes); } else { printf("no tests were performed\n"); } return; } #endif // #ifdef LIBCW_UNIT_TESTS /** \return EXIT_SUCCESS if all tests complete successfully, \return EXIT_FAILURE otherwise */ int main(int argc, char *const argv[]) { int rv = 0; #ifdef LIBCW_UNIT_TESTS static const int SIGNALS[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, 0 }; unsigned int testset = 0; struct timeval seed; gettimeofday(&seed, NULL); // fprintf(stderr, "seed: %d\n", (int) seed.tv_usec); srand(seed.tv_usec); /* Obtain a bitmask of the tests to run from the command line arguments. If none, then default to ~0, which effectively requests all tests. */ if (argc > 1) { testset = 0; for (int arg = 1; arg < argc; arg++) { unsigned int test = strtoul(argv[arg], NULL, 0); testset |= 1 << test; } } else { testset = ~0; } #define CW_SYSTEMS_MAX 5 char sound_systems[CW_SYSTEMS_MAX + 1]; #define CW_MODULES_MAX 4 /* g, t, k, o */ char modules[CW_MODULES_MAX + 1]; modules[0] = '\0'; if (!cw_test_args(argc, argv, sound_systems, CW_SYSTEMS_MAX, modules, CW_MODULES_MAX)) { cw_test_print_help(argv[0]); exit(EXIT_FAILURE); } atexit(cw_test_print_stats); /* Arrange for the test to exit on a range of signals. */ for (int i = 0; SIGNALS[i] != 0; i++) { if (!cw_register_signal_handler(SIGNALS[i], SIG_DFL)) { fprintf(stderr, "libcw: ERROR: cw_register_signal_handler\n"); exit(EXIT_FAILURE); } } rv = cw_test_dependent(sound_systems, modules); #endif // #ifdef LIBCW_UNIT_TESTS return rv == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } unixcw-3.4.2/src/libcw/libcw_key.c0000644000175000017500000011443112473664711016701 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_key.c \brief Straight key and keyer. */ #include #include /* uint32_t */ #include #include /* usleep() */ #include #include "libcw_debug.h" #include "libcw_key.h" #include "libcw_gen.h" #include "libcw_rec.h" #include "libcw_signal.h" #include "libcw_utils.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* ******************************************************************** */ /* Section:Keying control */ /* ******************************************************************** */ /* Code maintaining state of a key, and handling changes of key state. A key can be in two states: \li open - a physical key with electric contacts open, no sound or continuous wave is generated; \li closed - a physical key with electric contacts closed, a sound or continuous wave is generated; Key type is not specified. This code maintains state of any type of key: straight key, cootie key, iambic key. All that matters is state of contacts (open/closed). The concept of "key" is extended to a software generator (provided by this library) that generates Morse code wave from text input. This means that key is closed when a tone (element) is generated, and key is open when there is inter-tone (inter-element) space. Client code can register - using cw_register_keying_callback() - a client callback function. The function will be called every time the state of a key changes. */ /* ******************************************************************** */ /* Section:Iambic keyer */ /* ******************************************************************** */ /* * The CW keyer functions implement the following state graph: * * +-----------------------------------------------------+ * | (all latches clear) | * | (dot latch) | * | +--------------------------+ * | | | * | v | * | +-------------> KS_IN_DOT_[A|B] -------> KS_AFTER_DOT_[A|B] * | |(dot paddle) ^ (delay) | * | | | |(dash latch/ * | | +------------+ | _B) * v | | | * --> KS_IDLE --+ +--------------------------+ * ^ | | | * | | | +-------------+(dot latch/ * | | | | _B) * | |(dash paddle) v (delay) | * | +-------------> KS_IN_DASH_[A|B] -------> KS_AFTER_DASH_[A|B] * | ^ | * | | | * | +--------------------------+ * | (dash latch) | * | (all latches clear) | * +-----------------------------------------------------+ */ /* See also enum of int values, declared in libcw_key.h. */ static const char *cw_iambic_keyer_states[] = { "KS_IDLE", "KS_IN_DOT_A", "KS_IN_DASH_A", "KS_AFTER_DOT_A", "KS_AFTER_DASH_A", "KS_IN_DOT_B", "KS_IN_DASH_B", "KS_AFTER_DOT_B", "KS_AFTER_DASH_B" }; static int cw_key_ik_update_state_initial_internal(volatile cw_key_t *key); static int cw_key_ik_enqueue_symbol_internal(volatile cw_key_t *key, int key_value, char symbol); static int cw_key_sk_enqueue_symbol_internal(volatile cw_key_t *key, int key_value); /* ******************************************************************** */ /* Section:Keying control */ /* ******************************************************************** */ /** \brief Register external callback function for keying Register a \p callback_func function that should be called when a state of a \p key changes from "key open" to "key closed", or vice-versa. The first argument passed to the registered callback function is the supplied \p callback_arg, if any. The second argument passed to registered callback function is the key state: CW_KEY_STATE_CLOSED (one/true) for "key closed", and CW_KEY_STATE_OPEN (zero/false) for "key open". Calling this routine with a NULL function address disables keying callbacks. Any callback supplied will be called in signal handler context (??). \param key \param callback_func - callback function to be called on key state changes \param callback_arg - first argument to callback_func */ void cw_key_register_keying_callback_internal(volatile cw_key_t *key, void (*callback_func)(void*, int), void *callback_arg) { key->key_callback = callback_func; key->key_callback_arg = callback_arg; return; } /** Most of the time libcw just passes around key_callback_arg, not caring of what type it is, and not attempting to do any operations on it. On one occasion however, it needs to know whether key_callback_arg is of type 'struct timeval', and if so, it must do some operation on it. I could pass struct with ID as key_callback_arg, but that may break some old client code. Instead I've created this function that has only one, very specific purpose: to pass to libcw a pointer to timer. The timer is owned by client code, and is used to measure and clock iambic keyer. \param key \param timer */ void cw_key_ik_register_timer_internal(volatile cw_key_t *key, struct timeval *timer) { key->ik.timer = timer; return; } /** \brief Set new value of key Set new value of a key. Filter successive key-down or key-up actions into a single action (successive calls with the same value of \p key_state don't change internally registered value of key). If and only if the function registers change of key value, an external callback function for keying (if configured) is called. Notice that the function is used only in cw_tq_dequeue_internal(). A generator which owns a tone queue is treated as a key, and dequeued tones are treated as key values. Dequeueing tones is treated as manipulating a key. \param key - key to use \param key_value - key value to be set */ void cw_key_tk_set_value_internal(volatile cw_key_t *key, int key_value) { cw_assert (key, "key is NULL"); if (key->tk.key_value != key_value) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/qk: key value: %d->%d", key->tk.key_value, key_value); /* Remember the new key value. */ key->tk.key_value = key_value; /* Call a registered callback. */ if (key->key_callback) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/qk: ====== about to call callback, key value = %d\n", key->tk.key_value); (*(key->key_callback))(key->key_callback_arg, key->tk.key_value); } return; } else { /* This is not an error. This may happen when dequeueing 'forever' tone multiple times in a row. */ return; } } /* Comment for key used as iambic keyer: Iambic keyer cannot function without an associated generator. A keyer has to have some generator to function correctly. Generator doesn't care if it has any key registered or not. Thus a function binding a keyer and generator belongs to "iambic keyer" module. Remember that a generator can exist without a keyer. In applications that do nothing related to keying with iambic keyer, having just a generator is a valid situation. \param key - key that needs to have a generator associated with it \param gen - generator to be used with given keyer */ void cw_key_register_generator_internal(volatile cw_key_t *key, cw_gen_t *gen) { /* General key. */ key->gen = gen; gen->key = key; return; } /** There should be a binding between key and a receiver. The receiver can get it's properly formed input data (key down/key up events) from any source, so it's independent from key. On the other hand the key without receiver is rather useless. Therefore I think that the key should contain reference to a receiver, not the other way around. \param key - key that needs to have a receiver associated with it \param rec - receiver to be used with given key */ void cw_key_register_receiver_internal(volatile cw_key_t *key, cw_rec_t *rec) { key->rec = rec; return; } /** \brief Set new key value, generate appropriate tone (Mark/Space) Set new value of a key. Filter successive key-down or key-up actions into a single action (successive calls with the same value of \p key_value don't change internally registered value of key). If and only if the function registers change of key value, an external callback function for keying (if configured) is called. If and only if the function registers change of key value, a state of related generator \p gen is changed accordingly (a tone is started or stopped). \param key - key in use \param key_state - key state to be set \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_sk_enqueue_symbol_internal(volatile cw_key_t *key, int key_value) { cw_assert (key, "key is NULL"); cw_assert (key->gen, "generator is NULL"); if (key->sk.key_value != key_value) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/sk: key value %d->%d", key->sk.key_value, key_value); /* Remember the new key value. */ key->sk.key_value = key_value; /* Call a registered callback. */ if (key->key_callback) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/sk: ++++++ about to call callback, key value = %d\n", key_value); (*(key->key_callback))(key->key_callback_arg, key->sk.key_value); } int rv; if (key->sk.key_value == CW_KEY_STATE_CLOSED) { /* In case of straight key we don't know at all how long the tone should be (we don't know for how long the key will be closed. Let's enqueue a beginning of mark. A constant tone will be played until function receives CW_KEY_STATE_OPEN key state. */ rv = cw_gen_key_begin_mark_internal(key->gen); } else { /* CW_KEY_STATE_OPEN, time to go from Mark (audible tone) to Space (silence). */ rv = cw_gen_key_begin_space_internal(key->gen); } cw_assert (rv, "failed to key key value %d", key->sk.key_value); return rv; } else { /* This may happen when dequeueing 'forever' tone multiple times in a row. */ return CW_SUCCESS; } } /** \brief Enqueue a symbol (Mark/Space) in generator's queue This function is called when keyer enters new graph state (as described by keyer's state graph). The keyer needs some mechanism to control itself, to control when to move out of current graph state into next graph state. The movement between graph states must be done in specific time periods. Iambic keyer needs to be notified whenever a specific time period has elapsed. Lengths of the enqueued periods are determined by type of \p symbol (Space, Dot, Dash). Generator and its tone queue is used to implement this mechanism. The function enqueues a tone/symbol (Mark or Space) of specific length - this is the beginning of period when keyer is in new graph state. Then generator dequeues the tone/symbol, counts the time period, and (at the end of the tone/period) notifies keyer about end of period. (Keyer then needs to evaluate state of paddles and decide what's next, but that is a different story). As a side effect of using generator, a sound is generated (if generator's sound system is not Null). Function also calls external callback function for keying on every change of key's value (if the callback has been registered by client code). Key's value (Open/Closed) is passed to the callback as argument. Callback is called by this function only when there is a change of key value - this function filters successive key-down or key-up actions into a single action. TODO: explain difference and relation between key's value and keyer's graph state. \param key - current key \param key_value - key value to be set (Mark/Space) \param symbol - symbol to enqueue (Space, Dot, Dash) \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_enqueue_symbol_internal(volatile cw_key_t *key, int key_value, char symbol) { cw_assert (key, "keyer is NULL"); cw_assert (key->gen, "generator is NULL"); if (key->ik.key_value != key_value) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/ik: key value %d->%d", key->ik.key_value, key_value); /* Remember the new key value. */ key->ik.key_value = key_value; /* Call a registered callback. */ if (key->key_callback) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/ik: ------ about to call callback, key value = %d\n", key_value); (*(key->key_callback))(key->key_callback_arg, key->ik.key_value); } /* 'Pure' means without any end-of-mark spaces. */ int rv = cw_gen_key_pure_symbol_internal(key->gen, symbol); cw_assert (rv, "failed to key symbol '%c'", symbol); return rv; } else { /* This is not an error. This may happen when dequeueing 'forever' tone multiple times in a row. */ return CW_SUCCESS; } } /* ******************************************************************** */ /* Section:Iambic keyer */ /* ******************************************************************** */ /** \brief Enable iambic Curtis mode B Normally, the iambic keying functions will emulate Curtis 8044 Keyer mode A. In this mode, when both paddles are pressed together, the last dot or dash being sent on release is completed, and nothing else is sent. In mode B, when both paddles are pressed together, the last dot or dash being sent on release is completed, then an opposite element is also sent. Some operators prefer mode B, but timing is more critical in this mode. The default mode is Curtis mode A. \param key */ void cw_key_ik_enable_curtis_mode_b_internal(volatile cw_key_t *key) { key->ik.curtis_mode_b = true; return; } /** See documentation of cw_key_ik_enable_curtis_mode_b() for more information \param key */ void cw_key_ik_disable_curtis_mode_b_internal(volatile cw_key_t *key) { key->ik.curtis_mode_b = false; return; } /** See documentation of cw_enable_iambic_curtis_mode_b() for more information \param key \return true if Curtis mode is enabled for the key \return false otherwise */ bool cw_key_ik_get_curtis_mode_b_state_internal(volatile cw_key_t *key) { return key->ik.curtis_mode_b; } /** \brief Update state of iambic keyer, queue tone representing state of the iambic keyer It seems that the function is called when a client code informs about change of state of one of paddles. So I think what the function does is that it takes the new state of paddles and re-evaluate internal state of iambic keyer. The function is also called in generator's thread function cw_generator_dequeue_and_play_internal() each time a tone is dequeued and pushed to audio system. I don't know why make the call in that place for iambic keyer, but not for straight key. \param key - iambic key \return CW_FAILURE if there is a lock and the function cannot proceed \return CW_SUCCESS otherwise */ int cw_key_ik_update_graph_state_internal(volatile cw_key_t *key) { if (!key) { /* This function is called from generator thread. It is perfectly valid situation that for some applications a generator exists, but a keyer does not exist. Silently accept this situation. */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_INTERNAL, CW_DEBUG_DEBUG, "libcw/ik: NULL key, silently accepting"); return CW_SUCCESS; } /* This function is called from generator thread function, so the generator must exist. Be paranoid and check it, just in case :) */ cw_assert (key->gen, "generator is NULL"); if (key->ik.lock) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_INTERNAL, CW_DEBUG_ERROR, "libcw/ik: lock in thread %ld", (long) pthread_self()); return CW_FAILURE; } key->ik.lock = true; /* Synchronize low level timing parameters if required. */ cw_gen_sync_parameters_internal(key->gen); cw_rec_sync_parameters_internal(key->rec); int old_state = key->ik.graph_state; /* Decide what to do based on the current state. */ switch (key->ik.graph_state) { /* Ignore calls if our state is idle. */ case KS_IDLE: key->ik.lock = false; return CW_SUCCESS; case KS_IN_DOT_A: case KS_IN_DOT_B: /* Verify that key value and keyer graph state are in sync. We are *at the end* of Mark, so key should be (still) closed. */ cw_assert (key->ik.key_value == CW_KEY_STATE_CLOSED, "inconsistency between keyer state (%s) ad key value (%d)", cw_iambic_keyer_states[key->ik.graph_state], key->ik.key_value); /* We are ending a dot, so turn off tone and begin the after-dot delay. No routine status checks are made since we are in a signal handler, and can't readily return error codes to the client. */ cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_OPEN, CW_SYMBOL_SPACE); key->ik.graph_state = key->ik.graph_state == KS_IN_DOT_A ? KS_AFTER_DOT_A : KS_AFTER_DOT_B; break; case KS_IN_DASH_A: case KS_IN_DASH_B: /* Verify that key value and keyer graph state are in sync. We are *at the end* of Mark, so key should be (still) closed. */ cw_assert (key->ik.key_value == CW_KEY_STATE_CLOSED, "inconsistency between keyer state (%s) ad key value (%d)", cw_iambic_keyer_states[key->ik.graph_state], key->ik.key_value); /* We are ending a dash, so turn off tone and begin the after-dash delay. No routine status checks are made since we are in a signal handler, and can't readily return error codes to the client. */ cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_OPEN, CW_SYMBOL_SPACE); key->ik.graph_state = key->ik.graph_state == KS_IN_DASH_A ? KS_AFTER_DASH_A : KS_AFTER_DASH_B; break; case KS_AFTER_DOT_A: case KS_AFTER_DOT_B: /* Verify that key value and keyer graph state are in sync. We are *at the end* of Space, so key should be (still) open. */ cw_assert (key->ik.key_value == CW_KEY_STATE_OPEN, "inconsistency between keyer state (%s) ad key value (%d)", cw_iambic_keyer_states[key->ik.graph_state], key->ik.key_value); /* If we have just finished a dot or a dash and its post-mark delay, then reset the latches as appropriate. Next, if in a _B state, go straight to the opposite element state. If in an _A state, check the latch states; if the opposite latch is set true, then do the iambic thing and alternate dots and dashes. If the same latch is true, repeat. And if nothing is true, then revert to idling. */ if (!key->ik.dot_paddle) { /* Client has informed us that dot paddle has been released. Clear the paddle state memory. */ key->ik.dot_latch = false; } if (key->ik.graph_state == KS_AFTER_DOT_B) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DASH_REPRESENTATION); key->ik.graph_state = KS_IN_DASH_A; } else if (key->ik.dash_latch) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DASH_REPRESENTATION); if (key->ik.curtis_b_latch){ key->ik.curtis_b_latch = false; key->ik.graph_state = KS_IN_DASH_B; } else { key->ik.graph_state = KS_IN_DASH_A; } } else if (key->ik.dot_latch) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DOT_REPRESENTATION); key->ik.graph_state = KS_IN_DOT_A; } else { key->ik.graph_state = KS_IDLE; //cw_finalization_schedule_internal(); } break; case KS_AFTER_DASH_A: case KS_AFTER_DASH_B: /* Verify that key value and keyer graph state are in sync. We are *at the end* of Space, so key should be (still) open. */ cw_assert (key->ik.key_value == CW_KEY_STATE_OPEN, "inconsistency between keyer state (%s) ad key value (%d)", cw_iambic_keyer_states[key->ik.graph_state], key->ik.key_value); if (!key->ik.dash_paddle) { /* Client has informed us that dash paddle has been released. Clear the paddle state memory. */ key->ik.dash_latch = false; } /* If we have just finished a dot or a dash and its post-mark delay, then reset the latches as appropriate. Next, if in a _B state, go straight to the opposite element state. If in an _A state, check the latch states; if the opposite latch is set true, then do the iambic thing and alternate dots and dashes. If the same latch is true, repeat. And if nothing is true, then revert to idling. */ if (key->ik.graph_state == KS_AFTER_DASH_B) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DOT_REPRESENTATION); key->ik.graph_state = KS_IN_DOT_A; } else if (key->ik.dot_latch) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DOT_REPRESENTATION); if (key->ik.curtis_b_latch) { key->ik.curtis_b_latch = false; key->ik.graph_state = KS_IN_DOT_B; } else { key->ik.graph_state = KS_IN_DOT_A; } } else if (key->ik.dash_latch) { cw_key_ik_enqueue_symbol_internal(key, CW_KEY_STATE_CLOSED, CW_DASH_REPRESENTATION); key->ik.graph_state = KS_IN_DASH_A; } else { key->ik.graph_state = KS_IDLE; //cw_finalization_schedule_internal(); } break; } cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYER_STATES, CW_DEBUG_INFO, "libcw/ik: keyer state: %s -> %s", cw_iambic_keyer_states[old_state], cw_iambic_keyer_states[key->ik.graph_state]); key->ik.lock = false; return CW_SUCCESS; } /** \brief Inform iambic keyer logic about changed state of iambic keyer's paddles Function informs the library that the iambic keyer paddles have changed state. The new paddle states are recorded, and if either transition from false to true, paddle latches (for iambic functions) are also set. On success, the routine returns CW_SUCCESS. On failure, it returns CW_FAILURE, with errno set to EBUSY if the tone queue or straight key are using the sound card, console speaker, or keying system. If appropriate, this routine starts the keyer functions sending the relevant element. Element send and timing occurs in the background, so this routine returns almost immediately. See cw_keyer_element_wait() and cw_keyer_wait() for details about how to check the current status of iambic keyer background processing. \param key \param dot_paddle_state \param dash_paddle_state \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_notify_paddle_event_internal(volatile cw_key_t *key, int dot_paddle_state, int dash_paddle_state) { #if 0 /* This is disabled, but I'm not sure why. */ /* If the tone queue or the straight key are busy, this is going to conflict with our use of the sound card, console sounder, and keying system. So return an error status in this case. */ if (cw_tq_is_busy_internal(key->gen->tq) || cw_key_sk_is_busy_internal(key)) { errno = EBUSY; return CW_FAILURE; } #endif /* Clean up and save the paddle states passed in. */ key->ik.dot_paddle = (dot_paddle_state != 0); key->ik.dash_paddle = (dash_paddle_state != 0); /* Update the paddle latches if either paddle goes true. The latches are checked in the signal handler, so if the paddles go back to false during this element, the item still gets actioned. The signal handler is also responsible for clearing down the latches. */ if (key->ik.dot_paddle) { key->ik.dot_latch = true; } if (key->ik.dash_paddle) { key->ik.dash_latch = true; } /* If in Curtis mode B, make a special check for both paddles true at the same time. This flag is checked by the signal handler, to determine whether to add mode B trailing timing elements. */ if (key->ik.curtis_mode_b && key->ik.dot_paddle && key->ik.dash_paddle) { key->ik.curtis_b_latch = true; } cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYER_STATES, CW_DEBUG_INFO, "libcw/ik: keyer paddles %d,%d, latches %d,%d, curtis_b %d", key->ik.dot_paddle, key->ik.dash_paddle, key->ik.dot_latch, key->ik.dash_latch, key->ik.curtis_b_latch); if (key->ik.graph_state == KS_IDLE) { /* If the current state is idle, give the state process an initial impulse. */ return cw_key_ik_update_state_initial_internal(key); } else { /* The state machine for iambic keyer is already in motion, no need to do anything more. Current paddle states have been recorded in this function. Any future changes of paddle states will be also recorded by this function. In both cases the main action upon states of paddles and paddle latches is taken in cw_key_ik_update_graph_state_internal(). */ return CW_SUCCESS; } } /** \brief Initiate work of iambic keyer state machine State machine for iambic keyer must be pushed from KS_IDLE state. Call this function to do this. \param key \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_update_state_initial_internal(volatile cw_key_t *key) { cw_assert (key, "keyer is NULL"); cw_assert (key->gen, "generator is NULL"); if (!key->ik.dot_paddle && !key->ik.dash_paddle) { /* Both paddles are open/up. We certainly don't want to start any process upon "both paddles open" event. But the function shouldn't have been called in that situation. */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYER_STATES, CW_DEBUG_ERROR, "libcw/ik: called update_state_initial() function when both paddles are up"); /* Silently accept. TODO: maybe it's a good idea, or maybe bad one to return CW_SUCCESS here. */ return CW_SUCCESS; } int old_state = key->ik.graph_state; if (key->ik.dot_paddle) { /* "Dot" paddle pressed. Pretend that we are in "after dash" space, so that keyer will have to transit into "dot" mark state. */ key->ik.graph_state = key->ik.curtis_b_latch ? KS_AFTER_DASH_B : KS_AFTER_DASH_A; } else { /* key->ik.dash_paddle */ /* "Dash" paddle pressed. Pretend that we are in "after dot" space, so that keyer will have to transit into "dash" mark state. */ key->ik.graph_state = key->ik.curtis_b_latch ? KS_AFTER_DOT_B : KS_AFTER_DOT_A; } cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYER_STATES, CW_DEBUG_DEBUG, "libcw/ik: keyer state (init): %s -> %s", cw_iambic_keyer_states[old_state], cw_iambic_keyer_states[key->ik.graph_state]); /* Here comes the "real" initial transition - this is why we called this function. */ int rv = cw_key_ik_update_graph_state_internal(key); if (rv == CW_FAILURE) { /* Just try again, once. */ usleep(1000); rv = cw_key_ik_update_graph_state_internal(key); if (!rv) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYER_STATES, CW_DEBUG_ERROR, "libcw/ik: call to update_state_initial() failed"); } } return rv; } /** \brief Change state of dot paddle Alter the state of just one of the two iambic keyer paddles. The other paddle state of the paddle pair remains unchanged. See cw_key_ik_notify_paddle_event_internal() for details of iambic keyer background processing, and how to check its status. \param key \param dot_paddle_state \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_notify_dot_paddle_event_internal(volatile cw_key_t *key, int dot_paddle_state) { return cw_key_ik_notify_paddle_event_internal(key, dot_paddle_state, key->ik.dash_paddle); } /** See documentation of cw_notify_keyer_dot_paddle_event() for more information \param key \param dash_paddle_state \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_notify_dash_paddle_event_internal(volatile cw_key_t *key, int dash_paddle_state) { return cw_key_ik_notify_paddle_event_internal(key, key->ik.dot_paddle, dash_paddle_state); } /** \brief Get the current saved states of the two paddles \param key \param dot_paddle_state \param dash_paddle_state */ void cw_key_ik_get_paddles_internal(volatile cw_key_t *key, int *dot_paddle_state, int *dash_paddle_state) { if (dot_paddle_state) { *dot_paddle_state = key->ik.dot_paddle; } if (dash_paddle_state) { *dash_paddle_state = key->ik.dash_paddle; } return; } /** \brief Get the current states of paddle latches Function returns the current saved states of the two paddle latches. A paddle latches is set to true when the paddle state becomes true, and is cleared if the paddle state is false when the element finishes sending. \param key \param dot_paddle_latch_state \param dash_paddle_latch_state */ void cw_key_ik_get_paddle_latches_internal(volatile cw_key_t *key, int *dot_paddle_latch_state, int *dash_paddle_latch_state) { if (dot_paddle_latch_state) { *dot_paddle_latch_state = key->ik.dot_latch; } if (dash_paddle_latch_state) { *dash_paddle_latch_state = key->ik.dash_latch; } return; } /** \brief Check if a keyer is busy \param key \return true if keyer is busy \return false if keyer is not busy */ bool cw_key_ik_is_busy_internal(volatile cw_key_t *key) { return key->ik.graph_state != KS_IDLE; } /** \brief Wait for end of element from the keyer Waits until the end of the current element, dot or dash, from the keyer. On error the function returns CW_FAILURE, with errno set to EDEADLK if SIGALRM is blocked. testedin::test_keyer() \param key \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_wait_for_element_internal(volatile cw_key_t *key) { if (cw_sigalrm_is_blocked_internal()) { /* no point in waiting for event, when signal controlling the event is blocked */ errno = EDEADLK; return CW_FAILURE; } /* First wait for the state to move to idle (or just do nothing if it's not), or to one of the after- states. */ while (key->ik.graph_state != KS_IDLE && key->ik.graph_state != KS_AFTER_DOT_A && key->ik.graph_state != KS_AFTER_DOT_B && key->ik.graph_state != KS_AFTER_DASH_A && key->ik.graph_state != KS_AFTER_DASH_B) { cw_signal_wait_internal(); } /* Now wait for the state to move to idle (unless it is, or was, already), or one of the in- states, at which point we know we're actually at the end of the element we were in when we entered this routine. */ while (key->ik.graph_state != KS_IDLE && key->ik.graph_state != KS_IN_DOT_A && key->ik.graph_state != KS_IN_DOT_B && key->ik.graph_state != KS_IN_DASH_A && key->ik.graph_state != KS_IN_DASH_B) { cw_signal_wait_internal(); } return CW_SUCCESS; } /** \brief Wait for the current keyer cycle to complete The routine returns CW_SUCCESS on success. On error, it returns CW_FAILURE, with errno set to EDEADLK if SIGALRM is blocked or if either paddle state is true. \param key \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_ik_wait_for_keyer_internal(volatile cw_key_t *key) { if (cw_sigalrm_is_blocked_internal()) { /* no point in waiting for event, when signal controlling the event is blocked */ errno = EDEADLK; return CW_FAILURE; } /* Check that neither paddle is true; if either is, then the signal cycle is going to continue forever, and we'll never return from this routine. */ if (key->ik.dot_paddle || key->ik.dash_paddle) { errno = EDEADLK; return CW_FAILURE; } /* Wait for the keyer state to go idle. */ while (key->ik.graph_state != KS_IDLE) { cw_signal_wait_internal(); } return CW_SUCCESS; } /** \brief Reset iambic keyer data Clear all latches and paddle states of iambic keyer, return to Curtis 8044 Keyer mode A, and return to silence. This function is suitable for calling from an application exit handler. \param key */ void cw_key_ik_reset_internal(volatile cw_key_t *key) { key->ik.dot_paddle = false; key->ik.dash_paddle = false; key->ik.dot_latch = false; key->ik.dash_latch = false; key->ik.curtis_b_latch = false; key->ik.curtis_mode_b = false; cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYER_STATES, CW_DEBUG_DEBUG, "libcw/ik: keyer state %s -> KS_IDLE", cw_iambic_keyer_states[key->ik.graph_state]); key->ik.graph_state = KS_IDLE; /* Silence sound and stop any background soundcard tone generation. */ cw_gen_silence_internal(key->gen); cw_finalization_schedule_internal(); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_KEYER_STATES, CW_DEBUG_DEBUG, "libcw/ik: keyer state -> %s (reset)", cw_iambic_keyer_states[key->ik.graph_state]); return; } /** Iambic keyer has an internal timer variable. On some occasions the variable needs to be updated. I thought that it needs to be updated by client application on key paddle events, but it turns out that it should be also updated in generator dequeue code. Not sure why. \param key - keyer with timer to be updated \param usecs - amount of increase (usually length of a tone) */ void cw_key_ik_increment_timer_internal(volatile cw_key_t *key, int usecs) { if (!key) { /* This function is called from generator thread. It is perfectly valid situation that for some applications a generator exists, but a keyer does not exist. Silently accept this situation. */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_INTERNAL, CW_DEBUG_DEBUG, "libcw/ik: NULL key, silently accepting"); return; } if (key->ik.graph_state != KS_IDLE) { /* Update timestamp that clocks iambic keyer with current time interval. This must be done only when iambic keyer is in use. Calling the code when straight key is in use will cause problems, so don't clock a straight key with this. */ if (key->ik.timer) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_KEYING, CW_DEBUG_INFO, "libcw/ik: incrementing timer by %d [us]\n", usecs); key->ik.timer->tv_usec += usecs % CW_USECS_PER_SEC; key->ik.timer->tv_sec += usecs / CW_USECS_PER_SEC + key->ik.timer->tv_usec / CW_USECS_PER_SEC; key->ik.timer->tv_usec %= CW_USECS_PER_SEC; } } return; } /* ******************************************************************** */ /* Section:Straight key */ /* ******************************************************************** */ /** \brief Inform the library that the straight key has changed state This routine returns CW_SUCCESS on success. On error, it returns CW_FAILURE, with errno set to EBUSY if the tone queue or iambic keyer are using the sound card, console speaker, or keying control system. If \p key_state indicates no change of state, the call is ignored. \p key_state may be either CW_KEY_STATE_OPEN (false) or CW_KEY_STATE_CLOSED (true). \param key \param key_state - state of straight key \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_key_sk_notify_event_internal(volatile cw_key_t *key, int key_state) { #if 0 /* This is disabled, but I'm not sure why. */ /* If the tone queue or the keyer are busy, we can't use the sound card, console sounder, or the key control system. */ if (cw_tq_is_busy_internal(key->gen->tq) || cw_key_ik_is_busy_internal(key)) { errno = EBUSY; return CW_FAILURE; } #endif /* Do tones and keying, and set up timeouts and soundcard activities to match the new key state. */ int rv = cw_key_sk_enqueue_symbol_internal(key, key_state); #if 0 /* Disabled since we don't do finalization anymore. */ if (key->sk.key_value == CW_KEY_STATE_OPEN) { /* Indicate that we have finished with timeouts, and also with the soundcard too. There's no way of knowing when straight keying is completed, so the only thing we can do here is to schedule release on each key up event. */ cw_finalization_schedule_internal(); } #endif return rv; } /** \brief Get saved state of straight key Returns the current saved state of the straight key. \param key \return CW_KEY_STATE_CLOSED (true) if the key is down \return CW_KEY_STATE_OPEN (false) if the key up */ int cw_key_sk_get_state_internal(volatile cw_key_t *key) { return key->sk.key_value; } /** \brief Check if the straight key is busy This routine is just a pseudonym for cw_key_sk_get_state_internal(), and exists to fill a hole in the API naming conventions. TODO: verify if this function is needed in new API. \param key \return true if the straight key is busy \return false if the straight key is not busy */ bool cw_key_sk_is_busy_internal(volatile cw_key_t *key) { return key->sk.key_value; } /** \brief Clear the straight key state, and return to silence This function is suitable for calling from an application exit handler. \param key */ void cw_key_sk_reset_internal(volatile cw_key_t *key) { key->sk.key_value = CW_KEY_STATE_OPEN; /* Silence sound and stop any background soundcard tone generation. */ cw_gen_silence_internal(key->gen); //cw_finalization_schedule_internal(); cw_debug_msg ((&cw_debug_object), CW_DEBUG_STRAIGHT_KEY_STATES, CW_DEBUG_INFO, "libcw/sk: key state ->UP (reset)"); return; } unixcw-3.4.2/src/libcw/libcw_oss.h0000644000175000017500000000041712365202426016707 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_OSS #define H_LIBCW_OSS #include "libcw_gen.h" int cw_oss_configure(cw_gen_t *gen, const char *device); #endif /* #ifndef H_LIBCW_OSS */ unixcw-3.4.2/src/libcw/libcw_test_internal.c0000644000175000017500000000714012500367422020750 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include #include #include /* gettimeofday() */ #include "libcw.h" #include "libcw_gen.h" #include "libcw_rec.h" #include "libcw_debug.h" #include "libcw_data.h" #include "libcw_tq.h" #include "libcw_utils.h" #include "libcw_null.h" #include "libcw_console.h" #include "libcw_oss.h" extern cw_debug_t cw_debug_object; /* ******************************************************************** */ /* Unit tests for internal functions */ /* ******************************************************************** */ /* Unit tests for internal functions (and also some public functions) defined in libcw.c. See also libcw_test_public.c and libcw_test_simple_gen.c. */ #include #include typedef unsigned int (*cw_test_function_t)(void); static cw_test_function_t cw_unit_tests[] = { /* cw_data module */ test_cw_representation_to_hash_internal, test_cw_representation_to_character_internal, test_cw_representation_to_character_internal_speed, test_character_lookups_internal, test_prosign_lookups_internal, test_phonetic_lookups_internal, test_validate_character_and_string_internal, test_validate_representation_internal, /* cw_tq module */ test_cw_tq_new_delete_internal, test_cw_tq_get_capacity_internal, test_cw_tq_prev_index_internal, test_cw_tq_next_index_internal, test_cw_tq_length_internal, test_cw_tq_enqueue_dequeue_internal, test_cw_tq_enqueue_internal_2, test_cw_tq_is_full_internal, test_cw_tq_test_capacity_1, test_cw_tq_test_capacity_2, /* cw_gen module */ test_cw_generator_set_tone_slope, test_cw_gen_tone_slope_shape_enums, test_cw_gen_new_delete_internal, test_cw_gen_forever_internal, /* cw_utils module */ test_cw_timestamp_compare_internal, test_cw_timestamp_validate_internal, test_cw_usecs_to_timespec_internal, test_cw_version_internal, test_cw_license_internal, test_cw_get_x_limits_internal, /* cw_rec module */ test_cw_rec_identify_mark_internal, test_cw_rec_with_base_data_fixed, test_cw_rec_with_random_data_fixed, test_cw_rec_with_random_data_adaptive, test_cw_get_receive_parameters, /* cw_debug module */ test_cw_debug_flags_internal, NULL }; int main(void) { fprintf(stderr, "libcw unit tests\n\n"); struct timeval tv; gettimeofday(&tv, NULL); srand((int) tv.tv_usec); //cw_debug_set_flags(&cw_debug_object, CW_DEBUG_RECEIVE_STATES); //cw_debug_object.level = CW_DEBUG_INFO; int i = 0; while (cw_unit_tests[i]) { cw_unit_tests[i](); i++; } /* "make check" facility requires this message to be printed on stdout; don't localize it */ fprintf(stdout, "\nlibcw: test result: success\n\n"); return 0; } unixcw-3.4.2/src/libcw/libcw_data.c0000644000175000017500000014342612475676637017044 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_data.c \brief Characters, representations, lookup and validation functions. The only hard data stored by libcw library seems to be: \li characters and their representations \li procedural signals \li phonetics These three groups of data, collected in three separate tables, are defined in this file, together with lookup functions and other related utility functions. Unit test functions for this code are at the end of the file. */ #include #include /* UCHAR_MAX */ #include #include #include #include #include "libcw.h" #include "libcw_debug.h" #include "libcw_data.h" #include "libcw_test.h" extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; /* Morse code characters table. This table allows lookup of the Morse representation (shape) of a given alphanumeric character. Representations (shapes) are held as a string, with "-" representing dash, and "." representing dot. The table ends with a NULL entry. Notice that ASCII characters are stored as uppercase characters. */ static const cw_entry_t CW_TABLE[] = { /* ASCII 7bit letters */ {'A', ".-" }, {'B', "-..."}, {'C', "-.-."}, {'D', "-.." }, {'E', "." }, {'F', "..-."}, {'G', "--." }, {'H', "...."}, {'I', ".." }, {'J', ".---"}, {'K', "-.-" }, {'L', ".-.."}, {'M', "--" }, {'N', "-." }, {'O', "---" }, {'P', ".--."}, {'Q', "--.-"}, {'R', ".-." }, {'S', "..." }, {'T', "-" }, {'U', "..-" }, {'V', "...-"}, {'W', ".--" }, {'X', "-..-"}, {'Y', "-.--"}, {'Z', "--.."}, /* Numerals */ {'0', "-----"}, {'1', ".----"}, {'2', "..---"}, {'3', "...--"}, {'4', "....-"}, {'5', "....."}, {'6', "-...."}, {'7', "--..."}, {'8', "---.."}, {'9', "----."}, /* Punctuation */ {'"', ".-..-."}, {'\'', ".----."}, {'$', "...-..-"}, {'(', "-.--." }, {')', "-.--.-"}, {'+', ".-.-." }, {',', "--..--"}, {'-', "-....-"}, {'.', ".-.-.-" }, {'/', "-..-." }, {':', "---..."}, {';', "-.-.-." }, {'=', "-...-" }, {'?', "..--.."}, {'_', "..--.-" }, {'@', ".--.-."}, /* ISO 8859-1 accented characters */ {'\334', "..--" }, /* U with diaeresis */ {'\304', ".-.-" }, /* A with diaeresis */ {'\307', "-.-.."}, /* C with cedilla */ {'\326', "---." }, /* O with diaeresis */ {'\311', "..-.."}, /* E with acute */ {'\310', ".-..-"}, /* E with grave */ {'\300', ".--.-"}, /* A with grave */ {'\321', "--.--"}, /* N with tilde */ /* ISO 8859-2 accented characters */ {'\252', "----" }, /* S with cedilla */ {'\256', "--..-"}, /* Z with dot above */ /* Non-standard procedural signal extensions to standard CW characters. */ {'<', "...-.-" }, /* VA/SK, end of work */ {'>', "-...-.-"}, /* BK, break */ {'!', "...-." }, /* SN, understood */ {'&', ".-..." }, /* AS, wait */ {'^', "-.-.-" }, /* KA, starting signal */ {'~', ".-.-.." }, /* AL, paragraph */ /* Guard. */ {0, NULL} }; /** \brief Return the number of characters present in character lookup table Return the number of characters that are known to libcw. The number includes: \li ASCII 7bit letters, \li numerals, \li punctuation, \li ISO 8859-1 accented characters, \li ISO 8859-2 accented characters, \li non-standard procedural signal extensions to standard CW characters. testedin::test_character_lookups_internal() \return number of characters known to libcw */ int cw_get_character_count(void) { static int character_count = 0; if (character_count == 0) { for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { character_count++; } } return character_count; } /** \brief Get list of characters present in character lookup table Function provides a string containing all of the characters represented in library's lookup table. The list includes: \li ASCII 7bit letters, \li numerals, \li punctuation, \li ISO 8859-1 accented characters, \li ISO 8859-2 accented characters, \li non-standard procedural signal extensions to standard CW characters. \p list should be allocated and managed by caller. The length of \p list must be at least one greater than the number of characters represented in the character lookup table, returned by cw_get_character_count(). testedin::test_character_lookups_internal() \param list - pointer to space to be filled by function */ void cw_list_characters(char *list) { cw_assert (list, "Output pointer is null"); /* Append each table character to the output string. */ int i = 0; for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { list[i++] = cw_entry->character; } list[i] = '\0'; return; } /** \brief Get length of the longest representation Function returns the string length of the longest representation in the character lookup table. testedin::test_character_lookups_internal() \return a positive number - length of the longest representation */ int cw_get_maximum_representation_length(void) { static int maximum_length = 0; if (maximum_length == 0) { /* Traverse the main lookup table, finding the longest representation. */ for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { int length = (int) strlen (cw_entry->representation); if (length > maximum_length) { maximum_length = length; } } } return maximum_length; } /** \brief Return representation of given character Look up the given character \p c, and return the representation of that character. Return NULL if there is no representation for the given character. Otherwise return pointer to static string with representation of character. The returned pointer is owned and managed by library. \param c - character to look up \return pointer to string with representation of character on success \return NULL on failure (when \p c has no representation) */ const char *cw_character_to_representation_internal(int c) { static const cw_entry_t *lookup[UCHAR_MAX]; /* Fast lookup table */ static bool is_initialized = false; /* If this is the first call, set up the fast lookup table to give direct access to the CW table for a given character. */ if (!is_initialized) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_LOOKUPS, CW_DEBUG_INFO, "libcw: initialize fast lookup table"); for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { lookup[(unsigned char) cw_entry->character] = cw_entry; } is_initialized = true; } /* There is no differentiation in the lookup and representation table between upper and lower case characters; everything is held as uppercase. So before we do the lookup, we convert to ensure that both cases work. */ c = toupper(c); /* Now use the table to lookup the table entry. Unknown characters return NULL, courtesy of the fact that explicitly uninitialized static variables are initialized to zero, so lookup[x] is NULL if it's not assigned to in the above loop. */ const cw_entry_t *cw_entry = lookup[(unsigned char) c]; if (cw_debug_has_flag((&cw_debug_object), CW_DEBUG_LOOKUPS)) { if (cw_entry) { fprintf(stderr, "libcw: lookup '%c' returned <'%c':\"%s\">\n", c, cw_entry->character, cw_entry->representation); } else if (isprint(c)) { fprintf(stderr, "libcw: lookup '%c' found nothing\n", c); } else { fprintf(stderr, "libcw: lookup 0x%02x found nothing\n", (unsigned char) c); } } return cw_entry ? cw_entry->representation : NULL; } /** \brief Get representation of a given character The function is depreciated, use cw_character_to_representation() instead. Return the string representation (shape) of a given Morse code character \p c. The routine returns CW_SUCCESS on success, and fills in the string pointer (\p representation) passed in. On failure, it returns CW_FAILURE and sets errno to ENOENT, indicating that the character \p c could not be found. The length of \p representation buffer must be at least one greater than the length of longest representation held in the character lookup table. The largest value of length is returned by cw_get_maximum_representation_length(). \param c - character to look up \param representation - pointer to space for representation of character \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_lookup_character(char c, char *representation) { /* Lookup the character, and if found, return the string. */ const char *retval = cw_character_to_representation_internal(c); if (retval) { if (representation) { strcpy(representation, retval); } return CW_SUCCESS; } /* Failed to find the requested character. */ errno = ENOENT; return CW_FAILURE; } /** \brief Get representation of a given character On success return representation of a given character. Returned pointer is owned by caller of the function. On failure function returns NULL and sets errno: ENOENT indicates that the character could not be found. ENOMEM indicates that character has been found, but function failed to strdup() representation. testedin::test_character_lookups_internal() \param c - character to look up \return pointer to freshly allocated representation on success \return NULL on failure */ char *cw_character_to_representation(int c) { /* Lookup the character, and if found, return the string */ const char *representation = cw_character_to_representation_internal(c); if (representation) { char *r = strdup(representation); if (r) { return r; } else { errno = ENOMEM; return NULL; } } else { /* Failed to find the requested character */ errno = ENOENT; return NULL; } } /** \brief Return a hash value of a character representation Return a hash value, in the range 2-255, for a character's \p representation. The routine returns 0 if no valid hash could be made from the \p representation string. This hash algorithm is designed ONLY for valid CW representations; that is, strings composed of only "." and "-", and in this case, strings no longer than seven characters. TODO: create unit test that verifies that the longest representation recognized by libcw is in fact no longer than 7. TODO: consider creating an implementation that has the limit larger than 7. Then perhaps make the type of returned value to be uint16_t. The algorithm simply turns the representation string into a number, a "bitmask", based on pattern of "." and "-" in \p representation. The first bit set in the mask indicates the start of data (hence the 7-character limit) - it is not the data itself. This mask is viewable as an integer in the range 2 (".") to 255 ("-------"), and can be used as an index into a fast lookup array. testedin::test_cw_representation_to_hash_internal() \param representation - string representing a character \return non-zero value of hash of valid representation (in range 2-255) \return zero for invalid representation */ unsigned int cw_representation_to_hash_internal(const char *representation) { /* Our algorithm can handle only 7 characters of representation. And we insist on there being at least one character, too. */ int length = (int) strlen (representation); if (length > CHAR_BIT - 1 || length < 1) { return 0; } /* Build up the hash based on the dots and dashes; start at 1, the sentinel * (start) bit. */ unsigned int hash = 1; for (int i = 0; i < length; i++) { /* Left-shift everything so far. */ hash <<= 1; if (representation[i] == CW_DASH_REPRESENTATION) { /* Dash is represented by '1' in hash. */ hash |= 1; } else if (representation[i] == CW_DOT_REPRESENTATION) { /* Dot is represented by '0' in hash (we don't have to do anything at this point, the zero is already in the hash). */ ; } else { /* Invalid element in representation string. */ return 0; } } return hash; } /** \brief Return character corresponding to given representation Look up the given \p representation, and return the character that it represents. testedin::test_cw_representation_to_character_internal() \param representation - representation of a character to look up FIXME: function should be able to return zero as non-error value (?). \return zero if there is no character for given representation \return non-zero character corresponding to given representation otherwise */ int cw_representation_to_character_internal(const char *representation) { static const cw_entry_t *lookup[UCHAR_MAX]; /* Fast lookup table */ static bool is_complete = true; /* Set to false if there are any lookup table entries not in the fast lookup table */ static bool is_initialized = false; /* If this is the first call, set up the fast lookup table to give direct access to the CW table for a hashed representation. */ if (!is_initialized) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_LOOKUPS, CW_DEBUG_INFO, "libcw: initialize hash lookup table"); is_complete = cw_representation_lookup_init_internal(lookup); is_initialized = true; } /* Hash the representation to get an index for the fast lookup. */ unsigned int hash = cw_representation_to_hash_internal(representation); const cw_entry_t *cw_entry = NULL; /* If the hashed lookup table is complete, we can simply believe any hash value that came back. That is, we just use what is at the index "hash", since this is either the entry we want, or NULL. */ if (is_complete) { cw_entry = lookup[hash]; } else { /* Impossible, since test_cw_representation_to_hash_internal() passes without problems for all valid representations. Debug message is already displayed in cw_representation_lookup_init_internal(). */ /* The lookup table is incomplete, but it doesn't have to be that we are missing entry for this particular hash. Try to find the entry in lookup table anyway, maybe it exists. */ if (hash && lookup[hash] && lookup[hash]->representation && strcmp(lookup[hash]->representation, representation) == 0) { /* Found it in an incomplete table. */ cw_entry = lookup[hash]; } else { /* We have no choice but to search the table entry by entry, sequentially, from top to bottom. */ for (cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { if (strcmp(cw_entry->representation, representation) == 0) { break; } } /* If we got to the end of the table, prepare to return zero. */ cw_entry = cw_entry->character ? cw_entry : NULL; } } if (cw_debug_has_flag((&cw_debug_object), CW_DEBUG_LOOKUPS)) { if (cw_entry) { fprintf(stderr, "libcw: lookup [0x%02x]'%s' returned <'%c':\"%s\">\n", hash, representation, cw_entry->character, cw_entry->representation); } else { fprintf(stderr, "libcw: lookup [0x%02x]'%s' found nothing\n", hash, representation); } } return cw_entry ? cw_entry->character : 0; } /** \brief Return character corresponding to given representation Look up the given \p representation, and return the character that it represents. In contrast to cw_representation_to_character_internal(), this function doesn't use fast lookup table. It directly traverses the main character/representation table and searches for a character. The function shouldn't be used in production code. Its first purpose is to verify correctness of cw_representation_to_character_internal() (since this direct method is simpler and, well, direct) in a unit test function. The second purpose is to compare time of execution of the two functions: direct and with lookup table, and see what are the speed advantages of using function with lookup table. \param representation - representation of a character to look up FIXME: function should be able to return zero as non-error value (?). \return zero if there is no character for given representation \return non-zero character corresponding to given representation otherwise */ int cw_representation_to_character_direct_internal(const char *representation) { /* Search the table entry by entry, sequentially, from top to bottom. */ const cw_entry_t *cw_entry = NULL; for (cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { if (strcmp(cw_entry->representation, representation) == 0) { break; } } /* If we got to the end of the table, prepare to return zero. */ cw_entry = cw_entry->character ? cw_entry : NULL; return cw_entry ? cw_entry->character : 0; } /** \brief Initialize representation lookup table Initialize \p lookup table with values from CW_TABLE (of type cw_entry_t). The table is indexed with hashed representations of cw_entry_t->representation strings. \p lookup table must be large enough to store all entries, caller must make sure that the condition is met. On failure function returns CW_FAILURE. On success the function returns CW_SUCCESS. Successful execution of the function is when all representations from CW_TABLE have valid hashes, and all entries from CW_TABLE have been put into \p lookup. First condition of function's success, mentioned above, should be always true because the CW_TABLE has been created once and it doesn't change, and all representations in the table are valid. Second condition of function's success, mentioned above, should be also always true because first condition is always true. The initialization may fail under one condition: if the lookup functions should operate on non-standard character table, other than CW_TABLE. For now it's impossible, because there is no way for client code to provide its own table of CW characters. \param lookup - lookup table to be initialized \return CW_SUCCESS on success \return CW_FAILURE otherwise */ int cw_representation_lookup_init_internal(const cw_entry_t *lookup[]) { /* For each main table entry, create a hash entry. If the hashing of any entry fails, note that the table is not complete and ignore that entry for now (for the current lookup table, this should not happen). The hashed table speeds up lookups of representations by a factor of 5-10. NOTICE: Notice that the lookup table will be marked as incomplete only if one or more representations in CW_TABLE aren't valid (i.e. they are made of anything more than '.' or '-'). This wouldn't be a logic error, this would be an error with invalid input. Such invalid input shouldn't happen in properly built characters table. So perhaps returning "false" tells us more about input CW_TABLE than about lookup table. Other possibility to consider is that "is_complete = false" when length of representation is longer than 7 dots/dashes. There is an assumption that no representation in input CW_TABLE is longer than 7 dots/dashes. */ bool is_complete = true; for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { unsigned int hash = cw_representation_to_hash_internal(cw_entry->representation); if (hash) { lookup[hash] = cw_entry; } else { is_complete = false; } } if (!is_complete) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_LOOKUPS, CW_DEBUG_WARNING, "libcw: hash lookup table incomplete"); } return is_complete ? CW_SUCCESS : CW_FAILURE; } /** \brief Check if representation of a character is valid This function is depreciated, use cw_representation_is_valid() instead. Check that the given string is a valid Morse representation. A valid string is one composed of only "." and "-" characters. If representation is invalid, function returns CW_FAILURE and sets errno to EINVAL. \param representation - representation of a character to check \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_check_representation(const char *representation) { bool v = cw_representation_is_valid(representation); return v ? CW_SUCCESS : CW_FAILURE; } /** \brief Check if representation of a character is valid Check that the given string is a valid Morse representation. A valid string is one composed of only "." and "-" characters. This means that the function checks only if representation is error-free, and not whether the representation represents existing/defined character. If representation is invalid, function returns false and sets errno to EINVAL. testedin::test_validate_representation_internal() \param representation - representation of a character to check \return true on success \return false on failure */ bool cw_representation_is_valid(const char *representation) { /* Check the characters in representation. */ for (int i = 0; representation[i]; i++) { if (representation[i] != CW_DOT_REPRESENTATION && representation[i] != CW_DASH_REPRESENTATION) { errno = EINVAL; return false; } } return true; } /** \brief Get the character represented by a given Morse representation This function is depreciated, use cw_representation_to_character() instead. Function checks \p representation, and if it is valid and represents a known character, function returns CW_SUCCESS. Additionally, if \p c is non-NULL, function puts the looked up character in \p c. \p c should be allocated by caller. Function assumes that \p c being NULL pointer is a valid situation, and can return CW_SUCCESS in such situation. On error, function returns CW_FAILURE. errno is set to EINVAL if any character of the representation is invalid, or ENOENT to indicate that the character represented by \p representation could not be found. \param representation - representation of a character to look up \param c - location where to put looked up character \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_lookup_representation(const char *representation, char *c) { /* Check the characters in representation. */ if (!cw_representation_is_valid(representation)) { errno = EINVAL; return CW_FAILURE; } /* Lookup the representation, and if found, return the character. */ char character = cw_representation_to_character_internal(representation); if (character) { if (c) { *c = character; } return CW_SUCCESS; } /* Failed to find the requested representation. */ errno = ENOENT; return CW_FAILURE; } /** \brief Return the character represented by a given Morse representation Function checks \p representation, and if it is valid and represents a known character, function returns the character (a non-zero value). On error, function returns zero. errno is set to EINVAL if any character of the representation is invalid, or ENOENT to indicate that the character represented by \p representation could not be found. testedin::test_character_lookups_internal() \param representation - representation of a character to look up \return non-zero character on success \return zero on failure */ int cw_representation_to_character(const char *representation) { /* Check the characters in representation. */ if (!cw_representation_is_valid(representation)) { errno = EINVAL; return 0; } /* Lookup the representation, and if found, return the character. */ int c = cw_representation_to_character_internal(representation); if (c) { return c; } else { /* Failed to find the requested representation. */ errno = ENOENT; return 0; } } /* ******************************************************************** */ /* Section:Extended Morse code data and lookup (procedural signals) */ /* ******************************************************************** */ /* Ancillary procedural signals table. This table maps procedural signal characters in the main table to their expansions, along with a flag noting if the character is usually expanded for display. */ typedef struct { const char character; /* Character represented */ const char *const expansion; /* Procedural expansion of the character */ const bool is_usually_expanded; /* If expanded display is usual */ } cw_prosign_entry_t; static const cw_prosign_entry_t CW_PROSIGN_TABLE[] = { /* Standard procedural signals */ {'"', "AF", false}, {'\'', "WG", false}, {'$', "SX", false}, {'(', "KN", false}, {')', "KK", false}, {'+', "AR", false}, {',', "MIM", false}, {'-', "DU", false}, {'.', "AAA", false}, {'/', "DN", false}, {':', "OS", false}, {';', "KR", false}, {'=', "BT", false}, {'?', "IMI", false}, {'_', "IQ", false}, {'@', "AC", false}, /* Non-standard procedural signal extensions to standard CW characters. */ {'<', "VA", true}, /* VA/SK, end of work */ {'>', "BK", true}, /* BK, break */ {'!', "SN", true}, /* SN, understood */ {'&', "AS", true}, /* AS, wait */ {'^', "KA", true}, /* KA, starting signal */ {'~', "AL", true}, /* AL, paragraph */ /* Sentinel end of table value */ {0, NULL, false} }; /** \brief Get number of procedural signals testedin::test_prosign_lookups_internal() \return the number of characters represented in the procedural signal expansion lookup table */ int cw_get_procedural_character_count(void) { static int character_count = 0; if (character_count == 0) { for (const cw_prosign_entry_t *e = CW_PROSIGN_TABLE; e->character; e++) { character_count++; } } return character_count; } /** \brief Get list of characters for which procedural expansion is available Function returns into \p list a string containing all of the Morse characters for which procedural expansion is available. The length of \p list must be at least by one greater than the number of characters represented in the procedural signal expansion lookup table, returned by cw_get_procedural_character_count(). \p list is managed by caller testedin::test_prosign_lookups_internal() \param list - space for returned characters */ void cw_list_procedural_characters(char *list) { /* Append each table character to the output string. */ int i = 0; for (const cw_prosign_entry_t *e = CW_PROSIGN_TABLE; e->character; e++) { list[i++] = e->character; } list[i] = '\0'; return; } /** \brief Get length of the longest procedural expansion Function returns the string length of the longest expansion in the procedural signal expansion table. testedin::test_prosign_lookups_internal() \return length */ int cw_get_maximum_procedural_expansion_length(void) { static size_t maximum_length = 0; if (maximum_length == 0) { /* Traverse the main lookup table, finding the longest. */ for (const cw_prosign_entry_t *e = CW_PROSIGN_TABLE; e->character; e++) { size_t length = strlen(e->expansion); if (length > maximum_length) { maximum_length = length; } } } return (int) maximum_length; } /** \brief Return information related to a procedural character Function looks up the given procedural character \p c, and returns the expansion of that procedural character, with a display hint in \p is_usually_expanded. Pointer returned by the function is owned and managed by library. \p is_usually_expanded pointer is owned by client code. \param c - character to look up \param is_usually_expanded - output, display hint \return expansion of input character on success \return NULL if there is no table entry for the given character */ const char *cw_lookup_procedural_character_internal(int c, bool *is_usually_expanded) { static const cw_prosign_entry_t *lookup[UCHAR_MAX]; /* Fast lookup table */ static bool is_initialized = false; /* If this is the first call, set up the fast lookup table to give direct access to the procedural expansions table for a given character. */ if (!is_initialized) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_LOOKUPS, CW_DEBUG_INFO, "libcw: initialize prosign fast lookup table"); for (const cw_prosign_entry_t *e = CW_PROSIGN_TABLE; e->character; e++) { lookup[(unsigned char) e->character] = e; is_initialized = true; } } /* Lookup the procedural signal table entry. Unknown characters return NULL. All procedural signals are non-alphabetical, so no need to use any uppercase coercion here. */ const cw_prosign_entry_t *cw_prosign = lookup[(unsigned char) c]; if (cw_debug_has_flag((&cw_debug_object), CW_DEBUG_LOOKUPS)) { if (cw_prosign) { fprintf(stderr, "libcw: prosign lookup '%c' returned <'%c':\"%s\":%d>\n", c, cw_prosign->character, cw_prosign->expansion, cw_prosign->is_usually_expanded); } else if (isprint(c)) { fprintf(stderr, "libcw: prosign lookup '%c' found nothing\n", c); } else { fprintf(stderr, "libcw: prosign lookup 0x%02x found nothing\n", (unsigned char) c); } } /* If found, return any display hint and the expansion; otherwise, NULL. */ if (cw_prosign) { *is_usually_expanded = cw_prosign->is_usually_expanded; return cw_prosign->expansion; } else { return NULL; } } /** \brief Get the string expansion of a given Morse code procedural signal character On success the function - fills \p expansion with the string expansion of a given Morse code procedural signal character \p c; - sets is_usuall_expanded to true as a display hint for the caller; - returns CW_SUCCESS. Both \p expansion and \p is_usually_expanded must be allocated and managed by caller. They can be NULL, then the function won't attempt to use them. The length of \p expansion must be at least by one greater than the longest expansion held in the procedural signal character lookup table, as returned by cw_get_maximum_procedural_expansion_length(). If procedural signal character \p c cannot be found, the function sets errno to ENOENT and returns CW_FAILURE. testedin::test_prosign_lookups_internal() \param c - character to look up \param expansion - output, space to fill with expansion of the character \param is_usually_expanded - visual hint \return CW_FAILURE on failure (errno is set to ENOENT) \return CW_SUCCESS on success */ int cw_lookup_procedural_character(char c, char *expansion, int *is_usually_expanded) { bool is_expanded; /* Lookup, and if found, return the string and display hint. */ const char *retval = cw_lookup_procedural_character_internal(c, &is_expanded); if (retval) { if (expansion) { strcpy(expansion, retval); } if (is_usually_expanded) { *is_usually_expanded = is_expanded; } return CW_SUCCESS; } /* Failed to find the requested procedural signal character. */ errno = ENOENT; return CW_FAILURE; } /* ******************************************************************** */ /* Section:Phonetic alphabet */ /* ******************************************************************** */ /* Phonetics table. Not really CW, but it might be handy to have. The table contains ITU/NATO phonetics. */ static const char *const CW_PHONETICS[27] = { "Alfa", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu", NULL /* guard */ }; /** \brief Get maximum length of a phonetic testedin::test_phonetic_lookups_internal() \return the string length of the longest phonetic in the phonetics lookup table */ int cw_get_maximum_phonetic_length(void) { static size_t maximum_length = 0; if (maximum_length == 0) { /* Traverse the main lookup table, finding the longest. */ for (int phonetic = 0; CW_PHONETICS[phonetic]; phonetic++) { size_t length = strlen(CW_PHONETICS[phonetic]); if (length > maximum_length) { maximum_length = length; } } } return (int) maximum_length; } /** \brief Get the phonetic of a given character On success the routine fills in the string pointer passed in with the phonetic of given character \p c. The length of phonetic must be at least one greater than the longest phonetic held in the phonetic lookup table, as returned by cw_get_maximum_phonetic_length(). If character cannot be found, the function sets errno to ENOENT. testedin::test_phonetic_lookups_internal() \param c - character to look up \param phonetic - output, space for phonetic of a character \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_lookup_phonetic(char c, char *phonetic) { /* Coerce to uppercase, and verify the input argument. */ c = toupper(c); if (c >= 'A' && c <= 'Z') { if (phonetic) { strcpy(phonetic, CW_PHONETICS[c - 'A']); return CW_SUCCESS; } } /* No such phonetic. */ errno = ENOENT; return CW_FAILURE; } /** \brief Checks that the given character is validly sendable in Morse Function sets errno to ENOENT on failure. testedin::test_validate_character_and_string_internal() \param c - character to check \return CW_SUCCESS if character is valid \return CW_FAILURE if character is invalid */ bool cw_character_is_valid(char c) { /* If the character is the space special-case, or it is in the lookup table, return success. */ if (c == ' ' || cw_character_to_representation_internal(c)) { return CW_SUCCESS; } else { errno = ENOENT; return CW_FAILURE; } } int cw_check_character(char c) { return (int) cw_character_is_valid(c); } /** \brief Validate a string Check that each character in the given string is valid and can be sent by libcw as a Morse character. Function sets errno to EINVAL on failure testedin::test_validate_character_and_string_internal() \param string - string to check \return CW_SUCCESS on success \return CW_FAILURE on failure */ bool cw_string_is_valid(const char *string) { /* Check that each character in the string has a Morse representation, or - as a special case - is a space character. */ for (int i = 0; string[i] != '\0'; i++) { if (!(string[i] == ' ' || cw_character_to_representation_internal(string[i]))) { errno = EINVAL; return CW_FAILURE; } } return CW_SUCCESS; } int cw_check_string(const char *string) { return cw_string_is_valid(string); } /* Unit tests. */ #ifdef LIBCW_UNIT_TESTS #include /* free() */ #include "libcw_utils.h" #define REPRESENTATION_LEN 7 /* for maximum length of 7, there should be 254 items: 2^1 + 2^2 + 2^3 + ... + 2^7 */ #define REPRESENTATION_TABLE_SIZE ((2 << (REPRESENTATION_LEN + 1)) - 1) /** tests::cw_representation_to_hash_internal() The function builds every possible valid representation no longer than 7 chars, and then calculates a hash of the representation. Since a representation is valid, the tested function should calculate a valid hash. The function does not compare a representation and its hash to verify that patterns in representation and in hash match. TODO: add code that would compare the patterns of dots/dashes in representation against pattern of bits in hash. TODO: test calling the function with invalid representation. */ unsigned int test_cw_representation_to_hash_internal(void) { int p = fprintf(stdout, "libcw/data: cw_representation_to_hash_internal():"); /* Intended contents of input[] is something like that: input[0] = "." input[1] = "-" input[2] = ".." input[3] = "-." input[4] = ".-" input[5] = "--" input[6] = "..." input[7] = "-.." input[8] = ".-." input[9] = "--." input[10] = "..-" input[11] = "-.-" input[12] = ".--" input[13] = "---" . . . input[248] = ".-.----" input[249] = "--.----" input[250] = "..-----" input[251] = "-.-----" input[252] = ".------" input[253] = "-------" */ char input[REPRESENTATION_TABLE_SIZE][REPRESENTATION_LEN + 1]; /* build table of all valid representations ("valid" as in "build from dash and dot, no longer than REPRESENTATION_LEN"). */ long int rep = 0; for (unsigned int len = 1; len <= REPRESENTATION_LEN; len++) { /* Build representations of all lengths, starting from shortest (single dot or dash) and ending with the longest representations. */ unsigned int bit_vector_len = 2 << (len - 1); /* A representation of length "len" can have 2^len distinct values. The "for" loop that we are in iterates over these 2^len forms. */ for (unsigned int bit_vector = 0; bit_vector < bit_vector_len; bit_vector++) { /* Turn every '0' into dot, and every '1' into dash. */ for (unsigned int bit_pos = 0; bit_pos < len; bit_pos++) { unsigned int bit = bit_vector & (1 << bit_pos); input[rep][bit_pos] = bit ? '-' : '.'; // fprintf(stderr, "rep = %x, bit pos = %d, bit = %d\n", bit_vector, bit_pos, bit); } input[rep][len] = '\0'; //fprintf(stderr, "\ninput[%ld] = \"%s\"", rep, input[rep]); rep++; } } /* compute hash for every valid representation */ for (int i = 0; i < rep; i++) { unsigned int hash = cw_representation_to_hash_internal(input[i]); /* The function returns values in range 2 - 255. */ cw_assert (hash >= 2 && hash <= 255, "Invalid hash #%d: %u\n", i, hash) } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_representation_to_character_internal() */ unsigned int test_cw_representation_to_character_internal(void) { int p = fprintf(stdout, "libcw/data: cw_representation_to_character_internal():"); /* The test is performed by comparing results of function using fast lookup table, and function using direct lookup. */ for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { int lookup = cw_representation_to_character_internal(cw_entry->representation); int direct = cw_representation_to_character_direct_internal(cw_entry->representation); cw_assert (lookup == direct, "Failed for \"%s\"\n", cw_entry->representation); } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } unsigned int test_cw_representation_to_character_internal_speed(void) { int p = fprintf(stdout, "libcw/data: cw_representation_to_character() speed gain: "); /* Testing speed gain between function with direct lookup, and function with fast lookup table. Test is preformed by running each function N times with timer started before the N runs and stopped after N runs. */ int N = 1000; struct timeval start; struct timeval stop; gettimeofday(&start, NULL); for (int i = 0; i < N; i++) { for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { __attribute__((unused)) int rv = cw_representation_to_character_internal(cw_entry->representation); } } gettimeofday(&stop, NULL); int lookup = cw_timestamp_compare_internal(&start, &stop); gettimeofday(&start, NULL); for (int i = 0; i < N; i++) { for (const cw_entry_t *cw_entry = CW_TABLE; cw_entry->character; cw_entry++) { __attribute__((unused)) int rv = cw_representation_to_character_direct_internal(cw_entry->representation); } } gettimeofday(&stop, NULL); int direct = cw_timestamp_compare_internal(&start, &stop); p += fprintf(stdout, "%.2f", 1.0 * direct / lookup); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief Test functions looking up characters and their representation. tests::cw_get_character_count() tests::cw_list_characters() tests::cw_get_maximum_representation_length() tests::cw_character_to_representation() tests::cw_representation_to_character() */ unsigned int test_character_lookups_internal(void) { int count = 0; /* Number of characters. */ /* Test: get number of characters known to libcw. */ { /* libcw doesn't define a constant describing the number of known/supported/recognized characters, but there is a function calculating the number. One thing is certain: the number is larger than zero. */ count = cw_get_character_count(); cw_assert (count > 0, "Invalid number of characters: %d\n", count); int n = printf("libcw/data: cw_get_character_count(): %d:", count); CW_TEST_PRINT_TEST_RESULT (false, n); } char charlist[UCHAR_MAX + 1]; /* Test: get list of characters supported by libcw. */ { /* Of course length of the list must match the character count discovered above. */ cw_list_characters(charlist); printf("libcw/data: cw_list_characters():\n" "libcw/data: %s\n", charlist); size_t len = strlen(charlist); cw_assert (count == (int) len, "Number of characters don't match: %d != %zd\n", count, len); int n = printf("libcw/data: character count is correct (%d == %d)", count, (int) len); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: get maximum length of a representation (a string of dots/dashes). */ { /* This test is rather not related to any other, but since we are doing tests of other functions related to representations, let's do this as well. */ int rep_len = cw_get_maximum_representation_length(); cw_assert (rep_len > 0, "Maximum representation length invalid: %d\n", rep_len); int n = printf("libcw/data: cw_get_maximum_representation_length(): %d:", rep_len); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: character <--> representation lookup. */ { /* For each character, look up its representation, the look up each representation in the opposite direction. */ for (int i = 0; charlist[i] != '\0'; i++) { char *representation = cw_character_to_representation(charlist[i]); cw_assert (representation, "Failed to get a representation string (#%d)\n", i); /* Here we convert the representation into an output char 'c'. */ char c = cw_representation_to_character(representation); cw_assert (c, "Failed to get character for a representation (#%d)\n", i); /* Compare output char with input char. */ cw_assert (charlist[i] == c, "Two-way lookup failure for char '%c' (#%d)\n", c, i); free(representation); representation = NULL; } int n = printf("libcw/data: cw_character_to_representation():"); CW_TEST_PRINT_TEST_RESULT (false, n); n = printf("libcw/data: cw_representation_to_character():"); CW_TEST_PRINT_TEST_RESULT (false, n); n = printf("libcw/data: two-way lookup for character lookups:"); CW_TEST_PRINT_TEST_RESULT (false, n); } return 0; } /** \brief Test functions looking up procedural characters and their representation. tests::cw_get_procedural_character_count() tests::cw_list_procedural_characters() tests::cw_get_maximum_procedural_expansion_length() tests::cw_lookup_procedural_character() */ unsigned int test_prosign_lookups_internal(void) { /* Collect and print out a list of characters in the procedural signals expansion table. */ int count = 0; /* Number of prosigns. */ /* Test: get number of prosigns known to libcw. */ { count = cw_get_procedural_character_count(); cw_assert (count > 0, "Invalid number of procedural characters: %d\n", count); int n = printf("libcw/data: cw_get_procedural_character_count(): %d", count); CW_TEST_PRINT_TEST_RESULT (false, n); } char charlist[UCHAR_MAX + 1]; /* Test: get list of characters supported by libcw. */ { cw_list_procedural_characters(charlist); printf("libcw/data: cw_list_procedural_characters():\n" "libcw/data: %s\n", charlist); size_t len = strlen(charlist); cw_assert (count == (int) len, "Number of characters don't match: %d != %zd\n", count, len); int n = printf("libcw/data: procedural character count is correct (%d == %d)", count, (int) len); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: expansion length. */ { int exp_len = cw_get_maximum_procedural_expansion_length(); cw_assert (exp_len > 0, "Expansion length invalid: %d\n", exp_len); int n = printf("libcw/data: cw_get_maximum_procedural_expansion_length(): %d", exp_len); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: lookup. */ { /* For each procedural character, look up its expansion and check for two or three characters, and a true/false assignment to the display hint. */ for (int i = 0; charlist[i] != '\0'; i++) { char expansion[256]; int is_usually_expanded = -1; cw_assert (cw_lookup_procedural_character(charlist[i], expansion, &is_usually_expanded), "Lookup of character '%c' (#%d) failed", charlist[i], i); /* TODO: comment, please. */ if ((strlen(expansion) != 2 && strlen(expansion) != 3) || is_usually_expanded == -1) { cw_assert (0, "Expansion check failed\n"); } } int n = printf("libcw/data: cw_lookup_procedural_character():"); CW_TEST_PRINT_TEST_RESULT (false, n); n = printf("libcw/data: cw_lookup_procedural_() mapping:"); CW_TEST_PRINT_TEST_RESULT (false, n); } return 0; } /** tests::cw_get_maximum_phonetic_length() tests::cw_lookup_phonetic() */ unsigned int test_phonetic_lookups_internal(void) { /* For each ASCII character, look up its phonetic and check for a string that start with this character, if alphabetic, and false otherwise. */ /* Test: check that maximum phonetic length is larger than zero. */ { int len = cw_get_maximum_phonetic_length(); cw_assert (len > 0, "Maximum phonetic length invalid: %d\n", len); int n = printf("libcw/data: cw_get_maximum_phonetic_length(): %d", len); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: lookup of phonetic + reverse lookup. */ { for (int i = 0; i < UCHAR_MAX; i++) { char phonetic[256]; int status = cw_lookup_phonetic((char) i, phonetic); cw_assert (status == (bool) isalpha(i), "Lookup of phonetic '%c' (#%d) failed\n", (char ) i, i); if (status && (bool) isalpha(i)) { /* We have looked up a letter, it has a phonetic. Almost by definition, the first letter of phonetic should be the same as the looked up letter. */ cw_assert (phonetic[0] == toupper((char) i), "Reverse lookup failed for phonetic \"%s\" ('%c' / #%d)\n", phonetic, (char) i, i); } } int n = printf("libcw/data: cw_lookup_phonetic():"); CW_TEST_PRINT_TEST_RESULT (false, n); n = printf("libcw/data: reverse lookup for phonetic characters:"); CW_TEST_PRINT_TEST_RESULT (false, n); } return 0; } /** Validate all supported characters, first each characters individually, then as a string. tests::cw_character_is_valid() tests::cw_string_is_valid() */ unsigned int test_validate_character_and_string_internal(void) { /* Test: validation of individual characters. */ { char charlist[UCHAR_MAX + 1]; cw_list_characters(charlist); for (int i = 0; i < UCHAR_MAX; i++) { if (i == ' ' || (i != 0 && strchr(charlist, toupper(i)) != NULL)) { /* Here we have a valid character, that is recognized/supported as 'sendable' by libcw. cw_character_is_valid() should confirm it. */ cw_assert (cw_character_is_valid(i), "Valid character '%c' / #%d not recognized as valid\n", (char ) i, i); } else { /* The 'i' character is not recognized/supported by libcw. cw_character_is_valid() should return false to signify that the char is invalid. */ cw_assert (!cw_character_is_valid(i), "Invalid character '%c' / #%d recognized as valid\n", (char ) i, i); } } int n = printf("libcw/data: cw_character_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); n = printf("libcw/data: cw_character_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: validation of string as a whole. */ { /* Check the whole charlist item as a single string, then check a known invalid string. */ char charlist[UCHAR_MAX + 1]; cw_list_characters(charlist); cw_assert (cw_string_is_valid(charlist), "String with valid characters not recognized as valid\n"); int n = printf("libcw/data: cw_string_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); /* Test invalid string. */ cw_assert (!cw_string_is_valid("%INVALID%"), "String with invalid characters recognized as valid\n"); n = printf("libcw/data: cw_string_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); } return 0; } /** \brief Validating representations of characters tests::cw_representation_is_valid() */ unsigned int test_validate_representation_internal(void) { /* Test: validating valid representations. */ { cw_assert (cw_representation_is_valid(".-.-.-"), "Valid representation #1 not recognized as valid.\n"); cw_assert (cw_representation_is_valid(".-"), "Valid representation #2 not recognized as valid.\n"); cw_assert (cw_representation_is_valid("---"), "Valid representation #3 not recognized as valid.\n"); cw_assert (cw_representation_is_valid("...-"), "Valid representation #4 not recognized as valid.\n"); int n = printf("libcw/data: cw_representation_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); } /* Test: validating invalid representations. */ { cw_assert (!cw_representation_is_valid("INVALID"), "Invalid representation #1 not recognized as invalid.\n"); cw_assert (!cw_representation_is_valid("_._"), "Invalid representation #2 not recognized as invalid.\n"); cw_assert (!cw_representation_is_valid("-_-"), "Invalid representation #3 not recognized as invalid.\n"); int n = printf("libcw/data: cw_representation_is_valid():"); CW_TEST_PRINT_TEST_RESULT (false, n); } return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libsigs.awk0000644000175000017500000000236112451007007016704 0ustar acerionacerion#!/bin/awk -f # # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # # AWK script to produce function signatures from processed C source. # Pass output of libdoc.awk script to input of this script. # Initialize tags BEGIN { FUNCTION_TAG = "F" } # Handle lines containing function specification $1 == FUNCTION_TAG { sub(FUNCTION_TAG, "") sub(/^ */, "") gsub(/\t/, " ") printf(".BI \"%s\"\n.br\n", $0) next } # Tidy up on end of file END { print(".fi\n") } unixcw-3.4.2/src/libcw/include.awk0000644000175000017500000000317412451007215016677 0ustar acerionacerion#!/bin/awk -f # # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # # AWK script to replicate just the include() function of m4. This avoids # the need for a full m4 binary; overkill for what we really need. # # Catch 'include(...)' special lines; watch out, mawk doesn't support # POSIX character classes (http://ubuntuforums.org/archive/index.php/t-619985.html) /^include\([^\)]*\)$/ { # Find the name of the file being included. file = $0 sub(/^include\(/, "", file) sub(/\)$/, "", file) # Read in each line of the file, and print it out. while ((status=getline line 0) print line close (file) # Check for read or general getline error. if (status != 0) { printf ("Error reading file %s: %s\n", file, ERRNO) | "cat 1>&2" exit 1 } next } # Pass unchanged all lines that don't look like 'include(...)' { print $0 } unixcw-3.4.2/src/libcw/libcw.h0000644000175000017500000003765112451007375016037 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef _LIBCW_H #define _LIBCW_H #include /* For struct timeval */ #include /* int16_t */ #include #include static const int CW_AUDIO_CHANNELS = 1; /* Sound in mono */ #if defined(__cplusplus) extern "C" { #endif enum cw_return_values { CW_FAILURE = false, CW_SUCCESS = true }; /* supported audio sound systems */ enum cw_audio_systems { CW_AUDIO_NONE = 0, /* initial value; this is not the same as CW_AUDIO_NULL */ CW_AUDIO_NULL, /* empty audio output (no sound, just timing); this is not the same as CW_AUDIO_NONE */ CW_AUDIO_CONSOLE, /* console buzzer */ CW_AUDIO_OSS, CW_AUDIO_ALSA, CW_AUDIO_PA, /* PulseAudio */ CW_AUDIO_SOUNDCARD /* OSS, ALSA or PulseAudio (PA) */ }; enum { CW_KEY_STATE_OPEN = 0, /* key is open, no electrical contact in key, no sound */ CW_KEY_STATE_CLOSED /* key is closed, there is an electrical contact in key, a sound is generated */ }; typedef int16_t cw_sample_t; /* Default outputs for audio systems. Used by libcw unless client code decides otherwise. */ #define CW_DEFAULT_NULL_DEVICE "" #define CW_DEFAULT_CONSOLE_DEVICE "/dev/console" #define CW_DEFAULT_OSS_DEVICE "/dev/audio" #define CW_DEFAULT_ALSA_DEVICE "default" #define CW_DEFAULT_PA_DEVICE "( default )" /* Limits on values of CW send and timing parameters */ #define CW_SPEED_MIN 4 /* Lowest WPM allowed */ #define CW_SPEED_MAX 60 /* Highest WPM allowed */ #define CW_SPEED_STEP 1 #define CW_SPEED_INITIAL 12 /* Initial send speed in WPM */ #define CW_FREQUENCY_MIN 0 /* Lowest tone allowed (0=silent) */ #define CW_FREQUENCY_MAX 4000 /* Highest tone allowed */ #define CW_FREQUENCY_INITIAL 800 /* Initial tone in Hz */ #define CW_FREQUENCY_STEP 20 #define CW_VOLUME_MIN 0 /* Quietest volume allowed (0=silent) */ #define CW_VOLUME_MAX 100 /* Loudest volume allowed */ #define CW_VOLUME_INITIAL 70 /* Initial volume percent */ #define CW_VOLUME_STEP 1 #define CW_GAP_MIN 0 /* Lowest extra gap allowed */ #define CW_GAP_MAX 60 /* Highest extra gap allowed */ #define CW_GAP_INITIAL 0 /* Initial gap setting */ #define CW_GAP_STEP 1 #define CW_WEIGHTING_MIN 20 /* Lowest weighting allowed */ #define CW_WEIGHTING_MAX 80 /* Highest weighting allowed */ #define CW_WEIGHTING_INITIAL 50 /* Initial weighting setting */ #define CW_TOLERANCE_MIN 0 /* Lowest receive tolerance allowed */ #define CW_TOLERANCE_MAX 90 /* Highest receive tolerance allowed */ #define CW_TOLERANCE_INITIAL 50 /* Initial tolerance setting */ /* * Representation characters for Dot and Dash. Only the following * characters are permitted in Morse representation strings. */ enum { CW_DOT_REPRESENTATION = '.', CW_DASH_REPRESENTATION = '-' }; /* Debugging support. */ /* Definitions of debug flags. */ enum { /* Suppress KIOCSOUND ioctls. The flag is unused at the moment in libcw.c. */ CW_DEBUG_SILENT = 1 << 0, /* Print out keying control data (key open / key closed). */ CW_DEBUG_KEYING = 1 << 1, /* Print out information related to main object generating audio (i.e. the generator). */ CW_DEBUG_GENERATOR = 1 << 2, /* Print out tone queue data. */ CW_DEBUG_TONE_QUEUE = 1 << 3, /* Print out send and receive timing parameters. */ CW_DEBUG_PARAMETERS = 1 << 4, /* Print out changes of 'receive state'. */ CW_DEBUG_RECEIVE_STATES = 1 << 5, /* Print out iambic keyer information. */ CW_DEBUG_KEYER_STATES = 1 << 6, /* Print out straight key information. */ CW_DEBUG_STRAIGHT_KEY_STATES = 1 << 7, /* Print out table lookup results. */ CW_DEBUG_LOOKUPS = 1 << 8, /* Print out finalization actions. */ CW_DEBUG_FINALIZATION = 1 << 9, /* Print out information related to calls to standard library functions. This does not include calls that are directly related to configuring audio devices (e.g. calling open() to open OSS device). Printing debug information about problems with malloc() seems to be most common use case for this flag. */ CW_DEBUG_STDLIB = 1 << 10, /* Print out any events directly related to sound systems: to opening audio device, configuring it, writing to it, and closing it. In case of e.g. OSS sound system, this may also include information about libc's open(), write() and ioctl() calls, as they are directly related to opening/configuring/writing to audio device. */ CW_DEBUG_SOUND_SYSTEM = 1 << 11, /* Print out information related to internal states / errors / inconsistencies of libcw library. */ CW_DEBUG_INTERNAL = 1 << 12, /* Bit mask of all defined debug bits. */ CW_DEBUG_MASK = (1 << 13) - 1 }; /* Debug levels of debug messages. */ enum { CW_DEBUG_DEBUG = 0, CW_DEBUG_INFO = 1, CW_DEBUG_WARNING = 2, CW_DEBUG_ERROR = 3, CW_DEBUG_NONE = 4 /* Don't print any debug info. */ }; /* Values deciding the shape of slopes of tones generated by generator. If a generated tone is declared to have one or two slopes, generator has to know what shape of the slope(s) should be. Since the shape of tones is common for all tones generated by generator, shape of tone is a property of generator rather than of tone. These names are to be used as values of argument 'slope_shape' of cw_generator_set_tone_slope() function. */ enum { CW_TONE_SLOPE_SHAPE_LINEAR, /* Ramp/linearly raising slope. */ CW_TONE_SLOPE_SHAPE_RAISED_COSINE, /* Shape of cosine function in range <-pi - zero). */ CW_TONE_SLOPE_SHAPE_SINE, /* Shape of sine function in range .raw file with audio samples written as raw data. */ #define CW_DEV_RAW_SINK_MARKERS 0 /* Put markers in raw data saved to raw sink. */ #else #define CW_DEV_RAW_SINK 0 #define CW_DEV_RAW_SINK_MARKERS 0 #endif struct cw_gen_struct { int (* open_device)(cw_gen_t *gen); void (* close_device)(cw_gen_t *gen); int (* write)(cw_gen_t *gen); /* Generator can only generate tones that were first put into queue, and then dequeued. Here is a tone queue associated with a generator. One tone queue per generator. One generator per tone queue. The tone queue should be created in generator's constructor, and deleted in generator's destructor using tone queue's own constructor and destructor functions - see cw_tq module for declarations of these functions. */ cw_tone_queue_t *tq; /* Buffer storing sine wave that is calculated in "calculate sine wave" cycles and sent to audio system (OSS, ALSA, PulseAudio). The buffer should be always filled with valid data before sending it to audio system (to avoid hearing garbage). We should also send exactly buffer_n_samples samples to audio system, in order to avoid situation when audio system waits for filling its buffer too long - this would result in errors and probably audible clicks. */ cw_sample_t *buffer; /* Size of data buffer, in samples. The size may be restricted (min,max) by current audio system (OSS, ALSA, PulseAudio); the audio system may also accept only specific values of the size. Audio libraries may provide functions that can be used to query for allowed audio buffer sizes. The smaller the buffer, the more often you have to call function writing data to audio system, which increases CPU usage. The larger the buffer, the less responsive an application may be to changes of audio data parameters (depending on application type). */ int buffer_n_samples; /* We need two indices to gen->buffer, indicating beginning and end of a subarea in the buffer. The subarea is not exactly the same as gen->buffer for variety of reasons: - buffer length is almost always smaller than length of a Mark or Space (in samples) that we want to produce; - moreover, length of a Mark/Space (in samples) is almost never an exact multiple of length of a buffer; - as a result, a sound representing a Mark/Space may start and end anywhere between beginning and end of the buffer; A workable solution is to have a subarea of the buffer, a window, into which we will write a series of fragments of calculated sound. "start" and "stop" mark beginning and end of the subarea (inclusive: samples indexed by "start" and "stop" are part of the subarea). The subarea shall not wrap around boundaries of the buffer: "stop" shall be no larger than "gen->buffer_n_samples - 1", and it shall never be smaller than "start". "start" will be somewhere between zero and "stop", inclusive. "start" == "stop" is a valid situation - length of subarea is then one. Very often (in the middle of a long tone), "start" will be zero, and "stop" will be "gen->buffer_n_samples - 1". Sine wave (sometimes with amplitude = 0) will be calculated for subarea's cells (samples) ranging from cell "start" to cell "stop", inclusive. */ int buffer_sub_start; int buffer_sub_stop; /* Some parameters of tones (and of tones' slopes) are common for all tones generated in given time by a generator. Therefore the generator should contain this struct. Other parameters, such as tone's length or frequency, are strictly related to tones - you won't find them here. */ struct { /* Depending on sample rate, sending speed, and user preferences, length of slope of tones generated by generator may vary, but once set, it is constant for all generated tones (until next change of sample rate, sending speed, etc.). This is why we have the slope length in generator. n_amplitudes declared a bit below in this struct is a secondary parameter, derived from ->len. */ int len; /* [us] */ /* Linear/raised cosine/sine/rectangle. */ int shape; /* Table of amplitudes of every PCM sample of tone's slope. The values in amplitudes[] change from zero to max (at least for any sane slope shape), so naturally they can be used in forming rising slope. However they can be used in forming falling slope as well - just iterate the table from end to beginning. */ float *amplitudes; /* This is a secondary parameter, derived from ->len. n_amplitudes is useful when iterating over ->amplitudes[] or reallocing the ->amplitudes[]. */ int n_amplitudes; } tone_slope; /* none/null/console/OSS/ALSA/PulseAudio */ int audio_system; bool audio_device_is_open; /* Path to console file, or path to OSS soundcard file, or ALSA sound device name, or PulseAudio device name (it may be unused for PulseAudio) */ char *audio_device; /* Output file descriptor for audio data (console, OSS). */ int audio_sink; #ifdef LIBCW_WITH_ALSA /* Data used by ALSA. */ cw_alsa_data_t alsa_data; #endif #ifdef LIBCW_WITH_PULSEAUDIO /* Data used by PulseAudio. */ cw_pa_data_t pa_data; #endif struct { int x; int y; int z; } oss_version; /* Output file descriptor for debug data (console, OSS, ALSA, PulseAudio). */ int dev_raw_sink; /* Essential sending parameters. */ int send_speed; /* [wpm] */ int frequency; /* The frequency of generated sound. [Hz] */ int volume_percent; /* Level of sound in percents of maximum allowable level. */ int volume_abs; /* Level of sound in absolute terms; height of PCM samples. */ int gap; /* Inter-mark gap. [number of dot lengths]. */ int weighting; /* Dot/dash weighting. */ /* After changing sending speed, gap or weighting, some generator's internal parameters need to be re-calculated. This is a flag that shows when this needs to be done. */ bool parameters_in_sync; int sample_rate; /* set to the same value of sample rate as you have used when configuring sound card */ /* start/stop flag. Set to true before running dequeue_and_play thread function. Set to false to stop generator and return from dequeue_and_play thread function. */ bool do_dequeue_and_play; /* Used to calculate sine wave. Phase offset needs to be stored between consecutive calls to function calculating consecutive fragments of sine wave. */ double phase_offset; /* Properties of generator's thread function is that is used to generate sine wave and write the wave to audio sink (cw_gen_dequeue_and_play_internal()). */ struct { pthread_t id; pthread_attr_t attr; /* Call to pthread_create(&id, ...) executed and succeeded? If not, don't call pthread_kill(). I can't check value of thread.id, because pthread_t data type is opaque. This flag is a bit different than cw_gen_t->do_dequeue_and_play. Setting ->do_dequeue_and_play signals intent to run a loop deqeueing tones in cw_gen_dequeue_and_play_internal(). Setting ->thread.running means that thread function cw_gen_dequeue_and_play_internal() was launched successfully. */ bool running; } thread; struct { /* Main thread, existing from beginning to end of main process run. The variable is used to send signals to main app thread. */ pthread_t thread_id; char *name; } client; /* These are basic timing parameters which should be recalculated each time client code demands changing some higher-level parameter of generator (e.g. changing of sending speed). */ /* Watch out for "additional" key word. WARNING: notice how the eoc and eow spaces are calculated. They aren't full 3 units and 7 units. They are 2 units (which takes into account preceding eom space length), and 5 units (which takes into account preceding eom *and* eoc space length). So these two lengths are *additional* ones, i.e. in addition to (already existing) eom and/or eoc space. Whether this is good or bad idea to calculate them like this is a separate topic. Just be aware of this fact. Search the word "*additional*" in libcw_gen.c for implementation */ int dot_len; /* Length of a dot. [us] */ int dash_len; /* Length of a dash. [us] */ int eom_space_len; /* Length of end-of-mark space (i.e. inter-mark space). [us] */ int eoc_space_len; /* Length of *additional* end-of-character space. [us] */ int eow_space_len; /* Length of *additional* end-of-word space. [us] */ int additional_space_len; /* Length of additional space at the end of a character. [us] */ int adjustment_space_len; /* Length of adjustment space at the end of a word. [us] */ /* Shortest length of tone. Right now it's initialized in constructor and never changed afterwards, but in future it may change - the value may be dynamically modified for performance reasons. The longer the quantum length, the less often some functions need to be called. TODO: do we need a separate cw_gen_t->forever_len field? Are there cases where "length of forever tone" != "quantum length"? */ int quantum_len; /* Key that has a generator associated with it. Standalone generator will have this set to NULL. But generator that is used by a key will have this set to non-NULL value with cw_key_register_generator_internal(). Remember that the key needs to have a generator, not the other way around. */ volatile struct cw_key_struct *key; }; /* Basic generator functions. */ cw_gen_t *cw_gen_new_internal(int audio_system, const char *device); void cw_gen_delete_internal(cw_gen_t **gen); int cw_gen_start_internal(cw_gen_t *gen); int cw_gen_stop_internal(cw_gen_t *gen); /* Setters of generator's basic parameters. */ int cw_gen_set_speed_internal(cw_gen_t *gen, int new_value); int cw_gen_set_frequency_internal(cw_gen_t *gen, int new_value); int cw_gen_set_volume_internal(cw_gen_t *gen, int new_value); int cw_gen_set_gap_internal(cw_gen_t *gen, int new_value); int cw_gen_set_weighting_internal(cw_gen_t *gen, int new_value); /* Getters of generator's basic parameters. */ int cw_gen_get_speed_internal(cw_gen_t *gen); int cw_gen_get_frequency_internal(cw_gen_t *gen); int cw_gen_get_volume_internal(cw_gen_t *gen); int cw_gen_get_gap_internal(cw_gen_t *gen); int cw_gen_get_weighting_internal(cw_gen_t *gen); void cw_gen_get_send_parameters_internal(cw_gen_t *gen, int *dot_len, int *dash_len, int *eom_space_len, int *eoc_space_len, int *eow_space_len, int *additional_space_len, int *adjustment_space_len); /* Generator's 'play' primitives. */ int cw_gen_play_mark_internal(cw_gen_t *gen, char mark); int cw_gen_play_eoc_space_internal(cw_gen_t *gen); int cw_gen_play_eow_space_internal(cw_gen_t *gen); /* These are also 'play' primitives, but are intended to be used on hardware key events. 'key' is a verb here. */ int cw_gen_key_begin_mark_internal(cw_gen_t *gen); int cw_gen_key_begin_space_internal(cw_gen_t *gen); int cw_gen_key_pure_symbol_internal(cw_gen_t *gen, char symbol); int cw_gen_play_representation_internal(cw_gen_t *gen, const char *representation, bool partial); int cw_gen_play_character_internal(cw_gen_t *gen, char c); int cw_gen_play_character_parital_internal(cw_gen_t *gen, char c); int cw_gen_play_string_internal(cw_gen_t *gen, const char *string); int cw_gen_set_audio_device_internal(cw_gen_t *gen, const char *device); int cw_gen_silence_internal(cw_gen_t *gen); char *cw_gen_get_audio_system_label_internal(cw_gen_t *gen); void cw_generator_delete_internal(void); void cw_gen_reset_send_parameters_internal(cw_gen_t *gen); void cw_gen_sync_parameters_internal(cw_gen_t *gen); #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_generator_set_tone_slope(void); unsigned int test_cw_gen_tone_slope_shape_enums(void); unsigned int test_cw_gen_new_delete_internal(void); unsigned int test_cw_gen_forever_internal(void); /* This is helper function (performing the real test), used in libcw_test_public and in libcw_test_internal. "forever" feature is not a part of public api, so in theory it shouldn't be tested in libcw_test_public, but the libcw_test_public is able to perform tests with different audio sinks, whereas libcw_test_internal only uses NULL audio sink. So libcw_test_internal does basic tests ("does it work at all?"), and libcw_test_public does full test. */ unsigned int test_cw_gen_forever_sub(int seconds, int audio_system, const char *audio_device); #endif /* #ifdef LIBCW_UNIT_TESTS */ #endif /* #ifndef H_LIBCW_GEN */ unixcw-3.4.2/src/libcw/libcw_oss.c0000644000175000017500000003626112477665037016727 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_oss.c \brief OSS audio sink. */ #include "config.h" #ifdef LIBCW_WITH_OSS #include #include #include /* dlopen() and related symbols */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libcw_oss.h" #include "libcw_debug.h" #include "libcw_gen.h" #if defined(HAVE_SYS_SOUNDCARD_H) # include #elif defined(HAVE_SOUNDCARD_H) # include #else # #endif extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; extern const unsigned int cw_supported_sample_rates[]; extern const char *default_audio_devices[]; /* Conditional compilation flags */ #define CW_OSS_SET_FRAGMENT 1 /* ioctl(fd, SNDCTL_DSP_SETFRAGMENT, ¶m) */ #define CW_OSS_SET_POLICY 0 /* ioctl(fd, SNDCTL_DSP_POLICY, ¶m) */ /* Constants specific to OSS audio system configuration */ static const int CW_OSS_SETFRAGMENT = 7; /* Sound fragment size, 2^7 samples */ static const int CW_OSS_SAMPLE_FORMAT = AFMT_S16_NE; /* Sound format AFMT_S16_NE = signed 16 bit, native endianess; LE = Little endianess */ static int cw_oss_open_device_ioctls_internal(int *fd, int *sample_rate); static int cw_oss_get_version_internal(int fd, int *x, int *y, int *z); static int cw_oss_write_internal(cw_gen_t *gen); static int cw_oss_open_device_internal(cw_gen_t *gen); static void cw_oss_close_device_internal(cw_gen_t *gen); /** \brief Check if it is possible to open OSS output Function does a test opening and test configuration of OSS output, but it closes it before returning. \param device - name of OSS device to be used; if NULL then library will use default device. \return true if opening OSS output succeeded; \return false if opening OSS output failed; */ bool cw_is_oss_possible(const char *device) { const char *dev = device ? device : CW_DEFAULT_OSS_DEVICE; /* Open the given soundcard device file, for write only. */ int soundcard = open(dev, O_WRONLY); if (soundcard == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: open(%s): \"%s\"", dev, strerror(errno)); return false; } { int x = 0, y = 0, z = 0; int rv = cw_oss_get_version_internal(soundcard, &x, &y, &z); if (rv == CW_FAILURE) { close(soundcard); return false; } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_oss: OSS version %X.%X.%X", x, y, z); } } /* http://manuals.opensound.com/developer/OSS_GETVERSION.html: about OSS_GETVERSION ioctl: "This ioctl call returns the version number OSS API used in the current system. Applications can use this information to find out if the OSS version is new enough to support the features required by the application. However this methods should be used with great care. Usually it's recommended that applications check availability of each ioctl() by calling it and by checking if the call returned errno=EINVAL." So, we call all necessary ioctls to be 100% sure that all needed features are available. cw_oss_open_device_ioctls_internal() doesn't specifically look for EINVAL, it only checks return values from ioctl() and returns CW_FAILURE if one of ioctls() returns -1. */ int dummy; int rv = cw_oss_open_device_ioctls_internal(&soundcard, &dummy); close(soundcard); if (rv != CW_SUCCESS) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: one or more OSS ioctl() calls failed"); return false; } else { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_oss: OSS is possible"); return true; } } int cw_oss_configure(cw_gen_t *gen, const char *device) { assert (gen); gen->audio_system = CW_AUDIO_OSS; cw_gen_set_audio_device_internal(gen, device); gen->open_device = cw_oss_open_device_internal; gen->close_device = cw_oss_close_device_internal; gen->write = cw_oss_write_internal; return CW_SUCCESS; } int cw_oss_write_internal(cw_gen_t *gen) { assert (gen); assert (gen->audio_system == CW_AUDIO_OSS); int n_bytes = sizeof (gen->buffer[0]) * gen->buffer_n_samples; int rv = write(gen->audio_sink, gen->buffer, n_bytes); if (rv != n_bytes) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: audio write: %s", strerror(errno)); //return NULL; } // cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_oss: written %d samples", gen->buffer_n_samples); return CW_SUCCESS; } /** \brief Open OSS output, associate it with given generator You must use cw_gen_set_audio_device_internal() before calling this function. Otherwise generator \p gen won't know which device to open. \param gen - current generator \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_oss_open_device_internal(cw_gen_t *gen) { /* Open the given soundcard device file, for write only. */ int soundcard = open(gen->audio_device, O_WRONLY); if (soundcard == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: open(%s): \"%s\"", gen->audio_device, strerror(errno)); return CW_FAILURE; } int rv = cw_oss_open_device_ioctls_internal(&soundcard, &gen->sample_rate); if (rv != CW_SUCCESS) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: one or more OSS ioctl() calls failed"); close(soundcard); return CW_FAILURE; } int size = 0; /* Get fragment size in bytes, may be different than requested with ioctl(..., SNDCTL_DSP_SETFRAGMENT), and, in particular, can be different than 2^N. */ if ((rv = ioctl(soundcard, (int) SNDCTL_DSP_GETBLKSIZE, &size)) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_GETBLKSIZE): \"%s\"", strerror(errno)); close(soundcard); return CW_FAILURE; } if ((size & 0x0000ffff) != (1 << CW_OSS_SETFRAGMENT)) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: OSS fragment size not set, %d", size); close(soundcard); /* FIXME */ return CW_FAILURE; } else { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_oss: OSS fragment size = %d", size); } gen->buffer_n_samples = size; cw_oss_get_version_internal(soundcard, &gen->oss_version.x, &gen->oss_version.y, &gen->oss_version.z); /* Note sound as now open for business. */ gen->audio_device_is_open = true; gen->audio_sink = soundcard; #if CW_DEV_RAW_SINK gen->dev_raw_sink = open("/tmp/cw_file.oss.raw", O_WRONLY | O_TRUNC | O_NONBLOCK); #endif return CW_SUCCESS; } /** \brief Perform all necessary ioctl calls on OSS file descriptor Wrapper function for ioctl calls that need to be done when configuring file descriptor \param fd for OSS playback. \param fd - file descriptor of open OSS file; \param sample_rate - sample rate configured by ioctl calls (output parameter) \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_oss_open_device_ioctls_internal(int *fd, int *sample_rate) { int parameter = 0; /* ignored */ if (ioctl(*fd, SNDCTL_DSP_SYNC, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_SYNC): \"%s\"", strerror(errno)); return CW_FAILURE; } #if 0 /* This ioctl call failed on FreeBSD 10, which resulted in libcw failing to open OSS device. A bit of digging on the web revealed this: OSS4: http://manuals.opensound.com/developer/SNDCTL_DSP_POST.html: "This ioctl call is provided for compatibility with older applications. It has no practical purpose and should in no case be used in new applications." */ parameter = 0; /* ignored */ if (ioctl(*fd, SNDCTL_DSP_POST, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_POST): \"%s\"", strerror(errno)); return CW_FAILURE; } #endif /* Set the audio format to 8-bit unsigned. */ parameter = CW_OSS_SAMPLE_FORMAT; if (ioctl(*fd, (int) SNDCTL_DSP_SETFMT, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_SETFMT): \"%s\"", strerror(errno)); return CW_FAILURE; } if (parameter != CW_OSS_SAMPLE_FORMAT) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: sample format not supported"); return CW_FAILURE; } /* Set up mono mode - a single audio channel. */ parameter = CW_AUDIO_CHANNELS; if (ioctl(*fd, (int) SNDCTL_DSP_CHANNELS, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_CHANNELS): \"%s\"", strerror(errno)); return CW_FAILURE; } if (parameter != CW_AUDIO_CHANNELS) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: number of channels not supported"); return CW_FAILURE; } /* Set up a standard sampling rate based on the notional correct value, and retain the one we actually get. */ unsigned int rate = 0; bool success = false; for (int i = 0; cw_supported_sample_rates[i]; i++) { rate = cw_supported_sample_rates[i]; if (!ioctl(*fd, (int) SNDCTL_DSP_SPEED, &rate)) { if (rate != cw_supported_sample_rates[i]) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_oss: imprecise sample rate:"); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_oss: asked for: %u", cw_supported_sample_rates[i]); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_oss: got: %u", rate); } success = true; break; } } if (!success) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_SPEED): \"%s\"", strerror(errno)); return CW_FAILURE; } else { *sample_rate = rate; } audio_buf_info buff; if (ioctl(*fd, (int) SNDCTL_DSP_GETOSPACE, &buff) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_GETOSPACE): \"%s\"", strerror(errno)); return CW_FAILURE; } else { /* fprintf(stderr, "before:\n"); fprintf(stderr, "buff.fragments = %d\n", buff.fragments); fprintf(stderr, "buff.fragsize = %d\n", buff.fragsize); fprintf(stderr, "buff.bytes = %d\n", buff.bytes); fprintf(stderr, "buff.fragstotal = %d\n", buff.fragstotal); */ } #if CW_OSS_SET_FRAGMENT /* * Live a little dangerously, by trying to set the fragment size of the * card. We'll try for a relatively short fragment of 128 bytes. This * gives us a little better granularity over the amounts of audio data * we write periodically to the soundcard output buffer. We may not get * the requested fragment size, and may be stuck with the default. The * argument has the format 0xMMMMSSSS - fragment size is 2^SSSS, and * setting 0x7fff for MMMM allows as many fragments as the driver can * support. */ /* parameter = 0x7fff << 16 | CW_OSS_SETFRAGMENT; */ parameter = 0x0032 << 16 | CW_OSS_SETFRAGMENT; if (ioctl(*fd, (int) SNDCTL_DSP_SETFRAGMENT, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_SETFRAGMENT): \"%s\"", strerror(errno)); return CW_FAILURE; } cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_INFO, "cw_oss: fragment size is 2^%d = %d", parameter & 0x0000ffff, 2 << ((parameter & 0x0000ffff) - 1)); /* Query fragment size just to get the driver buffers set. */ if (ioctl(*fd, (int) SNDCTL_DSP_GETBLKSIZE, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_GETBLKSIZE): \"%s\"", strerror(errno)); return CW_FAILURE; } if (parameter != (1 << CW_OSS_SETFRAGMENT)) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: OSS fragment size not set, %d", parameter); } #endif #if CW_OSS_SET_POLICY parameter = 5; if (ioctl(*fd, SNDCTL_DSP_POLICY, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_DSP_POLICY): \"%s\"", strerror(errno)); return CW_FAILURE; } #endif if (ioctl(*fd, (int) SNDCTL_DSP_GETOSPACE, &buff) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl(SNDCTL_GETOSPACE): \"%s\"", strerror(errno)); return CW_FAILURE; } else { /* fprintf(stderr, "after:\n"); fprintf(stderr, "buff.fragments = %d\n", buff.fragments); fprintf(stderr, "buff.fragsize = %d\n", buff.fragsize); fprintf(stderr, "buff.bytes = %d\n", buff.bytes); fprintf(stderr, "buff.fragstotal = %d\n", buff;3R.fragstotal); */ } return CW_SUCCESS; } /** \brief Close OSS device associated with current generator */ void cw_oss_close_device_internal(cw_gen_t *gen) { close(gen->audio_sink); gen->audio_sink = -1; gen->audio_device_is_open = false; #if CW_DEV_RAW_SINK if (gen->dev_raw_sink != -1) { close(gen->dev_raw_sink); gen->dev_raw_sink = -1; } #endif return; } int cw_oss_get_version_internal(int fd, int *x, int *y, int *z) { assert (fd); int parameter = 0; if (ioctl(fd, (int) OSS_GETVERSION, ¶meter) == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR, "cw_oss: ioctl OSS_GETVERSION"); return CW_FAILURE; } else { *x = (parameter & 0xFF0000) >> 16; *y = (parameter & 0x00FF00) >> 8; *z = (parameter & 0x0000FF) >> 0; return CW_SUCCESS; } } #else /* #ifdef LIBCW_WITH_OSS */ #include #include "libcw_oss.h" bool cw_is_oss_possible(__attribute__((unused)) const char *device) { return false; } int cw_oss_configure(__attribute__((unused)) cw_gen_t *gen, __attribute__((unused)) const char *device) { return CW_FAILURE; } #endif /* #ifdef LIBCW_WITH_OSS */ unixcw-3.4.2/src/libcw/Makefile.in0000644000175000017500000041505512536122132016622 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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@ check_PROGRAMS = libcw_test_public$(EXEEXT) \ libcw_test_internal$(EXEEXT) libcw_test_simple_gen$(EXEEXT) subdir = src/libcw DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/libcw.pc.in $(top_srcdir)/depcomp \ $(libcw_include_HEADERS) $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = libcw.pc CONFIG_CLEAN_VPATH_FILES = 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)$(libdir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(libcw_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libcw_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = libcw_la-libcw.lo libcw_la-libcw_gen.lo \ libcw_la-libcw_rec.lo libcw_la-libcw_tq.lo \ libcw_la-libcw_data.lo libcw_la-libcw_key.lo \ libcw_la-libcw_utils.lo libcw_la-libcw_signal.lo \ libcw_la-libcw_null.lo libcw_la-libcw_console.lo \ libcw_la-libcw_oss.lo libcw_la-libcw_alsa.lo \ libcw_la-libcw_pa.lo libcw_la-libcw_debug.lo am_libcw_la_OBJECTS = $(am__objects_1) libcw_la_OBJECTS = $(am_libcw_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libcw_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcw_la_CFLAGS) \ $(CFLAGS) $(libcw_la_LDFLAGS) $(LDFLAGS) -o $@ am__objects_2 = libcw_test_internal-libcw.$(OBJEXT) \ libcw_test_internal-libcw_gen.$(OBJEXT) \ libcw_test_internal-libcw_rec.$(OBJEXT) \ libcw_test_internal-libcw_tq.$(OBJEXT) \ libcw_test_internal-libcw_data.$(OBJEXT) \ libcw_test_internal-libcw_key.$(OBJEXT) \ libcw_test_internal-libcw_utils.$(OBJEXT) \ libcw_test_internal-libcw_signal.$(OBJEXT) \ libcw_test_internal-libcw_null.$(OBJEXT) \ libcw_test_internal-libcw_console.$(OBJEXT) \ libcw_test_internal-libcw_oss.$(OBJEXT) \ libcw_test_internal-libcw_alsa.$(OBJEXT) \ libcw_test_internal-libcw_pa.$(OBJEXT) \ libcw_test_internal-libcw_debug.$(OBJEXT) am_libcw_test_internal_OBJECTS = $(am__objects_2) \ libcw_test_internal-libcw_test_internal.$(OBJEXT) libcw_test_internal_OBJECTS = $(am_libcw_test_internal_OBJECTS) libcw_test_internal_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) libcw_test_internal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libcw_test_internal_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__objects_3 = libcw_test_public-libcw.$(OBJEXT) \ libcw_test_public-libcw_gen.$(OBJEXT) \ libcw_test_public-libcw_rec.$(OBJEXT) \ libcw_test_public-libcw_tq.$(OBJEXT) \ libcw_test_public-libcw_data.$(OBJEXT) \ libcw_test_public-libcw_key.$(OBJEXT) \ libcw_test_public-libcw_utils.$(OBJEXT) \ libcw_test_public-libcw_signal.$(OBJEXT) \ libcw_test_public-libcw_null.$(OBJEXT) \ libcw_test_public-libcw_console.$(OBJEXT) \ libcw_test_public-libcw_oss.$(OBJEXT) \ libcw_test_public-libcw_alsa.$(OBJEXT) \ libcw_test_public-libcw_pa.$(OBJEXT) \ libcw_test_public-libcw_debug.$(OBJEXT) am_libcw_test_public_OBJECTS = $(am__objects_3) \ libcw_test_public-libcw_test_public.$(OBJEXT) \ libcw_test_public-libcw_test.$(OBJEXT) libcw_test_public_OBJECTS = $(am_libcw_test_public_OBJECTS) libcw_test_public_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libcw_test_simple_gen_OBJECTS = \ libcw_test_simple_gen-libcw_test_simple_gen.$(OBJEXT) \ libcw_test_simple_gen-libcw_test.$(OBJEXT) libcw_test_simple_gen_OBJECTS = $(am_libcw_test_simple_gen_OBJECTS) libcw_test_simple_gen_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) libcw_test_simple_gen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) $(AM_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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(libcw_la_SOURCES) $(libcw_test_internal_SOURCES) \ $(libcw_test_public_SOURCES) $(libcw_test_simple_gen_SOURCES) DIST_SOURCES = $(libcw_la_SOURCES) $(libcw_test_internal_SOURCES) \ $(libcw_test_public_SOURCES) $(libcw_test_simple_gen_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man3dir = $(mandir)/man3 man7dir = $(mandir)/man7 NROFF = nroff MANS = $(man_MANS) DATA = $(pkgconfig_DATA) HEADERS = $(libcw_include_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)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # targets to be built in this directory lib_LTLIBRARIES = libcw.la man_MANS = libcw.3 cw.7 pkgconfig_DATA = libcw.pc EXTRA_DIST = include.awk libdoc.awk libfuncs.awk libpc.awk libsigs.awk \ libcw.3.m4 \ libcw.pc.in \ cw.7 \ libcw_gen.h libcw_rec.h \ libcw_tq.h libcw_data.h libcw_key.h libcw_utils.h libcw_signal.h \ libcw_null.h libcw_console.h libcw_oss.h libcw_alsa.h libcw_pa.h \ libcw_test.h # These files are used to build two different targets - list them only # once. I can't compile these files into an utility library because # the two targets are compiled with different CPPFLAGS. LIBCW_BASE_C_FILES = \ libcw.c \ libcw_gen.c libcw_rec.c \ libcw_tq.c libcw_data.c libcw_key.c libcw_utils.c libcw_signal.c \ libcw_null.c libcw_console.c libcw_oss.c libcw_alsa.c libcw_pa.c \ libcw_debug.c # target: shared library # source code files used to build libcw shared library libcw_la_SOURCES = $(LIBCW_BASE_C_FILES) # target-specific linker flags (objects to link) libcw_la_LIBADD = -lm -lpthread $(DL_LIB) $(OSS_LIB) # target-specific linker flags (additional flags) # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # LIBCW_VERSION is defined in configure.ac libcw_la_LDFLAGS = -version-number $(LIBCW_VERSION) # target-specific compiler flags libcw_la_CFLAGS = -rdynamic # target-specific preprocessor flags (#defs and include dirs) # # $(LIBCW_NDEBUG) activates asserts in base libcw for dev builds, and # deactivates asserts in base libcw for regular builds. libcw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCW_NDEBUG) libcw_includedir = $(includedir) libcw_include_HEADERS = libcw.h libcw_debug.h # target: libcw_test_public: a test program testing only public API of libcw library; # main() is defined in libcw_test_public.c # Source code files used to build libcw_test_public program. # This test tests library's public API, so the target should depend on # a regular shared library file found in build directory. It shouldn't # compile all *.c files that are used to create library, it should # compile only test files and "link" them with this library file. libcw_test_public_SOURCES = $(LIBCW_BASE_C_FILES) libcw_test_public.c libcw_test.c # target-specific preprocessor flags (#defs and include dirs) libcw_test_public_CPPFLAGS = $(AM_CPPFLAGS) -DLIBCW_UNIT_TESTS # target-specific linker flags (objects to link) libcw_test_public_LDADD = -lm -lpthread $(DL_LIB) -L./.libs -lcw # target: libcw_test_internal, a test program invoking unit tests for # (internal) functions defined in libcw_xyz.c files; # main() is defined in libcw_test_internal.c. # source code files used to build libcw_test_internal program libcw_test_internal_SOURCES = $(LIBCW_BASE_C_FILES) libcw_test_internal.c # target-specific preprocessor flags (#defs and include dirs) libcw_test_internal_CPPFLAGS = $(AM_CPPFLAGS) -DLIBCW_UNIT_TESTS # target-specific linker flags (objects to link) libcw_test_internal_LDADD = -lm -lpthread $(DL_LIB) $(OSS_LIB) # target-specific compiler flags libcw_test_internal_CFLAGS = -rdynamic # target: libcw_test_simple_gen, yet another test program; # main() is defined in libcw_test_simple_gen.c # The file defines a very simple set of tests that make only a basic # use of libcw's generator facilities. # source code files used to build libcw_test_simple_gen program libcw_test_simple_gen_SOURCES = libcw_test_simple_gen.c libcw_test.c # target-specific linker flags (objects to link) libcw_test_simple_gen_LDADD = -lm -lpthread $(DL_LIB) $(OSS_LIB) -L./.libs -lcw # target-specific compiler flags libcw_test_simple_gen_CFLAGS = -rdynamic # target: libcw.pc pkgconfigdir = $(libdir)/pkgconfig # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = libcw_test_internal.sh libcw.3 TESTS = $(check_SCRIPTS) # run test programs (only libcw_test_internal unit tests suite) check_SCRIPTS = libcw_test_internal.sh all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libcw/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libcw.pc: $(top_builddir)/config.status $(srcdir)/libcw.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcw.la: $(libcw_la_OBJECTS) $(libcw_la_DEPENDENCIES) $(EXTRA_libcw_la_DEPENDENCIES) $(AM_V_CCLD)$(libcw_la_LINK) -rpath $(libdir) $(libcw_la_OBJECTS) $(libcw_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list libcw_test_internal$(EXEEXT): $(libcw_test_internal_OBJECTS) $(libcw_test_internal_DEPENDENCIES) $(EXTRA_libcw_test_internal_DEPENDENCIES) @rm -f libcw_test_internal$(EXEEXT) $(AM_V_CCLD)$(libcw_test_internal_LINK) $(libcw_test_internal_OBJECTS) $(libcw_test_internal_LDADD) $(LIBS) libcw_test_public$(EXEEXT): $(libcw_test_public_OBJECTS) $(libcw_test_public_DEPENDENCIES) $(EXTRA_libcw_test_public_DEPENDENCIES) @rm -f libcw_test_public$(EXEEXT) $(AM_V_CCLD)$(LINK) $(libcw_test_public_OBJECTS) $(libcw_test_public_LDADD) $(LIBS) libcw_test_simple_gen$(EXEEXT): $(libcw_test_simple_gen_OBJECTS) $(libcw_test_simple_gen_DEPENDENCIES) $(EXTRA_libcw_test_simple_gen_DEPENDENCIES) @rm -f libcw_test_simple_gen$(EXEEXT) $(AM_V_CCLD)$(libcw_test_simple_gen_LINK) $(libcw_test_simple_gen_OBJECTS) $(libcw_test_simple_gen_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_alsa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_console.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_data.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_gen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_key.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_oss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_pa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_rec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_signal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_tq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_la-libcw_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_alsa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_console.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_gen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_key.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_oss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_pa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_rec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_test_internal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_tq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_internal-libcw_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_alsa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_console.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_gen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_key.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_oss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_pa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_rec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_test_public.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_tq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_public-libcw_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_simple_gen-libcw_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libcw_la-libcw.lo: libcw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw.Tpo -c -o libcw_la-libcw.lo `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw.Tpo $(DEPDIR)/libcw_la-libcw.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw.c' object='libcw_la-libcw.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw.lo `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c libcw_la-libcw_gen.lo: libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_gen.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_gen.Tpo -c -o libcw_la-libcw_gen.lo `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_gen.Tpo $(DEPDIR)/libcw_la-libcw_gen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_gen.c' object='libcw_la-libcw_gen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_gen.lo `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c libcw_la-libcw_rec.lo: libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_rec.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_rec.Tpo -c -o libcw_la-libcw_rec.lo `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_rec.Tpo $(DEPDIR)/libcw_la-libcw_rec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_rec.c' object='libcw_la-libcw_rec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_rec.lo `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c libcw_la-libcw_tq.lo: libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_tq.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_tq.Tpo -c -o libcw_la-libcw_tq.lo `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_tq.Tpo $(DEPDIR)/libcw_la-libcw_tq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_tq.c' object='libcw_la-libcw_tq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_tq.lo `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c libcw_la-libcw_data.lo: libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_data.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_data.Tpo -c -o libcw_la-libcw_data.lo `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_data.Tpo $(DEPDIR)/libcw_la-libcw_data.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_data.c' object='libcw_la-libcw_data.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_data.lo `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c libcw_la-libcw_key.lo: libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_key.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_key.Tpo -c -o libcw_la-libcw_key.lo `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_key.Tpo $(DEPDIR)/libcw_la-libcw_key.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_key.c' object='libcw_la-libcw_key.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_key.lo `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c libcw_la-libcw_utils.lo: libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_utils.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_utils.Tpo -c -o libcw_la-libcw_utils.lo `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_utils.Tpo $(DEPDIR)/libcw_la-libcw_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_utils.c' object='libcw_la-libcw_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_utils.lo `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c libcw_la-libcw_signal.lo: libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_signal.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_signal.Tpo -c -o libcw_la-libcw_signal.lo `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_signal.Tpo $(DEPDIR)/libcw_la-libcw_signal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_signal.c' object='libcw_la-libcw_signal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_signal.lo `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c libcw_la-libcw_null.lo: libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_null.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_null.Tpo -c -o libcw_la-libcw_null.lo `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_null.Tpo $(DEPDIR)/libcw_la-libcw_null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_null.c' object='libcw_la-libcw_null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_null.lo `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c libcw_la-libcw_console.lo: libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_console.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_console.Tpo -c -o libcw_la-libcw_console.lo `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_console.Tpo $(DEPDIR)/libcw_la-libcw_console.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_console.c' object='libcw_la-libcw_console.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_console.lo `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c libcw_la-libcw_oss.lo: libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_oss.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_oss.Tpo -c -o libcw_la-libcw_oss.lo `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_oss.Tpo $(DEPDIR)/libcw_la-libcw_oss.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_oss.c' object='libcw_la-libcw_oss.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_oss.lo `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c libcw_la-libcw_alsa.lo: libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_alsa.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_alsa.Tpo -c -o libcw_la-libcw_alsa.lo `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_alsa.Tpo $(DEPDIR)/libcw_la-libcw_alsa.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_alsa.c' object='libcw_la-libcw_alsa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_alsa.lo `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c libcw_la-libcw_pa.lo: libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_pa.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_pa.Tpo -c -o libcw_la-libcw_pa.lo `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_pa.Tpo $(DEPDIR)/libcw_la-libcw_pa.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_pa.c' object='libcw_la-libcw_pa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_pa.lo `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c libcw_la-libcw_debug.lo: libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -MT libcw_la-libcw_debug.lo -MD -MP -MF $(DEPDIR)/libcw_la-libcw_debug.Tpo -c -o libcw_la-libcw_debug.lo `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_la-libcw_debug.Tpo $(DEPDIR)/libcw_la-libcw_debug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_debug.c' object='libcw_la-libcw_debug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_la_CPPFLAGS) $(CPPFLAGS) $(libcw_la_CFLAGS) $(CFLAGS) -c -o libcw_la-libcw_debug.lo `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c libcw_test_internal-libcw.o: libcw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw.Tpo -c -o libcw_test_internal-libcw.o `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw.Tpo $(DEPDIR)/libcw_test_internal-libcw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw.c' object='libcw_test_internal-libcw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw.o `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c libcw_test_internal-libcw.obj: libcw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw.Tpo -c -o libcw_test_internal-libcw.obj `if test -f 'libcw.c'; then $(CYGPATH_W) 'libcw.c'; else $(CYGPATH_W) '$(srcdir)/libcw.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw.Tpo $(DEPDIR)/libcw_test_internal-libcw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw.c' object='libcw_test_internal-libcw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw.obj `if test -f 'libcw.c'; then $(CYGPATH_W) 'libcw.c'; else $(CYGPATH_W) '$(srcdir)/libcw.c'; fi` libcw_test_internal-libcw_gen.o: libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_gen.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_gen.Tpo -c -o libcw_test_internal-libcw_gen.o `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_gen.Tpo $(DEPDIR)/libcw_test_internal-libcw_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_gen.c' object='libcw_test_internal-libcw_gen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_gen.o `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c libcw_test_internal-libcw_gen.obj: libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_gen.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_gen.Tpo -c -o libcw_test_internal-libcw_gen.obj `if test -f 'libcw_gen.c'; then $(CYGPATH_W) 'libcw_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_gen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_gen.Tpo $(DEPDIR)/libcw_test_internal-libcw_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_gen.c' object='libcw_test_internal-libcw_gen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_gen.obj `if test -f 'libcw_gen.c'; then $(CYGPATH_W) 'libcw_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_gen.c'; fi` libcw_test_internal-libcw_rec.o: libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_rec.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_rec.Tpo -c -o libcw_test_internal-libcw_rec.o `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_rec.Tpo $(DEPDIR)/libcw_test_internal-libcw_rec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_rec.c' object='libcw_test_internal-libcw_rec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_rec.o `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c libcw_test_internal-libcw_rec.obj: libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_rec.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_rec.Tpo -c -o libcw_test_internal-libcw_rec.obj `if test -f 'libcw_rec.c'; then $(CYGPATH_W) 'libcw_rec.c'; else $(CYGPATH_W) '$(srcdir)/libcw_rec.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_rec.Tpo $(DEPDIR)/libcw_test_internal-libcw_rec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_rec.c' object='libcw_test_internal-libcw_rec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_rec.obj `if test -f 'libcw_rec.c'; then $(CYGPATH_W) 'libcw_rec.c'; else $(CYGPATH_W) '$(srcdir)/libcw_rec.c'; fi` libcw_test_internal-libcw_tq.o: libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_tq.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_tq.Tpo -c -o libcw_test_internal-libcw_tq.o `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_tq.Tpo $(DEPDIR)/libcw_test_internal-libcw_tq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_tq.c' object='libcw_test_internal-libcw_tq.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_tq.o `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c libcw_test_internal-libcw_tq.obj: libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_tq.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_tq.Tpo -c -o libcw_test_internal-libcw_tq.obj `if test -f 'libcw_tq.c'; then $(CYGPATH_W) 'libcw_tq.c'; else $(CYGPATH_W) '$(srcdir)/libcw_tq.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_tq.Tpo $(DEPDIR)/libcw_test_internal-libcw_tq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_tq.c' object='libcw_test_internal-libcw_tq.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_tq.obj `if test -f 'libcw_tq.c'; then $(CYGPATH_W) 'libcw_tq.c'; else $(CYGPATH_W) '$(srcdir)/libcw_tq.c'; fi` libcw_test_internal-libcw_data.o: libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_data.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_data.Tpo -c -o libcw_test_internal-libcw_data.o `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_data.Tpo $(DEPDIR)/libcw_test_internal-libcw_data.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_data.c' object='libcw_test_internal-libcw_data.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_data.o `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c libcw_test_internal-libcw_data.obj: libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_data.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_data.Tpo -c -o libcw_test_internal-libcw_data.obj `if test -f 'libcw_data.c'; then $(CYGPATH_W) 'libcw_data.c'; else $(CYGPATH_W) '$(srcdir)/libcw_data.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_data.Tpo $(DEPDIR)/libcw_test_internal-libcw_data.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_data.c' object='libcw_test_internal-libcw_data.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_data.obj `if test -f 'libcw_data.c'; then $(CYGPATH_W) 'libcw_data.c'; else $(CYGPATH_W) '$(srcdir)/libcw_data.c'; fi` libcw_test_internal-libcw_key.o: libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_key.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_key.Tpo -c -o libcw_test_internal-libcw_key.o `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_key.Tpo $(DEPDIR)/libcw_test_internal-libcw_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_key.c' object='libcw_test_internal-libcw_key.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_key.o `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c libcw_test_internal-libcw_key.obj: libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_key.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_key.Tpo -c -o libcw_test_internal-libcw_key.obj `if test -f 'libcw_key.c'; then $(CYGPATH_W) 'libcw_key.c'; else $(CYGPATH_W) '$(srcdir)/libcw_key.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_key.Tpo $(DEPDIR)/libcw_test_internal-libcw_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_key.c' object='libcw_test_internal-libcw_key.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_key.obj `if test -f 'libcw_key.c'; then $(CYGPATH_W) 'libcw_key.c'; else $(CYGPATH_W) '$(srcdir)/libcw_key.c'; fi` libcw_test_internal-libcw_utils.o: libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_utils.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_utils.Tpo -c -o libcw_test_internal-libcw_utils.o `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_utils.Tpo $(DEPDIR)/libcw_test_internal-libcw_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_utils.c' object='libcw_test_internal-libcw_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_utils.o `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c libcw_test_internal-libcw_utils.obj: libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_utils.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_utils.Tpo -c -o libcw_test_internal-libcw_utils.obj `if test -f 'libcw_utils.c'; then $(CYGPATH_W) 'libcw_utils.c'; else $(CYGPATH_W) '$(srcdir)/libcw_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_utils.Tpo $(DEPDIR)/libcw_test_internal-libcw_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_utils.c' object='libcw_test_internal-libcw_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_utils.obj `if test -f 'libcw_utils.c'; then $(CYGPATH_W) 'libcw_utils.c'; else $(CYGPATH_W) '$(srcdir)/libcw_utils.c'; fi` libcw_test_internal-libcw_signal.o: libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_signal.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_signal.Tpo -c -o libcw_test_internal-libcw_signal.o `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_signal.Tpo $(DEPDIR)/libcw_test_internal-libcw_signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_signal.c' object='libcw_test_internal-libcw_signal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_signal.o `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c libcw_test_internal-libcw_signal.obj: libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_signal.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_signal.Tpo -c -o libcw_test_internal-libcw_signal.obj `if test -f 'libcw_signal.c'; then $(CYGPATH_W) 'libcw_signal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_signal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_signal.Tpo $(DEPDIR)/libcw_test_internal-libcw_signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_signal.c' object='libcw_test_internal-libcw_signal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_signal.obj `if test -f 'libcw_signal.c'; then $(CYGPATH_W) 'libcw_signal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_signal.c'; fi` libcw_test_internal-libcw_null.o: libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_null.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_null.Tpo -c -o libcw_test_internal-libcw_null.o `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_null.Tpo $(DEPDIR)/libcw_test_internal-libcw_null.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_null.c' object='libcw_test_internal-libcw_null.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_null.o `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c libcw_test_internal-libcw_null.obj: libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_null.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_null.Tpo -c -o libcw_test_internal-libcw_null.obj `if test -f 'libcw_null.c'; then $(CYGPATH_W) 'libcw_null.c'; else $(CYGPATH_W) '$(srcdir)/libcw_null.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_null.Tpo $(DEPDIR)/libcw_test_internal-libcw_null.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_null.c' object='libcw_test_internal-libcw_null.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_null.obj `if test -f 'libcw_null.c'; then $(CYGPATH_W) 'libcw_null.c'; else $(CYGPATH_W) '$(srcdir)/libcw_null.c'; fi` libcw_test_internal-libcw_console.o: libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_console.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_console.Tpo -c -o libcw_test_internal-libcw_console.o `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_console.Tpo $(DEPDIR)/libcw_test_internal-libcw_console.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_console.c' object='libcw_test_internal-libcw_console.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_console.o `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c libcw_test_internal-libcw_console.obj: libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_console.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_console.Tpo -c -o libcw_test_internal-libcw_console.obj `if test -f 'libcw_console.c'; then $(CYGPATH_W) 'libcw_console.c'; else $(CYGPATH_W) '$(srcdir)/libcw_console.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_console.Tpo $(DEPDIR)/libcw_test_internal-libcw_console.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_console.c' object='libcw_test_internal-libcw_console.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_console.obj `if test -f 'libcw_console.c'; then $(CYGPATH_W) 'libcw_console.c'; else $(CYGPATH_W) '$(srcdir)/libcw_console.c'; fi` libcw_test_internal-libcw_oss.o: libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_oss.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_oss.Tpo -c -o libcw_test_internal-libcw_oss.o `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_oss.Tpo $(DEPDIR)/libcw_test_internal-libcw_oss.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_oss.c' object='libcw_test_internal-libcw_oss.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_oss.o `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c libcw_test_internal-libcw_oss.obj: libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_oss.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_oss.Tpo -c -o libcw_test_internal-libcw_oss.obj `if test -f 'libcw_oss.c'; then $(CYGPATH_W) 'libcw_oss.c'; else $(CYGPATH_W) '$(srcdir)/libcw_oss.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_oss.Tpo $(DEPDIR)/libcw_test_internal-libcw_oss.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_oss.c' object='libcw_test_internal-libcw_oss.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_oss.obj `if test -f 'libcw_oss.c'; then $(CYGPATH_W) 'libcw_oss.c'; else $(CYGPATH_W) '$(srcdir)/libcw_oss.c'; fi` libcw_test_internal-libcw_alsa.o: libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_alsa.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_alsa.Tpo -c -o libcw_test_internal-libcw_alsa.o `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_alsa.Tpo $(DEPDIR)/libcw_test_internal-libcw_alsa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_alsa.c' object='libcw_test_internal-libcw_alsa.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_alsa.o `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c libcw_test_internal-libcw_alsa.obj: libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_alsa.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_alsa.Tpo -c -o libcw_test_internal-libcw_alsa.obj `if test -f 'libcw_alsa.c'; then $(CYGPATH_W) 'libcw_alsa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_alsa.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_alsa.Tpo $(DEPDIR)/libcw_test_internal-libcw_alsa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_alsa.c' object='libcw_test_internal-libcw_alsa.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_alsa.obj `if test -f 'libcw_alsa.c'; then $(CYGPATH_W) 'libcw_alsa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_alsa.c'; fi` libcw_test_internal-libcw_pa.o: libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_pa.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_pa.Tpo -c -o libcw_test_internal-libcw_pa.o `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_pa.Tpo $(DEPDIR)/libcw_test_internal-libcw_pa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_pa.c' object='libcw_test_internal-libcw_pa.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_pa.o `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c libcw_test_internal-libcw_pa.obj: libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_pa.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_pa.Tpo -c -o libcw_test_internal-libcw_pa.obj `if test -f 'libcw_pa.c'; then $(CYGPATH_W) 'libcw_pa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_pa.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_pa.Tpo $(DEPDIR)/libcw_test_internal-libcw_pa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_pa.c' object='libcw_test_internal-libcw_pa.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_pa.obj `if test -f 'libcw_pa.c'; then $(CYGPATH_W) 'libcw_pa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_pa.c'; fi` libcw_test_internal-libcw_debug.o: libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_debug.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_debug.Tpo -c -o libcw_test_internal-libcw_debug.o `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_debug.Tpo $(DEPDIR)/libcw_test_internal-libcw_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_debug.c' object='libcw_test_internal-libcw_debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_debug.o `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c libcw_test_internal-libcw_debug.obj: libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_debug.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_debug.Tpo -c -o libcw_test_internal-libcw_debug.obj `if test -f 'libcw_debug.c'; then $(CYGPATH_W) 'libcw_debug.c'; else $(CYGPATH_W) '$(srcdir)/libcw_debug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_debug.Tpo $(DEPDIR)/libcw_test_internal-libcw_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_debug.c' object='libcw_test_internal-libcw_debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_debug.obj `if test -f 'libcw_debug.c'; then $(CYGPATH_W) 'libcw_debug.c'; else $(CYGPATH_W) '$(srcdir)/libcw_debug.c'; fi` libcw_test_internal-libcw_test_internal.o: libcw_test_internal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_test_internal.o -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_test_internal.Tpo -c -o libcw_test_internal-libcw_test_internal.o `test -f 'libcw_test_internal.c' || echo '$(srcdir)/'`libcw_test_internal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_test_internal.Tpo $(DEPDIR)/libcw_test_internal-libcw_test_internal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_internal.c' object='libcw_test_internal-libcw_test_internal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_test_internal.o `test -f 'libcw_test_internal.c' || echo '$(srcdir)/'`libcw_test_internal.c libcw_test_internal-libcw_test_internal.obj: libcw_test_internal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -MT libcw_test_internal-libcw_test_internal.obj -MD -MP -MF $(DEPDIR)/libcw_test_internal-libcw_test_internal.Tpo -c -o libcw_test_internal-libcw_test_internal.obj `if test -f 'libcw_test_internal.c'; then $(CYGPATH_W) 'libcw_test_internal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_internal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_internal-libcw_test_internal.Tpo $(DEPDIR)/libcw_test_internal-libcw_test_internal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_internal.c' object='libcw_test_internal-libcw_test_internal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_internal_CPPFLAGS) $(CPPFLAGS) $(libcw_test_internal_CFLAGS) $(CFLAGS) -c -o libcw_test_internal-libcw_test_internal.obj `if test -f 'libcw_test_internal.c'; then $(CYGPATH_W) 'libcw_test_internal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_internal.c'; fi` libcw_test_public-libcw.o: libcw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw.Tpo -c -o libcw_test_public-libcw.o `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw.Tpo $(DEPDIR)/libcw_test_public-libcw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw.c' object='libcw_test_public-libcw.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw.o `test -f 'libcw.c' || echo '$(srcdir)/'`libcw.c libcw_test_public-libcw.obj: libcw.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw.Tpo -c -o libcw_test_public-libcw.obj `if test -f 'libcw.c'; then $(CYGPATH_W) 'libcw.c'; else $(CYGPATH_W) '$(srcdir)/libcw.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw.Tpo $(DEPDIR)/libcw_test_public-libcw.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw.c' object='libcw_test_public-libcw.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw.obj `if test -f 'libcw.c'; then $(CYGPATH_W) 'libcw.c'; else $(CYGPATH_W) '$(srcdir)/libcw.c'; fi` libcw_test_public-libcw_gen.o: libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_gen.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_gen.Tpo -c -o libcw_test_public-libcw_gen.o `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_gen.Tpo $(DEPDIR)/libcw_test_public-libcw_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_gen.c' object='libcw_test_public-libcw_gen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_gen.o `test -f 'libcw_gen.c' || echo '$(srcdir)/'`libcw_gen.c libcw_test_public-libcw_gen.obj: libcw_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_gen.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_gen.Tpo -c -o libcw_test_public-libcw_gen.obj `if test -f 'libcw_gen.c'; then $(CYGPATH_W) 'libcw_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_gen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_gen.Tpo $(DEPDIR)/libcw_test_public-libcw_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_gen.c' object='libcw_test_public-libcw_gen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_gen.obj `if test -f 'libcw_gen.c'; then $(CYGPATH_W) 'libcw_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_gen.c'; fi` libcw_test_public-libcw_rec.o: libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_rec.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_rec.Tpo -c -o libcw_test_public-libcw_rec.o `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_rec.Tpo $(DEPDIR)/libcw_test_public-libcw_rec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_rec.c' object='libcw_test_public-libcw_rec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_rec.o `test -f 'libcw_rec.c' || echo '$(srcdir)/'`libcw_rec.c libcw_test_public-libcw_rec.obj: libcw_rec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_rec.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_rec.Tpo -c -o libcw_test_public-libcw_rec.obj `if test -f 'libcw_rec.c'; then $(CYGPATH_W) 'libcw_rec.c'; else $(CYGPATH_W) '$(srcdir)/libcw_rec.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_rec.Tpo $(DEPDIR)/libcw_test_public-libcw_rec.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_rec.c' object='libcw_test_public-libcw_rec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_rec.obj `if test -f 'libcw_rec.c'; then $(CYGPATH_W) 'libcw_rec.c'; else $(CYGPATH_W) '$(srcdir)/libcw_rec.c'; fi` libcw_test_public-libcw_tq.o: libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_tq.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_tq.Tpo -c -o libcw_test_public-libcw_tq.o `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_tq.Tpo $(DEPDIR)/libcw_test_public-libcw_tq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_tq.c' object='libcw_test_public-libcw_tq.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_tq.o `test -f 'libcw_tq.c' || echo '$(srcdir)/'`libcw_tq.c libcw_test_public-libcw_tq.obj: libcw_tq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_tq.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_tq.Tpo -c -o libcw_test_public-libcw_tq.obj `if test -f 'libcw_tq.c'; then $(CYGPATH_W) 'libcw_tq.c'; else $(CYGPATH_W) '$(srcdir)/libcw_tq.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_tq.Tpo $(DEPDIR)/libcw_test_public-libcw_tq.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_tq.c' object='libcw_test_public-libcw_tq.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_tq.obj `if test -f 'libcw_tq.c'; then $(CYGPATH_W) 'libcw_tq.c'; else $(CYGPATH_W) '$(srcdir)/libcw_tq.c'; fi` libcw_test_public-libcw_data.o: libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_data.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_data.Tpo -c -o libcw_test_public-libcw_data.o `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_data.Tpo $(DEPDIR)/libcw_test_public-libcw_data.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_data.c' object='libcw_test_public-libcw_data.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_data.o `test -f 'libcw_data.c' || echo '$(srcdir)/'`libcw_data.c libcw_test_public-libcw_data.obj: libcw_data.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_data.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_data.Tpo -c -o libcw_test_public-libcw_data.obj `if test -f 'libcw_data.c'; then $(CYGPATH_W) 'libcw_data.c'; else $(CYGPATH_W) '$(srcdir)/libcw_data.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_data.Tpo $(DEPDIR)/libcw_test_public-libcw_data.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_data.c' object='libcw_test_public-libcw_data.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_data.obj `if test -f 'libcw_data.c'; then $(CYGPATH_W) 'libcw_data.c'; else $(CYGPATH_W) '$(srcdir)/libcw_data.c'; fi` libcw_test_public-libcw_key.o: libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_key.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_key.Tpo -c -o libcw_test_public-libcw_key.o `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_key.Tpo $(DEPDIR)/libcw_test_public-libcw_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_key.c' object='libcw_test_public-libcw_key.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_key.o `test -f 'libcw_key.c' || echo '$(srcdir)/'`libcw_key.c libcw_test_public-libcw_key.obj: libcw_key.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_key.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_key.Tpo -c -o libcw_test_public-libcw_key.obj `if test -f 'libcw_key.c'; then $(CYGPATH_W) 'libcw_key.c'; else $(CYGPATH_W) '$(srcdir)/libcw_key.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_key.Tpo $(DEPDIR)/libcw_test_public-libcw_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_key.c' object='libcw_test_public-libcw_key.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_key.obj `if test -f 'libcw_key.c'; then $(CYGPATH_W) 'libcw_key.c'; else $(CYGPATH_W) '$(srcdir)/libcw_key.c'; fi` libcw_test_public-libcw_utils.o: libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_utils.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_utils.Tpo -c -o libcw_test_public-libcw_utils.o `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_utils.Tpo $(DEPDIR)/libcw_test_public-libcw_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_utils.c' object='libcw_test_public-libcw_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_utils.o `test -f 'libcw_utils.c' || echo '$(srcdir)/'`libcw_utils.c libcw_test_public-libcw_utils.obj: libcw_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_utils.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_utils.Tpo -c -o libcw_test_public-libcw_utils.obj `if test -f 'libcw_utils.c'; then $(CYGPATH_W) 'libcw_utils.c'; else $(CYGPATH_W) '$(srcdir)/libcw_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_utils.Tpo $(DEPDIR)/libcw_test_public-libcw_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_utils.c' object='libcw_test_public-libcw_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_utils.obj `if test -f 'libcw_utils.c'; then $(CYGPATH_W) 'libcw_utils.c'; else $(CYGPATH_W) '$(srcdir)/libcw_utils.c'; fi` libcw_test_public-libcw_signal.o: libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_signal.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_signal.Tpo -c -o libcw_test_public-libcw_signal.o `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_signal.Tpo $(DEPDIR)/libcw_test_public-libcw_signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_signal.c' object='libcw_test_public-libcw_signal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_signal.o `test -f 'libcw_signal.c' || echo '$(srcdir)/'`libcw_signal.c libcw_test_public-libcw_signal.obj: libcw_signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_signal.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_signal.Tpo -c -o libcw_test_public-libcw_signal.obj `if test -f 'libcw_signal.c'; then $(CYGPATH_W) 'libcw_signal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_signal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_signal.Tpo $(DEPDIR)/libcw_test_public-libcw_signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_signal.c' object='libcw_test_public-libcw_signal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_signal.obj `if test -f 'libcw_signal.c'; then $(CYGPATH_W) 'libcw_signal.c'; else $(CYGPATH_W) '$(srcdir)/libcw_signal.c'; fi` libcw_test_public-libcw_null.o: libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_null.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_null.Tpo -c -o libcw_test_public-libcw_null.o `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_null.Tpo $(DEPDIR)/libcw_test_public-libcw_null.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_null.c' object='libcw_test_public-libcw_null.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_null.o `test -f 'libcw_null.c' || echo '$(srcdir)/'`libcw_null.c libcw_test_public-libcw_null.obj: libcw_null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_null.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_null.Tpo -c -o libcw_test_public-libcw_null.obj `if test -f 'libcw_null.c'; then $(CYGPATH_W) 'libcw_null.c'; else $(CYGPATH_W) '$(srcdir)/libcw_null.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_null.Tpo $(DEPDIR)/libcw_test_public-libcw_null.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_null.c' object='libcw_test_public-libcw_null.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_null.obj `if test -f 'libcw_null.c'; then $(CYGPATH_W) 'libcw_null.c'; else $(CYGPATH_W) '$(srcdir)/libcw_null.c'; fi` libcw_test_public-libcw_console.o: libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_console.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_console.Tpo -c -o libcw_test_public-libcw_console.o `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_console.Tpo $(DEPDIR)/libcw_test_public-libcw_console.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_console.c' object='libcw_test_public-libcw_console.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_console.o `test -f 'libcw_console.c' || echo '$(srcdir)/'`libcw_console.c libcw_test_public-libcw_console.obj: libcw_console.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_console.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_console.Tpo -c -o libcw_test_public-libcw_console.obj `if test -f 'libcw_console.c'; then $(CYGPATH_W) 'libcw_console.c'; else $(CYGPATH_W) '$(srcdir)/libcw_console.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_console.Tpo $(DEPDIR)/libcw_test_public-libcw_console.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_console.c' object='libcw_test_public-libcw_console.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_console.obj `if test -f 'libcw_console.c'; then $(CYGPATH_W) 'libcw_console.c'; else $(CYGPATH_W) '$(srcdir)/libcw_console.c'; fi` libcw_test_public-libcw_oss.o: libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_oss.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_oss.Tpo -c -o libcw_test_public-libcw_oss.o `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_oss.Tpo $(DEPDIR)/libcw_test_public-libcw_oss.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_oss.c' object='libcw_test_public-libcw_oss.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_oss.o `test -f 'libcw_oss.c' || echo '$(srcdir)/'`libcw_oss.c libcw_test_public-libcw_oss.obj: libcw_oss.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_oss.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_oss.Tpo -c -o libcw_test_public-libcw_oss.obj `if test -f 'libcw_oss.c'; then $(CYGPATH_W) 'libcw_oss.c'; else $(CYGPATH_W) '$(srcdir)/libcw_oss.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_oss.Tpo $(DEPDIR)/libcw_test_public-libcw_oss.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_oss.c' object='libcw_test_public-libcw_oss.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_oss.obj `if test -f 'libcw_oss.c'; then $(CYGPATH_W) 'libcw_oss.c'; else $(CYGPATH_W) '$(srcdir)/libcw_oss.c'; fi` libcw_test_public-libcw_alsa.o: libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_alsa.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_alsa.Tpo -c -o libcw_test_public-libcw_alsa.o `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_alsa.Tpo $(DEPDIR)/libcw_test_public-libcw_alsa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_alsa.c' object='libcw_test_public-libcw_alsa.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_alsa.o `test -f 'libcw_alsa.c' || echo '$(srcdir)/'`libcw_alsa.c libcw_test_public-libcw_alsa.obj: libcw_alsa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_alsa.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_alsa.Tpo -c -o libcw_test_public-libcw_alsa.obj `if test -f 'libcw_alsa.c'; then $(CYGPATH_W) 'libcw_alsa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_alsa.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_alsa.Tpo $(DEPDIR)/libcw_test_public-libcw_alsa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_alsa.c' object='libcw_test_public-libcw_alsa.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_alsa.obj `if test -f 'libcw_alsa.c'; then $(CYGPATH_W) 'libcw_alsa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_alsa.c'; fi` libcw_test_public-libcw_pa.o: libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_pa.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_pa.Tpo -c -o libcw_test_public-libcw_pa.o `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_pa.Tpo $(DEPDIR)/libcw_test_public-libcw_pa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_pa.c' object='libcw_test_public-libcw_pa.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_pa.o `test -f 'libcw_pa.c' || echo '$(srcdir)/'`libcw_pa.c libcw_test_public-libcw_pa.obj: libcw_pa.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_pa.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_pa.Tpo -c -o libcw_test_public-libcw_pa.obj `if test -f 'libcw_pa.c'; then $(CYGPATH_W) 'libcw_pa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_pa.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_pa.Tpo $(DEPDIR)/libcw_test_public-libcw_pa.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_pa.c' object='libcw_test_public-libcw_pa.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_pa.obj `if test -f 'libcw_pa.c'; then $(CYGPATH_W) 'libcw_pa.c'; else $(CYGPATH_W) '$(srcdir)/libcw_pa.c'; fi` libcw_test_public-libcw_debug.o: libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_debug.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_debug.Tpo -c -o libcw_test_public-libcw_debug.o `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_debug.Tpo $(DEPDIR)/libcw_test_public-libcw_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_debug.c' object='libcw_test_public-libcw_debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_debug.o `test -f 'libcw_debug.c' || echo '$(srcdir)/'`libcw_debug.c libcw_test_public-libcw_debug.obj: libcw_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_debug.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_debug.Tpo -c -o libcw_test_public-libcw_debug.obj `if test -f 'libcw_debug.c'; then $(CYGPATH_W) 'libcw_debug.c'; else $(CYGPATH_W) '$(srcdir)/libcw_debug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_debug.Tpo $(DEPDIR)/libcw_test_public-libcw_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_debug.c' object='libcw_test_public-libcw_debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_debug.obj `if test -f 'libcw_debug.c'; then $(CYGPATH_W) 'libcw_debug.c'; else $(CYGPATH_W) '$(srcdir)/libcw_debug.c'; fi` libcw_test_public-libcw_test_public.o: libcw_test_public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_test_public.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_test_public.Tpo -c -o libcw_test_public-libcw_test_public.o `test -f 'libcw_test_public.c' || echo '$(srcdir)/'`libcw_test_public.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_test_public.Tpo $(DEPDIR)/libcw_test_public-libcw_test_public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_public.c' object='libcw_test_public-libcw_test_public.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_test_public.o `test -f 'libcw_test_public.c' || echo '$(srcdir)/'`libcw_test_public.c libcw_test_public-libcw_test_public.obj: libcw_test_public.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_test_public.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_test_public.Tpo -c -o libcw_test_public-libcw_test_public.obj `if test -f 'libcw_test_public.c'; then $(CYGPATH_W) 'libcw_test_public.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_public.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_test_public.Tpo $(DEPDIR)/libcw_test_public-libcw_test_public.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_public.c' object='libcw_test_public-libcw_test_public.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_test_public.obj `if test -f 'libcw_test_public.c'; then $(CYGPATH_W) 'libcw_test_public.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_public.c'; fi` libcw_test_public-libcw_test.o: libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_test.o -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_test.Tpo -c -o libcw_test_public-libcw_test.o `test -f 'libcw_test.c' || echo '$(srcdir)/'`libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_test.Tpo $(DEPDIR)/libcw_test_public-libcw_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test.c' object='libcw_test_public-libcw_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_test.o `test -f 'libcw_test.c' || echo '$(srcdir)/'`libcw_test.c libcw_test_public-libcw_test.obj: libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcw_test_public-libcw_test.obj -MD -MP -MF $(DEPDIR)/libcw_test_public-libcw_test.Tpo -c -o libcw_test_public-libcw_test.obj `if test -f 'libcw_test.c'; then $(CYGPATH_W) 'libcw_test.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_public-libcw_test.Tpo $(DEPDIR)/libcw_test_public-libcw_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test.c' object='libcw_test_public-libcw_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcw_test_public_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcw_test_public-libcw_test.obj `if test -f 'libcw_test.c'; then $(CYGPATH_W) 'libcw_test.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test.c'; fi` libcw_test_simple_gen-libcw_test_simple_gen.o: libcw_test_simple_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -MT libcw_test_simple_gen-libcw_test_simple_gen.o -MD -MP -MF $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Tpo -c -o libcw_test_simple_gen-libcw_test_simple_gen.o `test -f 'libcw_test_simple_gen.c' || echo '$(srcdir)/'`libcw_test_simple_gen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Tpo $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_simple_gen.c' object='libcw_test_simple_gen-libcw_test_simple_gen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -c -o libcw_test_simple_gen-libcw_test_simple_gen.o `test -f 'libcw_test_simple_gen.c' || echo '$(srcdir)/'`libcw_test_simple_gen.c libcw_test_simple_gen-libcw_test_simple_gen.obj: libcw_test_simple_gen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -MT libcw_test_simple_gen-libcw_test_simple_gen.obj -MD -MP -MF $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Tpo -c -o libcw_test_simple_gen-libcw_test_simple_gen.obj `if test -f 'libcw_test_simple_gen.c'; then $(CYGPATH_W) 'libcw_test_simple_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_simple_gen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Tpo $(DEPDIR)/libcw_test_simple_gen-libcw_test_simple_gen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test_simple_gen.c' object='libcw_test_simple_gen-libcw_test_simple_gen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -c -o libcw_test_simple_gen-libcw_test_simple_gen.obj `if test -f 'libcw_test_simple_gen.c'; then $(CYGPATH_W) 'libcw_test_simple_gen.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test_simple_gen.c'; fi` libcw_test_simple_gen-libcw_test.o: libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -MT libcw_test_simple_gen-libcw_test.o -MD -MP -MF $(DEPDIR)/libcw_test_simple_gen-libcw_test.Tpo -c -o libcw_test_simple_gen-libcw_test.o `test -f 'libcw_test.c' || echo '$(srcdir)/'`libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_simple_gen-libcw_test.Tpo $(DEPDIR)/libcw_test_simple_gen-libcw_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test.c' object='libcw_test_simple_gen-libcw_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -c -o libcw_test_simple_gen-libcw_test.o `test -f 'libcw_test.c' || echo '$(srcdir)/'`libcw_test.c libcw_test_simple_gen-libcw_test.obj: libcw_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -MT libcw_test_simple_gen-libcw_test.obj -MD -MP -MF $(DEPDIR)/libcw_test_simple_gen-libcw_test.Tpo -c -o libcw_test_simple_gen-libcw_test.obj `if test -f 'libcw_test.c'; then $(CYGPATH_W) 'libcw_test.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcw_test_simple_gen-libcw_test.Tpo $(DEPDIR)/libcw_test_simple_gen-libcw_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libcw_test.c' object='libcw_test_simple_gen-libcw_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcw_test_simple_gen_CFLAGS) $(CFLAGS) -c -o libcw_test_simple_gen-libcw_test.obj `if test -f 'libcw_test.c'; then $(CYGPATH_W) 'libcw_test.c'; else $(CYGPATH_W) '$(srcdir)/libcw_test.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || 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 '/\.3[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,^[^3][0-9a-z]*$$,3,;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)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$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)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-man7: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || 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 '/\.7[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,^[^7][0-9a-z]*$$,7,;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)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$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)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || 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)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-libcw_includeHEADERS: $(libcw_include_HEADERS) @$(NORMAL_INSTALL) @list='$(libcw_include_HEADERS)'; test -n "$(libcw_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libcw_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libcw_includedir)" || 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_HEADER) $$files '$(DESTDIR)$(libcw_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libcw_includedir)" || exit $$?; \ done uninstall-libcw_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libcw_include_HEADERS)'; test -n "$(libcw_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libcw_includedir)'; $(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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) $(check_SCRIPTS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? libcw_test_internal.sh.log: libcw_test_internal.sh @p='libcw_test_internal.sh'; \ b='libcw_test_internal.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(MANS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libcw_includedir)"; 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-libcw_includeHEADERS install-man \ install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-man7 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-libcw_includeHEADERS \ uninstall-man uninstall-pkgconfigDATA uninstall-man: uninstall-man3 uninstall-man7 .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libcw_includeHEADERS \ install-man install-man3 install-man7 install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libcw_includeHEADERS uninstall-man uninstall-man3 \ uninstall-man7 uninstall-pkgconfigDATA -include $(top_builddir)/Makefile.inc # target: libcw man page libcw.3: libcw.3.m4 cat $(top_srcdir)/src/libcw/*.c | $(AC_AWK) -f $(top_srcdir)/src/libcw/libdoc.awk | $(AC_AWK) -f $(top_srcdir)/src/libcw/libsigs.awk > signatures cat $(top_srcdir)/src/libcw/*.c | $(AC_AWK) -f $(top_srcdir)/src/libcw/libdoc.awk | $(AC_AWK) -f $(top_srcdir)/src/libcw/libfuncs.awk > functions $(AC_AWK) -f $(top_srcdir)/src/libcw/include.awk < $(top_srcdir)/src/libcw/libcw.3.m4 >libcw.3 rm -f signatures functions libcw_test_internal.sh: echo './libcw_test_internal | grep "test result: success"' > libcw_test_internal.sh chmod +x libcw_test_internal.sh # sources, references # # source of snippet related to "check_SCRIPTS" and related sh script: # http://www.freesoftwaremagazine.com/books/agaal/automatically_writing_makefiles_with_autotools # 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: unixcw-3.4.2/src/libcw/libcw_test.c0000644000175000017500000000752312451277514017070 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ /** \file libcw_test.c \brief Utility functions for test executables. */ #include "config.h" #define _XOPEN_SOURCE 600 /* signaction() + SA_RESTART */ #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "libcw_debug.h" #include "libcw_test.h" int cw_test_args(int argc, char *const argv[], char *sound_systems, size_t systems_max, char *modules, size_t modules_max) { strncpy(sound_systems, "ncoap", systems_max); sound_systems[systems_max] = '\0'; strncpy(modules, "gtko", modules_max); modules[modules_max] = '\0'; if (argc == 1) { fprintf(stderr, "sound systems = \"%s\"\n", sound_systems); fprintf(stderr, "modules = \"%s\"\n", modules); return CW_SUCCESS; } int opt; while ((opt = getopt(argc, argv, "m:s:")) != -1) { switch (opt) { case 's': { size_t len = strlen(optarg); if (!len || len > systems_max) { return CW_FAILURE; } int j = 0; for (size_t i = 0; i < len; i++) { if (optarg[i] != 'n' && optarg[i] != 'c' && optarg[i] != 'o' && optarg[i] != 'a' && optarg[i] != 'p') { return CW_FAILURE; } else { sound_systems[j] = optarg[i]; j++; } } sound_systems[j] = '\0'; } break; case 'm': { size_t len = strlen(optarg); if (!len || len > modules_max) { return CW_FAILURE; } int j = 0; for (size_t i = 0; i < len; i++) { if (optarg[i] != 'g' /* Generator. */ && optarg[i] != 't' /* Tone queue. */ && optarg[i] != 'k' /* Morse key. */ && optarg[i] != 'o') { /* Other. */ return CW_FAILURE; } else { modules[j] = optarg[i]; j++; } } modules[j] = '\0'; } break; default: /* '?' */ return CW_FAILURE; } } fprintf(stderr, "sound systems = \"%s\"\n", sound_systems); fprintf(stderr, "modules = \"%s\"\n", modules); return CW_SUCCESS; } void cw_test_print_help(const char *progname) { fprintf(stderr, "Usage: %s [-s ] [-m ]\n\n", progname); fprintf(stderr, " is one or more of those:\n"); fprintf(stderr, " n - null\n"); fprintf(stderr, " c - console\n"); fprintf(stderr, " o - OSS\n"); fprintf(stderr, " a - ALSA\n"); fprintf(stderr, " p - PulseAudio\n"); fprintf(stderr, "\n"); fprintf(stderr, " is one or more of those:\n"); fprintf(stderr, " g - generator\n"); fprintf(stderr, " t - tone queue\n"); fprintf(stderr, " k - Morse key\n"); fprintf(stderr, " o - other\n"); fprintf(stderr, "\n"); fprintf(stderr, " If no argument is provided, the program will attempt to test all audio systems and all modules\n"); return; } unixcw-3.4.2/src/libcw/libcw_null.h0000644000175000017500000000053612365202451017055 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_NULL #define H_LIBCW_NULL #include "libcw_gen.h" #include "libcw_tq.h" int cw_null_configure(cw_gen_t *gen, const char *device); void cw_null_write(cw_gen_t *gen, cw_tone_t *tone); #endif /* #ifndef H_LIBCW_NULL */ unixcw-3.4.2/src/libcw/libcw_pa.h0000644000175000017500000000114012365203602016472 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_PA #define H_LIBCW_PA #include "config.h" #ifdef LIBCW_WITH_PULSEAUDIO #include #include typedef struct cw_pa_data_struct { pa_simple *s; /* audio handle */ pa_sample_spec ss; /* sample specification */ pa_usec_t latency_usecs; pa_buffer_attr ba; } cw_pa_data_t; #endif /* #ifdef LIBCW_WITH_PULSEAUDIO */ #include "libcw_gen.h" int cw_pa_configure(cw_gen_t *gen, const char *device); #endif /* #ifndef H_LIBCW_PA */ unixcw-3.4.2/src/libcw/libcw.c0000644000175000017500000014746012502644604016031 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw.c */ #include /* EINVAL on FreeBSD */ #include "libcw.h" #include "libcw_gen.h" #include "libcw_rec.h" #include "libcw_key.h" #include "libcw_debug.h" /* Main container for data related to generating audible Morse code. This is a global variable in library file, but in future the variable will be moved from the file to client code. This is a global variable that should be converted into a function argument; this pointer should exist only in client's code, should initially be returned by new(), and deleted by delete(). TODO: perform the conversion later, when you figure out ins and outs of the library. */ cw_gen_t *cw_generator = NULL; /* From libcw_debug.c. */ extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; static cw_rec_t cw_receiver = { .state = RS_IDLE, .speed = CW_SPEED_INITIAL, .tolerance = CW_TOLERANCE_INITIAL, .gap = CW_GAP_INITIAL, .is_adaptive_receive_mode = CW_REC_ADAPTIVE_MODE_INITIAL, .noise_spike_threshold = CW_REC_NOISE_THRESHOLD_INITIAL, /* TODO: this variable is not set in cw_rec_reset_receive_parameters_internal(). Why is it separated from the four main variables? Is it because it is a derivative of speed? But speed is a derivative of this variable in adaptive speed mode. */ .adaptive_speed_threshold = CW_REC_SPEED_THRESHOLD_INITIAL, .mark_start = { 0, 0 }, .mark_end = { 0, 0 }, .representation[0] = '\0', .representation_ind = 0, .dot_len_ideal = 0, .dot_len_min = 0, .dot_len_max = 0, .dash_len_ideal = 0, .dash_len_min = 0, .dash_len_max = 0, .eom_len_ideal = 0, .eom_len_min = 0, .eom_len_max = 0, .eoc_len_ideal = 0, .eoc_len_min = 0, .eoc_len_max = 0, .additional_delay = 0, .adjustment_delay = 0, .parameters_in_sync = false, .statistics = { {0, 0} }, .statistics_ind = 0, .dot_averaging = { {0}, 0, 0, 0 }, .dash_averaging = { {0}, 0, 0, 0 }, }; static volatile cw_key_t cw_key = { .gen = NULL, .rec = &cw_receiver, .key_callback = NULL, .key_callback_arg = NULL, .sk = { .key_value = CW_KEY_STATE_OPEN }, .ik = { .graph_state = KS_IDLE, .key_value = CW_KEY_STATE_OPEN, .dot_paddle = false, .dash_paddle = false, .dot_latch = false, .dash_latch = false, .curtis_mode_b = false, .curtis_b_latch = false, .lock = false, .timer = NULL }, .tk = { .key_value = CW_KEY_STATE_OPEN } }; /* ******************************************************************** */ /* Generator */ /* ******************************************************************** */ /** \brief Create new generator Allocate memory for new generator data structure, set up default values of some of the generator's properties. The function does not start the generator (generator does not produce a sound), you have to use cw_generator_start() for this. Notice that the function doesn't return a generator variable. There is at most one generator variable at any given time. You can't have two generators. In some future version of the library the function will return pointer to newly allocated generator, and then you could have as many of them as you want, but not yet. \p audio_system can be one of following: NULL, console, OSS, ALSA, PulseAudio, soundcard. See "enum cw_audio_systems" in libcw.h for exact names of symbolic constants. \param audio_system - audio system to be used by the generator \param device - name of audio device to be used; if NULL then library will use default device. */ int cw_generator_new(int audio_system, const char *device) { cw_generator = cw_gen_new_internal(audio_system, device); if (!cw_generator) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: can't create generator"); return CW_FAILURE; } else { /* For some (all?) applications a key needs to have some generator associated with it. */ cw_key_register_generator_internal(&cw_key, cw_generator); return CW_SUCCESS; } } /** \brief Deallocate generator Deallocate/destroy generator data structure created with call to cw_generator_new(). You can't start nor use the generator after the call to this function. */ void cw_generator_delete(void) { cw_gen_delete_internal(&cw_generator); return; } /** \brief Start a generator Start producing tones using generator created with cw_generator_new(). The source of tones is a tone queue associated with the generator. If the tone queue is empty, the generator will wait for new tones to be queued. \return CW_FAILURE on errors \return CW_SUCCESS on success */ int cw_generator_start(void) { return cw_gen_start_internal(cw_generator); } /** \brief Shut down a generator Silence tone generated by generator (level of generated sine wave is set to zero, with falling slope), and shut the generator down. The shutdown does not erase generator's configuration. If you want to have this generator running again, you have to call cw_generator_start(). */ void cw_generator_stop(void) { cw_gen_stop_internal(cw_generator); return; } /** \brief Delete a generator - wrapper used in libcw_utils.c */ void cw_generator_delete_internal(void) { if (cw_generator) { cw_gen_delete_internal(&cw_generator); } return; } /** \brief Set sending speed of generator See libcw.h/CW_SPEED_{INITIAL|MIN|MAX} for initial/minimal/maximal value of send speed. errno is set to EINVAL if \p new_value is out of range. testedin::test_parameter_ranges() \param new_value - new value of send speed to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_send_speed(int new_value) { int rv = cw_gen_set_speed_internal(cw_generator, new_value); return rv; } /** \brief Set frequency of generator Set frequency of sound wave generated by generator. The frequency must be within limits marked by CW_FREQUENCY_MIN and CW_FREQUENCY_MAX. See libcw.h/CW_FREQUENCY_{INITIAL|MIN|MAX} for initial/minimal/maximal value of frequency. errno is set to EINVAL if \p new_value is out of range. \param new_value - new value of frequency to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_frequency(int new_value) { int rv = cw_gen_set_frequency_internal(cw_generator, new_value); return rv; } /** \brief Set volume of generator Set volume of sound wave generated by generator. The volume must be within limits marked by CW_VOLUME_MIN and CW_VOLUME_MAX. Note that volume settings are not fully possible for the console speaker. In this case, volume settings greater than zero indicate console speaker sound is on, and setting volume to zero will turn off console speaker sound. See libcw.h/CW_VOLUME_{INITIAL|MIN|MAX} for initial/minimal/maximal value of volume. errno is set to EINVAL if \p new_value is out of range. testedin::test_volume_functions() testedin::test_parameter_ranges() \param new_value - new value of volume to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_volume(int new_value) { int rv = cw_gen_set_volume_internal(cw_generator, new_value); return rv; } /** \brief Set sending gap of generator See libcw.h/CW_GAP_{INITIAL|MIN|MAX} for initial/minimal/maximal value of gap. errno is set to EINVAL if \p new_value is out of range. Notice that this function also sets the same gap value for library's receiver. testedin::test_parameter_ranges() \param new_value - new value of gap to be assigned to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_gap(int new_value) { int rv = cw_gen_set_gap_internal(cw_generator, new_value); if (rv != CW_FAILURE) { /* Ideally generator and receiver should have their own, separate cw_set_gap() functions. Unfortunately this is not the case (for now) so gap should be set here for receiver as well. TODO: add cw_set_gap() function for receiver. */ rv = cw_rec_set_gap_internal(&cw_receiver, new_value); } return rv; } /** \brief Set sending weighting for generator See libcw.h/CW_WEIGHTING_{INITIAL|MIN|MAX} for initial/minimal/maximal value of weighting. errno is set to EINVAL if \p new_value is out of range. testedin::test_parameter_ranges() \param new_value - new value of weighting to be assigned for generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_weighting(int new_value) { int rv = cw_gen_set_weighting_internal(cw_generator, new_value); return rv; } /** \brief Get sending speed from generator testedin::test_parameter_ranges() \return current value of the generator's send speed */ int cw_get_send_speed(void) { return cw_gen_get_speed_internal(cw_generator); } /** \brief Get frequency from generator Function returns "frequency" parameter of generator, even if the generator is stopped, or volume of generated sound is zero. testedin::test_parameter_ranges() \return current value of generator's frequency */ int cw_get_frequency(void) { return cw_gen_get_frequency_internal(cw_generator); } /** \brief Get sound volume from generator Function returns "volume" parameter of generator, even if the generator is stopped. testedin::test_volume_functions() testedin::test_parameter_ranges() \return current value of generator's sound volume */ int cw_get_volume(void) { return cw_gen_get_volume_internal(cw_generator); } /** \brief Get sending gap from generator testedin::test_parameter_ranges() \return current value of generator's sending gap */ int cw_get_gap(void) { return cw_gen_get_gap_internal(cw_generator); } /** \brief Get sending weighting from generator testedin::test_parameter_ranges() \return current value of generator's sending weighting */ int cw_get_weighting(void) { return cw_gen_get_weighting_internal(cw_generator); } /** \brief Get timing parameters for sending Return the low-level timing parameters calculated from the speed, gap, tolerance, and weighting set. Parameter values are returned in microseconds. Use NULL for the pointer argument to any parameter value not required. \param dot_usecs \param dash_usecs \param end_of_element_usecs \param end_of_character_usecs \param end_of_word_usecs \param additional_usecs \param adjustment_usecs */ void cw_get_send_parameters(int *dot_usecs, int *dash_usecs, int *end_of_element_usecs, int *end_of_character_usecs, int *end_of_word_usecs, int *additional_usecs, int *adjustment_usecs) { cw_gen_get_send_parameters_internal(cw_generator, dot_usecs, dash_usecs, end_of_element_usecs, end_of_character_usecs, end_of_word_usecs, additional_usecs, adjustment_usecs); return; } /** \brief Low-level primitive for sending a dot mark Low-level primitive function able to play/send single dot mark. The function appends to a tone queue a normal inter-mark gap after the dot mark. testedin::test_send_primitives() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_dot(void) { return cw_gen_play_mark_internal(cw_generator, CW_DOT_REPRESENTATION); } /** \brief Low-level primitive for sending a dash mark Low-level primitive function able to play/send single dash mark. The function appends to a tone queue a normal inter-mark gap after the dash mark. testedin::test_send_primitives() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_dash(void) { return cw_gen_play_mark_internal(cw_generator, CW_DASH_REPRESENTATION); } /** The function plays space timed to exclude the expected prior dot/dash inter-mark gap. FIXME: fix this description. testedin::test_send_primitives() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_character_space(void) { return cw_gen_play_eoc_space_internal(cw_generator); } /** The function sends space timed to exclude both the expected prior dot/dash inter-mark gap and the prior end of character space. FIXME: fix this description. testedin::test_send_primitives() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_word_space(void) { return cw_gen_play_eow_space_internal(cw_generator); } /** \brief Check, then send the given string as dots and dashes. The representation passed in is assumed to be a complete Morse character; that is, all post-character delays will be added when the character is sent. On success, the routine returns CW_SUCCESS. On failure, it returns CW_FAILURE, with errno set to EINVAL if any character of the representation is invalid, EBUSY if the sound card, console speaker, or keying system is busy, or EAGAIN if the tone queue is full, or if there is insufficient space to queue the tones or the representation. testedin::test_representations() \param representation - representation to send \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_representation(const char *representation) { return cw_gen_play_representation_internal(cw_generator, representation, false); } /** \brief Check, then send the given string as dots and dashes The \p representation passed in is assumed to be only part of a larger Morse representation; that is, no post-character delays will be added when the character is sent. On success, the routine returns CW_SUCCESS. On failure, it returns CW_FAILURE, with errno set to EINVAL if any character of the representation is invalid, EBUSY if the sound card, console speaker, or keying system is busy, or EAGAIN if the tone queue is full, or if there is insufficient space to queue the tones for the representation. testedin::test_representations() */ int cw_send_representation_partial(const char *representation) { return cw_gen_play_representation_internal(cw_generator, representation, true); } /** \brief Look up and send a given ASCII character as Morse The end of character delay is appended to the Morse sent. On success the routine returns CW_SUCCESS. On failure the function returns CW_FAILURE and sets errno. errno is set to ENOENT if the given character \p c is not a valid Morse character. errno is set to EBUSY if current audio sink or keying system is busy. errno is set to EAGAIN if the generator's tone queue is full, or if there is insufficient space to queue the tones for the character. This routine returns as soon as the character has been successfully queued for sending; that is, almost immediately. The actual sending happens in background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. testedin::test_send_character_and_string() \param c - character to send \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_character(char c) { return cw_gen_play_character_internal(cw_generator, c); } /** \brief Look up and send a given ASCII character as Morse code "partial" means that the "end of character" delay is not appended to the Morse code sent by the function, to support the formation of combination characters. On success the function returns CW_SUCCESS. On failure the function returns CW_FAILURE and sets errno. errno is set to ENOENT if the given character \p c is not a valid Morse character. errno is set to EBUSY if the audio sink or keying system is busy. errno is set to EAGAIN if the tone queue is full, or if there is insufficient space to queue the tones for the character. This routine queues its arguments for background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. \param c - character to send \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_character_partial(char c) { return cw_gen_play_character_parital_internal(cw_generator, c); } /** \brief Send a given ASCII string in Morse code errno is set to ENOENT if any character in the string is not a valid Morse character. errno is set to EBUSY if audio sink or keying system is busy. errno is set to EAGAIN if the tone queue is full or if the tone queue runs out of space part way through queueing the string. However, an indeterminate number of the characters from the string will have already been queued. For safety, clients can ensure the tone queue is empty before queueing a string, or use cw_send_character() if they need finer control. This routine queues its arguments for background processing, the actual sending happens in background processing. See cw_wait_for_tone() and cw_wait_for_tone_queue() for ways to check the progress of sending. testedin::test_send_character_and_string() \param string - string to send \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_send_string(const char *string) { return cw_gen_play_string_internal(cw_generator, string); } /** \brief Reset send/receive parameters Reset the library speed, frequency, volume, gap, tolerance, weighting, adaptive receive, and noise spike threshold to their initial default values: send/receive speed 12 WPM, volume 70 %, frequency 800 Hz, gap 0 dots, tolerance 50 %, and weighting 50 %. */ void cw_reset_send_receive_parameters(void) { cw_gen_reset_send_parameters_internal(cw_generator); cw_rec_reset_receive_parameters_internal(&cw_receiver); /* Reset requires resynchronization. */ cw_gen_sync_parameters_internal(cw_generator); cw_rec_sync_parameters_internal(&cw_receiver); return; } /** \brief Return char string with console device path Returned pointer is owned by library. \return char string with current console device path */ const char *cw_get_console_device(void) { return cw_generator->audio_device; } /** \brief Return char string with soundcard device name/path Returned pointer is owned by library. \return char string with current soundcard device name or device path */ const char *cw_get_soundcard_device(void) { return cw_generator->audio_device; } /** \brief Get a readable label of current audio system The function returns one of following strings: None, Null, Console, OSS, ALSA, PulseAudio, Soundcard \return audio system's label */ const char *cw_generator_get_audio_system_label(void) { return cw_get_audio_system_label(cw_generator->audio_system); } /* ******************************************************************** */ /* Tone queue */ /* ******************************************************************** */ /** \brief Register callback for low queue state Register a function to be called automatically by the dequeue routine whenever the tone queue falls to a given \p level. To be more precise: the callback is called by queue manager if, after dequeueing a tone, the manager notices that tone queue length has become equal or less than \p level. \p callback_arg may be used to give a value passed back on callback calls. A NULL function pointer suppresses callbacks. On success, the routine returns CW_SUCCESS. If \p level is invalid, the routine returns CW_FAILURE with errno set to EINVAL. Any callback supplied will be called in signal handler context. testedin::test_tone_queue_callback() \param callback_func - callback function to be registered \param callback_arg - argument for callback_func to pass return value \param level - low level of queue triggering callback call \return CW_SUCCESS on successful registration \return CW_FAILURE on failure */ int cw_register_tone_queue_low_callback(void (*callback_func)(void*), void *callback_arg, int level) { return cw_tq_register_low_level_callback_internal(cw_generator->tq, callback_func, callback_arg, level); } /** \brief Check if tone sender is busy Indicate if the tone sender is busy. \return true if there are still entries in the tone queue \return false if the queue is empty */ bool cw_is_tone_busy(void) { return cw_tq_is_busy_internal(cw_generator->tq); } /** \brief Wait for the current tone to complete The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns CW_FAILURE, with errno set to EDEADLK, to avoid indefinite waits. testedin::test_tone_queue_1() testedin::test_tone_queue_2() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_wait_for_tone(void) { return cw_tq_wait_for_tone_internal(cw_generator->tq); } /** \brief Wait for the tone queue to drain The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns false, with errno set to EDEADLK, to avoid indefinite waits. testedin::test_tone_queue_1() testedin::test_tone_queue_2() testedin::test_tone_queue_3() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_wait_for_tone_queue(void) { return cw_tq_wait_for_tone_queue_internal(cw_generator->tq); } /** \brief Wait for the tone queue to drain until only as many tones as given in level remain queued This routine is for use by programs that want to optimize themselves to avoid the cleanup that happens when the tone queue drains completely; such programs have a short time in which to add more tones to the queue. The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns false, with errno set to EDEADLK, to avoid indefinite waits. \param level - low level in queue, at which to return \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_wait_for_tone_queue_critical(int level) { return cw_tq_wait_for_level_internal(cw_generator->tq, (uint32_t) level); } /** \brief Indicate if the tone queue is full testedin::test_cw_tq_is_full_internal() \return true if tone queue is full \return false if tone queue is not full */ bool cw_is_tone_queue_full(void) { return cw_tq_is_full_internal(cw_generator->tq); } /** \brief Return the number of entries the tone queue can accommodate testedin::test_tone_queue_3() testedin::test_cw_tq_get_capacity_internal() */ int cw_get_tone_queue_capacity(void) { return (int) cw_tq_get_capacity_internal(cw_generator->tq); } /** \brief Return the number of entries currently pending in the tone queue testedin::test_cw_tq_length_internal() testedin::test_tone_queue_1() testedin::test_tone_queue_3() */ int cw_get_tone_queue_length(void) { return (int) cw_tq_length_internal(cw_generator->tq); } /** \brief Cancel all pending queued tones, and return to silence. If there is a tone in progress, the function will wait until this last one has completed, then silence the tones. This function may be called with SIGALRM blocked, in which case it will empty the queue as best it can, then return without waiting for the final tone to complete. In this case, it may not be possible to guarantee silence after the call. */ void cw_flush_tone_queue(void) { /* This function locks and unlocks mutex. */ cw_tq_flush_internal(cw_generator->tq); /* Force silence on the speaker anyway, and stop any background soundcard tone generation. */ cw_gen_silence_internal(cw_generator); //cw_finalization_schedule_internal(); return; } /** Cancel all pending queued tones, reset any queue low callback registered, and return to silence. This function is suitable for calling from an application exit handler. */ void cw_reset_tone_queue(void) { cw_tq_reset_internal(cw_generator->tq); /* Silence sound and stop any background soundcard tone generation. */ cw_gen_silence_internal(cw_generator); //cw_finalization_schedule_internal(); cw_debug_msg ((&cw_debug_object), CW_DEBUG_TONE_QUEUE, CW_DEBUG_INFO, "libcw: tone queue: reset"); return; } /** \brief Primitive access to simple tone generation This routine queues a tone of given duration and frequency. The routine returns CW_SUCCESS on success. If usec or frequency are invalid, it returns CW_FAILURE with errno set to EINVAL. If the sound card, console speaker, or keying function are busy, it returns CW_FAILURE with errno set to EBUSY. If the tone queue is full, it returns false with errno set to EAGAIN. testedin::test_tone_queue_0() testedin::test_tone_queue_1() testedin::test_tone_queue_2() testedin::test_tone_queue_3() \param usecs - duration of queued tone, in microseconds \param frequency - frequency of queued tone \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_queue_tone(int usecs, int frequency) { /* Check the arguments given for realistic values. This test is left here for legacy reasons. Don't change it. */ if (usecs < 0 || frequency < CW_FREQUENCY_MIN || frequency > CW_FREQUENCY_MAX) { errno = EINVAL; return CW_FAILURE; } cw_tone_t tone; CW_TONE_INIT(&tone, frequency, usecs, CW_SLOPE_MODE_STANDARD_SLOPES); int rv = cw_tq_enqueue_internal(cw_generator->tq, &tone); return rv; } /* ******************************************************************** */ /* Receiver */ /* ******************************************************************** */ /** \brief Set receiving speed of receiver See documentation of cw_set_send_speed() for more information. See libcw.h/CW_SPEED_{INITIAL|MIN|MAX} for initial/minimal/maximal value of receive speed. errno is set to EINVAL if \p new_value is out of range. errno is set to EPERM if adaptive receive speed tracking is enabled. testedin::test_parameter_ranges() \param new_value - new value of receive speed to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_receive_speed(int new_value) { return cw_rec_set_speed_internal(&cw_receiver, new_value); } /** \brief Get receiving speed from receiver testedin::test_parameter_ranges() \return current value of the receiver's receive speed */ int cw_get_receive_speed(void) { return (int) cw_rec_get_speed_internal(&cw_receiver); } /** \brief Set tolerance for receiver See libcw.h/CW_TOLERANCE_{INITIAL|MIN|MAX} for initial/minimal/maximal value of tolerance. errno is set to EINVAL if \p new_value is out of range. testedin::test_parameter_ranges() \param new_value - new value of tolerance to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_tolerance(int new_value) { return cw_rec_set_tolerance_internal(&cw_receiver, new_value); } /** \brief Get tolerance from receiver testedin::test_parameter_ranges() \return current value of receiver's tolerance */ int cw_get_tolerance(void) { return cw_rec_get_tolerance_internal(&cw_receiver); } /** \brief Get timing parameters for receiving, and adaptive threshold Return the low-level timing parameters calculated from the speed, gap, tolerance, and weighting set. Parameter values are returned in microseconds. Use NULL for the pointer argument to any parameter value not required. \param dot_usecs \param dash_usecs \param dot_min_usecs \param dot_max_usecs \param dash_min_usecs \param dash_max_usecs \param end_of_element_min_usecs \param end_of_element_max_usecs \param end_of_element_ideal_usecs \param end_of_character_min_usecs \param end_of_character_max_usecs \param end_of_character_ideal_usecs \param adaptive_threshold */ void cw_get_receive_parameters(int *dot_usecs, int *dash_usecs, int *dot_min_usecs, int *dot_max_usecs, int *dash_min_usecs, int *dash_max_usecs, int *end_of_element_min_usecs, int *end_of_element_max_usecs, int *end_of_element_ideal_usecs, int *end_of_character_min_usecs, int *end_of_character_max_usecs, int *end_of_character_ideal_usecs, int *adaptive_threshold) { cw_rec_get_parameters_internal(&cw_receiver, dot_usecs, dash_usecs, dot_min_usecs, dot_max_usecs, dash_min_usecs, dash_max_usecs, end_of_element_min_usecs, end_of_element_max_usecs, end_of_element_ideal_usecs, end_of_character_min_usecs, end_of_character_max_usecs, end_of_character_ideal_usecs, adaptive_threshold); return; } /** \brief Set noise spike threshold for receiver Set the period shorter than which, on receive, received marks are ignored. This allows the "receive mark" functions to apply noise canceling for very short apparent marks. For useful results the value should never exceed the dot length of a dot at maximum speed: 20000 microseconds (the dot length at 60WPM). Setting a noise threshold of zero turns off receive mark noise canceling. The default noise spike threshold is 10000 microseconds. errno is set to EINVAL if \p new_value is out of range. \param new_value - new value of noise spike threshold to be assigned to receiver \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_set_noise_spike_threshold(int new_value) { return cw_rec_set_noise_spike_threshold_internal(&cw_receiver, new_value); } /** \brief Get noise spike threshold from receiver See documentation of cw_set_noise_spike_threshold() for more information \return current value of receiver's threshold */ int cw_get_noise_spike_threshold(void) { return cw_rec_get_noise_spike_threshold_internal(&cw_receiver); } /** \brief Calculate and return receiver's timing statistics These statistics may be used to obtain a measure of the accuracy of received CW. The values \p dot_sd and \p dash_sd contain the standard deviation of dot and dash lengths from the ideal values, and \p element_end_sd and \p character_end_sd the deviations for inter element and inter character spacing. Statistics are held for all timings in a 256 element circular buffer. If any statistic cannot be calculated, because no records for it exist, the returned value is 0.0. Use NULL for the pointer argument to any statistic not required. \param dot_sd \param dash_sd \param element_end_sd \param character_end_sd */ void cw_get_receive_statistics(double *dot_sd, double *dash_sd, double *element_end_sd, double *character_end_sd) { cw_rec_get_statistics_internal(&cw_receiver, dot_sd, dash_sd, element_end_sd, character_end_sd); return; } /** \brief Clear the receive statistics buffer Clear the receive statistics buffer by removing all records from it and returning it to its initial default state. */ void cw_reset_receive_statistics(void) { cw_rec_reset_receive_statistics_internal(&cw_receiver); return; } /** \brief Enable adaptive receive speed tracking If adaptive speed tracking is enabled, the receive functions will attempt to automatically adjust the receive speed setting to match the speed of the incoming Morse code. If it is disabled, the receive functions will use fixed speed settings, and reject incoming Morse which is not at the expected speed. Adaptive speed tracking uses a moving average length of the past N marks as its baseline for tracking speeds. The default state is adaptive speed tracking disabled. */ void cw_enable_adaptive_receive(void) { cw_rec_set_adaptive_mode_internal(&cw_receiver, true); return; } /** \brief Disable adaptive receive speed tracking See documentation of cw_enable_adaptive_receive() for more information */ void cw_disable_adaptive_receive(void) { cw_rec_set_adaptive_mode_internal(&cw_receiver, false); return; } /** \brief Get adaptive receive speed tracking flag The function returns state of "adaptive receive enabled" flag. See documentation of cw_enable_adaptive_receive() for more information \return true if adaptive speed tracking is enabled \return false otherwise */ bool cw_get_adaptive_receive_state(void) { return cw_rec_get_adaptive_mode_internal(&cw_receiver); } /** \brief Signal beginning of receive mark Called on the start of a receive mark. If the \p timestamp is NULL, the current timestamp is used as beginning of mark. The function should be called by client application when pressing a key down (closing a circuit) has been detected by client application. On error the function returns CW_FAILURE, with errno set to ERANGE if the call is directly after another cw_start_receive_tone() call or if an existing received character has not been cleared from the buffer, or EINVAL if the timestamp passed in is invalid. \param timestamp - time stamp of "key down" event \return CW_SUCCESS on success \return CW_FAILURE otherwise (with errno set) */ int cw_start_receive_tone(const struct timeval *timestamp) { return cw_rec_mark_begin_internal(&cw_receiver, timestamp); } /** \brief Signal end of mark The function should be called by client application when releasing a key (opening a circuit) has been detected by client application. If the \p timestamp is NULL, the current time is used as timestamp of end of mark. On success, the routine adds a dot or dash to the receiver's representation buffer, and returns CW_SUCCESS. On failure, it returns CW_FAIURE, with errno set to: ERANGE if the call was not preceded by a cw_start_receive_tone() call, EINVAL if the timestamp passed in is not valid, ENOENT if the mark length was out of bounds for the permissible dot and dash lengths and fixed speed receiving is selected, ENOMEM if the receiver's representation buffer is full, EAGAIN if the mark was shorter than the threshold for noise and was therefore ignored. \param timestamp - time stamp of "key up" event \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_end_receive_tone(const struct timeval *timestamp) { return cw_rec_mark_end_internal(&cw_receiver, timestamp); } /** \brief Add a dot to the receiver's representation buffer Documentation for both cw_receive_buffer_dot() and cw_receive_buffer_dash(): Since we can't add a mark to the buffer without any accompanying timing information, the functions accepts \p timestamp of the "end of mark" event. If the \p timestamp is NULL, the current timestamp is used. These routines are for client code that has already determined whether a dot or dash was received by a method other than calling the routines cw_start_receive_tone() and cw_end_receive_tone(). On success, the relevant mark is added to the receiver's representation buffer. On failure, the routines return CW_FAILURE, with errno set to ERANGE if preceded by a cw_start_receive_tone() call with no matching cw_end_receive_tone() or if an error condition currently exists within the receiver's buffer, or ENOMEM if the receiver's representation buffer is full. \param timestamp - timestamp of "end of dot" event \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_receive_buffer_dot(const struct timeval *timestamp) { return cw_rec_add_mark_internal(&cw_receiver, timestamp, CW_DOT_REPRESENTATION); } /** \brief Add a dash to the receiver's representation buffer See documentation of cw_receive_buffer_dot() for more information. \param timestamp - timestamp of "end of dash" event \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_receive_buffer_dash(const struct timeval *timestamp) { return cw_rec_add_mark_internal(&cw_receiver, timestamp, CW_DASH_REPRESENTATION); } /** \brief Get the current buffered representation from the receiver's representation buffer On success the function fills in \p representation with the contents of the current representation buffer and returns CW_SUCCESS. On failure, it returns CW_FAILURE and sets errno to: ERANGE if not preceded by a cw_end_receive_tone() call, a prior successful cw_receive_representation call, or a prior cw_receive_buffer_dot or cw_receive_buffer_dash, EINVAL if the timestamp passed in is invalid, EAGAIN if the call is made too early to determine whether a complete representation has yet been placed in the buffer (that is, less than the end-of-character gap period elapsed since the last cw_end_receive_tone() or cw_receive_buffer_dot/dash call). This is not a *hard* error, just an information that the caller should try to get the representation later. \p is_end_of_word indicates that the space after the last mark received is longer that the end-of-character gap, so it must be qualified as end-of-word gap. \p is_error indicates that the representation was terminated by an error condition. TODO: the function should be called cw_receiver_poll_representation(). The function is called periodically (poll()-like function) by client code in hope that at some attempt receiver will be ready to pass \p representation. The attempt succeeds only if data stream is in "space" state. To mark end of the space, client code has to provide a timestamp (or pass NULL timestamp, the function will get time stamp at function call). The receiver needs to know the "end of space" event - thus the \p timestamp parameter. testedin::test_helper_receive_tests() \param timestamp - timestamp of event that ends "end-of-character" gap or "end-of-word" gap \param representation - buffer for representation (output parameter) \param is_end_of_word - buffer for "is end of word" state (output parameter) \param is_error - buffer for "error" state (output parameter) \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_receive_representation(const struct timeval *timestamp, /* out */ char *representation, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { int rv = cw_rec_poll_representation_internal(&cw_receiver, timestamp, representation, is_end_of_word, is_error); return rv; } /** \brief Get a current character Function returns the character currently stored in receiver's representation buffer. On success the function returns CW_SUCCESS, and fills \p c with the contents of the current representation buffer, translated into a character. On failure the function returns CW_FAILURE, with errno set to: ERANGE if not preceded by a cw_end_receive_tone() call, a prior successful cw_receive_character() call, or a cw_receive_buffer_dot() or cw_receive_buffer_dash() call, EINVAL if the timestamp passed in is invalid, or EAGAIN if the call is made too early to determine whether a complete character has yet been placed in the buffer (that is, less than the end-of-character gap period elapsed since the last cw_end_receive_tone() or cw_receive_buffer_dot/dash call). ENOENT if character stored in receiver cannot be recognized as valid \p is_end_of_word indicates that the space after the last mark received is longer that the end-of-character gap, so it must be qualified as end-of-word gap. \p is_error indicates that the character was terminated by an error condition. testedin::test_helper_receive_tests() \param timestamp - timestamp of event that ends end-of-character gap or end-of-word gap \param c - buffer for character (output parameter) \param is_end_of_word - buffer for "is end of word" state (output parameter) \param is_error - buffer for "error" state (output parameter) \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_receive_character(const struct timeval *timestamp, /* out */ char *c, /* out */ bool *is_end_of_word, /* out */ bool *is_error) { int rv = cw_rec_poll_character_internal(&cw_receiver, timestamp, c, is_end_of_word, is_error); return rv; } /** \brief Clear receiver's representation buffer Clears the receiver's representation buffer, resets receiver's internal state. This prepares the receiver to receive marks and spaces again. This routine must be called after successful, or terminating, cw_receive_representation() or cw_receive_character() calls, to clear the states and prepare the buffer to receive more marks and spaces. */ void cw_clear_receive_buffer(void) { cw_rec_clear_buffer_internal(&cw_receiver); return; } /** \brief Get the number of elements (dots/dashes) the receiver's buffer can accommodate The maximum number of elements written out by cw_receive_representation() is the capacity + 1, the extra character being used for the terminating NUL. \return number of elements that can be stored in receiver's representation buffer */ int cw_get_receive_buffer_capacity(void) { return CW_REC_REPRESENTATION_CAPACITY; } /** \brief Get the number of elements (dots/dashes) currently pending in the cw_receiver's representation buffer testedin::test_helper_receive_tests() \return number of elements in receiver's representation buffer */ int cw_get_receive_buffer_length(void) { return cw_rec_get_buffer_length_internal(&cw_receiver); } /** \brief Clear receive data Clear the receiver's representation buffer, statistics, and any retained receiver's state. This function is suitable for calling from an application exit handler. */ void cw_reset_receive(void) { cw_rec_reset_internal(&cw_receiver); return; } /* ******************************************************************** */ /* Key */ /* ******************************************************************** */ /** \brief Register external callback function for keying Register a \p callback_func function that should be called when a state of a key changes from "key open" to "key closed", or vice-versa. The first argument passed to the registered callback function is the supplied \p callback_arg, if any. The second argument passed to registered callback function is the key state: CW_KEY_STATE_CLOSED (one/true) for "key closed", and CW_KEY_STATE_OPEN (zero/false) for "key open". Calling this routine with a NULL function address disables keying callbacks. Any callback supplied will be called in signal handler context (??). \param callback_func - callback function to be called on key state changes \param callback_arg - first argument to callback_func */ void cw_register_keying_callback(void (*callback_func)(void*, int), void *callback_arg) { cw_key_register_keying_callback_internal(&cw_key, callback_func, callback_arg); return; } /* Most of the time libcw just passes around key_callback_arg, not caring of what type it is, and not attempting to do any operations on it. On one occasion however, it needs to know whether key_callback_arg is of type 'struct timeval', and if so, it must do some operation on it. I could pass struct with ID as key_callback_arg, but that may break some old client code. Instead I've created this function that has only one, very specific purpose: to pass to libcw a pointer to timer. The timer is owned by client code, and is used to measure and clock iambic keyer. */ void cw_iambic_keyer_register_timer(struct timeval *timer) { cw_key_ik_register_timer_internal(&cw_key, timer); return; } /** \brief Enable iambic Curtis mode B Normally, the iambic keying functions will emulate Curtis 8044 Keyer mode A. In this mode, when both paddles are pressed together, the last dot or dash being sent on release is completed, and nothing else is sent. In mode B, when both paddles are pressed together, the last dot or dash being sent on release is completed, then an opposite element is also sent. Some operators prefer mode B, but timing is more critical in this mode. The default mode is Curtis mode A. */ void cw_enable_iambic_curtis_mode_b(void) { cw_key_ik_enable_curtis_mode_b_internal(&cw_key); return; } /** See documentation of cw_enable_iambic_curtis_mode_b() for more information */ void cw_disable_iambic_curtis_mode_b(void) { cw_key_ik_disable_curtis_mode_b_internal(&cw_key); return; } /** See documentation of cw_enable_iambic_curtis_mode_b() for more information */ int cw_get_iambic_curtis_mode_b_state(void) { return (int) cw_key_ik_get_curtis_mode_b_state_internal(&cw_key); } /** \brief Inform about changed state of iambic keyer's paddles Function informs the library that the iambic keyer paddles have changed state. The new paddle states are recorded, and if either transition from false to true, paddle latches, for iambic functions, are also set. On success, the routine returns CW_SUCCESS. On failure, it returns CW_FAILURE, with errno set to EBUSY if the tone queue or straight key are using the sound card, console speaker, or keying system. If appropriate, this routine starts the keyer functions sending the relevant element. Element send and timing occurs in the background, so this routine returns almost immediately. See cw_keyer_element_wait() and cw_keyer_wait() for details about how to check the current status of iambic keyer background processing. testedin::test_keyer() \param dot_paddle_state \param dash_paddle_state \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_notify_keyer_paddle_event(int dot_paddle_state, int dash_paddle_state) { return cw_key_ik_notify_paddle_event_internal(&cw_key, dot_paddle_state, dash_paddle_state); } /** \brief Change state of dot paddle Alter the state of just one of the two iambic keyer paddles. The other paddle state of the paddle pair remains unchanged. See cw_notify_keyer_paddle_event() for details of iambic keyer background processing, and how to check its status. \param dot_paddle_state */ int cw_notify_keyer_dot_paddle_event(int dot_paddle_state) { return cw_notify_keyer_paddle_event(dot_paddle_state, cw_key.ik.dash_paddle); } /** See documentation of cw_notify_keyer_dot_paddle_event() for more information */ int cw_notify_keyer_dash_paddle_event(int dash_paddle_state) { return cw_notify_keyer_paddle_event(cw_key.ik.dot_paddle, dash_paddle_state); } /** \brief Get the current saved states of the two paddles testedin::test_keyer() \param dot_paddle_state \param dash_paddle_state */ void cw_get_keyer_paddles(int *dot_paddle_state, int *dash_paddle_state) { cw_key_ik_get_paddles_internal(&cw_key, dot_paddle_state, dash_paddle_state); return; } /** \brief Get the current states of paddle latches Function returns the current saved states of the two paddle latches. A paddle latches is set to true when the paddle state becomes true, and is cleared if the paddle state is false when the element finishes sending. \param dot_paddle_latch_state \param dash_paddle_latch_state */ void cw_get_keyer_paddle_latches(int *dot_paddle_latch_state, int *dash_paddle_latch_state) { cw_key_ik_get_paddle_latches_internal(&cw_key, dot_paddle_latch_state, dash_paddle_latch_state); return; } /** \brief Check if a keyer is busy \return true if keyer is busy \return false if keyer is not busy */ bool cw_is_keyer_busy(void) { return cw_key_ik_is_busy_internal(&cw_key); } /** \brief Wait for end of element from the keyer Waits until the end of the current element, dot or dash, from the keyer. On error the function returns CW_FAILURE, with errno set to EDEADLK if SIGALRM is blocked. testedin::test_keyer() \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_wait_for_keyer_element(void) { return cw_key_ik_wait_for_element_internal(&cw_key); } /** \brief Wait for the current keyer cycle to complete The routine returns CW_SUCCESS on success. On error, it returns CW_FAILURE, with errno set to EDEADLK if SIGALRM is blocked or if either paddle state is true. \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_wait_for_keyer(void) { return cw_key_ik_wait_for_keyer_internal(&cw_key); } /** \brief Reset iambic keyer data Clear all latches and paddle states of iambic keyer, return to Curtis 8044 Keyer mode A, and return to silence. This function is suitable for calling from an application exit handler. */ void cw_reset_keyer(void) { cw_key_ik_reset_internal(&cw_key); return; } #if 0 /* unused */ /* Period of constant tone generation after which we need another timeout, to ensure that the soundcard doesn't run out of data. */ static const int STRAIGHT_KEY_TIMEOUT = 500000; /** \brief Generate a tone while straight key is down Soundcard tone data is only buffered to last about a second on each cw_generate_sound_internal() call, and holding down the straight key for longer than this could cause a soundcard data underrun. To guard against this, a timeout is generated every half-second or so while the straight key is down. The timeout generates a chunk of sound data for the soundcard. */ void cw_straight_key_clock_internal(void) { if (cw_straight_key->key_value == CW_KEY_STATE_CLOSED) { /* Generate a quantum of tone data, and request another timeout. */ // cw_generate_sound_internal(); cw_timer_run_with_handler_internal(STRAIGHT_KEY_TIMEOUT, NULL); } return; } #endif /** \brief Inform the library that the straight key has changed state This routine returns CW_SUCCESS on success. On error, it returns CW_FAILURE, with errno set to EBUSY if the tone queue or iambic keyer are using the sound card, console speaker, or keying control system. If \p key_state indicates no change of state, the call is ignored. \p key_state may be either CW_KEY_STATE_OPEN (false) or CW_KEY_STATE_CLOSED (true). testedin::test_straight_key() \param key_state - state of straight key */ int cw_notify_straight_key_event(int key_state) { return cw_key_sk_notify_event_internal(&cw_key, key_state); } /** \brief Get saved state of straight key Returns the current saved state of the straight key. testedin::test_straight_key() \return CW_KEY_STATE_CLOSED (true) if the key is down \return CW_KEY_STATE_OPEN (false) if the key up */ int cw_get_straight_key_state(void) { return cw_key_sk_get_state_internal(&cw_key); } /** \brief Check if the straight key is busy This routine is just a pseudonym for cw_get_straight_key_state(), and exists to fill a hole in the API naming conventions. testedin::test_straight_key() \return true if the straight key is busy \return false if the straight key is not busy */ bool cw_is_straight_key_busy(void) { return cw_key_sk_is_busy_internal(&cw_key); } /** \brief Clear the straight key state, and return to silence This function is suitable for calling from an application exit handler. */ void cw_reset_straight_key(void) { cw_key_sk_reset_internal(&cw_key); return; } unixcw-3.4.2/src/libcw/libcw_tq.c0000644000175000017500000014131612537343076016536 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_tq.c \brief Queue of tones to be converted by generator to pcm data and sent to audio sink. Tone queue - a circular list of tone durations and frequencies pending, and a pair of indexes, tail (enqueue) and head (dequeue) to manage additions and asynchronous sending. The tone queue (the circular list) is implemented using constant size table. Explanation of "forever" tone: If a "forever" flag is set in a tone that is a last one on a tone queue, the tone should be constantly returned by dequeue function, without removing the tone - as long as it is a last tone on queue. Adding new, "non-forever" tone to the queue results in permanent dequeuing "forever" tone and proceeding to newly added tone. Adding new, "non-forever" tone ends generation of "forever" tone. The "forever" tone is useful for generating tones of length unknown in advance. dequeue() function recognizes the "forever" tone and acts as described above; there is no visible difference between dequeuing N separate "non-forever" tones of length L [us], and dequeuing a "forever" tone of length L [us] N times in a row. Because of some corner cases related to "forever" tones it is very strongly advised to set "low water mark" level to no less than 2 tones. */ #include /* "PRIu32" */ #include #include #include #include /* SIGALRM */ #include "libcw.h" #include "libcw_tq.h" #include "libcw_gen.h" #include "libcw_debug.h" #include "libcw_signal.h" #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif /* The CW tone queue functions implement the following state graph: (queue empty) +-----------------------------------------------------+ | | | | | (tone(s) added to queue, | v dequeueing process started) | ----> CW_TQ_IDLE -------------------------------> CW_TQ_BUSY --+ ^ | | | +--------+ (queue not empty) Above diagram shows two states of a queue, but dequeue function returns three distinct values: CW_TQ_DEQUEUED, CW_TQ_NDEQUEUED_EMPTY, CW_TQ_NDEQUEUED_IDLE. Having these three values is important for the function that calls the dequeue function. If you ever intend to limit number of return values of dequeue function to two, you will also have to re-think how cw_gen_dequeue_and_play_internal() operates. Future libcw API should (completely) hide tone queue from client code. The client code should only operate on a generator - enqueue tones to generator, flush a generator, register low water callback with generator etc. There is very little (or even no) need to explicitly reveal to client code this implementation detail called "tone queue". */ extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; static int cw_tq_set_capacity_internal(cw_tone_queue_t *tq, uint32_t capacity, uint32_t high_water_mark); static uint32_t cw_tq_get_high_water_mark_internal(cw_tone_queue_t *tq) __attribute__((unused)); static uint32_t cw_tq_prev_index_internal(cw_tone_queue_t *tq, uint32_t current) __attribute__((unused)); static uint32_t cw_tq_next_index_internal(cw_tone_queue_t *tq, uint32_t current); static int cw_tq_dequeue_sub_internal(cw_tone_queue_t *tq, cw_tone_t *tone); /* Not used anymore. 2015.02.22. */ #if 0 /* Remember that tail and head are of unsigned type. Make sure that order of calculations is correct when tail < head. */ #define CW_TONE_QUEUE_LENGTH(m_tq) \ ( m_tq->tail >= m_tq->head \ ? m_tq->tail - m_tq->head \ : m_tq->capacity - m_tq->head + m_tq->tail) \ #endif /** \brief Create new tone queue Allocate and initialize new tone queue structure. testedin::test_cw_tone_queue_init_internal() \return pointer to new tone queue on success \return NULL pointer on failure */ cw_tone_queue_t *cw_tq_new_internal(void) { cw_tone_queue_t *tq = (cw_tone_queue_t *) malloc(sizeof (cw_tone_queue_t)); if (!tq) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_TONE_QUEUE, CW_DEBUG_ERROR, "libcw/tq: failed to malloc() tone queue"); return (cw_tone_queue_t *) NULL; } int rv = pthread_mutex_init(&(tq->mutex), NULL); cw_assert (!rv, "failed to initialize mutex"); pthread_mutex_lock(&(tq->mutex)); tq->tail = 0; tq->head = 0; tq->len = 0; tq->state = CW_TQ_IDLE; tq->low_water_mark = 0; tq->low_water_callback = NULL; tq->low_water_callback_arg = NULL; tq->call_callback = false; tq->gen = (cw_gen_t *) NULL; rv = cw_tq_set_capacity_internal(tq, CW_TONE_QUEUE_CAPACITY_MAX, CW_TONE_QUEUE_HIGH_WATER_MARK_MAX); cw_assert (rv, "failed to set initial capacity of tq"); pthread_mutex_unlock(&(tq->mutex)); return tq; } void cw_tq_delete_internal(cw_tone_queue_t **tq) { cw_assert (tq, "pointer to tq is NULL"); if (!tq || !*tq) { return; } free(*tq); *tq = (cw_tone_queue_t *) NULL; return; } /** \brief Set capacity and high water mark for queue Set two parameters of queue: total capacity of the queue, and high water mark. When calling the function, client code must provide valid values of both parameters. Calling the function *by a client code* for a queue is optional, as a queue has these parameters always set to default values (CW_TONE_QUEUE_CAPACITY_MAX and CW_TONE_QUEUE_HIGH_WATER_MARK_MAX) by internal call to cw_tq_new_internal(). \p capacity must be no larger than CW_TONE_QUEUE_CAPACITY_MAX. \p high_water_mark must be no larger than CW_TONE_QUEUE_HIGH_WATER_MARK_MAX. Both values must be larger than zero (this condition is subject to changes in future revisions of the library). \p high_water_mark must be no larger than \p capacity. Functions set errno to EINVAL if any of the two parameters is invalid. testedin::test_cw_tq_capacity_test_init() \param tq - tone queue to configure \param capacity - new capacity of queue \param high_water_mark - high water mark for the queue \return CW_SUCCESS on success, CW_FAILURE otherwise */ int cw_tq_set_capacity_internal(cw_tone_queue_t *tq, uint32_t capacity, uint32_t high_water_mark) { cw_assert (tq, "tq is NULL"); if (!tq) { return CW_FAILURE; } if (!high_water_mark || high_water_mark > CW_TONE_QUEUE_HIGH_WATER_MARK_MAX) { /* If we allowed high water mark to be zero, the queue would not accept any new tones: it would constantly be full. */ errno = EINVAL; return CW_FAILURE; } if (!capacity || capacity > CW_TONE_QUEUE_CAPACITY_MAX) { /* Tone queue of capacity zero doesn't make much sense, so capacity == 0 is not allowed. */ errno = EINVAL; return CW_FAILURE; } if (high_water_mark > capacity) { errno = EINVAL; return CW_FAILURE; } tq->capacity = capacity; tq->high_water_mark = high_water_mark; return CW_SUCCESS; } /** \brief Return capacity of a queue testedin::test_cw_tq_get_capacity_internal() \param tq - tone queue, for which you want to get capacity \return capacity of tone queue */ uint32_t cw_tq_get_capacity_internal(cw_tone_queue_t *tq) { cw_assert (tq, "tone queue is NULL"); return tq->capacity; } /** \brief Return high water mark of a queue \param tq - tone queue, for which you want to get high water mark \return high water mark of tone queue */ uint32_t cw_tq_get_high_water_mark_internal(cw_tone_queue_t *tq) { cw_assert (tq, "tone queue is NULL"); return tq->high_water_mark; } /** \brief Return number of items on tone queue testedin::test_cw_tq_length_internal() \param tq - tone queue \return the count of tones currently held in the circular tone buffer. */ uint32_t cw_tq_length_internal(cw_tone_queue_t *tq) { pthread_mutex_lock(&tq->mutex); size_t len = tq->len; pthread_mutex_unlock(&tq->mutex); return len; } /** \brief Get previous index to queue Calculate index of previous element in queue, relative to given \p ind. The function calculates the index taking circular wrapping into consideration. testedin::test_cw_tq_prev_index_internal() \param tq - tone queue for which to calculate index \param ind - index in relation to which to calculate index of previous element in queue \return index of previous element in queue */ uint32_t cw_tq_prev_index_internal(cw_tone_queue_t *tq, uint32_t ind) { return ind == 0 ? tq->capacity - 1 : ind - 1; } /** \brief Get next index to queue Calculate index of next element in queue, relative to given \p ind. The function calculates the index taking circular wrapping into consideration. testedin::test_cw_tq_next_index_internal() \param tq - tone queue for which to calculate index \param ind - index in relation to which to calculate index of next element in queue \return index of next element in queue */ uint32_t cw_tq_next_index_internal(cw_tone_queue_t *tq, uint32_t ind) { return ind == tq->capacity - 1 ? 0 : ind + 1; } /** \brief Dequeue a tone from tone queue Dequeue a tone from tone queue. The queue returns three distinct values. This may seem overly complicated for a tone queue, but it actually works. The way the generator interacts with the tone queue, and the way the enqueueing works, depend on the dequeue function to return three values. If you ever try to make the dequeue function return two values, you would also have to redesign parts of generator and of enqueueing code. Look in cw_gen_write_to_soundcard_internal(). The function makes decision based on two distinct tone queue states (described by CW_TQ_DEQUEUED or CW_TQ_NDEQUEUED_EMPTY). So the _write() function must be executed by generator for both return values. But we also need a third return value that will tell the generator not to execute _write() *at all*, but just wait for signal. This third value is CW_TQ_NDEQUEUED_IDLE. These three return values are: \li CW_TQ_DEQUEUED - dequeue() function successfully dequeues and returns through \p tone a valid tone. dequeue() understands how "forever" tone should be handled: if such tone is the last tone on the queue, the function actually both returns the "forever" tone, and keeps it in queue (until next tone is enqueued). \li CW_TQ_NDEQUEUED_EMPTY - dequeue() function can't dequeue a tone from tone queue, because the queue has been just emptied, i.e. previous call to dequeue() was successful and returned CW_TQ_DEQUEUED, but that was the last tone on queue. This return value is a way of telling client code "I've had tones, but no more, you should probably stop playing any sounds and become silent". If no new tones are enqueued, the next call to dequeue() will return CW_TQ_NDEQUEUED_IDLE. \li CW_TQ_NDEQUEUED_IDLE - dequeue() function can't dequeue a tone from tone queue, because the queue is empty, and the tone queue has no memory of being non-empty before. This is the value that dequeue() would return for brand new tone queue. This is also value returned by dequeue() when its previous return value was CW_TQ_NDEQUEUED_EMPTY, and no new tones were enqueued since then. Notice that returned value does not describe internal state of tone queue. Successfully dequeued tone is returned through function's argument \p tone. The function does not modify the arguments if there are no tones to dequeue (CW_TQ_NDEQUEUED_EMPTY, CW_TQ_NDEQUEUED_IDLE). As mentioned above, dequeue() understands how "forever" tone works. If the last tone in queue has "forever" flag set, the function won't permanently dequeue it. Instead, it will keep returning (through \p tone) the tone on every call, until a new tone is added to the queue after the "forever" tone. testedin::test_cw_tq_dequeue_internal() testedin::test_cw_tq_test_capacity_2() \param tq - tone queue \param tone - dequeued tone \return CW_TQ_DEQUEUED (see information above) \return CW_TQ_NDEQUEUED_EMPTY (see information above) \return CW_TQ_NDEQUEUED_IDLE (see information above) */ int cw_tq_dequeue_internal(cw_tone_queue_t *tq, /* out */ cw_tone_t *tone) { pthread_mutex_lock(&(tq->mutex)); /* Decide what to do based on the current state. */ switch (tq->state) { case CW_TQ_IDLE: pthread_mutex_unlock(&(tq->mutex)); /* Ignore calls if our state is idle. */ return CW_TQ_NDEQUEUED_IDLE; case CW_TQ_BUSY: /* If there are some tones in queue, dequeue the next tone. If there are no more tones, go to the idle state. */ if (tq->len) { bool call_callback = cw_tq_dequeue_sub_internal(tq, tone); /* Notify the key control function about current tone. */ if (tq->gen && tq->gen->key) { cw_key_tk_set_value_internal(tq->gen->key, tone->frequency ? CW_KEY_STATE_CLOSED : CW_KEY_STATE_OPEN); } pthread_mutex_unlock(&(tq->mutex)); /* Since client's callback can use functions that call libcw's pthread_mutex_lock(), we should put the callback *after* we release pthread_mutex_unlock() in this function. */ if (call_callback) { (*(tq->low_water_callback))(tq->low_water_callback_arg); } return CW_TQ_DEQUEUED; } else { /* tq->len == 0 */ /* State of tone queue is still "busy", but there are no tones left on the queue. Time to bring tq->state in sync with tq->len. Set state to idle, indicating that dequeuing has finished for the moment. */ tq->state = CW_TQ_IDLE; /* There is no tone to dequeue, so don't modify function's arguments. Client code will learn about "no valid tone returned through function argument" state through return value. */ /* Notify the key control function about current tone. */ if (tq->gen && tq->gen->key) { cw_key_tk_set_value_internal(tq->gen->key, CW_KEY_STATE_OPEN); } pthread_mutex_unlock(&(tq->mutex)); return CW_TQ_NDEQUEUED_EMPTY; } } pthread_mutex_unlock(&(tq->mutex)); /* will never get here as "queue state" enum has only two values */ cw_assert(0, "reached unreachable place"); return CW_TQ_NDEQUEUED_IDLE; } /** \brief Handle dequeueing of tone from non-empty tone queue Function gets a tone from head of the queue. If this was a last tone in queue, and it was a "forever" tone, the tone is not removed from the queue (the philosophy of "forever" tone), and "low watermark" condition is not checked. Otherwise remove the tone from tone queue, check "low watermark" condition, and return value of the check (true/false). In any case, dequeued tone is returned through \p tone. \p tone must be a valid pointer provided by caller. \param tq - tone queue \param tone - dequeued tone (output from the function) \return true if a condition for calling "low watermark" callback is true \return false otherwise */ int cw_tq_dequeue_sub_internal(cw_tone_queue_t *tq, /* out */ cw_tone_t *tone) { CW_TONE_COPY(tone, &(tq->queue[tq->head])); if (tone->forever && tq->len == 1) { /* Don't permanently remove the last tone that is "forever" tone in queue. Keep it in tq until client code adds next tone (possibly forever). Queue's head should not be iterated. "forever" tone should be played by caller code, this is why we return the tone through function's argument. */ /* Don't call "low watermark" callback for "forever" tone. As the comment in this function below has stated: avoid endlessly calling the callback if the only queued tone is "forever" tone.*/ return false; } /* Used to check if we passed tq's low level watermark. */ uint32_t tq_len_before = tq->len; /* Dequeue. We already have the tone, now update tq's state. */ tq->head = cw_tq_next_index_internal(tq, tq->head); tq->len--; if (tq->len == 0) { /* Verify basic property of empty tq. */ cw_assert (tq->head == tq->tail, "Head: %"PRIu32", tail: %"PRIu32"", tq->head, tq->tail); } #if 0 /* Disabled because these debug messages produce lots of output to console. Enable only when necessary. */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_DEBUG, "libcw/tq: dequeue tone %d us, %d Hz", tone->len, tone->frequency); cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_DEBUG, "libcw/tq: head = %"PRIu32", tail = %"PRIu32", length = %"PRIu32" -> %"PRIu32"", tq->head, tq->tail, tq_len_before, tq->len); #endif /* You can remove this assert in future. It is only temporary, to check that some changes introduced on 2015.03.01 didn't break one assumption. */ cw_assert (!(tone->forever && tq_len_before == 1), "\"forever\" tone appears!"); bool call_callback = false; if (tq->low_water_callback) { /* It may seem that the double condition in 'if ()' is redundant, but for some reason it is necessary. Be very, very careful when modifying this. */ if (tq_len_before > tq->low_water_mark && tq->len <= tq->low_water_mark) { call_callback = true; } } return call_callback; } /** \brief Add tone to tone queue Enqueue a tone for specified frequency and number of microseconds. This routine adds the new tone to the queue, and if necessary sends signal to generator, so that the generator can dequeue the tone. The routine returns CW_SUCCESS on success. If the tone queue is full, the routine returns CW_FAILURE, with errno set to EAGAIN. If the iambic keyer or straight key are currently busy, the routine returns CW_FAILURE, with errno set to EBUSY. The function does not accept tones with frequency outside of CW_FREQUENCY_MIN-CW_FREQUENCY_MAX range. If length of a tone (tone->len) is zero, the function does not add it to tone queue and returns CW_SUCCESS. The function does not accept tones with negative values of len. testedin::test_cw_tq_enqueue_internal_1() testedin::test_cw_tq_enqueue_internal_2() testedin::test_cw_tq_test_capacity_1() testedin::test_cw_tq_test_capacity_2() \param tq - tone queue \param tone - tone to enqueue \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_tq_enqueue_internal(cw_tone_queue_t *tq, cw_tone_t *tone) { /* Check the arguments given for realistic values. */ if (tone->frequency < CW_FREQUENCY_MIN || tone->frequency > CW_FREQUENCY_MAX) { errno = EINVAL; return CW_FAILURE; } if (tone->len < 0) { errno = EINVAL; return CW_FAILURE; } if (tone->len == 0) { /* Drop empty tone. It won't be played anyway, and for now there are no other good reasons to enqueue it. While it may happen in higher-level code to create such tone, but there is no need to spend time on it here. */ cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_INFO, "libcw/tq: dropped tone with len == 0"); return CW_SUCCESS; } #if 0 /* This part is no longer in use. It seems that it's not necessary. 2015.02.22. */ /* If the keyer or straight key are busy, return an error. This is because they use the sound card/console tones and key control, and will interfere with us if we try to use them at the same time. */ if (cw_key_ik_is_busy_internal(tq->gen->key) || cw_key_sk_is_busy_internal(tq->gen->key)) { errno = EBUSY; return CW_FAILURE; } #endif pthread_mutex_lock(&(tq->mutex)); if (tq->len == tq->capacity) { /* Tone queue is full. */ errno = EAGAIN; cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_ERROR, "libcw/tq: can't enqueue tone, tq is full"); pthread_mutex_unlock(&(tq->mutex)); return CW_FAILURE; } cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_TONE_QUEUE, CW_DEBUG_DEBUG, "libcw/tq: enqueue tone %d us, %d Hz", tone->len, tone->frequency); /* Enqueue the new tone. Notice that tail is incremented after adding a tone. This means that for empty tq new tone is inserted at index tail == head (which should be kind of obvious). */ CW_TONE_COPY(&(tq->queue[tq->tail]), tone); tq->tail = cw_tq_next_index_internal(tq, tq->tail); tq->len++; if (tq->state == CW_TQ_IDLE) { /* A loop in cw_gen_dequeue_and_play_internal() function may await for the queue to be filled with new tones to dequeue and play. It waits for a signal, for information that there are some new tones in tone queue. This is a right place and time to send such a signal. */ tq->state = CW_TQ_BUSY; pthread_kill(tq->gen->thread.id, SIGALRM); } pthread_mutex_unlock(&(tq->mutex)); return CW_SUCCESS; } /** \brief Register callback for low queue state Register a function to be called automatically by the dequeue routine whenever the tone queue falls to a given \p level. To be more precise: the callback is called by queue manager if, after dequeueing a tone, the manager notices that tone queue length has become equal or less than \p level. \p callback_arg may be used to give a value passed back on callback calls. A NULL function pointer suppresses callbacks. On success, the routine returns CW_SUCCESS. If \p level is invalid, the routine returns CW_FAILURE with errno set to EINVAL. Any callback supplied will be called in signal handler context. \param tq - tone queue \param callback_func - callback function to be registered \param callback_arg - argument for callback_func to pass return value \param level - low level of queue triggering callback call \return CW_SUCCESS on successful registration \return CW_FAILURE on failure */ int cw_tq_register_low_level_callback_internal(cw_tone_queue_t *tq, void (*callback_func)(void*), void *callback_arg, int level) { if (level < 0 || (uint32_t) level >= tq->capacity) { errno = EINVAL; return CW_FAILURE; } /* Store the function and low water mark level. */ tq->low_water_mark = (uint32_t) level; tq->low_water_callback = callback_func; tq->low_water_callback_arg = callback_arg; return CW_SUCCESS; } /** \brief Check if tone sender is busy Indicate if the tone sender is busy. \param tq - tone queue \return true if there are still entries in the tone queue \return false if the queue is empty */ bool cw_tq_is_busy_internal(cw_tone_queue_t *tq) { return tq->state != CW_TQ_IDLE; } /** \brief Wait for the current tone to complete The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns CW_FAILURE, with errno set to EDEADLK, to avoid indefinite waits. \param tq - tone queue \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_tq_wait_for_tone_internal(cw_tone_queue_t *tq) { if (cw_sigalrm_is_blocked_internal()) { /* no point in waiting for event, when signal controlling the event is blocked */ errno = EDEADLK; return CW_FAILURE; } /* Wait for the head index to change or the dequeue to go idle. */ uint32_t check_tq_head = tq->head; while (tq->head == check_tq_head && tq->state != CW_TQ_IDLE) { cw_signal_wait_internal(); } return CW_SUCCESS; } /** \brief Wait for the tone queue to drain The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns false, with errno set to EDEADLK, to avoid indefinite waits. \param tq - tone queue \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_tq_wait_for_tone_queue_internal(cw_tone_queue_t *tq) { if (cw_sigalrm_is_blocked_internal()) { /* no point in waiting for event, when signal controlling the event is blocked */ errno = EDEADLK; return CW_FAILURE; } /* Wait until the dequeue indicates it has hit the end of the queue. */ while (tq->state != CW_TQ_IDLE) { cw_signal_wait_internal(); } return CW_SUCCESS; } /** \brief Wait for the tone queue to drain until only as many tones as given in level remain queued This routine is for use by programs that want to optimize themselves to avoid the cleanup that happens when the tone queue drains completely; such programs have a short time in which to add more tones to the queue. The routine returns CW_SUCCESS on success. If called with SIGALRM blocked, the routine returns false, with errno set to EDEADLK, to avoid indefinite waits. \param tq - tone queue \param level - low level in queue, at which to return \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_tq_wait_for_level_internal(cw_tone_queue_t *tq, uint32_t level) { if (cw_sigalrm_is_blocked_internal()) { /* no point in waiting for event, when signal controlling the event is blocked */ errno = EDEADLK; return CW_FAILURE; } /* Wait until the queue length is at or below criticality. */ while (cw_tq_length_internal(tq) > level) { cw_signal_wait_internal(); } return CW_SUCCESS; } /** \brief Indicate if the tone queue is full This is a helper subroutine created so that I can pass a test tone queue in unit tests. The 'cw_is_tone_queue_full() works only on default tone queue object. testedin::test_cw_tq_is_full_internal() \param tq - tone queue to check \return true if tone queue is full \return false if tone queue is not full */ bool cw_tq_is_full_internal(cw_tone_queue_t *tq) { return tq->len == tq->capacity; } void cw_tq_reset_internal(cw_tone_queue_t *tq) { /* Empty and reset the queue, and force state to idle. */ tq->len = 0; tq->head = tq->tail; tq->state = CW_TQ_IDLE; /* Reset low water mark details to their initial values. */ tq->low_water_mark = 0; tq->low_water_callback = NULL; tq->low_water_callback_arg = NULL; return; } void cw_tq_flush_internal(cw_tone_queue_t *tq) { pthread_mutex_lock(&(tq->mutex)); /* Empty and reset the queue. */ tq->len = 0; tq->head = tq->tail; pthread_mutex_unlock(&(tq->mutex)); /* If we can, wait until the dequeue goes idle. */ if (!cw_sigalrm_is_blocked_internal()) { cw_tq_wait_for_tone_queue_internal(tq); } return; } /* *** Unit tests *** */ #ifdef LIBCW_UNIT_TESTS #include "libcw_test.h" static cw_tone_queue_t *test_cw_tq_capacity_test_init(uint32_t capacity, uint32_t high_water_mark, int head_shift); static unsigned int test_cw_tq_enqueue_internal_1(cw_tone_queue_t *tq); static unsigned int test_cw_tq_dequeue_internal(cw_tone_queue_t *tq); /** tests::cw_tq_new_internal() tests::cw_tq_delete_internal() */ unsigned int test_cw_tq_new_delete_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_new/delete_internal():"); /* Arbitrary number of calls to new()/delete() pair. */ for (int i = 0; i < 40; i++) { cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to initialize tone queue"); /* Try to access some fields in cw_tone_queue_t just to be sure that the tq has been allocated properly. */ cw_assert (tq->head == 0, "head in new tone queue is not at zero"); tq->tail = tq->head + 10; cw_assert (tq->tail == 10, "tail didn't store correct new value"); cw_tq_delete_internal(&tq); cw_assert (tq == NULL, "delete() didn't set the pointer to NULL"); } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_tq_get_capacity_internal() */ unsigned int test_cw_tq_get_capacity_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_get_capacity_internal():"); cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to initialize tone queue"); for (uint32_t i = 10; i < 40; i++) { /* This is a silly test, but let's have any test of the getter. */ tq->capacity = i; uint32_t capacity = cw_tq_get_capacity_internal(tq); cw_assert (capacity == i, "incorrect capacity: %"PRIu32" != %"PRIu32"", capacity, i); } cw_tq_delete_internal(&tq); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_tq_prev_index_internal() */ unsigned int test_cw_tq_prev_index_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_prev_index_internal():"); cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tone queue"); struct { int arg; uint32_t expected; bool guard; } input[] = { { tq->capacity - 4, tq->capacity - 5, false }, { tq->capacity - 3, tq->capacity - 4, false }, { tq->capacity - 2, tq->capacity - 3, false }, { tq->capacity - 1, tq->capacity - 2, false }, /* This one should never happen. We can't pass index equal "capacity" because it's out of range. */ /* { tq->capacity - 0, tq->capacity - 1, false }, */ { 0, tq->capacity - 1, false }, { 1, 0, false }, { 2, 1, false }, { 3, 2, false }, { 4, 3, false }, { 0, 0, true } /* guard */ }; int i = 0; while (!input[i].guard) { uint32_t prev = cw_tq_prev_index_internal(tq, input[i].arg); //fprintf(stderr, "arg = %d, result = %d, expected = %d\n", input[i].arg, (int) prev, input[i].expected); cw_assert (prev == input[i].expected, "calculated \"prev\" != expected \"prev\": %"PRIu32" != %"PRIu32"", prev, input[i].expected); i++; } cw_tq_delete_internal(&tq); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_tq_next_index_internal() */ unsigned int test_cw_tq_next_index_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_next_index_internal():"); cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tone queue"); struct { int arg; uint32_t expected; bool guard; } input[] = { { tq->capacity - 5, tq->capacity - 4, false }, { tq->capacity - 4, tq->capacity - 3, false }, { tq->capacity - 3, tq->capacity - 2, false }, { tq->capacity - 2, tq->capacity - 1, false }, { tq->capacity - 1, 0, false }, { 0, 1, false }, { 1, 2, false }, { 2, 3, false }, { 3, 4, false }, { 0, 0, true } /* guard */ }; int i = 0; while (!input[i].guard) { uint32_t next = cw_tq_next_index_internal(tq, input[i].arg); //fprintf(stderr, "arg = %d, result = %d, expected = %d\n", input[i].arg, (int) next, input[i].expected); cw_assert (next == input[i].expected, "calculated \"next\" != expected \"next\": %"PRIu32" != %"PRIu32"", next, input[i].expected); i++; } cw_tq_delete_internal(&tq); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** The second function is just a wrapper for the first one, so this test case tests both functions at once. tests::cw_tq_length_internal() tests::cw_get_tone_queue_length() */ unsigned int test_cw_tq_length_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_length_internal():"); /* This is just some code copied from implementation of 'enqueue' function. I don't use 'enqueue' function itself because it's not tested yet. I get rid of all the other code from the 'enqueue' function and use only the essential part to manually add elements to list, and then to check length of the list. */ cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tone queue"); cw_tone_t tone; CW_TONE_INIT(&tone, 1, 1, CW_SLOPE_MODE_NO_SLOPES); for (uint32_t i = 0; i < tq->capacity; i++) { /* This block of code pretends to be enqueue function. The most important functionality of enqueue function is done here manually. We don't do any checks of boundaries of tq, we trust that this is enforced by for loop's conditions. */ { /* Notice that this is *before* enqueueing the tone. */ cw_assert (tq->len < tq->capacity, "length before enqueue reached capacity: %"PRIu32" / %"PRIu32"", tq->len, tq->capacity); /* Enqueue the new tone and set the new tail index. */ CW_TONE_COPY(&(tq->queue[tq->tail]), &tone); tq->tail = cw_tq_next_index_internal(tq, tq->tail); tq->len++; cw_assert (tq->len <= tq->capacity, "length after enqueue exceeded capacity: %"PRIu32" / %"PRIu32"", tq->len, tq->capacity); } /* OK, added a tone, ready to measure length of the queue. */ uint32_t len = cw_tq_length_internal(tq); cw_assert (len == i + 1, "after adding tone #%"PRIu32" length is incorrect (%"PRIu32")", i, len); cw_assert (len == tq->len, "lengths don't match: %"PRIu32" != %"PRIu32"", len, tq->len); } cw_tq_delete_internal(&tq); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief Wrapper for tests of enqueue() and dequeue() function First we fill a tone queue when testing enqueue(), and then use the tone queue to test dequeue(). */ unsigned int test_cw_tq_enqueue_dequeue_internal(void) { cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tone queue"); tq->state = CW_TQ_BUSY; /* Fill the tone queue with tones. */ unsigned int rv = test_cw_tq_enqueue_internal_1(tq); cw_assert (rv == 0, "test of enqueue() failed"); /* Use the same (now filled) tone queue to test dequeue() function. */ rv = test_cw_tq_dequeue_internal(tq); cw_assert (rv == 0, "test of dequeue() failed"); cw_tq_delete_internal(&tq); return 0; } /** tests::cw_tq_enqueue_internal() */ unsigned int test_cw_tq_enqueue_internal_1(cw_tone_queue_t *tq) { int p = fprintf(stdout, "libcw/tq: cw_tq_enqueue_internal():"); /* At this point cw_tq_length_internal() should be tested, so we can use it to verify correctness of 'enqueue' function. */ cw_tone_t tone; CW_TONE_INIT(&tone, 1, 1, CW_SLOPE_MODE_NO_SLOPES); for (uint32_t i = 0; i < tq->capacity; i++) { /* This tests for potential problems with function call. */ int rv = cw_tq_enqueue_internal(tq, &tone); cw_assert (rv, "failed to enqueue tone #%"PRIu32"/%"PRIu32"", i, tq->capacity); /* This tests for correctness of working of the 'enqueue' function. */ uint32_t len = cw_tq_length_internal(tq); cw_assert (len == i + 1, "incorrect tone queue length: %"PRIu32" != %"PRIu32"", len, i + 1); } /* Try adding a tone to full tq. */ /* This tests for potential problems with function call. Enqueueing should fail when the queue is full. */ int rv = cw_tq_enqueue_internal(tq, &tone); cw_assert (rv == CW_FAILURE, "was able to add tone to full queue"); /* This tests for correctness of working of the 'enqueue' function. Full tq should not grow beyond its capacity. */ cw_assert (tq->len == tq->capacity, "length of full tone queue is not equal to capacity: %"PRIu32" != %"PRIu32"", tq->len, tq->capacity); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** tests::cw_tq_dequeue_internal() */ unsigned int test_cw_tq_dequeue_internal(cw_tone_queue_t *tq) { int p = fprintf(stdout, "libcw/tq: cw_tq_dequeue_internal():"); /* tq should be completely filled after tests of enqueue() function. */ /* Test some assertions about full tq, just to be sure. */ cw_assert (tq->capacity == tq->len, "capacity != len of full queue: %"PRIu32" != %"PRIu32"", tq->capacity, tq->len); cw_tone_t tone; CW_TONE_INIT(&tone, 1, 1, CW_SLOPE_MODE_NO_SLOPES); for (uint32_t i = tq->capacity; i > 0; i--) { /* Length of tone queue before dequeue. */ cw_assert (i == tq->len, "iteration before dequeue doesn't match len: %"PRIu32" != %"PRIu32"", i, tq->len); /* This tests for potential problems with function call. */ int rv = cw_tq_dequeue_internal(tq, &tone); cw_assert (rv == CW_TQ_DEQUEUED, "unexpected return value from \"dequeued()\": %d", rv); /* Length of tone queue after dequeue. */ cw_assert (i - 1 == tq->len, "iteration after dequeue doesn't match len: %"PRIu32" != %"PRIu32"", i - 1, tq->len); } /* Try removing a tone from empty queue. */ /* This tests for potential problems with function call. */ int rv = cw_tq_dequeue_internal(tq, &tone); cw_assert (rv == CW_TQ_NDEQUEUED_EMPTY, "unexpected return value when dequeueing empty tq: %d", rv); /* This tests for correctness of working of the dequeue() function. Empty tq should stay empty. At this point cw_tq_length_internal() should be tested, so we can use it to verify correctness of dequeue() function. */ uint32_t len = cw_tq_length_internal(tq); cw_assert (len == 0, "non-zero returned length of empty tone queue: len = %"PRIu32"", len); cw_assert (tq->len == 0, "length of empty queue is != 0 (%"PRIu32")", tq->len); /* Try removing a tone from empty queue. */ /* This time we should get CW_TQ_NDEQUEUED_IDLE return value. */ rv = cw_tq_dequeue_internal(tq, &tone); cw_assert (rv == CW_TQ_NDEQUEUED_IDLE, "unexpected return value from \"dequeue\" on empty tone queue: %d", rv); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** The second function is just a wrapper for the first one, so this test case tests both functions at once. tests::cw_tq_is_full_internal() tests::cw_is_tone_queue_full() */ unsigned int test_cw_tq_is_full_internal(void) { int p = fprintf(stdout, "libcw/tq: cw_tq_is_full_internal():"); cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tq"); tq->state = CW_TQ_BUSY; cw_tone_t tone; CW_TONE_INIT(&tone, 1, 1, CW_SLOPE_MODE_NO_SLOPES); /* Notice the "capacity - 1" in loop condition: we leave one place in tq free so that is_full() called in the loop always returns false. */ for (uint32_t i = 0; i < tq->capacity - 1; i++) { int rv = cw_tq_enqueue_internal(tq, &tone); /* The 'enqueue' function has been already tested, but it won't hurt to check this simple assertion here as well. */ cw_assert (rv == CW_SUCCESS, "failed to enqueue tone #%"PRIu32"", i); /* Here is the proper test of tested function. */ cw_assert (!cw_tq_is_full_internal(tq), "tone queue is full after enqueueing tone #%"PRIu32"", i); } /* At this point there is still place in tq for one more tone. Enqueue it and verify that the tq is now full. */ int rv = cw_tq_enqueue_internal(tq, &tone); cw_assert (rv == CW_SUCCESS, "failed to enqueue last tone"); cw_assert (cw_tq_is_full_internal(tq), "tone queue is not full after adding last tone"); cw_tq_delete_internal(&tq); CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief Test "capacity" property of tone queue Function tests "capacity" property of tone queue, and also tests related properties: head and tail. In this function it is done by first enqueueing N known tones to a tone queue using cw_tq_enqueue_internal(), and then "manually" checking content of tone queue to be sure that all the tones are in place. tests::cw_tq_enqueue_internal() */ unsigned int test_cw_tq_test_capacity_1(void) { int p = fprintf(stdout, "libcw/tq: testing correctness of handling capacity (1):"); /* We don't need to check tq with capacity == CW_TONE_QUEUE_CAPACITY_MAX (yet). Let's test a smaller queue. 30 tones will be enough (for now), and 30-4 is a good value for high water mark. */ uint32_t capacity = 30; uint32_t watermark = capacity - 4; /* We will do tests of queue with constant capacity, but with different initial position at which we insert first element (tone), i.e. different position of queue's head. Put the guard after "capacity - 1". */ int head_shifts[] = { 0, 5, 10, 29, -1, 30, -1 }; int s = 0; while (head_shifts[s] != -1) { // fprintf(stderr, "\nTesting with head shift = %d\n", head_shifts[s]); /* For every new test with new head shift we need a "clean" queue. */ cw_tone_queue_t *tq = test_cw_tq_capacity_test_init(capacity, watermark, head_shifts[s]); /* Fill all positions in queue with tones of known frequency. If shift_head != 0, the enqueue function should make sure that the enqueued tones are nicely wrapped after end of queue. */ for (uint32_t i = 0; i < tq->capacity; i++) { cw_tone_t tone; CW_TONE_INIT(&tone, (int) i, 1000, CW_SLOPE_MODE_NO_SLOPES); int rv = cw_tq_enqueue_internal(tq, &tone); cw_assert (rv == CW_SUCCESS, "failed to enqueue tone #%"PRIu32"", i); } /* With the queue filled with valid and known data, it's time to read back the data and verify that the tones were placed in correct positions, as expected. Let's do the readback N times, just for fun. Every time the results should be the same. */ for (int l = 0; l < 3; l++) { for (uint32_t i = 0; i < tq->capacity; i++) { uint32_t shifted = (i + head_shifts[s]) % (tq->capacity); // fprintf(stderr, "Readback %d: position %"PRIu32": checking tone %"PRIu32", expected %"PRIu32", got %d\n", // l, shifted, i, i, tq->queue[shifted].frequency); cw_assert (tq->queue[shifted].frequency == (int) i, "frequency of dequeued tone is incorrect: %d != %d", tq->queue[shifted].frequency, (int) i); } } /* Matches tone queue creation made in test_cw_tq_capacity_test_init(). */ cw_tq_delete_internal(&tq); s++; } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief Test "capacity" property of tone queue Function tests "capacity" property of tone queue, and also tests related properties: head and tail. In this function it is done by first enqueueing N known tones to a tone queue using cw_tq_enqueue_internal(), then dequeueing the tones with cw_tq_dequeue_internal() and then checking that enqueued tones are the ones that we were expecting to get. tests::cw_tq_enqueue_internal() tests::cw_tq_dequeue_internal() */ unsigned int test_cw_tq_test_capacity_2(void) { int p = fprintf(stdout, "libcw/tq: testing correctness of handling capacity (2):"); /* We don't need to check tq with capacity == CW_TONE_QUEUE_CAPACITY_MAX (yet). Let's test a smaller queue. 30 tones will be enough (for now), and 30-4 is a good value for high water mark. */ uint32_t capacity = 30; uint32_t watermark = capacity - 4; /* We will do tests of queue with constant capacity, but with different initial position at which we insert first element (tone), i.e. different position of queue's head. Put the guard after "capacity - 1". */ int head_shifts[] = { 0, 5, 10, 29, -1, 30, -1 }; int s = 0; while (head_shifts[s] != -1) { // fprintf(stderr, "\nTesting with head shift = %d\n", head_shifts[s]); /* For every new test with new head shift we need a "clean" queue. */ cw_tone_queue_t *tq = test_cw_tq_capacity_test_init(capacity, watermark, head_shifts[s]); /* Fill all positions in queue with tones of known frequency. If shift_head != 0, the enqueue function should make sure that the enqueued tones are nicely wrapped after end of queue. */ for (uint32_t i = 0; i < tq->capacity; i++) { cw_tone_t tone; CW_TONE_INIT(&tone, (int) i, 1000, CW_SLOPE_MODE_NO_SLOPES); int rv = cw_tq_enqueue_internal(tq, &tone); cw_assert (rv == CW_SUCCESS, "failed to enqueue tone #%"PRIu32"", i); } /* With the queue filled with valid and known data (tones), it's time to read back the data and verify that the tones were placed in correct positions, as expected. In test_cw_tq_test_capacity_1() we did the readback "manually", this time let's use "dequeue" function to do the job. Since the "dequeue" function moves queue pointers, we can do this test only once (we can't repeat the readback N times with calls to dequeue() expecting the same results). */ uint32_t i = 0; cw_tone_t tone; /* For output only, so no need to initialize. */ int rv = 0; while ((rv = cw_tq_dequeue_internal(tq, &tone)) && rv == CW_TQ_DEQUEUED) { uint32_t shifted = (i + head_shifts[s]) % (tq->capacity); cw_assert (tq->queue[shifted].frequency == (int) i, "position %"PRIu32": checking tone %"PRIu32", expected %"PRIu32", got %d\n", shifted, i, i, tq->queue[shifted].frequency); i++; } cw_assert (i == tq->capacity, "number of dequeues (%"PRIu32") is different than capacity (%"PRIu32")\n", i, tq->capacity); /* Matches tone queue creation made in test_cw_tq_capacity_test_init(). */ cw_tq_delete_internal(&tq); s++; } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } /** \brief Create and initialize tone queue for tests of capacity Create new tone queue for tests using three given parameters: \p capacity, \p high_water_mark, \p head_shift. The function is used to create a new tone queue in tests of "capacity" parameter of a tone queue. First two function parameters are rather boring. What is interesting is the third parameter: \p head_shift. In general the behaviour of tone queue (a circular list) should be independent of initial position of queue's head (i.e. from which position in the queue we start adding new elements to the queue). By initializing the queue with different initial positions of head pointer, we can test this assertion about irrelevance of initial head position. Returned pointer is owned by caller. tests::cw_tq_set_capacity_internal() \param capacity - intended capacity of tone queue \param high_water_mark - high water mark to be set for tone queue \param head_shift - position of first element that will be inserted in empty queue \return newly allocated and initialized tone queue */ cw_tone_queue_t *test_cw_tq_capacity_test_init(uint32_t capacity, uint32_t high_water_mark, int head_shift) { cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create new tone queue"); tq->state = CW_TQ_BUSY; int rv = cw_tq_set_capacity_internal(tq, capacity, high_water_mark); cw_assert (rv == CW_SUCCESS, "failed to set capacity/high water mark"); cw_assert (tq->capacity == capacity, "incorrect capacity: %"PRIu32" != %"PRIu32"", tq->capacity, capacity); cw_assert (tq->high_water_mark == high_water_mark, "incorrect high water mark: %"PRIu32" != %"PRIu32"", tq->high_water_mark, high_water_mark); /* Initialize *all* tones with known value. Do this manually, to be 100% sure that all tones in queue table have been initialized. */ for (int i = 0; i < CW_TONE_QUEUE_CAPACITY_MAX; i++) { CW_TONE_INIT(&(tq->queue[i]), 10000 + i, 1, CW_SLOPE_MODE_STANDARD_SLOPES); } /* Move head and tail of empty queue to initial position. The queue is empty - the initialization of fields done above is not considered as real enqueueing of valid tones. */ tq->tail = head_shift; tq->head = tq->tail; tq->len = 0; /* TODO: why do this here? */ tq->state = CW_TQ_BUSY; return tq; } /** \brief Test the limits of the parameters to the tone queue routine tests::cw_tq_enqueue_internal() */ unsigned int test_cw_tq_enqueue_internal_2(void) { cw_tone_queue_t *tq = cw_tq_new_internal(); cw_assert (tq, "failed to create a tone queue\n"); cw_tone_t tone; int f_min, f_max; cw_get_frequency_limits(&f_min, &f_max); /* Test 1: invalid length of tone. */ errno = 0; tone.len = -1; /* Invalid length. */ tone.frequency = f_min; /* Valid frequency. */ int status = cw_tq_enqueue_internal(tq, &tone); cw_assert (status == CW_FAILURE, "enqueued tone with invalid length.\n"); cw_assert (errno == EINVAL, "bad errno: %s\n", strerror(errno)); /* Test 2: tone's frequency too low. */ errno = 0; tone.len = 100; /* Valid length. */ tone.frequency = f_min - 1; /* Invalid frequency. */ status = cw_tq_enqueue_internal(tq, &tone); cw_assert (status == CW_FAILURE, "enqueued tone with too low frequency.\n"); cw_assert (errno == EINVAL, "bad errno: %s\n", strerror(errno)); /* Test 3: tone's frequency too high. */ errno = 0; tone.len = 100; /* Valid length. */ tone.frequency = f_max + 1; /* Invalid frequency. */ status = cw_tq_enqueue_internal(tq, &tone); cw_assert (status == CW_FAILURE, "enqueued tone with too high frequency.\n"); cw_assert (errno == EINVAL, "bad errno: %s\n", strerror(errno)); cw_tq_delete_internal(&tq); cw_assert (!tq, "tone queue not deleted properly\n"); int n = printf("libcw/tq: cw_tq_enqueue_internal():"); CW_TEST_PRINT_TEST_RESULT (false, n); return 0; } #endif /* #ifdef LIBCW_UNIT_TESTS */ unixcw-3.4.2/src/libcw/libcw_data.h0000644000175000017500000000303612450304574017016 0ustar acerionacerion/* This file is a part of unixcw project. unixcw project is covered by GNU General Public License. */ #ifndef H_LIBCW_DATA #define H_LIBCW_DATA #include typedef struct cw_entry_struct{ const char character; /* Character represented */ const char *const representation; /* Dot-dash shape of the character */ } cw_entry_t; /* functions handling representation of a character; representation looks like this: ".-" for "a", "--.." for "z", etc. */ int cw_representation_lookup_init_internal(const cw_entry_t *lookup[]); int cw_representation_to_character_internal(const char *representation); __attribute__((unused)) int cw_representation_to_character_direct_internal(const char *representation); unsigned int cw_representation_to_hash_internal(const char *representation); const char *cw_character_to_representation_internal(int c); const char *cw_lookup_procedural_character_internal(int c, bool *is_usually_expanded); #ifdef LIBCW_UNIT_TESTS unsigned int test_cw_representation_to_hash_internal(void); unsigned int test_cw_representation_to_character_internal(void); unsigned int test_cw_representation_to_character_internal_speed(void); unsigned int test_character_lookups_internal(void); unsigned int test_prosign_lookups_internal(void); unsigned int test_phonetic_lookups_internal(void); unsigned int test_validate_character_and_string_internal(void); unsigned int test_validate_representation_internal(void); #endif /* #ifdef LIBCW_UNIT_TESTS */ #endif /* #ifndef H_LIBCW_DATA */ unixcw-3.4.2/src/libcw/libcw_signal.c0000644000175000017500000004444212472371371017366 0ustar acerionacerion/* Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) 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. */ /** \file libcw_signal.c \brief Signal handling routines. There are some static variables in this file, maybe they should be moved to some common structure. I've noticed that these functions are used in libcw_gen, libcw_tq and libcw_key. Perhaps these static variables should be members of cw_gen_t. */ #include "config.h" #include #include #include #include "libcw.h" #include "libcw_signal.h" #include "libcw_debug.h" #include "libcw_gen.h" #include "libcw_utils.h" #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif /* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403043 */ #if defined(NSIG) /* Debian GNU/Linux: signal.h; Debian kFreeBSD: signal.h (libc0.1-dev_2.13-21_kfreebsd-i386.deb) */ #define CW_SIG_MAX (NSIG) #elif defined(_NSIG) /* Debian GNU/Linux: asm-generic/signal.h; Debian kFreeBSD: i386-kfreebsd-gnu/bits/signum.h->signal.h (libc0.1-dev_2.13-21_kfreebsd-i386.deb) */ #define CW_SIG_MAX (_NSIG) #elif defined(RTSIG_MAX) /* Debian GNU/Linux: linux/limits.h */ #define CW_SIG_MAX ((RTSIG_MAX)+1) #elif defined(__FreeBSD__) #define CW_SIG_MAX (_SIG_MAXSIG) #else #error "unknown number of signals" #endif extern cw_debug_t cw_debug_object; extern cw_debug_t cw_debug_object_ev; extern cw_debug_t cw_debug_object_dev; extern cw_gen_t *cw_generator; static int cw_timer_run_internal(int usecs); static void cw_sigalrm_handlers_caller_internal(int signal_number); static int cw_sigalrm_block_internal(bool block); static void cw_signal_main_handler_internal(int signal_number); /* The library keeps a single central non-sparse list of SIGALRM signal handlers. The handler functions will be called sequentially on each SIGALRM received. */ enum { CW_SIGALRM_HANDLERS_MAX = 32 }; static void (*cw_sigalrm_handlers[CW_SIGALRM_HANDLERS_MAX])(void); /* Flag to tell us if the SIGALRM handler is installed, and a place to keep the old SIGALRM disposition, so we can restore it when the library decides it can stop handling SIGALRM for a while. */ static bool cw_is_sigalrm_handlers_caller_installed = false; static struct sigaction cw_sigalrm_original_disposition; /** \brief Call handlers of SIGALRM signal This function calls the SIGALRM signal handlers of the library subsystems, expecting them to ignore unexpected calls. The handlers are kept in cw_sigalrm_handlers[] table, and can be added to the table with cw_timer_run_with_handler_internal(). SIGALRM is sent to a process every time an itimer timer expires. The timer is set with cw_timer_run_internal(). */ void cw_sigalrm_handlers_caller_internal(__attribute__((unused)) int signal_number) { /* Call the known functions that are interested in SIGALRM signal. Stop on the first free slot found; valid because the array is filled in order from index 0, and there are no deletions. */ for (int handler = 0; handler < CW_SIGALRM_HANDLERS_MAX && cw_sigalrm_handlers[handler]; handler++) { cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_INTERNAL, CW_DEBUG_DEBUG, "libcw: SIGALRM handler #%d", handler); (cw_sigalrm_handlers[handler])(); } return; } /** \brief Set up a timer for specified number of microseconds Convenience function to set the itimer for a single shot timeout after a given number of microseconds. SIGALRM is sent to caller process when the timer expires. \param usecs - time in microseconds \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_timer_run_internal(int usecs) { struct itimerval itimer; /* Set up a single shot timeout for the given period. */ itimer.it_interval.tv_sec = 0; itimer.it_interval.tv_usec = 0; itimer.it_value.tv_sec = usecs / CW_USECS_PER_SEC; itimer.it_value.tv_usec = usecs % CW_USECS_PER_SEC; int status = setitimer(ITIMER_REAL, &itimer, NULL); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: setitimer(%d): %s", usecs, strerror(errno)); return CW_FAILURE; } return CW_SUCCESS; } /** \brief Register SIGALRM handler(s), and send SIGALRM signal Install top level handler of SIGALRM signal (cw_sigalrm_handlers_caller_internal()) if it is not already installed. Register given \p sigalrm_handler lower level handler, if not NULL and if not yet registered. Then send SIGALRM signal after delay equal to \p usecs microseconds. \param usecs - time for itimer \param sigalrm_handler - SIGALRM handler to register \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_timer_run_with_handler_internal(int usecs, void (*sigalrm_handler)(void)) { if (!cw_sigalrm_install_top_level_handler_internal()) { return CW_FAILURE; } /* If it's not already present, and one was given, add address of the lower level SIGALRM handler to the list of known handlers. */ if (sigalrm_handler) { int handler; /* Search for this handler, or the first free entry, stopping at the last entry in the table even if it's not a match and not free. */ for (handler = 0; handler < CW_SIGALRM_HANDLERS_MAX - 1; handler++) { if (!cw_sigalrm_handlers[handler] || cw_sigalrm_handlers[handler] == sigalrm_handler) { break; } } /* If the handler is already there, do no more. Otherwise, if we ended the search at an unused entry, add it to the list of lower level handlers. */ if (cw_sigalrm_handlers[handler] != sigalrm_handler) { if (cw_sigalrm_handlers[handler]) { errno = ENOMEM; cw_debug_msg ((&cw_debug_object), CW_DEBUG_INTERNAL, CW_DEBUG_ERROR, "libcw: overflow cw_sigalrm_handlers"); return CW_FAILURE; } else { cw_sigalrm_handlers[handler] = sigalrm_handler; } } } /* The fact that we receive a call means that something is using timeouts and sound, so make sure that any pending finalization doesn't happen. */ cw_finalization_cancel_internal(); /* Depending on the value of usec, either set an itimer, or send ourselves SIGALRM right away. */ if (usecs <= 0) { /* Send ourselves SIGALRM immediately. */ if (pthread_kill(cw_generator->thread.id, SIGALRM) != 0) { // if (raise(SIGALRM) != 0) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: raise()"); return CW_FAILURE; } } else { /* Set the itimer to produce a single interrupt after the given duration. */ if (!cw_timer_run_internal(usecs)) { return CW_FAILURE; } } return CW_SUCCESS; } int cw_sigalrm_install_top_level_handler_internal(void) { if (!cw_is_sigalrm_handlers_caller_installed) { /* Install the main SIGALRM handler routine (a.k.a. top level SIGALRM handler) - a function that calls all registered lower level handlers), and keep the old information (disposition) so we can put it back when useful to do so. */ struct sigaction action; action.sa_handler = cw_sigalrm_handlers_caller_internal; action.sa_flags = SA_RESTART; sigemptyset(&action.sa_mask); int status = sigaction(SIGALRM, &action, &cw_sigalrm_original_disposition); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigaction(): %s", strerror(errno)); return CW_FAILURE; } cw_is_sigalrm_handlers_caller_installed = true; } return CW_SUCCESS; } /** \brief Uninstall the SIGALRM handler, if installed Restores SIGALRM's disposition for the system to the state we found it in before we installed our own SIGALRM handler. \return CW_FAILURE on failure \return CW_SUCCESS on success */ int cw_sigalrm_restore_internal(void) { /* Ignore the call if we haven't installed our handler. */ if (cw_is_sigalrm_handlers_caller_installed) { /* Cancel any pending itimer setting. */ if (!cw_timer_run_internal(0)) { return CW_FAILURE; } /* Put back the SIGALRM information saved earlier. */ int status = sigaction(SIGALRM, &cw_sigalrm_original_disposition, NULL); if (status == -1) { perror ("libcw: sigaction"); return CW_FAILURE; } cw_is_sigalrm_handlers_caller_installed = false; } return CW_SUCCESS; } /** \brief Check if SIGALRM is currently blocked Check the signal mask of the process, and return false, with errno set to EDEADLK, if SIGALRM is blocked. If function returns true, but errno is set, the function has failed to check if SIGALRM is blocked. \return true if SIGALRM is currently blocked (errno is zero) \return true on errors (errno is set by system call that failed) \return false if SIGALRM is currently not blocked */ bool cw_sigalrm_is_blocked_internal(void) { sigset_t empty_set, current_set; /* Prepare empty set of signals */ int status = sigemptyset(&empty_set); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigemptyset(): %s", strerror(errno)); return true; } /* Block an empty set of signals to obtain the current mask. */ status = sigprocmask(SIG_BLOCK, &empty_set, ¤t_set); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigprocmask(): %s", strerror(errno)); return true; } /* Check that SIGALRM is not blocked in the current mask. */ if (sigismember(¤t_set, SIGALRM)) { errno = 0; return true; } else { return false; } } /** \brief Block or unblock SIGALRM signal Function blocks or unblocks SIGALRM. It may be used to block the signal for the duration of certain critical sections, and to unblock the signal afterwards. \param block - pass true to block SIGALRM, and false to unblock it \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_sigalrm_block_internal(bool block) { sigset_t set; /* Prepare empty set of signals */ int status = sigemptyset(&set); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigemptyset(): %s", strerror(errno)); return CW_FAILURE; } /* Add single signal to the set */ status = sigaddset(&set, SIGALRM); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigaddset(): %s", strerror(errno)); return CW_FAILURE; } /* Block or unblock SIGALRM for the process using the set of signals */ status = pthread_sigmask(block ? SIG_BLOCK : SIG_UNBLOCK, &set, NULL); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: pthread_sigmask(): %s", strerror(errno)); return CW_FAILURE; } return CW_SUCCESS; } /** \brief Block the callback from being called Function blocks the callback from being called for a critical section of caller code if \p block is true, and unblocks the callback if \p block is false. Function works by blocking SIGALRM; a block should always be matched by an unblock, otherwise the tone queue will suspend forever. \param block - pass 1 to block SIGALRM, and 0 to unblock it */ void cw_block_callback(int block) { cw_sigalrm_block_internal((bool) block); return; } /** \brief Wait for a signal, usually a SIGALRM Function assumes that SIGALRM is not blocked. Function may return CW_FAILURE on failure, i.e. when call to sigemptyset(), sigprocmask() or sigsuspend() fails. \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_signal_wait_internal(void) { sigset_t empty_set, current_set; /* Prepare empty set of signals */ int status = sigemptyset(&empty_set); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigemptyset(): %s", strerror(errno)); return CW_FAILURE; } /* Block an empty set of signals to obtain the current mask. */ status = sigprocmask(SIG_BLOCK, &empty_set, ¤t_set); if (status == -1) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: sigprocmask(): %s", strerror(errno)); return CW_FAILURE; } /* Wait on the current mask */ status = sigsuspend(¤t_set); if (status == -1 && errno != EINTR) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_STDLIB, CW_DEBUG_ERROR, "libcw: suspend(): %s", strerror(errno)); return CW_FAILURE; } return CW_SUCCESS; } /* Array of callbacks registered for convenience signal handling. They're initialized dynamically to SIG_DFL (if SIG_DFL is not NULL, which it seems that it is in most cases). */ static void (*cw_signal_callbacks[CW_SIG_MAX])(int); /** \brief Generic function calling signal handlers Signal handler function registered when cw_register_signal_handler() is called. The function resets the library (with cw_complete_reset()), and then, depending on value of signal handler for given \p signal_number: \li calls exit(EXIT_FAILURE) if signal handler is SIG_DFL, or \li continues without further actions if signal handler is SIG_IGN, or \li calls the signal handler. The signal handler for given \p signal_number is either a pre-set, default value, or is a value registered earlier with cw_register_signal_handler(). \param signal_number */ void cw_signal_main_handler_internal(int signal_number) { cw_debug_msg ((&cw_debug_object), CW_DEBUG_FINALIZATION, CW_DEBUG_INFO, "libcw: caught signal %d", signal_number); /* Reset the library and retrieve the signal's handler. */ cw_complete_reset(); void (*callback_func)(int) = cw_signal_callbacks[signal_number]; /* The default action is to stop the process; exit(1) seems to cover it. */ if (callback_func == SIG_DFL) { exit(EXIT_FAILURE); } else if (callback_func == SIG_IGN) { /* continue */ } else { /* invoke any additional handler callback function */ (*callback_func)(signal_number); } return; } /** \brief Register a signal handler and optional callback function for given signal number On receipt of that signal, all library features will be reset to their default states. Following the reset, if \p callback_func is a function pointer, the function is called; if it is SIG_DFL, the library calls exit(); and if it is SIG_IGN, the library returns from the signal handler. This is a convenience function for clients that need to clean up library on signals, with either exit, continue, or an additional function call; in effect, a wrapper round a restricted form of sigaction. The \p signal_number argument indicates which signal to catch. On problems errno is set to EINVAL if \p signal_number is invalid or if a handler is already installed for that signal, or to the sigaction error code. \param signal_number \param callback_func \return CW_SUCCESS - if the signal handler installs correctly \return CW_FAILURE - on errors or problems */ int cw_register_signal_handler(int signal_number, void (*callback_func)(int)) { static bool is_initialized = false; /* On first call, initialize all signal_callbacks to SIG_DFL. */ if (!is_initialized) { for (int i = 0; i < CW_SIG_MAX; i++) { cw_signal_callbacks[i] = SIG_DFL; } is_initialized = true; } /* Reject invalid signal numbers, and SIGALRM, which we use internally. */ if (signal_number < 0 || signal_number >= CW_SIG_MAX || signal_number == SIGALRM) { errno = EINVAL; return CW_FAILURE; } /* Install our handler as the actual handler. */ struct sigaction action, original_disposition; action.sa_handler = cw_signal_main_handler_internal; action.sa_flags = SA_RESTART; sigemptyset(&action.sa_mask); int status = sigaction(signal_number, &action, &original_disposition); if (status == -1) { perror("libcw: sigaction"); return CW_FAILURE; } /* If we trampled another handler, replace it and return false. */ if (!(original_disposition.sa_handler == cw_signal_main_handler_internal || original_disposition.sa_handler == SIG_DFL || original_disposition.sa_handler == SIG_IGN)) { status = sigaction(signal_number, &original_disposition, NULL); if (status == -1) { perror("libcw: sigaction"); return CW_FAILURE; } errno = EINVAL; return CW_FAILURE; } /* Save the callback function (it may validly be SIG_DFL or SIG_IGN). */ cw_signal_callbacks[signal_number] = callback_func; return CW_SUCCESS; } /** \brief Unregister a signal handler interception Function removes a signal handler interception previously registered with cw_register_signal_handler(). \param signal_number \return true if the signal handler uninstalls correctly \return false otherwise (with errno set to EINVAL or to the sigaction error code) */ int cw_unregister_signal_handler(int signal_number) { /* Reject unacceptable signal numbers. */ if (signal_number < 0 || signal_number >= CW_SIG_MAX || signal_number == SIGALRM) { errno = EINVAL; return CW_FAILURE; } /* See if the current handler was put there by us. */ struct sigaction original_disposition; int status = sigaction(signal_number, NULL, &original_disposition); if (status == -1) { perror("libcw: sigaction"); return CW_FAILURE; } if (original_disposition.sa_handler != cw_signal_main_handler_internal) { /* No, it's not our signal handler. Don't touch it. */ errno = EINVAL; return CW_FAILURE; } /* Remove the signal handler by resetting to SIG_DFL. */ struct sigaction action; action.sa_handler = SIG_DFL; action.sa_flags = 0; sigemptyset(&action.sa_mask); status = sigaction(signal_number, &action, NULL); if (status == -1) { perror("libcw: sigaction"); return CW_FAILURE; } /* Reset the callback entry for tidiness. */ cw_signal_callbacks[signal_number] = SIG_DFL; return CW_SUCCESS; } unixcw-3.4.2/src/Makefile.am0000644000175000017500000000045411742314561015511 0ustar acerionacerion# use $(top_builddir) instead of $(top_srcdir) because Makefile.inc is # (re)created at build time; if you use $(top_srcdir), you may (will?) # get empty, non-initialized $(AC_SRC_SUBDIRS); -include $(top_builddir)/Makefile.inc # may (or may not) include cwcp and xcwcp SUBDIRS = $(AC_SRC_SUBDIRS) unixcw-3.4.2/src/cwutils/0000755000175000017500000000000012540354302015136 5ustar acerionacerionunixcw-3.4.2/src/cwutils/dictionary.c0000644000175000017500000005475212451006042017460 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "dictionary.h" #include "cw_words.h" #include "cw_common.h" #include "memory.h" #include "i18n.h" #include "libcw_debug.h" /** cw dictionaries Dictionary is a data structure containing list of "words", grouped together for some specific purpose. Every dictionary has a description (dictionary's label), and a list of words that are the body of a dictionary. "words" is used loosely: the words can be real, multi-character words, or just single letters. Every dictionary has a 'group size' property, telling if words in a dictionary are only single-character words, or multi-character words. Dictionaries can be stored in a text file between two sessions of a program. Dictionaries stored in a memory are put on a linked list. There can be only one such list at a time. Description of a given dictionary is in first line in square brackets, and in following line is a list of words. Words are separated by space characters. Examples (yes, this looks like contents of .ini file): [ Digits ] 1 2 3 4 5 6 7 8 9 0 [ A-K ] A B C D E F G H I J K [ My favourite nouns ] coffee C vacation Linux Comments in file are allowed (and skipped): lines starting with ';' or '#' characters are considered to be comments. Usually an application uses several dictionaries, and a file can also store few dictionaries. The module has its own, internal, default list of cw dictionaries. If application doesn't read any dictionaries from text file, the module loads its own dictionaries to memory on first call to cw_dictionaries_iterate(). The module implements functions providing following functionality: \li loading dictionaries from text file to memory, \li removing dictionaries from memory, \li writing current dictionaries from memory to text file, \li iterating over list of dictionaries in memory, \li getting description of a specified dictionary, \li getting 'group size' information about given dictionary, \li getting a random word from given dictionary. */ static void cw_dictionary_trim(char *buffer); static bool cw_dictionary_parse_is_comment(const char *line); static bool cw_dictionary_parse_is_section(const char *line, char **name_ptr); static cw_dictionary_t *cw_dictionaries_create_from_stream(FILE *stream, const char *file); static cw_dictionary_t *cw_dictionaries_create_default(void); static char *cw_dictionary_check_line(const char *line); /*---------------------------------------------------------------------*/ /* Dictionary data */ /*---------------------------------------------------------------------*/ enum { MAX_LINE = 8192 }; /* Aggregate dictionary data into a structure. */ struct cw_dictionary_s { const char *description; /* Dictionary description */ const char *const *wordlist; /* Dictionary word list */ int wordlist_length; /* Length of word list */ int group_size; /* Size of a group */ void *mutable_description; /* Freeable (aliased) description string */ void *mutable_wordlist; /* Freeable (aliased) word list */ void *mutable_wordlist_data; /* Freeable bulk word list data */ dictionary *next; /* List pointer */ }; /* Head of a list storing currently loaded dictionaries. */ static cw_dictionary_t *dictionaries_head = NULL; /*---------------------------------------------------------------------*/ /* Dictionary implementation */ /*---------------------------------------------------------------------*/ /* * dictionary_new() * dictionary_new_const() * dictionary_new_mutable() * * Create a new dictionary, and add to any list tail passed in, returning * the entry created (the new list tail). The main function adds the data, * plus any mutable pointers that need to be freed on destroying the * dictionary. The const and mutable variants are convenience interfaces. */ static dictionary *dictionary_new(dictionary *tail, const char *description, const char *const wordlist[], void *mutable_description, void *mutable_wordlist, void *mutable_wordlist_data) { /* Count words in the wordlist, and look for multicharacter entries. */ int words = 0; bool is_multicharacter = false; for (int word = 0; wordlist[word]; word++) { is_multicharacter |= strlen(wordlist[word]) > 1; words++; } /* Create a new dictionary and fill in the main fields. Group size is set to one for multicharacter word lists, five otherwise. */ dictionary *dict = safe_malloc(sizeof (*dict)); dict->description = description; dict->wordlist = wordlist; dict->wordlist_length = words; dict->group_size = is_multicharacter ? 1 : 5; dict->next = NULL; /* Add mutable pointers passed in. */ dict->mutable_description = mutable_description; dict->mutable_wordlist = mutable_wordlist; dict->mutable_wordlist_data = mutable_wordlist_data; /* Add to the list tail passed in, if any. */ if (tail) { tail->next = dict; } return dict; } static dictionary *dictionary_new_const(dictionary *tail, const char *description, const char *const wordlist[]) { return dictionary_new(tail, description, wordlist, NULL, NULL, NULL); } static dictionary *dictionary_new_mutable(dictionary *tail, char *description, const char *wordlist[], void *wordlist_data) { return dictionary_new(tail, description, wordlist, description, wordlist, wordlist_data); } /** \brief Reset dictionaries state Free any allocations from the current dictionaries list, and return list of dictionaries to the initial state (i.e. empty). */ void cw_dictionaries_unload(void) { cw_dictionary_t *next = NULL; /* Free each dictionary in the list. */ for (cw_dictionary_t *entry = dictionaries_head; entry; entry = next) { next = entry->next; /* Free allocations held in the dictionary. */ free(entry->mutable_wordlist); free(entry->mutable_description); free(entry->mutable_wordlist_data); /* Free the dictionary itself. */ free(entry); } dictionaries_head = NULL; return; } /* * dictionary_unload() * * Free any allocations from the current dictionary, and return to the * initial state. */ void dictionary_unload(void) { cw_dictionaries_unload(); return; } /** \brief Parse a line, check if it is a line with comment Function parses given \p line and checks if it looks like a comment. A comment is a line starting with ';' or '#' char, or a line consisting entirely of spaces and TAB characters \param line - line to parse \return true if line is a line with comment \return false otherwise */ bool cw_dictionary_parse_is_comment(const char *line) { size_t index = strspn(line, " \t"); return index == strlen(line) || strchr(";#", line[0]); } /** \brief Parse a line, check if it is section name Function parses given \p line and checks if it looks like a name of a section (a string in square brackets). If it is a section name, then the function stores the name in \p name_ptr and returns true. Otherwise it returns false. On success the function allocates memory and sets *name_ptr pointer to this memory. \param line - line to parse \param name_ptr - output, place for name of a section \return true if line contains section name \return false otherwise */ bool cw_dictionary_parse_is_section(const char *line, char **name_ptr) { char *name = safe_malloc(strlen(line) + 1); char dummy; int count = sscanf(line, " [ %[^]] ] %c", name, &dummy); if (count == 1) { *name_ptr = safe_realloc(name, strlen(name) + 1); return true; } free(name); return false; } /* * dictionary_build_wordlist() * * Build and return a wordlist from a string of space-separated words. The * wordlist_data is changed by this function. */ static const char ** dictionary_build_wordlist (char *wordlist_data) { const char **wordlist, *word; int size, allocation; /* Split contents into a wordlist, and store each word retrieved. */ size = allocation = 0; wordlist = NULL; for (word = strtok (wordlist_data, " \t"); word; word = strtok (NULL, " \t")) { if (size == allocation) { allocation = allocation == 0 ? 1 : allocation << 1; wordlist = safe_realloc (wordlist, sizeof (*wordlist) * allocation); } wordlist[size++] = word; } /* Add a null sentinel. */ if (size == allocation) { allocation++; wordlist = safe_realloc (wordlist, sizeof (*wordlist) * allocation); } wordlist[size++] = NULL; return wordlist; } /** \brief Trim a line Helper functions for cw_dictionaries_read(). Trims a line of all leading and trailing whitespace. Trimming is done in-place, content of the \p buffer argument may be modified. \param buffer - buffer with string to trim */ void cw_dictionary_trim(char *buffer) { size_t bytes = strlen(buffer); while (bytes > 0 && isspace(buffer[bytes - 1])) { buffer[--bytes] = '\0'; } size_t index = strspn(buffer, " \t"); if (index > 0) { memmove(buffer, buffer + index, bytes - index + 1); } return; } /** \brief Check if given line contains any invalid characters. Check a \p line for unsendable characters. If there are any invalid characters in \p line, return an allocated string with '^' characters in error positions and with spaces in all other positions. Return NULL if all characters in \p line are valid (sendable). Returned pointer is managed by caller. \param line - line to check \return pointer to string if \p line contains one or more invalid characters \return NULL otherwise */ char *cw_dictionary_check_line(const char *line) { char *errors = malloc(strlen(line) + 1); int count = 0; int i = 0; for (i = 0; line[i] != '\0'; i++) { errors[i] = cw_character_is_valid(line[i]) ? ' ' : '^'; if (errors[i] == '^') { count++; } } errors[i] = '\0'; /* If not all sendable, return the string, otherwise return NULL. */ if (count > 0) { return errors; } free(errors); errors = NULL; return NULL; } /** \brief Create a dictionary list from a stream Load dictionaries from a \p stream into memory. The \p stream needs to be already open for reading. \p file is a name of the stream, used in error messages. \p stream should be open and closed by caller of the function. The file format is expected to be ini-style. This is a lower level function, to be used by cw_dictionaries_read(). \param stream - stream to read data from \param file - human-readable name of the stream \return head of list of loaded dictionaries on success \return NULL if loading fails. */ cw_dictionary_t *cw_dictionaries_create_from_stream(FILE *stream, const char *file) { const char **wordlist; /* Clear the variables used to accumulate stream data. */ char *line = safe_malloc(MAX_LINE); int line_number = 0; char *name = NULL; char *content = NULL; dictionary *head = NULL; dictionary *tail = NULL; /* Parse input lines to create a new dictionary. */ while (cw_getline(stream, line, MAX_LINE + 1)) { line_number++; char *new_name; if (cw_dictionary_parse_is_comment(line)) { continue; } else if (cw_dictionary_parse_is_section(line, &new_name)) { /* New section, so handle data accumulated so far. Or if no data accumulated, forget it. */ if (content) { wordlist = dictionary_build_wordlist(content); tail = dictionary_new_mutable(tail, name, wordlist, content); head = head ? head : tail; } else { free(name); name = NULL; } /* Start new accumulation of words. */ cw_dictionary_trim(new_name); name = new_name; content = NULL; } else if (name) { /* Check the line for unsendable characters. */ char *errors = cw_dictionary_check_line(line); if (errors) { fprintf(stderr, "%s:%d: unsendable character found:\n", file, line_number); fprintf(stderr, "%s\n%s\n", line, errors); free(errors); } /* Accumulate this line into the current content. */ cw_dictionary_trim(line); if (content) { content = safe_realloc(content, strlen(content) + strlen(line) + 2); strcat(content, " "); strcat(content, line); } else { content = safe_malloc(strlen(line) + 1); strcpy(content, line); } } else { fprintf(stderr, "%s:%d: unrecognized line, expected [section] or commentary\n", file, line_number); } } /* Handle any final accumulated data. */ if (content) { wordlist = dictionary_build_wordlist(content); tail = dictionary_new_mutable(tail, name, wordlist, content); head = head ? head : tail; } if (!head) { fprintf(stderr, "%s:%d: no usable dictionary data found in the file\n", file, line_number); } free(line); line = NULL; return head; } /** \brief Create list of default dictionaries Create a dictionary list from internal data. \return head of the list on success \return NULL on failure */ cw_dictionary_t *cw_dictionaries_create_default(void) { cw_dictionary_t *head = NULL, *tail = NULL; head = dictionary_new_const (NULL, _("Letter Groups"), CW_ALPHABETIC); tail = dictionary_new_const (head, _("Number Groups"), CW_NUMERIC); tail = dictionary_new_const (tail, _("Alphanum Groups"), CW_ALPHANUMERIC); tail = dictionary_new_const (tail, _("All Char Groups"), CW_ALL_CHARACTERS); tail = dictionary_new_const (tail, _("English Words"), CW_SHORT_WORDS); tail = dictionary_new_const (tail, _("CW Words"), CW_CW_WORDS); tail = dictionary_new_const (tail, _("PARIS Calibrate"), CW_PARIS); tail = dictionary_new_const (tail, _("EISH5 Groups"), CW_EISH5); tail = dictionary_new_const (tail, _("TMO0 Groups"), CW_TMO0); tail = dictionary_new_const (tail, _("AUV4 Groups"), CW_AUV4); tail = dictionary_new_const (tail, _("NDB6 Groups"), CW_NDB6); tail = dictionary_new_const (tail, _("KX=-RP Groups"), CW_KXffRP); tail = dictionary_new_const (tail, _("FLYQC Groups"), CW_FLYQC); tail = dictionary_new_const (tail, _("WJ1GZ Groups"), CW_WJ1GZ); tail = dictionary_new_const (tail, _("23789 Groups"), CW_23789); tail = dictionary_new_const (tail, _(",?.;)/ Groups"), CW_FIGURES_1); tail = dictionary_new_const (tail, _("\"'$(+:_ Groups"), CW_FIGURES_2); #if 0 /* test code */ dictionaries_head = head; int i = 0; for (cw_dictionary_t *dict = cw_dictionaries_iterate(NULL); dict; dict = cw_dictionaries_iterate(dict)) { i++; } fprintf(stderr, "number of default dictionaries = %d (should be 17)\n", i + 1); if (i == 17) { return head; } else { cw_dictionaries_unload(); return NULL; } #else return head; #endif } /** \brief Read dictionaries from given file Set the main dictionary list to data read from a file. \param file - open file to read from \return true on success \return false if loading fails */ bool cw_dictionaries_read(const char *file) { /* Open the input stream, or fail if unopenable. */ FILE *stream = fopen(file, "r"); if (!stream) { fprintf(stderr, "%s: open error: %s\n", file, strerror(errno)); return false; } /* If we can generate a dictionary list, free any currently allocated one and store the details of what we loaded into module variables. */ cw_dictionary_t *head = cw_dictionaries_create_from_stream(stream, file); if (head) { cw_dictionaries_unload(); dictionaries_head = head; } /* Close stream and return true if we loaded a dictionary. */ fclose(stream); return head != NULL; } int dictionary_load(const char *file) { return cw_dictionaries_read(file); } /** \brief Iterate known dictionaries Because this is the only way dictionaries can be accessed by callers, this function sets up a default dictionary list if none loaded. \param current - current dictionary on list of dictionaries, or NULL if you want to fetch first dictionary from list \return the first dictionary if \p current is NULL \return next dictionary is \p current is a dictionary \return NULL if there are no more dictionaries on list */ const cw_dictionary_t *cw_dictionaries_iterate(const cw_dictionary_t *current) { /* If no dictionary list has been loaded, supply a default one. */ if (!dictionaries_head) { dictionaries_head = cw_dictionaries_create_default(); } return current ? current->next : dictionaries_head; } /* * dictionary_iterate() * * Iterate known dictionaries. Returns the first if dictionary is NULL, * otherwise the next, or NULL if no more. * * Because this is the only way dictionaries can be accessed by callers, * this function sets up a default dictionary list if none loaded. */ const dictionary *dictionary_iterate(const dictionary *current) { return cw_dictionaries_iterate(current); } /** \brief Write current dictionaries to given file Write the currently loaded (or default) dictionaries out to a given file. \param file - file to write to \return true on success \return false if writing fails */ bool cw_dictionaries_write(const char *file) { /* Open the output stream, or fail if unopenable. */ FILE *stream = fopen(file, "w"); if (!stream) { fprintf(stderr, "%s: open error: %s\n", file, strerror(errno)); return false; } /* If no dictionary list has been loaded, supply a default one, then print details of each. */ if (!dictionaries_head) { dictionaries_head = cw_dictionaries_create_default(); } for (const cw_dictionary_t *dict = dictionaries_head; dict; dict = dict->next) { fprintf(stream, "[ %s ]\n\n", dict->description); int chars = 0; for (int i = 0; i < dict->wordlist_length; i++) { fprintf(stream, " %s", dict->wordlist[i]); chars += strlen(dict->wordlist[i]) + 1; if (chars > 72) { fprintf(stream, "\n"); chars = 0; } } fprintf(stream, chars > 0 ? "\n\n" : "\n"); } fclose(stream); return true; } int dictionary_write(const char *file) { return cw_dictionaries_write(file); } /** \brief Get description of a given dictionary \return a string */ const char *cw_dictionary_get_description(const cw_dictionary_t *dict) { return dict->description; } /* * get_dictionary_description() * get_dictionary_group_size() * * Return the text description and group size for a given dictionary. */ const char *get_dictionary_description(const dictionary *dict) { return dict->description; } /** \brief Get group size of a given dictionary \param dict - dictionary to query */ int cw_dictionary_get_group_size(const cw_dictionary_t *dict) { return dict->group_size; } int get_dictionary_group_size(const dictionary *dict) { return dict->group_size; } /** \brief Get a random word from given dictionary \param dict - dictionary to query \return a string */ const char *cw_dictionary_get_random_word(const cw_dictionary_t *dict) { static bool is_initialized = false; /* On the first call, seed the random number generator. */ if (!is_initialized) { srand(time(NULL)); is_initialized = true; } return dict->wordlist[rand() % dict->wordlist_length]; } /* * get_dictionary_random_word() * * Return a random word from the given dictionary. */ const char *get_dictionary_random_word(const dictionary *dict) { return cw_dictionary_get_random_word(dict); } #ifdef CW_DICTIONARY_UNIT_TESTS #include "libcw_test.h" static unsigned int test_cw_dictionary_check_line(void); typedef unsigned int (*cw_dict_test_function_t)(void); static cw_dict_test_function_t cw_dict_unit_tests[] = { test_cw_dictionary_check_line, NULL }; int main(void) { fprintf(stderr, "unit tests for \"dictionary\" functions\n\n"); int i = 0; while (cw_dict_unit_tests[i]) { cw_dict_unit_tests[i](); i++; } /* "make check" facility requires this message to be printed on stdout; don't localize it */ fprintf(stdout, "\ndictionary: test result: success\n\n"); return 0; } unsigned int test_cw_dictionary_check_line(void) { int p = fprintf(stderr, "dictionary: cw_dictionary_check_line():"); /* First test the function giving it strings with some invalid characters. */ { struct { const char *in; const char *expected_out; } invalid_test_data[] = { /* See src/libcw/libcw.c for list of valid characters. */ /* The '^' marks in "out" strings point invalid characters. These "out" strings look exactly as expected outputs of tested function. */ { "t7890pl\tnbf7890lnbdg", " ^ " }, { "`u90-pkngfrt6789=0ol", "^ " }, { "34rtghjm,1qazx-poijh|", " ^" }, { "=-0987654$[^&*()%^&|", " ^ ^ ^ ^" }, { NULL, NULL } /* Guard. */ }; for (int i = 0; invalid_test_data[i].in; i++) { char *out = cw_dictionary_check_line(invalid_test_data[i].in); cw_assert (out, "function returned NULL for string #%d with invalid char(s)", i); cw_assert (!strcmp(out, invalid_test_data[i].expected_out), "strings not equal:\n\"%s\"\n\"%s\"\n", out, invalid_test_data[i].expected_out); free(out); out = NULL; } } /* Now also test with strings with all chars valid. */ { const char *valid_test_data[] = { /* See src/libcw/libcw.c for list of valid characters. */ "t7890pltnbf7890lnbdg", "u90-pkngfrt6789=0ol", "34rtghjm,1qazx-poijh", "=-0987654$^&()^&ABCP", NULL /* Guard. */ }; for (int i = 0; valid_test_data[i]; i++) { char *out = cw_dictionary_check_line(valid_test_data[i]); cw_assert (!out, "function returned non-NULL for string #%d with all valid chars", i); } } CW_TEST_PRINT_TEST_RESULT(false, p); return 0; } #endif /* #ifdef CW_DICTIONARY_UNIT_TESTS */ unixcw-3.4.2/src/cwutils/memory.c0000644000175000017500000000370212451006017016612 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "memory.h" /*---------------------------------------------------------------------*/ /* Memory allocation wrappers */ /*---------------------------------------------------------------------*/ /* * safe_malloc() * safe_realloc() * safe_strdup() * * Non-failing wrappers around malloc(), realloc(), and strdup(). */ void * safe_malloc (size_t size) { void *pointer; pointer = malloc (size); if (!pointer) { perror ("malloc"); exit (EXIT_FAILURE); } return pointer; } void * safe_realloc (void *ptr, size_t size) { void *pointer; pointer = realloc (ptr, size); if (!pointer) { perror ("realloc"); exit (EXIT_FAILURE); } return pointer; } char * safe_strdup (const char *s) { char *copy; copy = malloc (strlen (s) + 1); if (!copy) { perror ("strdup"); exit (EXIT_FAILURE); } strcpy (copy, s); return copy; } unixcw-3.4.2/src/cwutils/cw_common.h0000644000175000017500000000477012451006137017301 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef H_CW_COMMON #define H_CW_COMMON #if defined(__cplusplus) extern "C" { #endif #include #include #define CW_PRACTICE_TIME_MIN 1 #define CW_PRACTICE_TIME_MAX 99 #define CW_PRACTICE_TIME_INITIAL 15 #define CW_PRACTICE_TIME_STEP 1 typedef struct { char *program_name; int audio_system; char *audio_device; int send_speed; int frequency; int volume; int gap; int weighting; int practice_time; char *input_file; char *output_file; int is_cw; int has_practice_time; int has_outfile; bool has_infile; /* * Program-specific state variables, settable from the command line, or from * embedded input stream commands. These options may be set by the embedded * command parser to values other than strictly TRUE or FALSE; all non-zero * values are equivalent to TRUE. * * These fields are used only in cw. */ int do_echo; /* Echo characters */ int do_errors; /* Print error messages to stderr */ int do_commands; /* Execute embedded commands */ int do_combinations; /* Execute [...] combinations */ int do_comments; /* Allow {...} as comments */ } cw_config_t; extern void cw_print_help(cw_config_t *config); extern cw_config_t *cw_config_new(const char *program_name); extern void cw_config_delete(cw_config_t **config); extern int cw_config_is_valid(cw_config_t *config); extern int cw_generator_new_from_config(cw_config_t *config); extern void cw_start_beep(void); extern void cw_end_beep(void); extern bool cw_getline(FILE *stream, char *buffer, int buffer_size); #if defined(__cplusplus) } #endif #endif /* H_CW_COMMON */ unixcw-3.4.2/src/cwutils/cw_common.c0000644000175000017500000002632612451006056017275 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ /** \file cw_common.c Code that is common for all _applications_ from unixcw package. Wrappers for some libcw functions, that probably don't belong to libcw.c. */ #define _BSD_SOURCE /* strdup() */ #include "config.h" #include /* fprintf(stderr, ...) */ #include /* malloc() / free() */ #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "cw_common.h" static int cw_generator_apply_config(cw_config_t *config); /** Create new configuration with default values Function returns pointer to config variable, with fields of config initialized to valid default values. \param program_name - human-readable name of application calling the function \return pointer to config on success \return NULL on failure */ cw_config_t *cw_config_new(const char *program_name) { cw_config_t *config = (cw_config_t *) malloc(sizeof (cw_config_t)); if (!config) { fprintf(stderr, "%s: can't allocate memory for configuration\n", program_name); return NULL; } config->program_name = strdup(program_name); if (!(config->program_name)) { fprintf(stderr, "%s: can't allocate memory for program name\n", program_name); free(config); config = NULL; return NULL; } config->audio_system = CW_AUDIO_NONE; config->audio_device = NULL; config->send_speed = CW_SPEED_INITIAL; config->frequency = CW_FREQUENCY_INITIAL; config->volume = CW_VOLUME_INITIAL; config->gap = CW_GAP_INITIAL; config->weighting = CW_WEIGHTING_INITIAL; config->practice_time = CW_PRACTICE_TIME_INITIAL; config->input_file = NULL; config->output_file = NULL; config->is_cw = false; config->has_practice_time = false; config->has_outfile = false; config->has_infile = true; config->do_echo = true; config->do_errors = true; config->do_commands = true; config->do_combinations = true; config->do_comments = true; return config; } /** \brief Delete configuration variable Deallocate given configuration, assign NULL to \p config \param config - configuration variable to deallocate */ void cw_config_delete(cw_config_t **config) { if (*config) { if ((*config)->program_name) { free((*config)->program_name); (*config)->program_name = NULL; } if ((*config)->audio_device) { free((*config)->audio_device); (*config)->audio_device = NULL; } if ((*config)->input_file) { free((*config)->input_file); (*config)->input_file = NULL; } if ((*config)->output_file) { free((*config)->output_file); (*config)->output_file = NULL; } free(*config); *config = NULL; } return; } /** \brief Validate configuration Check consistency and correctness of configuration. Currently the function only checks if "audio device" command line argument has been specified at the same time when "soundcard" has been specified as audio system. This is an inconsistency as you can specify audio device only for specific audio system ("soundcard" is just a general audio system). \param config - configuration to validate \return true if configuration is valid \return false if configuration is invalid */ int cw_config_is_valid(cw_config_t *config) { /* Deal with odd argument combinations. */ if (config->audio_device) { if (config->audio_system == CW_AUDIO_SOUNDCARD) { fprintf(stderr, "libcw: a device has been specified for 'soundcard' sound system\n"); fprintf(stderr, "libcw: a device can be specified only for 'console', 'oss', 'alsa' or 'pulseaudio'\n"); return false; } else if (config->audio_system == CW_AUDIO_NULL) { fprintf(stderr, "libcw: a device has been specified for 'null' sound system\n"); fprintf(stderr, "libcw: a device can be specified only for 'console', 'oss', 'alsa' or 'pulseaudio'\n"); return false; } else { ; /* audio_system is one that accepts custom "audio device" */ } } else { ; /* no custom "audio device" specified, a default will be used */ } return true; } /** \brief Create new cw generator, apply given configuration Create new cw generator (using audio system from given \p config), and then apply rest of parameters from \p config to that generator. \p config should be first created with cw_config_new(). \param config - configuration to be applied to generator \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_generator_new_from_config(cw_config_t *config) { if (config->audio_system == CW_AUDIO_NULL) { if (cw_is_null_possible(config->audio_device)) { if (cw_generator_new(CW_AUDIO_NULL, config->audio_device)) { if (cw_generator_apply_config(config)) { return CW_SUCCESS; } else { fprintf(stderr, "%s: failed to apply configuration\n", config->program_name); return CW_FAILURE; } } else { fprintf(stderr, "%s: failed to open Null output\n", config->program_name); } } else { fprintf(stderr, "%s: Null output not available\n", config->program_name); } /* fall through to try with next audio system type */ } if (config->audio_system == CW_AUDIO_NONE || config->audio_system == CW_AUDIO_PA || config->audio_system == CW_AUDIO_SOUNDCARD) { if (cw_is_pa_possible(config->audio_device)) { if (cw_generator_new(CW_AUDIO_PA, config->audio_device)) { if (cw_generator_apply_config(config)) { return CW_SUCCESS; } else { fprintf(stderr, "%s: failed to apply configuration\n", config->program_name); return CW_FAILURE; } } else { fprintf(stderr, "%s: failed to open PulseAudio output\n", config->program_name); } } else { fprintf(stderr, "%s: PulseAudio output not available (device: %s)\n", config->program_name, config->audio_device ? config->audio_device : CW_DEFAULT_PA_DEVICE); } /* fall through to try with next audio system type */ } if (config->audio_system == CW_AUDIO_NONE || config->audio_system == CW_AUDIO_OSS || config->audio_system == CW_AUDIO_SOUNDCARD) { if (cw_is_oss_possible(config->audio_device)) { if (cw_generator_new(CW_AUDIO_OSS, config->audio_device)) { if (cw_generator_apply_config(config)) { return CW_SUCCESS; } else { fprintf(stderr, "%s: failed to apply configuration\n", config->program_name); return CW_FAILURE; } } else { fprintf(stderr, "%s: failed to open OSS output with device \"%s\"\n", config->program_name, cw_get_soundcard_device()); } } else { fprintf(stderr, "%s: OSS output not available (device: %s)\n", config->program_name, config->audio_device ? config->audio_device : CW_DEFAULT_OSS_DEVICE); } /* fall through to try with next audio system type */ } if (config->audio_system == CW_AUDIO_NONE || config->audio_system == CW_AUDIO_ALSA || config->audio_system == CW_AUDIO_SOUNDCARD) { if (cw_is_alsa_possible(config->audio_device)) { if (cw_generator_new(CW_AUDIO_ALSA, config->audio_device)) { if (cw_generator_apply_config(config)) { return CW_SUCCESS; } else { fprintf(stderr, "%s: failed to apply configuration\n", config->program_name); return CW_FAILURE; } } else { fprintf(stderr, "%s: failed to open ALSA output with device \"%s\"\n", config->program_name, cw_get_soundcard_device()); } } else { fprintf(stderr, "%s: ALSA output not available (device: %s)\n", config->program_name, config->audio_device ? config->audio_device : CW_DEFAULT_ALSA_DEVICE); } /* fall through to try with next audio system type */ } if (config->audio_system == CW_AUDIO_NONE || config->audio_system == CW_AUDIO_CONSOLE) { if (cw_is_console_possible(config->audio_device)) { if (cw_generator_new(CW_AUDIO_CONSOLE, config->audio_device)) { if (cw_generator_apply_config(config)) { return CW_SUCCESS; } else { fprintf(stderr, "%s: failed to apply configuration\n", config->program_name); return CW_FAILURE; } } else { fprintf(stderr, "%s: failed to open console output with device %s\n", config->program_name, cw_get_console_device() ? cw_get_console_device() : config->audio_device); } } else { fprintf(stderr, "%s: console output not available (device: %s)\n", config->program_name, config->audio_device ? config->audio_device : CW_DEFAULT_CONSOLE_DEVICE); } /* fall through to try with next audio system type */ } /* there is no next audio system type to try */ return CW_FAILURE; } /** \brief Apply given configuration to a generator Function applies frequency, volume, sending speed, gap and weighting to current generator. The generator should exist (it should be created by cw_generator_new(). The function is just a wrapper for few common function calls, to be used in cw_generator_new_from_config(). \param config - current configuration \return CW_SUCCESS on success \return CW_FAILURE on failure */ int cw_generator_apply_config(cw_config_t *config) { if (!cw_set_frequency(config->frequency)) { return CW_FAILURE; } if (!cw_set_volume(config->volume)) { return CW_FAILURE; } if (!cw_set_send_speed(config->send_speed)) { return CW_FAILURE; } if (!cw_set_gap(config->gap)) { return CW_FAILURE; } if (!cw_set_weighting(config->weighting)) { return CW_FAILURE; } return CW_SUCCESS; } /** \brief Generate a tone that indicates a start */ void cw_start_beep(void) { cw_flush_tone_queue(); cw_queue_tone(20000, 500); cw_queue_tone(20000, 1000); cw_wait_for_tone_queue(); return; } /** \brief Generate a tone that indicates an end */ void cw_end_beep(void) { cw_flush_tone_queue(); cw_queue_tone(20000, 500); cw_queue_tone(20000, 1000); cw_queue_tone(20000, 500); cw_queue_tone(20000, 1000); cw_wait_for_tone_queue(); return; } /** \brief Get line from FILE Line of text is returned through \p buffer that should be allocated by caller. Total buffer size (including space for ending NUL) is given by \p buffer_size. The function adds ending NULL. Function strips newline character from the line read from file. The newline character is not put into \p buffer. \return true on successful reading of line \return false otherwise */ bool cw_getline(FILE *stream, char *buffer, int buffer_size) { if (!feof(stream) && fgets(buffer, buffer_size, stream)) { size_t bytes = strlen(buffer); while (bytes > 0 && strchr("\r\n", buffer[bytes - 1])) { buffer[--bytes] = '\0'; } return true; } return false; } unixcw-3.4.2/src/cwutils/dictionary.h0000644000175000017500000000475112451006127017463 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef H_CW_DICTIONARY #define H_CW_DICTIONARY #if defined(__cplusplus) extern "C" { #endif #include typedef struct cw_dictionary_s cw_dictionary_t; extern bool cw_dictionaries_read(const char *file); extern void cw_dictionaries_unload(void); extern bool cw_dictionaries_write(const char *file); extern const cw_dictionary_t *cw_dictionaries_iterate(const cw_dictionary_t *dict); extern const char *cw_dictionary_get_description(const cw_dictionary_t *dict); extern int cw_dictionary_get_group_size(const cw_dictionary_t *dict); extern const char *cw_dictionary_get_random_word(const cw_dictionary_t *dict); /* Everything below is deprecated. */ typedef struct cw_dictionary_s dictionary; extern int dictionary_load(const char *file) __attribute__ ((deprecated)); /* Use cw_dictionaries_read() */ extern void dictionary_unload(void) __attribute__ ((deprecated)); /* Use cw_dictionaries_unload() */ extern int dictionary_write(const char *file) __attribute__ ((deprecated)); /* Use cw_dictionaries_write() */ extern const dictionary *dictionary_iterate(const dictionary *dict) __attribute__ ((deprecated)); /* Use cw_dictionary_iterate() */ extern const char *get_dictionary_description(const dictionary *dict) __attribute__ ((deprecated)); /* Use cw_dictionary_get_description() */ extern int get_dictionary_group_size(const dictionary *dict) __attribute__ ((deprecated)); /* Use cw_dictionary_get_group_size() */ extern const char *get_dictionary_random_word(const dictionary *dict) __attribute__ ((deprecated)); /* Use cw_dictionary_get_random_word() */ #if defined(__cplusplus) } #endif #endif /* H_CW_DICTIONARY */ unixcw-3.4.2/src/cwutils/memory.h0000644000175000017500000000217512451006104016617 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef _CWMEMORY_H #define _CWMEMORY_H #if defined(__cplusplus) extern "C" { #endif #include /* size_t */ void *safe_malloc (size_t size); void *safe_realloc (void *ptr, size_t size); char *safe_strdup (const char *s); #if defined(__cplusplus) } #endif #endif /* _CWMEMORY_H */ unixcw-3.4.2/src/cwutils/Makefile.am0000644000175000017500000000504512451006023017171 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # -include $(top_builddir)/Makefile.inc # targets to be built in this directory check_PROGRAMS=cw_dictionary_tests # source code files used to build cw_dictionary_tests program cw_dictionary_tests_SOURCES = dictionary.c memory.c i18n.c cw_common.c # target-specific preprocessor flags (#defs and include dirs) cw_dictionary_tests_CPPFLAGS = $(AM_CPPFLAGS) -DCW_DICTIONARY_UNIT_TESTS # target-specific linker flags (objects to link) cw_dictionary_tests_LDADD=-L$(top_builddir)/src/libcw/.libs -lcw #-lm -lpthread -ldl # target-specific compiler flags cw_dictionary_tests_CFLAGS = -rdynamic # no header from this dir should be installed # noinst_HEADERS = cmdline.h cw_copyright.h cw_common.h cw_words.h dictionary.h i18n.h memory.h # convenience libraries noinst_LIBRARIES = lib_cw.a lib_cwcp.a lib_cwgen.a lib_xcwcp.a lib_cw_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h lib_cwcp_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h dictionary.c dictionary.h cw_words.h lib_cwgen_a_SOURCES = cw_copyright.h i18n.c i18n.h cmdline.c cmdline.h memory.c memory.h lib_xcwcp_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h dictionary.c dictionary.h cw_words.h # Test targets; no self-test, but make sure all is built. #check: all # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = greptest.sh TESTS = $(check_SCRIPTS) # run test programs (only libcwunittests unit tests suite) check_SCRIPTS = greptest.sh greptest.sh: echo './cw_dictionary_tests | grep "test result: success"' > greptest.sh chmod +x greptest.sh unixcw-3.4.2/src/cwutils/cw_copyright.h0000644000175000017500000000274012451006051020007 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef H_CW_COPYRIGHT #define H_CW_COPYRIGHT #include "i18n.h" #if defined(__cplusplus) extern "C" { #endif static const char *const CW_COPYRIGHT = N_("Copyright (C) 2001-2006 Simon Baldwin\n" "Copyright (C) 2011-2015 Kamil Ignacak\n\n" "This program comes with ABSOLUTELY NO WARRANTY; for details please see\n" "the file 'COPYING' supplied with the source code. This is free software,\n" "and you are welcome to redistribute it under certain conditions; again,\n" "see 'COPYING' for details. This program is released under the GNU General\n" "Public License.\n"); #if defined(__cplusplus) } #endif #endif /* H_CW_COPYRIGHT */ unixcw-3.4.2/src/cwutils/i18n.h0000644000175000017500000000242612451006117016071 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef _CWI18N_H #define _CWI18N_H #if defined(HAVE_LIBINTL_H) # include # define _(STR) i18n_gettext (STR) # define gettext_noop(STR) (STR) # define N_(STR) gettext_noop (STR) #else # define _(STR) (STR) # define N_(STR) (STR) #endif #if defined(__cplusplus) extern "C" { #endif extern void i18n_initialize (void); extern const char *i18n_gettext (const char *msgid); #if defined(__cplusplus) } #endif #endif /* _CWI18N_H */ unixcw-3.4.2/src/cwutils/cw_words.h0000644000175000017500000006224312451006134017143 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef H_CW_WORDS #define H_CW_WORDS #include /* NULL */ /* * Bulk string data for generating characters to send. These string entries * are used as initializers for the default dictionary set. */ static const char *const CW_ALPHABETIC[] = { "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S", "T","U","V","W","X","Y","Z",NULL}; static const char *const CW_NUMERIC[] = { "0","1","2","3","4","5","6","7","8","9",NULL}; static const char *const CW_ALPHANUMERIC[] = { "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S", "T","U","V", "W","X","Y","Z","0","1","2","3","4","5","6","7","8","9",NULL}; static const char *const CW_ALL_CHARACTERS[] = { "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S", "T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9", "=","-",",","?",".",";",")","/","\"","'","$","(","+",":","_",NULL}; static const char *const CW_EISH5[] = {"E","I","S","H","5",NULL}; static const char *const CW_TMO0[] = {"T","M","O","0",NULL}; static const char *const CW_AUV4[] = {"A","U","V","4",NULL}; static const char *const CW_NDB6[] = {"N","D","B","6",NULL}; static const char *const CW_KXffRP[] = {"K","X","=","-","R","P",NULL}; static const char *const CW_FLYQC[] = {"F","L","Y","Q","C",NULL}; static const char *const CW_WJ1GZ[] = {"W","J","1","G","Z",NULL}; static const char *const CW_23789[] = {"2","3","7","8","9",NULL}; static const char *const CW_FIGURES_1[] = {",","?",".",";",")","/",NULL}; static const char *const CW_FIGURES_2[] = {"\"","'","$","(","+",":","_",NULL}; static const char *const CW_SHORT_WORDS[] = { "ACT","ADD","AGE","AGO","AID","AIM","AIR","ALL","AND","ANY","APE","ARC", "ARE","ARK","ARM","ART","ASH","ASK","ATE","AWE","BAD","BAG","BAR","BAT", "BAY","BED","BEE","BEG","BET","BID","BIG","BIN","BIT","BOB","BOO","BOW", "BOX","BOY","BUD","BUN","BUS","BUT","BUY","BYE","CAB","CAN","CAR","CAT", "CON","COP","COW","CRY","CUP","CUT","DAN","DAY","DEW","DID","DIE","DIG", "DIM","DIN","DIP","DOG","DON","DOT","DRY","DUE","DUG","EAR","EAT","EBB", "EGG","EGO","END","ERA","ERE","ERR","EYE","FAN","FAR","FAT","FED","FEE", "FEN","FEW","FIN","FIT","FIX","FLY","FOG","FOR","FOX","FRY","FUN","FUR", "GAG","GAP","GAS","GET","GIG","GIN","GOD","GOT","GUM","GUN","GUT","GUY", "HAD","HAM","HAN","HAP","HAS","HAT","HAY","HER","HEY","HID","HIM","HIP", "HIS","HIT","HOP","HOT","HOW","HUB","HUG","HUH","HUM","HUT","ICE","ICY", "ILL","ION","ITS","JAR","JAW","JAY","JET","JIG","JIM","JOB","JOT","JOY", "JUG","KEY","KID","KIT","LAB","LAD","LAG","LAP","LAW","LAY","LED","LEG", "LET","LID","LIE","LIP","LIT","LOS","LOT","LOU","LOW","MAD","MAN","MAP", "MAX","MAY","MEG","MEN","MET","MID","MIX","MOB","MUD","MUG","NAG","NAP", "NED","NET","NEW","NIL","NIP","NOD","NON","NOR","NOT","NOW","NUT","ODD", "ODE","OFF","OIL","OLD","ONE","OUR","OUT","OWE","OWN","PAD","PAL","PAN", "PAT","PAY","PEN","PER","PET","PIG","PIN","PIT","POP","POT","PUB","PUN", "PUT","RAG","RAM","RAN","RAP","RAT","RAY","RED","RIB","RID","RIG","RIM", "RIP","ROB","ROD","RON","ROT","ROW","RUB","RUM","RUN","SAD","SAN","SAT", "SAW","SAY","SEA","SEE","SET","SHE","SHY","SIP","SIR","SIT","SIX","SKY", "SOB","SOD","SOL","SON","SUB","SUE","SUM","SUN","TAB","TAN","TAP","TAR", "TAU","TAX","TEA","TED","TEN","TEX","THE","TIE","TIN","TIP","TOE","TON", "TOO","TOP","TOY","TRY","TUG","TWO","UGH","URN","USE","VAN","VAT","VIA", "VIE","WAG","WAN","WAR","WAS","WAY","WEB","WET","WHO","WHY","WIN","WIT", "WON","WOO","YES","YET","YOU","ZOO", "ABLE","ACHE","ACID","ACTS","AGED","AGES","AIRY","AJAR","AKIN","ALEC", "ALLY","ALSO","AMEN","ANDY","ANTI","ANTS","ARCH","ARCS","AREA","ARID", "ARMS","ARMY","ARTS","ASKS","ATOM","AUNT","AVID","AWAY","AWED","AXEL", "AXES","AXIS","BABY","BACK","BAGS","BAIL","BAIT","BALL","BAND","BANG", "BANK","BARK","BARS","BASE","BASK","BASS","BATH","BATS","BAYS","BEAD", "BEAK","BEAM","BEAN","BEAR","BEAT","BEDS","BEEN","BEEP","BEER","BEES", "BELL","BELT","BEND","BENT","BEST","BETA","BIDS","BIKE","BILL","BINS", "BIRD","BITE","BITS","BLEW","BLIP","BLOB","BLOT","BLOW","BLUE","BLUR", "BOAT","BOBS","BODY","BOER","BOIL","BOLD","BOLT","BOMB","BONE","BONY", "BOOK","BOOM","BOOT","BORE","BORN","BOSS","BOTH","BOUT","BOWL","BOYS", "BRIM","BROW","BUCK","BUDS","BULK","BULL","BUMP","BUMS","BUNK","BURN", "BURY","BUSH","BUST","BUSY","BUYS","BUZZ","CAFE","CAGE","CAKE","CALL", "CALM","CAME","CANS","CANT","CAPE","CARD","CARE","CARS","CART","CASE", "CASH","CAST","CATS","CAVE","CENT","CHAP","CHAT","CHEF","CHEW","CHIN", "CHIP","CITY","CLAD","CLAP","CLIP","CLOT","CLUB","CLUE","COAT","COAX", "CODE","COGS","COIN","COKE","COLD","COME","COOK","COOL","COPE","COPS", "COPY","CORE","CORN","COST","COWS","CRAB","CREW","CUPS","CURE","CURL", "CUTE","DAMP","DARE","DARK","DARN","DART","DASH","DATA","DATE","DAWN", "DAYS","DAZE","DEAD","DEAL","DEAR","DEBT","DECK","DEEP","DEER","DENT", "DENY","DESK","DEWY","DIAL","DICE","DIED","DIES","DIET","DINE","DINT", "DIRE","DIRT","DISC","DISH","DISK","DIVE","DOCK","DOES","DOGS","DOLE", "DOLL","DOME","DONE","DOOM","DOOR","DOSE","DOTS","DOWN","DRAG","DRAW", "DREW","DRIP","DROP","DRUG","DRUM","DUCK","DUET","DULL","DULY","DUMB", "DUMP","DUNG","DUSK","DUST","DUTY","DYED","EACH","EARS","EASE","EAST", "EASY","ECHO","EDDY","EDEN","EDGE","EDIT","EELS","EGGS","ELMS","ELSE", "EMIT","ENDS","ENID","ENVY","EPIC","ERAS","ERIC","EVEN","EVER","EVIL", "EXIT","EYED","EYES","FACE","FACT","FADE","FAIL","FAIR","FAKE","FALL", "FAME","FARE","FARM","FAST","FATE","FEAR","FEAT","FEED","FEEL","FEET", "FELL","FELT","FEND","FERN","FIAT","FILE","FILL","FILM","FIND","FINE", "FINS","FIRE","FIRM","FISH","FIST","FITS","FIVE","FLAG","FLAP","FLAT", "FLAW","FLEA","FLED","FLEE","FLEW","FLEX","FLIP","FLIT","FLOP","FLOW", "FOAM","FOIL","FOLD","FOND","FOOD","FOOL","FOOT","FORD","FORK","FORM", "FOUL","FOUR","FRAY","FREE","FRET","FROG","FROM","FULL","FURS","FURY", "FUSS","GAIL","GAIN","GAIT","GAME","GARY","GASH","GASP","GATE","GAVE", "GAZE","GEAR","GENE","GETS","GIFT","GIRD","GIRL","GIST","GIVE","GLAD", "GLEN","GLOW","GNAT","GNAW","GOAL","GOAT","GODS","GOES","GOLD","GOLF", "GONE","GONG","GOOD","GOWN","GRAB","GREW","GREY","GRIM","GRIN","GRIP", "GRIT","GROW","GULF","GUNS","GUYS","HACK","HAIR","HALE","HALF","HALL", "HALT","HAND","HANG","HARD","HARM","HATE","HATS","HAUL","HAVE","HAWK", "HAZE","HAZY","HEAD","HEAP","HEAR","HEAT","HECK","HEEL","HELD","HELL", "HELP","HERD","HERE","HERO","HERS","HIDE","HIGH","HILL","HIND","HINT", "HIPS","HIRE","HISS","HOLD","HOLE","HOLY","HOME","HOOK","HOOP","HOOT", "HOPE","HORN","HOSE","HOST","HOUR","HOWL","HUGE","HULL","HUMS","HUNG", "HUNK","HUNT","HURL","HURT","HUSH","HUSK","HUTS","HYDE","HYMN","ICED", "IDEA","IDLE","IDLY","INCH","INTO","IRON","ITEM","JAIL","JANE","JAWS", "JAZZ","JETS","JOBS","JOIN","JOKE","JOLT","JOYS","JUMP","JUNK","JURY", "JUST","KARL","KEEL","KEEN","KEEP","KENT","KEPT","KEYS","KICK","KIDS", "KILL","KIND","KING","KISS","KNEE","KNEW","KNOB","KNOT","KNOW","LABS", "LACK","LADS","LADY","LAID","LAIN","LAKE","LAME","LAMP","LAND","LANE", "LARK","LAST","LATE","LAVA","LAWN","LAWS","LAYS","LAZY","LEAD","LEAF", "LEAK","LEAN","LEAP","LEFT","LEGS","LEND","LESS","LETS","LEWD","LICK", "LIED","LIES","LIFE","LIFT","LIKE","LIMB","LIMP","LINE","LINK","LIPS", "LISA","LIST","LIVE","LOAD","LOAF","LOAN","LOCK","LOGO","LONE","LONG", "LOOK","LOOM","LOOP","LORD","LOSE","LOSS","LOST","LOTS","LOUD","LOVE", "LUCK","LUMP","LURE","LURK","LUSH","LYNX","MADE","MAIL","MAIN","MAKE", "MANE","MANS","MANY","MAPS","MARK","MARS","MASH","MASS","MATE","MAZE", "MEAL","MEAN","MEAT","MEET","MELT","MEND","MENS","MENU","MERE","MESS", "MICE","MIKE","MILD","MILE","MILK","MILL","MIND","MINE","MINI","MINT", "MIRE","MISS","MIST","MOCK","MODE","MOOD","MOON","MORE","MOSS","MOST", "MOTH","MOVE","MUCH","MUCK","MUST","MUTE","MYTH","NAIL","NAME","NEAR", "NEAT","NECK","NEED","NEON","NEST","NEWS","NEWT","NEXT","NICE","NINE", "NOEL","NONE","NOON","NOSE","NOTE","NUMB","NUTS","OATH","ODDS","OILY", "ONCE","ONES","ONLY","ONTO","OPEN","OUCH","OURS","OVEN","OVER","OWED", "OWLS","OWNS","PACE","PACK","PADS","PAGE","PAID","PAIN","PAIR","PALE", "PALL","PALM","PANG","PARK","PART","PASS","PAST","PATH","PAUL","PEAK", "PEAR","PEAT","PEEL","PEEP","PEER","PEGS","PENT","PHIL","PICK","PIES", "PIGS","PILE","PINE","PING","PINK","PINS","PINT","PISA","PITS","PITY", "PLAN","PLAY","PLOD","PLOT","PLOY","PLUG","PLUS","PODS","POEM","POET", "POKE","POLE","POLO","POND","PONY","POOL","POOR","PORK","PORT","POSE", "POST","POUR","PRAY","PREY","PRIM","PROD","PROP","PROW","PUBS","PUFF", "PULL","PULP","PUMP","PURE","PURR","PUSH","PUTS","QUIZ","RACE","RAFT", "RAGE","RAID","RAIL","RAIN","RAMP","RANG","RANK","RAPT","RARE","RASP", "RATE","RATS","RAVE","RAYS","READ","REAL","REAR","REEL","RELY","REND", "RENT","REST","RIBS","RICE","RICH","RICK","RIDE","RIFT","RING","RISE", "RISK","ROAD","ROAM","ROAR","ROBE","ROCK","RODE","RODS","ROLE","ROLL", "ROME","ROOF","ROOM","ROOT","ROPE","ROSE","RUDE","RUIN","RULE","RUNG", "RUNS","RUSH","RUST","SACK","SAFE","SAGA","SAGE","SAID","SAIL","SAKE", "SALE","SALT","SAME","SAND","SANE","SANG","SANK","SASH","SAVE","SAWS", "SAYS","SCAN","SEAL","SEAS","SEAT","SEED","SEEK","SEEM","SEEN","SEER", "SEES","SELF","SELL","SEMI","SEND","SENT","SETS","SHED","SHIP","SHOD", "SHOE","SHOP","SHOT","SHOW","SHUT","SICK","SIDE","SIGH","SIGN","SILK", "SILO","SING","SINK","SINS","SITE","SITS","SITU","SIZE","SKID","SKIN", "SKIP","SKIS","SLAP","SLAY","SLEW","SLID","SLIM","SLIP","SLOT","SLOW", "SLUG","SLUM","SMUG","SNAP","SNOW","SNUG","SOAP","SODA","SOFA","SOFT", "SOIL","SOLD","SOLE","SOLO","SOME","SONG","SONY","SOON","SORE","SORT", "SOUL","SOUP","SOUR","SPAN","SPAT","SPED","SPIN","SPIT","SPOT","SPUN", "SPUR","STAB","STAR","STAY","STEP","STIR","STOP","STUB","STUN","SUCH", "SUED","SUIT","SULK","SUMS","SUNK","SUNS","SURE","SURF","SWAB","SWAM", "SWAY","SWIM","TACT","TAIL","TAKE","TALK","TALL","TANK","TAPE","TAPS", "TASK","TAXI","TEAM","TEAR","TELL","TEND","TENS","TENT","TERM","TEST", "TEXT","THAN","THAT","THEM","THEN","THEY","THIN","THIS","THOR","THUD", "THUS","TICK","TIDE","TIED","TIES","TILE","TILL","TILT","TIME","TINY", "TIPS","TIRE","TOES","TOLD","TOLL","TOMB","TONE","TONS","TOOK","TOOL", "TOPS","TORE","TORN","TOTO","TOUR","TOWN","TRAP","TRAY","TREE","TREK", "TRIM","TRIP","TROD","TROT","TRUE","TUBE","TUFT","TUNE","TURF","TURN", "TWIG","TWIN","TWOS","TYPE","UGLY","UNIT","UNIX","UNTO","UPON","URGE", "URSA","USED","VAIN","VARY","VAST","VEIL","VERY","VIEW","VILE","VOID", "VOTE","VOWS","WAFT","WAGE","WAIL","WAIT","WAKE","WALK","WALL","WANT", "WARD","WARM","WARN","WARP","WARS","WART","WARY","WASH","WAVE","WAYS", "WEAK","WEAR","WEBS","WEEK","WEEP","WELL","WENT","WERE","WEST","WHAT", "WHEN","WHIM","WHIP","WHOM","WICK","WIDE","WIFE","WIGS","WILD","WILL", "WILT","WIND","WINE","WING","WINK","WINS","WIPE","WIRE","WIRY","WISE", "WISH","WISP","WITH","WOKE","WOLF","WONT","WOOD","WOOF","WORD","WORE", "WORK","WORM","WORN","WRAP","YANK","YAWN","YEAR","YELL","YELP","YORK", "YOUR","ZERO","ZEST","ZONE","ZOOM", "ABACK","ABOUT","ABOVE","ABUSE","ACHED","ACHES","ACORN","ACRID","ACTOR", "ACUTE","ADDED","ADMIT","ADOPT","AFOOT","AFTER","AGAIN","AGENT","AGONY", "AGREE","AHEAD","AIMED","AISLE","ALARM","ALBUM","ALERT","ALGOL","ALIEN", "ALIVE","ALLEN","ALLEY","ALLOW","ALOFT","ALONE","ALONG","ALOUD","ALPHA", "ALTAR","ALTER","AMISS","AMONG","AMPLY","ANGEL","ANGER","ANGLE","ANGRY", "ANGST","ANKLE","ANNOY","ANTIC","APART","APPLE","APPLY","APRIL","APRON", "AREAS","ARGUE","ARISE","ARMED","AROSE","ARRAY","ARROW","ASHEN","ASHES", "ASIDE","ASKED","ATLAS","ATOLL","ATOMS","ATONE","AURAL","AVIAN","AVOID", "AWAKE","AWARD","AWARE","AWFUL","AWOKE","BABEL","BACKS","BACON","BADLY", "BAGGY","BAKED","BAKER","BALLS","BALMY","BANDS","BANGS","BANKS","BARED", "BARRY","BASED","BASIC","BASIS","BATHS","BEACH","BEADS","BEADY","BEAMS", "BEARD","BEAST","BEERS","BEGAN","BEGIN","BEGUN","BEING","BELLS","BELOW", "BELTS","BENCH","BERTH","BETEL","BILLS","BINGO","BIRDS","BIRTH","BLACK", "BLADE","BLAME","BLANK","BLAST","BLAZE","BLEAK","BLEND","BLESS","BLIND", "BLINK","BLITZ","BLOBS","BLOCK","BLOKE","BLOND","BLOOM","BLOWN","BLUER", "BLUNT","BLURS","BOARD","BOATS","BOBBY","BOLTS","BONES","BOOKS","BOOTH", "BOOTS","BOOZE","BORED","BORNE","BOUND","BOUTS","BOWED","BOWLS","BOXES", "BRAIN","BRAKE","BRAND","BRASH","BRASS","BRAUN","BRAVE","BREAD","BREAK", "BRICK","BRIEF","BRING","BRINK","BRISK","BROAD","BROCK","BROKE","BROWN", "BROWS","BRUSH","BUDGE","BUGGY","BUILD","BUILT","BULKY","BUNCH","BURLY", "BURNS","BURNT","BURST","BUSES","CABIN","CACTI","CAFES","CAKES","CALLS", "CAPES","CARDS","CARED","CARES","CARGO","CAROL","CARRY","CARTS","CARVE", "CASES","CATCH","CATER","CAUSE","CAVED","CAVES","CEASE","CELLS","CHAIN", "CHAIR","CHANT","CHAOS","CHAPS","CHARM","CHART","CHASE","CHASM","CHEAP", "CHECK","CHEEK","CHEER","CHEFS","CHESS","CHIEF","CHILD","CHILL","CHIME", "CHINA","CHINK","CHINS","CHOIR","CHOKE","CHOSE","CHUCK","CHURN","CHUTE", "CIGAR","CIVIL","CLAIM","CLARE","CLASS","CLAWS","CLEAN","CLEAR","CLERK", "CLICK","CLIFF","CLIMB","CLING","CLOAK","CLOCK","CLOGS","CLONE","CLOSE", "CLOTH","CLOUD","CLUBS","CLUES","CLUMP","CLUNG","COACH","COAST","COATS", "COBOL","CODES","COINS","COMBS","COMES","COMET","COMMA","COOKS","CORKS", "CORPS","COSTS","COUCH","COUGH","COULD","COUNT","COURT","COVER","CRAFT", "CRAGS","CRASH","CRAVE","CRAWL","CRAZY","CREAK","CREAM","CREEP","CREPT", "CREST","CREWS","CRIED","CRIES","CRIME","CROOK","CROPS","CROSS","CROWD", "CROWN","CRUDE","CRUEL","CRUMB","CRUST","CRYPT","CUBES","CUBIC","CURES", "CURSE","CURVE","CYCLE","DADDY","DAILY","DAIRY","DANCE","DARED","DARTS", "DATED","DAVID","DAWNS","DAZED","DEALS","DEALT","DEATH","DECAY","DEEDS", "DELAY","DELTA","DENSE","DENTS","DEPTH","DESKS","DETER","DEVIL","DEVON", "DIALS","DIARY","DIMLY","DINER","DIODE","DIRGE","DIRTY","DIVED","DIZZY", "DODGE","DOING","DOMED","DONOR","DOORS","DOUBT","DOWNS","DOZED","DOZEN", "DRAMA","DRANK","DRAWL","DRAWN","DREAM","DRESS","DRIED","DRIER","DRIFT", "DRILL","DRINK","DRIVE","DRONE","DROPS","DROVE","DRUGS","DRUMS","DRUNK", "DUCKS","DULLY","DUSTY","DWELL","DYING","EAGER","EAGLE","EARLY","EARTH", "EASED","EASES","EATEN","EATER","EBONY","EDDIE","EDGED","EDGES","EDITS", "EERIE","EIGHT","EJECT","ELBOW","ELDER","ELVIS","EMILY","EMPTY","ENDED", "ENJOY","ENTER","ENTRY","EQUAL","ERROR","ESSAY","ETHEL","ETHER","ETHIC", "EVENT","EVERY","EXACT","EXERT","EXILE","EXIST","EXTRA","FACED","FACES", "FACTO","FACTS","FADED","FADES","FAINT","FAITH","FAKED","FALLS","FALSE", "FAMED","FANCY","FANGS","FARED","FARMS","FATES","FAULT","FEAST","FEEDS", "FEELS","FENCE","FERNS","FETCH","FETID","FEVER","FEWER","FIELD","FIERY", "FIFTH","FIFTY","FIGHT","FILED","FILES","FILMS","FINAL","FINDS","FINER", "FIRED","FIRES","FIRST","FISTS","FIXED","FLAGS","FLAME","FLARE","FLASH", "FLASK","FLATS","FLAWS","FLEET","FLESH","FLICK","FLIES","FLING","FLINT", "FLIPS","FLOAT","FLOCK","FLOOD","FLOOR","FLOWN","FLOWS","FLUFF","FLUID", "FLUNG","FLYER","FOAMY","FOCUS","FOLDS","FOLKS","FOLLY","FOODS","FOOLS", "FORCE","FORDS","FORGE","FORMS","FORTH","FORTY","FOUND","FRAME","FRANK", "FRAUD","FREAK","FREED","FRESH","FRIED","FRIES","FROGS","FRONT","FROST", "FROTH","FROWN","FROZE","FRUIT","FUDGE","FUGUE","FULLY","FUMED","FUMES", "FUNNY","FURRY","GAILY","GAMES","GAMMA","GAPED","GASES","GASPS","GAUGE", "GAUNT","GAZED","GEARS","GEESE","GENES","GENUS","GERMS","GHOST","GIANT", "GIDDY","GIFTS","GIRLS","GIVEN","GIVES","GLADE","GLAND","GLARE","GLASS", "GLEAM","GLINT","GLOBE","GLOOM","GLORY","GLOSS","GOALS","GOATS","GOING", "GOLDS","GONER","GOOSE","GRACE","GRAFT","GRAIN","GRAND","GRANT","GRAPH", "GRASP","GRASS","GRATE","GRAVE","GRAVY","GREAT","GREEK","GREEN","GREET", "GRIEF","GRILL","GRIME","GRINS","GRIPS","GROAN","GROOM","GROUP","GROWL", "GROWN","GROWS","GRUNT","GUARD","GUESS","GUEST","GUIDE","GUILT","GUISE", "GULLY","GUSTS","GYPSY","HABIT","HADES","HALLS","HANDS","HANDY","HAPPY", "HARMS","HARSH","HATCH","HATED","HATES","HAVEN","HAVOC","HEADS","HEARD", "HEART","HEAVE","HEAVY","HEDGE","HEELS","HEFTY","HEIRS","HELLO","HENCE", "HERDS","HERES","HIKED","HIKER","HILLS","HITCH","HOBBY","HOLDS","HOLES", "HOMED","HOMES","HONDO","HONED","HONEY","HOOPS","HOPED","HOPES","HORNS", "HORSE","HOSTS","HOTEL","HOTLY","HOURS","HOUSE","HOVEL","HOVER","HUMAN", "HUMID","HUNCH","HUNTS","HURRY","HURTS","HUSKY","HYENA","IDEAL","IDEAS", "IDIOT","IGLOO","IMAGE","INANE","INDEX","INDIA","INEPT","INERT","INFRA", "INNER","INPUT","IRATE","IRONY","ISSUE","ITALY","ITEMS","JAMES","JEANS", "JOKES","JOLLY","JUDGE","JUICE","JUMPS","JUMPY","JUNKY","KAPPA","KEEPS", "KEVIN","KICKS","KILLS","KINDS","KINGS","KNACK","KNEEL","KNEES","KNELT", "KNIFE","KNOBS","KNOCK","KNOTS","KNOWN","KNOWS","LACES","LACEY","LADEN", "LANDS","LARGE","LASER","LASTS","LATER","LAUGH","LAYER","LEADS","LEAFY", "LEAKY","LEAPS","LEAPT","LEARN","LEAST","LEAVE","LEDGE","LEGAL","LEMON", "LEVEL","LEVER","LICKS","LIFTS","LIGHT","LIKED","LIKES","LILAC","LIMBS", "LIMIT","LINED","LINEN","LINER","LINES","LINKS","LIONS","LIVED","LIVER", "LIVES","LIVID","LLOYD","LOBBY","LOCAL","LOCKS","LODGE","LOGIC","LOOKS", "LOOPS","LOOSE","LORDS","LORRY","LOSER","LOUSY","LOVED","LOVES","LOWER", "LUCKY","LUMPS","LUMPY","LUNCH","LUNGS","LURCH","LYING","MADAM","MAGIC", "MAGNA","MAJOR","MAKER","MAKES","MANIC","MARCH","MARKS","MARRY","MARSH", "MATCH","MAYBE","MAZES","MEALS","MEANS","MEANT","MEATY","MEDIA","MEETS", "MELON","MEMOS","MENUS","MERRY","MESON","MESSY","METAL","MICRO","MIGHT", "MILES","MINCE","MINDS","MINES","MINOR","MINUS","MISTS","MISTY","MIXED", "MODEL","MOIST","MONEY","MONKS","MONTH","MOODS","MOONS","MOPED","MORAL", "MOSES","MOTEL","MOTOR","MOTTO","MOUSE","MOUTH","MOVED","MOVER","MOVES", "MOVIE","MOWER","MUDDY","MULTI","MURAL","MURKY","MUSED","MUSIC","MUSTY", "MUTED","NAIVE","NAKED","NAMED","NAMES","NANCY","NASTY","NAVEL","NEEDS", "NERVE","NEVER","NEWLY","NICER","NIFTY","NIGHT","NOBLE","NOISE","NOISY", "NORTH","NOTES","NYLON","OBEYS","OCCUR","OCEAN","ODDLY","OFFER","OFTEN", "OILED","OLDER","OLIVE","OMITS","OOZED","OPENS","OPERA","OPTED","OPTIC", "ORBIT","ORDER","ORGAN","ORION","OTHER","OTTER","OUGHT","OUTER","OWNED", "OWNER","OZONE","PACED","PACES","PACKS","PADDY","PAGES","PAINS","PAINT", "PAIRS","PALMS","PANEL","PANIC","PAPER","PARKS","PARTS","PARTY","PATCH", "PATHS","PAULA","PAUSE","PAVED","PEACE","PEAKS","PEARS","PEDAL","PENCE", "PENNY","PERCH","PERIL","PERKY","PETER","PETTY","PHASE","PHONE","PHOTO", "PIECE","PIGGY","PILED","PILES","PILLS","PILOT","PINTS","PIOUS","PIPED", "PIPER","PIPES","PITCH","PIZZA","PLACE","PLAIN","PLANE","PLANK","PLANS", "PLANT","PLATE","PLAYS","PLAZA","PLEAD","PLIED","PLUCK","PLUSH","PLUTO", "POEMS","POETS","POINT","POKED","POLES","POOLS","PORED","PORTS","POSSE", "POUCH","POUND","POWER","PRESS","PRICE","PRIDE","PRIME","PRINT","PRIOR", "PRISM","PRIZE","PROBE","PRONE","PRONG","PROOF","PROUD","PROVE","PROWL", "PULSE","PUMPS","PUNCH","PUPPY","PUTTY","QUARK","QUEST","QUEUE","QUICK", "QUIET","QUILL","QUITE","QUOTE","RACED","RACES","RACKS","RADIO","RAGED", "RAGES","RAINS","RAISE","RAKED","RANGE","RANKS","RAPID","RAVED","REACH", "REACT","READY","REDLY","REEDS","REFER","RELAX","RENEW","RENTS","REPLY", "RESET","RIDES","RIDGE","RIGHT","RIGID","RINGS","RIOTS","RISEN","RISES", "RISKS","RIVAL","RIVER","ROADS","ROAST","ROBED","ROBES","ROBOT","ROCKS", "ROCKY","ROLLS","ROOMS","ROOTS","ROSES","ROUGH","ROUND","ROUTE","ROYAL", "RUINS","RULED","RULER","RULES","RUSTS","RUSTY","SADLY","SAFER","SAGES", "SAINT","SALAD","SALES","SALLY","SANDS","SANDY","SANER","SANTA","SAUCE", "SAVED","SAVES","SAWED","SCALE","SCALP","SCALY","SCARE","SCARF","SCARS", "SCARY","SCENE","SCENT","SCOOP","SCOPE","SCORE","SCOUT","SCOWL","SCREW", "SCRUB","SEALS","SEAMS","SEATS","SEEDS","SEEDY","SEEMS","SEERS","SEIZE", "SELLS","SENDS","SENSE","SERVE","SETUP","SEVEN","SHACK","SHADE","SHADY", "SHAKE","SHAKY","SHALL","SHAME","SHAPE","SHARD","SHARE","SHARK","SHARP", "SHEAF","SHEEN","SHEEP","SHEER","SHEET","SHELF","SHIED","SHIFT","SHINE", "SHINY","SHIPS","SHIRT","SHOAL","SHOCK","SHOES","SHONE","SHOOK","SHOOT", "SHOPS","SHORE","SHORT","SHOUT","SHOVE","SHOWN","SHOWS","SHRUG","SHUTS", "SIDES","SIEVE","SIGHT","SIGNS","SILKY","SILLY","SIMON","SINAI","SINCE", "SINKS","SIXTH","SIXTY","SIZED","SKIES","SKILL","SKINS","SKIPS","SKULL", "SLANG","SLASH","SLATE","SLEEK","SLEEP","SLEPT","SLICE","SLIDE","SLIME", "SLIMY","SLITS","SLOPE","SLUMP","SLUNG","SMACK","SMALL","SMART","SMASH", "SMELL","SMELT","SMILE","SMIRK","SMITH","SMOKE","SNARL","SNEAK","SNEER", "SNIFF","SNOWS","SNOWY","SOBER","SOCKS","SOFAS","SOGGY","SOLAR","SOLES", "SOLID","SOLVE","SONGS","SONIC","SONNY","SORRY","SORTS","SOULS","SOUND", "SOUTH","SPACE","SPANS","SPARE","SPASM","SPEAK","SPEAR","SPECK","SPEED", "SPELL","SPEND","SPENT","SPIKE","SPILL","SPILT","SPINE","SPITE","SPLIT", "SPOIL","SPOKE","SPOON","SPORT","SPOTS","SPOUT","SPRAY","SQUAD","SQUAT", "STACK","STAFF","STAGE","STAIR","STAKE","STALE","STALK","STALL","STAMP", "STAND","STARE","STARK","STARS","START","STATE","STAYS","STEAD","STEAK", "STEAL","STEAM","STEEL","STEEP","STEER","STEPS","STERN","STEVE","STICK", "STILL","STING","STINT","STOCK","STOLE","STOMP","STONE","STONY","STOOD", "STOPS","STORE","STORM","STORY","STOUT","STOVE","STRAW","STRAY","STRIP", "STRUT","STUCK","STUDY","STUFF","STUMP","STUNG","STUNT","STYLE","SUGAR", "SUING","SUITE","SUITS","SUNNY","SUPER","SURGE","SURLY","SWAMP","SWARM", "SWEAR","SWEAT","SWEEP","SWEET","SWELL","SWEPT","SWIFT","SWING","SWISH", "SWISS","SWOON","SWOOP","SWORE","SWORN","SWUNG","SYRUP","TABLE","TAINT", "TAKEN","TAKES","TALES","TALKS","TALLY","TANKS","TAPES","TASTE","TAXIS", "TEACH","TEAMS","TEARS","TEASE","TEETH","TELLS","TENDS","TENEX","TENOR", "TENSE","TENTH","TERMS","TESTS","THANK","THATS","THEFT","THEIR","THEME", "THERE","THESE","THICK","THIEF","THIGH","THING","THINK","THIRD","THOSE", "THREE","THREW","THROB","THROW","THUDS","THUGS","THUMB","THUMP","TIDAL", "TIDES","TIGHT","TILES","TIMER","TIMES","TIRED","TITAN","TITLE","TOAST", "TODAY","TOKEN","TOMBS","TONES","TONGS","TONIC","TOOLS","TOOTH","TORCH", "TOTAL","TOUCH","TOUGH","TOWEL","TOWER","TOWNS","TOYED","TRACE","TRACK", "TRACT","TRADE","TRAIL","TRAIN","TRAMP","TRASH","TREAD","TREES","TRESS", "TRIAL","TRIBE","TRICK","TRIED","TRIES","TRUCK","TRULY","TRUNK","TRUST", "TRUTH","TUBES","TUNED","TURNS","TWANG","TWICE","TWIST","TYING","TYPES", "ULTRA","UNDER","UNION","UNITS","UNTIL","UPPER","UPSET","URGED","USAGE", "USERS","USHER","USING","USUAL","UTTER","VAGUE","VALUE","VAULT","VENUS", "VERBS","VERSE","VESTS","VEXED","VIDEO","VIEWS","VILLA","VIRGO","VIRUS", "VISIT","VITAL","VIVID","VOCAL","VOICE","VOTED","VOWED","WADED","WAIST", "WALES","WALLS","WANED","WANLY","WANTS","WASPS","WASTE","WATCH","WATER", "WAVED","WAVER","WAVES","WAYNE","WEARY","WEAVE","WEEDS","WEEKS","WEIRD", "WETLY","WHACK","WHALE","WHEEL","WHERE","WHICH","WHILE","WHINE","WHIPS", "WHITE","WHOLE","WHOOP","WHOSE","WIDER","WIDTH","WIELD","WILLS","WINDS", "WINDY","WINES","WINGS","WIPED","WIPER","WIRES","WISER","WISPS","WIVES", "WOMAN","WOMEN","WOODS","WOODY","WORDS","WORKS","WORLD","WORRY","WORSE", "WORST","WORTH","WOULD","WOUND","WRAPS","WRECK","WREST","WRIST","WRITE", "WRONG","WROTE","YARDS","YEARS","YIELD","YOUNG","YOURS","YOUTH","ZAIRE", "ZEBRA","ZONES",NULL}; static const char *const CW_CW_WORDS[] = { "(","+","73","88","AA","AB","ABT","ADR","AGN","AM","ANT","AS","B4","BCI", "BCL","BK","BN","BUG","C","CFM","CL","CLD","CLG","CQ","CW","DLD","DLVD", "DR","DX","ES","FB","FM","GA","GM","GN","GND","GUD","HI","HR","HV","HW", "K","LID","MA","MILS","MSG","N","NCS","ND","NIL","NM","NR","NW","OB","OC", "OM","OP","OPR","OT","PBL","PSE","PWR","PX","QRG","QRH","QRI","QRJ","QRK", "QRL","QRM","QRN","QRO","QRP","QRQ","QRS","QRT","QRU","QRV","QRW","QRX", "QRY","QRZ","QSA","QSB","QSD","QSG","QSK","QSL","QSM","QSN","QSO","QSP", "QST","QSU","QSW","QSX","QSY","QSZ","QTA","QTB","QTC","QTH","QTR","R", "RCD","RCVR","REF","RFI","RIG","RTTY","RX","SASE","SED","SIG","SKED","SRI", "SSB","SVC","T","TFC","TKS","TMW","TNX","TT","TU","TVI","TX","TXT","UR", "URS","VFO","VY","WA","WB","WD","WDS","WKD","WKG","WL","WUD","WX","XCVR", "XMTR","XTAL","XYL","YL","BURO","HPE","CU","SN","TEST","TEMP","MNI","RST", "599","5NN","559","CPY","DE","OK","RPT","ANI","BCNU","BD","BLV","CC","CK", "CNT","CO","CONDX","CPSE","CRD","CUD","CUAGN","CUL","ELBUG","ENUF","FER", "FONE","FREQ","GB","GD","GE","HVY","II","INPT","LSN","PA","PP","RPRT","RPT", "SA","STN","SUM","SWL","TRX","WID",NULL}; static const char *const CW_PARIS[] = {"PARIS",NULL}; #endif /* H_CW_WORDS */ unixcw-3.4.2/src/cwutils/cmdline.h0000644000175000017500000000305612451006144016725 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef _CWCMDLINE_H #define _CWCMDLINE_H #include #include "cw_common.h" /* cw_config_t */ #if defined(__cplusplus) extern "C" { #endif extern const char *cw_program_basename(const char *argv0); extern void combine_arguments(const char *env_variable, int argc, char *const argv[], int *new_argc, char **new_argv[]); extern int cw_process_argv(int argc, char *const argv[], const char *options, cw_config_t *config); extern bool has_longopts(void); extern int get_option(int argc, char *const argv[], const char *descriptor, int *option, char **argument); extern int get_optind(void); #if defined(__cplusplus) } #endif #endif /* _CWCMDLINE_H */ unixcw-3.4.2/src/cwutils/cmdline.c0000644000175000017500000004301412451006074016720 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #if defined(HAVE_GETOPT_H) # include #endif #include "libcw.h" #include "cmdline.h" #include "i18n.h" #include "memory.h" #include "cw_copyright.h" static int cw_process_option(int opt, const char *optarg, cw_config_t *config); static void cw_print_usage(const char *program_name); /*---------------------------------------------------------------------*/ /* Command line helpers */ /*---------------------------------------------------------------------*/ /** \brief Return the program's base name from the given argv0 Function returns pointer to substring in argv[0], so I guess that the pointer is owned by environment (?). Since there is always some non-NULL argv[0], the function always returns non-NULL pointer. \param argv0 - first argument to the program, argv[0] \return program's name */ const char *cw_program_basename(const char *argv0) { const char *base = strrchr(argv0, '/'); return base ? base + 1 : argv0; } /** \brief Combine command line options and environment options Build a new argc and argv by combining command line and environment options. The new values are held in the heap, and the malloc'ed addresses are not retained, so do not call this function repeatedly, otherwise it will leak memory. Combined values are returned through \p new_argc and \p new_argv. \param env_variable - name of environment variable to read from \param argc - argc of program's main() \param argv - argv[] of program's main() \param new_argc - combined argc \param new_argv[] - combined argv */ void combine_arguments(const char *env_variable, int argc, char *const argv[], /* out */ int *new_argc, /* out */ char **new_argv[]) { /* Begin with argv[0], which stays in place. */ char **local_argv = safe_malloc(sizeof (*local_argv)); int local_argc = 0; local_argv[local_argc++] = argv[0]; /* If options are given in an environment variable, add these next. */ char *env_options = getenv(env_variable); if (env_options) { char *options = safe_strdup(env_options); for (char *option = strtok(options, " \t"); option; option = strtok(NULL, " \t")) { local_argv = safe_realloc(local_argv, sizeof (*local_argv) * (local_argc + 1)); local_argv[local_argc++] = option; } } /* Append the options given on the command line itself. */ for (int arg = 1; arg < argc; arg++) { local_argv = safe_realloc(local_argv, sizeof (*local_argv) * (local_argc + 1)); local_argv[local_argc++] = argv[arg]; } /* Return the constructed argc/argv. */ *new_argc = local_argc; *new_argv = local_argv; return; } /*---------------------------------------------------------------------*/ /* Option handling helpers */ /*---------------------------------------------------------------------*/ /** \brief Check if target system supports long options \return true the system supports long options, \return false otherwise */ bool has_longopts(void) { #if defined(HAVE_GETOPT_LONG) return true; #else return false; #endif } /** \brief Adapter wrapper round getopt() and getopt_long() Descriptor strings are comma-separated groups of elements of the form "c[:]|longopt", giving the short form option ('c'), ':' if it requires an argument, and the long form option. \param argc \param argv \param descriptor \param option \param argument \return true if there are still options in argv to be drawn \return false if argv is exhausted */ int get_option(int argc, char *const argv[], const char *descriptor, int *option, char **argument) { static char *option_string = NULL; /* Standard getopt() string */ #if defined(HAVE_GETOPT_LONG) static struct option *long_options = NULL; /* getopt_long() structure */ static char **long_names = NULL; /* Allocated names array */ static int long_count = 0; /* Entries in long_options */ #endif int opt; /* If this is the first call, build a new option_string and a matching set of long options. */ if (!option_string) { /* Begin with an empty short options string. */ option_string = safe_strdup(""); /* Break the descriptor into comma-separated elements. */ char *options = safe_strdup(descriptor); for (char *element = strtok(options, ","); element; element = strtok(NULL, ",")) { /* Determine if this option requires an argument. */ int needs_arg = element[1] == ':'; /* Append the short option character, and ':' if present, to the short options string. For simplicity in reallocating, assume that the ':' is always there. */ option_string = safe_realloc(option_string, strlen(option_string) + 3); strncat(option_string, element, needs_arg ? 2 : 1); #if defined(HAVE_GETOPT_LONG) /* Take a copy of the long name and add it to a retained array. Because struct option makes name a const char*, we can't just store it in there and then free later. */ long_names = safe_realloc(long_names, sizeof (*long_names) * (long_count + 1)); long_names[long_count] = safe_strdup(element + (needs_arg ? 3 : 2)); /* Add a new entry to the long options array. */ long_options = safe_realloc(long_options, sizeof (*long_options) * (long_count + 2)); long_options[long_count].name = long_names[long_count]; long_options[long_count].has_arg = needs_arg; long_options[long_count].flag = NULL; long_options[long_count].val = element[0]; long_count++; /* Set the end sentry to all zeroes. */ memset(long_options + long_count, 0, sizeof (*long_options)); #endif } free(options); } /* Call the appropriate getopt function to get the first/next option. */ #if defined(HAVE_GETOPT_LONG) opt = getopt_long(argc, argv, option_string, long_options, NULL); #else opt = getopt(argc, argv, option_string); #endif /* If no more options, clean up allocated memory before returning. */ if (opt == -1) { #if defined(HAVE_GETOPT_LONG) /* Free each long option string created above, using the long_names growable array because the long_options[i].name aliased to it is a const char*. Then free long_names itself, and reset pointer. */ for (int i = 0; i < long_count; i++) { free(long_names[i]); long_names[i] = NULL; } free(long_names); long_names = NULL; /* Free the long options structure, and reset pointer and counter. */ free(long_options); long_options = NULL; long_count = 0; #endif /* Free and reset the retained short options string. */ free(option_string); option_string = NULL; } /* Return the option and argument, with false if no more arguments. */ *option = opt; *argument = optarg; return !(opt == -1); } /** Return the value of getopt()'s optind after get_options() calls complete. */ int get_optind(void) { return optind; } void cw_print_help(cw_config_t *config) { /* int format = has_longopts() */ fprintf(stderr, _("Usage: %s [options...]\n"), config->program_name); if (!has_longopts()) { fprintf(stderr, "%s", _("Long format of options is not supported on your system\n\n")); } fprintf(stderr, "%s", _("Audio system options:\n")); fprintf(stderr, "%s", _(" -s, --system=SYSTEM\n")); fprintf(stderr, "%s", _(" generate sound using SYSTEM audio system\n")); fprintf(stderr, "%s", _(" SYSTEM: {null|console|oss|alsa|pulseaudio|soundcard}\n")); fprintf(stderr, "%s", _(" 'null': don't use any sound output\n")); fprintf(stderr, "%s", _(" 'console': use system console/buzzer\n")); fprintf(stderr, "%s", _(" this output may require root privileges\n")); fprintf(stderr, "%s", _(" 'oss': use OSS output\n")); fprintf(stderr, "%s", _(" 'alsa' use ALSA output\n")); fprintf(stderr, "%s", _(" 'pulseaudio' use PulseAudio output\n")); fprintf(stderr, "%s", _(" 'soundcard': use either PulseAudio, OSS or ALSA\n")); fprintf(stderr, "%s", _(" default sound system: 'pulseaudio'->'oss'->'alsa'\n\n")); fprintf(stderr, "%s", _(" -d, --device=DEVICE\n")); fprintf(stderr, "%s", _(" use DEVICE as output device instead of default one;\n")); fprintf(stderr, "%s", _(" optional for {console|oss|alsa|pulseaudio};\n")); fprintf(stderr, "%s", _(" default devices are:\n")); fprintf(stderr, _(" 'console': \"%s\"\n"), CW_DEFAULT_CONSOLE_DEVICE); fprintf(stderr, _(" 'oss': \"%s\"\n"), CW_DEFAULT_OSS_DEVICE); fprintf(stderr, _(" 'alsa': \"%s\"\n"), CW_DEFAULT_ALSA_DEVICE); fprintf(stderr, _(" 'pulseaudio': %s\n\n"), CW_DEFAULT_PA_DEVICE); fprintf(stderr, "%s", _("Sending options:\n")); fprintf(stderr, "%s", _(" -w, --wpm=WPM set initial words per minute\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_SPEED_MIN, CW_SPEED_MAX); fprintf(stderr, _(" default value: %d\n"), CW_SPEED_INITIAL); fprintf(stderr, "%s", _(" -t, --tone=HZ set initial tone to HZ\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_FREQUENCY_MIN, CW_FREQUENCY_MAX); fprintf(stderr, _(" default value: %d\n"), CW_FREQUENCY_INITIAL); fprintf(stderr, "%s", _(" -v, --volume=PERCENT set initial volume to PERCENT\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_VOLUME_MIN, CW_VOLUME_MAX); fprintf(stderr, _(" default value: %d\n"), CW_VOLUME_INITIAL); fprintf(stderr, "%s", _("Dot/dash options:\n")); fprintf(stderr, "%s", _(" -g, --gap=GAP set extra gap between letters\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_GAP_MIN, CW_GAP_MAX); fprintf(stderr, _(" default value: %d\n"), CW_GAP_INITIAL); fprintf(stderr, "%s", _(" -k, --weighting=WEIGHT set weighting to WEIGHT\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_WEIGHTING_MIN, CW_WEIGHTING_MAX); fprintf(stderr, _(" default value: %d\n"), CW_WEIGHTING_INITIAL); fprintf(stderr, "%s", _("Other options:\n")); if (config->is_cw) { fprintf(stderr, "%s", _(" -e, --noecho disable sending echo to stdout\n")); fprintf(stderr, "%s", _(" -m, --nomessages disable writing messages to stderr\n")); fprintf(stderr, "%s", _(" -c, --nocommands disable executing embedded commands\n")); fprintf(stderr, "%s", _(" -o, --nocombinations disallow [...] combinations\n")); fprintf(stderr, "%s", _(" -p, --nocomments disallow {...} comments\n")); } if (config->has_practice_time) { fprintf(stderr, "%s", _(" -T, --time=TIME set initial practice time (in minutes)\n")); fprintf(stderr, _(" valid values: %d - %d\n"), CW_PRACTICE_TIME_MIN, CW_PRACTICE_TIME_MAX); fprintf(stderr, _(" default value: %d\n"), CW_PRACTICE_TIME_INITIAL); } if (config->has_infile) { fprintf(stderr, "%s", _(" -f, --infile=FILE read practice words from FILE\n")); } if (config->has_outfile) { fprintf(stderr, "%s", _(" -F, --outfile=FILE write current practice words to FILE\n")); } if (config->is_cw) { fprintf(stderr, "%s", _(" default file: stdin\n")); } fprintf(stderr, "\n"); fprintf(stderr, "%s", _(" -h, --help print this message\n")); fprintf(stderr, "%s", _(" -V, --version print version information\n\n")); return; } int cw_process_argv(int argc, char *const argv[], const char *options, cw_config_t *config) { int option; char *argument; while (get_option(argc, argv, options, &option, &argument)) { if (!cw_process_option(option, argument, config)) { return CW_FAILURE; } } if (get_optind() != argc) { fprintf(stderr, "%s: expected argument after options\n", config->program_name); cw_print_usage(config->program_name); return CW_FAILURE; } else { return CW_SUCCESS; } } int cw_process_option(int opt, const char *optarg, cw_config_t *config) { switch (opt) { case 's': if (!strcmp(optarg, "null") || !strcmp(optarg, "n")) { config->audio_system = CW_AUDIO_NULL; } else if (!strcmp(optarg, "alsa") || !strcmp(optarg, "a")) { config->audio_system = CW_AUDIO_ALSA; } else if (!strcmp(optarg, "oss") || !strcmp(optarg, "o")) { config->audio_system = CW_AUDIO_OSS; } else if (!strcmp(optarg, "pulseaudio") || !strcmp(optarg, "p")) { config->audio_system = CW_AUDIO_PA; } else if (!strcmp(optarg, "console") || !strcmp(optarg, "c")) { config->audio_system = CW_AUDIO_CONSOLE; } else if (!strcmp(optarg, "soundcard") || !strcmp(optarg, "s")) { config->audio_system = CW_AUDIO_SOUNDCARD; } else { fprintf(stderr, "%s: invalid audio system (option 's'): %s\n", config->program_name, optarg); return CW_FAILURE; } break; case 'd': // fprintf(stderr, "%s: d:%s\n", config->program_name, optarg); if (optarg && strlen(optarg)) { config->audio_device = strdup(optarg); } else { fprintf(stderr, "%s: no device specified for option -d\n", config->program_name); return CW_FAILURE; } break; case 'w': { // fprintf(stderr, "%s: w:%s\n", config->program_name, optarg); int speed = atoi(optarg); if (speed < CW_SPEED_MIN || speed > CW_SPEED_MAX) { fprintf(stderr, "%s: speed out of range: %d\n", config->program_name, speed); return CW_FAILURE; } else { config->send_speed = speed; } break; } case 't': { // fprintf(stderr, "%s: t:%s\n", config->program_name, optarg); int frequency = atoi(optarg); if (frequency < CW_FREQUENCY_MIN || frequency > CW_FREQUENCY_MAX) { fprintf(stderr, "%s: frequency out of range: %d\n", config->program_name, frequency); return CW_FAILURE; } else { config->frequency = frequency; } break; } case 'v': { // fprintf(stderr, "%s: v:%s\n", config->program_name, optarg); int volume = atoi(optarg); if (volume < CW_VOLUME_MIN || volume > CW_VOLUME_MAX) { fprintf(stderr, "%s: volume level out of range: %d\n", config->program_name, volume); return CW_FAILURE; } else { config->volume = volume; } break; } case 'g': { // fprintf(stderr, "%s: g:%s\n", config->program_name, optarg); int gap = atoi(optarg); if (gap < CW_GAP_MIN || gap > CW_GAP_MAX) { fprintf(stderr, "%s: gap out of range: %d\n", config->program_name, gap); return CW_FAILURE; } else { config->gap = gap; } break; } case 'k': { // fprintf(stderr, "%s: k:%s\n", config->program_name, optarg); int weighting = atoi(optarg); if (weighting < CW_WEIGHTING_MIN || weighting > CW_WEIGHTING_MAX) { fprintf(stderr, "%s: weighting out of range: %d\n", config->program_name, weighting); return CW_FAILURE; } else { config->weighting = weighting; } break; } case 'T': { // fprintf(stderr, "%s: T:%s\n", config->program_name, optarg); int time = atoi(optarg); if (time < 0) { fprintf(stderr, "%s: practice time is negative\n", config->program_name); return CW_FAILURE; } else { config->practice_time = time; } break; } case 'f': if (optarg && strlen(optarg)) { config->input_file = strdup(optarg); } else { fprintf(stderr, "%s: no input file specified for option -f\n", config->program_name); return CW_FAILURE; } /* TODO: access() */ break; case 'F': if (optarg && strlen(optarg)) { config->output_file = strdup(optarg); } else { fprintf(stderr, "%s: no output file specified for option -F\n", config->program_name); return CW_FAILURE; } /* TODO: access() */ break; case 'e': config->do_echo = false; break; case 'm': config->do_errors = false; break; case 'c': config->do_commands = false; break; case 'o': config->do_combinations = false; break; case 'p': config->do_comments = false; break; case 'h': cw_print_help(config); exit(EXIT_SUCCESS); case 'V': fprintf(stderr, _("%s version %s\n"), config->program_name, PACKAGE_VERSION); fprintf(stderr, "%s\n", CW_COPYRIGHT); exit(EXIT_SUCCESS); case '?': default: /* '?' */ cw_print_usage(config->program_name); return CW_FAILURE; } return CW_SUCCESS; } void cw_print_usage(const char *program_name) { const char *format = has_longopts() ? _("Try '%s --help' for more information.\n") : _("Try '%s -h' for more information.\n"); fprintf(stderr, format, program_name); return; } unixcw-3.4.2/src/cwutils/i18n.c0000644000175000017500000000323412451006027016062 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include "i18n.h" /*---------------------------------------------------------------------*/ /* Internationalization */ /*---------------------------------------------------------------------*/ enum { FALSE = 0, TRUE = !FALSE }; /* * i18n_initialize() * * Set locale, and message locations if available. */ void i18n_initialize (void) { setlocale (LC_ALL, ""); } /* * i18n_gettext() * * Wrapper for gettext(). This function is the destination for _("mumble"). */ const char * i18n_gettext (const char *msgid) { #if defined(HAVE_LIBINTL_H) static int is_initialized = FALSE; if (!is_initialized) { textdomain (PACKAGE_NAME); is_initialized = TRUE; } return gettext (msgid); #else return msgid; #endif } unixcw-3.4.2/src/cwutils/Makefile.in0000644000175000017500000013073012536122132017206 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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@ check_PROGRAMS = cw_dictionary_tests$(EXEEXT) subdir = src/cwutils DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(top_srcdir)/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = lib_cw_a_AR = $(AR) $(ARFLAGS) lib_cw_a_LIBADD = am_lib_cw_a_OBJECTS = i18n.$(OBJEXT) cw_common.$(OBJEXT) \ cmdline.$(OBJEXT) memory.$(OBJEXT) lib_cw_a_OBJECTS = $(am_lib_cw_a_OBJECTS) lib_cwcp_a_AR = $(AR) $(ARFLAGS) lib_cwcp_a_LIBADD = am_lib_cwcp_a_OBJECTS = i18n.$(OBJEXT) cw_common.$(OBJEXT) \ cmdline.$(OBJEXT) memory.$(OBJEXT) dictionary.$(OBJEXT) lib_cwcp_a_OBJECTS = $(am_lib_cwcp_a_OBJECTS) lib_cwgen_a_AR = $(AR) $(ARFLAGS) lib_cwgen_a_LIBADD = am_lib_cwgen_a_OBJECTS = i18n.$(OBJEXT) cmdline.$(OBJEXT) \ memory.$(OBJEXT) lib_cwgen_a_OBJECTS = $(am_lib_cwgen_a_OBJECTS) lib_xcwcp_a_AR = $(AR) $(ARFLAGS) lib_xcwcp_a_LIBADD = am_lib_xcwcp_a_OBJECTS = i18n.$(OBJEXT) cw_common.$(OBJEXT) \ cmdline.$(OBJEXT) memory.$(OBJEXT) dictionary.$(OBJEXT) lib_xcwcp_a_OBJECTS = $(am_lib_xcwcp_a_OBJECTS) am_cw_dictionary_tests_OBJECTS = \ cw_dictionary_tests-dictionary.$(OBJEXT) \ cw_dictionary_tests-memory.$(OBJEXT) \ cw_dictionary_tests-i18n.$(OBJEXT) \ cw_dictionary_tests-cw_common.$(OBJEXT) cw_dictionary_tests_OBJECTS = $(am_cw_dictionary_tests_OBJECTS) cw_dictionary_tests_DEPENDENCIES = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cw_dictionary_tests_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(cw_dictionary_tests_CFLAGS) $(CFLAGS) $(AM_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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(lib_cw_a_SOURCES) $(lib_cwcp_a_SOURCES) \ $(lib_cwgen_a_SOURCES) $(lib_xcwcp_a_SOURCES) \ $(cw_dictionary_tests_SOURCES) DIST_SOURCES = $(lib_cw_a_SOURCES) $(lib_cwcp_a_SOURCES) \ $(lib_cwgen_a_SOURCES) $(lib_xcwcp_a_SOURCES) \ $(cw_dictionary_tests_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # source code files used to build cw_dictionary_tests program cw_dictionary_tests_SOURCES = dictionary.c memory.c i18n.c cw_common.c # target-specific preprocessor flags (#defs and include dirs) cw_dictionary_tests_CPPFLAGS = $(AM_CPPFLAGS) -DCW_DICTIONARY_UNIT_TESTS # target-specific linker flags (objects to link) cw_dictionary_tests_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw #-lm -lpthread -ldl # target-specific compiler flags cw_dictionary_tests_CFLAGS = -rdynamic # no header from this dir should be installed # noinst_HEADERS = cmdline.h cw_copyright.h cw_common.h cw_words.h dictionary.h i18n.h memory.h # convenience libraries noinst_LIBRARIES = lib_cw.a lib_cwcp.a lib_cwgen.a lib_xcwcp.a lib_cw_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h lib_cwcp_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h dictionary.c dictionary.h cw_words.h lib_cwgen_a_SOURCES = cw_copyright.h i18n.c i18n.h cmdline.c cmdline.h memory.c memory.h lib_xcwcp_a_SOURCES = cw_copyright.h i18n.c i18n.h cw_common.c cw_common.h cmdline.c cmdline.h memory.c memory.h dictionary.c dictionary.h cw_words.h # Test targets; no self-test, but make sure all is built. #check: all # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = greptest.sh TESTS = $(check_SCRIPTS) # run test programs (only libcwunittests unit tests suite) check_SCRIPTS = greptest.sh all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cwutils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/cwutils/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) lib_cw.a: $(lib_cw_a_OBJECTS) $(lib_cw_a_DEPENDENCIES) $(EXTRA_lib_cw_a_DEPENDENCIES) $(AM_V_at)-rm -f lib_cw.a $(AM_V_AR)$(lib_cw_a_AR) lib_cw.a $(lib_cw_a_OBJECTS) $(lib_cw_a_LIBADD) $(AM_V_at)$(RANLIB) lib_cw.a lib_cwcp.a: $(lib_cwcp_a_OBJECTS) $(lib_cwcp_a_DEPENDENCIES) $(EXTRA_lib_cwcp_a_DEPENDENCIES) $(AM_V_at)-rm -f lib_cwcp.a $(AM_V_AR)$(lib_cwcp_a_AR) lib_cwcp.a $(lib_cwcp_a_OBJECTS) $(lib_cwcp_a_LIBADD) $(AM_V_at)$(RANLIB) lib_cwcp.a lib_cwgen.a: $(lib_cwgen_a_OBJECTS) $(lib_cwgen_a_DEPENDENCIES) $(EXTRA_lib_cwgen_a_DEPENDENCIES) $(AM_V_at)-rm -f lib_cwgen.a $(AM_V_AR)$(lib_cwgen_a_AR) lib_cwgen.a $(lib_cwgen_a_OBJECTS) $(lib_cwgen_a_LIBADD) $(AM_V_at)$(RANLIB) lib_cwgen.a lib_xcwcp.a: $(lib_xcwcp_a_OBJECTS) $(lib_xcwcp_a_DEPENDENCIES) $(EXTRA_lib_xcwcp_a_DEPENDENCIES) $(AM_V_at)-rm -f lib_xcwcp.a $(AM_V_AR)$(lib_xcwcp_a_AR) lib_xcwcp.a $(lib_xcwcp_a_OBJECTS) $(lib_xcwcp_a_LIBADD) $(AM_V_at)$(RANLIB) lib_xcwcp.a clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cw_dictionary_tests$(EXEEXT): $(cw_dictionary_tests_OBJECTS) $(cw_dictionary_tests_DEPENDENCIES) $(EXTRA_cw_dictionary_tests_DEPENDENCIES) @rm -f cw_dictionary_tests$(EXEEXT) $(AM_V_CCLD)$(cw_dictionary_tests_LINK) $(cw_dictionary_tests_OBJECTS) $(cw_dictionary_tests_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_dictionary_tests-cw_common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_dictionary_tests-dictionary.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_dictionary_tests-i18n.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_dictionary_tests-memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dictionary.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i18n.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cw_dictionary_tests-dictionary.o: dictionary.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-dictionary.o -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-dictionary.Tpo -c -o cw_dictionary_tests-dictionary.o `test -f 'dictionary.c' || echo '$(srcdir)/'`dictionary.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-dictionary.Tpo $(DEPDIR)/cw_dictionary_tests-dictionary.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dictionary.c' object='cw_dictionary_tests-dictionary.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-dictionary.o `test -f 'dictionary.c' || echo '$(srcdir)/'`dictionary.c cw_dictionary_tests-dictionary.obj: dictionary.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-dictionary.obj -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-dictionary.Tpo -c -o cw_dictionary_tests-dictionary.obj `if test -f 'dictionary.c'; then $(CYGPATH_W) 'dictionary.c'; else $(CYGPATH_W) '$(srcdir)/dictionary.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-dictionary.Tpo $(DEPDIR)/cw_dictionary_tests-dictionary.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dictionary.c' object='cw_dictionary_tests-dictionary.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-dictionary.obj `if test -f 'dictionary.c'; then $(CYGPATH_W) 'dictionary.c'; else $(CYGPATH_W) '$(srcdir)/dictionary.c'; fi` cw_dictionary_tests-memory.o: memory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-memory.o -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-memory.Tpo -c -o cw_dictionary_tests-memory.o `test -f 'memory.c' || echo '$(srcdir)/'`memory.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-memory.Tpo $(DEPDIR)/cw_dictionary_tests-memory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memory.c' object='cw_dictionary_tests-memory.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-memory.o `test -f 'memory.c' || echo '$(srcdir)/'`memory.c cw_dictionary_tests-memory.obj: memory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-memory.obj -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-memory.Tpo -c -o cw_dictionary_tests-memory.obj `if test -f 'memory.c'; then $(CYGPATH_W) 'memory.c'; else $(CYGPATH_W) '$(srcdir)/memory.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-memory.Tpo $(DEPDIR)/cw_dictionary_tests-memory.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memory.c' object='cw_dictionary_tests-memory.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-memory.obj `if test -f 'memory.c'; then $(CYGPATH_W) 'memory.c'; else $(CYGPATH_W) '$(srcdir)/memory.c'; fi` cw_dictionary_tests-i18n.o: i18n.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-i18n.o -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-i18n.Tpo -c -o cw_dictionary_tests-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-i18n.Tpo $(DEPDIR)/cw_dictionary_tests-i18n.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='i18n.c' object='cw_dictionary_tests-i18n.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-i18n.o `test -f 'i18n.c' || echo '$(srcdir)/'`i18n.c cw_dictionary_tests-i18n.obj: i18n.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-i18n.obj -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-i18n.Tpo -c -o cw_dictionary_tests-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-i18n.Tpo $(DEPDIR)/cw_dictionary_tests-i18n.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='i18n.c' object='cw_dictionary_tests-i18n.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-i18n.obj `if test -f 'i18n.c'; then $(CYGPATH_W) 'i18n.c'; else $(CYGPATH_W) '$(srcdir)/i18n.c'; fi` cw_dictionary_tests-cw_common.o: cw_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-cw_common.o -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-cw_common.Tpo -c -o cw_dictionary_tests-cw_common.o `test -f 'cw_common.c' || echo '$(srcdir)/'`cw_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-cw_common.Tpo $(DEPDIR)/cw_dictionary_tests-cw_common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cw_common.c' object='cw_dictionary_tests-cw_common.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-cw_common.o `test -f 'cw_common.c' || echo '$(srcdir)/'`cw_common.c cw_dictionary_tests-cw_common.obj: cw_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -MT cw_dictionary_tests-cw_common.obj -MD -MP -MF $(DEPDIR)/cw_dictionary_tests-cw_common.Tpo -c -o cw_dictionary_tests-cw_common.obj `if test -f 'cw_common.c'; then $(CYGPATH_W) 'cw_common.c'; else $(CYGPATH_W) '$(srcdir)/cw_common.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cw_dictionary_tests-cw_common.Tpo $(DEPDIR)/cw_dictionary_tests-cw_common.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cw_common.c' object='cw_dictionary_tests-cw_common.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cw_dictionary_tests_CPPFLAGS) $(CPPFLAGS) $(cw_dictionary_tests_CFLAGS) $(CFLAGS) -c -o cw_dictionary_tests-cw_common.obj `if test -f 'cw_common.c'; then $(CYGPATH_W) 'cw_common.c'; else $(CYGPATH_W) '$(srcdir)/cw_common.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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 # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) $(check_SCRIPTS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? greptest.sh.log: greptest.sh @p='greptest.sh'; \ b='greptest.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am -include $(top_builddir)/Makefile.inc greptest.sh: echo './cw_dictionary_tests | grep "test result: success"' > greptest.sh chmod +x greptest.sh # 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: unixcw-3.4.2/src/cwgen/0000755000175000017500000000000012540354303014550 5ustar acerionacerionunixcw-3.4.2/src/cwgen/Makefile.am0000644000175000017500000000266112451005714016611 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # -include $(top_builddir)/Makefile.inc # program(s) to be built in current dir bin_PROGRAMS = cwgen # source code files used to build cwgen program cwgen_SOURCES = cwgen.c # target-specific preprocessor flags (#defs and include dirs) #cwgen_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cwgen_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwgen.a # copy man page to proper directory during installation man_MANS = cwgen.1 # and mark it as distributable, too EXTRA_DIST = cwgen.1 # Test targets. check: all -./cwgen unixcw-3.4.2/src/cwgen/cwgen.10000644000175000017500000000715012536121675015751 0ustar acerionacerion.\" .\" UnixCW CW Tutor Package - CWGEN .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH CWGEN 1 "CW Tutor Package" "cwgen ver. 3.4.2" \" -*- nroff -*- .SH NAME .\" cwgen \- generate groups of random characters for Morse code practice .\" .\" .\" .SH SYNOPSIS .\" .B cwgen [\-g\ \-\-groups=\fIgroups\fP] [\-n\ \-\-groupsize=\fIgroupsize\fP] [\-n\ \-\-groupsize=\fIgroup_min-group_max\fP] [\-r\ \-\-repeat=\fIrepeat\fP] [\-x\ \-\-limit=\fIlimit\fP] [\-c\ \-\-charset=\fIcharset\fP] .BR [\-h\ \-\-help] [\-V\ \-\-version] .PP \fBcwgen\fP installed on GNU/Linux systems understands both short form and long form command line options. \fBcwgen\fP installed on other operating systems may understand only the short form options. .PP Options may be predefined in the environment variable \fBCWGEN_OPTIONS\fP. If defined, these options are used first; command line options take precedence. .PP .\" .\" .\" .SH DESCRIPTION .\" .PP .B cwgen provides a simple method to generate groups of random characters for use as input into \fBcw\fP. Command line options control the group size, number of groups, and character set from which the random characters are selected. .PP .\" .\" .\" .SS COMMAND LINE OPTIONS .\" .B cwgen understands the following command line options. The long form options may not be available in non-LINUX versions. .TP .I "\-g, \-\-groups" Specifies the number of groups of random characters to generate. The default value is 128. .TP .I "\-n, \-\-groupsize" Specifies either the number of random characters in each group, if a single value is given, or a range for the number of random characters in each group if a dash-separated pair of values is given. If a range is given, \fBcwgen\fP generates groups sized randomly between 'group_min' and 'group_max'. The default value is 5. .TP .I "\-r, \-\-repeat" Specifies the number of times to repeat each group. The default value is 0, indicating that each group is printed just once. .TP .I "\-x, \-\-limit" Specifies an upper limit on the number of characters printed. This option is useful when using random group sizes, to ensure a given amount of practice text. The default value is 0, indicating no upper limit on the number of characters printed. .TP .I "\-c, \-\-charset" Defines the character set from which the random characters are selected. The default value is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'. .PP .\" .\" .\" .SH EXAMPLES .\" Generate 20 groups of 10 characters from the set EISH5, and sound them as Morse code. Both short-form and long-form option examples are shown: .IP cwgen \-g 20 \-n 10 \-c "EISH5" | cw \-w 25 \-t 850 .IP cwgen \-\-groups=20 \-\-groupsize=10 \-\-charset="EISH5" | cw \-\-wpm=25 \-\-tone=850 .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBcw\fP(7,LOCAL), \fBlibcw\fP(3,LOCAL), \fBcw\fP(1,LOCAL), \fBcwcp\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/cwgen/cwgen.c0000644000175000017500000002702012451005770016022 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include #include /* gettimeofday() */ #include #include #include #include /* SCNu64 in sscanf() */ #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "i18n.h" #include "cmdline.h" #include "cw_copyright.h" #include "memory.h" #define MIN_GROUPS 1 /* Lowest number of groups allowed. */ #define INITIAL_GROUPS 128 /* Default number of groups. */ #define MIN_GROUP_SIZE 1 /* Lowest group size allowed. */ #define INITIAL_GROUP_SIZE 5 /* Default group size. */ #define INITIAL_REPEAT 0 /* Default repeat count. */ #define MIN_REPEAT 0 /* Lowest repeat count allowed. */ #define MIN_LIMIT 0 /* Lowest character count limit allowed. */ #define INITIAL_LIMIT 0 /* Default character count limit. */ static const char *const DEFAULT_CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; struct cwgen_config { char *program_name; /* Program's name (argv[0]) */ int n_groups; /* How many unique groups to generate. */ int group_size_min; /* Minimal size (length) of generated groups. */ int group_size_max; /* Maximal size (length) of generated groups. */ int n_repeats; /* How many times in a row to repeat each unique group; zero for no repeats (group will be printed only once). */ uint64_t n_chars_max; /* Maximal number of characters (excluding spaces) to generate in whole set of groups; may be zero - no limit. */ char *charset; /* Set of chars to be used to generate groups. */ } config = { .program_name = (char *) NULL, .n_groups = INITIAL_GROUPS, .group_size_min = INITIAL_GROUP_SIZE, .group_size_max = INITIAL_GROUP_SIZE, .n_repeats = INITIAL_REPEAT, .n_chars_max = INITIAL_LIMIT, .charset = (char *) NULL }; static const char *all_options = "g:|groups,n:|groupsize,r:|repeat,x:|limit,c:|charset,h|help,v|version"; static void cwgen_generate_characters(struct cwgen_config *config); static void cwgen_print_usage(const char *program_name); static void cwgen_print_help(const char *program_name); static void cwgen_parse_command_line(int argc, char **argv, struct cwgen_config *config); static void cwgen_free_config(struct cwgen_config *config); /** \brief Generate random characters on stdout Generate random characters on stdout, in groups as requested, and up to the requested number of groups. Characters are selected from the set given at random. \param config - program's configuration variable */ void cwgen_generate_characters(struct cwgen_config *config) { static bool is_initialized = false; /* On first (usually only) call, seed the random number generator. */ if (!is_initialized) { /* Previously the initializator used value returned by time(). Consecutive calls of the program within one second resulted in the same generated string - not very random. To improve randomness, I've switched to gettimeofday(). */ struct timeval t; gettimeofday(&t, NULL); srandom(t.tv_usec); is_initialized = true; } /* Allocate the buffer for repeating groups. */ char *buffer = (char *) malloc(config->group_size_max); if (!buffer) { fprintf(stderr, "%s: failed to allocate memory\n", config->program_name); exit(EXIT_FAILURE); } /* Generate groups up to the number requested or to the character limit. */ int charset_length = strlen(config->charset); uint64_t chars = 0; for (int group = 0; group < config->n_groups; group++) { /* Randomize the group size between min and max inclusive. */ int group_size = config->group_size_min + random() % (config->group_size_max - config->group_size_min + 1); /* Create random group. */ for (int i = 0; i < group_size; i++) { buffer[i] = config->charset[random() % charset_length]; } /* Repeatedly print the group as requested. It's always printed at least once, then repeated for the desired repeat count. Break altogether if we hit any set limit on printed characters. */ int repeat = 0; do { for (int i = 0; i < group_size; i++) { putchar(buffer[i]); fflush(stdout); chars++; if (config->n_chars_max && chars >= config->n_chars_max) { break; } } putchar(' '); fflush(stdout); if (config->n_chars_max && chars >= config->n_chars_max) { break; } } while (repeat++ < config->n_repeats); if (config->n_chars_max && chars >= config->n_chars_max) { break; } } free(buffer); return; } /** \brief Print out a brief message directing the user to the help function \param program_name - program's name */ void cwgen_print_usage(const char *program_name) { const char *format = has_longopts() ? _("Try '%s --help' for more information.\n") : _("Try '%s -h' for more information.\n"); fprintf(stderr, format, program_name); return; } /* \brief Print out a brief page of help information \param program_name - program's name */ static void cwgen_print_help(const char *program_name) { if (!has_longopts()) { fprintf(stderr, "%s", _("Long format of options is not supported on your system\n\n")); } printf(_("Usage: %s [options...]\n\n"), program_name); printf(_(" -g, --groups=GROUPS send GROUPS groups of chars [default %d]\n"), INITIAL_GROUPS); printf(_(" GROUPS values may not be lower than %d\n"), MIN_GROUPS); printf(_(" -n, --groupsize=GS make groups GS chars [default %d]\n"), INITIAL_GROUP_SIZE); printf(_(" GS values may not be lower than %d, or\n"), MIN_GROUP_SIZE); printf("%s", _(" -n, --groupsize=GL-GH make groups between GL and GH chars\n")); printf("%s", _(" valid GL, GH values are as for GS above\n")); printf(_(" -r, --repeat=COUNT repeat each group COUNT times [default %d]\n"), INITIAL_REPEAT); printf(_(" COUNT values may not be lower than %d\n"), MIN_REPEAT); printf("%s", _(" -c, --charset=CHARSET select chars to send from this set\n")); printf(_(" [default %s]\n"), DEFAULT_CHARSET); printf(_(" -x, --limit=LIMIT stop after LIMIT characters [default %d]\n"), INITIAL_LIMIT); printf("%s", _(" a LIMIT of zero indicates no set limit\n")); printf("%s", _(" -h, --help print this message\n")); printf("%s", _(" -v, --version output version information and exit\n\n")); exit(EXIT_SUCCESS); } /** \brief Parse command line options Parse the command line options for initial values for the various global and flag definitions. \param argc - main()'s argc \param argv - main()'s argv \param config - program's configuration variable */ void cwgen_parse_command_line(int argc, char **argv, struct cwgen_config *config) { int option; char *argument; config->program_name = strdup(cw_program_basename(argv[0])); if (!config->program_name) { fprintf(stderr, "%s: failed to allocate memory\n", argv[0]); exit(EXIT_FAILURE); } while (get_option(argc, argv, all_options, &option, &argument)) { switch (option) { case 'g': if (sscanf(argument, "%d", &(config->n_groups)) != 1 || config->n_groups < MIN_GROUPS) { fprintf(stderr, _("%s: invalid groups value: '%s'\n"), config->program_name, argument); exit(EXIT_FAILURE); } break; case 'n': if (sscanf(argument, "%d-%d", &(config->group_size_min), &(config->group_size_max)) == 2) { if (config->group_size_min < MIN_GROUP_SIZE || config->group_size_max < MIN_GROUP_SIZE || config->group_size_min > config->group_size_max) { fprintf(stderr, _("%s: invalid groupsize range: '%s'\n"), config->program_name, argument); exit(EXIT_FAILURE); } } else if (sscanf(argument, "%d", &(config->group_size_min)) == 1) { if (config->group_size_min < MIN_GROUP_SIZE) { fprintf(stderr, _("%s: invalid groupsize value\n"), config->program_name); exit(EXIT_FAILURE); } config->group_size_max = config->group_size_min; } break; case 'r': if (sscanf(argument, "%d", &(config->n_repeats)) != 1 || config->n_repeats < MIN_REPEAT) { fprintf(stderr, _("%s: invalid repeat value: '%s'\n"), config->program_name, argument); exit(EXIT_FAILURE); } break; case 'x': if (sscanf(argument, "%" SCNu64, &(config->n_chars_max)) != 1 || strstr(argument, "-")) { fprintf(stderr, _("%s: invalid limit value: %s\n"), config->program_name, argument); exit(EXIT_FAILURE); } fprintf(stderr, _("%s: valid limit value: %s\n"), config->program_name, argument); break; case 'c': if (strlen(argument) == 0) { fprintf(stderr, _("%s: charset cannot be empty\n"), config->program_name); exit(EXIT_FAILURE); } assert(!config->charset); config->charset = strdup(argument); if (!config->charset) { fprintf(stderr, _("%s: failed to allocate memory\n"), config->program_name); exit(EXIT_FAILURE); } break; case 'h': cwgen_print_help(config->program_name); case 'v': printf(_("%s version %s\n%s\n"), config->program_name, PACKAGE_VERSION, _(CW_COPYRIGHT)); exit(EXIT_SUCCESS); case '?': cwgen_print_usage(config->program_name); exit(EXIT_FAILURE); default: fprintf(stderr, _("%s: getopts returned %c\n"), config->program_name, option); exit(EXIT_FAILURE); } } if (get_optind() != argc) { cwgen_print_usage(config->program_name); exit(EXIT_FAILURE); } return; } /** \brief Parse the command line options, then generate the characters requested */ int main(int argc, char **argv) { int combined_argc; char **combined_argv; /* Set locale and message catalogs. */ i18n_initialize(); /* Parse combined environment and command line arguments. */ combine_arguments(_("CWGEN_OPTIONS"), argc, argv, &combined_argc, &combined_argv); cwgen_parse_command_line(combined_argc, combined_argv, &config); if (!config.charset) { config.charset = strdup(DEFAULT_CHARSET); if (!config.charset) { fprintf(stderr, _("%s: failed to allocate memory\n"), argv[0]); return EXIT_FAILURE; } } /* Generate the character groups as requested. */ cwgen_generate_characters(&config); putchar('\n'); cwgen_free_config(&config); return EXIT_SUCCESS; } /** \brief Deallocate memory used by fields of config variable Function calls free() for all pointers to previously allocated memory. \param config - pointer to config variable */ void cwgen_free_config(struct cwgen_config *config) { if (config->charset) { free(config->charset); config->charset = (char *) NULL; } if (config->program_name) { free(config->program_name); config->program_name = (char *) NULL; } return; } unixcw-3.4.2/src/cwgen/Makefile.in0000644000175000017500000005622412536122132016624 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = cwgen$(EXEEXT) subdir = src/cwgen DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_cwgen_OBJECTS = cwgen.$(OBJEXT) cwgen_OBJECTS = $(am_cwgen_OBJECTS) cwgen_DEPENDENCIES = $(top_builddir)/src/cwutils/lib_cwgen.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(cwgen_SOURCES) DIST_SOURCES = $(cwgen_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) 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)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # source code files used to build cwgen program cwgen_SOURCES = cwgen.c # target-specific preprocessor flags (#defs and include dirs) #cwgen_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cwgen_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwgen.a # copy man page to proper directory during installation man_MANS = cwgen.1 # and mark it as distributable, too EXTRA_DIST = cwgen.1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cwgen/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/cwgen/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cwgen$(EXEEXT): $(cwgen_OBJECTS) $(cwgen_DEPENDENCIES) $(EXTRA_cwgen_DEPENDENCIES) @rm -f cwgen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cwgen_OBJECTS) $(cwgen_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cwgen.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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 check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 -include $(top_builddir)/Makefile.inc # Test targets. check: all -./cwgen # 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: unixcw-3.4.2/src/xcwcp/0000755000175000017500000000000012540354303014571 5ustar acerionacerionunixcw-3.4.2/src/xcwcp/display.h0000644000175000017500000000361112451007616016413 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #ifndef _XCWCP_DISPLAY_H #define _XCWCP_DISPLAY_H #include //----------------------------------------------------------------------- // Class Display //----------------------------------------------------------------------- // Describes an extremely simply text display interface. The interface is // minimized and abstracted like this to make changes to the underlying // implementation easy. namespace cw { class Application; class DisplayImpl; class Display { public: Display (Application *application, QWidget *parent); QWidget *get_widget() const; // Minimal text display interface; add a character, remove a character, // and clear the display completely. void append(char c); void backspace(); void clear(); // Minimal pass-through status bar interface. void show_status(const QString &status); void clear_status(); private: Application *application_; DisplayImpl *implementation_; // Prevent unwanted operations. Display (const Display &); Display &operator= (const Display &); }; } // cw namespace #endif // _XCWCP_DISPLAY_H unixcw-3.4.2/src/xcwcp/moc_application.cc0000644000175000017500000001052612540353760020253 0ustar acerionacerion/**************************************************************************** ** Meta object code from reading C++ file 'application.h' ** ** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "application.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'application.h' doesn't include ." #elif Q_MOC_OUTPUT_REVISION != 63 #error "This file was generated using the moc from 4.8.6. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_cw__Application[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 18, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 17, 16, 16, 16, 0x08, 25, 16, 16, 16, 0x08, 37, 16, 16, 16, 0x08, 45, 16, 16, 16, 0x08, 52, 16, 16, 16, 0x08, 67, 16, 16, 16, 0x08, 75, 16, 16, 16, 0x08, 88, 16, 16, 16, 0x08, 103, 16, 16, 16, 0x08, 122, 16, 16, 16, 0x08, 138, 16, 16, 16, 0x08, 151, 16, 16, 16, 0x08, 165, 16, 16, 16, 0x08, 188, 16, 16, 16, 0x08, 214, 16, 16, 16, 0x08, 222, 16, 16, 16, 0x08, 231, 16, 16, 16, 0x08, 248, 16, 16, 16, 0x08, 0 // eod }; static const char qt_meta_stringdata_cw__Application[] = { "cw::Application\0\0about()\0startstop()\0" "start()\0stop()\0new_instance()\0clear()\0" "sync_speed()\0speed_change()\0" "frequency_change()\0volume_change()\0" "gap_change()\0mode_change()\0" "curtis_mode_b_change()\0adaptive_receive_change()\0" "fonts()\0colors()\0toggle_toolbar()\0" "poll_timer_event()\0" }; void cw::Application::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); Application *_t = static_cast(_o); switch (_id) { case 0: _t->about(); break; case 1: _t->startstop(); break; case 2: _t->start(); break; case 3: _t->stop(); break; case 4: _t->new_instance(); break; case 5: _t->clear(); break; case 6: _t->sync_speed(); break; case 7: _t->speed_change(); break; case 8: _t->frequency_change(); break; case 9: _t->volume_change(); break; case 10: _t->gap_change(); break; case 11: _t->mode_change(); break; case 12: _t->curtis_mode_b_change(); break; case 13: _t->adaptive_receive_change(); break; case 14: _t->fonts(); break; case 15: _t->colors(); break; case 16: _t->toggle_toolbar(); break; case 17: _t->poll_timer_event(); break; default: ; } } Q_UNUSED(_a); } const QMetaObjectExtraData cw::Application::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject cw::Application::staticMetaObject = { { &QMainWindow::staticMetaObject, qt_meta_stringdata_cw__Application, qt_meta_data_cw__Application, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &cw::Application::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *cw::Application::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *cw::Application::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_cw__Application)) return static_cast(const_cast< Application*>(this)); return QMainWindow::qt_metacast(_clname); } int cw::Application::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 18) qt_static_metacall(this, _c, _id, _a); _id -= 18; } return _id; } QT_END_MOC_NAMESPACE unixcw-3.4.2/src/xcwcp/modeset.h0000644000175000017500000001142612451007602016404 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #ifndef _CWMODESET_H #define _CWMODESET_H #include #include #include "dictionary.h" // Forward declaration of opaque dictionary. //typedef struct dictionary_s dictionary; //----------------------------------------------------------------------- // Class Mode //----------------------------------------------------------------------- namespace cw { // Describes a given operating mode. All modes have a description, and // dictionary modes add a way to generate random groups of words from the // dictionary. class DictionaryMode; class KeyboardMode; class ReceiveMode; class Mode { public: Mode (const std::string &description) : description_ (description) { } virtual ~Mode () { } std::string get_description() const; bool is_same_type_as(const Mode *other) const; virtual const DictionaryMode *is_dictionary() const; virtual const KeyboardMode *is_keyboard() const; virtual const ReceiveMode *is_receive() const; private: const std::string description_; // Mode description // Prevent unwanted operations. Mode (const Mode &); Mode &operator= (const Mode &); }; class DictionaryMode : public Mode { public: DictionaryMode (const std::string &description, const cw_dictionary_t *dict) : Mode (description), dictionary_ (dict) { } std::string get_random_word_group() const; virtual const DictionaryMode *is_dictionary() const; private: const cw_dictionary_t *dictionary_; // Mode dictionary // Prevent unwanted operations. DictionaryMode (const DictionaryMode &); DictionaryMode &operator= (const DictionaryMode &); }; class KeyboardMode : public Mode { public: KeyboardMode (const std::string &description) : Mode (description) { } virtual const KeyboardMode *is_keyboard() const; private: // Prevent unwanted operations. KeyboardMode (const KeyboardMode &); KeyboardMode &operator= (const KeyboardMode &); }; class ReceiveMode : public Mode { public: ReceiveMode (const std::string &description) : Mode (description) { } virtual const ReceiveMode *is_receive() const; private: // Prevent unwanted operations. ReceiveMode (const ReceiveMode &); ReceiveMode &operator= (const ReceiveMode &); }; // Class inline functions. inline std::string Mode::get_description() const { return description_; } inline const DictionaryMode *Mode::is_dictionary() const { return 0; } inline const KeyboardMode * Mode::is_keyboard() const { return 0; } inline const ReceiveMode *Mode::is_receive() const { return 0; } inline const DictionaryMode *DictionaryMode::is_dictionary() const { return this; } inline const KeyboardMode *KeyboardMode::is_keyboard() const { return this; } inline const ReceiveMode *ReceiveMode::is_receive() const { return this; } } // cw namespace //----------------------------------------------------------------------- // Class ModeSet //----------------------------------------------------------------------- namespace cw { // Aggregates Modes, created from dictionaries and locally, and provides a // concept of a current mode and convenient access to modes based on the // current mode setting. class ModeSet { public: ModeSet(); void set_current(int index); const Mode *get_current() const; int get_count() const; const Mode *get(int index) const; const DictionaryMode *is_dictionary() const; const KeyboardMode *is_keyboard() const; const ReceiveMode *is_receive() const; private: const std::vector *const modes_; const Mode *current_; // Prevent unwanted operations. ModeSet (const ModeSet &); ModeSet &operator= (const ModeSet &); }; // Class inline functions. inline void ModeSet::set_current (int index) { current_ = modes_->at(index); return; } inline const Mode *ModeSet::get_current() const { return current_; } inline int ModeSet::get_count() const { return modes_->size(); } inline const Mode *ModeSet::get(int index) const { return modes_->at(index); } } // cw namespace #endif // _CWMODESET_H unixcw-3.4.2/src/xcwcp/sender.cc0000644000175000017500000001206712475645774016414 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "config.h" #include #include #include #include #include #include "sender.h" #include "display.h" #include "modeset.h" #include "libcw.h" #include "i18n.h" namespace cw { //----------------------------------------------------------------------- // Class Sender //----------------------------------------------------------------------- // poll() // // Poll the CW library tone queue, and if it is getting low, arrange for // more data to be passed in to the sender. void Sender::poll(const Mode *current_mode) { if (current_mode->is_dictionary() || current_mode->is_keyboard()) { if (cw_get_tone_queue_length() <= 1) { // Arrange more data for the sender. In // dictionary modes, add more random data if // the queue is empty. In keyboard mode, just // dequeue anything currently on the character // queue. if (current_mode->is_dictionary() && send_queue_.empty()) { const DictionaryMode *dict_mode = current_mode->is_dictionary(); enqueue_string(std::string(1, ' ') + dict_mode->get_random_word_group()); } dequeue_character(); } } return; } // handle_key_event() // // Specific handler for keyboard mode_key events. Handles presses only; // releases are ignored. void Sender::handle_key_event(QKeyEvent *event, const Mode *current_mode) { if (!current_mode->is_keyboard()) { return; } if (event->type() == QEvent::KeyPress) { if (event->key() == Qt::Key_Backspace) { // Remove the last queued character, or at // least try, and we are done. delete_character(); event->accept(); } else { // Extract the ASCII keycode from the key // event, and queue the character for sending, // converted to uppercase. const char *c = event->text().toAscii().data(); enqueue_string(c); // Accept the event if the character was // sendable. If not, it won't have queued, // and so by ignoring it we can let characters // such as Tab pass up to the parent. if (cw_character_is_valid(toupper(c[0]))) { event->accept(); } } } return; } // clear() // // Flush the tone queue, empty the character queue, and set to idle. void Sender::clear() { cw_flush_tone_queue(); send_queue_.clear(); is_queue_idle_ = true; return; } // dequeue_character() // // Called when the CW send buffer is empty. If the queue is not idle, take // the next character from the queue and send it. If there are no more queued // characters, set the queue to idle. void Sender::dequeue_character() { if (is_queue_idle_) { return; } if (send_queue_.empty()) { is_queue_idle_ = true; display_->clear_status(); return; } // Take the next character off the queue and send it. We don't // expect sending to fail as only sendable characters are queued. const char c = toupper(send_queue_.front()); send_queue_.pop_front(); if (!cw_send_character(c)) { perror("cw_send_character"); abort(); } // Update the status bar with the character being sent. // Put the sent char at the end to avoid "jumping" of whole // string when width of glyph of sent char changes at variable // font width. QString status = _("Sending at %1 WPM: '%2'"); display_->show_status(status.arg(cw_get_send_speed()).arg(c)); return; } // enqueue_string() // // Queues a string for sending by the CW sender. Rejects any unsendable // characters found in the string. Rejection is silent. void Sender::enqueue_string(const std::string &word) { bool is_queue_notify = false; // Add each character, and note if we need to change from idle. for (unsigned int i = 0; i < word.size(); i++) { const char c = toupper(word[i]); if (cw_character_is_valid(c)) { send_queue_.push_back(c); display_->append(c); if (is_queue_idle_) { is_queue_notify = true; } } } // If we queued any character, mark the queue as not idle. if (is_queue_notify) { is_queue_idle_ = false; } return; } // delete_character() // // Remove the most recently added character from the queue, provided that // the dequeue hasn't yet reached it. If there's nothing available to // delete, fail silently. void Sender::delete_character() { if (!send_queue_.empty()) { send_queue_.pop_back(); display_->backspace(); } return; } } // cw namespace unixcw-3.4.2/src/xcwcp/sender.h0000644000175000017500000000411612451007570016226 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #ifndef _XCWCP_SENDER_H #define _XCWCP_SENDER_H #include #include #include //----------------------------------------------------------------------- // Class Sender //----------------------------------------------------------------------- // Encapsulates the main application sender data and functions. Sender // abstracts the send character queue, polling, and event handling. namespace cw { class Display; class Mode; class Sender { public: Sender (Display *display) : display_ (display), is_queue_idle_ (true) { } // Poll timeout handler, and keypress event handler. void poll(const Mode *current_mode); void handle_key_event(QKeyEvent *event, const Mode *current_mode); // Clear out queued data on stop, mode change, etc. void clear(); private: // Display used for output. Display *display_; // Deque and queue manipulation functions, used to handle and // maintain the buffer of characters awaiting libcw send. bool is_queue_idle_; std::deque send_queue_; void dequeue_character(); void enqueue_string(const std::string &word); void delete_character(); // Prevent unwanted operations. Sender(const Sender &); Sender &operator= (const Sender &); }; } // cw namespace #endif // _XCWCP_SENDER_H unixcw-3.4.2/src/xcwcp/display.cc0000644000175000017500000001547512475645774016607 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "config.h" #include #include #include #include #include #include #include #include "display.h" #include "application.h" #include "i18n.h" namespace cw { const QString DISPLAY_WHATSTHIS = _("This is the main display for Xcwcp. The random CW characters that " "Xcwcp generates, any keyboard input you type, and the CW that you " "key into Xcwcp all appear here.

" "You can clear the display contents from the File menu.

" "The status bar shows the current character being sent, any character " "received, and other general error and Xcwcp status information."); //----------------------------------------------------------------------- // Class DisplayImpl //----------------------------------------------------------------------- // DisplayImpl class, extends QTextEdit. This class is used as the // implementation of the simple text display. It overrides QTextEdit in // order to gain finer control over the way text is displayed, and is local // to this module. class DisplayImpl : public QTextEdit { public: DisplayImpl (Application *application, QWidget *parent); protected: // Functions overridden to catch events from the parent class. void keyPressEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event); void mousePressEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); // Are these necessary after adding fontPointSize() in constructor? virtual QMenu *createPopupMenu(const QPoint &); virtual QMenu *createPopupMenu(); private: // Application to forward key and mouse events to. Application *application_; // Prevent unwanted operations. DisplayImpl (const DisplayImpl &); DisplayImpl &operator= (const DisplayImpl &); }; // DisplayImpl() // // Call the superclass constructor, and save the application for sending on // key and mouse events. DisplayImpl::DisplayImpl (Application *application, QWidget *parent) : QTextEdit (parent), application_ (application) { // Block context menu in text area, this is to make right mouse // button work as correct sending key (paddle). // http://doc.qt.nokia.com/latest/qt.html#ContextMenuPolicy-enum // Qt::PreventContextMenu: // "the widget does not feature a context menu, [...] the handling // is not deferred to the widget's parent. This means that all right // mouse button events are guaranteed to be delivered to the widget // itself through mousePressEvent(), and mouseReleaseEvent()." setContextMenuPolicy(Qt::PreventContextMenu); // Clear widget. setPlainText(""); // These two lines just repeat the default settings. // I'm putting them here just for fun. setLineWrapMode(QTextEdit::WidgetWidth); // Words will be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. setWordWrapMode(QTextOption::WordWrap); // Text is wrapped at word boundaries. // This can be changed by user in menu Settings -> Text font setFontWeight(QFont::Bold); } // keyPressEvent() // keyReleaseEvent() // // Catch key events and pass them to our parent Application. Both press // and release events are merged into one *_event() call. void DisplayImpl::keyPressEvent(QKeyEvent *event) { application_->key_event(event); return; } void DisplayImpl::keyReleaseEvent(QKeyEvent *event) { application_->key_event(event); return; } // mousePressEvent() // mouseDoubleClickEvent() // mouseReleaseEvent() // // Do the same for mouse button events. We need to catch both press and // double-click, since for keying we don't use or care about double-clicks, // just any form of button press, any time. void DisplayImpl::mousePressEvent(QMouseEvent *event) { application_->mouse_event(event); return; } void DisplayImpl::mouseDoubleClickEvent(QMouseEvent *event) { application_->mouse_event(event); return; } void DisplayImpl::mouseReleaseEvent(QMouseEvent *event) { application_->mouse_event(event); return; } // createPopupMenu() // // Override and suppress popup menus, so we can use the right mouse button // as a keyer paddle. QMenu *DisplayImpl::createPopupMenu(const QPoint &) { return NULL; } QMenu *DisplayImpl::createPopupMenu() { return NULL; } //----------------------------------------------------------------------- // Class Display //----------------------------------------------------------------------- // Display() // // Create a display implementation, passing the application to be informed // when the display widget receives key or mouse events. Display::Display(Application *application, QWidget *parent) : application_(application), implementation_(new DisplayImpl(application, parent)) { QWidget *display_widget = get_widget(); display_widget->setFocus(); display_widget->setWhatsThis(DISPLAY_WHATSTHIS); application_->setCentralWidget(display_widget); show_status(_("Ready")); } // get_widget() // // Return the underlying QWidget used to implement the display. Returning // the widget only states that this is a QWidget, it doesn't tie us to using // any particular type of widget. QWidget *Display::get_widget() const { return implementation_; } // append() // // Append a character at the current notional cursor position. void Display::append(char c) { implementation_->insertPlainText(QString(QChar(c))); return; } // backspace() // // Delete the character left of the notional cursor position (that is, the // last one appended). void Display::backspace() { // implementation_->doKeyboardAction (QTextEdit::ActionBackspace); return; } // clear() // // Clear the display area. void Display::clear() { implementation_->clear(); return; } // show_status() // // Display the given string on the status line. void Display::show_status(const QString &status) { application_->statusBar()->showMessage(status); return; } // clear_status() // // Clear the status line. void Display::clear_status() { application_->statusBar()->clearMessage(); return; } } // cw namespace unixcw-3.4.2/src/xcwcp/Makefile.am0000644000175000017500000000527312472651077016650 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # use $(top_builddir) instead of $(top_srcdir) because Makefile.inc is # (re)created at build time; if you use $(top_srcdir), you may (will?) # get empty $(AC_QT4_CFLAGS), $(AC_QT4_LIBS) and $(AC_QT4_MOC); -include $(top_builddir)/Makefile.inc # program(s) to be built in current dir bin_PROGRAMS = xcwcp # source code files used to build xcwcp program xcwcp_SOURCES = \ application.cc application.h \ moc_application.cc \ display.cc display.h \ main.cc \ modeset.cc modeset.h \ receiver.cc receiver.h\ sender.cc sender.h # target-specific preprocessor flags (#defs and include dirs) xcwcp_CPPFLAGS = $(AM_CPPFLAGS) $(AC_QT4_CFLAGS) # target-specific linker flags (objects to link) xcwcp_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(AC_QT4_LIBS) $(top_builddir)/src/cwutils/lib_xcwcp.a # copy man page to proper directory during installation man_MANS = xcwcp.1 # and mark it as distributable, too EXTRA_DIST = xcwcp.1 \ icons/icon_mini_xcwcp.xpm \ icons/icon_start.xpm \ icons/icon_stop.xpm # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = moc_application.cc # Qt4 magic # Previously the invocation of moc was: "$(AC_QT4_MOC) $< -o $@", but # because of failed build on FreeBSD I decided to replace the "$<" and # "$@" symbols with file names. moc_application.cc: application.h $(AC_QT4_MOC) application.h -o moc_application.cc # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -so ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -sa ) || \ ( echo "Retrying the test in silent mode"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -sc ) unixcw-3.4.2/src/xcwcp/main.cc0000644000175000017500000001257212536367734016054 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "application.h" #include "libcw.h" //#include "libcw_debug.h" #include "i18n.h" #include "cmdline.h" #include "cw_copyright.h" #include "dictionary.h" //extern cw_debug_t cw_debug_object; void xcwcp_atexit(void); namespace { cw_config_t *config = NULL; /* program-specific configuration */ bool generator = false; /* have we created a generator? */ std::string all_options = "s:|sound,d:|device," "w:|wpm,t:|tone,v:|volume," "g:|gap,k:|weighting," // "i:|infile,F:|outfile," // "T:|time," "h|help,V|version"; /** \brief Signal handler, called by the CW library after its own cleanup \param signal_number */ void signal_handler(int signal_number) { std::clog << _("Caught signal ") << signal_number << _(", exiting...") << std::endl; exit(EXIT_SUCCESS); } } // namespace /** Parse the command line, initialize a few things, then instantiate the Application and wait. */ int main(int argc, char **argv) { try { //cw_debug_set_flags(&cw_debug_object, CW_DEBUG_KEYING | CW_DEBUG_GENERATOR | CW_DEBUG_TONE_QUEUE | CW_DEBUG_RECEIVE_STATES | CW_DEBUG_KEYER_STATES | CW_DEBUG_INTERNAL| CW_DEBUG_PARAMETERS); //cw_debug_object.level = CW_DEBUG_DEBUG; atexit(xcwcp_atexit); /* Set locale and message catalogs. */ i18n_initialize(); /* Parse combined environment and command line arguments. */ int combined_argc; char **combined_argv; // Parse combined environment and command line arguments. Arguments // are passed to QApplication() first to allow it to extract any Qt // or X11 options. combine_arguments("XCWCP_OPTIONS", argc, argv, &combined_argc, &combined_argv); QApplication q_application (combined_argc, combined_argv); config = cw_config_new(cw_program_basename(argv[0])); if (!config) { return EXIT_FAILURE; } config->has_practice_time = 0; config->has_infile = false; if (!cw_process_argv(argc, argv, all_options.c_str(), config)) { fprintf(stderr, _("%s: failed to parse command line args\n"), config->program_name); return EXIT_FAILURE; } if (!cw_config_is_valid(config)) { fprintf(stderr, _("%s: inconsistent arguments\n"), config->program_name); return EXIT_FAILURE; } if (config->input_file) { if (!cw_dictionaries_read(config->input_file)) { fprintf(stderr, _("%s: %s\n"), config->program_name, strerror(errno)); fprintf(stderr, _("%s: can't load dictionary from input file %s\n"), config->program_name, config->input_file); return EXIT_FAILURE; } } if (config->output_file) { if (!cw_dictionaries_write(config->output_file)) { fprintf(stderr, _("%s: %s\n"), config->program_name, strerror(errno)); fprintf(stderr, _("%s: can't save dictionary to output file %s\n"), config->program_name, config->input_file); return EXIT_FAILURE; } } generator = cw_generator_new_from_config(config); if (!generator) { fprintf(stderr, "%s: failed to create generator\n", config->program_name); return EXIT_FAILURE; } cw_generator_start(); /* Set up signal handlers to clean up and exit on a range of signals. */ struct sigaction action; action.sa_handler = signal_handler; action.sa_flags = 0; sigemptyset(&action.sa_mask); static const int SIGNALS[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, 0 }; for (int i = 0; SIGNALS[i]; i++) { if (!cw_register_signal_handler(SIGNALS[i], signal_handler)) { perror("cw_register_signal_handler()"); return EXIT_FAILURE; } } // Display the application's windows. cw::Application *application = new cw::Application (); application->setWindowTitle(_("Xcwcp")); application->show(); q_application.connect(&q_application, SIGNAL (lastWindowClosed ()), &q_application, SLOT (quit ())); application->check_audio_system(config); // Enter the application event loop. int rv = q_application.exec(); return rv; } // Handle any exceptions thrown by the above. catch (std::bad_alloc) { std::clog << "Internal error: heap memory exhausted" << std::endl; return EXIT_FAILURE; } catch (...) { std::clog << "Internal error: unknown problem" << std::endl; return EXIT_FAILURE; } } void xcwcp_atexit(void) { if (generator) { cw_complete_reset(); cw_generator_stop(); cw_generator_delete(); } if (config) { cw_config_delete(&config); } return; } unixcw-3.4.2/src/xcwcp/receiver.cc0000644000175000017500000004062712475645774016743 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "config.h" #include #include #include #include #include #include "receiver.h" #include "display.h" #include "modeset.h" #include "libcw.h" #include "i18n.h" namespace cw { //----------------------------------------------------------------------- // Class Receiver //----------------------------------------------------------------------- // poll() // // Poll the CW library receive buffer for a complete character, and handle // anything found in it. void Receiver::poll(const Mode *current_mode) { if (!current_mode->is_receive()) { return; } // Report and clear any receiver errors noted when handling // the last libcw keyer event. if (libcw_receive_errno_ != 0) { poll_report_receive_error(); } // If we are awaiting a possible inter-word space, // poll that first, then go on to poll receive // characters; otherwise just poll receive characters. if (is_pending_inter_word_space_) { // This call directly asks receiver: "did you // record space after a character that is long // enough to treat it as end of word?". poll_receive_space(); // If we received a space, poll the next // possible receive character if (!is_pending_inter_word_space_) { poll_receive_character(); } } else { // Not awaiting a possible space, so just poll // the next possible receive character. poll_receive_character(); } return; } // handle_key_event() // // Specific handler for receive mode key events. Handles both press and // release events, but ignores autorepeat. void Receiver::handle_key_event(QKeyEvent *event, const Mode *current_mode, bool is_reverse_paddles) { if (!current_mode->is_receive()) { return; } //fprintf(stderr, "\n\n"); // If this is a key press that is not the first one of an // autorepeating key, ignore the event. This prevents // autorepeat from getting in the way of identifying the real // keyboard events we are after. if (event->isAutoRepeat()) { return; } if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { const int is_down = event->type() == QEvent::KeyPress; if (event->key() == Qt::Key_Space || event->key() == Qt::Key_Up || event->key() == Qt::Key_Down || event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { // These keys are obvious candidates for // "straight key" key. // Prepare timestamp for libcw on both "key // up" and "key down" events. There is no code // in libcw that would generate updated // consecutive timestamps for us (as it does // in case of iambic keyer). gettimeofday(&timer, NULL); //fprintf(stderr, "time on Skey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); cw_notify_straight_key_event(is_down); event->accept(); } else if (event->key() == Qt::Key_Left) { // Notice that keyboard keys that are // recognized as iambic keyer paddles, and // left/right mouse buttons that are also // treated as iambic keyer paddles, are // handled by basically the same code. I was // thinking about putting the common code in // function, but I didn't do it because of // performance (whether I'm right here or // wrong that's another thing). is_left_down = is_down; if (is_left_down && !is_right_down) { // Prepare timestamp for libcw, but // only for initial "paddle down" // event at the beginning of // character. Don't create the // timestamp for any successive // "paddle down" events inside a // character. // // In case of iambic keyer the // timestamps for every next // (non-initial) "paddle up" or // "paddle down" event in a character // will be created by libcw. gettimeofday(&timer, NULL); //fprintf(stderr, "time on Lkey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); } // Inform libcw about state of left paddle // regardless of state of the other paddle. is_reverse_paddles ? cw_notify_keyer_dash_paddle_event(is_down) : cw_notify_keyer_dot_paddle_event(is_down); event->accept(); } else if (event->key() == Qt::Key_Right) { is_right_down = is_down; if (is_right_down && !is_left_down) { // Prepare timestamp for libcw, but // only for initial "paddle down" // event at the beginning of // character. Don't create the // timestamp for any successive // "paddle down" events inside a // character. // // In case of iambic keyer the // timestamps for every next // (non-initial) "paddle up" or // "paddle down" event in a character // will be created by libcw. gettimeofday(&timer, NULL); //fprintf(stderr, "time on Rkey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); } // If this is the RightArrow key, use as the // other one of the paddles. // Inform libcw about state of left paddle // regardless of state of the other paddle. is_reverse_paddles ? cw_notify_keyer_dot_paddle_event(is_down) : cw_notify_keyer_dash_paddle_event(is_down); event->accept(); } else { // Some other, uninteresting key. Ignore it. ; } } return; } // handle_mouse_event() // // Specific handler for receive mode key events. Handles button press and // release events, folds doubleclick into press, and ignores mouse moves. void Receiver::handle_mouse_event(QMouseEvent *event, const Mode *current_mode, bool is_reverse_paddles) { if (!current_mode->is_receive()) { return; } //fprintf(stderr, "\n\n"); if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick || event->type() == QEvent::MouseButtonRelease) { const int is_down = event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick; // If this is the Middle button, use as a straight key. if (event->button() == Qt::MidButton) { // Prepare timestamp for libcw on both "key // up" and "key down" events. There is no code // in libcw that would generate updated // consecutive timestamps for us (as it does // in case of iambic keyer). gettimeofday(&timer, NULL); //fprintf(stderr, "time on Skey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); cw_notify_straight_key_event(is_down); event->accept(); } else if (event->button() == Qt::LeftButton) { // Notice that keyboard keys that are // recognized as iambic keyer paddles, and // left/right mouse buttons that are also // treated as iambic keyer paddles, are // handled by basically the same code. I was // thinking about putting the common code in // function, but I didn't do it because of // performance (whether I'm right here or // wrong that's another thing). is_left_down = is_down; if (is_left_down && !is_right_down) { // Prepare timestamp for libcw, but // only for initial "paddle down" // event at the beginning of // character. Don't create the // timestamp for any successive // "paddle down" events inside a // character. // // In case of iambic keyer the // timestamps for every next // (non-initial) "paddle up" or // "paddle down" event in a character // will be created by libcw. gettimeofday(&timer, NULL); //fprintf(stderr, "time on Lkey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); } // Inform libcw about state of left paddle // regardless of state of the other paddle. is_reverse_paddles ? cw_notify_keyer_dash_paddle_event(is_down) : cw_notify_keyer_dot_paddle_event(is_down); event->accept(); } else if (event->button() == Qt::RightButton) { is_right_down = is_down; if (is_right_down && !is_left_down) { // Prepare timestamp for libcw, but // only for initial "paddle down" // event at the beginning of // character. Don't create the // timestamp for any successive // "paddle down" events inside a // character. // // In case of iambic keyer the // timestamps for every next // (non-initial) "paddle up" or // "paddle down" event in a character // will be created by libcw. gettimeofday(&timer, NULL); //fprintf(stderr, "time on Rkey down: %10ld : %10ld\n", timer.tv_sec, timer.tv_usec); } // Inform libcw about state of right paddle // regardless of state of the other paddle. is_reverse_paddles ? cw_notify_keyer_dot_paddle_event(is_down) : cw_notify_keyer_dash_paddle_event(is_down); event->accept(); } else { // Some other mouse button, or mouse cursor // movement. Ignore it. ; } } return; } // handle_libcw_keying_event() // // Handler for the keying callback from the CW library indicating that the // keying state changed. The function handles the receive of keyed CW, // ignoring calls on non-receive modes. // // This function is called in signal handler context, and it takes care to // call only functions that are safe within that context. In particular, // it goes out of its way to deliver results by setting flags that are // later handled by receive polling. void Receiver::handle_libcw_keying_event(struct timeval *t, int key_state) { // Ignore calls where the key state matches our tracked key state. This // avoids possible problems where this event handler is redirected between // application instances; we might receive an end of tone without seeing // the start of tone. if (key_state == tracked_key_state_) { //fprintf(stderr, "tracked key state == %d\n", tracked_key_state_); return; } else { //fprintf(stderr, "tracked key state := %d\n", key_state); tracked_key_state_ = key_state; } // If this is a tone start and we're awaiting an inter-word // space, cancel that wait and clear the receive buffer. if (key_state && is_pending_inter_word_space_) { // Tell receiver to prepare (to make space) for // receiving new character. cw_clear_receive_buffer(); // The tone start means that we're seeing the next // incoming character within the same word, so no // inter-word space is possible at this point in // time. The space that we were observing/waiting for, // was just inter-character space. is_pending_inter_word_space_ = false; } //fprintf(stderr, "calling callback, stage 2\n"); // Pass tone state on to the library. For tone end, check to // see if the library has registered any receive error. if (key_state) { // Key down //fprintf(stderr, "start receive tone: %10ld . %10ld\n", t->tv_sec, t->tv_usec); if (!cw_start_receive_tone(t)) { perror("cw_start_receive_tone"); abort(); } } else { // Key up //fprintf(stderr, "end receive tone: %10ld . %10ld\n", t->tv_sec, t->tv_usec); if (!cw_end_receive_tone(t)) { // Handle receive error detected on tone end. For // ENOMEM and ENOENT we set the error in a class // flag, and display the appropriate message on the // next receive poll. switch (errno) { case EAGAIN: // libcw treated the tone as noise (it was // shorter than noise threshold). // No problem, not an error. break; case ENOMEM: case ENOENT: libcw_receive_errno_ = errno; cw_clear_receive_buffer(); break; default: perror("cw_end_receive_tone"); abort(); } } } return; } // clear() // // Clear the library receive buffer and our own flags. void Receiver::clear() { cw_clear_receive_buffer(); is_pending_inter_word_space_ = false; libcw_receive_errno_ = 0; tracked_key_state_ = FALSE; return; } // poll_report_receive_error() // // Handle any error registered when handling a libcw keying event. void Receiver::poll_report_receive_error() { // Handle any receive errors detected on tone end but delayed until here. display_->show_status(libcw_receive_errno_ == ENOENT ? _("Badly formed CW element") : _("Receive buffer overrun")); libcw_receive_errno_ = 0; return; } // poll_receive_character() // // Receive any new character from the CW library. void Receiver::poll_receive_character() { char c; // Don't use receiver.timer - it is used eclusively for // marking initial "key down" events. Use local throw-away // timer2. // // Additionally using reveiver.timer here would mess up time // intervals measured by receiver.timer, and that would // interfere with recognizing dots and dashes. struct timeval timer2; gettimeofday(&timer2, NULL); //fprintf(stderr, "poll_receive_char: %10ld : %10ld\n", timer2.tv_sec, timer2.tv_usec); if (cw_receive_character(&timer2, &c, NULL, NULL)) { // Receiver stores full, well formed // character. Display it. display_->append(c); // A full character has been received. Directly after // it comes a space. Eiter a short inter-character // space followed by another character (in this case // we won't display the inter-character space), or // longer inter-word space - this space we would like // to catch and display. // // Set a flag indicating that next poll may result in // inter-word space. is_pending_inter_word_space_ = true; // Update the status bar to show the character // received. Put the received char at the end of // string to avoid "jumping" of whole string when // width of glyph of received char changes at variable // font width. QString status = _("Received at %1 WPM: '%2'"); display_->show_status(status.arg(cw_get_receive_speed()).arg(c)); //fprintf(stderr, "Received character '%c'\n", c); } else { // Handle receive error detected on trying to read a character. switch (errno) { case EAGAIN: // Call made too early, receiver hasn't // received a full character yet. Try next time. break; case ERANGE: // Call made not in time, or not in proper // sequence. Receiver hasn't received any // character (yet). Try harder. break; case ENOENT: // Invalid character in receiver's buffer. { // New scope to avoid gcc 3.2.2 internal compiler error cw_clear_receive_buffer(); display_->append('?'); QString status = _("Unknown character received at %1 WPM"); display_->show_status(status.arg(cw_get_receive_speed())); } break; default: perror("cw_receive_character"); abort(); } } return; } // poll_receive_space() // // If we received a character on an earlier poll, check again to see if we // need to revise the decision about whether it is the end of a word too. void Receiver::poll_receive_space() { // Recheck the receive buffer for end of word. bool is_end_of_word; // We expect the receiver to contain a character, but we don't // ask for it this time. The receiver should also store // information about a post-character space. If it is longer // than a regular inter-character space, then the receiver // will treat it as inter-word space, and communicate it over // is_end_of_word. // Don't use receiver.timer - it is used eclusively for // marking initial "key down" events. Use local throw-away // timer2. struct timeval timer2; gettimeofday(&timer2, NULL); //fprintf(stderr, "poll_receive_space: %10ld : %10ld\n", timer2.tv_sec, timer2.tv_usec); cw_receive_character(&timer2, NULL, &is_end_of_word, NULL); if (is_end_of_word) { //fprintf(stderr, "End of word\n\n"); display_->append(' '); cw_clear_receive_buffer(); is_pending_inter_word_space_ = false; } else { // We don't reset is_pending_inter_word_space. The // space that currently lasts, and isn't long enough // to be considered inter-word space, may grow to // become the inter-word space. Or not. // // This growing of inter-character space into // inter-word space may be terminated by incoming next // tone (key down event) - the tone will mark // beginning of new character within the same // word. And since a new character begins, the flag // will be reset (elsewhere). } return; } } // cw namespace unixcw-3.4.2/src/xcwcp/modeset.cc0000644000175000017500000001074112475645774016571 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "modeset.h" #include "dictionary.h" namespace cw { //----------------------------------------------------------------------- // Class Mode //----------------------------------------------------------------------- // is_same_type_as() // // Return true if the mode passed in has the same type (dictionary, keyboard, // or receive) as this mode. bool Mode::is_same_type_as(const Mode *other) const { return (is_dictionary() && other->is_dictionary()) || (is_keyboard() && other->is_keyboard()) || (is_receive() && other->is_receive()); } // get_random_word_group() // // Return a string composed of an appropriately sized group of random elements // from the contained dictionary. std::string DictionaryMode::get_random_word_group() const { std::string random_group; const int group_size = cw_dictionary_get_group_size(dictionary_); random_group.resize(group_size); for (int group = 0; group < group_size; group++) { const char *element = cw_dictionary_get_random_word(dictionary_); random_group += element; } return random_group; } //----------------------------------------------------------------------- // Class ModeSetHelper //----------------------------------------------------------------------- // Collects and aggregates operating modes, constructing from all known // dictionaries, then adding any local modes. This is a singleton class, // constrained to precisely one instance, as a helper for ModeSet. class ModeSetHelper { public: static const std::vector *get_modes(); private: ModeSetHelper(); ~ModeSetHelper(); std::vector modes_; // Prevent unwanted operations. ModeSetHelper (const ModeSetHelper &); ModeSetHelper &operator= (const ModeSetHelper &); }; // ModeSetHelper() // // Initialize a mode set with dictionary and locally defined modes. ModeSetHelper::ModeSetHelper() { // Start the modes with the known dictionaries. for (const cw_dictionary_t *dict = cw_dictionaries_iterate (NULL); dict; dict = cw_dictionaries_iterate(dict)) { const std::string description = cw_dictionary_get_description(dict); modes_.push_back(new DictionaryMode(description, dict)); } // Add keyboard send and keyer receive. modes_.push_back(new KeyboardMode("Send Keyboard CW")); modes_.push_back(new ReceiveMode("Receive Keyed CW")); return; } // ~ModeSetHelper() // // Delete all heap allocated modes in the modes array, and clear the array. ModeSetHelper::~ModeSetHelper() { for (unsigned int i = 0; i < modes_.size(); i++) { delete modes_[i]; } modes_.clear(); return; } // get_modes() // // Instantiate the singleton instance of ModeSetHelper and return the Modes // aggregated in this ModeSetHelper. const std::vector *ModeSetHelper::get_modes() { static const ModeSetHelper *instance = NULL; if (!instance) { instance = new ModeSetHelper (); } return &instance->modes_; } //----------------------------------------------------------------------- // Class ModeSet //----------------------------------------------------------------------- // // ModeSet() // // Set up the modes_ array to contain the singleton-created modes vector, // and initialize the current mode to the first. ModeSet::ModeSet() : modes_ (ModeSetHelper::get_modes()), current_ (modes_->at(0)) { } // is_dictionary() // is_keyboard() // is_receive() // // Convenience type identification functions for the current mode. const DictionaryMode *ModeSet::is_dictionary() const { return current_->is_dictionary(); } const KeyboardMode *ModeSet::is_keyboard() const { return current_->is_keyboard(); } const ReceiveMode *ModeSet::is_receive() const { return current_->is_receive(); } } // cw namespace unixcw-3.4.2/src/xcwcp/xcwcp.10000644000175000017500000004035512536122041016003 0ustar acerionacerion.\" .\" UnixCW CW Tutor Package - xcwcp .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH XCWCP 1 "CW Tutor Package" "xcwcp ver. 3.4.2" \" -*- nroff -*- .SH NAME .\" xcwcp \- X Window-based Morse tutor program .\" .\" .\" .SH SYNOPSIS .\" .B xcwcp [\-s\ \-\-system=\fISYSTEM\fP] [\-d\ \-\-device=\fIDEVICE\fP] [\-w\ \-\-wpm=\fIWPM\fP] [\-t\ \-\-tone=\fIHZ\fP] [\-v\ \-\-volume=\fIPERCENT\fP] [\-g\ \-\-gap=\fIGAP\fP] [\-f, \-\-infile=\fIFILE\fP] [\-F, \-\-outifile=\fIFILE\fP] .BR [\-h\ \-\-help] [\-V\ \-\-version] .PP \fBxcwcp\fP installed on GNU/Linux systems understands both short form and long form command line options. \fBxcwcp\fP installed on other operating systems may understand only the short form options. .PP There are no mandatory options. .PP Options may be predefined in the environment variable \fBXCWCP_OPTIONS\fP. If defined, these options are used first; command line options take precedence. .PP .\" .\" .\" .SH DESCRIPTION .\" .PP .B xcwcp is a X Window-based interactive Morse code tutor program. It lets you choose from a number of options for practice, including sending random characters, random words, and characters from the keyboard. It will also receive Morse code that you send using the keyboard or mouse as a Morse keyer, and display the characters it sees. .PP .\" .\" .\" .SS COMMAND LINE OPTIONS .\" .B xcwcp understands the following command line options. The long form options may not be available in non-LINUX versions. .TP .I "\-s, \-\-system=SYSTEM" Specifies the way that \fBxcwcp\fP generates tones. Valid values are: \fIconsole\fP for tones through the console speaker, \fIalsa\fP for tones generated through the system sound card using ALSA sound system, \fIoss\fP for tones generated through system sound card using OSS sound system, \fIsoundcard\fP for tones generated through the system sound card, but without explicit selection of sound system. These values can be shortened to 'c', 'a', 'o', or 's', respectively. The default value is 'oss'. .TP .I "\-d, \-\-device=DEVICE" Specifies the device file to open for generating a sound. \fBxcwcp\fP will use default device if none is specified. The default devices are: \fI/dev/console\fP for sound produced through console, \fIdefault\fP for ALSA sound system, \fI/dev/audio\fP for OSS sound system. See also \fINOTES ON USING A SOUND CARD\fP below. .TP .I "\-w, \-\-wpm=WPM" Sets the initial sending speed in words per minute. The value must be between 4 and 60. The default value is 12 WPM. .TP .I "\-t, \-\-tone=HZ" Sets the initial sounder pitch in Hz. This value must be between 0 and 4,000. A value of 0 selects silent operation, and can be used for timing checks or other testing. The default value is 800Hz, .TP .I "\-v, \-\-volume=PERCENT" Sets the initial sending volume, as a percentage of full scale volume. The value must be between 0 and 100. The default value is 70 %. Sound volumes work fully for sound card tones, but \fBxcwcp\fP cannot control the volume of tones from the console speaker. In this case, a volume of zero is silent, and all other volume values are simply sounded. .TP .I "\-g, \-\-gap=GAP" Sets the initial extra gap, in dot lengths, between characters (the 'Farnsworth' delay). It must be between 0 and 60. The default is 0. .TP .I "\-f, \-\-infile=FILE" Specifies a text file that \fBxcwcp\fP can read to configure its practice text. See \fICREATING CONFIGURATION FILES\fP below. .TP .I "\-F, \-\-outfile=FILE" Specifies a text file to which \fBxcwcp\fP should write its current practice text. .PP .\" .\" .\" .SS USER INTERFACE .\" .B xcwcp offers GUI controls for changing the speed, tone frequency, 'Farnsworth' gap, and mode of the program. All of the major controls are placed on the application toolbar. .PP The main GUI window is used to display the characters that \fBxcwcp\fP sends or receives. .PP To find out more about what a particular GUI control does, use the "What's this..." icon (the '?' at the far right of the toolbar). .PP .\" .\" .\" .SS RANDOM CHARACTERS AND WORDS .\" .B xcwcp sends random characters in groups of five, with a space between each group. .PP When sending random words, \fBxcwcp\fP sends the complete word, followed by a space. Because short words are easier to copy without writing, \fBxcwcp\fP's default dictionary contains only three, four, and five-letter words in its random words list. .PP .B xcwcp chooses at random from a list of around 3000 words in its default dictionary. You can change this text using a configuration file, read at startup. See \fICREATING CONFIGURATION FILES\fP below. .PP .\" .\" .\" .SS RECEIVING MORSE .\" .B xcwcp can receive Morse code, and display it in its main GUI window. To key Morse code into the program, select the Receive Keyed CW mode, and press the stop/start button. Now, place the mouse cursor over the central window of the program. By pressing the middle mouse button, you should be able to key Morse into the program as if the mouse button was a straight Morse key. .PP For better keying, you can use the left and right mouse buttons as if they were paddles on an Iambic keyer. This will send Morse code at the exact rate set on the Speed control. .PP You can also use the keyboard for keying. In this case, any of the Up or Down cursor keys, Space, Enter, or Return may be used as the straight key, and the Left and Right cursor keys act as the two paddles of an Iambic keyer. .PP By default, \fBxcwcp\fP will try to follow the speed of the Morse code that you send to it. It is possible to switch this tracking off, in which case the program switches to receiving only at the exact speed set on the Speed control. However, fixed speed receiving is very, very picky about receiving only extremely accurately timed Morse code, so unless you are striving for complete perfection, you may find that speed tracking is more comfortable. .PP The speed tracking in \fBxcwcp\fP can sometime be confused by very wide and abrupt changes in speed. If it is having difficulty finding the speed you are sending at, you can use the File pulldown menu to synchronize the receive speed to the speed set on the Speed control. .PP At any time, the mode selection combowidget can get focus by using Alt+M. You can then use the space bar or the up/down keys to change the mode. The Tab key moves to the next widget, so you can change speed, etc. Shift+Tab moves backwards. .PP .\" .\" .\" .SS NOTES ON USING A SOUND CARD .\" By default, \fBxcwcp\fP tries to open OSS device "/dev/audio" to access the system sound card. This is generally the correct device to use, but for systems with special requirements, or those with multiple sound cards, the option \fI-d\fP or \fI\-\-device\fP, combined with \fI-s\fP or \fI\-\-system\fP can be used to specify the device and audio system for sound card access. If the sound card device cannot be set up, \fBxcwcp\fP prints the error message .IP cannot set up soundcard sound .PP and exits. .PP Sound card devices, when opened through OSS sound system, are usually single-access devices, so that when one process has opened the device, other processes are prevented from using it. In such cases \fBxcwcp\fP will of course conflict with any other programs that expect exclusive use of the system sound card (for example, MP3 players). If \fBxcwcp\fP finds that the sound card is already busy, it prints the error message .IP open /dev/audio: Device or resource busy .PP and exits. .PP .\" The main sound card device will often allow \fBxcwcp\fP to control tone .\" volumes directly, but where this is not possible, \fBxcwcp\fP uses the .\" mixer device instead. By default, this is "/dev/mixer", but the device .\" can be specified with the \fI-y\fP or \fI\-\-mdevice\fP options. In .\" general, as with the main sound card device, the default mixer device .\" is usually the correct one to use. .\" .PP .\" The mixer device is only used if the sound card does not allow volume .\" control through the main sound card device. .PP The sound card device is not used if \fBxcwcp\fP is only sending tones on the console speaker. .PP .\" .\" .\" .SS AUDIO OUTPUT \- DEFAULTS AND SELECTION .\" \fBxcwcp\fP first tries to access sound card using PulseAudio sound system, using default device name, unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP \fBxcwcp\fP then tries to access sound card using OSS audio system and default OSS audio device name ('/dev/audio'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through OSS fails, \fBxcwcp\fP tries to access the sound card using ALSA audio system, and default ALSA audio device name ('default'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through ALSA also fails, \fBxcwcp\fP tries to access system console buzzer using default buzzer device '/dev/console', unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP It is very common that in order to access the console buzzer device user has to have root privileges. For that reason trying to open console buzzer almost always fails. This is not a program's bug, this is a result of operating system's restrictions. Making \fBxcwcp\fP an suid binary bypasses this restriction. The program does not fork() or exec(), so making it suid should be relatively safe. Note however that this practice is discouraged for security reasons. .PP As stated, user can tell \fBxcwcp\fP which device to use, using \fI-d\fP or \fI\-\-device\fP option. Which device files are suitable will depend on which operating system is running, which system user ID runs \fBxcwcp\fP, and which user groups user belongs to. .PP .\" .\" .\" .SS CREATING CONFIGURATION FILES .\" .B xcwcp contains a default set of modes and practice text that should be enough to begin with. It can however read in a file at startup that reconfigures these to provide different character groupings, word sets, and other practice data. .PP To read a configuration file, use the \fI-i\fP or \fI\-\-infile\fP command line option. The file should introduce each \fBxcwcp\fP mode with a section header in '[' ... ']' characters, followed by the practice text for that mode, with elements separated by whitespace. Lines starting with a semicolon or hash are treated as comments. For example .IP ; Simple example mode .br [ A to Z ] .br A B C D E F G H I J K L M N O P Q R S T U V W X Y Z .PP .B xcwcp will generate five character groups for modes whose elements are all single characters, and treat other modes as having elements that are complete words. As a starting point for customized modes, \fBxcwcp\fP will write its default configuration to a file if given the undocumented \fI-#\fP option, for example "xcwcp -# /tmp/xcwcp.ini". .\" .\" .\" .SH NOTES .\" .B xcwcp is an X Window rewrite of \fBcwcp\fP. Both programs borrow heavily from the the DOS Morse code tutor CP222C.EXE, by VU2ZAP. .PP The characters echoed in the main GUI window may be ASCII equivalents of Morse procedural signals; see the \fBcw\fP(7,LOCAL) man page for details. .\" .\" .\" .SS HINTS ON LEARNING MORSE CODE .\" Here are a few hints and tips that may help with the process of learning Morse code. .PP Firstly, do \fBNOT\fP think of the elements as dots and dashes. Instead, think of them as dits and dahs (so 'A' is di-dah). If you think of them in this way, the process of translating sound into characters will be learned much more easily. .PP Do not learn the characters from a table. Learn them by watching the groups appear on the screen, and listening to the sounds produced as each is sent. In the very initial stages, it may be beneficial if you can find a person to take you through the first stages of recognising characters. .PP Do not waste your time learning Morse code at 5 WPM. Set the speed to 12 or 15 WPM, but use extra spacing (the Gap window) to reduce the effective speed to much lower - around four or five WPM \fIeffective\fP speed. This way, you will learn the rhythm of the characters as they are sent, but still have plenty of time between characters. As you practice, decrease the gap to zero. .PP Learn in stages. Start by learning the \fIEISH5\fP group, then progress down through the menu as each group is mastered. The groups contain characters which are in some way related, either by sound, or by type of character. .PP Once you have completed all the groups \fIEISH5\fP to \fI,?.;)/\fP (or \fI23789\fP if you do not want to learn procedural signals yet), use the full character set options, and the words and CW words options, to sharpen your skill. If you have difficulties with particular characters, return to that group and practice again with a smaller character set. .PP Resist the temptation to try to learn or improve your speed by copying off-air. You will not know what speed you are working at, and much hand-sent Morse is not perfectly formed. What you can gain off-air though is a general 'resilience', a tolerance for Morse code where the timing of individual elements, or spacing between characters and words, is not 100% accurate. .PP If working to attain a particular speed for a test, always set the speed slightly higher. For example, if aiming for 12 WPM, set the tutor speed to 14 or 15 WPM. This way, when you drop back to 12 WPM you will feel much more relaxed about copying. Be aware that \fBxcwcp\fP is not necessarily going to send at exactly the speed you set, due to limitations in what can be done with UNIX timers. It often sends at a slower speed than you set, so be very careful with this if you have a target speed that you need to reach. .PP Use the program to make cassette tapes that you can take with you in a walkman or in the car, for long journeys. You do not have to write down everything you hear to practice Morse code. Simply listening to the shapes of characters over a period will help to train your brain into effortless recognition. In fact, slavishly writing everything down becomes a barrier at speeds of 15-20 WPM and above, so if you can begin to copy without writing each character down, you will find progress much easier above these speeds. But do not over-use these tapes, otherwise you will quickly memorise them. Re-record them with new contents at very regular intervals. .PP Try to spend at least 15-30 minutes each day practicing. Much less than this will make progress glacially slow. But significantly more than an hour or so may just result in you becoming tired, but not improving. Recognise when it is time to stop for the day. .PP Do not worry if you reach a speed 'plateau'. This is common, and you will soon pass it with a little perseverance. .PP At higher speeds, CW operators tend to recognise the 'shape' of whole words, rather than the individual characters within the words. The CW words menu option can be used to help to practice and develop this skill. .PP Neither the mouse buttons nor the keyboard are ideal for use a keys or keyer paddles, for sending practice. Try to use a proper key for sending where possible. It is hard even for experienced operators to get good keying using the mouse or keyboard. Of the two, the mouse is probably the better option, though, in a pinch. .PP .\" .\" .\" .SH ERRORS AND OMISSIONS .\" The calibration option is a bit ropy. It simply sends PARIS repeatedly, and relies on you to time the sending and then work out if any adjustment to the speed is really necessary. Automatic calibration by making measurements over a given period would be a lot better. .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBcw\fP(7,LOCAL), \fBlibcw\fP(3,LOCAL), \fBcw\fP(1,LOCAL), \fBcwgen\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/xcwcp/application.h0000644000175000017500000001134512451007623017252 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #ifndef _XCWCP_APPLICATION_H #define _XCWCP_APPLICATION_H #include #include #include #include #include #include #include "modeset.h" #include "cw_common.h" //----------------------------------------------------------------------- // Class Application //----------------------------------------------------------------------- // Encapsulates the outermost Xcwcp Qt application. Defines slots and // signals, as well as the usual class information. namespace cw { class Display; class Sender; class Receiver; class Application : public QMainWindow { Q_OBJECT public: Application(); // Handle key press and mouse button press events void key_event(QKeyEvent *event); void mouse_event(QMouseEvent *event); void check_audio_system(cw_config_t *config); protected: void closeEvent (QCloseEvent *event); private slots: // Qt widget library callback functions. void about(); void startstop(); void start(); void stop(); void new_instance(); void clear(); void sync_speed(); void speed_change(); void frequency_change(); void volume_change(); void gap_change(); void mode_change(); void curtis_mode_b_change(); void adaptive_receive_change(); void fonts(); void colors(); void toggle_toolbar(void); void poll_timer_event(); private: // Class variable to enable sharing of the libcw across instances. Set to // the 'this' of the CW user instance, or NULL if no current user. static Application *libcw_user_application_instance; QPixmap xcwcp_icon; bool play_; QPixmap start_icon; QPixmap stop_icon; // GUI elements used throughout the class. QToolBar *toolbar; // main toolbar QToolButton *startstop_button_; QAction *startstop_; // Shared between toolbar and Progam menu QComboBox *mode_combo_; QSpinBox *speed_spin_; QSpinBox *frequency_spin_; QSpinBox *volume_spin_; QSpinBox *gap_spin_; QMenu *program_menu_; QAction *new_window_; QAction *clear_display_; QAction *sync_speed_; QAction *close_; QAction *quit_; QMenu *settings_; QAction *reverse_paddles_; QAction *curtis_mode_b_; QAction *adaptive_receive_; QAction *font_settings_; QAction *color_settings_; QAction *toolbar_visibility_; QMenu *help_; QAction *about_; Display *display_; int file_synchronize_speed_id_; int file_start_id_; int file_stop_id_; // Set of modes used by the application; initialized from dictionaries, with // keyboard and receive modes added. ModeSet modeset_; // Sender and receiver. Sender *sender_; Receiver *receiver_; // Poll timer, used to ensure that all of the application processing can // be handled in the foreground, rather than in the signal handling context // of a libcw tone queue low callback. QTimer *poll_timer_; // Flag indicating if this instance is currently using the libcw. Of // course xcwcp is an application that links to libcw, but this flag // is for *active* use of libcw, i.e when "play"/"start" button in // xcwcp's UI has been pressed. bool is_using_libcw_; // Saved receive speed, used to reinstate adaptive tracked speed on start. int saved_receive_speed_; // Keying callback function for libcw. There is a static version for // the whole class, and an instance version for each object. The class // version calls the relevant instance version, based on which instance is // the current registered libcw user. static void libcw_keying_event_static (void *, int key_state); void libcw_keying_event (int key_state); // Wrappers for creating UI. void make_central_widget(void); void make_toolbar(void); void make_mode_combo(void); void make_program_menu(void); void make_settings_menu(void); void make_help_menu(void); void make_auxiliaries_begin(void); void make_auxiliaries_end(void); // Prevent unwanted operations. Application (const Application &); Application &operator= (const Application &); }; } // cw namespace #endif // _XCWCP_APPLICATION_H unixcw-3.4.2/src/xcwcp/application.cc0000644000175000017500000006623612475645774017446 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "icons/icon_start.xpm" #include "icons/icon_stop.xpm" #include "icons/icon_mini_xcwcp.xpm" #include "application.h" #include "sender.h" #include "receiver.h" #include "display.h" #include "modeset.h" #include "cw_common.h" #include "libcw.h" #include "i18n.h" #include "cw_copyright.h" namespace cw { //----------------------------------------------------------------------- // Module variables, miscellaneous other stuff //----------------------------------------------------------------------- // Strings displayed in 'about' dialog. const QString ABOUT_CAPTION = QString(_("Xcwcp version ")) + PACKAGE_VERSION; const QString ABOUT_TEXT = QString(_("Xcwcp version ")) + PACKAGE_VERSION + "\n" + CW_COPYRIGHT; // Strings for whats-this dialogs. const QString STARTSTOP_WHATSTHIS = _("When this button shows , click it to begin " "sending or receiving. Only one window may send at a time.

" "When the button shows , click it to finish " "sending or receiving.\n\n"); const QString MODE_WHATSTHIS = _("This allows you to change what Xcwcp does. Most of the available " "selections will probably generate random CW characters of one form or " "another.

" "The exceptions are Send Keyboard CW, which sends the characters " "that you type at the keyboard, and Receive Keyed CW, which will " "decode CW that you key in using the mouse or keyboard.

" "To key CW into Xcwcp for receive mode, use either the mouse or the " "keyboard. On the mouse, the left and right buttons form an Iambic " "keyer, and the middle mouse button works as a straight key.

" "On the keyboard, use the Left and Right cursor keys for Iambic keyer " "control, and the Up or Down cursor keys, or the Space, Enter, or " "Return keys, as a straight key."); const QString SPEED_WHATSTHIS = _("This controls the CW sending speed. If you deselect adaptive " "receive speed, it also controls the CW receiving speed."); const QString FREQUENCY_WHATSTHIS = _("This sets the frequency of the CW tone on the system sound card " "or console.

" "It affects both sent CW and receive sidetone."); const QString VOLUME_WHATSTHIS = _("This sets the volume of the CW tone on the system sound card. " "It is not possible to control console sound volume, so in this " "case, all values other than zero produce tones.

" "The volume control affects both sent CW and receive sidetone."); const QString GAP_WHATSTHIS = _("This sets the \"Farnsworth\" gap used in sending CW. This gap is an " "extra number of dit-length silences between CW characters."); //----------------------------------------------------------------------- // Static variables, constructor //----------------------------------------------------------------------- // A pointer to the class currently actively using the CW library. As there // is only one CW library, we need to make sure that only a single Xcwcp // instance is using it at any one time. When NULL, no instance is currently // using the library. Application *Application::libcw_user_application_instance = NULL; // Application() // // Class constructor. Creates the application main window an GUI frame, and // registers everything we need to register to get the application up and // running. Application::Application() : QMainWindow (0) { make_auxiliaries_begin(); QMainWindow::setAttribute(Qt::WA_DeleteOnClose, true); QMainWindow::setWindowTitle(_("Xcwcp")); QMainWindow::setWindowIcon(xcwcp_icon); QMainWindow::resize(800, 400); make_toolbar(); make_program_menu(); make_settings_menu(); make_help_menu(); make_central_widget(); make_auxiliaries_end(); return; } //----------------------------------------------------------------------- // Libcw keying event callback //----------------------------------------------------------------------- // libcw_keying_event_static() // // This is the class-level handler for the keying callback from the CW // library indicating that the keying state changed. This function uses the // libcw_user_application_instance static variable to determine which class // instance 'owns' the CW library at the moment (if any), then calls that // instance's receiver handler function. // // This function is called in signal handler context. void Application::libcw_keying_event_static(void *arg, int key_state) { const Application *app = libcw_user_application_instance; // Notify the receiver of a libcw keying event only if there // is a user instance that is actively using the library and // in receive mode. The receiver handler function cannot // determine this for itself. if (app && app->is_using_libcw_ && app->modeset_.is_receive()) { //fprintf(stderr, "calling callback, stage 1 (key = %d)\n", key_state); struct timeval *t = (struct timeval *) arg; app->receiver_->handle_libcw_keying_event(t, key_state); } return; } //----------------------------------------------------------------------- // Qt event and slot handlers //----------------------------------------------------------------------- // about() // // Pop up a brief dialog about the application. void Application::about() { QMessageBox::about(0, ABOUT_CAPTION, ABOUT_TEXT); return; } // closeEvent() // // Event handler for window close. Requests a confirmation if we happen to // be busy sending. void Application::closeEvent(QCloseEvent *event) { bool is_closing = true; if (is_using_libcw_) { is_closing = QMessageBox::warning(this, _("Xcwcp"), _("Busy - are you sure?"), _("&Exit"), _("&Cancel"), 0, 0, 1) == 0; if (is_closing) { stop(); } } is_closing ? event->accept() : event->ignore(); return; } // startstop() // // Call start or stop depending on the current toggle state of the toolbar // button that calls this slot. void Application::startstop() { play_ ? stop() : start(); return; } // start() // // Start sending or receiving CW. void Application::start() { if (is_using_libcw_) { // Already playing, nothing to do. return; } // If the CW library is in use by another instance, let the user stop // that one and let this one continue. if (libcw_user_application_instance) { const bool is_stop = QMessageBox::warning(this, _("Xcwcp"), _("Another Xcwcp window is busy."), _("&Stop Other"), _("&Cancel"), 0, 0, 1) == 0; if (is_stop) { libcw_user_application_instance->stop(); } else { // Restore button's proper visual appearance // after it has been pressed, but user hasn't // confirmed starting playing in this instance. //this->startstop_button_->setDown(false); return; } } is_using_libcw_ = true; // Acquire the CW library sender. libcw_user_application_instance = this; // Synchronize the CW sender to our values of speed/tone/gap, and Curtis // mode B. We need to do this here since updates to the GUI widgets are // ignored if we aren't in fact active; this permits multiple instances // of the class to interoperate with the CW library. Sort of. We can // do it by just calling the slots for the GUI widgets directly. speed_change(); frequency_change(); volume_change(); gap_change(); curtis_mode_b_change(); cw_start_beep(); // Call the adaptive receive change callback to synchronize the CW // library with this instance's idea of receive tracking and speed. adaptive_receive_change(); // Clear the sender and receiver. sender_->clear(); receiver_->clear(); // Accessing proper action through this->startstop_ // should also work. QAction *action = startstop_button_->defaultAction(); action->setChecked(true); action->setIcon(stop_icon); action->setText(_("Stop")); action->setToolTip(_("Stop")); //startstop_button_->setDown(true); play_ = true; display_->clear_status(); // Start the poll timer. At 60WPM, a dot is 20ms, so polling for the // maximum library speed needs a 10ms timeout. poll_timer_->setSingleShot(false); poll_timer_->start(10); return; } // stop() // // Empty the buffer of characters awaiting send, and halt the process of // refilling the buffer. void Application::stop() { if (!is_using_libcw_) { // Not playing at the moment, nothing to do return; } is_using_libcw_ = false; // Stop the poll timer, and clear the sender and receiver. poll_timer_->stop(); sender_->clear(); receiver_->clear(); // Save the receive speed, for restore on next start. saved_receive_speed_ = cw_get_receive_speed(); cw_end_beep(); // Done with the CW library sender for now. libcw_user_application_instance = NULL; // Accessing proper action through this->startstop_ // should also work. QAction *action = startstop_button_->defaultAction(); action->setChecked(false); action->setIcon(start_icon); action->setText(_("Start")); action->setToolTip(_("Start")); //startstop_button_->setDown(false); play_ = false; display_->show_status(_("Ready")); return; } // new_instance() // // Creates a new instance of the Xcwcp application. void Application::new_instance() { Application *app = new Application(); //app->setCaption (_("Xcwcp")); app->show(); return; } // clear() // // Clears the display window of this Xcwcp instance. void Application::clear() { display_->clear(); return; } // sync_speed() // // Forces the tracked receive speed into synchronization with the speed // spin box if adaptive receive is activated. void Application::sync_speed() { if (is_using_libcw_) { if (adaptive_receive_->isChecked()) { // Force by unsetting adaptive receive, // setting the receive speed, then resetting // adaptive receive again. cw_disable_adaptive_receive(); if (!cw_set_receive_speed(speed_spin_->value())) { perror("cw_set_receive_speed"); abort(); } cw_enable_adaptive_receive(); } } return; } // speed_change() // frequency_change() // volume_change() // gap_change() // // Handle changes in the spin boxes for these CW parameters. The only action // necessary is to write the new values out to the CW library. The one thing // we do do is to only change parameters when we are active (i.e. have // control of the CW library). void Application::speed_change() { if (is_using_libcw_) { if (!cw_set_send_speed(speed_spin_->value())) { perror("cw_set_send_speed"); abort(); } if (!cw_get_adaptive_receive_state()) { if (!cw_set_receive_speed(speed_spin_->value())) { perror("cw_set_receive_speed"); abort(); } } } return; } void Application::frequency_change() { if (is_using_libcw_) { if (!cw_set_frequency(frequency_spin_->value())) { perror("cw_set_frequency"); abort(); } } return; } void Application::volume_change() { if (is_using_libcw_) { if (!cw_set_volume(volume_spin_->value())) { perror("cw_set_volume"); abort(); } } return; } void Application::gap_change() { if (is_using_libcw_) { if (!cw_set_gap(gap_spin_->value())) { perror("cw_set_gap"); abort(); } } return; } // mode_change() // // Handle a change of mode. Synchronize mode and receive speed if moving to // a receive mode, then clear the sender and receiver and any pending tones. void Application::mode_change() { // Get the mode to which mode we're changing. const Mode *new_mode = modeset_.get(mode_combo_->currentIndex()); // If this changes mode type, set the speed synchronization // menu item state to enabled for receive mode, disabled // otherwise. And for tidiness, clear the display. if (!new_mode->is_same_type_as(modeset_.get_current())) { sync_speed_->setEnabled(new_mode->is_receive()); display_->clear(); } // If the mode changed while we're busy, clear the sender and receiver. if (is_using_libcw_) { sender_->clear(); receiver_->clear(); } // Keep the ModeSet synchronized to mode_combo changes. modeset_.set_current(mode_combo_->currentIndex()); return; } // curtis_mode_b_change() // // Called whenever the user request a change of Curtis iambic mode. The // function simply passes the Curtis mode on to the CW library if active, // and ignores the call if not. void Application::curtis_mode_b_change() { if (is_using_libcw_) { curtis_mode_b_->isChecked() ? cw_enable_iambic_curtis_mode_b() : cw_disable_iambic_curtis_mode_b(); } return; } // adaptive_receive_change() // // Called whenever the user request a change of adaptive receive status. The // function passes the new receive speed tracking mode on to the CW library if // active, and if fixed speed receive is set, also sets the hard receive speed // to equal the send speed, otherwise, it restores the previous tracked receive // speed. void Application::adaptive_receive_change() { if (is_using_libcw_) { if (adaptive_receive_->isChecked()) { // If going to adaptive receive, first set the // speed to the saved receive speed, then turn // on adaptive receiving. cw_disable_adaptive_receive(); if (!cw_set_receive_speed(saved_receive_speed_)) { perror("cw_set_receive_speed"); abort (); } cw_enable_adaptive_receive(); } else { // If going to fixed receive, save the current // adaptive receive speed so we can restore it // later, then turn off adaptive receive, and // set the speed to equal the send speed as // shown on the speed spin box. saved_receive_speed_ = cw_get_receive_speed(); cw_disable_adaptive_receive(); if (!cw_set_receive_speed(speed_spin_->value())) { perror("cw_set_receive_speed"); abort(); } } } return; } // fonts() // // Use a font dialog to allow selection of display font. void Application::fonts() { bool status; QFont font = QFontDialog::getFont(&status, this); if (status) { QWidget *display_widget = display_->get_widget(); display_widget->setFont(font); } return; } // colors() // // Use a color dialog to allow selection of display color. void Application::colors() { QColor color = QColorDialog::getColor(); if (color.isValid()) { QWidget *display_widget = display_->get_widget(); QPalette palette; palette.setColor(QPalette::Text, color); // display_widget->setAutoFillForeground(true); display_widget->setPalette(palette); } return; } //----------------------------------------------------------------------- // Timer, keyboard and mouse events //----------------------------------------------------------------------- // poll_timer_event() // // Handle a timer event from the QTimer we set up on initialization. This // timer is used for regular polling for sender tone queue low and completed // receive characters. void Application::poll_timer_event() { if (is_using_libcw_) { sender_->poll(modeset_.get_current()); receiver_->poll(modeset_.get_current()); } return; } // key_event() // // Handle a key press event from the display widget. void Application::key_event(QKeyEvent *event) { event->ignore(); // Special case Alt-M as a way to acquire focus in the mode // combo widget. This was a workaround applied to earlier // releases, no longer required now that events are propagated // correctly to the parent. //if (event->state () & AltButton && event->key () == Qt::Key_M) // { // mode_combo_->setFocus (); // event->accept (); // return; // } // Pass the key event to the sender and the receiver. if (is_using_libcw_) { sender_->handle_key_event(event, modeset_.get_current()); receiver_->handle_key_event(event, modeset_.get_current(), reverse_paddles_->isChecked()); } return; } // mouse_event() // // Handle a mouse event from the display widget. void Application::mouse_event(QMouseEvent *event) { event->ignore(); // Pass the mouse event to the receiver. The sender isn't interested. if (is_using_libcw_) { receiver_->handle_mouse_event(event, modeset_.get_current(), reverse_paddles_->isChecked()); } return; } void Application::toggle_toolbar(void) { if (toolbar->isVisible()) { toolbar->hide(); toolbar_visibility_->setText("Show Toolbar"); } else { toolbar->show(); toolbar_visibility_->setText("Hide Toolbar"); } return; } void Application::make_toolbar(void) { toolbar = QMainWindow::addToolBar(_("Xcwcp Operations")); startstop_ = new QAction(_("Start/Stop"), this); startstop_->setIcon(start_icon); startstop_->setText(_("Start")); startstop_->setToolTip(_("Start")); startstop_->setWhatsThis(STARTSTOP_WHATSTHIS); startstop_->setCheckable(false); connect(startstop_, SIGNAL (triggered(bool)), this, SLOT (startstop())); // Put a button in the toolbar, not the action. // Button can gain focus through Tab key, whereas // action can't. The focus for button is, for some reason, // invisible, but it's there. startstop_button_ = new QToolButton(toolbar); startstop_button_->setDefaultAction(startstop_); startstop_button_->setCheckable(false); toolbar->addWidget(startstop_button_); toolbar->addSeparator(); make_mode_combo(); toolbar->addWidget(mode_combo_); toolbar->addSeparator (); QLabel *speed_label_ = new QLabel(_("Speed:"), 0, 0); toolbar->addWidget(speed_label_); speed_spin_ = new QSpinBox(toolbar); speed_spin_->setMinimum(CW_SPEED_MIN); speed_spin_->setMaximum(CW_SPEED_MAX); speed_spin_->setSingleStep(CW_SPEED_STEP); speed_spin_->setToolTip(_("Speed")); speed_spin_->setWhatsThis(SPEED_WHATSTHIS); speed_spin_->setSuffix(_(" WPM")); speed_spin_->setValue(cw_get_send_speed()); connect(speed_spin_, SIGNAL (valueChanged(int)), SLOT (speed_change())); toolbar->addWidget(speed_spin_); toolbar->addSeparator(); QLabel *tone_label = new QLabel(_("Tone:")); toolbar->addWidget(tone_label); frequency_spin_ = new QSpinBox(toolbar); frequency_spin_->setMinimum(CW_FREQUENCY_MIN); frequency_spin_->setMaximum(CW_FREQUENCY_MAX); frequency_spin_->setSingleStep(CW_FREQUENCY_STEP); frequency_spin_->setToolTip(_("Frequency")); frequency_spin_->setSuffix(_(" Hz")); frequency_spin_->setWhatsThis(FREQUENCY_WHATSTHIS); frequency_spin_->setValue(cw_get_frequency()); connect(frequency_spin_, SIGNAL (valueChanged(int)), SLOT (frequency_change())); toolbar->addWidget(frequency_spin_); toolbar->addSeparator (); QLabel *volume_label = new QLabel(_("Volume:"), 0, 0); toolbar->addWidget(volume_label); volume_spin_ = new QSpinBox(toolbar); volume_spin_->setMinimum(CW_VOLUME_MIN); volume_spin_->setMaximum(CW_VOLUME_MAX); volume_spin_->setSingleStep(CW_VOLUME_STEP); volume_spin_->setToolTip(_("Volume")); volume_spin_->setSuffix(_(" %")); volume_spin_->setWhatsThis(VOLUME_WHATSTHIS); volume_spin_->setValue(cw_get_volume()); connect(volume_spin_, SIGNAL (valueChanged(int)), SLOT (volume_change())); toolbar->addWidget(volume_spin_); toolbar->addSeparator (); QLabel *gap_label = new QLabel(_("Gap:"), 0, 0); toolbar->addWidget(gap_label); gap_spin_ = new QSpinBox(toolbar); gap_spin_->setMinimum(CW_GAP_MIN); gap_spin_->setMaximum(CW_GAP_MAX); gap_spin_->setSingleStep(CW_GAP_STEP); gap_spin_->setToolTip(_("Gap")); gap_spin_->setSuffix(_(" dot(s)")); gap_spin_->setWhatsThis(GAP_WHATSTHIS); gap_spin_->setValue(cw_get_gap()); connect(gap_spin_, SIGNAL (valueChanged(int)), SLOT (gap_change())); toolbar->addWidget(gap_spin_); // Finally for the toolbar, add whatsthis. //QWhatsThis::whatsThisButton (toolbar); // This removes context menu for the toolbar. The menu made it // possible to close a toolbar, which complicates 'show/hide' // behavior a bit. // Disabling the menu makes Settings->Hide toolbar the only place // to toggle toolbar visibility. Nice and simple. QAction *a = toolbar->toggleViewAction(); a->setVisible(false); return; } void Application::make_mode_combo() { mode_combo_ = new QComboBox(0); //, _("Mode")); mode_combo_->setToolTip(_("Mode")); mode_combo_->setWhatsThis(MODE_WHATSTHIS); connect(mode_combo_, SIGNAL (activated(int)), SLOT (mode_change())); // Append each mode represented in the modes set to the combo box's // contents, then synchronize the current mode. for (int index = 0; index < modeset_.get_count(); index++) { const QVariant data(index); const Mode *mode = modeset_.get(index); const QString string = QString::fromUtf8(mode->get_description().c_str()); mode_combo_->addItem(string, data); } modeset_.set_current(mode_combo_->currentIndex()); return; } void Application::make_program_menu(void) { program_menu_ = new QMenu (_("&Program"), this); QMainWindow::menuBar()->addMenu(program_menu_); new_window_ = new QAction(_("&New Window"), this); new_window_->setShortcut(Qt::CTRL + Qt::Key_N); connect(new_window_, SIGNAL (triggered()), SLOT (new_instance())); program_menu_->addAction(new_window_); program_menu_->addSeparator (); program_menu_->addAction(startstop_); // The action is connected in make_toolbar(). clear_display_ = new QAction(_("&Clear Text"), this); clear_display_->setShortcut(Qt::CTRL + Qt::Key_C); connect(clear_display_, SIGNAL (triggered()), SLOT (clear())); program_menu_->addAction(clear_display_); sync_speed_ = new QAction(_("Synchronize S&peed"), this); sync_speed_->setShortcut(Qt::CTRL + Qt::Key_P); sync_speed_->setEnabled(modeset_.is_receive()); connect(sync_speed_, SIGNAL (triggered()), SLOT (sync_speed())); program_menu_->addAction(sync_speed_); program_menu_->addSeparator(); close_ = new QAction(_("&Close"), this); close_->setShortcut(Qt::CTRL + Qt::Key_W); connect(close_, SIGNAL (triggered()), SLOT (close())); program_menu_->addAction(close_); quit_ = new QAction(_("&Quit"), qApp); quit_->setShortcut(Qt::CTRL + Qt::Key_Q); connect(quit_, SIGNAL (triggered()), qApp, SLOT (closeAllWindows())); program_menu_->addAction(quit_); return; } void Application::make_settings_menu(void) { QMenu *settings_ = new QMenu(_("&Settings"), this); QMainWindow::menuBar()->addMenu(settings_); reverse_paddles_ = new QAction(_("&Reverse Paddles"), this); reverse_paddles_->setCheckable(true); reverse_paddles_->setChecked(false); settings_->addAction(reverse_paddles_); curtis_mode_b_ = new QAction(_("&Curtis Mode B Timing"), this); curtis_mode_b_->setCheckable(true); curtis_mode_b_->setChecked(false); connect(curtis_mode_b_, SIGNAL (toggled(bool)), SLOT (curtis_mode_b_change())); settings_->addAction(curtis_mode_b_); adaptive_receive_ = new QAction(_("&Adaptive CW Receive Speed"), this); adaptive_receive_->setCheckable(true); adaptive_receive_->setChecked(true); connect(adaptive_receive_, SIGNAL (toggled(bool)), SLOT (adaptive_receive_change())); settings_->addAction(adaptive_receive_); settings_->addSeparator(); font_settings_ = new QAction(_("&Text font..."), this); connect(font_settings_, SIGNAL (triggered(bool)), SLOT (fonts())); settings_->addAction(font_settings_); color_settings_ = new QAction(_("&Text color..."), this); connect(color_settings_, SIGNAL (triggered(bool)), SLOT (colors())); settings_->addAction(color_settings_); settings_->addSeparator(); toolbar_visibility_ = new QAction(_("Hide toolbar"), this); connect(toolbar_visibility_, SIGNAL (triggered(bool)), SLOT (toggle_toolbar())); settings_->addAction(toolbar_visibility_); return; } void Application::make_help_menu(void) { help_ = new QMenu(_("&Help"), this); QMainWindow::menuBar()->addSeparator(); QMainWindow::menuBar()->addMenu(help_); about_ = new QAction(_("&About"), this); connect(about_, SIGNAL(triggered(bool)), SLOT(about())); help_->addAction(about_); return; } void Application::make_central_widget(void) { // this constructor calls setCentralWidget() display_ = new Display(this, this->parentWidget()); return; } void Application::make_auxiliaries_begin(void) { start_icon = QPixmap(icon_start_xpm); stop_icon = QPixmap(icon_stop_xpm); xcwcp_icon = QPixmap(icon_mini_xcwcp_xpm); is_using_libcw_ = false; saved_receive_speed_ = cw_get_receive_speed(); play_ = false; // Create a timer for polling send and receive. poll_timer_ = new QTimer (this); connect(poll_timer_, SIGNAL (timeout()), SLOT (poll_timer_event())); return; } void Application::make_auxiliaries_end(void) { // Create a sender and a receiver. sender_ = new Sender(display_); receiver_ = new Receiver(display_); // Register class handler as the CW library keying event callback. It's // important here that we register the static handler, since once we have // been into and out of 'C', all concept of 'this' is lost. It's the job // of the static handler to work out which class instance is using the CW // library, and call the instance's libcw_keying_event() function. // // The handler called back by libcw is important because it's // used to send to libcw information about timings of events // (key down and key up events). // // Without the callback the library can play sounds as key or // paddles are pressed, but (since it doesn't receive timing // parameters) it won't be able to identify entered Morse // code. cw_register_keying_callback(libcw_keying_event_static, &(receiver_->timer)); // The call above registered receiver_->timer as a generic // argument to a callback. However, libcw needs to know when // the argument happens to be of type 'struct timeval'. This // is why we have this second call, explicitly passing // receiver's timer to libcw. cw_iambic_keyer_register_timer(&(receiver_->timer)); gettimeofday(&(receiver_->timer), NULL); //fprintf(stderr, "time on aux config: %10ld : %10ld\n", receiver_->timer.tv_sec, receiver_->timer.tv_usec); QString label("Output: "); label += cw_generator_get_audio_system_label(); QLabel *sound_system = new QLabel(label); statusBar()->addPermanentWidget(sound_system); return; } void Application::check_audio_system(cw_config_t *config) { if (config->audio_system == CW_AUDIO_ALSA && cw_is_pa_possible(NULL)) { QMessageBox msgBox; QString message1 = _("Selected audio system is ALSA, but audio on your system is handled by PulseAudio."); QString message2 = _("Expect various problems.\n"); QString message3 = _("In this situation it is recommended to run %1 like this:\n" \ "%2 -s p\n\n"); msgBox.setText(message1 + " " + message2 + message3.arg(config->program_name).arg(config->program_name)); msgBox.exec(); } return; } } // cw namespace unixcw-3.4.2/src/xcwcp/Makefile.in0000644000175000017500000011452412536122132016643 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = xcwcp$(EXEEXT) subdir = src/xcwcp DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_xcwcp_OBJECTS = xcwcp-application.$(OBJEXT) \ xcwcp-moc_application.$(OBJEXT) xcwcp-display.$(OBJEXT) \ xcwcp-main.$(OBJEXT) xcwcp-modeset.$(OBJEXT) \ xcwcp-receiver.$(OBJEXT) xcwcp-sender.$(OBJEXT) xcwcp_OBJECTS = $(am_xcwcp_OBJECTS) xcwcp_DEPENDENCIES = $(top_builddir)/src/cwutils/lib_xcwcp.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(xcwcp_SOURCES) DIST_SOURCES = $(xcwcp_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) 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)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # source code files used to build xcwcp program xcwcp_SOURCES = \ application.cc application.h \ moc_application.cc \ display.cc display.h \ main.cc \ modeset.cc modeset.h \ receiver.cc receiver.h\ sender.cc sender.h # target-specific preprocessor flags (#defs and include dirs) xcwcp_CPPFLAGS = $(AM_CPPFLAGS) $(AC_QT4_CFLAGS) # target-specific linker flags (objects to link) xcwcp_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(AC_QT4_LIBS) $(top_builddir)/src/cwutils/lib_xcwcp.a # copy man page to proper directory during installation man_MANS = xcwcp.1 # and mark it as distributable, too EXTRA_DIST = xcwcp.1 \ icons/icon_mini_xcwcp.xpm \ icons/icon_start.xpm \ icons/icon_stop.xpm # CLEANFILES extends list of files that need to be removed when # calling "make clean" CLEANFILES = moc_application.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xcwcp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/xcwcp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list xcwcp$(EXEEXT): $(xcwcp_OBJECTS) $(xcwcp_DEPENDENCIES) $(EXTRA_xcwcp_DEPENDENCIES) @rm -f xcwcp$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(xcwcp_OBJECTS) $(xcwcp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-application.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-display.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-moc_application.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-modeset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-receiver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcwcp-sender.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< xcwcp-application.o: application.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-application.o -MD -MP -MF $(DEPDIR)/xcwcp-application.Tpo -c -o xcwcp-application.o `test -f 'application.cc' || echo '$(srcdir)/'`application.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-application.Tpo $(DEPDIR)/xcwcp-application.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='application.cc' object='xcwcp-application.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-application.o `test -f 'application.cc' || echo '$(srcdir)/'`application.cc xcwcp-application.obj: application.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-application.obj -MD -MP -MF $(DEPDIR)/xcwcp-application.Tpo -c -o xcwcp-application.obj `if test -f 'application.cc'; then $(CYGPATH_W) 'application.cc'; else $(CYGPATH_W) '$(srcdir)/application.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-application.Tpo $(DEPDIR)/xcwcp-application.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='application.cc' object='xcwcp-application.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-application.obj `if test -f 'application.cc'; then $(CYGPATH_W) 'application.cc'; else $(CYGPATH_W) '$(srcdir)/application.cc'; fi` xcwcp-moc_application.o: moc_application.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-moc_application.o -MD -MP -MF $(DEPDIR)/xcwcp-moc_application.Tpo -c -o xcwcp-moc_application.o `test -f 'moc_application.cc' || echo '$(srcdir)/'`moc_application.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-moc_application.Tpo $(DEPDIR)/xcwcp-moc_application.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='moc_application.cc' object='xcwcp-moc_application.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-moc_application.o `test -f 'moc_application.cc' || echo '$(srcdir)/'`moc_application.cc xcwcp-moc_application.obj: moc_application.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-moc_application.obj -MD -MP -MF $(DEPDIR)/xcwcp-moc_application.Tpo -c -o xcwcp-moc_application.obj `if test -f 'moc_application.cc'; then $(CYGPATH_W) 'moc_application.cc'; else $(CYGPATH_W) '$(srcdir)/moc_application.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-moc_application.Tpo $(DEPDIR)/xcwcp-moc_application.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='moc_application.cc' object='xcwcp-moc_application.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-moc_application.obj `if test -f 'moc_application.cc'; then $(CYGPATH_W) 'moc_application.cc'; else $(CYGPATH_W) '$(srcdir)/moc_application.cc'; fi` xcwcp-display.o: display.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-display.o -MD -MP -MF $(DEPDIR)/xcwcp-display.Tpo -c -o xcwcp-display.o `test -f 'display.cc' || echo '$(srcdir)/'`display.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-display.Tpo $(DEPDIR)/xcwcp-display.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='display.cc' object='xcwcp-display.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-display.o `test -f 'display.cc' || echo '$(srcdir)/'`display.cc xcwcp-display.obj: display.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-display.obj -MD -MP -MF $(DEPDIR)/xcwcp-display.Tpo -c -o xcwcp-display.obj `if test -f 'display.cc'; then $(CYGPATH_W) 'display.cc'; else $(CYGPATH_W) '$(srcdir)/display.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-display.Tpo $(DEPDIR)/xcwcp-display.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='display.cc' object='xcwcp-display.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-display.obj `if test -f 'display.cc'; then $(CYGPATH_W) 'display.cc'; else $(CYGPATH_W) '$(srcdir)/display.cc'; fi` xcwcp-main.o: main.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-main.o -MD -MP -MF $(DEPDIR)/xcwcp-main.Tpo -c -o xcwcp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-main.Tpo $(DEPDIR)/xcwcp-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='xcwcp-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc xcwcp-main.obj: main.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-main.obj -MD -MP -MF $(DEPDIR)/xcwcp-main.Tpo -c -o xcwcp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-main.Tpo $(DEPDIR)/xcwcp-main.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='xcwcp-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi` xcwcp-modeset.o: modeset.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-modeset.o -MD -MP -MF $(DEPDIR)/xcwcp-modeset.Tpo -c -o xcwcp-modeset.o `test -f 'modeset.cc' || echo '$(srcdir)/'`modeset.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-modeset.Tpo $(DEPDIR)/xcwcp-modeset.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='modeset.cc' object='xcwcp-modeset.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-modeset.o `test -f 'modeset.cc' || echo '$(srcdir)/'`modeset.cc xcwcp-modeset.obj: modeset.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-modeset.obj -MD -MP -MF $(DEPDIR)/xcwcp-modeset.Tpo -c -o xcwcp-modeset.obj `if test -f 'modeset.cc'; then $(CYGPATH_W) 'modeset.cc'; else $(CYGPATH_W) '$(srcdir)/modeset.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-modeset.Tpo $(DEPDIR)/xcwcp-modeset.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='modeset.cc' object='xcwcp-modeset.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-modeset.obj `if test -f 'modeset.cc'; then $(CYGPATH_W) 'modeset.cc'; else $(CYGPATH_W) '$(srcdir)/modeset.cc'; fi` xcwcp-receiver.o: receiver.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-receiver.o -MD -MP -MF $(DEPDIR)/xcwcp-receiver.Tpo -c -o xcwcp-receiver.o `test -f 'receiver.cc' || echo '$(srcdir)/'`receiver.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-receiver.Tpo $(DEPDIR)/xcwcp-receiver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='receiver.cc' object='xcwcp-receiver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-receiver.o `test -f 'receiver.cc' || echo '$(srcdir)/'`receiver.cc xcwcp-receiver.obj: receiver.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-receiver.obj -MD -MP -MF $(DEPDIR)/xcwcp-receiver.Tpo -c -o xcwcp-receiver.obj `if test -f 'receiver.cc'; then $(CYGPATH_W) 'receiver.cc'; else $(CYGPATH_W) '$(srcdir)/receiver.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-receiver.Tpo $(DEPDIR)/xcwcp-receiver.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='receiver.cc' object='xcwcp-receiver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-receiver.obj `if test -f 'receiver.cc'; then $(CYGPATH_W) 'receiver.cc'; else $(CYGPATH_W) '$(srcdir)/receiver.cc'; fi` xcwcp-sender.o: sender.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-sender.o -MD -MP -MF $(DEPDIR)/xcwcp-sender.Tpo -c -o xcwcp-sender.o `test -f 'sender.cc' || echo '$(srcdir)/'`sender.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-sender.Tpo $(DEPDIR)/xcwcp-sender.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sender.cc' object='xcwcp-sender.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-sender.o `test -f 'sender.cc' || echo '$(srcdir)/'`sender.cc xcwcp-sender.obj: sender.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT xcwcp-sender.obj -MD -MP -MF $(DEPDIR)/xcwcp-sender.Tpo -c -o xcwcp-sender.obj `if test -f 'sender.cc'; then $(CYGPATH_W) 'sender.cc'; else $(CYGPATH_W) '$(srcdir)/sender.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xcwcp-sender.Tpo $(DEPDIR)/xcwcp-sender.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sender.cc' object='xcwcp-sender.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xcwcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o xcwcp-sender.obj `if test -f 'sender.cc'; then $(CYGPATH_W) 'sender.cc'; else $(CYGPATH_W) '$(srcdir)/sender.cc'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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 check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 # use $(top_builddir) instead of $(top_srcdir) because Makefile.inc is # (re)created at build time; if you use $(top_srcdir), you may (will?) # get empty $(AC_QT4_CFLAGS), $(AC_QT4_LIBS) and $(AC_QT4_MOC); -include $(top_builddir)/Makefile.inc # Qt4 magic # Previously the invocation of moc was: "$(AC_QT4_MOC) $< -o $@", but # because of failed build on FreeBSD I decided to replace the "$<" and # "$@" symbols with file names. moc_application.cc: application.h $(AC_QT4_MOC) application.h -o moc_application.cc # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -so ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -sa ) || \ ( echo "Retrying the test in silent mode"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./xcwcp -sc ) # 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: unixcw-3.4.2/src/xcwcp/receiver.h0000644000175000017500000000742012451007575016560 0ustar acerionacerion// Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) // Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) // // 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. // #ifndef _XCWCP_RECEIVER_H #define _XCWCP_RECEIVER_H #include #include //----------------------------------------------------------------------- // Class Receiver //----------------------------------------------------------------------- // Encapsulates the main application receiver data and functions. Receiver // abstracts states associated with receiving, event handling, libcw keyer // event handling, and data passed between signal handler and foreground // contexts. namespace cw { class Display; class Mode; class Receiver { public: Receiver (Display *display) : display_ (display), is_pending_inter_word_space_ (false), libcw_receive_errno_ (0), tracked_key_state_ (false), is_left_down (false), is_right_down (false) { } // Poll timeout handler. void poll(const Mode *current_mode); // Keypress event handler. void handle_key_event(QKeyEvent *event, const Mode *current_mode, bool is_reverse_paddles); // Mouse button press event handler. void handle_mouse_event(QMouseEvent *event, const Mode *current_mode, bool is_reverse_paddles); // CW library keying event handler. void handle_libcw_keying_event(struct timeval *t, int key_state); // Clear out queued data on stop, mode change, etc. void clear(); // Timer for measuring length of dots and dashes. // // Initial value of the timestamp is created by xcwcp's // receiver on first "paddle down" event in a character. The // timestamp is then updated by libcw on specific time // intervals. The intervals are a function of keyboard key // presses or mouse button presses recorded by xcwcp. struct timeval timer; private: // Display used for output. Display *display_; // Flag indicating if receive polling has received a character, and may need // to augment it with a word space on a later poll. volatile bool is_pending_inter_word_space_; // Flag indicating possible receive errno detected in signal // handler context and needing to be passed to the foreground. volatile int libcw_receive_errno_; // Safety flag to ensure that we keep the library in sync with keyer events. // Without, there's a chance that of a on-off event, one half will go to one // application instance, and the other to another instance. volatile int tracked_key_state_; // State of left and right paddle of iambic keyer. The flags // are common for keying with keyboard keys and with mouse // buttons. // // A timestamp for libcw needs to be generated only in // situations when one of the paddles comes down and the other // is up. This is why we observe state of both paddles // separately. bool is_left_down; bool is_right_down; // Poll primitives to handle receive errors, characters, and spaces. void poll_report_receive_error(); void poll_receive_character(); void poll_receive_space(); // Prevent unwanted operations. Receiver (const Receiver &); Receiver &operator= (const Receiver &); }; } // cw namespace #endif // _XCWCP_RECEIVER_H unixcw-3.4.2/src/xcwcp/icons/0000755000175000017500000000000012540354303015704 5ustar acerionacerionunixcw-3.4.2/src/xcwcp/icons/icon_stop.xpm0000644000175000017500000000137711662171134020442 0ustar acerionacerion/* XPM */ static const char * icon_stop_xpm[] = { /* width height ncolors chars_per_pixel */ "16 16 21 1", /* colors */ " c None", ". c #63A2C0", "X c #6EABC7", "o c #5998B9", "O c #3F7FA6", "+ c #4F8EB2", "@ c #034367", "# c #64A4BF", "$ c #5A9AB8", "% c #AEDDE9", "& c #3B7DA3", "* c #94CCDC", "= c #7CB9CE", "- c #79B5CE", "; c #87C0D5", ": c #024266", "> c #4F90B1", ", c #6FAEC6", "< c #4586AA", "1 c #30739C", "2 c #000000", /* pixels */ " ", " ", " ", " ::: ::: ", " :%%%: :%%%: ", " :*==: :*==: ", " :;,,: :;,,: ", " :-##: :-##: ", " :X$$: :X$$: ", " :.>>: :.>>: ", " :o<<: :o<<: ", " :+&&: :+&&: ", " :O11: :O11: ", " @:: @:: ", " ", " " }; unixcw-3.4.2/src/xcwcp/icons/icon_mini_xcwcp.xpm0000644000175000017500000000237711662543404021621 0ustar acerionacerion/* XPM */ static const char * icon_mini_xcwcp_xpm[] = { "32 32 4 1", " c None", ". c #FE0000", "+ c #FF0000", "@ c #000000", " ", " ", " ", " ", " ..++.. +..+++ ", " +.++++ .++..+ ", " .+++.+ ..+.+. ", " .+...+ .....+ ", " ..++++ .+++.+ ", " .+++.+ ..++.+ ", " ", " ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@ @@@@@@ ", " @@@@@@@ @@@@@@@ ", " @@@@@@@@ @@@@@@@@ ", " @@@@@@@@@@@@@@@@@@@@ ", " @@@@@@@@@@@@@@@@@@ ", " @@@@@@@@@@@@@@@@ ", " @@@@@@@@@@@@@@ ", " @@@@@@@@@@@@ ", " @@@@@@@@ ", " ", " ", " ", " "}; unixcw-3.4.2/src/xcwcp/icons/icon_start.xpm0000644000175000017500000000153211662174024020604 0ustar acerionacerion/* XPM */ static const char * icon_start_xpm[] = { /* width height ncolors chars_per_pixel */ "16 16 27 1", /* colors */ " c None", ". c #266995", "X c #34769F", "o c #6FAEC7", "O c #83C1D4", "+ c #5999B8", "@ c #79B7CD", "# c #64A4BF", "$ c #6AA5BE", "% c #A1D2E0", "& c #5A9AB8", "* c #1B5F8E", "= c #AEDDE9", "- c #3B7DA3", "; c #4C8CAD", ": c #8ECADC", "> c #7DB4C8", ", c #024266", "< c #6EADC6", "1 c #4181A7", "2 c #4F90B1", "3 c #A9D9E5", "4 c #93C6D6", "5 c #5A97B5", "6 c #4586AA", "7 c #30739C", "8 c #000000", /* pixels */ " ", " ,, ", " ,==, ", " ,=:=, ", " ,3OO=, ", " ,%@@@=, ", " ,4o<<<=, ", " ,>#####=, ", " ,$+&&&&&, ", " ,5222222, ", " ,;66666, ", " ,1----, ", " ,X777, ", " ,..., ", " ,**, ", " ,, " }; unixcw-3.4.2/src/config.h.in0000644000175000017500000001472212536122155015501 0ustar acerionacerion/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `asound' library (-lasound). */ #undef HAVE_LIBASOUND /* Define to 1 if you have the `curses' library (-lcurses). */ #undef HAVE_LIBCURSES /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `pulse-simple' library (-lpulse-simple). */ #undef HAVE_LIBPULSE_SIMPLE /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `snd_pcm_hw_params_test_buffer_size' function. */ #undef HAVE_SND_PCM_HW_PARAMS_TEST_BUFFER_SIZE /* Define to 1 if you have the `snd_pcm_hw_params_test_periods' function. */ #undef HAVE_SND_PCM_HW_PARAMS_TEST_PERIODS /* Define to 1 if you have the header file. */ #undef HAVE_SOUNDCARD_H /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcoll' function and it is properly defined. */ #undef HAVE_STRCOLL /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strspn' function. */ #undef HAVE_STRSPN /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* 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_KBIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_KD_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_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOUNDCARD_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 the header file. */ #undef HAVE_SYS_VTKD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Library version, libtool notation */ #undef LIBCW_VERSION /* Define as 1 if your build machine can support ALSA. */ #undef LIBCW_WITH_ALSA /* Define as 1 if your build machine can support console buzzer. */ #undef LIBCW_WITH_CONSOLE /* Define as 1 if you want to enable development support. */ #undef LIBCW_WITH_DEV /* Define as 1 if your build machine can support OSS. */ #undef LIBCW_WITH_OSS /* Define as 1 if your build machine can support PulseAudio. */ #undef LIBCW_WITH_PULSEAUDIO /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile unixcw-3.4.2/src/cw/0000755000175000017500000000000012540354302014055 5ustar acerionacerionunixcw-3.4.2/src/cw/demo.cw0000644000175000017500000000335611665746644015370 0ustar acerionacerion{ Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) 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. Demonstration CW contact, to test CW sender program =================================================== The following example contact is taken from the CW section of the RSGB's publication "Amateur Radio Operating Manual". }%M0;{ }%T800;CQ CQ CQ CQ DE G4ZZZ G4ZZZ K { }%T1200;G4ZZZ G4ZZZ DE WD9ZZZ WD9ZZZ [AR] { }%T800;WD9ZZZ DE G4ZZZ GA OM ES MNI TNX FER CALL = UR RST 579 = { }NAME JOHN ES QTH LONDON = SO HW CPY? [AR] WD9ZZZ DE G4ZZZ K { }%T1200;G4ZZZ DE WD9ZZZ R FB JOHN ES GM OM = UR RST 559 = { }QTH SR [HH] SPRINGFIELD, ILL = NAME IS ED = SO HW? [AR] G4ZZZ DE WD9ZZZ K { }%T800;WD9ZZZ DE G4ZZZ SRI OM QRM5 = PSE RPT UR NAME?? BK { }%T1200;BK NAME IS ED ED ED BK { }%T800;BK R R TNX ED = QRM GONE = RIG IS HOMEBREW WID 75W INPUT = { }ANT IS DIPOLE = MNI TNX FER QSO ES CU AGN = { }73 ES GB [AR] WD9ZZZ DE G4ZZZ [VA] { }%T1200;G4ZZZ DE WD9ZZZ R UR RIG T9X ES FB = RIG HR IS TS520 = { }ANT IS 2EL QUAD = WL QSL VIA BURO = SO 73 ES GUD DX = { }GB [VA] G4ZZZ DE WD9ZZZ { } unixcw-3.4.2/src/cw/cw.c0000644000175000017500000004152112500411111014621 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #define _BSD_SOURCE #include "config.h" #include #include #include #include #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "cw.h" #include "libcw.h" #include "i18n.h" #include "cmdline.h" #include "cw_copyright.h" /*---------------------------------------------------------------------*/ /* Module variables, miscellaneous other stuff */ /*---------------------------------------------------------------------*/ /* Forward declarations for printf-like functions with checkable arguments. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) static void write_to_echo_stream (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); static void write_to_message_stream (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); static void write_to_cw_sender (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); #endif static cw_config_t *config = NULL; /* program-specific configuration */ static bool generator = false; /* have we created a generator? */ static const char *all_options = "s:|system,d:|device," "w:|wpm,t:|tone,v:|volume," "g:|gap,k:|weighting," "f:|infile," "e|noecho,m|nomessages,c|nocommands,o|nocombinations,p|nocomments," "h|help,V|version"; static void cw_atexit(void); /*---------------------------------------------------------------------*/ /* Convenience functions */ /*---------------------------------------------------------------------*/ /* * write_to_echo_stream() * write_to_message_stream() * * Local fprintf functions that suppress output to if the appropriate flag * is not set; writes are synchronously flushed. */ static void write_to_echo_stream (const char *format, ...) { if (config->do_echo) { va_list ap; va_start (ap, format); vfprintf (stdout, format, ap); fflush (stdout); va_end (ap); } } static void write_to_message_stream (const char *format, ...) { if (config->do_errors) { va_list ap; va_start (ap, format); vfprintf (stderr, format, ap); fflush (stderr); va_end (ap); } } /* * write_to_cw_sender() * * Fprintf-like function that allows us to conveniently print to the cw * output 'stream'. */ static void write_to_cw_sender (const char *format, ...) { va_list ap; char buffer[128]; /* * Format the CW send buffer using vsnprintf. Formatted strings longer than * the declared buffer will be silently truncated to the buffer length. */ va_start (ap, format); vsnprintf (buffer, sizeof (buffer), format, ap); va_end (ap); /* Sound the buffer, and wait for the send to complete. */ if (!cw_send_string (buffer)) { perror ("cw_send_string"); cw_flush_tone_queue (); abort (); } if (!cw_wait_for_tone_queue_critical (1)) { perror ("cw_wait_for_tone_queue_critical"); cw_flush_tone_queue (); abort (); } } /*---------------------------------------------------------------------*/ /* Embedded commands handling */ /*---------------------------------------------------------------------*/ /* * parse_stream_query() * * Handle a query received in the input stream. The command escape character * and the query character have already been read and recognized. */ static void parse_stream_query (FILE *stream) { int c, value; c = toupper (fgetc (stream)); switch (c) { case EOF: return; default: write_to_message_stream ("%c%c%c", CW_STATUS_ERR, CW_CMD_QUERY, c); return; case CW_CMDV_FREQUENCY: value = cw_get_frequency (); break; case CW_CMDV_VOLUME: value = cw_get_volume (); break; case CW_CMDV_SPEED: value = cw_get_send_speed (); break; case CW_CMDV_GAP: value = cw_get_gap (); break; case CW_CMDV_WEIGHTING: value = cw_get_weighting (); break; case CW_CMDV_ECHO: value = config->do_echo; break; case CW_CMDV_ERRORS: value = config->do_errors; break; case CW_CMDV_COMMANDS: value = config->do_commands; break; case CW_CMDV_COMBINATIONS: value = config->do_combinations; break; case CW_CMDV_COMMENTS: value = config->do_comments; break; } /* Write the value obtained above to the message stream. */ write_to_message_stream ("%c%c%d", CW_STATUS_OK, c, value); } /* * parse_stream_cwquery() * * Handle a cwquery received in the input stream. The command escape * character and the cwquery character have already been read and recognized. */ static void parse_stream_cwquery (FILE *stream) { int c, value; const char *format; c = toupper (fgetc (stream)); switch (c) { case EOF: return; default: write_to_message_stream ("%c%c%c", CW_STATUS_ERR, CW_CMD_CWQUERY, c); return; case CW_CMDV_FREQUENCY: value = cw_get_frequency (); format = _("%d HZ "); break; case CW_CMDV_VOLUME: value = cw_get_volume (); format = _("%d PERCENT "); break; case CW_CMDV_SPEED: value = cw_get_send_speed (); format = _("%d WPM "); break; case CW_CMDV_GAP: value = cw_get_gap (); format = _("%d DOTS "); break; case CW_CMDV_WEIGHTING: value = cw_get_weighting (); format = _("%d PERCENT "); break; case CW_CMDV_ECHO: value = config->do_echo; format = _("ECHO %s "); break; case CW_CMDV_ERRORS: value = config->do_errors; format = _("ERRORS %s "); break; case CW_CMDV_COMMANDS: value = config->do_commands; format = _("COMMANDS %s "); break; case CW_CMDV_COMBINATIONS: value = config->do_combinations; format = _("COMBINATIONS %s "); break; case CW_CMDV_COMMENTS: value = config->do_comments; format = _("COMMENTS %s "); break; } switch (c) { case CW_CMDV_FREQUENCY: case CW_CMDV_VOLUME: case CW_CMDV_SPEED: case CW_CMDV_GAP: case CW_CMDV_WEIGHTING: write_to_cw_sender (format, value); break; case CW_CMDV_ECHO: case CW_CMDV_ERRORS: case CW_CMDV_COMMANDS: case CW_CMDV_COMBINATIONS: case CW_CMDV_COMMENTS: write_to_cw_sender (format, value ? _("ON") : _("OFF")); break; } } /* * parse_stream_parameter() * * Handle a parameter setting command received in the input stream. The * command type character has already been read from the stream, and is passed * in as the first argument. */ static void parse_stream_parameter (int c, FILE *stream) { int value; int (*value_handler) (int); /* Parse and check the new parameter value. */ if (fscanf (stream, "%d;", &value) != 1) { write_to_message_stream ("%c%c", CW_STATUS_ERR, c); return; } /* Either assign a handler, or update the local flag, as appropriate. */ value_handler = NULL; switch (c) { case EOF: default: return; case CW_CMDV_FREQUENCY: value_handler = cw_set_frequency; break; case CW_CMDV_VOLUME: value_handler = cw_set_volume; break; case CW_CMDV_SPEED: value_handler = cw_set_send_speed; break; case CW_CMDV_GAP: value_handler = cw_set_gap; break; case CW_CMDV_WEIGHTING: value_handler = cw_set_weighting; break; case CW_CMDV_ECHO: config->do_echo = value; break; case CW_CMDV_ERRORS: config->do_errors = value; break; case CW_CMDV_COMMANDS: config->do_commands = value; break; case CW_CMDV_COMBINATIONS: config->do_combinations = value; break; case CW_CMDV_COMMENTS: config->do_comments = value; break; } /* * If not a local flag, apply the new value to a CW library control using * the handler assigned above. */ if (value_handler) { if (!(*value_handler) (value)) { write_to_message_stream ("%c%c", CW_STATUS_ERR, c); return; } } /* Confirm the new value with a stderr message. */ write_to_message_stream ("%c%c%d", CW_STATUS_OK, c, value); } /* * parse_stream_command() * * Handle a command received in the input stream. The command escape * character has already been read and recognized. */ static void parse_stream_command (FILE *stream) { int c; c = toupper (fgetc (stream)); switch (c) { case EOF: return; default: write_to_message_stream ("%c%c%c", CW_STATUS_ERR, CW_CMD_ESCAPE, c); return; case CW_CMDV_FREQUENCY: case CW_CMDV_VOLUME: case CW_CMDV_SPEED: case CW_CMDV_GAP: case CW_CMDV_WEIGHTING: case CW_CMDV_ECHO: case CW_CMDV_ERRORS: case CW_CMDV_COMMANDS: case CW_CMDV_COMBINATIONS: case CW_CMDV_COMMENTS: parse_stream_parameter (c, stream); break; case CW_CMD_QUERY: parse_stream_query (stream); break; case CW_CMD_CWQUERY: parse_stream_cwquery (stream); break; case CW_CMDV_QUIT: cw_flush_tone_queue (); write_to_echo_stream ("%c", '\n'); exit (EXIT_SUCCESS); } } /*---------------------------------------------------------------------*/ /* Input stream handling */ /*---------------------------------------------------------------------*/ /* * send_cw_character() * * Sends the given character to the CW sender, and waits for it to complete * sounding the tones. The character to send may be a partial or a complete * character. */ static void send_cw_character (int c, int is_partial) { int character, status; /* Convert all whitespace into a single space. */ character = isspace (c) ? ' ' : c; /* Send the character to the CW sender. */ status = is_partial ? cw_send_character_partial (character) : cw_send_character (character); if (!status) { if (errno != ENOENT) { perror ("cw_send_character[_partial]"); cw_flush_tone_queue (); abort (); } else { write_to_message_stream ("%c%c", CW_STATUS_ERR, character); return; } } /* Echo the original character while sending it. */ write_to_echo_stream ("%c", c); /* Wait for the character to complete. */ if (!cw_wait_for_tone_queue_critical (1)) { perror ("cw_wait_for_tone_queue_critical"); cw_flush_tone_queue (); abort (); } } /* * parse_stream() * * Read characters from a file stream, and either sound them, or interpret * controls in them. Returns on end of file. */ static void parse_stream (FILE *stream) { int c; enum { NONE, COMBINATION, COMMENT, NESTED_COMMENT } state = NONE; /* * Cycle round states depending on input characters. Comments may be * nested inside combinations, but not the other way around; that is, * combination starts and ends are not special within comments. */ for (c = fgetc (stream); !feof (stream); c = fgetc (stream)) { switch (state) { case NONE: /* * Start a comment or combination, handle a command escape, or send * the character if none of these checks apply. */ if (config->do_comments && c == CW_COMMENT_START) { state = COMMENT; write_to_echo_stream ("%c", c); } else if (config->do_combinations && c == CW_COMBINATION_START) { state = COMBINATION; write_to_echo_stream ("%c", c); } else if (config->do_commands && c == CW_CMD_ESCAPE) parse_stream_command (stream); else send_cw_character (c, false); break; case COMBINATION: /* * Start a comment nested in a combination, end a combination, * handle a command escape, or send the character if none of these * checks apply. */ if (config->do_comments && c == CW_COMMENT_START) { state = NESTED_COMMENT; write_to_echo_stream ("%c", c); } else if (c == CW_COMBINATION_END) { state = NONE; write_to_echo_stream ("%c", c); } else if (config->do_commands && c == CW_CMD_ESCAPE) parse_stream_command (stream); else { /* * If this is the final character in the combination, do not * suppress the end of character delay. To do this, look ahead * the next character, and suppress unless combination end. */ int lookahead; lookahead = fgetc (stream); ungetc (lookahead, stream); send_cw_character (c, lookahead != CW_COMBINATION_END); } break; case COMMENT: case NESTED_COMMENT: /* * If in a comment nested in a combination and comment end seen, * revert state to reflect in combination only. If in an unnested * comment and comment end seen, reset state. */ if (c == CW_COMMENT_END) state = (state == NESTED_COMMENT) ? COMBINATION : NONE; write_to_echo_stream ("%c", c); break; } } } /** \brief Parse command line args, then produce CW output until end of file \param argc \param argv */ int main (int argc, char *const argv[]) { atexit(cw_atexit); /* Set locale and message catalogs. */ i18n_initialize(); /* Parse combined environment and command line arguments. */ int combined_argc; char **combined_argv; combine_arguments("CW_OPTIONS", argc, argv, &combined_argc, &combined_argv); config = cw_config_new(cw_program_basename(argv[0])); if (!config) { return EXIT_FAILURE; } config->is_cw = 1; if (!cw_process_argv(argc, argv, all_options, config)) { fprintf(stderr, _("%s: failed to parse command line args\n"), config->program_name); return EXIT_FAILURE; } if (!cw_config_is_valid(config)) { fprintf(stderr, _("%s: inconsistent command line arguments\n"), config->program_name); return EXIT_FAILURE; } if (config->input_file) { if (!freopen(config->input_file, "r", stdin)) { fprintf(stderr, _("%s: %s\n"), config->program_name, strerror(errno)); fprintf(stderr, _("%s: error opening input file %s\n"), config->program_name, config->input_file); return EXIT_FAILURE; } } if (config->audio_system == CW_AUDIO_ALSA && cw_is_pa_possible(NULL)) { fprintf(stdout, "Selected audio system is ALSA, but audio on your system is handled by PulseAudio. Expect problems with timing.\n"); fprintf(stdout, "In this situation it is recommended to run %s like this:\n", config->program_name); fprintf(stdout, "%s -s p\n\n", config->program_name); fprintf(stdout, "Press Enter key to continue\n"); getchar(); } generator = cw_generator_new_from_config(config); if (!generator) { //fprintf(stderr, "%s: failed to create generator with device '%s'\n", config->program_name, config->audio_device); return EXIT_FAILURE; } /* Set up signal handlers to exit on a range of signals. */ static const int SIGNALS[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, 0 }; for (int i = 0; SIGNALS[i]; i++) { if (!cw_register_signal_handler(SIGNALS[i], SIG_DFL)) { fprintf(stderr, _("%s: can't register signal: %s\n"), config->program_name, strerror(errno)); return EXIT_FAILURE; } } /* Start producing sine wave (amplitude of the wave will be zero as long as there are no characters to process). */ cw_generator_start(); /* Send stdin stream to CW parsing. */ parse_stream(stdin); /* Await final tone completion before exiting. */ cw_wait_for_tone_queue(); return EXIT_SUCCESS; } void cw_atexit(void) { if (generator) { cw_generator_stop(); //cw_complete_reset(); cw_generator_delete(); } if (config) { cw_config_delete(&config); } return; } unixcw-3.4.2/src/cw/test.cw0000644000175000017500000000472511665754345015421 0ustar acerionacerion{ Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) 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. Acceptance tests for CW sender program ====================================== Test the limits of the CW sender program, and verify its response under error input conditions. }{ Initialize the test to 30 WPM, 800Hz, 70% volume, no gaps, 50% weighting }%C1;%P1;%M1;%E1;%O1;%G0;%K50;%T800;%V70;%W30;{ Demonstrate character set and combinations }= {CHARSET } ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"$()+-./:;=?_ ={ }= {MIXED CASE } The lazy dog jumps over the quick brown fox ={ }= {COMBINATIONS} [AR] [VA] [CT] ={ Test the limits of WPM, gap, weighting, Hz, and volume }%W4;= 4 WPM %W60;= 60 WPM %W30;={ }%G0;= GAP 0 %G60;= GAP 60 %G0;={ }%K20;= WEIGHTING 20 %K40;= WEIGHTING 40 %K60;= WEIGHTING 60 %K80;= WEIGHTING 80 %K50;={ }%T0;= TONE 0 %T10;= TONE 10 %T100;= TONE 100 %T1000;= TONE 1000 %T2000;= TONE 2000 %T4000;= TONE 4000 %T800;={ }%V0;= VOL 0 %V20;= VOL 20 %V40;= VOL 40 %V60;= VOL 60 %V80;= VOL 80 %V100;= VOL 100 %V70;={ Switch flags on and off }%E0;= ECHO OFF %?E%E1;= ECHO ON %?E%E1;={ }%M0;= MESSAGES OFF %?M%M1;= MESSAGES ON %?M%M1;={ }%O0;= {COMBINATIONS OFF} [AR] [VA] [CT] %?O%O1;= {COMBINATIONS ON} [AR] [VA] [CT] %?O%O1;={ }%P0;= {COMMENTS OFF, SOUNDED} %?P%P1;= {COMMENTS ON, NOT SOUNDED} %?P%P1;={ Test the queries }= {QUERIES } %?W%?T%?V%?G%?K%?C%?E%?M%?O%?P ={ }= {CW QUERIES} %>W%>T%>V%>G%>K%>C%>E%>M%>O%>P ={ Tests for errors on input }= {BAD CHARACTERS } | \ # ={ }= {BAD COMMANDS } %J %B %% %# %; %| ={ }= {BAD COMMAND ARGS} %W61;%W0;%W-10;%T-1;%T4001;%T-100;%V-1;%V101 ={ }= {BAD COMMAND ARGS} %G-1;%G61;%K19;%K81; ={ }= {BAD QUERIES } %?J %?B %?% %?; %?| ={ }= {BAD CW QUERIES } %>J %>B %>% %>; %>| ={ Check that we can quit }= QUIT %Q THIS TEXT SHOULD NOT APPEAR unixcw-3.4.2/src/cw/cw.10000644000175000017500000005110712536121621014555 0ustar acerionacerion.\" .\" UnixCW CW Tutor Package - CW .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH CW 1 "CW Tutor Package" "cw ver. 3.4.2" \" -*- nroff -*- .SH NAME .\" cw \- sound characters as Morse code on the soundcard or console speaker .\" .\" .\" .SH SYNOPSIS .\" .B cw [\-s\ \-\-system=\fISYSTEM\fP] [\-d\ \-\-device=\fIDEVICE\fP] [\-w\ \-\-wpm=\fIWPM\fP] [\-t\ \-\-tone=\fIHZ\fP] [\-v\ \-\-volume=\fIPERCENT\fP] [\-g\ \-\-gap=\fIGAP\fP] [\-k\ \-\-weighting=\fIWEIGHT\fP] .BR [\-e\ \-\-noecho] [\-m\ \-\-nomessages] [\-c\ \-\-nocommands] [\-o\ \-\-nocombinations] [\-p\ \-\-nocomments] [\-f\ \-\-infile=\fIFILE\fP] .BR [\-h\ \-\-help] [\-V\ \-\-version] .BR .PP \fBcw\fP installed on GNU/Linux systems understands both short form and long form command line options. \fBcw\fP installed on other operating systems may understand only the short form options. .PP There are no mandatory options. .PP Options may be predefined in the environment variable \fBCW_OPTIONS\fP. If defined, these options are used first; command line options take precedence. .PP .\" .\" .\" .SH DESCRIPTION .\" .PP \fBcw\fP reads characters from an input file, or from standard input, and sounds each valid character as Morse code on either the system sound card, or the system console speaker. After it sounds a character, \fBcw\fP echoes it to standard output. The input stream can contain embedded command strings. These change the parameters used when sounding the Morse code. \fBcw\fP reports any errors in embedded commands on standard error. .PP Use 'Ctrl+D' key combination to exit \fBcw\fP. .\" .\" .\" .SS COMMAND LINE OPTIONS .\" \fBcw\fP understands the following command line options. The long form options may not be available in non-LINUX versions. .TP .I "\-s, \-\-system=SYSTEM" Specifies the way that \fBcw\fP generates tones. Valid values are: \fInull\fP for no tones, just timings, \fIconsole\fP for tones through the console speaker, \fIalsa\fP for tones generated through the system sound card using ALSA sound system, \fIoss\fP for tones generated through system sound card using OSS sound system, \fIpulseaudio\fP for tones generated through system sound card using PulseAudio sound system, \fIsoundcard\fP for tones generated through the system sound card, but without explicit selection of sound system. These values can be shortened to 'n', 'c', 'a', 'o', 'p', or 's', respectively. The default value is 'pulseaudio' (on systems with PulseAudio installed), followed by 'oss'. .TP .I "\-d, \-\-device=DEVICE" Specifies the device file to open for generating a sound. \fBcw\fP will use default device if none is specified. The default devices are: \fI/dev/console\fP for sound produced through console, \fIdefault\fP for ALSA sound system, \fI/dev/audio\fP for OSS sound system, \fIa default device\fP for PulseAudio sound system. See also \fINOTES ON USING A SOUND CARD\fP below. .TP .I "\-w, \-\-wpm=WPM" Sets the initial sending speed in words per minute. The value must be between 4 and 60. The default value is 12 WPM. .TP .I "\-t, \-\-tone=HZ" Sets the initial sounder pitch in Hz. This value must be between 0 and 4,000. A value of 0 selects silent operation, and can be used for timing checks or other testing. The default value is 800Hz, .TP .I "\-v, \-\-volume=PERCENT" Sets the initial sending volume, as a percentage of full scale volume. The value must be between 0 and 100. The default value is 70 %. Sound volumes work fully for sound card tones, but \fBcw\fP cannot control the volume of tones from the console speaker. In this case, a volume of zero is silent, and all other volume values are simply sounded. .TP .I "\-g, \-\-gap=GAP" Sets the initial extra gap, in dot lengths, between characters (the 'Farnsworth' delay). It must be between 0 and 60. The default is 0. .TP .I "\-k, \-\-weighting=WEIGHT" Sets the initial weighting, as a percentage of dot lengths. It must be between 20 and 80. The default is 50. .TP .I "\-e, \-\-noecho" Stops \fBcw\fP echoing characters on standard output after they are sounded. The default is to have echoing on. .TP .I "\-m, \-\-nomessages" Stops \fBcw\fP printing error messages on standard error. The default is to print messages. .TP .I "\-c, \-\-nocommands" Stops \fBcw\fP from interpreting commands embedded in the input stream. The default is to interpret embedded commands. .TP .I "\-o, \-\-nocombinations" Stops \fBcw\fP from treating character strings bracketed by [...] as a single combination character. The default is to honor combinations. .TP .I "\-p, \-\-nocomments" Stops \fBcw\fP from treating character strings bracketed by {...} as 'comments'. Characters inside these braces will be echoed to standard output, but not sounded. When comments are being honored, any embedded commands inside the braces will be ignored. The default is to honor comments. .TP .I "\-f, \-\-infile=FILE" Specifies a text file that \fBcw\fP can read to configure its practice text. .TP .I "\-h, \-\-help" Prints short help message. .TP .I "\-V, \-\-version" Prints information about program's version, authors and license. .PP .\" .\" .\" .SS SOUNDING CHARACTERS .\" \fBcw\fP reads characters, one at a time, from its standard input or from its input file. Lowercase letters are converted internally to uppercase. The following list shows the valid IS0 8859-1 (Latin-1) characters that can be sounded by \fBcw\fP: .\" \[u0022] = ", otherwise emacs syntax highlighting is messed up; .IP ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\[u0022]$()+\-./:;=?_@ and space .PP In addition, the program also understands the following ISO 8859-1 and ISO 8859-2 accented characters: .\" .\" .\" �������Ѫ� .\" .\" .\" This looks like a great place for tutorial on non-standard characters .\" in troff document tutorial ;) .\" .\" Q: how to produce '�' ('S' with Cedilla)? .\" A: use composite glyph; 'man 7 groff_char' gives this syntax of .\" composite glyph: .\" \[base_glyph composite_1 composite_2 ...] .\" For '�' base glyph is 'S', and first (and only) composite is .\" 'cedilla', represented by Unicode thingy 'u0327'. Thus: .\" '�' = '\[S u0327]'; .\" .\" Q: how to produce '�' ('Z' with caron/hacek)? .\" A: in two ways: either as a composite glyph as demonstrated above), .\" i.e. like this: '\[Z u030C]', or in 'regular' way, using .\" non-composite glyph \[vZ]' .\" .\" Q: any more tips? .\" A: two: .\" - read 'man 7 groff_char' (or 'man 7 troff_char'); .\" - make sure that your terminal (terminal emulator) can display .\" non-standard characters correctly (and I mean *really* correctly); .\" make a little test: open 'man 7 troff_char' in your terminal, .\" and open web page with html version of the man page, then search .\" for non-standard characters (e.g. cedilla) in the html document .\" and compare them with those displayed in the terminal; .\" .\" .\" .\" .IP \[:U]\[:A]\[,C]\[:O]\['E]\[`E]\[`A]\[~N]\[S u0327] (S with cedilla), \[vZ] (Z with caron/hacek), .PP and accepts the following as single character forms of common procedural signals: .IP <>!&^~ .PP See \fBcw\fP(7,LOCAL) for more information on the above characters and Morse code. .PP If \fBcw\fP receives a character not in this set, it prints an error message '?\fIc\fP', where \fIc\fP is the error character. The only exceptions to this may be the \fBcw\fP command escape character '%', the combination start and stop characters '[' and ']', and the comment start and stop characters '{' and '}'. See \fIEMBEDDED COMMANDS\fP and \fIMORSE CODE COMBINATIONS\fP below. .PP .\" .\" .\" .SS EMBEDDED COMMANDS .\" \fBcw\fP recognizes special sequences in the input stream as embedded commands. These commands alter the parameters of the \fBcw\fP while it is running, or query current values. All commands are prefixed by the command escape character '%', and those which set a value end with a semicolon. .PP The format of an embedded command to change a parameter value is .IP %\fICvalue\fP; .PP where \fIC\fP is a command letter indicating what action \fBcw\fP is to take, and \fIvalue\fP is the argument or value for the command. .PP Valid command letters are .TP .I "T" Sets the tone pitch used to sound a character. .TP .I "W" Sets the sending speed. .TP .I "G" Sets the 'Farnsworth' gap between characters. .TP .I "K" Sets the weighting. .TP .I "E" Disables or re-enables echoing of sent characters on standard output. .TP .I "M" Disables or re-enables error messages on standard error. .TP .I "S" Disables or re-enables speaker tone generation. .TP .I "C" Disables processing of embedded commands. Note that once disabled, this command cannot re-enable them. .TP .I "O" Disables or re-enables recognition of [...] character combinations. .TP .I "P" Disables or re-enables recognition of {...} comments. When comments are being recognized, any character after an opening '{' and before any closing '}' will be echoed to standard output, but will not be sounded, or have any other effect. .PP For example, the embedded command sequence .IP %W25;%T1200; .PP will set \fBcw\fP to a speed of 25 WPM, and a tone pitch of 1200Hz. .PP The 'T', 'W', 'G', and 'A' commands take values along with the command. The limits on values given for embedded commands are the same as the limits available for command line options, detailed above. .PP The 'E', 'M', 'S', 'C' and 'O' commands are flags, and treat a value of zero as clear, and any other value as set. So, for example, the sequence .IP %M0;%C0; .PP will turn off error messages, and then turn off the processing of embedded commands. .PP If a parameter is set successfully, \fBcw\fP reports the new setting on standard error (except if no error messages is set). If an error is detected in an embedded command, \fBcw\fP reports an error. For the formats of error messages see the \fIMESSAGE FORMATS\fP section below. .PP The current values of parameters within \fBcw\fP may be queried, as well as set. The command format .IP %?\fIC\fP .PP queries the value of the parameter normally set with command \fIC\fP. .B cw reports the current value on standard error, using the same format as when new values are set. .PP The current values of parameters within \fBcw\fP may also be requested as output in Morse code. The command format .IP %>\fIC\fP .PP will generate Morse output reporting the value of the parameter normally set with command \fIC\fP. .PP If embedded commands are disabled, '%' characters are treated as any other (in this case, invalid) input character. .PP Once processing of embedded commands has been switched off, any command to switch this feature back on will not be recognized. That is, after '%C0;', an '%C1;' will not be recognized. .PP There is one additional command, and that is '%Q'. This command closes all open files and terminates \fBcw\fP. Any characters after this command in the input stream will be lost. .PP The file \fIcw.h\fP provides a full set of definitions for the commands, special characters, and status codes of \fBcw\fP. .PP .\" .\" .\" .SS MESSAGE FORMATS .\" Where a parameter value is set correctly with an embedded command, the message format .IP \=\fICvalue\fP .PP is returned. \fIC\fP is the command used, and \fIvalue\fP is the new value. .PP If an invalid value is supplied for a parameter in an embedded command, a message .IP ?\fICvalue\fP .PP is returned. .PP Where an invalid command is encountered, the message format .IP ?%\fIC\fP .PP is used. For an invalid query, the message is .IP ??\fIC\fP .PP and for an invalid request for a parameter in Morse code the message is .IP ?>\fIC\fP .PP A character in the input stream that cannot be sounded produces a message .IP ?\fIC\fP .PP These messages are not intended to be user-friendly, but are designed to be easily and quickly interpreted by another program. Similarly, the format of embedded commands is more computer-friendly than user-friendly. .PP If error messages are disabled, no messages of any type are printed on standard error. .PP .\" .\" .\" .SS MORSE CODE COMBINATIONS .\" The standard set of characters offered by \fBcw\fP may not be sufficient for some purposes. For example, some international characters do not have equivalent ISO 8859-1 and ISO 8859-2 that \fBcw\fP can sound directly. .PP To help in sounding such characters, \fBcw\fP offers the ability to form combination characters by placing individual character components between [...] brackets. \fBCw\fP sounds characters inside a combination without the usual gap between them. In this way, any missing character in the set can be built. .PP For example .IP [VA] .PP is one way to form the VA procedural signal, though .IP [SK] .PP works just as well. The eight-dot error signal can be sounded with .IP [HSE] .PP or the C-cedilla in international Morse code with .IP [CE] .PP There can be as many valid letters, numbers, or figures inside the [...] brackets as required. For example, an alternative way of sending the error signal could be .IP [EEEEEEEE] .PP Finally, three alternative ways of sending 73 might be .IP [TTEEE][EEETT] .br [TDE][EUT] .br [GEE][VT] .PP Embedded commands may be placed inside [...] combinations if required. Combinations do not nest. .PP This feature can be disabled by using the \fI\-O\fP or \fI\-\-nocombinations\fP command line flags, or with the 'O' embedded command. If combinations are disabled, '[' and ']' characters are treated as any other (invalid) input character. .PP .\" .\" .\" .SS NOTES ON USING A SOUND CARD .\" By default, \fBcw\fP tries to open default PulseAudio. If PulseAudio server is not accessible, cw tries to open OSS device "/dev/audio" to access the system sound card. This is generally the correct device to use, but for systems with special requirements, or those with multiple sound cards, the option \fI-d\fP or \fI\-\-device\fP, combined with \fI-s\fP or \fI\-\-system\fP can be used to specify the device and audio system for sound card access. If the sound card device cannot be set up, \fBcw\fP prints the error message .IP cannot set up soundcard sound .PP and exits. .PP Sound card devices, when opened through OSS sound system, are usually single-access devices, so that when one process has opened the device, other processes are prevented from using it. In such cases \fBcw\fP will of course conflict with any other programs that expect exclusive use of the system sound card (for example, MP3 players). If \fBcw\fP finds that the sound card is already busy, it prints the error message .IP open /dev/audio: Device or resource busy .PP and exits. .PP .\" The main sound card device will often allow \fBcw\fP to control tone .\" volumes directly, but where this is not possible, \fBcw\fP uses the .\" mixer device instead. By default, this is "/dev/mixer", but the device .\" can be specified with the \fI-y\fP or \fI\-\-mdevice\fP options. In .\" general, as with the main sound card device, the default mixer device .\" is usually the correct one to use. .\" .PP .\" The mixer device is only used if the sound card does not allow volume .\" control through the main sound card device. .PP The sound card device is not used if \fBcw\fP is only sending tones on the console speaker. .PP .\" .\" .\" .SS AUDIO OUTPUT \- DEFAULTS AND SELECTION .\" \fBcw\fP first tries to access sound card using PulseAudio sound system, using default device name, unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP \fBcw\fP then tries to access sound card using OSS audio system and default OSS audio device name ('/dev/audio'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through OSS fails, \fBcw\fP tries to access the sound card using ALSA audio system, and default ALSA audio device name ('default'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through ALSA also fails, \fBcw\fP tries to access system console buzzer using default buzzer device '/dev/console', unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP It is very common that in order to access the console buzzer device user has to have root privileges. For that reason trying to open console buzzer almost always fails. This is not a program's bug, this is a result of operating system's restrictions. Making \fBcw\fP an suid binary bypasses this restriction. The program does not fork() or exec(), so making it suid should be relatively safe. Note however that this practice is discouraged for security reasons. .PP As stated, user can tell \fBcw\fP which device to use, using \fI-d\fP or \fI\-\-device\fP option. Which device files are suitable will depend on which operating system is running, which system user ID runs \fBcw\fP, and which user groups user belongs to. .PP .\" .\" .\" .SH NOTES .\" Despite the fact that this manual page constantly and consistently refers to Morse code elements as dots and dashes, DO NOT think in these terms when trying to learn Morse code. Always think of them as 'dit's and 'dah's. .PP The Morse code table in the \fBcw\fP(7,LOCAL) man page is provided for reference only. If learning for the first time, you will be much better off learning by hearing the characters sent, rather than by looking at the table. .PP Other programs running in the system may interfere with the timing of the Morse code that \fBcw\fP is sending. If this is a problem, either try to run on a quiescent system, or try running \fBcw\fP with nice(1L,C,1). UNIX is not really designed for user-level programs to do the sort of fine timing required to send Morse code. \fBcw\fP is therefore more sensitive than most programs to other system activity. .PP .B cw uses system itimers for its internal timing. On most UNIX flavors, itimers are not guaranteed to signal a program exactly at the specified time, and they generally offer a resolution only as good as the normal system 'clock tick' resolution. An itimer SIGALRM usually falls on a system clock tick, making it accurate to no better than 10mS on a typical 100Hz kernel. .PP The effect of this is that an itimer period is generally either exactly as specified, or, more likely, slightly longer. At higher WPM settings, the cumulative effect of this affects timing accuracy, because at higher speeds, there are fewer 10mS clock ticks in a dot period. For example, at 12 WPM, the dot length is 100mS, enough to contain five kernel clock ticks. But at 60 WPM, the dot length is 20mS, or just two kernel clock ticks. So at higher speeds, the effect of itimer resolutions becomes more pronounced. .PP To test itimer timing, first try .IP X="PARIS PARIS PARIS PARIS " .IP echo "$X" | time cw \-w 4 .PP and note the elapsed time, which should be very close to one minute. Next, try .IP echo "$X$X$X$X$X$X$X$X$X$X$X$X" | time cw \-w 48 .PP The elapsed time should be the same. If it has increased, this is the effect of system itimers delaying for slightly longer than the specified period (higher WPM rates make more itimer calls). That's itimers for you, not perfect for this job, but the best there is without writing some, and perhaps a lot of, kernel code. .PP Except for zero, which is silent, tone values lower than 10Hz may not sound at the expected pitch. .PP .\" .\" .\" .SH EXAMPLES .\" Send a string of characters at 25 WPM, 700Hz, with no extra gaps: .IP echo "UNIX CW SOUNDER" | cw \-w 25 \-t 700 .PP Send a string at varying speeds and tones on the console speaker, specifying a system console device: .IP echo "%W12;%T400;400HZ 12WPM %W25;%T1500;1500HZ 25WPM" | cw \-m \-sc \-d /dev/tty2 .PP Send C-cedilla, VA, and a report of the WPM setting, with extra spacing at half volume: .IP echo "[CE] [VA] %>W" | cw \-g 10 \-v 50 .PP .\" .\" .\" .SH ERRORS AND OMISSIONS .\" Cut numbers are not provided, though they can be emulated, up to a point, by pre-filtering. .PP An output to an optional external device, for example, keying a line on the parallel port, or a serial line, might also be useful. .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBcw\fP(7,LOCAL), \fBlibcw\fP(3,LOCAL), \fBcwgen\fP(1,LOCAL), \fBcwcp\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/cw/Makefile.am0000644000175000017500000000366512451005455016126 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # -include $(top_builddir)/Makefile.inc # program(s) to be built in current dir bin_PROGRAMS = cw # source code files used to build cw program cw_SOURCES = cw.c cw.h # target-specific preprocessor flags (#defs and include dirs) # cw_CPPFLAGS = -I$(top_srcdir)/src/cwutils -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cw_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cw.a # copy man page to proper directory during installation man_MANS = cw.1 # and mark it as distributable, too EXTRA_DIST = cw.1 \ demo.cw prelude.cw test.cw # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -so -f test.cw ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -sa -f test.cw ) || \ ( echo "Retrying with console audio output"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -sc -f test.cw ) unixcw-3.4.2/src/cw/cw.h0000644000175000017500000000462312451005544014646 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #ifndef _CW_H #define _CW_H #if defined(__cplusplus) extern "C" { #endif /* General command and query introducers. */ enum { CW_CMD_ESCAPE = '%', /* Command escape character */ CW_CMD_QUERY = '?', /* Query subcommand */ CW_CMD_CWQUERY = '>', /* CW report query subcommand */ CW_CMD_END = ';' /* Completes an embedded command */ }; /* Specific command value specifiers. */ enum { CW_CMDV_FREQUENCY = 'T', /* CW tone */ CW_CMDV_VOLUME = 'V', /* CW volume */ CW_CMDV_SPEED = 'W', /* CW words-per-minute */ CW_CMDV_GAP = 'G', /* CW extra gaps in sending */ CW_CMDV_WEIGHTING = 'K', /* CW weighting */ CW_CMDV_ECHO = 'E', /* CW echo chars to stdout */ CW_CMDV_ERRORS = 'M', /* CW error msgs to stderr */ CW_CMDV_SOUND = 'S', /* CW creates tones. otherwise silent */ CW_CMDV_COMMANDS = 'C', /* CW responds to @... embedded cmds */ CW_CMDV_COMBINATIONS = 'O', /* CW allows [..] combinations */ CW_CMDV_COMMENTS = 'P', /* CW allows {..} combinations */ CW_CMDV_QUIT = 'Q' /* CW program exit command */ }; /* Combination and comment start and end characters. */ enum { CW_COMBINATION_START = '[', /* Begin [..] */ CW_COMBINATION_END = ']', /* End [..] */ CW_COMMENT_START = '{', /* Begin {..} */ CW_COMMENT_END = '}' /* End {..} */ }; /* Status values - first character of stderr messages. */ enum { CW_STATUS_OK = '=', /* =... command accepted */ CW_STATUS_ERR = '?' /* ?... error in command */ }; #if defined(__cplusplus) } #endif #endif /* _CW_H */ unixcw-3.4.2/src/cw/Makefile.in0000644000175000017500000005713612536122132016135 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = cw$(EXEEXT) subdir = src/cw DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_cw_OBJECTS = cw.$(OBJEXT) cw_OBJECTS = $(am_cw_OBJECTS) cw_DEPENDENCIES = $(top_builddir)/src/cwutils/lib_cw.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(cw_SOURCES) DIST_SOURCES = $(cw_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) 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)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # source code files used to build cw program cw_SOURCES = cw.c cw.h # target-specific preprocessor flags (#defs and include dirs) # cw_CPPFLAGS = -I$(top_srcdir)/src/cwutils -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cw_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cw.a # copy man page to proper directory during installation man_MANS = cw.1 # and mark it as distributable, too EXTRA_DIST = cw.1 \ demo.cw prelude.cw test.cw all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/cw/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cw$(EXEEXT): $(cw_OBJECTS) $(cw_DEPENDENCIES) $(EXTRA_cw_DEPENDENCIES) @rm -f cw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cw_OBJECTS) $(cw_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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 check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 -include $(top_builddir)/Makefile.inc # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -so -f test.cw ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -sa -f test.cw ) || \ ( echo "Retrying with console audio output"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cw -sc -f test.cw ) # 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: unixcw-3.4.2/src/cw/prelude.cw0000644000175000017500000001212711665747037016075 0ustar acerionacerion{ Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) 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. First Prelude in C - J.S. Bach ============================== The following data is an abuse of the CW sender program, using it to sound a short piece of music. The output has no charisma. }[%T523;E%T659;E%T784;E%T1047;E%T1319;E%T784;E%T1047;E%T1319;E{ }%T523;E%T659;E%T784;E%T1047;E%T1319;E%T784;E%T1047;E%T1319;E{ }%T523;E%T587;E%T880;E%T1175;E%T1397;E%T880;E%T1175;E%T1397;E{ }%T523;E%T587;E%T880;E%T1175;E%T1397;E%T880;E%T1175;E%T1397;E{ }%T494;E%T587;E%T784;E%T1175;E%T1397;E%T784;E%T1175;E%T1397;E{ }%T494;E%T587;E%T784;E%T1175;E%T1397;E%T784;E%T1175;E%T1397;E{ }%T523;E%T659;E%T784;E%T1047;E%T1319;E%T784;E%T1047;E%T1319;E{ }%T523;E%T659;E%T784;E%T1047;E%T1319;E%T784;E%T1047;E%T1319;E{ }%T523;E%T659;E%T880;E%T1319;E%T1760;E%T880;E%T1319;E%T1760;E{ }%T523;E%T659;E%T880;E%T1319;E%T1760;E%T880;E%T1319;E%T1760;E{ }%T523;E%T587;E%T741;E%T880;E%T1175;E%T741;E%T880;E%T1175;E{ }%T523;E%T587;E%T741;E%T880;E%T1175;E%T741;E%T880;E%T1175;E{ }%T494;E%T587;E%T784;E%T1175;E%T1568;E%T784;E%T1175;E%T1568;E{ }%T494;E%T587;E%T784;E%T1175;E%T1568;E%T784;E%T1175;E%T1568;E{ }%T494;E%T523;E%T659;E%T784;E%T1047;E%T659;E%T784;E%T1047;E{ }%T494;E%T523;E%T659;E%T784;E%T1047;E%T659;E%T784;E%T1047;E{ }%T440;E%T523;E%T659;E%T784;E%T1047;E%T659;E%T784;E%T1047;E{ }%T440;E%T523;E%T659;E%T784;E%T1047;E%T659;E%T784;E%T1047;E{ }%T294;E%T440;E%T587;E%T741;E%T1047;E%T587;E%T741;E%T1047;E{ }%T294;E%T440;E%T587;E%T741;E%T1047;E%T587;E%T741;E%T1047;E{ }%T392;E%T494;E%T587;E%T784;E%T988;E%T587;E%T784;E%T988;E{ }%T392;E%T494;E%T587;E%T784;E%T988;E%T587;E%T784;E%T988;E{ }%T392;E%T467;E%T659;E%T784;E%T1111;E%T659;E%T784;E%T1111;E{ }%T392;E%T467;E%T659;E%T784;E%T1111;E%T659;E%T784;E%T1111;E{ }%T349;E%T440;E%T587;E%T880;E%T1175;E%T587;E%T880;E%T1175;E{ }%T349;E%T440;E%T587;E%T880;E%T1175;E%T587;E%T880;E%T1175;E{ }%T349;E%T416;E%T587;E%T698;E%T988;E%T587;E%T698;E%T988;E{ }%T349;E%T416;E%T587;E%T698;E%T988;E%T587;E%T698;E%T988;E{ }%T330;E%T392;E%T523;E%T784;E%T1047;E%T523;E%T784;E%T1047;E{ }%T330;E%T392;E%T523;E%T784;E%T1047;E%T523;E%T784;E%T1047;E{ }%T330;E%T349;E%T440;E%T523;E%T698;E%T440;E%T523;E%T698;E{ }%T330;E%T349;E%T440;E%T523;E%T698;E%T440;E%T523;E%T698;E{ }%T294;E%T349;E%T440;E%T523;E%T698;E%T440;E%T523;E%T698;E{ }%T294;E%T349;E%T440;E%T523;E%T698;E%T440;E%T523;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T262;E%T330;E%T392;E%T523;E%T659;E%T392;E%T523;E%T659;E{ }%T262;E%T330;E%T392;E%T523;E%T659;E%T392;E%T523;E%T659;E{ }%T262;E%T392;E%T467;E%T523;E%T659;E%T467;E%T523;E%T659;E{ }%T262;E%T392;E%T467;E%T523;E%T659;E%T467;E%T523;E%T659;E{ }%T175;E%T349;E%T440;E%T523;E%T659;E%T440;E%T523;E%T659;E{ }%T175;E%T349;E%T440;E%T523;E%T659;E%T440;E%T523;E%T659;E{ }%T185;E%T262;E%T440;E%T523;E%T623;E%T440;E%T523;E%T623;E{ }%T185;E%T262;E%T440;E%T523;E%T623;E%T440;E%T523;E%T623;E{ }%T196;E%T312;E%T494;E%T523;E%T623;E%T494;E%T523;E%T623;E{ }%T196;E%T312;E%T494;E%T523;E%T623;E%T494;E%T523;E%T623;E{ }%T208;E%T349;E%T494;E%T523;E%T587;E%T494;E%T523;E%T587;E{ }%T208;E%T349;E%T494;E%T523;E%T587;E%T494;E%T523;E%T587;E{ }%T196;E%T349;E%T392;E%T494;E%T587;E%T392;E%T494;E%T587;E{ }%T196;E%T349;E%T392;E%T494;E%T587;E%T392;E%T494;E%T587;E{ }%T196;E%T330;E%T392;E%T523;E%T659;E%T392;E%T523;E%T659;E{ }%T196;E%T330;E%T392;E%T523;E%T659;E%T392;E%T523;E%T659;E{ }%T196;E%T294;E%T392;E%T523;E%T698;E%T392;E%T523;E%T698;E{ }%T196;E%T294;E%T392;E%T523;E%T698;E%T392;E%T523;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T196;E%T312;E%T440;E%T523;E%T741;E%T440;E%T523;E%T741;E{ }%T196;E%T312;E%T440;E%T523;E%T741;E%T440;E%T523;E%T741;E{ }%T196;E%T330;E%T392;E%T523;E%T784;E%T392;E%T523;E%T784;E{ }%T196;E%T330;E%T392;E%T523;E%T784;E%T392;E%T523;E%T784;E{ }%T196;E%T294;E%T392;E%T523;E%T698;E%T392;E%T523;E%T698;E{ }%T196;E%T294;E%T392;E%T523;E%T698;E%T392;E%T523;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T196;E%T294;E%T392;E%T494;E%T698;E%T392;E%T494;E%T698;E{ }%T131;E%T262;E%T392;E%T467;E%T659;E%T392;E%T467;E%T659;E{ }%T131;E%T262;E%T392;E%T467;E%T659;E%T392;E%T467;E%T659;E{ }%T131;E%T262;E%T349;E%T440;E%T523;E%T698;E%T523;E%T440;E{ }%T523;E%T440;E%T349;E%T440;E%T349;E%T294;E%T349;E%T294;E{ }%T131;E%T247;E%T784;E%T988;E%T1175;E%T1397;E%T1175;E%T988;E{ }%T1175;E%T988;E%T784;E%T988;E%T587;E%T698;E%T659;E%T587;E{ }%T1047;T]{ } unixcw-3.4.2/src/Makefile.in0000644000175000017500000004534112536122132015517 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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 = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = 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 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 \ distdir 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)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # may (or may not) include cwcp and xcwcp SUBDIRS = $(AC_SRC_SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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" 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 distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(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 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: 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 clean-libtool mostlyclean-am distclean: distclean-recursive -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-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 Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # use $(top_builddir) instead of $(top_srcdir) because Makefile.inc is # (re)created at build time; if you use $(top_srcdir), you may (will?) # get empty, non-initialized $(AC_SRC_SUBDIRS); -include $(top_builddir)/Makefile.inc # 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: unixcw-3.4.2/src/cwcp/0000755000175000017500000000000012540354303014401 5ustar acerionacerionunixcw-3.4.2/src/cwcp/Makefile.am0000644000175000017500000000360212451005572016440 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # -include $(top_builddir)/Makefile.inc # program(s) to be built in current dir bin_PROGRAMS = cwcp # source code files used to build cwcp program cwcp_SOURCES = cwcp.c # target-specific preprocessor flags (#defs and include dirs) #cwcp_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cwcp_LDADD = -lcurses -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwcp.a # copy man page to proper directory during installation man_MANS = cwcp.1 # and mark it as distributable, too EXTRA_DIST = cwcp.1 # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -so ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -sa ) || \ ( echo "Retrying with console audio output"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -sc ) unixcw-3.4.2/src/cwcp/cwcp.10000644000175000017500000004762312536121657015444 0ustar acerionacerion.\" .\" Unixcw CW Tutor Package - cwcp .\" Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) .\" Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) .\" .\" 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. .\" .\" .TH CWCP 1 "CW Tutor Package" "cwcp ver. 3.4.2" \" -*- nroff -*- .SH NAME .\" cwcp \- curses-based Morse tutor program .\" .\" .\" .SH SYNOPSIS .\" .B cwcp [\-s\ \-\-system=\fISYSTEM\fP] [\-d\ \-\-device=\fIDEVICE\fP] [\-w\ \-\-wpm=\fIWPM\fP] [\-t\ \-\-tone=\fIHZ\fP] [\-v\ \-\-volume=\fIPERCENT\fP] [\-g\ \-\-gap=\fIGAP\fP] [\-k\ \-\-weighting=\fIWEIGHT\fP] [\-T\ \-\-time=\fITIME\fP] [\-f, \-\-infile=\fIFILE\fP] [\-F, \-\-outifile=\fIFILE\fP] .\"[\-c\ \-\-colours=\fICOLOURSET\fP] .\".BR .\"[\-m\ \-\-mono] .BR [\-h\ \-\-help] [\-V\ \-\-version] .PP \fBcwcp\fP installed on GNU/Linux systems understands both short form and long form command line options. \fBcwcp\fP installed on other operating systems may understand only the short form options. .PP There are no mandatory options. .PP Options may be predefined in the environment variable \fBCWCP_OPTIONS\fP. If defined, these options are used first; command line options take precedence. .PP .\" .\" .\" .SH DESCRIPTION .\" .PP \fBcwcp\fP is a curses-based interactive Morse code tutor program. It allows menu selection from a number of sending modes, and also permits character sounding options, such as the tone pitch, and sending speed, to be varied from the keyboard using a full-screen user interface. .PP .\" .\" .\" .SS COMMAND LINE OPTIONS .\" .B cwcp understands the following command line options. The long form options may not be available in non-LINUX versions. .TP .I "\-s, \-\-system=SYSTEM" Specifies the way that \fBcwcp\fP generates tones. Valid values are: \fInull\fP for no tones, just timings, \fIconsole\fP for tones through the console speaker, \fIalsa\fP for tones generated through the system sound card using ALSA sound system, \fIoss\fP for tones generated through system sound card using OSS sound system, \fIpulseaudio\fP for tones generated through system sound card using PulseAudio sound system, \fIsoundcard\fP for tones generated through the system sound card, but without explicit selection of sound system. These values can be shortened to 'n', 'c', 'a', 'o', 'p', or 's', respectively. The default value is 'pulseaudio'. .TP .I "\-d, \-\-device=DEVICE" Specifies the device file to open for generating a sound. \fBcwcp\fP will use default device if none is specified. The default devices are: \fI/dev/console\fP for sound produced through console, \fIdefault\fP for ALSA sound system, \fI/dev/audio\fP for OSS sound system, \fIa default device\fP for PulseAudio sound system. See also \fINOTES ON USING A SOUND CARD\fP below. .TP .I "\-w, \-\-wpm=WPM" Sets the initial sending speed in words per minute. The value must be between 4 and 60. The default value is 12 WPM. .TP .I "\-t, \-\-tone=HZ" Sets the initial sounder pitch in Hz. This value must be between 0 and 4,000. A value of 0 selects silent operation, and can be used for timing checks or other testing. The default value is 800Hz, .TP .I "\-v, \-\-volume=PERCENT" Sets the initial sending volume, as a percentage of full scale volume. The value must be between 0 and 100. The default value is 70 %. Sound volumes work fully for sound card tones, but \fBcwcp\fP cannot control the volume of tones from the console speaker. In this case, a volume of zero is silent, and all other volume values are simply sounded. .TP .I "\-g, \-\-gap=GAP" Sets the initial extra gap, in dot lengths, between characters (the 'Farnsworth' delay). It must be between 0 and 60. The default is 0. .TP .I "\-k, \-\-weighting=WEIGHT" Sets the initial weighting, as a percentage of dot lengths. It must be between 20 and 80. The default is 50. .TP .I "\-T, \-\-time=TIME" Sets the initial practice time, in minutes. \fBcwcp\fP stops after generating random Morse code for this period. The value must be between 1 and 99. The default is 15 minutes. .TP .I "\-f, \-\-infile=FILE" Specifies a text file that \fBcwcp\fP can read to configure its practice text. See \fICREATING CONFIGURATION FILES\fP below. .TP .I "\-F, \-\-outfile=FILE" Specifies a text file to which \fBcwcp\fP should write its current practice text. .\".TP .\".I "\-c, \-\-colours, \-\-colors" .\"This option specifies an initial colour set for \fBcwcp\fP. The colour .\"set is specified as four integers, in the range 0 to 7, separated by .\".\"commas. These integers set the display foregrounds, the display .\"backgrounds, the box foregrounds, and the box backgrounds. The .\"available colours are, in order, black, red, green, yellow, blue, .\"magenta, cyan, and white. The default colour set is "7,4,7,0". .\"If \fI\-m\fP or \fI\-\-mono\fP is given, this option is ignored. .\".TP .\".I "\-m, \-\-mono" .\"This option tells \fBcwcp\fP not to attempt to produce a colour .\"display. Where colours are not possible, or monochrome .\"requested, \fBcwcp\fP will use reverse video within its windows to .\"create its interface. If this option is given, any \fI\-c\fP .\"or \fI\-\-colours\fP is ignored. .TP .I "\-h, \-\-help" Prints short help message. .TP .I "\-V, \-\-version" Prints information about program's version, authors and license. .PP .\" .\" .\" .SS USER INTERFACE .\" \fBcwcp\fP is a curses-based program that takes over the complete operation of the terminal on which it is run. If colours are available on the terminal, it will produce a colour interface. .PP The \fBcwcp\fP screen is divided into several distinct areas: .TP .I "The Menu Selection window" The Menu Selection window shows the main modes that \fBcwcp\fP offers. Use the \fIF10\fP and \fIF11\fP or \fIKEY_DOWN\fP and \fIKEY_UP\fP keys to select the mode. \fIF9\fP or \fIReturn\fP start sending, and \fIF9\fP again or \fIEsc\fP stop sending. Changing mode also stops sending. .TP .I "The Morse Code Display window" This window displays each Morse code character after it has been sent. .TP .I "The Speed Control window" The Speed window shows the current Morse code sending speed in words per minute. Pressing the \fIF2\fP or \fIKEY_RIGHT\fP keys increases the speed; pressing the \fIF1\fP or \fIKEY_LEFT\fP keys decreases the speed. .TP .I "The Tone Control window" This window shows the current Morse code tone pitch. Use the \fIF4\fP or \fIKEY_HOME\fP key to increase the pitch, and the \fIF3\fP or \fIKEY_END\fP key to decrease it. Values change in steps of 20Hz. .TP .I "The Volume Control window" This window shows the current Morse code volume. Use the \fIF6\fP key to increase the volume, and the \fIF5\fP key to decrease it. Values change in steps of 1%. Note that \fBcwcp\fP cannot control the volume of the console speaker, so the volume control only works effectively for tones generated on the sound card. .TP .I "The Gap Control window" This window shows the current additional 'Farnsworth' gaps to be appended after each Morse code character is sounded. Use \fIF8\fP to increase the gap, and \fIF7\fP to decrease it. .TP .I "The Time Control window" This window shows the selected practice time. After generating Morse code in a particular mode for this amount of time, \fBcwcp\fP stops automatically. Use \fIKEY_NPAGE\fP to increase the time, and \fIKEY_PPAGE\fP to decrease it. During sending, the value in this window counts down to one, and after final minute of sending has elapsed, \fBcwcp\fP stops sending. The timer operates like a microwave or kitchen timer; it counts down on its own, but the time remaining can also be altered manually while the timer operates. .PP The following keys vary the screen colours: .TP .I "{ key" Changes the foreground colour of the window boxes. .TP .I "} key" Changes the background colour of the window boxes. .TP .I "[ key" Changes the foreground colour of the window contents. .TP .I "] key" Changes the background colour of the window contents. .PP Eight screen colours are available for each: black, red, green, yellow, blue, magenta, cyan, and white. Use a key to cycle round these colours for the particular part of the display controlled by that key. On a change of colours, the complete screen is repainted. .PP Use \fICtrl\-L\fP to repaint the complete screen, in case of screen corruption. Use \fICtrl\-V\fP to clear the Morse Code Display Window. This command is available only when \fBcwcp\fP is not sending. .PP To leave \fBcwcp\fP, press \fIF12\fP or \fICtrl-C\fP, or select \fIExit\fP on the mode menu. .PP All of the above command keys may be used while random characters are being sent, and when keyboard input is being sent. .PP If function keys are not available on the terminal, \fICtrl-\fP combinations can be used. On the top row of letter keys on the keyboard, the keys \fICtrl-Q\fP to \fICtrl-I\fP may be used as alternatives for \fIF1\fP to \fIF8\fP, and on the second row of letter keys, \fICtrl-A\fP to \fICtrl-F\fP as alternatives for \fIF9\fP to \fIF12\fP. For \fIKEY_PPAGE\fP and \fIKEY_NPAGE\fP, use \fICtrl-O\fP and \fICtrl-P\fP. .PP .\" .\" .\" .SS RANDOM CHARACTERS AND WORDS .\" .B cwcp sends random characters in groups of five, with a space between each group. After a period of sending, set in the \fITime Control window\fP, \fBcwcp\fP stops automatically. It can also be stopped manually, before this time period expires. .PP When sending random words, \fBcwcp\fP sends the complete word, followed by a space. Because short words are easier to copy without writing, \fBcwcp\fP's default dictionary contains only three, four, and five-letter words in its random words list. .PP .B cwcp chooses at random from a list of around 3000 words in its default dictionary. You can change this text using a configuration file, read at startup. See \fICREATING CONFIGURATION FILES\fP below. .PP .\" .\" .\" .SS NOTES ON USING A SOUND CARD .\" By default, \fBcw\fP tries to open default PulseAudio. If PulseAudio server is not accessible, cw tries to open OSS device "/dev/audio" to access the system sound card. This is generally the correct device to use, but for systems with special requirements, or those with multiple sound cards, the option \fI-d\fP or \fI\-\-device\fP, combined with \fI-s\fP or \fI\-\-system\fP can be used to specify the device and audio system for sound card access. If the sound card device cannot be set up, \fBcwcp\fP prints the error message .IP cannot set up soundcard sound .PP and exits. .PP Sound card devices, when opened through OSS sound system, are usually single-access devices, so that when one process has opened the device, other processes are prevented from using it. In such cases \fBcwcp\fP will of course conflict with any other programs that expect exclusive use of the system sound card (for example, MP3 players). If \fBcwcp\fP finds that the sound card is already busy, it prints the error message .IP open /dev/audio: Device or resource busy .PP and exits. .PP .\" The main sound card device will often allow \fBcwcp\fP to control tone .\" volumes directly, but where this is not possible, \fBcwcp\fP uses the .\" mixer device instead. By default, this is "/dev/mixer", but the device .\" can be specified with the \fI-y\fP or \fI\-\-mdevice\fP options. In .\" general, as with the main sound card device, the default mixer device .\" is usually the correct one to use. .\" .PP .\" The mixer device is only used if the sound card does not allow volume .\" control through the main sound card device. .PP The sound card device is not used if \fBcwcp\fP is only sending tones on the console speaker. .PP .\" .\" .\" .SS AUDIO OUTPUT \- DEFAULTS AND SELECTION .\" \fBcwcp\fP first tries to access sound card using PulseAudio sound system, using default device name, unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP \fBcwcp\fP then tries to access sound card using OSS audio system and default OSS audio device name ('/dev/audio'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through OSS fails, \fBcwcp\fP tries to access the sound card using ALSA audio system, and default ALSA audio device name ('default'), unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP If opening soundcard through ALSA also fails, \fBcwcp\fP tries to access system console buzzer using default buzzer device '/dev/console', unless user specifies other audio device with option \fI-d\fP or \fI\-\-device\fP. .PP It is very common that in order to access the console buzzer device user has to have root privileges. For that reason trying to open console buzzer almost always fails. This is not a program's bug, this is a result of operating system's restrictions. Making \fBcwcp\fP an suid binary bypasses this restriction. The program does not fork() or exec(), so making it suid should be relatively safe. Note however that this practice is discouraged for security reasons. .PP As stated, user can tell \fBcwcp\fP which device to use, using \fI-d\fP or \fI\-\-device\fP option. Which device files are suitable will depend on which operating system is running, which system user ID runs \fBcwcp\fP, and which user groups user belongs to. .PP .\" .\" .\" .SS CREATING CONFIGURATION FILES .\" \fBcwcp\fP contains a default set of modes and practice text that should be enough to begin with. It can however read in a file at startup that reconfigures these to provide different character groupings, word sets, and other practice data. .PP To read a configuration file, use the \fI-f\fP or \fI\-\-infile\fP command line options. The file should introduce each \fBcwcp\fP mode with a section header in '[' ... ']' characters, followed by the practice text for that mode, with elements separated by whitespace. Lines starting with a semicolon or hash are treated as comments. For example .IP ; Simple example mode .br [ A to Z ] .br A B C D E F G H I J K L M N O P Q R S T U V W X Y Z .PP .B cwcp will generate five character groups for modes whose elements are all single characters, and treat other modes as having elements that are complete words. As a starting point for customized modes, \fBcwcp\fP will write its default configuration to a file if given the undocumented \fI-#\fP option, for example "cwcp -# /tmp/cwcp.ini". .\" .\" .\" .SH NOTES .\" .B cwcp owes its existence to the DOS Morse code tutor CP222C.EXE, by VU2ZAP. CP222C.EXE seemed to offer the right range of facilities for learning Morse code in a simple, easy-to-use, and compact package. \fBcwcp\fP is very much modeled on that DOS program, and should prove useful both for learning the code, and for experienced CW users who want, or need, to improve their receiving speed. .PP Curses may impose a delay when recognizing the \fIEsc\fP key alone, as this character is often the first of a sequence generated by a function key. \fBcwcp\fP responds instantly to \fIF9\fP. .PP The characters echoed in the Morse Code Display window may be ASCII representations of Morse procedural signals; see the \fBcw\fP(7,LOCAL) man page for details. .PP .\" .\" .\" .SS HINTS ON LEARNING MORSE CODE .\" Here are a few hints and tips that may help with the process of learning Morse code. .PP Firstly, do \fBNOT\fP think of the elements as dots and dashes. Instead, think of them as dits and dahs (so 'A' is di-dah). If you think of them in this way, the process of translating sound into characters will be learned much more easily. .PP Do not learn the characters from a table. Learn them by watching the groups appear on the screen, and listening to the sounds produced as each is sent. In the very initial stages, it may be beneficial if you can find a person to take you through the first stages of recognizing characters. .PP Do not waste your time learning Morse code at 5 WPM. Set the speed to 12 or 15 WPM, but use extra spacing (the Gap window) to reduce the effective speed to much lower - around four or five WPM \fIeffective\fP speed. This way, you will learn the rhythm of the characters as they are sent, but still have plenty of time between characters. As you practice, decrease the gap to zero. .PP Learn in stages. Start by learning the \fIEISH5\fP group, then progress down through the menu as each group is mastered. The groups contain characters which are in some way related, either by sound, or by type of character. .PP .\" \[u0022] = ", otherwise emacs syntax highlighting is messed up; Once you have completed all the groups \fIEISH5\fP to \fI\[u0022]'$(+:_\fP (or \fI23789\fP if you do not want to learn procedural signals yet), use the full character set options, and the words and CW words options, to sharpen your skill. If you have difficulties with particular characters, return to that group and practice again with a smaller character set. .PP Resist the temptation to try to learn or improve your speed by copying off-air. You will not know what speed you are working at, and much hand-sent Morse is not perfectly formed. What you can gain off-air though is a general 'resilience', a tolerance for Morse code where the timing of individual elements, or spacing between characters and words, is not 100% accurate. .PP If working to attain a particular speed for a test, always set the speed slightly higher. For example, if aiming for 12 WPM, set the tutor speed to 14 or 15 WPM. This way, when you drop back to 12 WPM you will feel much more relaxed about copying. Be aware that \fBcwcp\fP is not necessarily going to send at exactly the speed you set, due to limitations in what can be done with UNIX timers. It often sends at a slower speed than you set, so be very careful with this if you have a target speed that you need to reach. .PP Use the program to make cassette tapes that you can take with you in a walkman or in the car, for long journeys. You do not have to write down everything you hear to practice Morse code. Simply listening to the shapes of characters over a period will help to train your brain into effortless recognition. In fact, slavishly writing everything down becomes a barrier at speeds of 15-20 WPM and above, so if you can begin to copy without writing each character down, you will find progress much easier above these speeds. But do not over-use these tapes, otherwise you will quickly memorize them. Re-record them with new contents at very regular intervals. .PP Try to spend at least 15-30 minutes each day practicing. Much less than this will make progress glacially slow. But significantly more than an hour or so may just result in you becoming tired, but not improving. Recognize when it is time to stop for the day. .PP Do not worry if you reach a speed 'plateau'. This is common, and you will soon pass it with a little perseverance. .PP At higher speeds, CW operators tend to recognize the 'shape' of whole words, rather than the individual characters within the words. The CW words menu option can be used to help to practice and develop this skill. .PP .\" .\" .\" .SH ERRORS AND OMISSIONS .\" The calibration option is a bit ropy. It simply sends PARIS repeatedly, and relies on you to time the sending and then work out if any adjustment to the speed is really necessary. Automatic calibration by making measurements over a given period would be a lot better. .PP Generating random CW QSOs would be fun to do. .PP A facility to allow a user to key Morse into the system, and to have it send code, and measure the accuracy of keying, would be nice. .PP .\" .\" .\" .SH SEE ALSO .\" Man pages for \fBcw\fP(7,LOCAL), \fBlibcw\fP(3,LOCAL), \fBcw\fP(1,LOCAL), \fBcwgen\fP(1,LOCAL), and \fBxcwcp\fP(1,LOCAL). .\" unixcw-3.4.2/src/cwcp/cwcp.c0000644000175000017500000012035412536121470015510 0ustar acerionacerion/* * Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) * Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) * * 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. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_STRING_H) # include #endif #if defined(HAVE_STRINGS_H) # include #endif #include "libcw.h" #include "i18n.h" #include "cmdline.h" #include "cw_copyright.h" #include "dictionary.h" #include "memory.h" /*---------------------------------------------------------------------*/ /* Module variables, miscellaneous other stuff */ /*---------------------------------------------------------------------*/ /* Flag set if colors are requested on the user interface. */ static bool do_colors = true; /* Are we at the beginning of buffer displaying played characters? */ static bool beginning_of_buffer = true; /* Current sending state, active or idle. */ static bool is_sending_active = false; /* Width of parameter windows, displayed at the bottom of window. Since the same value is used as size of char buffer, make one character for terminating NUL explicit as +1. */ #define CWCP_PARAM_WIDTH (15 + 1) static cw_config_t *config = NULL; /* program-specific configuration */ static bool generator = false; /* have we created a generator? */ static const char *all_options = "s:|system,d:|device," "w:|wpm,t:|tone,v:|volume," "g:|gap,k:|weighting," "f:|infile,F:|outfile," "T:|time," /* "c:|colours,c:|colors,m|mono," */ "h|help,V|version"; static WINDOW *screen = NULL, *text_window = NULL, *text_subwindow = NULL, *mode_window = NULL, *mode_subwindow = NULL, *speed_window = NULL, *speed_subwindow = NULL, *tone_window = NULL, *tone_subwindow = NULL, *volume_window = NULL, *volume_subwindow = NULL, *gap_window = NULL, *gap_subwindow = NULL, *timer_window = NULL, *timer_subwindow = NULL; static void cwcp_atexit(void); static int timer_get_total_practice_time(void); static bool timer_set_total_practice_time(int practice_time); static void timer_start(void); static bool timer_is_expired(void); static void timer_window_update(int elapsed, int total); static void speed_update(void); static void frequency_update(void); static void volume_update(void); static void gap_update(void); typedef enum { M_DICTIONARY, M_KEYBOARD, M_EXIT } mode_type_t; static void mode_initialize(void); static void mode_clean(void); static bool mode_change_to_next(void); static bool mode_change_to_previous(void); static int mode_get_current(void); static int mode_get_count(void); static const char *mode_get_description(int index); static bool mode_current_is_type(mode_type_t type); static bool mode_is_sending_active(void); /* Definition of an interface operating mode; its description, related dictionary, and data on how to send for the mode. */ struct mode_s { const char *description; /* Text mode description */ mode_type_t type; /* Mode type; {M_DICTIONARY|M_KEYBOARD|M_EXIT} */ const cw_dictionary_t *dict; /* Dictionary, if type is dictionary */ }; typedef struct mode_s *moderef_t; /* Modes table, current program mode, and count of modes in the table. The program is always in one of these modes, indicated by current_mode. */ static moderef_t modes = NULL, current_mode = NULL; static int modes_count = 0; static int queue_get_length(void); static int queue_next_index(int index); static int queue_prior_index(int index); static void queue_display_add_character(void); static void queue_display_delete_character(void); static void queue_display_highlight_character(bool is_highlight); static void queue_discard_contents(void); static void queue_dequeue_character(void); static void queue_enqueue_string(const char *word); static void queue_enqueue_character(char c); static void queue_enqueue_random_dictionary_text(moderef_t mode, bool beginning_of_buffer); static void queue_transfer_character_to_libcw(void); static void queue_delete_character(void); static void ui_refresh_main_window(void); static void ui_display_state(const char *state); static void ui_clear_main_window(void); static void ui_poll_user_input(int fd, int usecs); static void ui_update_mode_selection(int old_mode, int current_mode); static void ui_handle_event(int c); static void ui_destroy(void); static void ui_initialize(void); static WINDOW *ui_init_window(int lines, int columns, int begin_y, int begin_x, const char *header); static void ui_init_display(int lines, int columns, int begin_y, int begin_x, const char *header, WINDOW **window, WINDOW **subwindow); static WINDOW *ui_init_screen(void); static void signal_handler(int signal_number); static void state_change_to_active(void); static void state_change_to_idle(void); /*---------------------------------------------------------------------*/ /* Circular character queue */ /*---------------------------------------------------------------------*/ /* Characters awaiting send are stored in a circular buffer, implemented as an array with tail and head indexes that wrap. */ enum { QUEUE_CAPACITY = 256 }; static volatile char queue_data[QUEUE_CAPACITY]; static volatile int queue_tail = 0, queue_head = 0; /* There are times where we have no data to send. For these cases, record as idle, so that we know when to wake the sender. */ static volatile bool is_queue_idle = true; /** \brief Return the count of characters currently held in the circular buffer */ int queue_get_length(void) { return queue_tail >= queue_head ? queue_tail - queue_head : queue_tail - queue_head + QUEUE_CAPACITY; } /** \brief Advance a tone queue index, including circular wrapping */ int queue_next_index(int index) { return (index + 1) % QUEUE_CAPACITY; } /** \brief Regress a tone queue index, including circular wrapping */ int queue_prior_index(int index) { return index == 0 ? QUEUE_CAPACITY - 1 : index - 1; } /** Add a character to the text display when queueing */ void queue_display_add_character(void) { /* Append the last queued character to the text display. */ if (queue_get_length() > 0) { waddch(text_subwindow, toupper(queue_data[queue_tail])); wrefresh(text_subwindow); } return; } /** Delete a character to the text display when dequeueing */ void queue_display_delete_character(void) { int y, x, max_x; __attribute__((unused)) int max_y; /* Get the text display dimensions and current coordinates. */ getmaxyx(text_subwindow, max_y, max_x); getyx(text_subwindow, y, x); /* Back the cursor up one position. */ x--; if (x < 0) { x += max_x; y--; } /* If these coordinates are on screen, write a space and back up. */ if (y >= 0) { wmove(text_subwindow, y, x); waddch(text_subwindow, ' '); wmove(text_subwindow, y, x); wrefresh(text_subwindow); } return; } /** Highlight or un-highlight a character in the text display when dequeueing */ void queue_display_highlight_character(bool is_highlight) { int y, x, max_x; __attribute__((unused)) int max_y; /* Get the text display dimensions and current coordinates. */ getmaxyx(text_subwindow, max_y, max_x); getyx(text_subwindow, y, x); /* Find the coordinates for the queue head character. */ x -= queue_get_length() + 1; while (x < 0) { x += max_x; y--; } /* If these coordinates are on screen, highlight or unhighlight, and then restore the cursor position so that it remains unchanged. */ if (y >= 0) { int saved_y, saved_x; getyx(text_subwindow, saved_y, saved_x); wmove(text_subwindow, y, x); waddch(text_subwindow, is_highlight ? winch(text_subwindow) | A_REVERSE : winch(text_subwindow) & ~A_REVERSE); wmove(text_subwindow, saved_y, saved_x); wrefresh(text_subwindow); } return; } /** \brief Forcibly empty the queue, if not already idle */ void queue_discard_contents(void) { if (!is_queue_idle) { queue_display_highlight_character(false); queue_head = queue_tail; is_queue_idle = true; } return; } /** \brief Dequeue a character Called when the CW send buffer is empty. If the queue is not idle, take the next character from the queue and send it. If there are no more queued characters, set the queue to idle. */ void queue_dequeue_character(void) { if (!is_queue_idle) { /* Unhighlight any previous highlighting, and see if we can dequeue. */ queue_display_highlight_character(false); if (queue_get_length() > 0) { char c; /* Take the next character off the queue, highlight, and send it. We don't expect sending to fail because only sendable characters are queued. */ queue_head = queue_next_index(queue_head); c = queue_data[queue_head]; queue_display_highlight_character(true); if (!cw_send_character(c)) { perror("cw_send_character"); abort(); } } else { is_queue_idle = true; } } return; } /** \brief Queue a string for sending by the CW sender Function rejects any unsendable character, and also any characters passed in where the character queue is already full. Rejection is silent. \param word - string to send */ void queue_enqueue_string(const char *word) { bool is_queue_notify = false; for (int i = 0; word[i] != '\0'; i++) { char c = toupper(word[i]); if (cw_character_is_valid(c)) { /* Calculate the new character queue tail. If the new value will not hit the current queue head, add the character to the queue. */ if (queue_next_index(queue_tail) != queue_head) { queue_tail = queue_next_index(queue_tail); queue_data[queue_tail] = c; queue_display_add_character(); if (is_queue_idle) { is_queue_notify = true; } } } } /* If we queued any character, mark the queue as not idle. */ if (is_queue_notify) { is_queue_idle = false; } return; } /** \brief Queue a character for sending by the CW sender Function rejects any unsendable character, and also any characters passed in where the character queue is already full. Rejection is silent. \param c - character to send */ void queue_enqueue_character(char c) { char buffer[2]; buffer[0] = c; buffer[1] = '\0'; queue_enqueue_string(buffer); return; } /** \brief Delete the most recently added character from the queue Remove the most recently added character from the queue, provided that the dequeue hasn't yet reached it. If there's nothing available to delete, fail silently. */ void queue_delete_character(void) { /* If data is queued, regress tail and delete one display character. */ if (queue_get_length() > 0) { queue_tail = queue_prior_index(queue_tail); queue_display_delete_character(); } return; } /** Add a group of elements from current dictionary to cwcp's character queue Function adds a group of letters, or a word, to cwcp's character queue. The group or the word is then played and displayed in main window. The function also enqueues space separating words/groups if \p beginning is true. You want to pass true only for first call of the function for given mode (only when the program should queue and play first group/word). \param mode - mode determining from which dictionary to get elements \param beginning - are we at the beginning of buffer/window? */ void queue_enqueue_random_dictionary_text(moderef_t mode, bool beginning) { if (!beginning) { queue_enqueue_character(' '); } /* Size of group of letters that will be printed together to main window of cwcp. '1' for dictionaries consisting of multi-character words (so you get single words separated with spaces), or '5' for single-character words (so you get 5-letter chunks separated with spaces). */ int group_size = cw_dictionary_get_group_size(mode->dict); /* Select and buffer N random elements selected from dictionary. */ for (int group = 0; group < group_size; group++) { /* For dictionaries with size of word in dictionary == 1 this returns single letters. */ queue_enqueue_string(cw_dictionary_get_random_word(mode->dict)); } return; } /** Check the libcw's tone queue, and if it is getting low, arrange for more data to be passed in to the libcw's tone queue. */ void queue_transfer_character_to_libcw(void) { if (cw_get_tone_queue_length() > 1) { return; } if (!is_sending_active) { return; } /* Arrange more data for libcw. The source for this data is dependent on the mode. If in dictionary modes, update and check the timer, then add more random data if the queue is empty. If in keyboard mode, just dequeue anything currently on the character queue. */ if (current_mode->type == M_DICTIONARY) { if (timer_is_expired()) { state_change_to_idle(); return; } if (queue_get_length() == 0) { queue_enqueue_random_dictionary_text(current_mode, beginning_of_buffer); if (beginning_of_buffer) { beginning_of_buffer = false; } } } if (current_mode->type == M_DICTIONARY || current_mode->type == M_KEYBOARD) { queue_dequeue_character(); } return; } /*---------------------------------------------------------------------*/ /* Practice timer */ /*---------------------------------------------------------------------*/ static const int TIMER_MIN_TIME = 1, TIMER_MAX_TIME = 99; /* practice timer limits */ static int timer_total_practice_time = 15; /* total time of practice, from beginning to end */ static int timer_practice_start = 0; /* time() value on practice start */ /** \brief Get current value of total time of practice */ int timer_get_total_practice_time(void) { return timer_total_practice_time; } /** \brief Set total practice time Set total time (total duration) of practice. \param practice_time - new value of total practice time \return true on success \return false on failure */ bool timer_set_total_practice_time(int practice_time) { if (practice_time >= TIMER_MIN_TIME && practice_time <= TIMER_MAX_TIME) { timer_total_practice_time = practice_time; return true; } else { return false; } } /** \brief Set the timer practice start time to the current time */ void timer_start(void) { timer_practice_start = time(NULL); return; } /** \brief Update the practice timer, and return true if the timer expires \return true if timer has expired \return false if timer has not expired yet */ bool timer_is_expired(void) { /* Update the display of minutes practiced. */ int elapsed = (time(NULL) - timer_practice_start) / 60; timer_window_update(elapsed, timer_total_practice_time); /* Check the time, requesting stop if over practice time. */ return elapsed >= timer_total_practice_time; } /** \brief Update value of time spent on practicing Function updates 'timer display' with one or two values of practice time: time elapsed and time total. Both times are in minutes. You can pass a negative value of \p elapsed - function will use previous valid value (which is zero at first time). \param elapsed - time elapsed from beginning of practice \param total - total time of practice */ void timer_window_update(int elapsed, int total) { static int el = 0; if (elapsed >= 0) { el = elapsed; } char buffer[CWCP_PARAM_WIDTH]; snprintf(buffer, CWCP_PARAM_WIDTH, total == 1 ? _("%2d/%2d min ") : _("%2d/%2d mins"), el, total); mvwaddstr(timer_subwindow, 0, 2, buffer); wrefresh(timer_subwindow); return; } /*---------------------------------------------------------------------*/ /* General program state and mode control */ /*---------------------------------------------------------------------*/ /** \brief Initialize modes Build up the modes from the known dictionaries, then add non-dictionary modes. */ void mode_initialize(void) { if (modes) { /* Dispose of any pre-existing modes -- unlikely. */ free(modes); modes = NULL; } /* Start the modes with the known dictionaries. */ int count = 0; for (const cw_dictionary_t *dict = cw_dictionaries_iterate(NULL); dict; dict = cw_dictionaries_iterate(dict)) { modes = safe_realloc(modes, sizeof (*modes) * (count + 1)); modes[count].description = cw_dictionary_get_description(dict); modes[count].type = M_DICTIONARY; modes[count++].dict = dict; } /* Add keyboard, exit, and null sentinel. */ modes = safe_realloc(modes, sizeof (*modes) * (count + 3)); modes[count].description = _("Keyboard"); modes[count].type = M_KEYBOARD; modes[count++].dict = NULL; modes[count].description = _("Exit (F12)"); modes[count].type = M_EXIT; modes[count++].dict = NULL; memset(modes + count, 0, sizeof (*modes)); /* Initialize the current mode to be the first listed, and set count. */ current_mode = modes; modes_count = count; return; } /** \brief Free data structures relates to modes Call this function at exit */ void mode_clean(void) { free(modes); modes = NULL; return; } /** \brief Get count of modes */ int mode_get_count(void) { return modes_count; } /** \brief Get index of the current mode */ int mode_get_current(void) { return current_mode - modes; } /** \brief Get description of a mode at given index */ const char *mode_get_description(int index) { return modes[index].description; } /** \brief Get result of a type comparison for the current mode */ bool mode_current_is_type(mode_type_t type) { return current_mode->type == type; } /** \brief Change the mode to next one Advance the current node, returning false if at the limit. \return true if mode has been changed \return false if mode has not been changed because it was the last on list */ bool mode_change_to_next(void) { current_mode++; if (!current_mode->description) { current_mode--; return false; } else { return true; } } /** \brief Change the mode to previous one Regress the current node, returning false if at the limit. \return true if mode has been changed \return false if mode has not been changed because it was the first on list */ bool mode_change_to_previous(void) { if (current_mode > modes) { current_mode--; return true; } else { return false; } } /** \brief Change the state of the program from idle to actively sending. */ void state_change_to_active(void) { static moderef_t last_mode = NULL; /* Detect changes of mode */ if (is_sending_active) { return; } cw_start_beep(); is_sending_active = true; ui_display_state(_("Sending(F9 or Esc to exit)")); if (current_mode != last_mode) { ui_clear_main_window(); timer_start(); /* Don't allow a space at the beginning of buffer. */ beginning_of_buffer = true; last_mode = current_mode; } ui_refresh_main_window(); return; } /** Change the state of the program from actively sending to idle. */ void state_change_to_idle(void) { if (!is_sending_active) { return; } is_sending_active = false; ui_display_state(_("Start(F9)")); touchwin(text_subwindow); wnoutrefresh(text_subwindow); doupdate(); /* Remove everything in the outgoing character queue. */ queue_discard_contents(); cw_end_beep(); return; } /** \brief Check if sending is active \return true if currently sending \return false otherwise */ bool mode_is_sending_active(void) { return is_sending_active; } /*---------------------------------------------------------------------*/ /* User interface initialization and event handling */ /*---------------------------------------------------------------------*/ /* * User interface introduction strings, split in two to avoid the 509 * character limit imposed by ISO C89 on string literal lengths. */ static const char *const INTRODUCTION = N_( "UNIX/Linux Morse Tutor v3.4.2\n" "Copyright (C) 1997-2006 Simon Baldwin\n" "Copyright (C) 2011-2015 Kamil Ignacak\n" "---------------------------------------------------------\n" "Cwcp is an interactive Morse code tutor program, designed\n" "both for learning Morse code for the first time, and for\n" "experienced Morse users who want, or need, to improve\n" "their receiving speed.\n"); static const char *const INTRODUCTION_CONTINUED = N_( "---------------------------------------------------------\n" "Select mode: Up/Down arrow/F10/F11\n" "Start sending selected mode: Enter/F9\n" "Pause: F9/Esc\n" "Resume: F9\n" "Exit program: menu->Exit/F12/^C\n" "Use keys specified below to adjust speed, tone, volume,\n" "and spacing of the Morse code at any time.\n"); /* Alternative F-keys for folks without (some, or all) F-keys. */ enum { CTRL_OFFSET = 0100, /* Ctrl keys are 'X' - 0100 */ PSEUDO_KEYF1 = 'Q' - CTRL_OFFSET, /* Alternative FKEY1 */ PSEUDO_KEYF2 = 'W' - CTRL_OFFSET, /* Alternative FKEY2 */ PSEUDO_KEYF3 = 'E' - CTRL_OFFSET, /* Alternative FKEY3 */ PSEUDO_KEYF4 = 'R' - CTRL_OFFSET, /* Alternative FKEY4 */ PSEUDO_KEYF5 = 'T' - CTRL_OFFSET, /* Alternative FKEY5 */ PSEUDO_KEYF6 = 'Y' - CTRL_OFFSET, /* Alternative FKEY6 */ PSEUDO_KEYF7 = 'U' - CTRL_OFFSET, /* Alternative FKEY7 */ PSEUDO_KEYF8 = 'I' - CTRL_OFFSET, /* Alternative FKEY8 */ PSEUDO_KEYF9 = 'A' - CTRL_OFFSET, /* Alternative FKEY9 */ PSEUDO_KEYF10 = 'S' - CTRL_OFFSET, /* Alternative FKEY10 */ PSEUDO_KEYF11 = 'D' - CTRL_OFFSET, /* Alternative FKEY11 */ PSEUDO_KEYF12 = 'F' - CTRL_OFFSET, /* Alternative FKEY12 */ PSEUDO_KEYNPAGE = 'O' - CTRL_OFFSET, /* Alternative PageDown */ PSEUDO_KEYPPAGE = 'P' - CTRL_OFFSET /* Alternative PageUp */ }; /* User interface event loop running flag. */ static bool is_running = true; /* Color definitions. */ static const short color_array[] = { COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; enum { COLORS_COUNT = sizeof (color_array) / sizeof (color_array[0]) }; enum { DISPLAY_EXTERNAL_COLORS = 1, /* Normal color pair */ DISPLAY_INTERNAL_COLORS = 2, /* Blue color pair */ DISPLAY_FOREGROUND = 7, /* White foreground */ DISPLAY_BACKGROUND = 4, /* Blue background */ BOX_FOREGROUND = 7, /* White foreground */ BOX_BACKGROUND = 0 /* Black background */ }; /* Color values as arrays into color_array. */ static int display_foreground = DISPLAY_FOREGROUND, /* White foreground */ display_background = DISPLAY_BACKGROUND, /* Blue background */ box_foreground = BOX_FOREGROUND, /* White foreground */ box_background = BOX_BACKGROUND; /* Black background */ /** \brief Initialize main window */ WINDOW *ui_init_screen(void) { /* Create the main window for the complete screen. */ WINDOW *window = initscr(); wrefresh(window); /* If using colors, set up a base color for the screen. */ if (do_colors && has_colors()) { start_color(); init_pair(DISPLAY_EXTERNAL_COLORS, color_array[box_foreground], color_array[box_background]); init_pair(DISPLAY_INTERNAL_COLORS, color_array[display_foreground], color_array[display_background]); wbkgdset(window, COLOR_PAIR (DISPLAY_EXTERNAL_COLORS) | ' '); werase(window); wrefresh(window); } return window; } /** \brief Create new window Create new window with initial header and contents. The function allocates new ncurses WINDOW. \return new window */ WINDOW *ui_init_window(int lines, int columns, int begin_y, int begin_x, const char *header) { /* Create the window, and set up colors if possible and requested. */ WINDOW *window = newwin(lines, columns, begin_y, begin_x); if (!window) { fprintf(stderr, "newwin()\n"); exit(EXIT_FAILURE); } if (do_colors && has_colors()) { wbkgdset(window, COLOR_PAIR (DISPLAY_EXTERNAL_COLORS) | ' '); wattron(window, COLOR_PAIR (DISPLAY_EXTERNAL_COLORS)); werase(window); } /* Test on top of the area. */ box(window, 0, 0); mvwaddstr(window, 0, 1, header); wrefresh(window); return window; } /** \brief Create new main window for Morse code text Function allocates two new ncurses WINDOW variables. */ void ui_init_display(int lines, int columns, int begin_y, int begin_x, const char *header, WINDOW **window, WINDOW **subwindow) { *window = ui_init_window(lines, columns, begin_y, begin_x, header); /* Text subwindow: Create the window, and set up colors if possible and requested. */ *subwindow = newwin(lines - 2, columns - 2, begin_y + 1, begin_x + 1); if (!*subwindow) { fprintf(stderr, "newwin()\n"); exit(EXIT_FAILURE); } if (do_colors && has_colors()) { wbkgdset(*subwindow, COLOR_PAIR (DISPLAY_INTERNAL_COLORS) | ' '); wattron(*subwindow, COLOR_PAIR (DISPLAY_INTERNAL_COLORS)); werase(*subwindow); } wrefresh(*subwindow); return; } /** \brief Initialize the user interface, boxes and windows */ void ui_initialize(void) { static bool is_initialized = false; int max_y, max_x; /* Create the over-arching screen window. */ screen = ui_init_screen(); getmaxyx(screen, max_y, max_x); /* Create and box in the mode window. */ ui_init_display(max_y - 3, 20, 0, 0, _("Mode(F10v,F11^)"), &mode_window, &mode_subwindow); for (int i = 0; i < mode_get_count(); i++) { if (i == mode_get_current()) { wattron(mode_subwindow, A_REVERSE); } else { wattroff(mode_subwindow, A_REVERSE); } mvwaddstr(mode_subwindow, i, 1, mode_get_description(i)); } wrefresh(mode_subwindow); /* Create the text display window; do the introduction only once. */ ui_init_display(max_y - 3, max_x - 20, 0, 20, _("Start(F9)"), &text_window, &text_subwindow); wmove(text_subwindow, 0, 0); if (!is_initialized) { waddstr(text_subwindow, _(INTRODUCTION)); waddstr(text_subwindow, _(INTRODUCTION_CONTINUED)); is_initialized = true; } wrefresh(text_subwindow); idlok(text_subwindow, true); immedok(text_subwindow, true); scrollok(text_subwindow, true); int lines = 3; int columns = CWCP_PARAM_WIDTH; /* Create the control feedback boxes. */ ui_init_display(lines, columns, max_y - lines, columns * 0, _("Speed(F1-,F2+)"), &speed_window, &speed_subwindow); speed_update(); ui_init_display(lines, columns, max_y - lines, columns * 1, _("Tone(F3-,F4+)"), &tone_window, &tone_subwindow); frequency_update(); ui_init_display(lines, columns, max_y - lines, columns * 2, _("Vol(F5-,F6+)"), &volume_window, &volume_subwindow); volume_update(); ui_init_display(lines, columns, max_y - lines, columns * 3, _("Gap(F7-,F8+)"), &gap_window, &gap_subwindow); gap_update(); ui_init_display(lines, columns, max_y - lines, columns * 4, _("Time(Dn-,Up+)"), &timer_window, &timer_subwindow); timer_window_update(0, timer_get_total_practice_time()); /* Set up curses input mode. */ keypad(screen, true); noecho(); cbreak(); curs_set(0); raw(); nodelay(screen, false); wrefresh(curscr); return; } /** \brief Dismantle the user interface, boxes and windows */ void ui_destroy(void) { if (text_subwindow) { delwin(text_subwindow); text_subwindow = NULL; } if (text_window) { delwin(text_window); text_window = NULL; } if (mode_subwindow) { delwin(mode_subwindow); mode_subwindow = NULL; } if (mode_window) { delwin(mode_window); mode_window = NULL; } if (speed_subwindow) { delwin(speed_subwindow); speed_subwindow = NULL; } if (speed_window) { delwin(speed_window); speed_window = NULL; } if (tone_subwindow) { delwin(tone_subwindow); tone_subwindow = NULL; } if (tone_window) { delwin(tone_window); tone_window = NULL; } if (volume_subwindow) { delwin(volume_subwindow); volume_subwindow = NULL; } if (volume_window) { delwin(volume_window); volume_window = NULL; } if (gap_subwindow) { delwin(gap_subwindow); gap_subwindow = NULL; } if (gap_window) { delwin(gap_window); gap_window = NULL; } if (timer_subwindow) { delwin(timer_subwindow); timer_subwindow = NULL; } if (timer_window) { delwin(timer_window); timer_window = NULL; } if (screen) { /* Clear the screen for neatness. */ werase(screen); wrefresh(screen); delwin(screen); screen = NULL; } /* End curses processing. */ endwin(); return; } /** \brief Assess a user command, and action it if valid If the command turned out to be a valid user interface command, return true, otherwise return false. */ static int interface_interpret(int c) { /* Interpret the command passed in */ switch (c) { default: return false; case ']': display_background = (display_background + 1) % COLORS_COUNT; goto color_update; case '[': display_foreground = (display_foreground + 1) % COLORS_COUNT; goto color_update; case '{': box_background = (box_background + 1) % COLORS_COUNT; goto color_update; case '}': box_foreground = (box_foreground + 1) % COLORS_COUNT; goto color_update; color_update: if (do_colors && has_colors()) { init_pair(DISPLAY_EXTERNAL_COLORS, color_array[box_foreground], color_array[box_background]); init_pair(DISPLAY_INTERNAL_COLORS, color_array[display_foreground], color_array[display_background]); wrefresh(curscr); } break; case 'L' - CTRL_OFFSET: wrefresh(curscr); break; case KEY_F (1): case PSEUDO_KEYF1: case KEY_LEFT: if (cw_set_send_speed(cw_get_send_speed() - CW_SPEED_STEP)) { speed_update(); } break; case KEY_F (2): case PSEUDO_KEYF2: case KEY_RIGHT: if (cw_set_send_speed(cw_get_send_speed() + CW_SPEED_STEP)) { speed_update(); } break; case KEY_F (3): case PSEUDO_KEYF3: case KEY_END: if (cw_set_frequency(cw_get_frequency() - CW_FREQUENCY_STEP)) { frequency_update(); } break; case KEY_F (4): case PSEUDO_KEYF4: case KEY_HOME: if (cw_set_frequency(cw_get_frequency() + CW_FREQUENCY_STEP)) { frequency_update(); } break; case KEY_F (5): case PSEUDO_KEYF5: if (cw_set_volume(cw_get_volume() - CW_VOLUME_STEP)) { volume_update(); } break; case KEY_F (6): case PSEUDO_KEYF6: if (cw_set_volume(cw_get_volume() + CW_VOLUME_STEP)) { volume_update(); } break; case KEY_F (7): case PSEUDO_KEYF7: if (cw_set_gap(cw_get_gap() - CW_GAP_STEP)) { gap_update(); } break; case KEY_F (8): case PSEUDO_KEYF8: if (cw_set_gap(cw_get_gap() + CW_GAP_STEP)) { gap_update(); } break; case KEY_NPAGE: case PSEUDO_KEYNPAGE: if (timer_set_total_practice_time(timer_get_total_practice_time() - CW_PRACTICE_TIME_STEP)) { timer_window_update(-1, timer_get_total_practice_time()); } break; case KEY_PPAGE: case PSEUDO_KEYPPAGE: if (timer_set_total_practice_time(timer_get_total_practice_time() + CW_PRACTICE_TIME_STEP)) { timer_window_update(-1, timer_get_total_practice_time()); } break; case KEY_F (11): case PSEUDO_KEYF11: case KEY_UP: { state_change_to_idle(); int old_mode = mode_get_current(); if (mode_change_to_previous()) { ui_update_mode_selection(old_mode, mode_get_current()); } } break; case KEY_F (10): case PSEUDO_KEYF10: case KEY_DOWN: { state_change_to_idle(); int old_mode = mode_get_current(); if (mode_change_to_next()) { ui_update_mode_selection(old_mode, mode_get_current()); } } break; case KEY_F (9): case PSEUDO_KEYF9: case '\n': if (mode_current_is_type(M_EXIT)) { is_running = false; } else { if (!mode_is_sending_active()) { state_change_to_active(); } else { if (c != '\n') { state_change_to_idle(); } } } break; case KEY_CLEAR: case 'V' - CTRL_OFFSET: if (!mode_is_sending_active()) { ui_clear_main_window(); } break; case '[' - CTRL_OFFSET: case 'Z' - CTRL_OFFSET: state_change_to_idle(); break; case KEY_F (12): case PSEUDO_KEYF12: case 'C' - CTRL_OFFSET: queue_discard_contents(); cw_flush_tone_queue(); is_running = false; break; case KEY_RESIZE: state_change_to_idle(); ui_destroy(); ui_initialize(); break; } /* The command was a recognized interface key. */ return true; } void speed_update(void) { char buffer[CWCP_PARAM_WIDTH]; snprintf(buffer, CWCP_PARAM_WIDTH, _("%2d WPM"), cw_get_send_speed()); mvwaddstr(speed_subwindow, 0, 4, buffer); wrefresh(speed_subwindow); return; } void frequency_update(void) { char buffer[CWCP_PARAM_WIDTH]; snprintf(buffer, CWCP_PARAM_WIDTH, _("%4d Hz"), cw_get_frequency()); mvwaddstr(tone_subwindow, 0, 3, buffer); wrefresh(tone_subwindow); return; } void volume_update(void) { char buffer[CWCP_PARAM_WIDTH]; snprintf(buffer, CWCP_PARAM_WIDTH, _("%3d %%"), cw_get_volume()); mvwaddstr(volume_subwindow, 0, 4, buffer); wrefresh(volume_subwindow); return; } void gap_update(void) { char buffer[CWCP_PARAM_WIDTH]; int value = cw_get_gap(); snprintf(buffer, CWCP_PARAM_WIDTH, value == 1 ? _("%2d dot ") : _("%2d dots"), value); mvwaddstr(gap_subwindow, 0, 3, buffer); wrefresh(gap_subwindow); return; } /** \brief Handle UI event Handle an interface 'event', in this case simply a character from the keyboard via curses. */ void ui_handle_event(int c) { /* See if this character is a valid user interface command. */ if (interface_interpret(c)) { return; } /* If the character is standard 8-bit ASCII or backspace, and the current sending mode is from the keyboard, then make an effort to either queue the character for sending, or delete the most recently queued. */ if (mode_is_sending_active() && mode_current_is_type(M_KEYBOARD)) { if (c == KEY_BACKSPACE || c == KEY_DC) { queue_delete_character(); return; } else if (c <= UCHAR_MAX) { queue_enqueue_character((char) c); return; } } /* The 'event' is nothing at all of interest; drop it. */ return; } /** \brief Check for keyboard input from user Calls our sender polling function at regular intervals, and returns only when data is available to getch(), so that it will not block. Opportunistically on every poll check if we need to update queue of elements to play/display, and if so, do update the queue. \param fd - file to pool for new keys from the user \param usecs - pooling interval */ void ui_poll_user_input(int fd, int usecs) { int fd_count; /* Poll until the select indicates data on the file descriptor. */ do { fd_set read_set; struct timeval timeout; /* Set up a the file descriptor set and timeout information. */ FD_ZERO(&read_set); FD_SET(fd, &read_set); timeout.tv_sec = usecs / 1000000; timeout.tv_usec = usecs % 1000000; /* Wait until timeout, data, or a signal. If a signal interrupts select, we can just treat it as another timeout. */ fd_count = select(fd + 1, &read_set, NULL, NULL, &timeout); if (fd_count == -1 && errno != EINTR) { perror("select"); exit(EXIT_FAILURE); } /* Make this call on timeouts and on reads; it's just easier. */ queue_transfer_character_to_libcw(); } while (fd_count != 1); return; } void ui_clear_main_window(void) { werase(text_subwindow); wmove(text_subwindow, 0, 0); wrefresh(text_subwindow); return; } void ui_refresh_main_window(void) { touchwin(text_subwindow); wnoutrefresh(text_subwindow); doupdate(); return; } void ui_display_state(const char *state) { box(text_window, 0, 0); mvwaddstr(text_window, 0, 1, state); wnoutrefresh(text_window); doupdate(); return; } /** Change appearance of list of modes, indicating current mode Change an entry in list of modes, indicating which mode is currently selected. un-highlight \p old_mode, highlight \p current_mode. \param old_mode - index of old mode \param current_mode - index of currently selected mode */ void ui_update_mode_selection(int old_mode, int current_mode) { wattroff(mode_subwindow, A_REVERSE); mvwaddstr(mode_subwindow, old_mode, 1, mode_get_description(old_mode)); wattron(mode_subwindow, A_REVERSE); mvwaddstr(mode_subwindow, current_mode, 1, mode_get_description(current_mode)); wrefresh(mode_subwindow); return; } /** \brief Signal handler for signals, to clear up on kill */ void signal_handler(int signal_number) { /* Attempt to wrestle the screen back from curses. */ ui_destroy(); /* Show the signal caught, and exit. */ fprintf(stderr, _("\nCaught signal %d, exiting...\n"), signal_number); exit(EXIT_SUCCESS); } /** Parse the command line, initialize a few things, then enter the main program event loop, from which there is no return. */ int main(int argc, char **argv) { atexit(cwcp_atexit); /* Set locale and message catalogs. */ i18n_initialize(); /* Parse combined environment and command line arguments. */ int combined_argc; char **combined_argv; /* Parse combined environment and command line arguments. */ combine_arguments(_("CWCP_OPTIONS"), argc, argv, &combined_argc, &combined_argv); config = cw_config_new(cw_program_basename(argv[0])); if (!config) { return EXIT_FAILURE; } config->has_practice_time = true; config->has_outfile = true; if (!cw_process_argv(combined_argc, combined_argv, all_options, config)) { fprintf(stderr, _("%s: failed to parse command line args\n"), config->program_name); return EXIT_FAILURE; } free(combined_argv); combined_argv = NULL; if (!cw_config_is_valid(config)) { fprintf(stderr, _("%s: inconsistent arguments\n"), config->program_name); return EXIT_FAILURE; } if (config->input_file) { if (!cw_dictionaries_read(config->input_file)) { fprintf(stderr, _("%s: %s\n"), config->program_name, strerror(errno)); fprintf(stderr, _("%s: can't load dictionary from input file %s\n"), config->program_name, config->input_file); return EXIT_FAILURE; } } if (config->output_file) { if (!cw_dictionaries_write(config->output_file)) { fprintf(stderr, _("%s: %s\n"), config->program_name, strerror(errno)); fprintf(stderr, _("%s: can't save dictionary to output file %s\n"), config->program_name, config->input_file); return EXIT_FAILURE; } } if (config->audio_system == CW_AUDIO_ALSA && cw_is_pa_possible(NULL)) { fprintf(stdout, "Selected audio system is ALSA, but audio on your system is handled by PulseAudio. Expect problems with timing.\n"); fprintf(stdout, "In this situation it is recommended to run %s like this:\n", config->program_name); fprintf(stdout, "%s -s p\n\n", config->program_name); fprintf(stdout, "Press Enter key to continue\n"); getchar(); } generator = cw_generator_new_from_config(config); if (!generator) { fprintf(stderr, "%s: failed to create generator\n", config->program_name); return EXIT_FAILURE; } timer_set_total_practice_time(config->practice_time); static const int SIGNALS[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, 0 }; /* Set up signal handlers to clear up and exit on a range of signals. */ for (int i = 0; SIGNALS[i]; i++) { if (!cw_register_signal_handler(SIGNALS[i], signal_handler)) { fprintf(stderr, _("%s: can't register signal: %s\n"), config->program_name, strerror(errno)); return EXIT_FAILURE; } } /* Build our table of modes from dictionaries, augmented with keyboard and any other local modes. */ mode_initialize(); /* Initialize the curses user interface, then catch and action every keypress we see. Before calling getch, wait until data is available on stdin, polling the libcw sender. At 60WPM, a dot is 20ms, so polling for the maximum library speed needs a 10ms (10,000usec) timeout. */ ui_initialize(); cw_generator_start(); while (is_running) { ui_poll_user_input(fileno(stdin), 10000); ui_handle_event(getch()); } cw_wait_for_tone_queue(); return EXIT_SUCCESS; } void cwcp_atexit(void) { ui_destroy(); if (generator) { cw_complete_reset(); cw_generator_stop(); cw_generator_delete(); } mode_clean(); cw_dictionaries_unload(); if (config) { cw_config_delete(&config); } return; } unixcw-3.4.2/src/cwcp/Makefile.in0000644000175000017500000005712012536122132016451 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = cwcp$(EXEEXT) subdir = src/cwcp DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_cwcp_OBJECTS = cwcp.$(OBJEXT) cwcp_OBJECTS = $(am_cwcp_OBJECTS) cwcp_DEPENDENCIES = $(top_builddir)/src/cwutils/lib_cwcp.a AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=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 = $(cwcp_SOURCES) DIST_SOURCES = $(cwcp_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) 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)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ # source code files used to build cwcp program cwcp_SOURCES = cwcp.c # target-specific preprocessor flags (#defs and include dirs) #cwcp_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/ # target-specific linker flags (objects to link) cwcp_LDADD = -lcurses -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwcp.a # copy man page to proper directory during installation man_MANS = cwcp.1 # and mark it as distributable, too EXTRA_DIST = cwcp.1 all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cwcp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/cwcp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(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 \ || test -f $$p1 \ ; 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) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(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: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cwcp$(EXEEXT): $(cwcp_OBJECTS) $(cwcp_DEPENDENCIES) $(EXTRA_cwcp_DEPENDENCIES) @rm -f cwcp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cwcp_OBJECTS) $(cwcp_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cwcp.Po@am__quote@ .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) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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: $(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) 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 clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool 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 check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool 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 mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 -include $(top_builddir)/Makefile.inc # Test targets. # This test target will be invoked when creating deb package. check: # This test target can be invoked manually. real_check: all ( echo "Trying with OSS audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -so ) || \ ( echo "Retrying with ALSA audio output"; \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -sa ) || \ ( echo "Retrying with console audio output"; \ LIBCW_DEBUG=1 \ LD_LIBRARY_PATH=../libcw:$$LD_LIBRARY_PATH ./cwcp -sc ) # 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: unixcw-3.4.2/Makefile.inc.in0000644000175000017500000000326212451011523015471 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # Autoconfigure definitions. AC_CC = @CC@ AC_CFLAGS = @CFLAGS@ AC_CXX = @CXX@ AC_CXXFLAGS = @CXXFLAGS@ AC_DEFS = @DEFS@ AC_GZIP = @GZIP@ AC_LDCONFIG = @LDCONFIG@ AC_LIBS = @LIBS@ AC_AWK = @AWK@ AC_QT4_CFLAGS = @QT4_CFLAGS@ AC_QT4_LIBS = @QT4_LIBS@ AC_QT4_MOC = @MOC@ AC_SRC_SUBDIRS = @SRC_SUBDIRS@ AC_CFLAG_PIC = @CFLAG_PIC@ AC_CC_LINKS_SO = @CC_LINKS_SO@ AC_LD_LINKS_SO = @LD_LINKS_SO@ AC_LD = @LD@ AC_LN_S = @LN_S@ # Portability values. INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ prefix = @prefix@ exec_prefix = @exec_prefix@ includedir = @includedir@ bindir = @bindir@ mandir = @mandir@ libdir = @libdir@ # http://www.gnu.org/s/hello/manual/autoconf/Changed-Directory-Variables.html datarootdir = @datarootdir@ AM_CPPFLAGS = -I$(top_srcdir)/src/ \ -I$(top_srcdir)/src/libcw/ \ -I$(top_srcdir)/src/cwutils/ unixcw-3.4.2/missing0000755000175000017500000002415211760446200014262 0ustar acerionacerion#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, 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 run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] 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 # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixcw-3.4.2/TODO0000644000175000017500000000114212373701721013350 0ustar acerionacerionTODO: Add to configure.ac a check for GNU make on build machine. unixcw's Makefiles may not work with non-GNU make on non Linux machines. Add to configure.ac a check for pkg-config. It is necessary for configuring QT4 application (xcwcp). Make qa_test_configure_flags.sh portable. Some shells (on FreeBSD) don't like the options[] table. After finalizing split of libcw into modules, add configure flags for disabling modules (e.g. --disable-libcw-receiver, --disable-libcw-key). Check if it's possible to use pkg-config to get ncurses compilation flags. ---------- DONE: unixcw-3.4.2/compile0000755000175000017500000001533711760446200014246 0ustar acerionacerion#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-01-04.17; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 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*) 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/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # 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*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l*) lib=${1#-l} 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 set x "$@" "$dir/$lib.dll.lib" break fi if test -f "$dir/$lib.lib"; then found=yes set x "$@" "$dir/$lib.lib" break fi done IFS=$save_IFS test "$found" != yes && set x "$@" "$lib.lib" shift ;; -L*) func_file_conv "${1#-L}" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" ;; -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 ) 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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixcw-3.4.2/COPYING0000644000175000017500000004325411665750012013725 0ustar acerionacerion 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. unixcw-3.4.2/unixcw-2.3.spec0000644000175000017500000000457711665754531015402 0ustar acerionacerion# # Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # # 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. # # Normal descriptive preamble. Summary: UnixCW Morse Code Utilities Name: unixcw Version: 2.3 Release: 2 Group: Applications/Hamradio Copyright: GPL Packager: Simon Baldwin URL: http://www.geocities.com/simon_baldwin/ Source: ftp://metalab.unc.edu/pub/Linux/apps/ham/morse/unixcw-2.3.tgz BuildRoot: /tmp/unixcw-2.3 %description The UnixCW utilities add a general purpose CW library to your system, and a small set of applications based around this library. These applications form a Morse code tutor suite, useful for Amateur and Marine radio operators. # Straightforward preparation for building. %prep %setup # To build, first configure, then make. Here we set "prefix" to the build # root, suffixed with "/usr". So, unlike our natural locations under # "/usr/local", we build and install the RPM packaged version in "/usr", # leaving "/usr/local" free for, well, the usual "/usr/local" stuff. %build ./configure make prefix="$RPM_BUILD_ROOT/usr" # Install with "prefix" tweaked in the same way. %install make prefix="$RPM_BUILD_ROOT/usr" install # Clean up our build root. %clean rm -rf $RPM_BUILD_ROOT # Postinstall and postuninstall. %post /sbin/ldconfig %postun /sbin/ldconfig # List of packaged files. %files /usr/bin/cw /usr/bin/cwcp /usr/bin/cwgen /usr/bin/xcwcp /usr/include/libcw.h /usr/lib/libcw.a /usr/lib/libcw.so /usr/lib/libcw.so.0 /usr/lib/libcw.so.0.0.0 /usr/man/man1/cw.1.gz /usr/man/man1/cwcp.1.gz /usr/man/man1/cwgen.1.gz /usr/man/man1/xcwcp.1.gz /usr/man/man3/libcw.3.gz /usr/man/man7/CW.7.gz /usr/man/man7/cw.7.gz /usr/lib/pkgconfig/libcw.pc %doc COPYING %doc README %doc INSTALLING unixcw-3.4.2/install-sh0000755000175000017500000003325611760446200014674 0ustar acerionacerion#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # 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 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=$? 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; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test 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=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixcw-3.4.2/configure.ac0000755000175000017500000004031512536122112015146 0ustar acerionacerion# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com) # Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl) # # 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. # # General initializations. AC_PREREQ(2.57) AC_INIT([unixcw], [3.4.2]) AC_CONFIG_SRCDIR([src/libcw/libcw_gen.c]) AM_INIT_AUTOMAKE # Libtool initialization, added during tests on FreeBSD LT_INIT # Specify a configuration header. AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_FILES([src/libcw/libcw.pc]) # General checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_AWK AC_PROG_LIBTOOL AC_PROG_RANLIB # Added during tests on FreeBSD AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S AM_PROG_CC_C_O # OS-specific configuration. On top there are default values of some # flags, to be modified per host type. # General notice: FreeBSD 9.3 doesn't like empty quotes # (e.g. DL_LIB=\"\"). Empty string should be totally empty. # libcw on Linux needs "-ldl" library (dlopen() and related symbols) # for dynamic loading of ALSA and PulseAudio libraries. Tested BSD # systems (FreeBSD and OpenBSD) don't have a separate -ldl library # (and since they don't support ALSA and PulseAudio, libcw on BSDs # wouldn't even need the library). DL_LIB= # libcw on OpenBSD (tested on 5.5) needs -lossaudio for _oss_ioctl # symbol. No explicit OSS library needed by libcw on FreeBSD and # Linux. Quick and short googling suggests that NetBSD also uses # ossaudio library. # TODO: consider using AC_CHECK_LIB(ossaudio, _oss_ioctl) OSS_LIB= AC_CANONICAL_HOST case $host_os in *linux*|*Linux*) AC_MSG_NOTICE([Detected Linux: $host_os]) # Needed because of dynamic loading of libraries in libcw. DL_LIB=\"-ldl\" ;; *freebsd*|*FreeBSD*) AC_MSG_NOTICE([Detected FreeBSD: $host_os]) ;; *openbsd*|*OpenBSD*) AC_MSG_NOTICE([Detected OpenBSD: $host_os]) OSS_LIB=\"-lossaudio\" ;; *netbsd*|*NetBSD*) # I didn't test unixcw on NetBSD, but let's give it a # chance. AC_MSG_NOTICE([Detected NetBSD: $host_os]) OSS_LIB=\"-lossaudio\" ;; *) AC_MSG_NOTICE([Detected other OS: $host_os]) # Until someone complains, for other OSes we will configure # the flags the same way as on Linux. DL_LIB=\"-ldl\" ;; esac AC_SUBST(DL_LIB) AC_SUBST(OSS_LIB) # Check specifically for gzip and ldconfig, and substitute the harmless ":" # if absent. AC_PATH_PROG(GZIP, gzip, ,) if test -z "$GZIP" ; then GZIP=":" fi AC_PATH_PROG(LDCONFIG, ldconfig, ,) if test -z "$LDCONFIG" ; then LDCONFIG=":" fi AC_SUBST(GZIP) AC_SUBST(LDCONFIG) # Check for basic but essential libraries AC_CHECK_LIB(pthread, pthread_create) AC_CHECK_LIB(m, floor) # show-stoppers if test $ac_cv_lib_m_floor = 'no' ; then AC_MSG_ERROR([math library is missing, cannot continue]) fi if test $ac_cv_lib_pthread_pthread_create = 'no' ; then AC_MSG_ERROR([pthread library is missing, cannot continue]) fi # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # library's current:revision:age # # I'm defining it here so that it's available in config.h and can be # used in libcw's cw_version() function that should return the # numbers. LIBCW_VERSION=\"6:4:1\" AC_DEFINE_UNQUOTED([LIBCW_VERSION], $LIBCW_VERSION, [Library version, libtool notation]) AC_SUBST(LIBCW_VERSION) # ######################################################################## # definitions of custom command line options for configure script # ######################################################################## # Build support for console buzzer output? Yes by default. AC_ARG_ENABLE([console], AS_HELP_STRING([--disable-console], [disable support for console buzzer audio output]), [], [enable_console=yes]) AC_MSG_CHECKING([whether to include console buzzer audio support]) if test "$enable_console" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Build support for OSS audio system? Yes by default. AC_ARG_ENABLE([oss], AS_HELP_STRING([--disable-oss], [disable support for OSS audio output]), [], [enable_oss=yes]) AC_MSG_CHECKING([whether to include OSS audio support]) if test "$enable_oss" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Build support for ALSA audio system? Yes by default. AC_ARG_ENABLE([alsa], AS_HELP_STRING([--disable-alsa], [disable support for ALSA audio output]), [], [enable_alsa=yes]) AC_MSG_CHECKING([whether to include ALSA audio support]) if test "$enable_alsa" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Build support for PulseAudio audio system? Yes by default. AC_ARG_ENABLE(pulseaudio, AS_HELP_STRING([--disable-pulseaudio], [disable support for PulseAudio audio output]), [], [enable_pulseaudio=yes]) AC_MSG_CHECKING([whether to include PulseAudio audio support]) if test "$enable_pulseaudio" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Build cwcp? Yes by default. AC_ARG_ENABLE(cwcp, AS_HELP_STRING([--disable-cwcp], [do not build cwcp (application with curses user interface)]), [], [enable_cwcp=yes]) AC_MSG_CHECKING([whether to build cwcp]) if test "$enable_cwcp" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Build xcwcp? Yes by default. AC_ARG_ENABLE(xcwcp, AS_HELP_STRING([--disable-xcwcp], [do not build xcwcp (application with Qt4 user interface)]), [], [enable_xcwcp=yes]) AC_MSG_CHECKING([whether to build xcwcp]) if test "$enable_xcwcp" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # Enable development debugging? No by default. AC_ARG_ENABLE(dev, AS_HELP_STRING([--enable-dev], [enable development support (messages/debug code/asserts)]), [], [enable_dev=no]) AC_MSG_CHECKING([whether to enable development support]) if test "$enable_dev" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi # ##### # end # ##### # ######################################################################## # Process command line options, and if enabled - checking if requirements # for enabled features are satisfied. # ######################################################################## if test "$enable_console" = "no" ; then WITH_CONSOLE='no' else # Search for header that provides KIOCSOUND AC_CHECK_HEADERS([sys/kd.h sys/vtkd.h sys/kbio.h]) if test "$ac_cv_header_sys_kd_h" = 'no' \ && test "$ac_cv_header_sys_vtkd_h" = 'no' \ && test "$ac_cv_header_sys_kbio_h" = 'no' ; then WITH_CONSOLE='no' AC_MSG_WARN([Cannot find either sys/kd.h, sys/vtkd.h, or sys/kbio.h - support for console buzzer audio output will be disabled]) else WITH_CONSOLE='yes' fi fi if test "$WITH_CONSOLE" = 'yes' ; then AC_DEFINE([LIBCW_WITH_CONSOLE], [1], [Define as 1 if your build machine can support console buzzer.]) fi if test "$enable_oss" = "no" ; then WITH_OSS='no' else AC_CHECK_HEADERS([soundcard.h sys/soundcard.h]) if test "$ac_cv_header_soundcard_h" = 'no' \ && test "$ac_cv_header_sys_soundcard_h" = 'no' ; then WITH_OSS='no' AC_MSG_WARN([Cannot find either soundcard.h or sys/soundcard.h - support for OSS audio output will be disabled]) else WITH_OSS='yes' fi fi if test "$WITH_OSS" = 'yes' ; then AC_DEFINE([LIBCW_WITH_OSS], [1], [Define as 1 if your build machine can support OSS.]) fi if test "$enable_alsa" = "no" ; then WITH_ALSA='no' else AC_CHECK_LIB(asound, snd_pcm_open) if test "$ac_cv_lib_asound_snd_pcm_open" = 'yes' ; then # Check for certain routines which are missing from liboss-salsa-dev # (kfreebsd's libasound implementation). If a function is found # build system defines HAVE_function_name in config.h. AC_CHECK_FUNCS([ \ snd_pcm_hw_params_test_periods \ snd_pcm_hw_params_test_buffer_size \ ]) WITH_ALSA='yes' else WITH_ALSA='no' AC_MSG_WARN([Cannot find ALSA library files - support for ALSA audio output will be disabled]) fi fi if test "$WITH_ALSA" = 'yes' ; then AC_DEFINE([LIBCW_WITH_ALSA], [1], [Define as 1 if your build machine can support ALSA.]) fi if test "$enable_pulseaudio" = "no" ; then WITH_PULSEAUDIO='no' else AC_CHECK_LIB(pulse-simple, pa_simple_new) if test "$ac_cv_lib_pulse_simple_pa_simple_new" = 'yes' ; then WITH_PULSEAUDIO='yes' else WITH_PULSEAUDIO='no' AC_MSG_WARN([Cannot find PulseAudio library files - support for PulseAudio audio output will be disabled]) fi fi if test "$WITH_PULSEAUDIO" = 'yes' ; then AC_DEFINE([LIBCW_WITH_PULSEAUDIO], [1], [Define as 1 if your build machine can support PulseAudio.]) fi if test "$enable_cwcp" = "no" ; then WITH_CWCP='no' else AC_CHECK_LIB(curses, initscr) if test $ac_cv_lib_curses_initscr = 'yes' ; then WITH_CWCP='yes' else WITH_CWCP='no' AC_MSG_WARN([Cannot find libcurses - unable to build cwcp]) fi fi if test "$enable_xcwcp" = "no" ; then WITH_XCWCP='no' else # http://stackoverflow.com/questions/5178511/integrate-qt-project-with-autotool PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [ AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin) AC_MSG_RESULT([QT4 CLFAGS is $QT4_CFLAGS]) AC_MSG_RESULT([QT4 LIBS is $QT4_LIBS]) AC_SUBST(QT4_CFLAGS) AC_SUBST(QT4_LIBS) AC_SUBST(MOC) WITH_XCWCP='yes' ], [ AC_MSG_WARN([Cannot find Qt4 files - unable to build xcwcp]) WITH_XCWCP='no' ]) fi # Development support tools. AM_CONDITIONAL(LIBCW_WITH_DEV, test "$enable_dev" = "yes") if test "$enable_dev" = "yes" ; then WITH_DEV='yes' AC_DEFINE([LIBCW_WITH_DEV], [1], [Define as 1 if you want to enable development support.]) else WITH_DEV='no' fi if test "$WITH_DEV" = 'yes' ; then LIBCW_NDEBUG="" else LIBCW_NDEBUG="-DNDEBUG" fi AC_SUBST(LIBCW_NDEBUG) # ##### # end # ##### # unixcw uses per-target linker object lists (target_LDADD) LIBS= # Checks for header files AC_HEADER_STDC AC_HEADER_STDBOOL AC_HEADER_TIME AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h strings.h sys/ioctl.h \ sys/param.h sys/time.h unistd.h locale.h libintl.h]) AC_CHECK_HEADERS([getopt.h]) AC_CHECK_HEADERS([string.h strings.h]) if test "$ac_cv_header_string_h" = 'no' \ && test "$ac_cv_header_strings_h" = 'no' ; then AC_MSG_WARN([Cannot find either string.h or strings.h]) fi # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_C_VOLATILE AC_PROG_GCC_TRADITIONAL # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STRCOLL AC_FUNC_VPRINTF AC_CHECK_FUNCS([floor gettimeofday memset sqrt strchr strdup strrchr \ strtoul getopt_long setlocale memmove select strerror strspn]) AC_FUNC_SELECT_ARGTYPES # Decide on which subdirectories to build; substitute into SRC_SUBDIRS. # Build cwcp if curses is available, and xcwcp if Qt is available. SRC_SUBDIRS="libcw cwutils cw cwgen" if test "$WITH_CWCP" = 'yes' ; then SRC_SUBDIRS="$SRC_SUBDIRS cwcp" fi if test "$WITH_XCWCP" = 'yes' ; then SRC_SUBDIRS="$SRC_SUBDIRS xcwcp" fi AC_SUBST(SRC_SUBDIRS) # Used for debug purposes. # CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O0/g'` # Add -Wall, -W, -pedantic, and other paranoia to gcc command flags, and -Wall # to with a few suppressions to icc command flags, then similarly, though less # so, for g++ and icpc. if test "`basename $CC`" = "gcc" ; then CFLAGS="$CFLAGS -Wall -W -pedantic -Wfloat-equal -Wpointer-arith -std=gnu99" CFLAGS="$CFLAGS -Wcast-qual -Wwrite-strings -Wmissing-prototypes" CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls" else if test "`basename $CC`" = "icc" ; then CFLAGS="$CFLAGS -Wall -wd181,188,279,383,593,810,981,1469" fi fi if test "`basename $CXX`" = "g++" ; then # -Wno-variadic-macros is to silence g++'s warnings about C99 # variadic macros from libcw_debug.h CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wno-variadic-macros" else if test "`basename $CXX`" = "icpc" ; then CXXFLAGS="$CXXFLAGS -Wall -wd181,188,279,383,593,810,981,1469" fi fi # Determine if -fPIC or -KPIC is available for building .so libraries. # Because gcc complains about invalid flags, but then continues, we have to # check by searching the compile stdout and stderr for any output. if test -z "$CFLAG_PIC" ; then AC_MSG_CHECKING([for -KPIC or -fPIC compiler options]) cat >conftest.c <<-EOF int so_test() { return 0; } EOF if $CC -fPIC -c conftest.c 2>&1 | egrep -q '.' ; then if $CC -KPIC -c conftest.c 2>&1 | egrep -q '.' ; then CFLAG_PIC="" else CFLAG_PIC="-KPIC" fi else CFLAG_PIC="-fPIC" fi rm -f conftest.c conftest.o if test -n "$CFLAG_PIC" ; then AC_MSG_RESULT($CFLAG_PIC) else AC_MSG_RESULT(no) fi fi AC_SUBST(CFLAG_PIC) # Determine if the C compiler builds DSO files, by testing with -shared. CC_LINKS_SO="no" if test -n "$CC" ; then AC_MSG_CHECKING(whether cc builds .so files with -shared) cat >conftest.c <<-EOF int so_test() { return 0; } EOF $CC -c conftest.c >/dev/null 2>/dev/null $CC -shared -o conftest.so conftest.o >/dev/null 2>/dev/null rm -f conftest.c conftest.o if test -f conftest.so ; then nm conftest.so | grep -q so_test if test $? -eq 0 ; then CC_LINKS_SO="yes" fi fi rm -f conftest.so if test $CC_LINKS_SO = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_SUBST(CC_LINKS_SO) # A linker might also build DSO files with -G, but we'll prefer to use the # compiler if it will cooperate. LD_LINKS_SO="no" AC_PATH_PROG(LD, ld, , ) if test -n "$LD" ; then AC_MSG_CHECKING(whether ld builds .so files with -G) cat >conftest.c <<-EOF int so_test() { return 0; } EOF $CC -c conftest.c >/dev/null 2>/dev/null $LD -G -o conftest.so conftest.o >/dev/null 2>/dev/null rm -f conftest.c conftest.o if test -f conftest.so ; then nm conftest.so | grep -q so_test if test $? -eq 0 ; then LD_LINKS_SO="yes" fi fi rm -f conftest.so if test $LD_LINKS_SO = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi else LD=":" fi AC_SUBST(LD) AC_SUBST(LD_LINKS_SO) AC_CONFIG_FILES([Makefile.inc Makefile src/Makefile src/libcw/Makefile src/cwutils/Makefile src/cw/Makefile src/cwgen/Makefile]) if test "$WITH_CWCP" = 'yes' ; then AC_CONFIG_FILES([src/cwcp/Makefile]) fi if test "$WITH_XCWCP" = 'yes' ; then AC_CONFIG_FILES([src/xcwcp/Makefile]) fi AC_OUTPUT # Put this at the very end, so that these are the last lines seen by # user on console with low number of rows. AC_MSG_NOTICE([----------------------------------------------]) AC_MSG_NOTICE([------ $PACKAGE_NAME $PACKAGE_VERSION build configuration ------]) AC_MSG_NOTICE([operating system: ...................... $host_os]) AC_MSG_NOTICE([build libcw: ........................... yes]) AC_MSG_NOTICE([ libcw soname version: .............. $LIBCW_VERSION]) AC_MSG_NOTICE([ include console buzzer support: .... $WITH_CONSOLE]) AC_MSG_NOTICE([ include OSS support: ............... $WITH_OSS]) AC_MSG_NOTICE([ include ALSA support: .............. $WITH_ALSA]) AC_MSG_NOTICE([ include PulseAudio support: ........ $WITH_PULSEAUDIO]) AC_MSG_NOTICE([build cw: .............................. yes]) AC_MSG_NOTICE([build cwgen: ........................... yes]) AC_MSG_NOTICE([build cwcp: ............................ $WITH_CWCP]) AC_MSG_NOTICE([build xcwcp: ........................... $WITH_XCWCP]) if test "$WITH_XCWCP" = 'yes' ; then AC_MSG_NOTICE([ Qt4 CFLAGS: $QT4_CFLAGS]) AC_MSG_NOTICE([ Qt4 LIBS: $QT4_LIBS]) AC_MSG_NOTICE([ Qt4 MOC: $MOC]) fi if test "$WITH_DEV" = 'yes' ; then AC_MSG_NOTICE([enable dev support: ..................... yes]) fi AC_MSG_NOTICE([----------------------------------------------]) unixcw-3.4.2/Makefile.in0000644000175000017500000006107212536122132014727 0ustar acerionacerion# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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 = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 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 = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/Makefile.inc.in COPYING THANKS TODO compile \ config.guess config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = Makefile.inc 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 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 dist dist-all distcheck 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)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) 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 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@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_LINKS_SO = @CC_LINKS_SO@ CFLAGS = @CFLAGS@ CFLAG_PIC = @CFLAG_PIC@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIB = @DL_LIB@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GZIP = @GZIP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDCONFIG = @LDCONFIG@ LDFLAGS = @LDFLAGS@ LD_LINKS_SO = @LD_LINKS_SO@ LIBCW_NDEBUG = @LIBCW_NDEBUG@ LIBCW_VERSION = @LIBCW_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSS_LIB = @OSS_LIB@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ 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@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ QT4_CFLAGS = @QT4_CFLAGS@ QT4_LIBS = @QT4_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SRC_SUBDIRS = @SRC_SUBDIRS@ 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_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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@ SUBDIRS = src EXTRA_DIST = \ icon_unixcw.svg icon_unixcw.xpm \ unixcw-2.3.spec unixcw-3.4.2.lsm \ po/UnixCW.po \ THANKS HISTORY \ debian all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): Makefile.inc: $(top_builddir)/config.status $(srcdir)/Makefile.inc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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: $(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) | GZIP=$(GZIP_ENV) gzip -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-tarZ: distdir @echo WARNING: "Support for shar distribution archives 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 distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -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*) \ GZIP=$(GZIP_ENV) gzip -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*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(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 \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && 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 installdirs: installdirs-recursive installdirs-am: 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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: 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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool 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-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixcw-3.4.2/depcomp0000755000175000017500000004755611760446200014255 0ustar acerionacerion#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2011-12-04.11; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011 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 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" # 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 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. 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. 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 -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$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 -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; 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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else 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,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#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. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # 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.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; 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" = 0; then : else 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/\(.*\)/ \1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/ / G p }' >> "$depfile" 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:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "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" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "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:: \1 \\:p' >> "$depfile" echo " " >> "$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 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixcw-3.4.2/INSTALL0000644000175000017500000002572012540353464013724 0ustar acerionacerionThis is INSTALL file for unixcw 3.4.2. unixcw is written in C and C++. unixcw can be built and installed with standard set of commands: ./configure && make && make install Depending on platform and software/files installed on build machine, build system will configure and compile following features: - support for console buzzer in libcw; - support for OSS audio backend in libcw; - support for ALSA audio backend in libcw; - support for PulseAudio audio backend in libcw; If a support for a feature from this list is available in libcw, it will be available in rest of applications from unixcw package. Moreover, depending on platform and software/files installed on build machine, the build system will configure and compile following features: - cwcp, if ncurses development files are available; - xcwcp, if QT4 development files are available (xcwcp is an application written in C++); libcw library, and cw and cwgen applications are built unconditionally. You can explicitly disable some libcw and unixcw features by passing flags to configure script. See output of "./configure --help" for details. Check your platform-dependent documentation on what packages/files are needed for each of these features. Build-time requirements for unixcw: - standard build environment to build software from source package with "./configure && make && make install"; - GNU make may be necessary on some platforms (I've had a problem with FreeBSD's make on FreeBSD 9.3; make on FreeBSD 10.0 worked fine). If, when running "make", you see an error message like this: *** Parse error in unixcw-3.4.0/src: Need an operator in '../Makefile.inc' (Makefile:640) *** Error 1 in unixcw-3.4.0 (Makefile:416 'all-recursive') then install gmake package, and try running "gmake & gmake install" instead of "make & make install". - pkg-config to get configuration flags for QT4 application (xcwcp); you can override pkg-config settings for QT4 using environment variables, see output of "./configure --help" for details. - audio library development files for including support for OSS, ALSA and PulseAudio audio sinks in libcw; - header file providing KIOCSOUND symbol for including support for console buzzer in libcw. - ncurses development files for building cwcp; - QT4 development files for building xcwcp; unixcw 3.4.2 (or at least parts of it) was successfully compiled on following platforms: - Debian GNU/Linux 8 jessie/sid, x86_64, gcc 4.9.2; - Alpine Linux 3.1, x86_64, gcc 4.8.3, musl 1.1.5; - FreeBSD 10.0, x86_64, clang 3.3; unixcw 3.4.1 (or at least parts of it) was successfully compiled on following platforms: - Debian GNU/Linux jessie/sid, x86_64, gcc 4.9.1; unixcw 3.4.0 (or at least parts of it) was successfully compiled on following platforms: - Debian GNU/Linux jessie/sid, x86_64, gcc 4.9.1; - FreeBSD 10.0 (x86_64-unknown-freebsd10.0, with clang 3.3); - FreeBSD 9.3 (freebsd9.3 with gcc 4.2.1); - OpenBSD 5.5 (amd64-unknown-openbsd5.5 with gcc 4.2.1); compilation on OpenBSD gives lots of warnings related to usage of functions deemed unsafe by OpenBSD developers, but there are no errors. There are also some warnings about redeclarations of some functions - this still needs to be fixed. These were project-specific instructions. Generic instructions are below. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. unixcw-3.4.2/ChangeLog0000644000175000017500000007635212537253364014460 0ustar acerionacerion2015-06-14 Kamil Ignacak * pre-release: updating information in selected files before release (updating version numbers, adding notes new releases etc.) 2015-03-19 Kamil Ignacak * fixes: Few minor changes in main code and test code that solve problems found during tests on FreeBSD 10. 2015-03-13 Kamil Ignacak * generator: fixing one possible cause of segfaults: limiting number of executions of cw_gen_silence_internal() function that somewhere down in call stack also called pthread_kill(). On some occasions (during library cleanup) the thread id passed to pthread_kill becomes invalid, and any subsequent calls to cw_gen_silence_internal() resulted in segfault. I have discovered this problem when testing src/cw/cw on Alpine Linux. Other parts of unixcw package may have been affected by this problem as well. I don't know how old the problem was (since when it was possible to create segfaults when exiting from cw on Alpine Linux). The fix was tested on Alpine Linux and on Debian GNU/Linux. 2015-03-10 Kamil Ignacak * tests: testing unixcw on Alpine Linux (with musl libc). Fixing problems in cw_oss and cw_gen modules. One important change in libcw made during tests on Alpine Linux: generator's thread function is now a joinable thread (it was a detached thread until now). I don't think that it will have any impact on libcw's client code, but I thought that I should mention this in ChangeLog. Also adding one (unit ?) test function to libcw_test_internal. 2015-03-05 Kamil Ignacak * cw_gen: today I've added second and third brand new unit test function for cw_gen module in libcw_gen.c file. At the beginning of this development cycle there were zero functions defined in libcw_gen.c (there were, and still are, functions testing cw_gen module in libcw_test_public.c). I think that's a progress :) During creation of these functions I had an opportunity to improve code and comments of generator's base functions. 2015-03-04 Kamil Ignacak * asserts: base libcw is now compiled with -DNDEBUG flag by default (asserts are "off"). The asserts are still "on" by default in "unit tests" libcw. Asserts are switched "on" in base libcw with "./configure --enable-dev". 2015-03-02 Kamil Ignacak * generator: First unit test intended to be executed on building "make check" target. The unit test function uncovered one error: when a generator is created, then is *not* started, and then is deleted, libcw called pthread_kill(&id, ...) on uninitialized id in cw_gen_delete(). This caused a program to crash. This has been fixed by adding a flag to cw_gen_t and additional code in cw_gen.c. 2015-02-25 Kamil Ignacak * tq: improving handling of tones in general, and "forever" tones in particular. I have created CW_TONE_INIT and CW_TONE_COPY macros that (re-)initialize a tone variable (all of its fields), and that copy values of fields from one cw_tone_t variable to other. There are so many places where I need to set values of fields of cw_tone_t, that I thought it would be beneficial to have some sort of constructor/initializer. A full constructor that mallocs() tone would be too much, but simple macro doing assignments is quite ok. Until now the tone queue manager and generator used special value CW_AUDIO_FOREVER_USECS assigned to cw_tone_t.usecs to indicate that a tone is "forever" tone. This had one downside: a regular, plain variable had special value that I had to constantly be aware of. Now the "usecs" is again a regular variable - nothing more than the length of tone. Information whether or not a tone is "forever" tone is now conveyed by new field in cw_tone_t: cw_tone_t.forever. 2015-02-23 Kamil Ignacak * cw_gen: Lots of small updates. Mostly in comments, but I have also removed few unused (commented out) lines of code and renamed some internal functions. One noticeable change was in cw_generator_set_tone_slope() - some corner cases of handling function's arguments were cleared in function's top level comments, and implementation has been updated accordingly. 2015-02-22 Kamil Ignacak * key, generator, tone queue: Small improvements at intersection of these modules. One example: after changing third argument to cw_key_ik_enqueue_symbol_internal(), the function no longer has to explicitly refer to length of Space/Dot/Dash stored in generator. Enqueueing symbols with proper length is now exclusively job of generator (at least in case of this function call). Also modifying names of some variables (so that they follow a convention used already in receiver) and functions (so that their purpose is more obvious). So in a nutshell: small improvements in key, generator and tone queue. 2015-02-22 Kamil Ignacak * libcw.c: after populating the file with "global" functions for generator, tone queue and receiver modules, I have also moved here the "global" functions from cw_key module. At this point the file contains definitions of global variables cw_receiver, cw_generator and cw_key (cw_key is static in this file). 2015-02-19 Kamil Ignacak * libcw.c: I have (re)created the file. It will contain all the functions that use global variables cw_generator, cw_receiver and maybe cw_key as implicit arguments. After moving such functions from other modules into libcw.c, other modules major should be completely free of global variables, and should only contain functions that operate on generators, receivers and keys as explicit function arguments. Then the function will have the old interface, and the new interface. And it will be easy to have multiple generators (or receivers) in the same application. 2014-12-30 Kamil Ignacak * valgrind: running valgrind on libcw_test_internal reveals few small problems in test code, and one small problem in "production" code. Fixing the problems. Thanks valgrind! 2014-12-20 Kamil Ignacak * tests: moving as much code as possible from libcw_test_public.c to respective module files. The tests that are still in libcw_test_public.c test library functions that depend on different modules (mostly tone queue and generator). Those library functions that can be tested in separation are tested in their module files. This should shorten the libcw_test_public.c file and ensure that test functions are defined as close to library functions as possible, so that library code and related test code are grouped together (thus improving modularization of library). There is still some work to be done in this area, but a good progress has been made. In the process of moving test functions to their modules, some test functions have been improved a bit. 2014-12-02 Kamil Ignacak * tests: improving unit tests for receiver module. The receiver's test code from libcw_test_public.c is being slowly moved to libcw_rec.c. receiver module is fairly independent from a generator or audio sinks, so it's ok to mat the tests internal in the libcw_rec.c file. They can be executed with simple "make check", and the execution takes very little time. 2014-11-28 Kamil Ignacak * tests: improving unit tests for receiver module. Working on functions that will automatically generate test data (input data for cw_start_receive_tone() and cw_end_receive_tone() functions) with different parameters 2014-11-24 Kamil Ignacak * tests: Test executables for libcw now accept -m option, which allows me to specify libcw module(s) to be tested. Option's values are: 'r' - receiver 't' - tone queue 'g' - generator 'k' - Morse key 'o' - other * cwutils: reformatting code in src/cwutils/cmdline.c. No functional changes. 2014-11-19 Kamil Ignacak More changes in receiver module. Refactoring and moving public functions' code to _internal() functions that accept pointer to receiver as first argument. Updating comments. If you depend on Receiver State names (strings starting with RS_) printed by library's debug messages, you may want to check changed values of RS enum and corresponding strings on top of libcw_rec.c - they have been changed. Making some terminology changes in libcw_rec.c - some things are now named in more consistent way (variable names, names of things). 2014-11-12 Kamil Ignacak Proceeding with changes, simplifications and refactoring in receiver module. Generator module is also affected. 2014-11-11 Kamil Ignacak Creating new module: libcw_rec. Moving code related to receiver from libcw.c to libcw_rec.c. Moving other code from libcw.c to other modules. libcw.c has been emptied and is now removed. 2014-08-17 Kamil Ignacak * build system: changes in build system files (configure.ac and src/libcw/Makefile.am) introduced to improve compilation on OpenBSD 5.5. 2014-08-16 Kamil Ignacak * README: reviewed contents of README file. Lots of stuff accumulated in the file over the time, making a first-to-read document a bit too large. Moved parts of the file to INSTALL, THANKS and HISTORY files. * INSTALL: reviewed contents of INSTALL file. Less unnecessary sentences, more details. Also added a generic installation instructions as usually found in INSTALL files. * files: added new files to dist package: THANKS HISTORY added new files to git repository only: qa_build_debian.sh qa_compile_headers.sh qa_test_configure_flags.sh (well this one is moved from ./tools) qa_valgrind_cwcp.sh 2014-08-12 Kamil Ignacak * libcw/utils: three more functions have been moved to libcw_utils: cw_version, cw_license and cw_get_audio_system_label, because, well, these functions look like utility functions. * libcw/signal: I couldn't resist and I moved signal-related functions from libcw.c to new module: libcw_signal. Bodies of these functions have not been modified, so you can compare contents of libcw_signal.c with contents of libcw.c from last release to see how the move has been done. * libcw/generator: I have moved some more code from libcw.c to libcw_gen.c. There is still some generator-related code left in libcw.c, but I promise not to touch it in this release. I think that I have enough of moving code. There is still some code left in libcw.c. Big part of this code is related to receiver. The next big task in my work on libcw should be understanding (or at least attempting to understand) the receiver code and its relation to other modules (especially to libcw_gen and libcw_key modules). Receiver code is one of last areas that I haven't really tried to digest. 2014-08-07 Kamil Ignacak * QT4: Simplifying configuration of QT4 in configure.ac: using PKG_CHECK_MODULES instead of custom shell script. Tests on Linux and FreeBSD ongoing. * FreeBSD & clang 3.3: successful build of "make check" target. Successful execution of libcw_test_simple_gen and libcw_test_internal. Tests on FreeBSD ongoing. 2014-08-06 Kamil Ignacak * FreeBSD: I managed to configure and build the package on FreeBSD 10. It worked! I only had to slightly adjust configure.ac and src/libcw/Makefile.am (dl library). There is still a bit of work on FreeBSD left to do in configure.ac. * OSS: During tests of OSS on FreeBSD I've found a bug that prevented libcw from correctly opening OSS sink (unnecessary function call). This bug has been fixed. This fix should affect Linux and FreeBSD. 2014-08-02 Kamil Ignacak * libcw/key: lots of changes in libcw_key module. After some trials and errors I've implemented a code with single data type for all types of code (cw_key_t) while maintaining separate states of straight key, iambic keyer, and tone-queue-key. The key and code handling it is not visible to users of public API. Behaviour of public API functions has not been changed. 2014-07-28 Kamil Ignacak * libcw: I think that for now I'm done with splitting libcw.c into parts. In about a week I have moved large portions of code from libcw.c to separate files. Different parts of libcw.c, implementing different functionality, are now in their own *.c/*.h files. These new modules are: libcw_data.c libcw_gen.c libcw_key.c libcw_tq.c libcw_utils.c It's very possible that in future I will move some more code from libcw.c to new files. Up until now the code in new files is pretty much the same as it was in libcw.c (the same order of functions, the same bodies of functions, pretty much copy-and-paste). If you want to check correctness of moving the functions to new files, you could do this by comparing libcw/*.c files from 28.07.2014 with original libcw.c from previous release (I did such comparing using KDE application 'kompare', everything looks ok to me). After today I may make some changes in *.c files that will make the movement of code less transparent (but of course keeping everything in git). In addition to moving parts core functionality of the library from libcw.c to new files, I have also reviewed test code and build targets in Makefile.am for building test applications. You can now build three test executables with "make check": libcw_test_internal libcw_test_public libcw_test_simple_gen C code used to build these test executables is now a bit more simple - it uses a bit less #ifdefs, and main() function for each executable is in its own separate *.c file. There is no main() function in libcw.c file anymore. The main goal for the splitting of libcw.c was to introduce more order into the project. libcw.c file contained almost 10k LOC. Almost all modules (with exception of audio systems) were in a single file. Functions implementing these modules were sometimes mixed. Mental navigation in the file was becoming difficult. The split should help me solve these problems. The description above was given to explain why and how the libcw.c has been modified so heavily in this release. The code is still in *.c files. No functionality has been removed. No functions have been added or removed. Looking from outside, the library hasn't changed. It has the same set of functions implementing the same functionality. The libcw.h and libcw_debug.h files haven't changed at all. Changes to libcw in this release, from users' and developers' point of view, are none. 2014-07-26 Kamil Ignacak * cwcp: fixing a stupid error that I introduced in one of previous releases: cwcp didn't use "combined" argv, so it didn't process CWCP_OPTIONS from env. Now it should work. Today's commit ends my main part of work on cwcp code. There were three main changes made to cwcp: first: fixing the bug mentioned above; second: calling few delwin()s to plug memory leaks; third: bringing the code into shape when it comes to project's indentation and comments style. 2014-07-23 Kamil Ignacak * libcw/test code: moving some code related to testing from libcw.c into other files. This little change triggered a larger change in test utilities for libcw. Now we have three libcw test executables built with "make check": libcw_test_internal, libcw_test_public, and libcw_test_simple. Each of them has its own .c file with its own main(). There is no main() function in libcw.c anymore. Explicit "standalone" target has been removed from src/libcw/Makefile.am. It has been replaced by libcw_test_simple executable built with "make check". 2014-07-22 Kamil Ignacak * libcw/keying code: Moving most of code related to iambic keyer, straight key, and general keying control into new file: libcw_key.c. Having separate things in separate files (instead of having everything in a single 10kLOC file) should make some things easier for me as a maintainer of libcw. 2014-07-21 Kamil Ignacak * libcw/tone queue: Moving most of code related to tone queue into new file: libcw_tq.c. * libcw/data: Moving code related to characters (and their representation), prosigns and phonetics to new file: libcw_data.c Having separate things in separate files (instead of having everything in a single 10kLOC file) should make some things easier for me as a maintainer of libcw. 2014-04-23 Kamil Ignacak * committing changes before a new release; the new release contains a fix of problem reported by Pino Zollo ZP4KFX. Se NEWS file for more details. 2013-12-08 Kamil Ignacak * cwgen: improving seed for random function. 2013-10-26 Kamil Ignacak * clocking of iambic keyer. There has been a problem with clocking iambic keyer when the state machine for the keyer was in motion. The clocking has been receiving imprecise timestamps, and so recognizing characters (e.g. in xcwcp's receiver) was difficult. Today I've committed code that fixes timing problems in clocking iambic keyer. The code updates receiver's timer with lengths of dequeued tones in cw_generator_dequeue_and_play_internal(). Receiver uses this updated timer as an argument to cw_{start|stop}_receive_tone(), and since the timer is updated with exact time values, the lengths of spaces and marks are more precise. Fixing the problem also required some changes in xcwcp/receiver.cc and xcwcp/application.cc. 2013-10-22 Kamil Ignacak * unit tests: adding first unit test in cwutils/dictionary module. 2013-10-19 Kamil Ignacak * unit tests: adding "tests::" and "testedin::" markings in functions' top level comments to indicate which functions are tested in which unit tests. Also rewriting parts of bodies of unit tests in libcwtest.c so that printout of test results is a bit cleaner. 2013-10-17 Kamil Ignacak * xcwcp: reviewing, commenting and reformatting code in receiver.cc - the file that uses libcw's receiver functionality. 2013-10-13 Kamil Ignacak * receiver code: more changes and reviewing of receiver code. Unit tests for two functions in recever section: cw_timestamp_validate_internal() and cw_timestamp_compare_internal(). I've reversed order of arguments for the first function, so the order now matches (output, input) pattern of parameters order. 2013-10-10 Kamil Ignacak * testing: some improvements in code testing receiving functions in libcwtest.c: simplifications, comments, refactoring. * refactoring in libcw.c: moving some free variables related to sending and receiving of Morse code into generator and receiver variables, respectively. 2013-10-06 Kamil Ignacak * tone queue: using "len" property to simplify management and monitoring of tone queue and its capacity. Code is now a bit simpler. 2013-10-05 Kamil Ignacak * tone queue: adding "len" property to tone queue. Adding and using it should simplify some aspects of queue management. 2013-10-04 Kamil Ignacak * tone queue: still working with capacity, head and tail. Updated data type for the three variables, it will be uint32_t. * debugging: introduced cw_assert() macro that should improve debugging and assertions. 2013-09-12 Kamil Ignacak * tone queue: more changes related to "capacity", and additionally "head" and "tail" properties of tone queue. No functionality changed yet, just some minor improvements, comments and tests. 2013-09-09 Kamil Ignacak * tone queue: refactoring code handling "capacity" of tone queue; two purposes: improved "testability" and possibility of assigning non-default capacities of tone queues. 2013-07-24 Kamil Ignacak * FreeBSD patches: applying patches for FreeBSD, provided by Diane Bruce (thank you!). Thanks to the patches the ./configure script now should support two new flags: --with-qt-includes= --with-qt-libraries= 2013-03-18 Kamil Ignacak * fixes: Thomas Beierlein has reported that some combinations of '--enable-*'/'--disable-*' flags result in a code that fails to compile. He also provided a patch that fixes it. I've created a tool ('unixcw/tools/test_configure_flags.sh') that tests all combinations of configure flags, which also detected one more faulty configuration, in addition to the ones discovered by Thomas. 2013-01-24 Kamil Ignacak * unit tests: src/libcw/libcwtests.c has been heavily refactored. The work on the file will continue to ensure that public API of libcw is tested as thoroughly as reasonably possible. * new functions: adding new functions: cw_character_is_valid() (replaces cw_check_character()) and cw_string_is_valid() (replaces cw_check_string()). The old functions are still available, but have been marked as deprecated. 2013-01-03 Kamil Ignacak * fixes: fixing a function in libcw that attempts to open audio device. Simple improvement of logic conditions makes it less possible (under certain circumstances) that the function will fail to open a device. * pre-release: new version of unicw will have version number 3.2.0. New version of libcw will have soname version 5.0.0. Implementing necessary changes related to the two pieces of information. Also attempting to build debian packages from unixcw source package, and fixing bugs and upgrading files in the process. Various other updates of files related to pre-release activities. 2012-12-31 Kamil Ignacak * distribution: src/libcw/libcw_debug.h is now marked as file to be installed along with libcw.h * generator: improved behaviour of cw_generator_new() in cases when the function failed to create a generator. Now if the function fails, the generator variable is fully 'de-initialized'. 2012-12-29 Kamil Ignacak * tone queue: improving the method of queuing a space character. This helps me avoid problems in some corner case (when a single space is queued, and tone queue's low watermark is set to 1). This problem has been spotted when testing cwdaemon. * compilation errors: unixcw/src/libcw/libcw.h: Rewriting three cases of usage of "__attribute__ ((deprecated(msg)))", some versions of gcc may not support "deprecated" with string argument (error reported by user). 2012-11-21 Kamil Ignacak * debugging: I have reviewed list of CW_DEBUG_* flags. Some of the names of the flags have changed. If you are using any of these flags, you need to review your code. debug module now provides updated macro printing debug messages. The macro now accepts 'severity level' flag (debug / info / warning / error). There are now three permanent debug objects provided by libcw. Two of them are only for debug purposes, the third one is for general use. Behaviour of the objects may be controlled by the severity flag, as well as by debug flags defining areas of code, for which the debugging is active. 2012-09-17 Kamil Ignacak * libcw: code implementing support for various audio backends has been moved from libcw.c to new files. That way we have less mess in libcw.c, better separation of modules, and cleaner space for improvements in code implementing support for audio backends (e.g. advanced API of PulseAudio). 2012-09-11 Kamil Ignacak * debug: adding src/libcw/libcw_debug.py - a tool that transforms timing information that may be printed by debugged libcw applications. The transformed timing information may be then plotted by plotting programs to gain insight into inner workings and time dependencies of different parts of libcw applications. The tool is rather imperfect and may need manual adjustments for every new situation, but hopefully it will turn out to be useful. * cwcp: refactoring cwcp.c, adding comments, fixing one small annoyance. 2012-08-15 Kamil Ignacak * tone slopes: libcw now can generate tones with slopes shaped as sine function or as raised cosine function. The 'raised cosine' slope is now default. Until now, shape of slopes has been calculated every time a tone has been generated. Now the shape is calculated only when some parameters of generator (volume, sample rate, length of slope) change. This should improve performance of libcw by one or two percents (no benchmarks were performed :/ ). 2012-08-11 Kamil Ignacak * debug: Adding src/libcw/libcw_debug.c module. Currently the module implements only debug events with time stamps, but most probably all debugging facilities will be moved to the module in future. 2012-08-06 Kamil Ignacak * build system configuration: fixing faulty logic checking "--disable-feature" flags in configure.ac. Bug reported by Thomas Beierlein. Thanks Thomas! 2012-07-04 Kamil Ignacak * libcw: fixing problem with interlocks in threaded code; since this is an important fix, I will have to prepare new release of unixcw. 2012-05-27 Kamil Ignacak * libcw: fixing an error with overflowing n_samples. It was spotted during some tests performed when reviewing files before new release. I guess that means that I'm in a phase of final tests of the package. * unixcw: bunch of changes that prepare the package for new release. New release number of unixcw will be 3.1.0, new soname of libcw will be 4:0:0. 2012-05-21 Kamil Ignacak * libcw: Implementing loading of PulseAudio and ALSA libraries at run-time (loading symbols from the two libraries - to be exact), instead of doing it at compile time (load time?). This means that support for PulseAudio and/or ALSA can be enabled during compile time, but user doesn't have to have PulseAudio and/or ALSA installed on target system in order to install libcw. In other words: PulseAudio and ALSA libraries are now recommended, but not required. This does not mean that the two libraries are somehow deprecated by libcw. It just means that installing libcw doesn't have to mean a necessity of installing too much additional packages. OSS - by its nature - doesn't have to be loaded to be used by libcw, it's just open(), write() and close(), so handling OSS is much easier and doesn't involve run time loading (the description is rather simplified, but still OSS is a different story than PulseAudio and ALSA libraries). 2012-05-17 Kamil Ignacak * libcw/pulseaudio: some general improvements in PulseAudio code; there may be a slight improvement in responsiveness, as I've added code that configures buffering attribute passed to pa_simple_new(). The configuration is very simple (read: code copied from the net), I suspect that it can be improved. * libcw/Null: Adding support for Null output. Null output is an empty device that doesn't produce a sound. It doesn't use any physical or logical device to output a sound. Its only function is to provide a timing information: it acts as if it accepts and plays x microseconds of sound, and it returns after the x microseconds. I'm not sure if this will turn out useful, maybe yes, maybe no. Currently it is implemented using single call to usleep(), without any checks of return value. This should be improved. Code from cwutils has been changed to use/provide functionality related to the new output. 2012-05-14 Kamil Ignacak * libcw/tone queue: cw_generator_write_sine_wave_internal(): using cw_signal_wait_internal() (together with pthread_kill() in enqueue function) instead of usleep() - this should decrease CPU usage in idle state; still needs to be tested and verified, but - overall - good idea; I think that this solution existed in libcw before I've started slaughtering the code, so consider this just rediscovering of a clever code; 2012-05-10 Kamil Ignacak * libcw/console: Console output now works correctly, playing nicely with queue()/dequeue() and the generator. 2012-05-06 Kamil Ignacak * cwcp/user interface: fixing small bug in code: till now modifying practice time didn't work correctly, any attempts to do so resulted in resetting the time to zero. Now this is fixed. 2012-05-01 Kamil Ignacak * libcw/experimental code: removed code that was disabled when CW_DEV_EXPERIMENTAL_WRITE was set to 1. 2012-05-01 Kamil Ignacak * libcw/audio: more changes in libcw; I'm decreasing dependency on timers, and increasing dependency on tone queue. I could put it that way: there are less places where time periods are dictated by itimers, and more places where time periods are measured by audio systems' 'write' functions. This way I am sure that when I'm sending X samples to audio sink, it - given sample rate Y - results in Z microseconds of sound. This seems like a good concept, it works well so far. I think that it will me impossible (and impractical) to get rid of all timers, but for generating audio - it works well. There may be a problem with console buzzer, as there is no audio sink that would accept X samples, but already I have an idea how to solve this. I've been using CW_DEV_EXPERIMENTAL_WRITE definition to enable new, experimental code, and disable old code. Since the new, experimental code works so well, I will completely get rid of the old code soon. 2012-04-25 Kamil Ignacak * libcw/ALSA: the problem described below has been solved, but at a cost of significant changes in how a Morse code sound is generated (timers are no longer used). This will almost certainly affect other parts of libcw (e.g. Morse keys handling), but it has advantages: timing of ALSA sound is (should be - to be tested) perfect, and I can easily add support for PulseAudio. (this change has been made and committed earlier, somewhere between 21.04 and 24.04, I'm just describing it now). * libcw/PulseAudio: Adding support for PulseAudio. PulseAudio only works with "experimental write" enabled, so there is no way that I can have both PulseAudio and old algorithm for generating audio. Either I will have to refactor/refresh/rework rest of libcw.c (and then have PulseAudio), or I will leave old way of generating audio (not breaking things (yet) in applications using libcw, but also not having PulseAudio). 2012-04-21 Kamil Ignacak * libcw/ALSA: I've noticed that there is a problem with waveform produced with ALSA. Dits and dashes start at correct time, but they are ended incorrectly - either too soon, or too late. This results in dots and dashes of incorrect length. The length differences are small, but audible. I have ruled out problems with itimer. itimer doesn't produce perfect time intervals, but error introduced by itimer is way to small to result in described problem. The problem is probably related to delay introduced by snd_pcm_writei(). I'm thinking about following solution: start generating tones (be it inter-symbol silence, or the symbols (dits and dashes) themselves) on signal generated by itimer, but stop generating dit/dash/silence after writing specific number of samples to audio device. In other words: start generating on timer events, stop generating on sample counter overflow. The problem doesn't seem to appear when using OSS output, perhaps because sound fragment size is much smaller than ALSA period size, e.g. 128 vs. 940. 2012-04-15 Kamil Ignacak * build system: Most important change: adding code that handles --disable-xxx options passed to the script: --disable-console --disable-oss --disable-alsa --disable-cwcp --disable-xcwcp The options allow disabling certain functionalities of unixcw, so that the package can be built on machines that don't provide some functions or properties. Example: unixcw 3.0.1 can't be compiled on hurd-i386 because of this error from configure script: "configure: error: Cannot find either sys/kd.h, sys/vtkd.h, or sys/kbio.h" At lease one of these headers is needed for console buzzer support. With new code in configure, compilation of code working with console buzzer can be disabled. Similarly, user can now disable compilation of OSS-related code on platforms that no longer provide OSS. Functionality can be disabled explicitly (with command line option), or implicitly - if any of tests performed by configure script fails. Changes described above required some modifications of libcw.c file. Also added --enable-dev. Build system now uses Makefile.am and Makefile.in files used/generated by Automake. Adding two calls to configure: AM_INIT_AUTOMAKE (build system now uses Automake to handle Makefile files), and AC_PROG_LIBTOOL (libtool is now used to create libraries). Build system now supports "make distcheck" target. Build system now depends on libtool. unixcw-3.4.2/icon_unixcw.svg0000644000175000017500000001426111663010242015724 0ustar acerionacerion image/svg+xml unixcw-3.4.2/icon_unixcw.xpm0000644000175000017500000235034311663010407015742 0ustar acerionacerion/* XPM */ static char * unixcw_xpm[] = { "800 800 3 1", " c None", ". c #FF0000", "+ c #000000", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ...................................................................................................................................................... ...................................................................................................................................................... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++ ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; unixcw-3.4.2/HISTORY0000644000175000017500000001115512537345161013755 0ustar acerionacerionThis is HISTORY file for unixcw. It describes major changes in unixcw releases. For detailed description of changes see NEWS file. The original UnixCW package, version 1, grew out of a desire to have a program available under Linux that was very similar to the one I was used to under DOS. While several Linux Morse Tutors were, in fact, still are, available, I never quite found one that did the stuff I wanted. From the original UnixCW package came version 2. This was almost a total rewrite, although it included the same basic binaries as were in version 1. The two major changes for this version were the addition of an extensive, general purpose CW library, and also an X Window-based CW tutor program. With version 2.1, finally, came full sound card support, built into the CW library itself. All three main user level programs that use the library were enhanced to allow control over the sound card tone volume. Console speaker sound is still there, if needed, but sound card tones became the default mode. Version 2.2 was a bug-fixed version of 2.1. It seems that some sound card drivers (some later OSS drivers) couldn't handle the volume control ioctls that the CW library uses, and this meant sound card tones would not work for these systems. To solve this, version 2.2 uses the /dev/mixer device to control volumes if it finds that it cannot do this with the main sound card device. Version 2.3 is a thorough overhaul, cleanup, and refactoring of version 2.2. All the code has been reformatted for correct Gnu style, and programs now take a lot more care over what they do, and don't do, in signal handler context. cwcp and xcwcp now offer fully configurable modes and dictionaries through a configuration file option, and xcwcp has been rewritten in proper C++ style. Version 3.0 has been prepared and released by new lead developer, Kamil Ignacak. The takeover of unixcw has been discussed with and approved by Simon Baldwin. Main changes in 3.0 are: o rewriting parts of libcw so that using OSS is less probable to cause problems (this should solve at least one Debian bug) o adding support for ALSA to libcw; libcw uses OSS as default audio system, but there are no differences in support of OSS and ALSA in terms of functionality o porting xcwcp to Qt4 The fact that there is a new maintainer should take some burden off of shoulders of Kamal Mostafa, who was responsible for (among other things) patching unixcw. Version 3.0 introduces some changes in API, and there should be some more API changes in 3.1. Hopefully things will be more stable in 3.2. Version 3.0.1 contains small fixes that don't influence core capabilities of any application, but are still important. Patches for this release were provided mainly by Kamal Mostafa (thanks Kamal!). Version 3.1.0 adds support for PulseAudio. Plenty of other changes in library code improve timings of tones produced by the library. Few library functions are deprecated, they are replaced by new functions. Version 3.1.1 fixes small problem with interlocks in thread code. Version 3.2.0 introduces small fixes and improvements in libcw, and implements new debug facilities (the old ones are being deprecated). It also fixes faulty logic checking "--disable-feature" flags in configure.ac. The problem was spotted by Thomas Beierlein. Version 3.3.0 is mostly fixes. More fixes in configuration flags (thanks again to Thomas Beierlein). Patches fixing compilation under FreeBSD (thanks to Diane Bruce). Fixes and improvements of handling of iambic keying in libcw and xcwcp. Fixing compilation error in cwutils/dictionary.h. Version 3.3.1 is just one fix in libcw. Thanks to Pino Zollo ZP4KFX for reporting a bug and testing solution. Version 3.4.0 contains two changes in source code: - refreshment of cwcp code; - splitting libcw.c into parts. Additionally the build system has been updated to correctly build unixcw on: - FreeBSD 10 (x86_64-unknown-freebsd10.0, with clang 3.3); - FreeBSD 9.3 (freebsd9.3 with gcc 4.2.1); - OpenBSD 5.5 (amd64-unknown-openbsd5.5 with gcc 4.2.1); Version 3.4.1 focused on internal changes in libcw. All library code is now split between separate module files. Some test code from libcw_test_public.c has been moved to respective modules. Version 3.4.2 focused on internal changes in libcw. Improving separation of modules in the library. Taking steps to separate library's global variables (generator, receiver, key) and functions implicitly operating on these variables from functions taking a generator, receiver, or key as an argument. Improving unit tests code. Testing unixcw on Alpine Linux (because of musl libc) and FreeBSD 10.0 (because this is *unix*cw). unixcw-3.4.2/NEWS0000644000175000017500000005307212540353136013367 0ustar acerionacerionversion 3.4.2 / 2015-06-17 libcw: - fixing one possible cause of segfaults in generator code (segfaults occurred when pthread_kill() was called with invalid thread ID in some specific circumstances). - fixing another problem with libcw: when a generator is created, then is *not* started, and then is deleted, libcw called pthread_kill(&id, ...) on uninitialized id in cw_gen_delete(). This caused a program to crash. - fixing problems with OSS and generator modules that surfaced during tests on Alpine Linux. - expanding unit tests. - libcw is now compiled with -DNDEBUG flag by default (asserts are "off"). The asserts are still "on" by default in "unit tests" libcw. Asserts are switched "on" in base libcw with "./configure --enable-dev". - cw_generator_set_tone_slope(): some corner cases of handling function's arguments were cleared in function's top level comments, and implementation has been updated accordingly. - Library soname/version changed from 6.3.1 to 6.4.1. ---------------------------------------------------------------------------- version 3.4.1 / 2015-01-02 libcw: - The remainder of code from libcw.c has been moved to respective module files. New module file has been created: libcw_rec.c - it contains receiver code. I think that number of modules won't change anymore. libcw.c has been removed, all functionality is now implemented by module files. - A number of unit test functions has been moved from libcw_test_public.c to respective module files. These functions can be executed independently, so there is no reason to keep them in libcw_test_public.c. They can be kept in module files, close to tested library functions. libcw_test_public.c is now less difficult to work with. The moved test functions are now executed while building "make check" target, so they should be called more often, increasing the chances of catching problems early. - Data sets for some of receiver's unit tests are now generated by helper functions. This allowed me to increase size of the data sets and increase variation of the data (both for fixed speed receiving and for adaptive receiving). The data sets are basically timing tables used to drive the receiver - to test main functions of the receiver, responsible for accepting mark/space events from client code. The increased size and variation of the test data gives me more confidence that the core functionality of the receiver works as expected. - If you run libcw in debugging mode and you depend on Receiver State names (strings starting with RS_) printed by library's debug messages, you may want to check changed values of RS enum and corresponding strings on top of libcw_rec.c - they have been changed. - Some changes have been made to library functions (mainly in generator and receiver modules) to ensure that the code separated between modules can be compiled and that it works as expected. Since receiver code has been put in a separate file, it was possible to review and refactor the receiver code a bit. No functionality of the library has been changed, with an exception described in next point. - Data type of receiver's speed is now internally a float instead of int. This change improves behaviour of adaptive receiving algorithm a bit. It's not a big change, but it may positively impact client code using receiver functions. - libcw_test_public test executable now accepts '-m' command line option (for selecting module(s)) to test. Check output of 'libcw_test_public -h' for more details. - Since the modification described above does not change how the library works, nor does it change any API, there is no reason for any major revision changes. Library soname/version has been changed from 6.2.1 to 6.3.1. ---------------------------------------------------------------------------- version 3.4.0 / 2014-11-11 unixcw: - Build system files have been modified to correctly configure and compile unixcw (or at least parts of it) on following platforms (in addition to Debian GNU/Linux): - FreeBSD 10.0 (x86_64-unknown-freebsd10.0, with clang 3.3); - FreeBSD 9.3 (freebsd9.3 with gcc 4.2.1); - OpenBSD 5.5 (amd64-unknown-openbsd5.5 with gcc 4.2.1); See INSTALL file for more information. - QT4 configuration flags (CFLAGS, LIBS, MOC) are now detected only by using pkg-config. My hand-made script that searched for QT4 files has been reduced to simple call to PKG_CHECK_MODULES(). This means that the following arguments are no longer accepted by configure script: --with-qt-cflags= --with-qt-libraries= If you want to override pkg-config settings, you can still use environment variables. Check output of "./configure --help" for details libcw: - Large parts of libcw.c have been moved to new files: - libcw_gen.c (generator) - libcw_tq.c (tone queue) - libcw_data.c (representations and lookup) - libcw_key.c (straight key, iambic keyer) - libcw_signal.c (signal handling) - libcw_utils.c (utility functions) Benefits of this move: - I won't have to use a table of contents to move around in libcw.c (the file had 10kLOC before this operation); - it will be easier to define boundaries between functionality of modules, and it will be easier to reason about how these modules should function and interact with each other; Check ChangeLog entry from 2014-07-28 for more information on this subject. Separation of libcw modules is not yet completed. Receiver code is still mixed with generator code, and there are still some functions left in libcw.c. I expect to finish the separation in one or two development cycles. - "make check" now builds three executables in libcw directory: - libcw_test_internal - libcw_test_public - libcw_test_simple_gen main() functions for test executables have been moved outside of libcw.c. - fixed bug in OSS code on BSD systems (found under FreeBSD 10). As part of configuring OSS device, libcw made this call: ioctl(*fd, SNDCTL_DSP_POST, ¶meter) It turns out that this call was unnecessary and returned error value. This prevented libcw from correctly opening OSS device. Now OSS device should be again available to unixcw applications. Notice that this bug most probably affected only BSD systems. - Library soname/version changed from 6.1.1 to 6.2.1. All these changes described above did not change API of the library in any way. Functionality of the library is intact. libcw.h header file has not been changed at all. cwcp: - cwcp ignored CWCP_OPTIONS environment variable. Now it should read it and use it as intended. - cwcp code has been reviewed. Code has been modified to ensure that each call to ncurses' newwin() is matched with delwin(). valgrind may still complain, but now the situation is a bit better. ---------------------------------------------------------------------------- version 3.3.1 / 2014-04-23 libcw: - Fixing bug discovered when fixing a problem with cwdaemon, reported by Pino Zollo ZP4KFX. Condition for calling "low water mark in tone queue" callback was invalid. This resulted in calling the callback too early or too often. - Library version changed from 6.0.1 to 6.1.1. Big *thank you* to Pino Zollo ZP4KFX for reporting a problem with cwdaemon and for helping to solve it in cwdaemon and in libcw. ---------------------------------------------------------------------------- version 3.3.0 / 2013.12.10 unixcw: - Thomas Beierlein has reported that some combinations of '--enable-*'/'--disable-*' flags result in a code that fails to compile. He also provided a patch that fixes it. I've created a tool ('unixcw/tools/test_configure_flags.sh') that tests all combinations of configure flags, which also detected one more faulty configuration, in addition to the ones discovered by Thomas. Thanks Thomas! - FreeBSD patches: Diane Bruce provided a set of patches that fix compilation on FreeBSD (thank you!). Thanks to the patches the ./configure script now should support two new flags: --with-qt-cflags= --with-qt-libraries= The state of build system on FreeBSD may still not be perfect (I didn't test this myself on FreeBSD), but should now be better than it was. libcw: - new functions: adding new functions: cw_character_is_valid() (replaces cw_check_character()) and cw_string_is_valid() (replaces cw_check_string()). The old functions are still available, but have been marked as deprecated. - unit tests: improvements and expansion of unit test code testing public API. - unit tests: improvements and expansion of unit test code testing libcw's internal functions. - receiver code (responsible for receiving and recognizing Morse code keyed with iambic keyer or straight key) has been reviewed. - code handling incoming events for receiving iambic keyer has been improved. iambic keyer events sent from client code to libcw are recognized with better precision, which leads to better recognition of keyed characters. These changes don't change public API nor "external" behaviour of libcw - these are just improvements of existing functionality. - new function: cw_iambic_keyer_register_timer(): to be used by client code that wants to receive Morse code sent with mouse or keyboard keys emulating iambic key. The function is related to the change mentioned one point above. At this point the interface to iambic keying becomes a bit more complicated. It will take me some more time to figure it out completely. For now I've made some internal fixes and changes that improve one aspect of this functionality, and as a result I had to add this one function. Expect more changes in future. If you want to see an example of usage of the keyer API, see xcwcp source code. xcwcp: - xcwcp takes advantage of changes in how libcw handles iambic keying, and - with some additional modifications in xcwcp's code - gets improved handling of iambic keying. cwgen: - improving randomness of generated strings; until now if cwgen was called twice within the same second, it produced the same result (since the random function has been seeded with value returned by time()). Now the seed comes from gettimeofday() (the milliseconds part), so randomness has been improved a bit. cwutils: - unit tests: adding first unit test in cwutils/dictionary module. - bugfix: usage of __attribute__ ((deprecated("message"))) construct in cwutils/dictionary.h may have lead to compilation failure. This has been fixed by getting rid of "message" argument. ---------------------------------------------------------------------------- version 3.2.0 / 2013.01.11 unixcw: - Fixing faulty logic checking "--disable-feature" flags in configure.ac. Bug reported by Thomas Beierlein. Thanks Thomas! libcw: - Debugging facilities of the library are being rewritten and have been moved to new file: src/lib/libcw_debug.h. See the file for details of new interface. The interface may still change, and it isn't documented yet. List of CW_DEBUG_* flags has been modified. The old interface is being deprecated. - libcw now can generate tones with slopes shaped as sine function or as raised cosine function. The 'raised cosine' slope is now default. - Rewriting usage of "__attribute__ ((deprecated(msg)))" facility in libcw.h. A user has reported errors related to the attribute when compiling libcw with gcc 4.3.3. - Improving the method of queuing a space character. This helps me avoid problems in some corner cases (e.g. when a single space is queued, and tone queue's low watermark is set to 1). - Improving behaviour of cw_generator_new(). Under some circumstances it is less likely to fail to create new generator. There was also possibility of causing a client application to crash if the function failed, but this has been fixed. - Library version changed from 4.1.1 to 5.0.0. cwcp: - Fixing one small issue: in every new session with cwcp the application printed a space at the beginning of played text. ---------------------------------------------------------------------------- version 3.1.1 / 2012.07.04 libcw: - Fixing problem with interlocks in thread code. Library version changed from 4.0.0 to 4.1.1. ---------------------------------------------------------------------------- version 3.1.0 / 2012.06.30 unixcw: - Added support for PulseAudio. All applications from unixcw that produce audio output benefit from this. PulseAudio is the default audio backend on machines with installed and accessible PulseAudio server. If audio backend hasn't been specified by user, the applications try to access different sound backends in following order: PulseAudio -> OSS -> ALSA -> console buzzer. The usual restrictions for console buzzer output (root privileges required) still apply. Running application from unixcw package (cw, cwcp, xcwcp) with ALSA selected as sound backend while PulseAudio server is running will result in all kinds of different problems. User is warned about such situation by the application. - Added 'Null' audio system as an optional audio backend. No sound is being played if this system is selected, libcw is spending its time only on generating tones of proper length and sending then in proper moments to a pseudo-device. Pass '-s n' option to unixcw application to use this 'audio' backend. - Thanks to changes in libcw, unixcw doesn't 'require' ALSA or PulseAudio libraries, or PulseAudio server on target system, even if support for the two audio backends was compiled in. The two audio backends are now only recommended, thanks to linking to the libraries at run time. - Build system now uses libtool. 'libtool' script is in release archive, so there are no new compile-time requirements related to this (at least 'make distcheck' completes successfully with libtool package uninstalled). - It is possible to explicitly disable support for audio backends at compile time. Pass --disable-{console|oss|alsa|pulseaudio} to ./configure to do this. - It is possible to explicitly disable compilation of cwcp and xcwcp. Pass --disable-{cwcp|xcwcp} to ./configure to do this. - Build system now uses Makefile.am files as a basis to generate Makefile files. - Build system now supports and correctly builds "make distcheck" target. libcw: - Added support for PulseAudio. There are still some things to be improved in code implementing support for PulseAudio, but pretty solid basics are there. - Added support for Null pseudo-audio-system. Not sure if it will be useful, I just thought that someone would like to use libcw without generating any sound. Perhaps some simple platforms without audio devices, perhaps practicing sending/keying without playback. Who knows. It was easy to do, so I did it. - If you compare libcw.c files from this and previous release, you will notice lots of changes. This is because I've changed the algorithm that controls time periods when generating tones (generating sine wave). Until now the periods were measured with itimers. The tricky part was to keep two processed in sync: turning sine wave on and off, and sending the content of audio buffer with sine wave to audio backend. I'm calling it 'tricky' because it works fine only for small sizes of audio buffer, as was is in case of OSS (~128 samples). With larger buffer sizes forced by ALSA (~1k samples) the two processes de-synchronize. I had to come up with better design, and the side effect of the design is total rewrite of parts of libcw.c (for my own purposes I call the rewrite a 'butchering', but that is a different story). New design relies on blocking writes to audio systems, and their property of being able to play only X samples (Y milliseconds) at a time (with given sample rate). - Following functions are deprecated: cw_check_representation(), cw_lookup_representation(), cw_lookup_character(). Use these instead: cw_representation_is_valid(), cw_representation_to_character(), cw_character_to_representation(). - library's soname changed from 3.0.1 to 4.0.0 Library's version becomes independent from version of unixcw. cwcp: - Fixing small bug in user interface: till now modifying practice time didn't work correctly, any attempts to do so resulted in resetting the time to zero. Now this is fixed. ---------------------------------------------------------------------------- version 3.0.2 / 2012.06.18 New version. You won't find it in git repo, but only in SourceForge download area and on Debian webpage. This is a special release with two goals related to Debian packaging: debian/: - fixing Debian's FTBFS bug #676752 - removing debian/ from unixcw_X.Y.Z.orig.tar.gz. Contents of debian/ can be found in separately provided unixcw_X.Y.Z-W.debian.tar.gz Thanks to Kamal Mostafa for patiently explaining to me some details of Debian/Ubuntu packaging. ---------------------------------------------------------------------------- version 3.0.1 / 2012.01.08 Thanks to Kamal Mostafa for providing patches that are the reason for 3.0.1 release. Content of upstream package unixcw-3.0.1 is approximately the same as of Debian source package unixcw_3.0-5. debian/: - added proper "Section" field in control file; - fixed library dependencies in control file; - fixed "Replaces:"/"Conflicts:" fields in control file; - fixed Debian bug #653411: changes in *.preinst files to remove dangling symlinks left by old packaging (suggested by Bob Proulx); general: - fixed library dependencies in "configure" script; - fixed library dependencies provided by libcw.pc file; libcw: - proper detection of capabilities of liboss-salsa-dev (kfreebsd's libasound implementation); libcw now can be built properly on Debian/kFreeBSD; - fixing awk scripts producing man pages: the awk scripts now work with mawk too; cwcp: - fixed list of libraries in Makefile; ---------------------------------------------------------------------------- version 3.0 / 2011.12.13 Thanks to Simon Baldwin for creating this software in the first place, and to Kamal Mostafa for helping me with packaging unixcw 3.0 for Debian. unixcw: - Changed major version of unixcw package to '3'. Changes listed below probably justify this. - New main developer: Kamil Ignacak - New website: http://unixcw.sourceforge.net - Scripts building Debian packages now build 'libcw3' package instead of 'unixcw' package, and 'libcw3-dev' Debian package instead of 'unixcw-dev' Debian package. libcw: - Renamed 'cwlib' part of unixcw package to 'libcw'. - Renamed library's header file from cwlib.h to libcw.h. - Changed library's soname from 0 to 3 (/usr/lib/libcw.so.3.0.0 / libcw.so.3). - Added support for ALSA. OSS is still the default backend. - As a consequence, libasound2 is a new dependency. There is no possibility (yet) to disable or reconfigure this at build time. It is possible to select sound backend in applications that use libcw. - Added implicit dependency on pthread library (which is a part of libc library, so it should be available on target system by default). Main routine generating sine wave operates as a separate thread. - Added actual slopes to dot and dash sounds produced by the library. This should result in less of (or even none) audible pops. Unfortunately current implementation makes dots and dashes a tiny bit longer than they would be without the slopes. The difference is not significant, but I plan to re-implement it in the future to make this feature 100% correct. The slopes are linear. - Rewritten management of sound volume so that the library doesn't use OSS mixer. This should resolve Debian bug #567394 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567394). Code that controls volume level is common for OSS and ALSA. - Since libcw doesn't touch the mixer device anymore, then Debian bug #567392 should be resolved as well (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567392). - Added code that attempts to discover proper audio buffer size for both OSS and ALSA. This should resolve Debian bug #567395 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567395). - Fix of Debian bug #567395 should also solve Debian bug #567397 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567397). - Changed library's API. There will be more API changes in 3.1, so consider current API to be unstable. - Changed volume change step from 5% to 1%. - Changed frequency change step from 100Hz to 20Hz. - The library no longer can produce sound on console buzzer and on sound card at the same time. - The library knows default names of OSS, ALSA and console buzzer devices. The names are used to open sound devices if no other names are provided explicitly as function arguments. - Introduced symbolic names of int values returned by most of library's function: CW_FAILURE / CW_SUCCESS. xcwcp: - Ported xcwcp to QT4. This should resolve Debian bug #604386 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=604386). - Added auto-detection of QT4 headers and QT4 moc by build files. unixcw-3.4.2/THANKS0000644000175000017500000000272212373716241013603 0ustar acerionacerionunixcw was developed by Simon Baldwin, G0FRD . ---------- Thanks to... Kamal Mostafa, KA6MAL, for reviewing the libcw API, showing me the errors of my ways with 64-bit integers, and hounding me to add the adaptive receive speed tracking... Joop Stakenborg, PG4I, for being a willing "guinea pig" with various snapshots of unfinished versions of the package, for help in isolating various sound card problems, and for his continued enthusiasm and interest in maintaining UnixCW as a Debian Linux package... Paolo Cravero, IK1ZYW, for very kindly making the first sound card patch available for UnixCW 2. His tone generation code is now fully embedded inside the CW library, and it's no exaggeration to say that without his help, there would still be no sound card support in UnixCW... Michael D. Ivey, for identifying a problem with CW sending rhythm when sending in 'Farnsworth' mode, and for taking the time and trouble to test the patches I sent him... Wolf-Ruediger Juergens, for ideas on implementing CW weighting... Diane Bruce and Jason L. Wright, for adding support for assorted BSD flavors... Dan Jacobson, for making improvement suggestions above and beyond the call of duty... And finally, everyone else who has sent feedback about UnixCW. If not for your interest, and fairly frequent requests for a version that works with a sound card, the package would not have progressed at all. Simon Baldwin, G0FRD unixcw-3.4.2/configure0000755000175000017500000233071612536122131014576 0ustar acerionacerion#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for unixcw 3.4.2. # # # 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 -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || 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'" SHELL=${CONFIG_SHELL-/bin/sh} 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='unixcw' PACKAGE_TARNAME='unixcw' PACKAGE_VERSION='3.4.2' PACKAGE_STRING='unixcw 3.4.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/libcw/libcw_gen.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 LD_LINKS_SO CC_LINKS_SO CFLAG_PIC SRC_SUBDIRS LIBOBJS LIBCW_NDEBUG LIBCW_WITH_DEV_FALSE LIBCW_WITH_DEV_TRUE MOC QT4_LIBS QT4_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LIBCW_VERSION LDCONFIG GZIP OSS_LIB DL_LIB CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote 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 LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V 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' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_console enable_oss enable_alsa enable_pulseaudio enable_cwcp enable_xcwcp enable_dev ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR QT4_CFLAGS QT4_LIBS' # 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 unixcw 3.4.2 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/unixcw] --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 unixcw 3.4.2:";; 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-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-console disable support for console buzzer audio output --disable-oss disable support for OSS audio output --disable-alsa disable support for ALSA audio output --disable-pulseaudio disable support for PulseAudio audio output --disable-cwcp do not build cwcp (application with curses user interface) --disable-xcwcp do not build xcwcp (application with Qt4 user interface) --enable-dev enable development support (messages/debug code/asserts) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). 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 CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path QT4_CFLAGS C compiler flags for QT4, overriding pkg-config QT4_LIBS linker flags for QT4, overriding pkg-config 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 unixcw configure 3.4.2 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_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_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_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_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # 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 # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_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_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_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_cxx_try_link # 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_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 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 unixcw $as_me 3.4.2, 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=$? # 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 am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${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 case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac 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}" != 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='unixcw' VERSION='3.4.2' 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. 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 -' # 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 # Libtool initialization, added during tests on FreeBSD case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # 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 # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_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 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"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_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 '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $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 for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $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 # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi 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 test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else 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. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $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 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 for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=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_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=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_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } 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 CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Specify a configuration header. ac_config_headers="$ac_config_headers src/config.h" ac_config_files="$ac_config_files src/libcw/libcw.pc" # General checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${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 { $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 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=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$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 CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $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 CXX=$ac_ct_CXX fi fi fi fi # 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 { $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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" 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_CXX_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_CXX_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_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $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; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_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_cxx_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_cxx_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_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_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_cxx_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_cxx_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 \"$CXXCPP\" 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes 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 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Added during tests on FreeBSD { $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 { $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 # OS-specific configuration. On top there are default values of some # flags, to be modified per host type. # General notice: FreeBSD 9.3 doesn't like empty quotes # (e.g. DL_LIB=\"\"). Empty string should be totally empty. # libcw on Linux needs "-ldl" library (dlopen() and related symbols) # for dynamic loading of ALSA and PulseAudio libraries. Tested BSD # systems (FreeBSD and OpenBSD) don't have a separate -ldl library # (and since they don't support ALSA and PulseAudio, libcw on BSDs # wouldn't even need the library). DL_LIB= # libcw on OpenBSD (tested on 5.5) needs -lossaudio for _oss_ioctl # symbol. No explicit OSS library needed by libcw on FreeBSD and # Linux. Quick and short googling suggests that NetBSD also uses # ossaudio library. # TODO: consider using AC_CHECK_LIB(ossaudio, _oss_ioctl) OSS_LIB= case $host_os in *linux*|*Linux*) { $as_echo "$as_me:${as_lineno-$LINENO}: Detected Linux: $host_os" >&5 $as_echo "$as_me: Detected Linux: $host_os" >&6;} # Needed because of dynamic loading of libraries in libcw. DL_LIB=\"-ldl\" ;; *freebsd*|*FreeBSD*) { $as_echo "$as_me:${as_lineno-$LINENO}: Detected FreeBSD: $host_os" >&5 $as_echo "$as_me: Detected FreeBSD: $host_os" >&6;} ;; *openbsd*|*OpenBSD*) { $as_echo "$as_me:${as_lineno-$LINENO}: Detected OpenBSD: $host_os" >&5 $as_echo "$as_me: Detected OpenBSD: $host_os" >&6;} OSS_LIB=\"-lossaudio\" ;; *netbsd*|*NetBSD*) # I didn't test unixcw on NetBSD, but let's give it a # chance. { $as_echo "$as_me:${as_lineno-$LINENO}: Detected NetBSD: $host_os" >&5 $as_echo "$as_me: Detected NetBSD: $host_os" >&6;} OSS_LIB=\"-lossaudio\" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: Detected other OS: $host_os" >&5 $as_echo "$as_me: Detected other OS: $host_os" >&6;} # Until someone complains, for other OSes we will configure # the flags the same way as on Linux. DL_LIB=\"-ldl\" ;; esac # Check specifically for gzip and ldconfig, and substitute the harmless ":" # if absent. # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; 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_GZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $GZIP in [\\/]* | ?:[\\/]*) ac_cv_path_GZIP="$GZIP" # 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_GZIP="$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 ;; esac fi GZIP=$ac_cv_path_GZIP if test -n "$GZIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5 $as_echo "$GZIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$GZIP" ; then GZIP=":" fi # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; 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_LDCONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LDCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LDCONFIG="$LDCONFIG" # 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_LDCONFIG="$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 ;; esac fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDCONFIG" >&5 $as_echo "$LDCONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$LDCONFIG" ; then LDCONFIG=":" fi # Check for basic but essential libraries { $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 : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5 $as_echo_n "checking for floor in -lm... " >&6; } if ${ac_cv_lib_m_floor+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 floor (); int main () { return floor (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_floor=yes else ac_cv_lib_m_floor=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_m_floor" >&5 $as_echo "$ac_cv_lib_m_floor" >&6; } if test "x$ac_cv_lib_m_floor" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # show-stoppers if test $ac_cv_lib_m_floor = 'no' ; then as_fn_error $? "math library is missing, cannot continue" "$LINENO" 5 fi if test $ac_cv_lib_pthread_pthread_create = 'no' ; then as_fn_error $? "pthread library is missing, cannot continue" "$LINENO" 5 fi # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # library's current:revision:age # # I'm defining it here so that it's available in config.h and can be # used in libcw's cw_version() function that should return the # numbers. LIBCW_VERSION=\"6:4:1\" cat >>confdefs.h <<_ACEOF #define LIBCW_VERSION $LIBCW_VERSION _ACEOF # ######################################################################## # definitions of custom command line options for configure script # ######################################################################## # Build support for console buzzer output? Yes by default. # Check whether --enable-console was given. if test "${enable_console+set}" = set; then : enableval=$enable_console; else enable_console=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include console buzzer audio support" >&5 $as_echo_n "checking whether to include console buzzer audio support... " >&6; } if test "$enable_console" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Build support for OSS audio system? Yes by default. # Check whether --enable-oss was given. if test "${enable_oss+set}" = set; then : enableval=$enable_oss; else enable_oss=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include OSS audio support" >&5 $as_echo_n "checking whether to include OSS audio support... " >&6; } if test "$enable_oss" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Build support for ALSA audio system? Yes by default. # Check whether --enable-alsa was given. if test "${enable_alsa+set}" = set; then : enableval=$enable_alsa; else enable_alsa=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include ALSA audio support" >&5 $as_echo_n "checking whether to include ALSA audio support... " >&6; } if test "$enable_alsa" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Build support for PulseAudio audio system? Yes by default. # Check whether --enable-pulseaudio was given. if test "${enable_pulseaudio+set}" = set; then : enableval=$enable_pulseaudio; else enable_pulseaudio=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include PulseAudio audio support" >&5 $as_echo_n "checking whether to include PulseAudio audio support... " >&6; } if test "$enable_pulseaudio" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Build cwcp? Yes by default. # Check whether --enable-cwcp was given. if test "${enable_cwcp+set}" = set; then : enableval=$enable_cwcp; else enable_cwcp=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build cwcp" >&5 $as_echo_n "checking whether to build cwcp... " >&6; } if test "$enable_cwcp" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Build xcwcp? Yes by default. # Check whether --enable-xcwcp was given. if test "${enable_xcwcp+set}" = set; then : enableval=$enable_xcwcp; else enable_xcwcp=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build xcwcp" >&5 $as_echo_n "checking whether to build xcwcp... " >&6; } if test "$enable_xcwcp" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # Enable development debugging? No by default. # Check whether --enable-dev was given. if test "${enable_dev+set}" = set; then : enableval=$enable_dev; else enable_dev=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable development support" >&5 $as_echo_n "checking whether to enable development support... " >&6; } if test "$enable_dev" = "yes" ; 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" >&5 $as_echo "no" >&6; } fi # ##### # end # ##### # ######################################################################## # Process command line options, and if enabled - checking if requirements # for enabled features are satisfied. # ######################################################################## if test "$enable_console" = "no" ; then WITH_CONSOLE='no' else # Search for header that provides KIOCSOUND for ac_header in sys/kd.h sys/vtkd.h sys/kbio.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 if test "$ac_cv_header_sys_kd_h" = 'no' \ && test "$ac_cv_header_sys_vtkd_h" = 'no' \ && test "$ac_cv_header_sys_kbio_h" = 'no' ; then WITH_CONSOLE='no' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find either sys/kd.h, sys/vtkd.h, or sys/kbio.h - support for console buzzer audio output will be disabled" >&5 $as_echo "$as_me: WARNING: Cannot find either sys/kd.h, sys/vtkd.h, or sys/kbio.h - support for console buzzer audio output will be disabled" >&2;} else WITH_CONSOLE='yes' fi fi if test "$WITH_CONSOLE" = 'yes' ; then $as_echo "#define LIBCW_WITH_CONSOLE 1" >>confdefs.h fi if test "$enable_oss" = "no" ; then WITH_OSS='no' else for ac_header in soundcard.h sys/soundcard.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 if test "$ac_cv_header_soundcard_h" = 'no' \ && test "$ac_cv_header_sys_soundcard_h" = 'no' ; then WITH_OSS='no' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find either soundcard.h or sys/soundcard.h - support for OSS audio output will be disabled" >&5 $as_echo "$as_me: WARNING: Cannot find either soundcard.h or sys/soundcard.h - support for OSS audio output will be disabled" >&2;} else WITH_OSS='yes' fi fi if test "$WITH_OSS" = 'yes' ; then $as_echo "#define LIBCW_WITH_OSS 1" >>confdefs.h fi if test "$enable_alsa" = "no" ; then WITH_ALSA='no' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 $as_echo_n "checking for snd_pcm_open in -lasound... " >&6; } if ${ac_cv_lib_asound_snd_pcm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $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 snd_pcm_open (); int main () { return snd_pcm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_asound_snd_pcm_open=yes else ac_cv_lib_asound_snd_pcm_open=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_asound_snd_pcm_open" >&5 $as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; } if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBASOUND 1 _ACEOF LIBS="-lasound $LIBS" fi if test "$ac_cv_lib_asound_snd_pcm_open" = 'yes' ; then # Check for certain routines which are missing from liboss-salsa-dev # (kfreebsd's libasound implementation). If a function is found # build system defines HAVE_function_name in config.h. for ac_func in \ snd_pcm_hw_params_test_periods \ snd_pcm_hw_params_test_buffer_size \ 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 WITH_ALSA='yes' else WITH_ALSA='no' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ALSA library files - support for ALSA audio output will be disabled" >&5 $as_echo "$as_me: WARNING: Cannot find ALSA library files - support for ALSA audio output will be disabled" >&2;} fi fi if test "$WITH_ALSA" = 'yes' ; then $as_echo "#define LIBCW_WITH_ALSA 1" >>confdefs.h fi if test "$enable_pulseaudio" = "no" ; then WITH_PULSEAUDIO='no' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pa_simple_new in -lpulse-simple" >&5 $as_echo_n "checking for pa_simple_new in -lpulse-simple... " >&6; } if ${ac_cv_lib_pulse_simple_pa_simple_new+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpulse-simple $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 pa_simple_new (); int main () { return pa_simple_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pulse_simple_pa_simple_new=yes else ac_cv_lib_pulse_simple_pa_simple_new=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_pulse_simple_pa_simple_new" >&5 $as_echo "$ac_cv_lib_pulse_simple_pa_simple_new" >&6; } if test "x$ac_cv_lib_pulse_simple_pa_simple_new" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPULSE_SIMPLE 1 _ACEOF LIBS="-lpulse-simple $LIBS" fi if test "$ac_cv_lib_pulse_simple_pa_simple_new" = 'yes' ; then WITH_PULSEAUDIO='yes' else WITH_PULSEAUDIO='no' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find PulseAudio library files - support for PulseAudio audio output will be disabled" >&5 $as_echo "$as_me: WARNING: Cannot find PulseAudio library files - support for PulseAudio audio output will be disabled" >&2;} fi fi if test "$WITH_PULSEAUDIO" = 'yes' ; then $as_echo "#define LIBCW_WITH_PULSEAUDIO 1" >>confdefs.h fi if test "$enable_cwcp" = "no" ; then WITH_CWCP='no' 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 : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCURSES 1 _ACEOF LIBS="-lcurses $LIBS" fi if test $ac_cv_lib_curses_initscr = 'yes' ; then WITH_CWCP='yes' else WITH_CWCP='no' { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libcurses - unable to build cwcp" >&5 $as_echo "$as_me: WARNING: Cannot find libcurses - unable to build cwcp" >&2;} fi fi if test "$enable_xcwcp" = "no" ; then WITH_XCWCP='no' else # http://stackoverflow.com/questions/5178511/integrate-qt-project-with-autotool if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_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 ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for QT4" >&5 $as_echo_n "checking for QT4... " >&6; } if test -n "$QT4_CFLAGS"; then pkg_cv_QT4_CFLAGS="$QT4_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtCore QtGui >= 4.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "QtCore QtGui >= 4.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_QT4_CFLAGS=`$PKG_CONFIG --cflags "QtCore QtGui >= 4.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$QT4_LIBS"; then pkg_cv_QT4_LIBS="$QT4_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"QtCore QtGui >= 4.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "QtCore QtGui >= 4.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_QT4_LIBS=`$PKG_CONFIG --libs "QtCore QtGui >= 4.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then QT4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "QtCore QtGui >= 4.4.0" 2>&1` else QT4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "QtCore QtGui >= 4.4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$QT4_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find Qt4 files - unable to build xcwcp" >&5 $as_echo "$as_me: WARNING: Cannot find Qt4 files - unable to build xcwcp" >&2;} WITH_XCWCP='no' elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find Qt4 files - unable to build xcwcp" >&5 $as_echo "$as_me: WARNING: Cannot find Qt4 files - unable to build xcwcp" >&2;} WITH_XCWCP='no' else QT4_CFLAGS=$pkg_cv_QT4_CFLAGS QT4_LIBS=$pkg_cv_QT4_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } for ac_prog in moc-qt4 moc 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_path_MOC+:} false; then : $as_echo_n "(cached) " >&6 else case $MOC in [\\/]* | ?:[\\/]*) ac_cv_path_MOC="$MOC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in `eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin 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_MOC="$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 ;; esac fi MOC=$ac_cv_path_MOC if test -n "$MOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 $as_echo "$MOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$MOC" && break done test -n "$MOC" || MOC="moc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: QT4 CLFAGS is $QT4_CFLAGS" >&5 $as_echo "QT4 CLFAGS is $QT4_CFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: QT4 LIBS is $QT4_LIBS" >&5 $as_echo "QT4 LIBS is $QT4_LIBS" >&6; } WITH_XCWCP='yes' fi fi # Development support tools. if test "$enable_dev" = "yes"; then LIBCW_WITH_DEV_TRUE= LIBCW_WITH_DEV_FALSE='#' else LIBCW_WITH_DEV_TRUE='#' LIBCW_WITH_DEV_FALSE= fi if test "$enable_dev" = "yes" ; then WITH_DEV='yes' $as_echo "#define LIBCW_WITH_DEV 1" >>confdefs.h else WITH_DEV='no' fi if test "$WITH_DEV" = 'yes' ; then LIBCW_NDEBUG="" else LIBCW_NDEBUG="-DNDEBUG" fi # ##### # end # ##### # unixcw uses per-target linker object lists (target_LDADD) LIBS= # Checks for header files { $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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_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_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=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_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in fcntl.h limits.h stdlib.h string.h strings.h sys/ioctl.h \ sys/param.h sys/time.h unistd.h locale.h libintl.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 getopt.h do : ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_H 1 _ACEOF fi done for ac_header in string.h strings.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 if test "$ac_cv_header_string_h" = 'no' \ && test "$ac_cv_header_strings_h" = 'no' ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find either string.h or strings.h" >&5 $as_echo "$as_me: WARNING: Cannot find either string.h or strings.h" >&2;} fi # Checks for typedefs, structures, and compiler characteristics. { $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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=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_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi # Checks for library functions. for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=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_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=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_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 $as_echo_n "checking for working strcoll... " >&6; } if ${ac_cv_func_strcoll_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strcoll_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { return (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || strcoll ("123", "456") >= 0) ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strcoll_works=yes else ac_cv_func_strcoll_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_strcoll_works" >&5 $as_echo "$ac_cv_func_strcoll_works" >&6; } if test $ac_cv_func_strcoll_works = yes; then $as_echo "#define HAVE_STRCOLL 1" >>confdefs.h fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in floor gettimeofday memset sqrt strchr strdup strrchr \ strtoul getopt_long setlocale memmove select strerror strspn 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 for ac_header in sys/select.h sys/socket.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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* # Decide on which subdirectories to build; substitute into SRC_SUBDIRS. # Build cwcp if curses is available, and xcwcp if Qt is available. SRC_SUBDIRS="libcw cwutils cw cwgen" if test "$WITH_CWCP" = 'yes' ; then SRC_SUBDIRS="$SRC_SUBDIRS cwcp" fi if test "$WITH_XCWCP" = 'yes' ; then SRC_SUBDIRS="$SRC_SUBDIRS xcwcp" fi # Used for debug purposes. # CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O0/g'` # Add -Wall, -W, -pedantic, and other paranoia to gcc command flags, and -Wall # to with a few suppressions to icc command flags, then similarly, though less # so, for g++ and icpc. if test "`basename $CC`" = "gcc" ; then CFLAGS="$CFLAGS -Wall -W -pedantic -Wfloat-equal -Wpointer-arith -std=gnu99" CFLAGS="$CFLAGS -Wcast-qual -Wwrite-strings -Wmissing-prototypes" CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls" else if test "`basename $CC`" = "icc" ; then CFLAGS="$CFLAGS -Wall -wd181,188,279,383,593,810,981,1469" fi fi if test "`basename $CXX`" = "g++" ; then # -Wno-variadic-macros is to silence g++'s warnings about C99 # variadic macros from libcw_debug.h CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wno-variadic-macros" else if test "`basename $CXX`" = "icpc" ; then CXXFLAGS="$CXXFLAGS -Wall -wd181,188,279,383,593,810,981,1469" fi fi # Determine if -fPIC or -KPIC is available for building .so libraries. # Because gcc complains about invalid flags, but then continues, we have to # check by searching the compile stdout and stderr for any output. if test -z "$CFLAG_PIC" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -KPIC or -fPIC compiler options" >&5 $as_echo_n "checking for -KPIC or -fPIC compiler options... " >&6; } cat >conftest.c <<-EOF int so_test() { return 0; } EOF if $CC -fPIC -c conftest.c 2>&1 | egrep -q '.' ; then if $CC -KPIC -c conftest.c 2>&1 | egrep -q '.' ; then CFLAG_PIC="" else CFLAG_PIC="-KPIC" fi else CFLAG_PIC="-fPIC" fi rm -f conftest.c conftest.o if test -n "$CFLAG_PIC" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAG_PIC" >&5 $as_echo "$CFLAG_PIC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Determine if the C compiler builds DSO files, by testing with -shared. CC_LINKS_SO="no" if test -n "$CC" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc builds .so files with -shared" >&5 $as_echo_n "checking whether cc builds .so files with -shared... " >&6; } cat >conftest.c <<-EOF int so_test() { return 0; } EOF $CC -c conftest.c >/dev/null 2>/dev/null $CC -shared -o conftest.so conftest.o >/dev/null 2>/dev/null rm -f conftest.c conftest.o if test -f conftest.so ; then nm conftest.so | grep -q so_test if test $? -eq 0 ; then CC_LINKS_SO="yes" fi fi rm -f conftest.so if test $CC_LINKS_SO = "yes" ; 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" >&5 $as_echo "no" >&6; } fi fi # A linker might also build DSO files with -G, but we'll prefer to use the # compiler if it will cooperate. LD_LINKS_SO="no" # Extract the first word of "ld", so it can be a program name with args. set dummy ld; 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_LD+:} false; then : $as_echo_n "(cached) " >&6 else case $LD in [\\/]* | ?:[\\/]*) ac_cv_path_LD="$LD" # 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_LD="$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 ;; esac fi LD=$ac_cv_path_LD if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$LD" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ld builds .so files with -G" >&5 $as_echo_n "checking whether ld builds .so files with -G... " >&6; } cat >conftest.c <<-EOF int so_test() { return 0; } EOF $CC -c conftest.c >/dev/null 2>/dev/null $LD -G -o conftest.so conftest.o >/dev/null 2>/dev/null rm -f conftest.c conftest.o if test -f conftest.so ; then nm conftest.so | grep -q so_test if test $? -eq 0 ; then LD_LINKS_SO="yes" fi fi rm -f conftest.so if test $LD_LINKS_SO = "yes" ; 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" >&5 $as_echo "no" >&6; } fi else LD=":" fi ac_config_files="$ac_config_files Makefile.inc Makefile src/Makefile src/libcw/Makefile src/cwutils/Makefile src/cw/Makefile src/cwgen/Makefile" if test "$WITH_CWCP" = 'yes' ; then ac_config_files="$ac_config_files src/cwcp/Makefile" fi if test "$WITH_XCWCP" = 'yes' ; then ac_config_files="$ac_config_files src/xcwcp/Makefile" fi 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 "${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 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 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBCW_WITH_DEV_TRUE}" && test -z "${LIBCW_WITH_DEV_FALSE}"; then as_fn_error $? "conditional \"LIBCW_WITH_DEV\" 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 unixcw $as_me 3.4.2, 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="\\ unixcw config.status 3.4.2 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" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _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" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "src/libcw/libcw.pc") CONFIG_FILES="$CONFIG_FILES src/libcw/libcw.pc" ;; "Makefile.inc") CONFIG_FILES="$CONFIG_FILES Makefile.inc" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libcw/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcw/Makefile" ;; "src/cwutils/Makefile") CONFIG_FILES="$CONFIG_FILES src/cwutils/Makefile" ;; "src/cw/Makefile") CONFIG_FILES="$CONFIG_FILES src/cw/Makefile" ;; "src/cwgen/Makefile") CONFIG_FILES="$CONFIG_FILES src/cwgen/Makefile" ;; "src/cwcp/Makefile") CONFIG_FILES="$CONFIG_FILES src/cwcp/Makefile" ;; "src/xcwcp/Makefile") CONFIG_FILES="$CONFIG_FILES src/xcwcp/Makefile" ;; *) 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. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; 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 # Put this at the very end, so that these are the last lines seen by # user on console with low number of rows. { $as_echo "$as_me:${as_lineno-$LINENO}: ----------------------------------------------" >&5 $as_echo "$as_me: ----------------------------------------------" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: ------ $PACKAGE_NAME $PACKAGE_VERSION build configuration ------" >&5 $as_echo "$as_me: ------ $PACKAGE_NAME $PACKAGE_VERSION build configuration ------" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: operating system: ...................... $host_os" >&5 $as_echo "$as_me: operating system: ...................... $host_os" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: build libcw: ........................... yes" >&5 $as_echo "$as_me: build libcw: ........................... yes" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: libcw soname version: .............. $LIBCW_VERSION" >&5 $as_echo "$as_me: libcw soname version: .............. $LIBCW_VERSION" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: include console buzzer support: .... $WITH_CONSOLE" >&5 $as_echo "$as_me: include console buzzer support: .... $WITH_CONSOLE" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: include OSS support: ............... $WITH_OSS" >&5 $as_echo "$as_me: include OSS support: ............... $WITH_OSS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: include ALSA support: .............. $WITH_ALSA" >&5 $as_echo "$as_me: include ALSA support: .............. $WITH_ALSA" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: include PulseAudio support: ........ $WITH_PULSEAUDIO" >&5 $as_echo "$as_me: include PulseAudio support: ........ $WITH_PULSEAUDIO" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: build cw: .............................. yes" >&5 $as_echo "$as_me: build cw: .............................. yes" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: build cwgen: ........................... yes" >&5 $as_echo "$as_me: build cwgen: ........................... yes" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: build cwcp: ............................ $WITH_CWCP" >&5 $as_echo "$as_me: build cwcp: ............................ $WITH_CWCP" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: build xcwcp: ........................... $WITH_XCWCP" >&5 $as_echo "$as_me: build xcwcp: ........................... $WITH_XCWCP" >&6;} if test "$WITH_XCWCP" = 'yes' ; then { $as_echo "$as_me:${as_lineno-$LINENO}: Qt4 CFLAGS: $QT4_CFLAGS" >&5 $as_echo "$as_me: Qt4 CFLAGS: $QT4_CFLAGS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Qt4 LIBS: $QT4_LIBS" >&5 $as_echo "$as_me: Qt4 LIBS: $QT4_LIBS" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Qt4 MOC: $MOC" >&5 $as_echo "$as_me: Qt4 MOC: $MOC" >&6;} fi if test "$WITH_DEV" = 'yes' ; then { $as_echo "$as_me:${as_lineno-$LINENO}: enable dev support: ..................... yes" >&5 $as_echo "$as_me: enable dev support: ..................... yes" >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: ----------------------------------------------" >&5 $as_echo "$as_me: ----------------------------------------------" >&6;}