libmapper/0000755000175000017500000000000012423631307012022 5ustar tiagotiagolibmapper/install-sh0000755000175000017500000003325512423630127014035 0ustar tiagotiago#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # 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-writable 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: libmapper/icons/0000755000175000017500000000000012423630127013134 5ustar tiagotiagolibmapper/icons/libmapper_doc.png0000644000175000017500000010437512423630127016454 0ustar tiagotiagoPNG  IHDRhcp; iCCPICC ProfilexՖgTS鍒@ޑ"]z UPB138cAEQp, , q`C™5ͷ'sZzO,NCEP?O΂>ЀrXb xwY񦹬׿NEAB ~:'ŒL{g1mXI-2NOqP/lL$ILd>t:Ɩ"P]<y/q-F7~=[!N㭘_iY~M颴yAU!;pig6'"¦uQiNN8o>&{͛ o}Rx3/ 0iMfA7=Q˝օoJ]m BA8i 4Lö63!;OaRr&{8\Œcmie)+߄ۛZ웻&lpo/-H/M<3%ɞꇗ]@yPU]0s;pwpdl%`@lPjf8\ @ F#BB QE}FW BBh$IBDHl@ُ!?#9 ҋCa5 štT @ Y"4 ]f BM9z/1h86Ngsyq1DW+UpmNM7'YxGeb|9߄Ǐu)%, $ IEm Hd Db41XLCl${1J2%IMH[K+]>ҙt=EL?Hoߣa0 wF #Q8x ǒ U5ݐ{)Oח_,+_*\E@KZBUOaLhXxH4`0|f54b-32eL4v0N5ccؚ$T\7EML{L{ff"*>syyy"bEYzbfm9뫥eVLVmVMַl66klZl^60{컶,۹m;lI+B.;=8rdtOgsTCCs $90gEDžEqsUsr{.pqaq㥧{/'U^8o?BnOOc_$zQ?[~@m}\ .[ Xp!X$$H60w܇5C07x{Ðe!'_1iUh^hg+lIءw[DEdEtDGFE*.`ՂkjRLdLMB;Yd(gѕj^"x!.*Pg^07ύ{w_; . % ]K\' '%&W))RާLHJkL'ǥTхKsMb2e;J%5HƢL%tee}՟]ay99&+6xJJʎw{Ύow.ytv]]YeAe-vo9;uw8pBDI&iEhsr%5͹/<}-ggL=;.n9tncIǃ ߺ0B/^:ySW^u|ZSm_m=mtzKcO[37n}-kqn_lн{g!a#GWf[Nz߻Iؓgy0)i3guCC}{/|>Bb|?*_<] F_I^M.~o;BK7ڏ;?E}z63s/m_>H$I/F41AF4>'g S~c,SybP@f?+oPCXU6֓К1kR:1$c/}_j0ݔ'&*pP@7wO pHYs   IDATx}$E~v$a a"Ir4E@{(*Y,ApA*q KN ,aɰ9W3svt̜ڪ:u*}͹U .t C0@uzd!>0 C AX C0{0 "` c2 CC0rtN/u0 #h C)F90-C0z qy}/kܹiGc5RҶ,KFm{_d2t!8:'^&@Z#@~.W>}z̙3GϞ=;$D8}y{ν,1%M;%%B U!.$:y䏤w') ,!b_Hc'wѣ;;bsQΠK6a0tr^&\-r[·ϟ%ѣ;ޅ)adj",-;?%D+![H1;w?#8bvq%bVc"3VXUMЊ3A׆L1#d=O>}mR$eZҞ9~W'Yyh9v[>k֬;{'L93BWJQit9HX@q`ZJ Ac~kY!GQ͛w'xŝw9R.*eF 6&"2\""nHkX~[B#h\ ˌ9眿k_V$$k#2@bVO+&dOdr#[KS!RqkW^yџ'}.>7|3exjl׊7-huC7KPFDJUoJ=à`hFZaa =Oyolh=GYE)ތZE5s)׍/$DWCoߑ<&fQA9-lb@q-~r&)3D>=-m^^PWŁ,kY?Ȋ+8q+ 1\Pևkp:,:D3qz3 نu(cy2YI2LWnܸu >_?K*ϔ<o"p8 Qq01<3C\ FDe:ugtߪ:AIo$2 e@*1|ӟx≁ly;C!g1Jz .J/bsyD1#e!#)#iY iQȜ!1°<8C,dݐa}"aÆ3RsU!2D>C}ѢzȋCgzxКF9C 4iu8 N4W! prMԨm>s@CA;t$y0Litׯ>ͣF,|ip Q)^Ȳ@9b~NC'IAo 0GNrEyTAr2ƙ?zl.[ޱ,>s5mWU[%qpA!6 a#I"Ou52ΐ #3gNrg_>~m,Y i(jk4ȁũi7Cڠ7Iq)e !#"B]|YHCXӷo; b"GF%BJH UzIHR!$cC 7$*fdtAP;Az8߿_lSvKz)СC袋>+K 8eDD x}MҶ80HI'#iyёFڶP9C 34yQ7,@ഊ9C2={vG KwqtI#D-ie)څi@Ҍ[-qH'CFȏʛ3r !:Krqbz"<3Xir&` a$I9gm]kT= ցD͐2ԫ-+k(;2ӑAA.:RqmEk$n-.{?xg,2#i0.izRֵRR,A^z:He-J5H}x!' :X2 FJTB|b4Bx#Ăy'O|s@n3CApaiȐ<%('mHu:,͑OOIx9KC81S^" =suB9uq$uۖF '!c#q4A >9sd ZSzv뭷`XE-i<#/)0}4ZEFZGk5) cZF9dAE:ԣNg͚K.ȕ:/9ҔɜtZnm l$]B5jIS4F4Ci[hV5rMդ 4q$dtϚxQNxZUkR ӕAF/YBZFHr"t㳶 !@E$b )G.˸u9nS4bC(˞P aQqϰ&iLKlJ_^Z*d]LqZ ޯ L8uyS+uIi`&C`C^e: }hOmە"x9RG?'$\bAG(]MrHSCj+q3򙦎N3>}9/0(itK,k9B bjGKS$mQzh̥@=:_Fa,W_Fu|.)i $a!!{PӅxw,'/'^r@ D$-uQ`߬Z@jGyT)c>@rIbeofZC@BpHF !G/ Ak|Ptd|.Ҩ2 D:kBcaq ݰ/,GB}7pÛ$'OsO#bZ^#OyhZڜaN<芄]q җ[="-(F@?>D]+h APW.!jҚ͗Txv 3}΋뾈N穧/Ikpb1'KˬAkw.CyOm]aRC]q.: t:NcagZX`U,i95 Zs@%Hhq5.!#Zap]4tV{YXG"PIB/4Iܢ.z /p8'MSh (:;;i9#66A`::H7(!g1 Ys/pYX{rZ,A=Jt3Y:RHZ⋗.}ENH=$_9iQC]LJZ.Ȗd2L3$9ӪFfӂ.{3-kcA'k i9Bk|9BH1$-uNJ /x2i1D\ra_Z$XS8B]V8C꡻Nq u!ց<8P}htև<daq.k0`vvۍG}40' &ϋ.sҒ6fRb0BH7LK&2DyI#լӺ?^}Ca_;e1)T^.N:(/ozZ-T~6'R_ȐZ$\tqAiAm+W~_I>, eZq-K:^דּκ&U`IEx IR\[AeA@@gXMHδQI/ l.5N+N!޽}#Ou1OaxYQI5I(Dz:ޥ*u|#,u?V*ʑ48U"fW]h(i#P3_M~I!a#*FB ! X1`\^b}[M4eqCHD -(I!Izfz !$ۢRT|Xz :Fu^0.$;|W\h=IAnHM<6)7CyV*ٖ|qy$WeMl_m3rFpUáQ^Jq(6y wCnYg |׺kqX]ꊪC6s$bú/=J#M6lƷ;v+QO&_IRiY ^H 9Fc$[aC8CG[p‡zxIA"h;Q9YցWMnçM'mƍw)ǯ 9 /דM!dL C G0r1 K<2,W=Ł4 Ƒ֨>P%%qTZN`>]c\k5Ǐ]A mBL>a;#覿6 yD|8Be:NBz~uB2*žɑrݮ3aԣ]^m Ǹ829Bk?2hB&Y#dAGGNDyD (GxPCsi[uСkZiOBNT[XZ8_=1N x5"ge\4C23렌:,CXt~t.#;"sT1v, wHcĈgN8()A.TRZjN%!jR mkp=(C/̿=81DO]y,gǶʝ43et}~Euu*6tR.&Gg t;:>6w&Mz.<:ەtS°P_4(,_#a u!u /#z:2CWV!ڱ.-Cet$~#>2!Kj-\P !SDF&x 3(@f*Y8!N":sZrB ?6rf[Z8 ʙ5AfP6i O_~eX gx6 ShNZ fA@n]2HRz:|M9e qUrKT͈pY),Lp <48DH :CF P7aiQOn /0Kh| |i( Rn8̔49C ϼriDt(g4F(4gIRϟ?M/_+MOΞ=:ї0>Q8 1wBԣLץ c,+eKn喛?}ル"1T4Ws䚤3%hŜ!TH& 8PN,`]!PiX,ϛ:uO=̲>"?L>ǐ:Q!B<Ɔ2}Fy8]?+*Y$d1ΐ咤Is!"$ ^d 1rBGCtLu! jc*$ZH<Ҕ3!#Y㇉?Jk'^SNg?Ps Hi8t>.25$ԂƸs4n6?y?@GR!e9$U-,C)g93u0 BiQB(cyge4u G{>03 Y78˱>) '0^KK_s$-JQyqh\ s@@p YiSrG#PixZ3 Q!ʰMymAy"?z\Z$L-CK9~L( Dz4}?c`iI#M/Bd qF mfsxTq2q\P<8e! ySOCFGIެ i8ZWYW.(G$RO˃2e0Slo=s9g))T$GTK͎@IbiCF"$j+qCtԧC !tM3Dye8ir:z ӸxX qKˉG-ySq;0tC;:~@<D$4-qM~h y#V0CGa2Y`Y n;7I tGqmeePtt<8D>(KYہh-2k4CQBG8rShgZ8e{u>]wY#f1Ν%m4@ 8PɁ1! y  G]ơ-cmSGG8iX qwozat9x Ot2c8a[m=]wJ"3/QA9;C7ӒUNտ%khHHQ8 Hʠ$[!׺y]Vau0P{䣯 㸂r' 5yk=q,vqׯ,rKFaWd@4HR:8 ! ru9 IiQC lraZ_cدzG7~=waK{ƅŜt\Xd '#p !pe9X|<ׄL]<G98B8.gk}tuYp:dgT  K[#o,xKܐt Z: Mȣə!d 堃d6PG )#!~ƃy,h K>Ȥre'ٲ[悤Qu4<3֏0Nՠo Y!LJ<=> 2d},uRq'|7x|Qp<5 H2A< _0N d>BK҅ i)|ƃ!I9fʰBQG#MVyZ',Ն*W_}kER+Ilooh]UrmHȁS0(X<,2::HV3D:4T#56 H$A-c5:2IJHy n;ѳԇ|ʙF}q8CEFy:x.A:t{2uqB)g׆n7ѡ h%VejAnw@ >HHȣNВ& t,p(tA泯 !g!u9 qSƲ:d^.d:}!ȑ#:nOKBi=#Ԥ-I;GAR B_JY e@$( yli3u`c2Yy:rY4t*9|9M|رc~PǯWrE. #VSFE-0*!DȐLyY2I.AiǺHen#(c^.FʐH,JC qHk=_guv%zF(?U cDw4(Fð@ R(HB+aP#p$q, 1a P'ϴ.]NF k_׫a ¿r.;]<,e8Liz&1sy+\( 4L :IL3x`OG`DE0vbGHG} lX皭h#hi R :lz Z,v e(8L^Z?J<,/Jr0 R!cy긮\eDmFKޫAΘ )3$3-*^!0ڊ6?@r Pɓ![i]Y'4YuY7Bʨ҈18)^2iu=8#G^9Ǻ :t}ɿZ<1:H E%3N0!Ĩz$CD>VA ANo&mꅼRЧnTy0d::/!k}70`z _鍨Z]YگʊΔR-@ ( #{$Z)=xr !|XƵN8ԍʯ$gC^ץuZQ>&Zo߾{!r0șЍ Nf(d3 zI u)ӄ!䰠׺r^' I uĂ M|+S48g&CȐFXX!-R\tU=B@hit:a.vQuiAk=eaz( YP4C%FeZ:uYWZi%Ls<$38pq䑤%Z"m/G?{c;#P!Wt0(2p$ Q#:IY& w/\.1%:t,ްaƑ-bH䌋&fA+9#1jG@BqL`n &0Pg%^2q]]^QFc뀞 nIX {ae+$퀸r 3 *{еLd A-|3u~xT[qʖxtXN_:8>A,<ǴiqC7tSGFOLj#'ݒ$pfA'T 0T-3uS噯a^Ұ\r}Kڎ3QA/L7YGTW3fe)iX1iNmpJd2wt?\4 ّX(ٓqk2Cap<(UuUʧ^0\c5F5 [2di9!.KLҙt؜!вR8i(guu/*$W.u0! :K.%i3$Dh2q挠kJ W0iTy:lkM~֣JVn_ǵNZEYdi  ޤM 4 ִJ;A:s@ ahBc3c:dQ_t^=Y6ӥ,!C 3ρA”! rx6LK43iU#!t #$j'Iyx~&-WɁ90R\3X2194 YDiP/ij-_>+F^5cLT_鳄䁠A:ipIk40i qfW>C   iMҽxFЂ9C Oԃ\5<7i`~zΚ5 $ rzހpЧg3 C*@I}U  H~:]wAR)!xMÚ`]|V0"$jIMCޜ )GYↀ!`!WD %wIB|c96Kٔ Chgd-t??xdPTcKu un&0 CDa=u$n$m8!`T@@'$gI$`)g:Vht,L0 YW / 0҆!`d#'47G5uQ#]A2 CD@ $ Uls!`痂$`4Ӏe1,*ˊ*Y!`&HO( R/(/@I`C0 pfΜT$`r(d$R2 C0 FIܬ$C()1O͂. e!ЉiHː CJA!`:u*T#fPiyd<)|XȾZ!` E࣏>%ZLo;tb9cdJ!`Q)yXJI S+YKǥK?,_~2eϝmv3f(sM"/cٸ{9ԇ.[ve/n\?d8hFMwVE]UP4ix'ݓO>AE 0}t?߭znvp[ny 4ðJwAw# ySnFwڴE>.IK?$W\YIGsL3 F5C^Ŭ׀d3g1>ح-K! 5.c,/=N6cɸukf~ 6p~ Fs]PMExWN:(6 Uc馛ܵ^fϞ~V!P<;#{~AUQKk2MQrGV)eDV ,g#:Ungf-~)lZ+!4 Ϋ*ntUU_V^n+m1or= {39O;4N: qs]>t8Sݩ?.IJ  !C]w?5[[uGGqo~V[mu L 7]pt_[;GjKyG|gK.8~Dx\/cuGq{LF7WN/83%X=jA% ǩ/iCQC_z%1Ov {s1mo\Ke KzB7p FAv5YQ r> >NӍ7as_WwiV뺊sD:FXgq{bh!@f-XFyUB2O?>֫CXxqm>/Nqh8"#0TjafUYqCfB۷z뭽 ?r_O[RS冚 9[]*0G]Ί%ҲxQ; Hva~+RcUD^~e:)~VэL$SYЩY_W[ "C: Mz,ׯ_?o"_~#jMgﱟ8 &> qm3t'|rKoiA'/t2U.e`EH!KklR1Ϻ_y?_/" Vy^VtUu/EsN < [: @v gKՌcVؖXǏ#*9XZc5[lQI)S1W9J87.d۹ߠ K@kO> MJ_{yJ-O#FtfA7%sv\"Yƶn뉹YWV8[/ʼM̬g, WR6mF%3$ M6ĵue^}UOʘޘ5kVZW\q,|;C.m7m4>p~AuX5nw e죑\IJV8:K: xFeXl9yxkR{Sw񻽥PP{Č~emO Ϻ۫G>AC'"A5'X/[-nΜ9#ɓ]}mZ4eo?od7jnۦ8j,fX}%NU8.Ӭ/ [UT*f]|֋|"J+<5,p:W_يjliJc f%薞5Ѱ X3䠃J9kEh.[S^p."6Bk-M)Ӑ*WܟW sϹ1cdx-G֣8n&sAki{TL4ɝuY>`ڴ'HfA5EYb%܉'FC[bi| # {atBPh(;:(7p2Zݳ@`ޘL.5E,/ m/45=SIzfX?3 'MLABFAf6ILc38}-E+ћ) :nAW@u9r;clvƚf쟑N 2ٍ-sMs뚓=߿޳G.;8{h` X\skOsyqԩf|bZXyĆl͘1C(*[_Mw}=-:msG/'4s8g\!ЌϖL#/tH:5B7bg8{ity󻔛g]$0ό͍dҵ__~yfohFNz tgΜYA#s;|=JsFvh^݀ż{UW3,ƺflhF9őڅ1e^oE:0֑8;/V@ȆձwmFUzGcUaBL~#GQ%Ay T%`O#Fx">|xU/*i_tE6ү7!f#3 đAA:Ȫ 2^rztcZϹ>~\ǀ8abc sb⋻^s qn 'ԫ;}tƓO>-@^0 :/W*ER^K,\nbI/^^nR#݂ev ]FK/Č]g"w~嶀͔ؠ!ݣ.hծo-i6N)Zv~-/2 ڵ||!w^1fztzAޙ eC ULqDYQ.ݰ %%5Y_Ms{Y<;zz]Ke5aNu?XW[Ľݷwv fW&߸!^s]~{~h\y\o\/}$G[K{$=P҃GnVV.' ܽ9C IJ|Yi!B=/ʉ'K=UjJV iz[#8߿ Wev*dpI!ď^TS&q:ħۈK,>uU,h⨩F5W8&ڰB7GOA0r!=J~@VC麲")ߏeX7*zTWK667^%$_ժ禽P['d5wBΜa/+wKWny2;e9C$S 1 W;A۰ o𫋵 Ĝf+!w%E _.%S!˔J?,hL|0bHLpߘjhB@]`oE}anUq^B-GZ#@湱:+,Xa\SW-?L׾_:Tnt*]3NT2SoKQ#Gp7˚=qȋ}V\̒n‾+eY5oǭ6ˎJ  #k“u?w^y{_ XՍCXk£~Op8oĬؙ~Ap)BA=Bj%V5(Vw]ibUgya wG-;;R@9L6d%9C]oۨ~|U},W˳{V6QXӿ~&/D8jZH@Yln: t :UO4F47ŗyb? _./fw? lۑa7BNeedJN/u!9ÇzՄ{sl(k*+=Ϝ!6Bе='.kRC B|Y1;=xBw߽W$YEm@_A-o<Y;QKD| kz3=H]3!T6eah<"$ͱyS>v'|P Z(3ő஌#Xf+/I//[pP9CZjNުtr̬DX9&Mltɻc?yjs@RXIo &SB{{?u27=ڬ]::'^?[/kWK5eC +̂ ikn`)'/"W5=ܮi^BvTSq/+֕-A;櫹V!<(_ (ۚ>bzܕ|p.d܊)o}GU)-嚌:ztP"r%Zzje |ѫ;I2Ŏ~Q[FU9r!?q6_%`JXٹO>kmߑKY7t8ӽ8:| z#1oe6f#^#+E^OLc뭈a +/GoK)G})?L蚍z *݌w98[ԙ4d?dse! Z+bE c̪u/*L-@z $ԙĚ>Y&R,nᱯ2}Xꑅݦ#O`bqmU81Z՘1.{qj5Ak4,޲|,ąm*>Q%]mĂ}t?s._/8*S*V'ȏ-22'dcR-_U5UUu E~k~> di<{y!)}z9|(W7ƅߓ[sfUCr^тNVnU{ƨT |"0]J+Mcx{ϱn.}~GN5W:Yb w#顢UYaVqt@vח)Ųl1avi ڶMڬ.0DYzN_Rnw9oD,ËV5^,>iVu̮N #4ѴZ ,N_^VvAzXㄬͪWu-hLg=-;>`=;zr]ϧ&⦅]G2n VQ$0.jؐTT7'՝͂Vh["˺m֮O>>Yas>>=Y{%7]Ǵ>~w^zr,lw%anw?W\xn-pOf$R+Yu+U3&: ZjrlIMc]nx:u|!$ŗKIY u̐#3f8':xϻՓ+YoHY,gIs YԕtW=K-;Co^Ηc>X_|\i !dٳgs9 渹滹zzw}ЫYNO8\yNq,Ft Lu߿;{zNguXȓ'Ov{ݻ>C7o^u?IoJ=xJL%B _1#DƔ[ -uQnذa5 KgO;W_}k݋;yп'us .6nlcݱ6p.$YfG}ĉ2w\/Wnv,e 0W;6Q;V!^`*CqU_~yt ,\ k3ﭾeYڈ3G'd &SjvOtkF` Gq7tH\A*mw`Y,^ sCҒ˴[6NQ/WjkMvpn\.?Ab .5 z]QXAykZЉA i-۔>Mwmiº]zn-pmM@9-Woy喋!|׳gO@6l6t{4>[{饗@&T^-3]gu<)o殜ֵ,-EY[ؗ$43gkr-{73dut]Mr>o4K/]u$h,7I2,Su?uAUW]尾ٜ!`2!fH0=z_ÍZ]7/}V_iܢ>ٖ^x+6őYqK%X"A<n4Zz \!vC`—_~/q=\ F!`toTL nv+} 7yk]ݻQÍl_t_8qbe F q{7%ZNG NpL#+K7l4QWeHF}QIhz[@UtiǍRa9,mk:]wOϖѵ Z㬊hZ(/>l AV_}-u/=DU$(;@ dt *~iϸwer\5c[Uq=c:j+BiYб1n8Is7vKai>*a~\K_,{Lv@?{4oui!Xj:-$S+9L1bD 5q^So̝3oA͑?JBےb端}qlz@HπU#x8enۋbZ>ƍ8VX";ua+4V\qEk:kVƴ϶n1YgϮZ+oYiV^p|-G"KЕG=X sp m5Nxj{ַw{GL5+AWK҉˙]H"D쯿W=+2$ٴSs΍^5J _nW {̘1W5vo~yʇ~XMLS 9؏A"fysO_wGNCqOS?e'Vmޒg}jibE`TIt\.# hV5: '޲si ]^{ߝzW^SI?4su/|%u1-LЩxS  hA_tEnS nƌ`ICL`>~v?uzV]uUw{/TaI1!n6>1 frӦMsMJ+ "O?P_%q?CYg9IRtl6K:3v# (%W:|g8qʣ>ڝwy~y_br[Y[FVƫZa?Oo6H2mc=mƣz=hR6 :Ob3Dy¯'^x@8|&7t$L4e݀{%IA7cεx^zuQkq͋=ZXЧro!bm#g7.> 1@^{;co;:q|h._ 6&tfA sE+<@ $'KNcQoMLAZ֥w\i,X7+%vyt>S5 a]U12.ˌTF*"'?[Xa^1"IDAT2iiV =u'i#44=zt MS lϿ/]=@| jUwv,UMu'e=0#hF867?{9wG &$s9ǯ~+$؊Y]02%h Y=NiߏU5O;407#.R[-^֤Phf,z +k̘12!+{<쳉Zq^կj87k /66p%Hq=ӬN~X*tDCԂNԳ*\P͚5+QgO>TςLԉeYi2Cͥ@tpD3茠6ˍ#m~U臯qAȋ^~~9_^fۘf`/IqpX"wwLr9򨛪\iFЕRxxD\s N:YRkk.s? ZR,V^{Ochx5]MMG؎ayT;!6GE8<8}x:,‘Kqӎ;/ ]-H|tUT;q[o}OH&:yof{[~'c1GAsTc_!lA1Dzx /DٚK@޽w%L5?s8qԩUu 0}; W]u!f׫0f( :8^a_mX p5S\7=9At@ .ÊϪ(mExƴla _g*o{gV6ªرcus.ʴK#[fbAAw?~vrJ;0묳N}! 2e?G2AmV E='kFU8ظBЧX~Ad5yS;?l}.$Ki̙3KV`}wV5檓|ܓ_2y A"?g YD_fGk/Xߊ : ǜɚ3[շ~U}駻-"nwr'2^5jTfm/ k%Bk~0/8N4iR*p2:9%\?}4hPU05J\$|ewx_ytz u {/첩 Ъr=-ꫯv-X5s[F,WłtЦ8r{Ëa6 y+D=f̘VY. )NQc8LVܢ>zUR4s#IO֗ طU뮻p a]d+7Z A&k[&43-ڬ<# aH-L`n< dM!RI36NVĸq3k0]wAOÇyeYƉamqL=ѕ-I6{^_#Ƶ n@~MI#Z>^ 3tʹT !~O?tqI6 : 2* cq\]ac= ܻINNGjjtB 34 ,[$&Cu&yĉ=)?㉿pd'Oa.^l ߬! ܰRIwyo3sLF3<>l0:`&zTB8,\fFi٠bgԨQ7 ֬!..AσDhi9@ z`C0JtD4N)@#Cqt*Bi]"S0 CMq؝`@~dWO42eʆ!d6!`$E U RFЕ|C0:0b!`ϵ!D, "6 C 'ABX7 C@G] ^v!`El9N/PO6 C ؗ,)C0<Z6aw!`0i!YOњݵ C6 ɯu0Z(N*Yб`2%C0dt)tjPZE!TCʔsFmpG C 4+-KT&45+c@8 P#0TLf@8tzp3^8&5 C:zdK`t043g@3" )G3%gChFЍB5 C8),†!f̊6nˆk5!9F5]++l턀Mqն@!@0 a[Æ!`TD [ fAT C("`m!`yD )XDot!`rZ.AW2 vD`…p9ˡcy!`4#oM!P#rX!`z/i]?lfCh}stMA6 vC@,TI~Fб㠜4>TaCHCVʗUSjO}^ Y Q8ICXt%قntY-Xo1`+["}mqE_*ԛ.c*l˧پn2(5qx"2(>Ò,}EG}JuPGB|ŐQ T/W3L֥ Vz\ĤXW^էG$2 qq<J*^R n9=_=Xo`L+J2ےA€ P*y)l.B#?Oܢ YHg̚5kS"ӾE΃<١`w([|ߢGOQ88c>B7=#ؿ8c#3;q־O_H`UI-Yn3j3UCa˚'Χ]7}9(cq.!:VUW)6|<>OnֆS$kchD֐SW].AsP:WgXhfxt ystw&0f>,;91bZ]݄}wFRV{!|ͅ![.pOē|jONcZ>sig\YFu-k#鋩H!,a4{lb_>+)%k?O-} Z.ׇc.Ͽc>[祮._ak_|c,kSŌ6A/%h- v0Ŋ9ْ1u}{&0c{jgg==Sد-gp8#'O'׼o9d)A?+F&B1}S?5GrYο8ѳNמo͞] `Kbk:eT.H_z0) ZLm"&ż >ԇh0GL I2f/ASc 03Yw{]t> |4+ W^oCGzBҾ ASX@}`NӐ(YG"a`s }vxԳ'jI s7q&5gٵٞk.| U gRv`;Km"yE䇍H6X,əz y$M{|c]_;H{>voȽ3٣A IҵΜOkz缔KMqj<Ƴy. &QKjl֖K۽GUQ.AG/3sn?Thk qCN> 3Y:)Շ*ϸi7\b6 qIrĪ&[5o=#u7:WDNR)jI֐49qgXS=KryFTI̷Q5Lђd[aŦ>'!hm?Jaeo xmK-YF]5~17[[(XMS~*K\"5=S#v]g t:h塅{{h}y|c1.|g Is6sy' 8s($$ m\:ߚjraBAs&61lM4֞ ?}#_cO/!9"ETVK,|1ɸ&gq!65K~w~1*׏M b5ϲ1ђ*vDqi4 5[bXo1֙ͥ~zZsILNcᣓL18I>5M:gyƈkd ASKmQ4Il@%c|˥dz! ^19bx_0zYG߻^fiSKN%嗀IxP<5{=ó%wl AS4hTcchF y\&OjKhHM>65$d|  yl{i{{ `Z"ɓYy>Θ%R $ڲ`4AE#\ߖؓ !A, ZrF];rN{m3⌭Vw-⹼ԒM><%Mxyj MRf /k%ӌo'Mdqfk!׽jb,IKē;<?1E_/6_{`[炉0Ӗ`X,H-rL|$O >Bh4 1l测91{<\\l09:bNB\sĞi[z!g[?VvO3街zx3:mHᝌ᳈%I׶{[3 4WӒ8P TӀI"uAK\>m#fI؈>{a&\z詇zdKb^j%Q5I#j,0Dmt,!hI|ک9<ɕ}&^sƷ{sn@!'FO[[< }i?iKp3ce_S-QF`S!Vޤ9FC(D"16CkO1;lŽ^{뵯բ[|0qZs9IV╗쑌#{;-yJ38bTD7!F<`,0Hzb)Є"1rOCrQysV3{ 9ђ/is&`g)$)S/m|4ѢS$XrYO=rе-Vՙ#!Ohs=Z?+6ӺiWhcbpx$/1l}4b%AW?sxCjÖ8949,b{S_2's9ߨޏ7ݧ53#jW缾C#%A7fqHM3im#7u{$ab\²=}2>0kMqs䥭O>Rb@&K~ 怚Pb4$ EhE$iS[-lchG߻=; }ڞ]-̘C31k_,Z;TWa43&_xWF'aNb=o=/=ٝnDm b=ꏹGdi; ZkIϺIm̛"QDn4X-֨~9vq&pZN-!^kݗ~4&Zшq|Ï&$zTg'h\| ~׾Iu_% 㭹578A;Nt"HIENDB`libmapper/icons/libmapper.graffle0000644000175000017500000001260312423630127016441 0ustar tiagotiago]YwF~VKZKmi,ٞ&! E( n /\DivW}]U_5ߟoƽn0Ϗzd菼Ϗ^_?}/??ݎi;aQ`p{;v.zO/.{㗏z>O>}CN /ug}#=L{f:#o>}_a}t;_t2r??90zнvA6iN|hc?t&?_/̌^_q.M`@.] \glF^9< ꨰŭ3Ce%<ױΑyc`>=~B'{} ,| Ij=cK+'&{%[wZBɾ§;3ŨbK[AsR ǽoؼsgTc?'G}:>@&ı"H>%3!J ƣx9#~|Q$ s'jXX7$.%R˛϶H5XNٛ˳LfW[V3/ | ^12(/;"T`QEݪ~6%Mz>+NqjnI=lm&uZ׸&Wv$1}@ufSC-~ZgrMӌM|xlet>>?8\w!͑Pr(!0Vt95b[* ǽh[;TЄ l|JfFH2-KzB"' FKt;禿✚}BM8I6v[w^nrɜVր77hKG*5rZ9˜s0?eEQdy^\&"}. SxtQ $GT^3 !?-RsR}jy^y *E0T qLTVo/_oA%pn?Ùy=Y-yé)hV+(")̡8;Ӓ"?c4LQI Hòe62v+o 4 40MHa.? e$裏a y'itiQub]Y˻8\PuG`̦XI{hjE&Ւ?_0"0$|e!H*-`T1FYU0=,%(e;-zhX Pu Oe:jM>.*QJEP{x``p%?1%P,I\/4ÖD8XKa}-qNIx:Hu8Ig(2h|41S>Dx8|pFdߛK-a^KxW3z3n}| J&~~p^g-Կ3:p݉y~K"A|!MԥG$HjR$uI4Ia IE$BڧۘؐI+iacRa@jqncHPk)g>@P JZZ}k3kw;;)D7`ZmT' JD;;x S1Œ(檍ȡ1lc$oq ȵakd?vV\%([?JLj0fJd4vF}3e{ЩN\xaJ p.j7C-ƼeZ)h]EF #CZSI{Ɯ~wDOJU>QX5J T#Jc(zH9Jfr5ҵ. xUBu{itiR1d\rI1̝N6"~E"gd>%a"Z7ѽҲ>Xַ]Xţa^f̦7G%=BG@D Β;do(\!Y)NIL0DEr.Ju2ŊƢXu\VwBPj?I~8~ ""TJPIDқلD"+ Hjgu&A&+Em{Bxi`bBYCEWp"v!u!~$VUγM4B'6bd4[Z{2fz,1fZ:1F^:1K[^Z5ҋíƺ+Z^lcxm#yK'FLL'%-1}w4kX+,;妡ܴ-7miM[nrӻ!RӖԴ-5miKM[jzcEZޗuiIݖ,mY=OCj$jH'e iKH7kڜ`mNδ6Z!{Iڒo_l]jyGz36Qsj$CЖCCK턙t.ihhihKC[Ж4wFCsH)KC[Ж4- mi iN 5ogEMwȤqs[) T/m JKƈ (e DM[>MFnox(E 3l!mҷ:RkxK#S02cV$H #Ph#-N7 50KJoFmrt\ r4RҲҖe-+mYiJrySRӖԴ-5miKMGj*Ww-@g(47(ܵZ bM .d} XX+dm0YV-AJv)ʄ]u:Yr &wF5 ¢8(c[SMV!5Bh5' xu:kk]XKٖ-PH!YāT y'k*+ ,:fa ƳU z6X(x~`"G͕2Z%F\rRsJǞNd(/zو T'ͮitiR*;5 :nQ$d|\ILƗaenVȚ ^ퟕwXI n3yJ༺]TWPn+luVWQ j+lq-WE|D#R l لqZFgjK)x6j\[ϯ&|RbJxHP*F R{m_c琬rWcPi(BEF(FpN Za}؟DGz7΃όl\BR(N ;_}4kW_iWCYfE2ݍccRGayʋ0AO0&Bu 4]L6i]$pCm(qlC.HaŐZ0bX'P'1kC1%y"h Uy[܉TY1 ;VbN5?|.>غˏ *Fi6x ֮&EMBsQkc Z:5 ۾!:b{ߛXe(]|Fd1fyh=sshXRo~ D'ùs.lWJj7ZPcjqZ;c7 )uo/3s,'8so֨%_:7% CEscX'"7QJ YXРBx6/vͽa^8(6&3эVt2r?d2M[H?p&ijc&qT;qgwMJ< ܆UFؒ)g7ػK#nqq pMoΗl&{9=2KmAZ, zJ d_9M=A4],4"Y,Grŀ{ɩ2h>"O|#Eԯ׾((H5i` ^F V,@f7 {Gb{r3ɼWJkgap͸ ]tTGUC#aĀN5Jo,YDܶŀV/!{.b#Uw`ufQ'h#1rk9B“CS,AIgJ?p8rka|غ0Z;wDmЗ|fݺ(ĭJ4zb3'H#zvM=ĥ=C.ŜWGeQk@.Tej$z:K<)]*y- N@3F.3~Ъނ0. B1'/$&W660!hpt+-AN+'C;aب V%|Ie0R7;αɳ_oIڻ5ҞsԓL .ơo*j)5:@a:{KUZevv0o9hO蓤XifРf|~e`C\^"BCPr@vv׺|li#| Y7,}Nڊ@W>Kr$,ɛ7V1ZqW~a-nɶh&V$}ңp^jp%*ˎ|l? zXBlJidv^!(O,A+ȳ9s"<H,ͼ?. &_ 叨+x<- HrddQRsm9gz3K`s?Shܑ8]*'nvC 6"ڄɑyWTqh4vD2A~,QFGXТ/=_X.p j:p$LJ᙭2bY څ﬚n(ԋX:WE#_D][HAURŦQ$k9ʙZ)LCE$;5S*f;|e;UeK0YzK5?;=kO;f,QX[JJN=,|~?ZGL6}J͖3d4.6*7ɍmyhN@ hJ3Br4vN۠~!ʭ Q[Z~8 >2߁J4=nK`)B d?UĿhuSG5ځ Ȟ˦;F+UϚ/o&vہ8ZKawԄa(kݯ+*>ŶS~cJV爰Cـ8v/ Hp.c|V; <0ʕ7=#vFS}Bǜ\ YJ)N|e~Z0t)_D1%Vb_s'q9x~,vG kДt`"qfzݤ=+C1}kutX(u|Һ>/rݤ+@ :"~1&D'l4upATTYZWd\8D$eT4J3ōre!_p0y# Q\4d0H/9س$iZ&{[tXdmEqN, ;""@H{jq!iΡ #kZb):ăԴըoUP ,[B>4D~ F[΢&[~\ I%* yq07 g.*R^iz²?!m]>]%>5yYh%βϛr9FlN(),a` 1 >CPPՈ B\% JA\yQ{5 I4Ѥ߲86+>[Qˌ]o?3~ ѯnؿnhh=M`Gk3C4$.g+~ņ灬>Яǭ/mʷ&WҨ|v߅IdZRhha%9Z{Suo r$k^D,!m&hqF`dN6ɞNSb C/3zG2&`:c&Gy2\+!#jS#/@ ŘP3Q},^t-suIu-ecŗ EOøw>Zk !'0X:ԇl ,9oSWs3 KcgLJV:pǩtWnm|?3VW+5T(Hz\Z Ƀò&/ =mL:J;MܜJɣ,ly3l*483X&`8IH+#կRy6!# l#Ͱ=t<KGa-%zUTyVr+R ܜ~Cꬹ -$'4  ͵BJ\Zz$ǗH౒$۴'+9 @Y}NEI.ӣ[JWt}# fJVIj8٤79⊍YT$KE+'D "NXI }{v&vCKK"2{ɨU9ݴ ">eʋ3L9 `H! 㐆M[R@(10B>fPo,]eYWAzSU5W*rpjcjYYl*gUH5J}A,]+pM) 4e&[!xvQ~<֊F# 2ݩ!=w0Oְ C#Jʷ!v_|jͮ,&=} D+A؄=H;6U?5uViQjY<+j(|gT\Fo#Ƈ2 :HP\(.yJoDJ9>meo P1'D## $q`H05;uL5{)PN_etdx+eʯʵdn/p0#`B Py7mM erhQ?DFoZL wd1N-v||NRR>` եd6ww 9{}cfMjnh XS AgU/*V7%9ip?edz`ُ24@q!l B4!γ\$]GQ!V\e5_k)MtyV \W~GrX."J3T5"SuErN| 0.rGFk?f-=+s!~j{/^_*ґ#;V|z%RnJMXG=_qwyaG)AI,X?Z{@-S6ɴau)Q0I_H- mfY#Usq)Cx_cʰG9W}ane'T;z{Q^^f:SucS̅@-{NeAYlLIX(.墏<&\AeAyC~XzׁKg91h*mj LRu{Wݬ0gՆD+Xљ Bg 1GW˛}sL5&ps-3" Qtμ<Мß@%RUS*䄜/X\[]9I# >ш} oA᱓ zHc_5+ h&Łƙ0 XN:%[-$RN8n#nK%[=iu%"_f4f&mj eh"= } ]OWVgEqEWQiBY$-ͤ2$E ">zFM(|lME+BU;1 ෷ A ȚN΀ 4h4|f"n+>@-a7 8$bHHEu`/4m+Ǧc]R%"/F/UJ,i2*R)P~0H8ft)E$}{`*ZUޭRIhC C"-{=>sfr1 ܔ.'F5aY[p1* @=!9Դ6dO\نLAmt*Q& : uk咍&W*˩)*>:/k_I$ߎ&TfB@>J<OL7{hA:H'<`gܕn-S<6&I:rvN q:=4b3a&Rp%0 ?h}$ OҫjpMCLSdBE[z%y= 6}x >#+`Jy0|o P~\I܌˂ZX%*N[mMcosq85&f*?%=R!~А'I$JB_K5d?:4v9Xr'#nA'_p-;-:B7Xxq 4F)rxx==H=+⚽ܐ|C/0ʿoO<<nZo夜lĀip7ޭV›n|edcWgMܐ{ѽ^dU qFFR"\_"vB`)Bu}ZbO\J5_B2)mAvd|`>FZ@ ټ_|mэ/op0_Lڦ6 nUɄ5ݪC?;/lB=Ɯ[M"M xڻ3k9V*[kY3OzRO$[9!Xqݶ?~4X! A0ܫ(n**q(gL9FjXT!l噪ʊ{-!OŠS]Wd5 IzdmsKsGPpoqcy$ $0nN)6P3ʰ.yuTҥJ;4~iɗM\tiw5T LcWU; j ִ p Q31{2 vcYy1:Eٺo;AEXJ9#@ǜs gߞPᥱhD? YNHvYVd%Sm:f䕼> h0X'XO!h;xw|h8?٨TJym]`*FE yWqE;D/5HeZ挖$2COFT;FpิL)4!>(U+kPb-l<>ݍ97C>FxLa x%53k^OPh4:H/O10Hirn"J$`3s|VZ}/ /Yxbr0V9S5Z[[akb5QHe{{`1?eA[IVY7$Iij _g9͞]OdZKlh?in,H/Ξp(-n"jr]id]w꽫Kը h A[Qify31)H\vMC% !/xt폓(zk<'y;+<bMmI"p'a@3Zv1bФw=*vU,+.e≳} wN:!"Ftr d|idx >T-m_a.Zg91B?@Z/[,9v~dAOZ$5A4r-)]nq%l/Vh /)}SWDƉ6Bcnlj7n?ݼ ^}g__Zé᥿U@ou y ~.f `S떎azI:m1P"ShW~uSi;_JhA]@=*I03H~1Do? yGc*V E 1kOW 5#Ld 1SڦH>Q${[bxDpNy`!њfdZ>RD+`'_@w!S4x/ GE٩FjS#doZEamj FÛP[x s/v'TVC2 pOSN/$7c+7<=ѿ<ۓ  8xWsY5ՄnuE'v\V ڛ+w2dCF$]xfiN3^:&B=S,]Y? WM%bsD9/̞-Aøf1CjW}J ;Q#1⩓طtO1֦f{fiJ/p.Wh>u{1u@sF5=qܿNb Yls&UB:ofL6N͟eBW'׶+6\[Q{z`vjoBO,e 4-nskAWK }N1}H@8Qi>Fmo 1LCdU8]0.c[uH6ѡ+? hV*VZ=^%El622mO|ڨ jEazz7/UɎE5`jpKkًPlT,w/blx8gfba sSB5ceb!Y#p~m0`K+sxDP@J1#%B?u=]yH%ykfi}PCDj(8g_IMڐ~s=:?9F_~\I$I$I$7,!PA_n{mS+gj#I׋?3eZP4rI$I$I$o5È 6 J`vkt&vZmMmmm:Shd&e+ 6Pf9{7džTAM}5D,Xs;1)wp0LN]o6x9 ȉNmJ;n^{<ݗnboAcڇ)E6u֘ DIa;'l#T>]/~󌥬6ֽF1Ċf=BgTVecQJ7fu7dK@ 2gWj,, 231[lig֣$16"F,c?_V:&|jD*FqN t,%??ZHDhi=3V5Lp8NbbvJ= " 7ЁYp"o/AL^]NM~тD_I7FB^mzx7Fdufe"KSO:+?Itďiݵ%iD[[Qa+m.#J!^)쓀 ؜,PXѾ!֑ |p E|K3d}쑎4 Qu,Bߚko984Ga)|xYJ<>I?vR=C`dWSF*])m-Šx(wZq±NJ2 Ϗ?N* '@ndr-"[Kf.TieӠdlE2"c "l;7b*V eALrvOz#GZ\HKݙž7,L4|;^.C 0c}$D֤,1:/^~) +aq:VLf>w>ٚmVį ,AbiJ?!~~~0A!m5ѫ*Tݷ– F '}@'q=q"',>A .*@1Stic|!7!3o 4+(Ֆea˷Ϝuٍ,/҉4R9_~qJ7yeZ*{Ch4VDn5{XA=B 1[q>ߖ0tPT#e:kIgn7( b#8{ FţBYr'oz%kҪ*P-TTd\0bdF)͋o8j.Ϊfi<ʭP S,25 [TJ- 0ۻ,xa'4^YHQCn aO?z;E?F쮭B#GϬO1^T=S/nQW !(}"кZ~ya.Y$Ν]xL%G!ew˱s[C&Ƌ)De @9hR3LP@ nVΈ?74<9dS)Ew/oLU4|=T&f1Tjy6n)ʯw0S7,gA=3Q`2"wq0 Y'4)J9h+bΐa[ϛ$GnKMf%Qzbٷ` Wl~ ЛYg)GGﯯ'qFrӄa^;HUU<T'<˶+ːOޜ.\.SNf)Q֧ TJwX8ݰz4V%)ov¢\4YXB樂N'M4$1ƏYo) /9 )+C~|*YOk *u29H),JU}DVg,@Df6di;J8 +ˏ?I>]@E܆HЌiOēZQKh?3de}?B|[_7m;pд˪y=ONw]yOAfpՙd0%s.UI@) vM_,#qL=(>`L. =N8E#LHb$KUd Zb~>e! xw==߶~YO1NzU`0)MݮQHD 1W6){InSA0_žF`6@C #"z<v=gz߉Bud$F_"d3g%WQ/!) \H#F &R|٧-)@OD 0Jh+h͆@  [VsWjkOS>]#A)ڠI#WΉuEFtK$@Fd"H}0tk1HԾ\ZWL4= 84'fOsȻ'%y*ةWI@? @F:Zp+y`|w肓Ѹ"Z[@]]xrBxDx=;W.]#UB"ad,K6r}p=$mxo FPR5r_Ÿ>쎷z?6?3SV$^YxqoьndK%n3[QP^=j*,OwAlL=\ 5pR&oI,#Mi 5~#MMK%-En4WJ'N*j=XWgdyHN8gry:)+qi:]zTfmy+Z&?zLzA2x{T {mdTv(5&DtVintс;OɶZ$4J9uT/T{KľnTS-01%>쏊 `$VzBJK>JwY.sv>sć*,̷9FEy cS]CdN 8秝\Gv`_>3x)QQgbA$JA c%g< *t MQr2MP*YIkV8Omo6^_ g[}_/o4]ޏe8MVW" X:2 qZTMggh(@3n$ S/cL%=+= s(!0_+4!wbW[@bN!ѦB=.]u*j݂Wǟ&?ʶmW1R9Di0˲t3)L[1*# qآe \j&/7-a0iZ#y].>T@r0q4$mAx|BcB|YiGi5R'CvCWMbEmFz2b,"# Z rŸ[#ۅqjȈDxtgH=L''"3nI qSb;lf՜hKCA1kAcs%* JaJdC)vTvt9{̷ZP}Tyevx,h;;KMqLvt9\YD精dRvSmJFK@ZLmSZh<,pCN,Gn'gsW=of}a^AJs3PCF $v\vu1O&]7ERw@pJ+nosCEgL 1vm|7|36QHBՠz:̑~?0v*o}ApvDя$@>A !&O[Q"b6i <'5ɀf\#`44l_ WN<~i,# yc :׈v j|zl,:s鰖gm pL;Ox/ncf죭$5}ƺ3goӷamA_gϒ% +o >Ɖ@|p=زA iWLfq#ONjt4y?7Aq>#~ q;J=5QR֟b$N57Jr x<WYS'Udo$KՃ2."wl{&3nTL~ˈM EHjR>^VgOI0GEUǩ F!a3P7{BW:^N{KoȭNKݟlԞB?QlM JxyY,DWo'd> \*bܥ4:iC€SSw=߷jyɻD'oMQoD/z?ځ}snm/~=CSW}}'mgT_nwьASw8ot *o@oy?#M}n@Z_F-OvуaƉt8B/pE\LrzL]*ee#%kuy]wՌ8΅*/R~7%QeųčeiKXHZ87p;/čB~gk[;C̪[ 3:w9멠`=ND/xM:LX](ET.6ckSWM!p՞f` 7`'Wܟ*p/[l,@d@=N1&Ui~<M Bmq!| O{,ʡ .z3)OD˒!G:;tyЁcB1{( nJ!O@%PteګǸx#QmĂq}Bno#N- 8Si8d1j)\,wc酔 ;, d`("hlU3Kٜ#JE)N:@@Jvv>GZ*'Hα!bT5c!KEWp FZ*׵W5W:zK'*ow$h/o(ab3QEHC^ VjSnu%l?bG*G#7~EJۻaz/ <0倢aCtBr];Gz`Q͜".گ=MGb>mQ4Gpfru%%x04lݴǬޓP^ 7~nhY}tAboqV*/AV|7|7\3? ۯAȯQ~ uI ڳ <" g<(5Y}'c%Bި_JwȋgH0z’o*Hbpg1S%j*v8[ĥ,Cł="8sKl~ƛBz84HLNuT:ԅmӥqz3}CW)%϶ Nf~,9„\Q$+xiGHƴ}Njnܱ`.D+ ~xM\K)364ZxP`oRJu,9r)| ^N犆u)q*TӖH| ڤ!e/jQ9z} ř&b5.@zMIbq6 SGQ=GST*?;tC5!e:c6][{Ա ?m[暴" GS@$i5x7 aAI/WiEkbSڊ`XTzZ"b!zDq=nk@tKkR(~V,0^}]I*AY ԝ'bi=/Zj#㊼'@]*,M$JT3|h|1((iKtHhx"]9k/PqVZd]Xoӄ@2޶pEr&9E%Zs@Eެyp ڹ;#JhUsP2}Wne;y7}9F8Za9J^BF[N(DT j[㗻Ƽx˱kkV/!$(OrM:O0%q_W\&r)?.:.Wwg 7~od5,oox|ڸrL[ +np ELDb[^B@൷\ _P ,Q9֢m:_20O Ya+|x6jJm6U1)v(1Aьil͍TʿNܼGqӀ_|Ep9hr,JԕB&?ݏJ \(oȎ?6?!pۀ^$gI<Јw 8oyNj wj׼;.TꌸgٿqaJ|z$+u;mfn(! x=`ִ![wMܑT /إ,LIZ% t( pkbYp4t[Ũ5Q}U".NUΘTö_߼/B)fZ92Ijfa( g A@)]г׌j"S.E126xʓ:{N(ԴHT$RQ mr 0O|ӌL2 U߉4D_&(k xDvY놓'iLvwd#Nk4P3۴B֨%*\l_'ɝAg8UɸeMz=z\DB FfnZY wƐHzU]JwT>iR`QeDO=p$yy{B0iPCG.I0ŭHj$b)xy&2bFϔ>֙{'YԥWogfHcKmdjO!E`@R-Յ\_-ؐ @|sm`U;ydV<ۼքջ-^JBg|@ 1oƝn 4V|ܣq?boKB S 6㍧t-0 DaqӏTi6 ^x=l7pLj %񕖢HRf6&p.l+}n̉1wp$?A/BwJFnD6/hbk*#lWOFuDV Xӡn+OFzͮ-#~sD f{p Ii)ӌihr+fV9TOm0)ɆN8+V"s,P=_7˟[㤴pt\ wh dq mBXB_ȎB1b]Q㤴GKOߓ+Yni!p(pU ݜn Bn9WZ MQ[KtQ RGav}Ve6a1(^eB,D3Ւ5qq+Ձʳh_9<˕Q dVDBP0ϩ IM )9,&y|[:{n/VLy[>=q50ՎwuLAe.6݄^K_O^7ݩY|-wY5{0оghv#Y9q+T @pJ~ u[-c s"8;}ٟ H9X/Mi> ȐT?!o& crҡ[ ?r&aݐT4N+%`eqNVb :C=0jԐ215bfu᳠c#~2#Z>WjϣmR[vdF̯3m٥!7B]3?皈NS Zt$d("A(XA}s':藰t)-cEAfו U $9gq!eۚSYJ+JjrIe#U!SgKL<&@rncUQ㻻96| #ÿ>b*,2шnMAj*9#ti<Ժ[$aV+83AӽܧrHs|awRˡ0P<\y\7B/nrmSG:n-(nBoHo)R Kn\7ަ֕<{6C؈9xDKƝP& =6zCLv' 6{52MUCtlNIIvffAgf1ފEMZ/!'+3w*chQd]-ĶK!v~L$ý܍}L٬FD/SX+み{E@n#\yKZjF[þ ̭}zAjNNdp/u@juV4*rgvяB+RŒjyzylhqq~^|/6S 1p6F*+W,fqYו<%Vؘ*|rB0#]~A 7>uL=pzWj٣%@vq ׻]~͠zG]Ɠ@.H+CchXH k7"SÂOL0]O>,);3&~jʜs7 pe^CeC>#C_u$}N1яwe\w-׬D#DXZfN J$ :5[4,?B E[K{eMrBؚ3O(=Ri}ewjB'S|pχΔlu˨ƅ!C3Wqtsi LPw=CŢg$ӝ QDEE[ykc^6V5` $(؈]tjS8@Hm_:IV;Y#/??̞$\1146"+Z+x_D!ZfT,)[˙EKlSџ+\<'şʟv?Q" L^&'yoc M []nՔ*nfjLucTP):WR>-ώp98.tV^3z d^m-=$" fH cUH@nV =93ȚrMT['o( t!}KΒp/ϗpDoғC U/)6P/cH܊Ŧ >SrO[س\ng]H|3'}[ O ku;蝐]G|j*NY;hc x)s8o۱ hbj'~W6S(0Vb2Avy#Ǭ\6haeazP f}T"MLVw517z*O?'#?(PR4'#^P1롚'\ZT^'#zNju-S[4"zN}@FZ7[H{:DKfjNՋ ~o+ d5V0lJ:JDyx :hNa ܎/%{}ˊM=oͺ,Ahڐd<'y(ee-)wcފXؓT5) S&A ?ͳ_ق>UT ̕aIatD ~- bqg} ])]zG+\JwZhT.[)3DU>HvvĉT@IaRjz6-Q4\K]g^. q͊,cEZYŇ+"[h킖b~Kկ'Т &E@M7 jf~>O4:L.QCB؀~Y1 rYK#+`6J3U(A=xHL,7I_+}5o_;W+pE iy^Y\_l[ʙu1L8|}V Cfj*hFGt&88_!L$!5eڜ ?FDB=C ᧜r^l'D8<M gozG|H4y(NFpC Hc>BT^[j $%%J[99-P.jFEV"mwEjHB%М4`YYKS1hcsP Ɉ$@yCFuE b9_ţo=. 4N?}+WyBRꓧ6Nqu|,n)m >PR]# _NU}w0ck/i y&=<͌R:h·J ^C͹(qw7kj ]uӃdJ6Ei;lMZ: cMlB|-k^&ǰ"۔ONI=KL}xbԊhJmxh Oxn{^*EFv+x}sSEK`+TRmCѽ,Ԓ$YT/0^O0?ƺ1AS# Q^k$^?z¾>}P|55LO7s^q)E >r-8"`VWx_ċubVa$$Gveuz@tG&-ꪂBfbG {UBJ;ճ R(,v3.6-w٣,Iehya5: ܠbU?0sH*+}eXP&յ|OmHhJ!f(Rk\z:&L _02*@{Kh#d#($ oU`kUx"Nܢ+ړ9¼pdp92k"b*]ږR'\T%X1PƓb` i'bnXTxp1Y{L%W97%!m6`[^_}gE#ٴSm Lf%]$hNjM5'ѩwc|t|f}lOƍwZ3 9cD**Ë;иH%YWv& NEdC:n"Ll1!Gtl%DE05ze_ avbGA; YBv##/Axd|ױ[Y[*hwX$T\ڀ39E,~x\RlTm73>.+Urθ(^; =.I!:JO X۸5;ȦaCl& mӠmC4xwQ^,dSfHNR @*UoIB%8ZpRNgy8GUC(c#27.yM3YZiBqKJg~z-B'f.7VR[ H4//UiE1CJ.$1!%fc\(¥iF0}`k>*‚kY]'! pCS0&Vt4IMZr(lIMܭ/NU 9stOl9K{+F`!g#nJ^NUS֘qĪ;[syp/B΄L9Mm6l^JwV,t2"TL퉵ֲ3YF%D(vp5h2S _;Zު"N1=Z]Z)Ә [q=P"DzT'`^"USF%R59&6,xK}jˆ l5e#.C_OsѫP*nDt}`dOG% WZilyuYB< 0CI3|Wϙm qM$.@m 5OsĪ;[syyC_?mٺ&E]Ql$fm﹖aVf YѮN/D(Z:qfڮL5`!{}`q-PA%]2Zmi(&BEUb}([.i!y!8 5o-23vAE>b &§,raȘCn`ɕ᷌ZM2 :~4Kwq{ O@X`v5PGO]aTކAp!̓!̓!̓ d6ɈpbR1Z5dȊ@dl1p ]$ y7K\nXk6 G~pI 3y|2r/# %D:sul;[A~Tw&t ( ݺ/f횈Kn5%-$pNWý"ZR C;Wd >+hm6[ѱO6ZA/[%Ҏ{/Z⻡o4};&d8 ݵ.(ݺA9Lºh[n'#پH'H t_h@ O>{opD_m)?Uv ?"<$]>O8@_^]) Ꮦ Nzผ?W(H-q;=}c%eςGK˕ bDrxhC";NUøqhMu`5crܫeХvNr{ wɶ_c!VRGKNCs%n߃fymE;㥮&9(»!o2 lX@tRٛ:B ._ }]Nw|DC,g) cDAKFↀDd=#:Whi +odS!qѶ|Q2a˃uP-ifDѮ[LiP1˄'.90m}s`\p'cPfLMh~_b*75YcDqf%\ ֧tɘp&;A'xx9SvZP4R°bybekġ:ѻbzʼnf$̂>X>uXQ1k/S}/ F bί9/teC% .']FfI?w f+KO+=itAinz1˄'.90m}s`gqh<0aEugַ^ВpB {vF6F pufQ:b) 78i=6D Iq5؁-NK, yMoz+ouɠ1//E]r7L?LYP,x'd\a./Of|@$l::ф@vQ&8Ev6]|W I*e^H˅ŝ}U4Gp:;V IjtD7J{?oWExb:I,^Q+a  T ~;ףaO*̗woPCEUUZRȆ?/ϱfTr}kmW4O!hfG9˙Ѝ(T'm\ޗ.&Լ??[lkJgA𹶟W(LD[:3%ֲu1'- >9ll5ζadve|0`,5( 9(7F xX^}Q@HH]AhC `x߂R2q]y_O8'2p'CK^P\ZVWQĠI,R=` ӳ-hQf."]LeYΎmE5r6LiS T :{HUCA d; KR4 Bǀ%)WipB&nP**8-˸:r Ӌ?X EZKX"Y'dsP@Hܛ %h#>pt ]e>%Q;0O#k Ȋr*\=c}7kI(cfG =UȎ ZMҘbRo7C%ʴ BRefۅZ.#3N9stKKީ_Cȉ,pk.F;U)%ۖ!I(az_/ק!KDž}m:&.w^uc`ʠS|I;LՙLe 3r 9 @M= Nnxp~2޳'muwÆNǒc+ڇXc6./7ݹ%z7JpE-vGc,8&)o3S{[NjK}}!DkYqj2nˆns@휖;׬87jL`ndz>H(i'&gg6!=l_%E9xKEqfe/aʏW uwd@0C'm9LUC͛:vfpޠ>^^2ggBZ'Kғ!=sGd/aSb'/-\"h+UGJsev0QSUqkјDZBSk ` ƑNx<3 F7ļw'+BhieHfy@.0Snv&1T֤ HV GAꍀٝ($$X-mh#ϝ P-eo-.ʈRv@#52f _%k ĭ*;__2y-[[ry#7!B\mnKO X>veN5&KyjBCp%> N{_$yIdnPB|luUofY7eDhBTFݘC/뜀I#Η"&8WEfD G}v-- 88񪱟m*tOBuq}gZv5 쌊&4Gim>Lh*6LLٽIĞt*yi0=kD(OER7r{'_O>AB5>k켉\aL%G&;Pc.M ^< 04qMKXB^Q"x7;j# M$/Ss*bkk l~"r9"o=!ЀrXb xwY񦹬׿NEAB ~:'ŒL{g1mXI-2NOqP/lL$ILd>t:Ɩ"P]<y/q-F7~=[!N㭘_iY~M颴yAU!;pig6'"¦uQiNN8o>&{͛ o}Rx3/ 0iMfA7=Q˝օoJ]m BA8i 4Lö63!;OaRr&{8\Œcmie)+߄ۛZ웻&lpo/-H/M<3%ɞꇗ]@yPU]0s;pwpdl%`@lPjf8\ @ F#BB QE}FW BBh$IBDHl@ُ!?#9 ҋCa5 štT @ Y"4 ]f BM9z/1h86Ngsyq1DW+UpmNM7'YxGeb|9߄Ǐu)%, $ IEm Hd Db41XLCl${1J2%IMH[K+]>ҙt=EL?Hoߣa0 wF #Q8x ǒ U5ݐ{)Oח_,+_*\E@KZBUOaLhXxH4`0|f54b-32eL4v0N5ccؚ$T\7EML{L{ff"*>syyy"bEYzbfm9뫥eVLVmVMַl66klZl^60{컶,۹m;lI+B.;=8rdtOgsTCCs $90gEDžEqsUsr{.pqaq㥧{/'U^8o?BnOOc_$zQ?[~@m}\ .[ Xp!X$$H60w܇5C07x{Ðe!'_1iUh^hg+lIءw[DEdEtDGFE*.`ՂkjRLdLMB;Yd(gѕj^"x!.*Pg^07ύ{w_; . % ]K\' '%&W))RާLHJkL'ǥTхKsMb2e;J%5HƢL%tee}՟]ay99&+6xJJʎw{Ύow.ytv]]YeAe-vo9;uw8pBDI&iEhsr%5͹/<}-ggL=;.n9tncIǃ ߺ0B/^:ySW^u|ZSm_m=mtzKcO[37n}-kqn_lн{g!a#GWf[Nz߻Iؓgy0)i3guCC}{/|>Bb|?*_<] F_I^M.~o;BK7ڏ;?E}z63s/m_>H$I/F41AF4>'g S~c,SybP@f?+oPCXU6֓К1kR:1$c/}_j0ݔ'&*pP@7wO pHYs   IDATxnuv^{xhDo$ ;!2)ْH5+3J$g&8cK4$#DZ5)6A @^ν]wv?3箽^[teEXd`E l>BZD" ,2"փ) d-Xd`E1r%:8ΕM5GNAgL<^Pb: { ,2Ye^E/;]u>): 6, {VY؉>dj-FlU3kk5mZ,c*<XC#+.keW; 1!bﺽu׮]o޹sy;vص}nݺY6o|nٲ? D]s<_h9W NjɒGJRJ}RSDJ,e_bz;jh_z]ɧ!!+t-?v."ձ|d( xxc2+b?Fss^,kŝ3ufxP[;wx8/=#OJ;dA|Rie4<ȇ 1dt_{rr9m+7F_cdB~kcp<ݖ^ ;@k`7spKe򝸤o Xm1n[9!ɑGJyz2god xWzy䑏= < > }M1'~hrC(R'ǯvh@dz>lxmg19:}0e[ض'd=--kַϔH& xO~ݻw?+j(((ϊt~]B /șg{NΊÉ^ Q`q5O} {XԱ29<y^ul>{VO\Xl=Vv<1s=%68k`ypSfgW ;gyv-{:?4 ;fڎC[>fIHyRC*v_.|GE5Q'-rbZp3v\z%\gqƯIq?Ux;h@Y7JSǣ!]P SWcSch#oeƭiX;CH7v ;#d~L7g s!욋#8rd!eIc6rd>trLry!Y?`qp!-ölk5mĘWdf>oIP_Ußݳ ?Ffy\GQE..Aׯˈ,oyW^q1ƏoB8V};!!M|Дސq/^G SˆF /6_P[f{H C췴zr:7%Z1?d:x!'g-l2hk??ʃ{(/ʊKXQKy(]?Mozzi]D1%Up. Q NH|-@cI)K[^_ymuka1-k=rx1;9cdj%>[ /!;>uHamb\趕eMhYP²|I={v }H?.w? {(_E~yabww^|ſ N+2" KXr;!םGKHXum}07}xRK!5SLaC{ݚXWss,>~lߠ1,ub~Li<9aE.AKs.bkܧ/5zz =oV%q;/駟~$l*\]rqI;Q00Ɗ[]Nԋ A,K-G 7n6Xk|ڱ9a[ .[ڏǴAZm vY4m/v˵ aE?ǯe gdF/K^Z^Q}`mY}"/; <;/6._pW;y⠱QN0?C[ jlOGB%MxrI٠\0b:1l?cq{<_V1Rv | ٱ1~H/'C[v}٘`y[yIkij"o}AJG[0zL{xw cVK|߿ (rW/x[QQq4/,_Q*"j|^¡ ;'8)}I9n)5?ِ'1]tۓ rb = mm漆ҖP;Ch(e9f^ %i.estᷕxcƒjԒ93kj`tB+/3bW" }"/; k`Zmjbc:51[C^lɂC_5mX~.9xѻwoc}b}?Gy= Qoy[93:PYQ[! fqwo8toe'.CX] Ɏ&cjݔCcl:%1X%Sc)Ds6m/y|}rmR}ܯgXOP-n~D3)\QE^6.4w饗IBHQ,H={fZV*&gJd덁W4V lXXO);Z6ⷶq ;`{qxO{]8242oYH͕mŐ)ke<]-[ v5>/ѷxJvK;-ck6Z\Rr6V1 š~j>eI1Z1tb1Q1ư<}e9Yqٞ*1YQ9ǫrGiOPGg`PF21{biǷ͕w~/-iz,Ų}:Z` uۅ^Ϟ}ٿ% {{Q[ÙEӗ3~Q&lL6$_93xy_b[=1`k b]`[/[6chtu-ӱZ<ӳñRJqc5mj|c4zm_j[4l}ѳ"OМؔqMӺh6rdB~Ї p?O6SGVːLO.ߣ>GËXܑ,xؤ۾zʆh!Gت#Hm 2k)Ctbxv5>Ma5?Slx<7{cز?ur{衇շ>hPZĎ#c@ǻtom>xלtIW>#_l\VN"/qmlO9surb-fO[NŅczC`S&WO\Hzh'u}{}y$ϐ\_!\ vRx.yc Q rg#/,CMD/?]i,:.I5^ߓD;I/c&LιD9oј6,e.us)C3Qsw؅Й8Jr}q֎t_о i>}!ϒAܹUڬ?^[K8ąlsz=Rx-.xiR=Dqǥib6U%!?]~Z >}/Voe )O$j~HVjӿx5}e.~(>xv8/;8_g! x8쵺򞂴GFȣz2 .vqUӗD~דϑzXzqiV'?7bPRz^Jvxk|4F>4$\<\|-Wێ.I#3y2'|rxG'3wY)k8g Z~6ru[˰ ̔ eAQ/}Ҹ<.c6/jRS9^wwg^#\N &hvsdC9>pBvj ~ ,CNKlÚvjbicZ6=eZ>i.3y}.ø ]v+/_v<)vao+os>l9x#<__M{<(zL^E׳x?+⏔ٲ$>z[[חZz[#&gm 폵}ñӋZ(RvѸvO,`.lJ\۹65)7q~ݞyq =dp3y;s$_<.#Y@nX+92B6HK(+1<-7u;7GkZ16B۾fL֎iO=L^Hu[˰M֞+Wy{-w&)ϵ}?Hg-Km"nRG?cǛgA1+x"gCwpxR\誅b.wN'19mrmp1}-j6|bv9XN跥CX kb3E[lώ\;V"-2+yX2>.cr{=7 uAqP+Uhc4NODubT>yq`xpv|Ṭ:*&0z13j!~ d1z xxB|mǶXP%N+V:/lOa˳SkZv g Lk#ǬtZ8ⰶ {et_M,mBJ9`wyn4ϰ EqG Et^y<(q`oA7C`LȬjkYۅ)9WҷشY1FI-V?ctX?d';;ctc>Z 1_kղ[ 1ëXX:W @#WQs ;Wv92Zy>;,![޸fXt%lÎ=|ɛE%z~+Pq$F IDAT Of:iY,Ʉly6>hKBc_˒ 1xsl^|M_|(zh'l:(\,5˖lz|Ck0>W-<䎯˳2e-)9W 8kJ+)M7ddLKBJ$˚"/NRȃO)clrv,\ac\q<{1LKh|<l3b"΂NwjјVz2'R1i2$&C>O{=V ķrCkG ֘,u_^8x8E'ɯSlz;w!XP=OV=!Y ~2wϱeeb}>?2A#Wp;.* =ۛEv'W]Y毧X,cWs~y씎\HƳ0N][@զC3V{nbAE2/Zx=Oi!<ʐz` Z*B>b.(BӺ92GbK V '4|@oCmlom[%6lԫMM^_ܯxedq8֗;'¦maNjdz&Oc1S<ţQ F?,#VyWq]'yy{d&B]fCZ,Y)~)MlZ=}|nWk!;V?-˻>۽Ik⠟>}ƨ)5m{'zGm϶%6tJ7ଝNR.d33_lǰ=y5Ǽx8ײ5Sy .YBP߆/H)C5azLzrz<֦nf.'Zh eRm# @rR=w&gݮXLX9G]tEa#,蝏0q-C[!Z"$:#%ߣVWkT;e?==^-{Cqͧ)-kǃtp0rd-kHlga >_[aI=;  ()LB&!>dئ퓯Α׺ֲhPNj<_ma/>V~YgY֭D7)c*}†6ࡐc %瞘a&z}+ռ7xxO|g۰ ,6e#zUR6¡WPcRl3\E=y⭇lZ_|ϓ/:>-8aZ,!lBuݳ6glC~նZԧ.g2a'qG]_BhX4v J\+AĊu 5Ɔ"Fj#Q.'Ęl̎pKZݒ~+V:6x<ײcq̓_s+ JHmC+f,\QQ쒃mu>l/OKkƽv\LJkp dž #XoknӍymq^`PI %Z64/f<%:,ṗg׋Ã)8/~h_ɧ_[OBZ]?9ܢ7#<2[q= a;c1Z><kǃt؊@?,0ELoj]+YphlД|&'k)k.yбā H7GkZ64&ۭ[3\:Ohۯ1K.uh Ή. :(Ng1i,H¬w1[ ecT8VMK=5pZ}G!σ_5|\W]uUwWꪁ['m?~1ҐsrdB<]K{|ړ\AI=\z β~Z۪3Ɯ3ac b~\6-$>i }jeN۱c_ukoCX0$+ :V}x5A#cl {m_9З.ız֦G2! xc G1~"OJ L@mcI' 2jl'~('iA-l 'bP.+Ϧʅ0{c{^¬e]Ė3^R:9'YڰP6Gj!>8(Ǵls4Oc紭-Xd#Ceܟg]%pM^!8 ̡L 94I ʕ &(im.'kkl? BSJۯS؇~xw fi fp-61q{|Ѷ.a>|V ķr?DG[y>TsCvk'm:/mlY>Bz'd-8}:rX{4x]-}>~ xK)x4X{^j ?X Z\S Ǔ)$K  ;޵ƥT P5ďrl"1wb`֎+#$p8M7o|LbbuVjٶ؄C8'锋sL OS&rkP;t rrf98!?KۤN'Wܼ,6Gl?)Kǃ6Ǔ͠ثm _Ks?vm]w~ ǿ#?6.b1{2ƴn{A,xc" B!>t Ak`bi峎۳kE~j=X}}o?Sص|"ex\&g:/!S/;}޵\C)dCv<ƭZގ|H!1>x>NWk[ /{޷w(;S馛zے<`Z;&=so~f9>Ugs/ڦM'As L`>di/vl q`</ٗR8%XtnyO~I:kڶBx!~`̛?a^Ms[n ~4!9?{v1:4W0k[]*[bX#4Fgz8<=>y!z WĵOcE38ρؘg!/GK=\g/)-Vt|1_cv-lo{1R?1sqJ̸=mClĶQ/.bg9~h>dS218(1ɳ2_K?%iz iS3o05{O

҆{>q<yp?t%8OaKd1pOa[|P=טllJhMiY#\έ_.f9E~Svмmbzr=<<֛=/~xɯ1X?Ʒ\1N:\wVV?};߱~,b`K;CmrbGcmէp!1Li\/CucN_^)Id-bj}[fNWKja mR|\sMS '0n蟘'V,!cMzjHR)<=^|pEډ-9XeO W^yeeB8<#ݧ>ZJ#e3_;u;sʟįC!ۇ>{mʫ+3dNDs|&f: ~ƈ4:Y&fm]QNЦ[/OƵvlCcJ>l^zi?c1!c;Kk5Doc)!cr%MOM} kf"99+~ a-^ @6񇴭!-t-n9vn<<۹sg};sËS -s{\S0k0&~ꮗ]G?s(iz2}RrvK^Ng`L аɵ˦]RW(cĂ5moT0lSvxbi-cr9|%QW*[N R)_v ZOcvy@rz|LZ\'3ݢ"C BeXK46%Ա~Z~nc ˷zosk|䴆 `xC=;\ 'x?Ӭ{ :ccS8J14e6lĎ | SW?]Oyry6cXhַrCzaџLX-ڪGZÇ1SnX^`q=,gRO?yKTW_r%C6vXo!o eln৮#cOC y9L9:6C{6b⃇Y Nj7x5jby{ ˼R.?cݟɟt?C"jjiv 9RRymF czr<,w!qKyvÎIݘ߭pc6XM5T^ǿ h3h]z7zy-cէ/p7c((yq6d9mccLng hQO?ϓ㷇]/kcSƇ6b=ؽk뮻__X|i⠏cCyYN(~(a{ˉ~;S±:MP;>lsܣֆ'3X:?54vC)9ΑX+|.I#zi3*F* )ѷ,~NpN(KZ/'VkLo| ahlpS؆ݡ&i^TO6qbZ'վ[}sݞ={f3cTlĦ5l?ƛ+X<ۧ(ڽ IDATxܐoǴmy{Qg4ԼXð A?_~(ZƇSóBѡnʼOe`G±Zj?VtCn)Yʇr8KlCX-O[bc䊊|!&4W ɗpj4D[4% t,C|Jh|'8㌔;:6h7j5V~}6:DHk` t,!8Z1ۋqW.)a$kcV1Oci-[^c|;֮Knr1[zSm۶e_|?}[ʲR1hlo?#nǔϩ)ƦOۂ?nsEJ\̱vtZKka w pCx!J5ꊸUS a:P|H&c9qP~?%SJKlb<^)yqI'Ou\By8iJΎ{{ .t.A)x*پ^<0y1ʇ8e~ ?g1\঒Z8!{-k`s{Ko'SbxZߜ 6<;̯{l {,>MpOa#)bhmC{?fqm__ (C=9zZƛvj` >|٨IA٦LZzek, Ǥ0B+$3[pm]xb~K=xGYZIOtGGt/j`cfL ']j҆Ŷ_1" Oy;Xs|Nj 5Ƕlkf?ofXZbXr O_~y:Ҽ\|M7}Ó167Vi^xccjx9:rS 魍G\ЖS)b')_jN-L/-io^lVW2BT?yz`"iI -RN[ll abZ ΑGٽ쮸 ~ʚ>)?a8ҊV|i!C|s[1Uo'kssm6T?"<@:1梁cc랗B_h,;eݡPCbz~xwuuoq|n}:qw'GcmTO姢5SS*GMc<}sɿ7u;V䳪J*I: /aV_Tq6Zqx{qm¾_Oش}伍=bرk'a,1X>б}{ǿ= Xҩ5>Hb =b9xlhY)H~XPf*+Y>0ǂ8ATדr|OamӤK%Vǰg@΍!\c9ksK|rrKW^ybUinv[bCMBXwBC:C!ZH۳B؈l59)-%E^^;gP!tB24&;t60rc:zn_7weͲc՚s1jKKRFW(駟?-11%I Ÿ7R߼}N嶇]jk\=O>z9ӀWRWOȴ0dPB|؊hrCs0%/ܴ;K.oQ3v-cQ{v6J|=v|3SO=5K5qap ݗ{.qV6kaakwJ:E 96xzgV\>0yYzQ?$ 9Qz`d"_Tclp3!c#6p'}%bwO~zr 8ir=}z-.G6c љ)Ƽ(f-]efʆZ<-ǀCڭV_L9d0q1}[H/U9 utޘ6-&c.,;Fv>< rVKlieﴟs9zYgu15!rw}} %(pZK-b清 /gǗgc)iN/Go $L'-"J65d! lN{;цAox mdi:|C+fr _7!'|ԧ>}Wr_jFP(ǭO%綮sۦ]\solj+fܽmduy`f1/c2HC8nH&;dug= \mQlYg#heTv*nXk|OuvKj_*=/}Kݍ7 y_,6Z;.k'7į1˃m+^"`9IwY.gHaǻ9ƷP6|JƭYo?;fO2Bzk^h 3-B|(f㏈ '6GK;-um2wmguP=+ƛṄ!cEE~N/Rev]`mLa8?fX>OЮޮQFS-1-WM{/?HG< *5fΓ/P:D'Gy+76?d_׸sʑ7('T_mY٩ax>/eYKp\O?,,lc=E6)RgViK0v[婃Cd_;D"i_e8nM; a!'~_*m迕Aq}O3υ쓆ϥpl,\-4n LWU"vBX!~(ůWݚS0 䤆`Σ5lĶ_kZyb5"u19={^z֧N#dl'L Cz{1E3)@qֵg^o<~6~ 1!_z/ټޗvrI_nYtHFCqt) :dlMRH޾!;Vg}Yxgn Fdu׽ jq>0t\9:!?Xl 涘b=_#ctn]Ѷ2}Ɓ6Hm+ 8T)g!;O~^*ZvUtr'6[^t7z߄ٽ\ǬJkJoi b()ԟQOK3^pNQ>%qۛ'eh2cd%? n~x+o,&mGip+ C)E'-%3|\cp0c HTvf `@'G1 b/fS'z{.c?@^N/ 덯aq#Oˏ/˲#3~v/_*9dkҢ,k-bF3djBfj;[k0Xq?=Ȼl9{R 2ÿURF۫m6^hjBc}m{<x9>̓mХd 1NgOiC}McC6ه:=ppA÷ev̾Mݛ GlcmMK `Y]{+Z'Ɇjl뮗Y]r5kv˄<(j]!dqf罚\!!1T:Įgl q|GdP8NFh_ڗd=_N 7˓je81Yʬ.k#.d>F-, ,4oƌ^"u\"qmyv'c1#&rl׊ftyNlr[9=\Onx8!8P7j<6O+[[>:x#Wgw[Nwx;VoZw=R8BI*z#02֯rkR L6 o觗HB~7,E#Ēm5,uk2 $w/3\36m+Dy\\Kn 8;v(Lm37^&#7J99yA g?V1KH߈cyeB{l\*5O;(q&?z(Q L٬“NioV? fq3722Mz[l>uH ?*ܲ/=V% \ %^k|XiX8fkbvd m;f\[\GNsP F]#x1fx~kwhbtrVGA.Yc,/O( W@:)tB[b/31 _@Qc@Pkȅ˖X`iZ϶7\ ?Qs񭽒6OM;!$)6Zkl\r >|T*/tt!zKT Y>ұxc1ƌr9x\|^օ4Nw>Oj\)z#@x31R/?NyP\)Ћ-zk^+wd#__(㧤?\وp؈Xeh<іv46(<.*_k)BtHdF)OJ<CO^$'uSB{MP=_rtL Ųa}R@7Up">@ IDAT=Y> ?f n™ ̔# O_,*`y?bbmbVƧS9l0 tOr7Ce}ٿ"@&f7 Cqp!ғڋ.+eh\3V8'7+Û wdɅxCt}Z1an<aMG-;ޱ:; {ޠ UY1aep-=3e+O$owS`vCua 6XM xM Of,=^,(%4'`.r  [t x+z}?ct[iqC0Njl;<\z>.m3})wizQC0O\"ߠ{O[ 4p<4vܻ?MGCtQIr^iZ#an&RRJw\G}#H# K7'r^_( *#v⩑/crU5*c#;ȓ]rtҹkm. LɋT=[#HNerͲhfCPB;] {3_b;S='ೲ >'++d;%"$o[G{dVý/T[xz&dž9_N(l{޻S;$' ׼>|^B2vk{$o'Ȥ7eik:>voISW 2/)!(,jzu{w_RbvZmo޷<km4qk)69C'-yH>ڌG!Uy;6ںTCZ{8 IIS~z-f5lXrr)عg'^OW-\QCyď-<GLt#IK|ݻgK_+^+qfy=Vr}ȱW }K[,|<l2tjng\RǿRRБҏ6{@"lnYcV{νޏc\6ҶY#\~gQ񂾶2n#.HcO\CqJ6$vRzZG??"MZ[ֹr?ʬ'Sֲa_C1gab\W2Smh"_c9Tg6q-ŽgCO%}D?Wv(_9.V^~̵k -ߐYWm|{K.ޒc6*(S.v\Sưlk]} N 1Cwzt/}|pB:1~mu[w=./]_|9[wA>9#ShR XQ1[:/3bX/s<ȳdZ8 ū/uWrKG/߯Ov-;Ȏ+gC/ʬr Xmt k-x: '3B+'<-򞓭))E!g ''%G7) '}W {=YtXI) w[?Û/WQս,.xAK؁ L/חykVZᦶcm8WOKEf?y`2$n.=EܫܧLJ|.!%{{EAk3C0: g%p" w{zUnMaYx=^(ZXy9·4th50W o3"ڭRHM̏GkyX.KL;Cˬ~f%no\.WΐW@n<ūyhysX̔`"@IwO۵wxϭySİQmx~{ۨ er7?̸%r}(}g7_>6U_,Z/( K- ,20>E;yqo~fKlڝlMa `d^9.S-̲&iyٹY)|WOWΓ<kl}a/E kމ_6r|Nk9|3W z b S؀o|E{K/T?oʬxnCy v.cy>qsF+Fi|~jJU"_FKk'6Zb3)lVk:E,5l_?%2Nf?-~I-fx]$9~J/ZnhYUcpR6[Xd<"^4(qw(uu9̚XjqYSٮoK-ſAfbR:\jY]]S:?K?9dKKy7E1CYȼ62>w?mde ySlLorcJzfM;jڈN,6y=zuM '|C4*cW txˡey[nw<4WOIn K=g|%y9Xb?X6\ pGb0Rc-lxZbӆGa7k[;Ic<'je+RO/e/NA^*W ޸[{<}gcCǘ7{Z\h=+/2A3ntEE>f%W-ǃVZkN.[k;kn]bh+< ^GdF^Ϊ[?7,iA.߷7B_tXd`eZ"V'_bC6bÏ1_!ZӆF\Ґ}^L§c>*O)Oܫ?FZM6K1Ganӫkě#:68swPgeZd 3܇h"_#50R;m67ԇ]h۾էOJbg_1趖.N/?'*)\bozem=+_;A~Dm;?ܫY ,ڋ D2sFDd1X9k8y'$ a|r c9iDwlm\_o=_{;zm~_6Ȇp=OmֽU>ȬFz6'F1ƷcX6k y4u.|h |+'1yI٠y^CcK}@J?_ >fsl][d[\n5 ,20m&)5Npl49-rotˋrctS6b=#ٳOvyW_m3v.47 ZX l <>-`,9'rF?c?7y<\|Wүe#O-/:/%xc`ﰃ n!)xN;>VCnW<Z^*9'*EgEH":NTa'[ב?c k_ˎc-lDRE~ŎӦ `~jrC?ֲ~| k3uW7|u.g]ߕ/}U.Cvt'fjKp~R{޿bF.2 <-*d1'Bk'T< Wӎ;euCl輏C1hl{ѐŇCE_yRBf"?Nk,`I``;bdf $KNJfH0a3u:}nWқSmФmnfWsYZEms}e5YNߪU/;I3W5eO4[`(y|_Hn!6__76mGc Y-cl9ug|[r/CY Coƫnxq-gʬeVt٬>Q.7B@'4~ {"}S|wك 3̍7tCwxɣ\̐-u[ m|U` !!AYoq^}C~(y^x̯qBvdaaxPǾ*' ilvG*  c$Ru?&&^1r`C\U G\7=%g wrDޫ s 8=W2Z8{gqV m+;!m1[eE3b<: t&6iWZud=#9koJDP Q<8ڏɬ~ }AZq9"K_F57F\MmbgDKKlMѧI{'9y0|dzu:vA5uerbݻ~&_;\ ~ވWFr{m"ps.0o+3 ]/J1bvFN)ymN|:tV[l=2%]Dcw<;&[3˦8걄?[>1f۵϶ÿ^∮^趩u;b=5b_/?W VI27$HyqD8Eo@d*AE s 53 ؘg4zn9QY²WyqBۉV=J׊B.}ڽuߓ{G@T ;Q1N.>;O緅}v*Gg%ʫoG]ej_Q+ǥ(>{8[DXCl|.~U~1d9yJ\8{9KBi۠ͺ4:pk'=vSȰ,e_M: ŻⴶS“s!8`_R8G{7 A&jյ;eU篥(fO?j 7 gbWZ\|2\2Ja#䅃e|ǎ8oW6/'zz}[,1 8RR<X$#],Œ_,KqlꃧB`atGiW?$_;S}>``suW|MH&2]F+N;:Nyב{bf99;,n}7QLC0Ks69YkAe4I҂iHJwpħV IDATN41_9cy<}ꐨ +sP٪r /XI bpSU+KmX;5ol,~K^wqdmםSgɊaevtFc^!ڵ@N77MѬJLJY dHiBC6A;}Q3U7Ux{y q3#?g+U5*㰛lD_fxn%OGz {E䛸kfUUC\)e߶f>~)22b֎{Sxn=e!W0{&=Uf4uL7r/ev._*yvh?\W5,Ш[nڪmtpxԶv!gWlq{UNWK}lj[cv%W6gɸ]'_Yv}sLDЩ[eS6M}t^{h#itYqQL#,ef3򱔕0u,;}EsҙbrFA,Pg3Vbi+ j锕5=eخNvx?.YrsGt/.2{k͟Zl9;6g˟@:CBN~7*;!/2ȪUR勅a{8+c7LuP7x5y6q"10U/ã<ծas>[g`zv3 Q}>,ǰ#c~Xg\埑~\:;ޙK͘:ɗrSvS]Ʃj -_]U9S$-P믿y;a8Gߕ0m8e/ :Yh>(N!D,?RF9٘'1%bc,c)Bq%4cx8zGχO]pSJuSN>l` QGe7,)Zk#qM}ZXEi?WɟEO-{< ҧ$k2oE|`?#˛p#f }$&-_9O=8R;a"vX_j$ы ԡ _%lX{n<@3C^ys3^`_>"TZpaJSkPZ- N/:o0x $9y=R<5?]B iMӃM1p-P+bwphܹs^ppsyJ=,|qs8+o-Z:t'E*kSyrt9I7=Ӻw}1c]wݺZ ]wU8nH9.Zc>3*|W^qq9|ETGgD\NdBjKf$MӃ Ml䢋aRJw|5/yK"Bʣ$l5\cZsu׍]76;)±KL7MoI}6\jiMӃ>â#iaj:d~s8Nɡvpp>5Yk҆mp꘵OObvy]tI:v2G>SL-;Ӝ~淿y9rhwGӔZ~d5S7RY8g̹7)oTfvK7AsS6ɠtScStꫯtso~Sl4bLUgx}>#wwGf5uB'_a-\?o|*OsMUjy2 8[U>긼ͩj.~qHnqqʌ{m9] U/d/] {6F9tmcgNX4o/2 jb[L$i=묳C73 we;e(5ӡN}ƪh5:۸à vHSgD&iP~]|bc务 +P1dEO6U|uxO4rK21 !3,YdΗY|6[ Ԅ )Nˏ!e ͮ $]쐇s_h={n nr1 fͻ}+47 7PG/Ź-`[ &&ZnͷIMrjBflX ׹4=4imqM={]/x~:\>áqK\|7{铚C$etS YS.̔cM71]0n|-N;|[24' 4yA|ӆlo<:8e^?={v+,9A|޼y_KZᕉz\G!i#NTM1;v ;1Ue擟a T̜p i ZF@O@tPW YE.FZa|se΄}߇P̄!NKm+>fwŚ;ws7Ƌv!ط))E2Z=[eƺ.QW.pð/yl^Er:H ű/x c0O9}w3u&-кBN>9n 90M"C.gvupQaM쟘>鲢3f0;_}>ϙ[oQXi@,2-w0 E*[8>Gy1>AX`m)dMZe;NCğg'?YV5(H)}aK7XZ`_(g eNtϛHH_:̰|2/K}0]U3l?uGk6$,fm fx~I'm 6uL ڒ)K]t8[R LH" 1UpxCR/A z׻9ڬm9|+k2cۭvv-۳FINx.b1! _{YMx7u4INާ":;6z.s}.c;Dc4a"h38N꫋ciX嶪ةPDjIi.$'_fD&hpy|3,,@Te jҡUW[m5}~xxm?nvuW]mK{'~}T]?%;N]o$9Xm 28 .V -P+RCi}c䱴눝q"-koELKv7N嘂3,B* l;> ۅTQG62*i\λNK}wurݠ-7?0w}w1{O}>03llNZ ɋӖX8\O|?!)b`d;fuù#0nnj5??w L[ejqkHB#:DzuYtaR4-4m#%jPwK'#e Xy[bw|}o.> {7m--a" RwgB.c|~%nh"[μկ6׾f*Zp` 9餓w ͼf.{/6ѩ3 F8m3/xg}{mZk´Շ@\zA~ʸk<мo7Q5E]d/￿`kYVlnO@ݾI68Qիm vn)N]B ci4YnVwyI{ ڷ;hIG]lj>+_3gNfS=nl!eyۢ5OaM\Ƭǟd.y.]b2HXx㍇2^pW*> [Q>t^]e*U|])ٹlʮQë^b<ʩ`W|G`֎?X-W]uU1{ۺd,K8V"@3Y ﺪfʍxfav}u)ĉ_fö?.Rٳ b^a[oIX=h#XK;yK_:,yV5j3P}!d d d DX 181{Yx~&!W# e26Dp֎CSݥoUYLsL`edm1x#N}ch//M7.tsd).tD'/S!wlh=!)|>k֬J`0vA(>U;9|}-0[mU1kǁ5|8Ь G?2gyоIgzT2([Йmֿk&9|뺢N$:`b劅O#۸lC}  ©cYN>Ѵ=fFSˬUP[2*sK@1Gy.H 3vȍxl:q4i6lCN=46׼ O?< @W@̄e{8D y&0]v.} cώ9kyyXG,71p&]Ppe0!b~饗-Ro pl[4駢izWp? =ʅ?Ⱥ'_,BJ])8 8bReUhhiھZUӦAmXVÚAgH\EהYQ= b@[` XּX4NTnYZ>i4l,p`C6_}U;Pl\_5M7dx~ǯ~Y t&ե -/d ; X)d@`4οA`H|PBJ|\b}FVCcNR?2kBSN^G`v[ yi˪BmX:p>\_1Fç [ޅSE'A./N g_,\k1>Z t>Ue-/d#tƜ#8N~- UJgcpCv/4d59>fejj#| L,-Ҵ}<|)6m׼5/0v>,bW~33w\5;f~1&N_9Y,3 泓, c@)nǒ[$_.F6Vexv.kv>]ht^m?SN_5xCN= (;F6urIgw{gWf&4qVş@L 3 'G˨|aסlGs2͊7b+<a'}M;ؠ4:tlۣ"ٟtIsݐ&Kj_ɳpCG7wiBmp_oo:pjv>1|tt]5c lgψ[X!5kAa8Sx.)\t\pAP6Ӹr](g#fVDGD_8>k;y8Ziu='F/"Wveb;,f˔A82V?/~q7xb ?ȶon {{)^-@ "$ h[|ȴ@[kMINTq&4@4+| 3W3e 9yBվ42K}'o&E&!u찏XZu*uq2~ލ-\>ԏq J}Ud̐'c h}' <4ĵZxU%`(:DD#;趲'BXzBD`(ALI#d/ⷝdOE1ǒsYѱl8,x6XloBş*8vI8'*Lu͆-sg̘0}eB?"SLr!22Hm':ix :tS[n#tM W !:fӘ0"XY&IėfUpPczec(c)V$?x?kc)PBPvȚmy9yi3zNJ7LlP¾8y-3fϞ=۬OP`g}Tm\6OnCa{&< r, e_Wy'tS[,\@_m8y‘uTLpacydvw" S. 3w{|%/aCşPoxF&첝.(z8Ao5>mly\ˮD_/~>'6ii<6u裓޳7^L\Ͻ1x!n,(CEozӛ ˇT 1f3m?Ty*߶}oWMq̸Q'\ko}\:w}Miن:Duۼd|y<7]QGCi#ghӦM;x({*ymxuL[|Daj[ +>$ >@/%?-'}m$)6nʣKl;ly1,Qɜ9scƕ+}_ͱ|dIkLL([ `QbtI$LUQK\Bf+%w%hٻ"S};F`͛g>Ϛ~[oml>zsI'>G}&?|c-FPpCqZ)N~\v*Lu# VG ZsGA|V.qx1c/Ѷas7>FC$'OSRc_m?*鎰qQ2 y2f-sz6؀C@-K>o۶1:tټ,wyIlIV@N8uQ.EW*},2gllY`p6|e'Э7H.4f9w\ 8/^K^2e-6l#5TIQ>s)$48CmUgu7t]\|;Nv!S۴t>i*mڴn߸VE׿u77[n)UN65xؐWprݷ/u$l?KڪŘQ D͖&Oej> 4'xYxz|;{d Xk*TmۧPsiie֡rE=2}lǵļ}3xͰ*O|ž5)9tr5ɣn+N0&Le'ߤP0γ.ݲ@Wo2Y`9Ͱ ͡I7!$nJrU+gvpv []꯾Vc&0 ?l,PvOnO*Θ]xetλh$'RN5H.|W9U|\-ЦIُ}cŬ=3F;)ie:.X*r5YW7) i`,紛M7%Tտ77pCg͗b3Z啉O@6&ۤK5M>spR8?jߖmJ{ "Oɨӷz<ۿ}6w9/yK=pX@_;zYG}lߠub:ElsօrHH(cN#K0)6ho ` {nw7?h2hW_;FȒt]0$W/.cEt„92xkCk|mdC̝;|C2rJqZT47͖[n)M'w]9:b9^/ɻZ/|mɕ" eC\Ӿ?hy{9#[e馛&꫙zuWurui:ﮄh'?h`H],_= [=j}M7߬կ~xǬ+>v[A, :`rڇ|bwImF൝|Uc^06}پK߿. l];~ |`Vl ^Gyy9L] ts{g>8W}N>BIK.c.^ Cb>enxΪN$w]N0y~F:)X[GHAUvhJAkJLy CyȜx |31>hF};VZq^} A,D 'ֶ_"_IN^ luJ<Vlm}\0uu\7H<M BvSvWgmi}-sߞ.\h8'lP5kVq?i:+~oI7!Kj:!Pv>kĠ e=h amP5-}Ŭ~/T=>Dї9,@m'-A0v]{>y4Ϯ{Tin r؍f?2cMvvu(s=}"&e~ `1|lC W4CchkZ1} Ot>~pM~_c9V[meկ[c=ƾ#!h hZCצ飥`U'yo[)]mQNzO]w]iq]w3gmU}\G-xmo3بC-{G|1z%0:e6|UJe:ߔB.l]bބԟi4NKzjq޸:5ӕW^XA9/W e:4 ;9_ Cpm6.?G[TՁ&:rgz`bvmq~k.0}vOw>XRI((h]0@ y."]r"qR7[aȒyvXr?aY'UeN'_[-M^fDXaVlO>%|'Ԗi RI()˩ Ht'ٰr|!:h p,^]8mPK7S} `VO{z@:9蠃 8raDӉ: ]ť15}dJyIS3cr ],uQAD&?<,窫j#0kRXN"2=\.s?e[6u/g-f2S䠐Ⱥ|t EkюG8v]6`pZޠfr9䓋e^{PGvm٦SܓlgJ} Sh nTfP)f ,qH miVS1q7o7WmGW\xf3|sYb>n WU;w1{nEC7`j_u*xW8Ӵb@8WG[ fΜ 'ǽrh8|IІa+%OW#ROy x֑z4h?,} oxø!b8p #+o~s饗:I+i.$>Kl]xbs3.q?#iN=:P\!SqbP2ܞ-@Ƹ[o _0g}v݆n+a/8#D 38u>#i A&h9k}_3SƸBuFU\oUxpfk@x Ls!+մ\#R'Ԇm=-SU+|zshm /pB70}|t>Ŧnn;SOe53yx}6-]KN[. p LȓiQ)?20p,r&gIN^FL8yQqPD)2j̄fx|5הUXh7\WZݟwyJJ=r]><_d,|%_<2>x&ߗ|e'`=\v0ajò^1<8Ӽ}t4 pm}(Yv,n7zhܛnbvgTvm6ɿmZuu9 Uqvc%%vvsZ}< G3e/+B4g̘aVZiB\vrTaw=Nq'/",r9CY/Auvj;pH08>xWK6M ypm.*wm92:/ޱ5s=4a>؝73|務퐢cH|; {rv}d;R׽uuiz:Uze4N'K8yb^3z(zҎ6eg6=2y"at)kKɘ|GWasÇnjTPC(' @?c1 +=^ =D& Q uY IDAT!)p.X`l,^٢|3D=gp=Lr=q:y:3(W`\^jCCYH!8 i`z]W;e1m}Yظrno՘뫮&Nܻ{#xvhKSO=Ğb"e)4{8}K!A8k׳ݗEjװe6XNAE"P^ô|U%g^' vځ2鰞c)XKc01uGj]wM,,z8&BuUO {/;~ȳ<&4UB *t`E(TAЁiag>q{|y6K^-h#,ޑJ6ːXq8'UH`1,^HW e\ @P xsjSKּ}t4 y(8{䳁o.O= lu]k)s=2hxsc/V0A#`]1cuH/ij+PvWN ><6#Ǽ6;O]/ʡ\y7zezKyzk;T'>~/R8y(<˸PZ:e;SE=`l8i,ώcR|mZisᄏ1f,U7va y,q)"2(3~{*;XƇR?{xN7jXa0v)˩]96 E/2ts='lPj{u+CZ>_0d)ir4@릛n*=N1~,28dW!XrɊ#8۹G*?#>,Q;3y`rqX8yX,kt y04c>ytINc4u9Efż]34x `ƃf6jLk-iU6]NB/V"^xvtye;f->7s!~(-YߣHn A~… Iux&.8\sM#wz3ЀP̵ÞpL ϲ+ =aj.vUѦ"۵]13| `s)n;HrJƳ)2*xe)2e;ʈOo.ggJXCiU >!,9yYվYd_ qNl4((Žm@#817NtBƷa-R1@86k6n)2۸]-lUY\|o|c m)S6uhk\OAסSW8?-+OzL<" 6lV|qґ!mGSQEe@( zXrҸI/ Y#'ŵ$LN~Y:$('0en&a;S!FX0Ն$ S0e+\8>.:6l_ʣK_lW97lwg:)Mtt>F S*'v׺ƳFӟT8K.;'Rj|<_ WŃ,y]J\ ]xGӰ:Qg]Vv;WtPʻdphx6ysdwv|nv|l0ߓNyד8KfG4Kel1˦_iX!cxjMSy% *6];7X lf]v1;;=HsspՕѱҨo-."6]-a0uqЦ/A:ϗeAÆ~$G)KzD8;y'DgsceQG=`c_ SċIXByWWJ]!Md28>[[ouƽL# W]% Ux.Ga!뙢^}2̙S8`璝гiH2x, ̓R~A\+xz8y,m&'Y<דew| ]n[jmz4Ʊat/˟G꓁L]plQwԗvd9! `Vv)GN]TUiUţ|w9FĤCZ6fep~sgH{H.&a{2q\Xsoy<64sbD"e 9Kq,0" 6DhUTF[,MT0Ox)ga])Wf7nl[F}!:8 /g:[l17~=rIg;\*{IUmz6xp:L{ 7G^z饓&E꣣aN㾤qG19"HK ?zp9y0(lL"JVмQF2γhllzf_|^# ǿ[N 74P,3 !E۝3q@+Q kzbxjGhV!Dm&Seuf"c\+mp/| 'zSUmBI|ЪCBWWu±_xf<~^O{S +36 *(RFY N^\*Fc렀j<O6lI\FmټiYFBҏGX8y#}؎ua v6OÍR^*ks>1l ;zgp`:c^{"2,Crtt>`kןn5O6n5]»}VA8/'t, Lpcs%)m|mcdLWO>ÿh]F]#S,,756N@Cq3E]M^a].G;pp?Ѹe4b\#.򰍸(0l)ilG-ﲑmQ93q037o^cb& VmLL?XȔy\:ba7i}߁]:䳻\ysp_}[%cu}'qo4e.)+&c)*( .'OppTd_ćdK@;!vɻm~!0bqGmg~+m=|LmM0;0d^áRW 4Cp6/ CC TvrIW۸m0Χbj9d7ƣj>>?(a'VqV 6u.^6 pcW-x ;ihXg!:WyMKЅH9Qt`~ҨaS =_, <&F <A6xm+͖2~زɞ۳m'{1X1^SĻxN"O 2L r咇-&ƒҏ4!r_,K=~Z\ 'OYȞ kl> -ۃ9m:hc4YJ 6:R>JIt]0:!S4Y0>ԅt냟![f5?*BnP׳K+l؋ 6pv<;f؄ S}ҏ+͑iMhxf+azAygח%FZE0lsA ҅7bl"k`)cjދ.vk?Clǖ,\)yPKcK'\u=6Ą)f@|N6σ@(vWA^'0I;KS%#/F<X{vI]2L@,`;y}oT,#EZo+;Ύװi;O_D"e>rOJ^N^sy8w8{8w|[yl^Bw* Cyڅ Mi DJ|φ2鐶^V&ScJ|̼ CXҖ3{Zzcw:̮R^]xQG:HuY絝U.pW]uM,o4E(s B\ASyJf◈I\B1t`X :rƁ hnv]i:YǔlGYQaQ 5~lj}N5<<>zEFʻhG! PH_>)b`C>[`,'ҺP#I<'GͲl(+x T>11tq`CL!MGQ'A_YmX۽Rey8xLv9>+,^%:1<N3bd~l;@a!G@|CzH :'u 1eMOmXҪx;k~k:[`,ǽΗVvh07C<J(ƥΗ/bbCn|c 8qs]-r?6r GO'YЖw3y(`Oy4 0,HQփCQz@vhs£{~#8sNpNŤXhm^d(BDA3{8ytɒu+,|Ge/ !<9 '45px,ӱ#G]Q/X~Z:aNFe@DZC5 ǁg\,٫P@iRlgP'zN(%=OGuup!Ѱ<5N[lfĦǼ݆2i)\euSgl'W K!M.ƦxUnsNGOlvpIAWlOEq\@,..aeSM;qӦz_J[vдjxB+f|L\u5=VNcs'=Σ% C\C:Ϙ'ӳ̥y.>sg=;vj^)BLr!=@/fD&'=*)5Q@jgώq8@t@CGCuuH(Dz6,lԋu 6M ᠍x:ո̳]ش z%T/SUlrUt1z8r^(MMFukm.N絜ZXs2!A&9gHIDATKt\u!Tvb\.׏BJhk)OWymg`YJI)`tޅ:…lDs)YfzjCy I_(ѻKtXgRnǍvš7BgEN2>|>S8gLQu|N [P|e,~EK붓xa 2p`GƦ2\Wpgi2̓L].a\)鲭 MCm^v:ʆnmNGvtc[LJ22Cg0!bkag>s 1:-΃v@Mc鲝* 糅 +꩏ݮeDZ4/~w:w\Nmxu^d:4iR|/C*KZpnB@;}Sцe=gA ө6ˀ! z -c~=6ȃYVGZCIi yMMe E I ):r Oy-;ోws2=&B3x4,M#L+p 7tkHD$m%ɯ(vqy$7guv:0v=LCh\,<@߾94œ}ؗx:4i/l&בr0#hH|F\q7HNN Nz&:xN?&q9fA.1q-R1c y9g g%뷐g/64 a25c=R a:]&em.>lGny:>ʂaz6PҴ \]{b:ڶj\NmxÔ0(C^34dk M<:.ZgL4k\]<9xg 1C)PųxIa8+BDNXZ,q flDҾ;T_R_ rz.ϮCuX¹`R  LL Jgi2W4]mv-Vä]72|?^&MwGWmz(x)txLu[Y^w:aQoe ϼܿO}xƥ$K̤Qx (s-3HR}rA ٴO>  S_(KW9coLQ;wr XD ^9x(l y #qc)pņ;Itz,#??i2"X&-qkH\U?J8+9i<vbxQaL|l˨u20]uEv-&C.Z1%=ׅgäwuñǘ>&64ކeyczuEu>?GڄazW?H6.bR(ylpӖ]L %](m$ 3rz:ltHf;wԁ'hBsVEOɈ6-4=893=Rb~,?HA y:pG>m'Wb.i3(sW>K&hxԓ?RD8upù#g<}~t#E z E͕GRa!//WÁ¯3eIfJEXą捐Di0qm^]27Nt2xq57ZXJ4\s }>- +92v3X4^| -13SKߤia>pǂSZ9?3rJ&w,uU!/;@KlVE]MWl$y<]Mݱ4cLf/ | 4F"v m[ݠfP %g-SwP,`1h?{ 89=[- } nK|N*ĝ!;t? T@/j.rz;?$%7lmMK5m^;TxϪX j' S;&#Hu*_8k$QWIӎbF626EFB`zz!MLWM\ X|4TdIV8g& 8ۛ,aq,4xPCItY dEDB"sCqx@j}wy_ڵ1EuR<}xNڗJs 6@_CJF.I#fNP\jrO2`,dL ʄ%Z2ub}_R)ILON} uEժektuB/j-VNyWn[ܴ l~Z*z'EⓈ3#_ 0ޒcuUz?u3cX5AP^~ 0Zd<wR9Dd+ >,Nb؃nЫJG?cSAGy{cr>Җ_;4,x+ņ 1kyg< ΍VZR@Y FJ2~7/:ٛ;^,T;Qv $bc_ƣ\2PR:o`qk+sB%1# 5 WRKĦ&ebK1{OG9ڌd*iu@dFջ.iVlj4]՘#qe S/a҄~<j: dRng12;luM8ZfH7sa R607wss(5W(Եac1ox@QYocĨ5yD&#M6.VDe8(医q#ݹZ45ߕd2Nh4&fyv3j4- 6| Q90t5%DMww|␰rj3n)G@6U's~x-9CSvKj5I-yw/cO'ywsY87A?\fCko8-pۃ$gI߮, ee -w%/Ή/1qRmjC&BBLo_wN_wOh5"l*K<9VGL{HE.驊{RlM2:B[ɼ2R]Gb0|z>rϫ;KkeO m*C,h@d9$«,YK [YmK]~`rC*~z: Ks}Vw8lʋ FT8^u)zߙ`EB#t`=Z!h^z:t5q7}pʴ& UyI7!Kܨ%ϹsbQYO$+A*҇p(O,\ϫC#U^^ 8+B,3[49=ȔZOdfך hZUj;/8J.<3lĚdb6bBM_4菩W.s{_O_mouKNim#~R7 Y[>8U|5@Ŋ\蝸AȞT5@Mv y[n7|h/+L^E38Ŝ* ⬑DU蓆bz+Ihq( aq3I*$x9C%&l䶆R*'p>ɋs' ߻o:NXd+gĞT¼3,Q&E Gfq8h2v[~gy_UX2>B̪ax?f0X)mB5ż*l:u#4wwޗCm9l8M^waOڃդfLXFaQ`_\y8!)5W7?`Hv7#rTEGIW3J% "dzeQUgI+M,3غQTܴDyCFQQ?!{hi%zF_Fփk] X2 mѡW'. Yiݗ(c+S$"RPl?Hs4]Q+< ֔wkÀ?X¢Kudv  +=bO(:=@J. I!=kђ[ | ?VW̭?aI`XIJ8]M3E!S0G;dTxyO`qr %GI u,4U˜QJHDZ+ el}LAI]ߗ+R)l٫آřS$ ߦAWVT=1u{:QjbZ;ot@=܋؉Q-bT`k$'AX#/qAdSTϦgm0,tOScTDQΑ&& yt7c=?Pњ EC9d#HYjb֪f9keg< O~"Zl@5-~k+8ľJJ Pi$;CPg{R,=q N Jr-E#{I)Ahs;ԎS;u^HOu5藺,D (VAPjc|',Ka]zݞ%8s(@+U,}\#k}rm͞="H=UE2Iʔ+0ɵd T8ijT԰/Э90ɕ5_4A:Cn$:懧+P&gJM!Hh"?kd P^gOkby~25((KlVG|ۼE|S'Hᰚs5V&-\7X<;DqVXשC.~oj"q8݈T@&57L,}Bv6ngx g qe'%?M&1E}!sљ4N.)\gnoᛯϔ pE-Y9ѧrX !&WH2͝*_ vG涽z80z_HM5[p2:Q3Az7IxQ.:`ْ@46wKŋZ0Zn2k # =N~tDq.%6 i㕢h ߚjەi8XoZ+9[;4ȝ3Lc׾8ڜP2bJfe~Tր[LS:_ST;vӪA|=2]䟀 /(.%l52,z)%Ý}0I\dԘl3LNxC'GjXJ0qLN?!*$P֥p8g@;cE3hlUqe}"tKޑ |lhQ` w "=Έ0Cz3mFv0nja@&$xb?t3RK,nhܛ ą8 9a0P6щ֔q8"/mpD5_#2oRR&y >69cX{:B ~ ke^*qmk rNN"%I EgS[;nYCB"2/&8KINށbcQ7*S63妼D$BsMH7ם6`T`({QB86O\!.$+[9&%3gwdEhpMsY,a_Y芍 ՓUd@:3m"Zm^2cBmŢX,G+t4ɓJa8xJugI8,3! )BC%1@u |){ i 987ĭǜ记S  bv5Xna%j$#x8Vfc#.BkĨ"k>BԵ|΢)<"V ܟ02jYc WŽl=ICCUaH.'bzr4kDSW_0yܞ6cuH,e8o%/"Z6Ui2X? ֵZZn1O+V#@  J—cq']BdKE/RI b(GiUW!{D`$]S wK /qNVc((r!NMJ &(loPSo h,|A2AJ8NWbtԊqI)NzHwH#pdΦE+1Tl#^/eA.u}[F̚/H Z2*mNGY3J[i! T;t#nbb .nAMˈ7u7 W/nbQk+ \z2%g9]ꌅЛt:;@okyn0vU4o/. BX2j J}VCk 9I(*tz{`109eJ̣d l ?DX00.:?72mwUlClZ=T`%p4h -ħŹLl+ -1b!y s!KӞX&Lc-*@`sWS9 1KPݳt(:@?tR0Tz[zQs<2+T#Eʈ9=;L]j=+\{4osw, UC"8HdyRoE̶Un)-3P-&$ 6J/rZ7U-cE8(7wy7Ė@pW|P ADjt0ծ3|{Q'j;NDKEt4R&{ p3SqeHomPmyߠ*vʺ·AL|՟hd7`&%J(-%Efv 1jsHwR!9B@B\>T@(YaFÍϊ ,iH*R*[8Cȷ~̟(Qjw ڇpXʞMnT &? MR7[׼~lhv Fˇr?`UL杵;2 T0󯭍y;Zo5,wB?ldR^.xM{cL|<%B]%G-L,!|%4sn~< 'g> vWnE.`!exzNu=l\ 2 X2< xxp*r_+Eǰu=-*C>&î 6ɽ9U,J+ `0T6ShlU UWOd':_ vl%U W3kW\5 HЀ}hCBD1 3sgi?&Pe^{>iA+bo 0.-h2}Y|xDTs>&D4Rxඵz ]ÚOa[ʖQ1̾ D*c8~ ef^@:Ls )郑║9͇}^)}+-ڱ]e)1ƪ>Рf 6c[2$<^,[]]hYT LWQ>"qi<:R jWwVw`T gUrA8@QU:˰ CW(Me~Jc5wuxUKULjJ37ϭU/D1T{ ׯPuvsǂZ!w摙g8 CK?kc>R(pao}EP< s+ρ?NT4|k_A\*'&`K }`򑑴uU,#2s42\Y٢ƭ}dgy,[TRVb]Ct4y ?Bn"*oDTErWCz"G# yR'W6Wr{eh+v< )_ITxv\$} 'nct{Y=J)kT컘L~:$ /=O+׈^$fpragoeB8]jOЕ '>\Q/vVD;C?EDB-@xwl ܛ7g&[C+s ;vBiN qhl? pR:;9(f_P#:X}˶.O/gܚw9\ot)|c DlFD6Õ+ʶƗd7ͯk"%vd}?QS-6; pg~XԪ7aj"/S^svgbot$#c8$|o-dsS {-RK:!̣y?H诶wcgǚHݠ0fɯW7\5na-)%4_rv 3wUrĸ O  0z]QE'/є6{m]c F*y(ɑuVʌے|;̟2pC=H_sRw-_`&nIM\ /?JKO,D7rs覅b`^S1qDGiƇiիY}[t:j A7&* Xڂ0 p*d@ꮨ'/"^*'K;\:>ѻBCǍm,ERav4# u$NioRv;WýoGv :tE\Zg`Ve=._QLtM YsS#`j7}V~53cEeCFJkO, g6i  oIh Y)@#Y&UydϺ;ⓉH/bWխy %) '.V_HqB[yi"aʛ*8KM}"Pu? vpS~ u#R[1WCo$B9̯Keo15v}-T-naSLg@=f%»ew dgߨpn5aw5Fܖ+"r4 GYk)?#<p*pU@=ù|<\ao0-U私>x1ަث ^=f{{?\Hgfy ?aA '  RG>R[A>mal-Ai[K9Ӕs}h}ۧ`ا;5h rqfVǧM2(EPA㘻E&{zY }7Z ;G; ^ D \㯸Cٽe$A"^wנXf4("pBrG"R1g% AW@?vAp7CÇBg@۟ ۤ,ؘx1Hf-Y`8 A]O5}ςy7b&1ig(>U>AZ 3sW>z'&M5<G}LܣTor^>JWvj:vs`x^[-Ю]_a \;6ZܡDSk߸og8&g~AOÇ2VW*1ŗ*Px|jZPyCҷcvQMQȈ.؇0> osJ^"5w1/S+!g,ʖtʪm'PLVzýC,E%Z&D?xԓ:AYf PSmB㗸0 zD?!_gQμ1s[:"x uLW^\9=W:;$ܮNuCBW\p![>۽Z.4Fs`@h GJ%&|Dۨ$$S5ƒxq*eZR{!S@aV'lYmUkj s|!#i!k}K` ih/]2zO%1(lQ,W 8`}wwVw<NCzń؈8Df'knݖ 'i<†8ot&m(/{.Xȁ>/1S9Ψ(>H[map"ryt'JNEZjȦYF_(A2GݦJVPz1<4_ZkdHt`{}kzD~^zDOYxTv彴}c_w]-8Ҡ愌 7䪞 >CZПCcq}B6AE'=(IV)lL"唘8EHhr8ܸ1ڷ3X ڏu T@c:p1ՕUyC1 b-jY)FQ۶[U*Z/Asqۖs͖v(:d9u˼4C( 77ѷh8e0nw_[' Ot*N-pL$E+>3 E6+:Ovf`F%j $AdVB.C !1sJ*x΅/%[TX;"ˬ/Po]h9T?B1;MA7v0792Ӳ=oxqFk[J,1h/@ڧ-~ 8r"cÚEpOFb0 Y(9nka?',G"#V enn!v;vv? 3S=Dv^?~YBuh M{A/i@.ϓ$,!X [i924Tf"&&.ұ-sBE_5" zU*pRIVJ7+R񬻐Ps/ߡ/#|yjt'w:Ww&0wT~,1˰r"~#.n|u:Ockalw35Oލق"D8%XFiRYfR|4;w`S%V N;zAo>X/"0n7ؑh)jA0Es9 av2B .{IA8JDe]{@L s]H8r ӰO4t\CͷXMK|uDV%Yw^ƒ'&]j8w>WsٓrQ!Ȉ] .2;T۔@$TTo ,UB&{\_IKz\Cy2ٝP 桴&#׃= GãoL`-RP6q'}؄DoϲU{* )4[ױؔk9Ptǖ!?bZa[i?1=]΁\n\8GWM';(_mY:R:-ޘTx$a$p̾N `)öLЋĿ &SF;ojZȗrҎ3 FZG\aܤRXE27ZG2-Wn([1Z^$hg@1?*nBjy› J"5|}oÙ>wy| ʥ^DuF9APc"մX x?oDLqN'|eRsUA5&yŀ ̺ep+$Ddj ,|y+ĩ:}~26ܕ|$oЪ P%7Ji>bEzn%uc mI!ڜn06F@fH"V_2̛4X9uKRp"拚 Y%bCf;,U]T֘ E/e.TۛAP=e Ϧ'kYZmJ+{ИJp19sg;B6l$?j)3*1`S b]8 :h^``d2= P=)3ySO0[F~; W1J'nOx&&h0d%hRHjX~ft4|0? 9 FfF{m]ӍORjjD~`=ÒDd$V !?? ۞ =7 *0?tsۅ`TKU耧Td4:C b"=, RR̹\)kftGd#YrU +^uzwL!(싱Qx-d{/Tg*W=P &!M{-7ϰb3uN&gbG_wK%Z?ƣEَ)B[G[[qb_2ξQaN Rq2/he&Xg! 4Jee-G;xCs1Q&'+IAcyr* g?W&(8'"%Jn$[Uh4 8LS~&I;TdNBEgsp[NoZqoRڐm~ }QӍ9C4̬Ԋ֝^k u1x[sctcYyTZvڒيKq2P}f+;B*Mq =2 01v)x#D QB˟+|z{gfG voT^@W^…#,!9 tIFY m/ţQ b=q[bAk/1!1rQMyX4u8ryFZ_/Fg"ʝCIwn!x"46t. 9~{zFL<0nۙVUΕޙH4O)d̫D*,i=F" Շ_ny虛졫5FhźKl~B9Omd[˸ /(!G ,|GQEt yO;`i66U_)~,Hg POH̹C<h'X_jB B6cƪ4؅gY"nWmz"aGk af6J2P?^vZ!k l! *o#ossߝ6؅KL`l/XVC}$qp-A[ezE58."~<]fNG_&+ʜ#xd17Y 9W3pa=6Bg,}:>7Tic N{n5PO9D+MV'?1Wɛ)eB(,_L9n@sڌ;BZg$/R)IeL&u<8S֌ܛ A8qԮ&hh6׼nwjzYxKy<]qN`kq II|&-%IXyQrEqp`5bmVՃNDzj1WQ>LwgdAqh0n.I__~់pM&᠝#XHHRy>1QSݤ :78ߌeQM~I?]O| ,m>R{ x3|D*biKϲWzk`q-pz> h4& 6|RIOܓP],tr 75mpO ;5B*oQ-<~?I!X(-xBwmuC?jeJIUB2WzPB5Gt;ȧiԻ Jq/̉ԏR/Qe3 (\X+p%Av:l:@!xa`N'c<}gk9iuZڬIRq>n(2C ;pWUSTu%/;TJt#%_2_EOG:v D :p_g\T\)vi)"紃VL6^߰R].z* }|=[<)uܐy}B.Dkq_^ XR 6Y9 &B[+BzUa(.K:9Y~gT{ c 5%{j}p) zFPBG(<94RDY0;™¦VML*V0WEGxpB|2 _凭f5LGF `(vk7S3$fn]53C<$Vs.:"IPn/#m;YX4MZ%ḮBr ġQ,֍F,u^H۠$7yd"E]Y7kt:k~ ^f]rتƾKT

    GYKos 1bvṴ."-"jpq++ȏ7;Ԩ[bۨ29b-\Lu|jG;D=E n T^2xr_H'QOQL]sg԰Y6$yU$ZBcjiue}:?)nGG'9YA'zrer sb1o9Kp= K(/ R>^@`nwR"(ǂvo":чWTScr {lH1侟6Z ?^ I^va׃I v-?/}06zvzN(@ @8U uHW [ŃCkkǖ=EB )̉NF`(kCDg-q EPL;xT`,$3%s/ۘv( TSZ]W.cDfS_ sT nyfK|Zu 'D%OB70%3_+{v*Kan"Q]ҍ|>٦5d]@ X*n;xBBxyl΃{|VSNœ@At{FA̰S=d,qV"h.xOcECw6 |#9bk |y!U`BA%i~>Y$)MuLgc]Vs, kXYW^|Bbs Yf6χV'R3A,eސ!vtj1WONX6s c^D"I5Pw4M\*V`tX۔vT7"17g&Fg<;LFj Nb, J,zuz/:TS@-ʻrA'JzֹVc*{ap1"2ȴ6^crJj;8_AH=νQZZ$C3d, (OlO4e'ܔl ^ F+"GۼCtFPn*cUC/cGcɉNF\zSe{ W.y1gfkJF=8TGJ>B ]4hI~7Ә>V}TV/G(kCSYN $<,-Ge% p=-^)#uJ2MP/f10FʢT*JwZ\*ŠsKuTc&;/c ,\+^!v^/GB=0&/0h1ST(pBw?߸T1v\ꢏOLo@؆i @p@:BLbE~_$qCVJnm\?7$3(c1d YL,U;KD~;JEŇA KDm.ylaXfcJ;Xs9#gәV=~rѴ؂o.r%fNuJd JjfKJDSyL8WHAz_VuЭFh906xiL΁ȠRmpO"?,ᓇ up}n~dJ'h\KRXh >N` V z(Dc,H9d˯/hQ(/Hp8Ic t3guY "q0 f%LhZC8wdjq#r1^ò~S ,5~,PIBZrսa()0T:~y,oR4f<` Cn"yErw#i5H)n"=HmPs 87$(ɟ Xq$y]l,E~Voy,ktES?&1bb!8Eu!>K\Ѹi>Gبg68C,[2|<5AVqVj^to>\7o-3Rm2+0d&9˳쿊WŦ0{[hHiexƍ*' ~:@M{ rp[ YJt*?L^2XW?3+,ׄ][ZEGj.,E>Q+dd%OLNa/&k.Y;,e'Ch{ޅl5+:Og-/x)ШРq[쮑2p o(6tx܋,ݍPC/"FG%G,[j]] oMU].cŃuGE~|`R䣦@^>f.`hR`(}]"Ec<3I4uŰזz.]Rآ!liz|f1h(Ou$rOBZZ>Sk$QnF?dA|KbU<3( 䞲-lbsSh98A|ФU1"G D||p#JϟSse>Ju|T7Y/:w|KOۿoEժuazXmw)zi>7ovR|m駇d>~_On|޾{|=vN|9kpVluU:T\y E eRuE# t_>G?P?za ~{-z)@4H0*Y;m.9k]#(A#N! fUtߥw=Pz Zr ڙ>ig.>4!8kfsh,h]Nv_=l1,@0?:n5.P|sqf/jh7^wjHCGmIJ? Ѯ 5Dl6JZfpo_g+2!-vVȷʧ~ȨB+u%۝TBI?U?/GeV P Hɦ@tTJC<@GkJoUL\uo$e>$+_ݑK~m-GQp|jj.B]rvUr6Y.I߉ƥ_=Tix˩U˚G34ޮV OOO(U&53F 8~m?Q =Rv zF\Ѭw0\vD7,kw&ψ K[ ) V}*t% E/Z]}9pr}๣? 6툚4Z)D l<&{9]:_t^Kण55i.Ȇ{=;t"\ǎXnځ'0M's@n*g Q3( - ҍ_?܈8 qDf.zded|hܘ6RW\ %m5Vc9g39 c6x} >Eݞ2bS"Nd_U\䥚2yb"K¾ϛ Ͽ0+r?Щ)r1=jo> QŒ%|*pfF2(B"Bu4PU4"}k^節^2H;QIG>h_X׉xe[3\#՗DPOV 800Z`CIUnBMh~ٴ Ն5.P: z;kѣ QX}"YG)S"[N\xzVr nQI VSUj!s*gza3G)_^ˠ+ QT.1OR g>#(*qqCTfvܮQpQK ]8WOOhbHq0;Ԍ(^MO]w;6D& Jba?qڣΗ/Әڸ{Z{Y& (f^ز4K [ݫKkt+^abs'Yڹ3oIm苈59R T|->Jiy=wל\@^^5ck["RYWlNÇXjC9[۰7 S\εp+5 K+@2E>$;Uk\.A8sr}eEk"j3\#ZP -Jys1.Es9Uu¦0!nԣDֲYR&D`~F[n>= F>8j$KSס8'qmT0NgR;5V010*݂x~+u5١7vv\/u DVP+mEA6 hD>kQF S TMV~)610I>$NT'=F`|sJOn㞰Rp'UL9.=,nЉϢcXGa51ٝxWr-JؗқCmCXI+lH|rD9$ڝ7By&) ~?:k`(c"M~eҴ Eʜvcd0 <'`H K 9Hu-fX ׌*7݋<8sM İ$4؏2?qV ,Ye>Ƌ1(oC-ΜMmJ}Jz4nIP,ϊT~?&%ZI{uYq8`E>t/(8vp)2oo|0ކ0ܓ Y@j!d4Z9 $3o 05ݛAlb %C2 FAd:bU ^-jY'gb'L'9{ L:xH%$5^*Op~޻rNj7!{k MR 0fpN& \cꐗv,ŭ$lJ>m786D}DPS?k_W(3>s.ʼ=<+Yso#1=Dٛ+`łsՑ5|f 1+zLDUzyM=Idx>0.'r7z [dB.8咿Ύ+T5}oC턾!,MEiSr|]6% ;̺%ʺ]#QA.#Ir4ҶBnUx/UQcd$l}f~'fTctVBgI4}#Q;e/wbC~k%ࠖrZ?h-8D e }7gru:ZpRy hcRET}3`j|Nr7 "ѣ ҡ>|UxtOqiW9?7:DŚ0J <=cfHɿRMWpkprn%|4=a&3??j2VǨLDc9z5R D젹v@c0L[w [\xKywZW[dʹĊ퉉Qo.nZ܇VL%kaeq[@rQkd7D trڪ <Dl4:T\D{,_g>.*p]:ѿ<0h .>ϊVQ]\8KWM<,ř{%qH2; i@=WP?9{QÀ1`wH1~Gf6 |>aNtFo.>XGtJ L a^^+@hwR2z:%G:NƕU&\4LZTǃ9cڋhZ݌sC+<$QVJ:yP2͵.3u}i?O! W3=`rĦ: !U υP愖e>Ð]c _xj,M([uʫs!"ZurjA:ƜMM(*RF#I!`IstIGHS*-t-xGKN!GVm}06* 2&@>>u<"mA)No|7z0Q cr9 Q =3F5G_vʇSHawF A [AdTt@5g%fjـT-tʑ<־dO@roR,c-- 1ޖ/Q` ťy̱E?S%\%% >hr[nb`^?Bu#F|nj*5Ht&j҆[`m?) a K= S> Rم?+Hv979>V5]p vzLK.M6(2ai3TÇqͬ{FͶo:zݍ{"bj"/jyE?xuD[Ey;q4ETTȗeLvZ'|m2Lx(EEQF:Z {0ەlϒ @@IvvXvF#s 䩯N`]mig-ްN[rMJ /; -*D,ڍZ(Agg!`9@/å`׈8=Ǡ)'ͥ†2vZ9=h9W =m+ z,8!R',FYX3-8d:~`uHZ^@8_JFV:9h >f7ݜvw[coiݎE5:{'W8řb{R%vʞ92N{N$M߆@s9hAB Eʖ¸KF@t~Ô5;!wܚYBWQt.3j)= 3oU[#[aꦞ5|DCmnIBZx^lΟFo9RMAB+i.:}]ɞC] K>P`.Zkb*,tF>}^q`g ܭlaY-n o @Uԋk|{VҎ\,H4boW)qW:k0+7dx [js"}m ;8Tȍp%ZYDM_"&#xuސ= ߨq&X-! hhia 딘L>mP}|P6yTs3`F_iˇ%.pz+Jz}SRPF ZpY=ͅͰQLyϧqЈX?*WB7 j *P̖!V^x+cG+eqN\Fh6jyhI%jCY!Y {Xj?:;vcZpP|QZI% mE=$ =ci* &'rQCrVH9vU(-^@gp7波f%Tc~ f~Mn<7C$]cɵ4qplY,|g_[Ц W&^QQ}ЪQC&~xc)Bn2,su]2G)ӫ45.MV#:b[ILTa9й +CQ@寧,xR6 -v뫾pg>dݿٍdV_WW|[#47HIa}uFa4^NWpW 4tUYC %TŸ#v ϫ&_,|k 2ƾ<-DBl \ y"TPYfǩI'{"]\)t\nQ~p"@TP i\rÌ[θLu۹ 9= #ַSiMiYƟ(%8WhKR!~(1".7#+He%|Ͷ58AgxVouxv`L_QO]1VT&$u8e܂?:ql8L}5 j|( dpSIwOVDWL{3,Vw[@%-T~3Mx =-HJft28@>x//4FN.W+So,Q,ȉn/D<:އNբ:ZٔӼu*^ $9ڙzs;' 5,o?ح~69GErKRHZfO(C%@#y`}S:v~V]{0qZ$Mt&aC? R&zY-_Qq&3EB'&B"AGz~\8 /I8`}=q)+3-\qWmU(;QmY'5uG kRU׼dHPNO! Л[k|$rKBzRxj>&S|h"3wg3؟M}U/3rlL E x_߷$z`a[f6D.*ԍd kL@R̴N{E%ojpF,B&Tܾ^_c$]H8;11}r)2L[ B~M?4ŗ2s ĶٔNqanEuLxA< ώwCey5nX%iGKu͉C Ѵ 6Uޢ_Ub]h_f!oExW`4׽/ EIB[LAzRk_1$^-!::fM)n^a5.,)n^9Uzn=!d$t(To'eXuyP aY,JѣQӅjs-hZ<.PlRR7L8}=D"E&^tim xb 7]VbCnG` ƀY^_UMRdMhu'ԅ:cm4T3Zaɽ@t밟<4 ҸvgLjBRd<jY`t00o_*śT"h2"C,ss"[SmWcZ.S*.ng>5V:<ڪ6:nf rO6\Qˋȭ]ZyPLxX2q9}/`@8q4,eÔسoz*;$N Hn(-9#۫2+T⮚>3'4w>P *". 9CWŕ~)cQ L͋wwq*̖ǰpU_k0 ( #=WI+gbB3׸xy^arV@ ՜!8 \ە )^s|7, "qg0yz "cbY.MgN?QӣJ<ь&SM\T9@VĦe{N;A<%ϔ/4{9?m?v Vz޴}pZΜ؜~#?@Fa=' pt}rn6#. +%ƅwZKAoB=c1 Dn'=}7/}g޿N*<@H'RhVJog*7+* =[B\lfY`{ˁjmCdW!eUJȽJ\o'p\Mn_3W1 }zxb32ql(4@nH'qj`(KL]R= [ڥ::![=-1h#p+& (^FZ^k-WT-(`jt|GR΋?*Kǁe{e ZjWC)z_տc/25\բOGpqҡesXJ2!O 2m@f!NNeGstxppяiHhpRE̚AZZΔ\3v,#QZ΋7d :v' A<0dS+hݱY.Bj+G Ci;c]X(c'6ہI z1*]n0KRD7=Q=~%AW/&.@x'b&pa>CdY(~ cmE3^j٢sI_ɑ*7kt{V[? Ō hHOX+R6j M3xQя:w[hat I&J8*B.h!rI_WjW#TU/VG>UۓžԗH\Wr 'M~g/S褯 <_w9ͽ/|b$m#[)`1ok8W}dndO2b'BXvEY A0rd@Bepۇ F\⾭vN:fٯUKEȹ %sR1x6pFtX;յ<~όhYԀc{ mXLxP * Ӻ>}V=L(wG*61MZlƭ.gNby#٠$ۆ7f|в@Fv F{2;1c`o]qǂe@ ']M@\HV"ˉ9_FjT?b'ߜS}ϙ8%.bfu3߽o'E 7k4ZLkTw= L`\Yv%]"Y`w،ygw/OWr80@N-\Edt_'Ҩ ;SJb+dB,"`8~/9R1ʂ-d"Z!Q.n0~TBh6(+`¥>}בk~%o' |-l.%3s-PifbH x+8! R DfFl4,S].2W) J dR"DtE*e8$c;qKubuNPCo!Vn]'HFT(UMpMuJl9-O61ט ["~ġu,Tɉ'2zoC;d71]7~єKY3cN%TC>u:jitRC˘XY STjw[fqInm7{ߊlJ|K > ePxV^?C6ty]< \jRI60U!ZKGZ^jC^e۳@u4;pSRF}Yuh( G FXtGOR+[KltW_?Š:`3_T!-MUg=YR JeT 2 Ngv3_Na޹)wv(S꛲w티Αξ"GY.ebkbros6&lޯ"E!7 C95HigOr뺈yJv+. 7Jen^a%{&dlGhEUPEؗWT V"]- P@ ܰY^b+#)7 Bԝ.4eݰV'9=VAbU 93xA1e 2%wt`0p%胫=Hڮz% ;a]6Kvo3H>cglg5 4/^FT``󤆫ve[Qٮ[,Cꗉ9&s2\ !3ȫdSU%sn`0No!S"c>REwߌ;|֘@@3NL?X65˰gqe(_  ˜N xyi4xB#O6F/ze1+8U 5続rjCG9ڲ})%P+yY$R6)^ZNIsO;_QnW˜ uaF9!3F>jjz4B)R8c)PʞWE? 1>S_y (6mgQ}-vu;yg%:"h}(41%'a%^G?|NTG+};r4\fc<#jS 7OstVC{=S:4}/:K;y~7lvU `1|jgZM:'"UFM {&/zUsYj7XaTXM1.xy :k{f3&)ޝۏ?rSd*Ը=&skܫ_ZYg})E$B+|x!,2P <͚YEFYiƙ,uR3^ab$(,i%M)()6|7wP։ QqPoIz%Emߋٮx9~E:&}t/ ùIw07pbK#iw|s-q}y=t&ؘJPv?…ϵGyϑ'UZ"\\Ej*6dž(*Wrg " MHS4 rlπyset,{ב@mMM󄁽usB9Qy^z p ا "7rZrBRHQ+K##ppPs%PCpbJsRnHZi8>\jQl5Ov~z֬<G<fC E=qԥ Qٖ&l!j/Շ)K[kmp7Q$2ʾI2Cج5xoAOTOǑp6XbӜg\v2X[h2'%cz/I<5=9 _+dXPJt>aN,=5 iS*gͯ JU w}RƤ$5Ts 5(ܢ졵.>8g- Vﶷ=/o #&g<)Y3ƺ<>3.Oe- ӯNy<*zcׂ&nPf' wLZ:-$wvff$p۸||57Z! 4xh y*^+nLk)0eӐhUUUUUQhJgS1E^rW_;ϻ3<[j.Ͽ!NAfoA<ծ 른oheL+%oixd5S5ys_z<(%G ly8K ч(Yܷ8l2T pRq.Z%`]oOp+Z;vc_hYITaoKۉk"L(wHMG䀐p5K4֧|5 дyb^%@BTV`\Y@Y_N=R?E AX*?%ތY:{뭖RO,'8δUUߐ$GY:KN "\,Ep PlOKt9F>a\`nc_'hhX+b ~=E H nBS5_Cϊ@̗AäG)6!JRz/rlciݾ^PPYe)PJ#ċ^ҩ~3u܌-x/W9~Jdd,yf[F^,q 1)'"QyM)o0 UϹDCiw4w%f8 0'){WW]"ؾ˹5azPq 9 y}Hv#3-nHW)SFw seAڱ{ }Sd M"# ĠYi-ۺ^P#M3tq7Q|-\8v Dc4!(:?أ{&+bMfc2+:v7Ƕ)7_ 6 4>B˷`k!Ԛָ9A K*4?.ᕦ'~q:-ArW0=dy*Cp S+ (p05z; 2Nj/KԼ$" 쑱!_Sꂧ}ϑ`EAkGpËivsb8d/QHkc7d8Ѷ"9/mseϥ7tHR)ҌX{h-hkzS#,7"KŏW5.v د[GO,Qf+@<)WlC[!'G/sC%p31Hc]Lؚ u=ҴMp8DYGwIdJK xx}kwOnN_C}Q` a~Am2&^ Vr|׃O|nR^q!~.^ {KF)`-IaKTK}aWOf4[d>DjeK.P<p=דi*R$uQX商Eۙv%0L]uJ7!I Qflu$g E ^"o)]t*YYr'%qi8e!͠FQ,s݈h6w#3?u~%tun^!pUIB 7]箦W+3$8vo(BenP?pP `~Ə&i3_uٌ]/$~UGz& 0M6ĢwQl- ʎyn_eWK2Fԫ>nL) NWބzJqWB0{,/ 'IPgvL=gs W?t%L!o6 V3xgB+C*K1hrފB0 78##.L۸z "IXB ;NJW84 [{V? tLCIr{njEf{Q y; 'Dr:_.wsOr$"J1 ɤeHW92Yݕ㐙GitZ9O0گ$5 $RCJD%~3pf:%ཊN]W3Hbvٵs&`"[.@P0XaK4%`JpUN6B,K{ɼkj^G@z?ՓLO #CV MA8Pr;H{(Q)% [ KFuj}pPݗacqQzsX=7J\ޗ[=8܂IoG˒A͗ʍ~WKP0avRRmyi]m=O,8QMVb tBd̅CzoޢZC]]Y7* 67XIFmk-IIo(*9x m͍L͠㐛b07_x2&yWP\VyϤ^mab=㼽c^Fl({lTCG6o'غɄYvi7o,P3نr\8=yye[m9'TBxQdzQz7 ٚl+rSÙTB23!ixR Y[Ecùv;+#Nt#?vB/Rk\~1BAnfϪYd!aei[O~3SlAOր[Wa[vU!KlƒTEWoG pb0ZoUf@@=q+d뤗y!@Iz "nohOiLӥEA'^T\#-#3)gp>vC Ҹ峵 ,F|D8UowGs Yl8Xc"˞@}v1)Kvq]aCC}ZoT :eRܫjw̡WV4.uitDU(4d'dN꣎zVO.7 R/̸&,{˩e`ߜjXtf[XSI 1Ź-vV:k&PKuӌ>Ȋ[a1CX$#5xx%q/)hrR׶1# LYLQIFRc{-G)<5`p{TX`jx & 7]+ǷՎC _NJQ`*NzS+s~9 GPN|n ]3F#skr'ۑd{_Q: ߙvRH5پ6m [0yڷJb[~:&{g2K,Sy0ś$bKMS\R$:7ȓU_!VfgO۱?(!t[1U > PPsw1tXNhUk:dLN]L<лYt@ɾ"y;`|\3!O,D&c4Rmxm:L(çc IDoyhɧOKYU'0E/WSVM_29CiZ@\nU@:3x|vZEiCԥ/#e'\{>a1Ghg\ Y 7̶;1]Zmh_5K[6lFBvI9{v'ѬmF4w4 /U2޺ޛ0O=@ܟVs?w$LEoZ|uHU*D'f;>~\[CYCeri)MIxmjT'~G-#bT9|'/axܼxT0i+6c"4|8t8ײ¢wehI2(Sq$ͦR)s@'Đ;`FO=B15gMKS, Ph*pɟ 륣VG|#Lט =Db73loa&A31j4K,w8Jn>Q\7?41 ?ieDb9^=ao'4dkȥS+2#Fh۝oR_ڌa'"'8Va qS};\A9͢G{8@uA7΋m#@qvxG Nf2Ӈ,|G}Fr WN-8jbO[V|b_J}rqWʮy5"B Wg"ǎ'/*<{1ST,U\ 4mer7AyE~7"0@K寙:BZVP-AUE!0-X` g%R04XL\:}@}[Eqg8?S`D Ɏa`<7D$DQVBw?>[|[SO06zKZ~Y{H}qm7Q6R F]Tڟi} d\D^EIoӡ|,6]kBopY7r<:$Ɗo1EZNHpYp.T&۪HGRLkF3Flѣ'GU T3tWT M4Q*̋¼cRs3 >*8.H}.ȧZ Lσ=R  l|SCvyqEqH8lGNe$'Ã[yp3{wN7NyT] F|z m!!Hڝ: |K%_2ދXU'9QڳࢹgCr${{ 䕍AQ)ߏF.S WH(QϦzU|pvgӠ:(?5zxkvϮ1C|8{a٧&5F+nc`]6Pd >'T-…[~ ?9N1R![nٵ)s(cinvt4TX?J:Hsg0w"m( ,JNUP uKn*3*|C")oMK\pqJ%Wr8[m^[Qy$N 5>&i~i6.ܣ_@QWг)ء!= Jk a'hpِ)JX+_7Ç3"|9iӯJ#liGSgN렚Ik7Mѩ=ھo`)?pv| a r`r=6T&6\%n(e}?J?@\<%Ozm4+⸞$q>:cmRJ ' 2*c ЗwvܽJ97^ar·tnBu1]b[m7{0G2ŎCw̴ϓgW 4%hOx)6shP lP1pՈ(. ;VNӲLXv7_V2l-d+ZWZ6%wʓӕ Xڝgk*uiwCxhy*gG|¤\ .Гb~ؾτ%V>}7.C*`auaq=`;kMRh|O,@ NC}T3̽vd%>YQX_С<^dMEO tÇR@D{eN*SgG3Whd^r RM| p1:zS|{]X1o{gZVu" ǁ}M6y9u@̳֒I\`q5=Ȟ T&1j!g9ܲO-KǏG-cxNgN ɱ)HM'ek;:Pzg?#FGd.q6tZQoM^[)=l-v KTj;/Ӳo[Wҋk䤿ԙ>FHVbRi 6ujh[0\!^ D_Zl绣- <$ _Ą2s:PsZpud0B@-S2[}%eGdH5IǸڭ"_.w Ǭ5]a:/z3=Z"y@9 _qqvh_~;GJ:Kwu''7.8yFȻYzC18 %eokiFԉ.(]yk##bd|@~n)%ky2oqW< 趃70g쪺&3N3)=?!#ߝz9nGJuXM =! c h?4RDx/Vp"`54 Br]sA107`AW15n ђ#/k@;曝$/' t*D ۓ3Ԩr֜C㦋"d`!&^, UT禠v%V^7jmm3 LI6# 8LuƵ% dhpiO*3U 5.iCV'{zp]r*>_S- {IϩelָUeº}RYiSӮP<& z;WP[ 8Ss$>5R~Q޹Dl`WBC*խ%K! zƅ)HGݱDQϙ-蘭QquQ"`/ȉ_0z Vt"@#hm(iv_>Y@ذY˴xZ93CGgd(|3[mߙǪ-K;LmP~mv=MXΟhVP yBG&C4h*&- &+lMVmw@vnƢ}:~Ud:(O`!^gb%"ڬ'c'̷T`< mRD;#:0mVL[ j]11w0i0 ^(4ɇSX0i9UɎ:.Q5[ ,R,3!,mE/B )T>>.LH(ВA`ȳѢI %2P355~ePCDܗքՌpP*Dԓ pzEVO0W4³S @jRloBHllho8-i 80Rd)%q{bK-'1zE&& =a)c8wj\"6n@Sh8@HAYy_ٟ+0WA}kgC3\raZ w+e=z*)yp8c B[v#QxGRe{'qP!AAdfTOI'% M5B@@Z<nbcY潯qa7 cXߪb!0EQ#[ ʉͽ%vf0WWJPpX뎚B#u] ׵e"bHC} O` 2l-."e2:o0i檆2#eQA~!V>N j] TD?rf~+qݓ b^$|dK&'pX8i{XIv;Ty@80(laԸKsTQ/|$LD:_XHBДoR OkjE K5VKO8Sf1K}ҝI})g kҦ_uQ)g$a9DUؾQ &NyќmmUYk]O4TrSR˙妀 dlkCs6*YB*}8Cf#Z2恇Ԯ lꭴ$k93: EXmW8IT 0V!m/͢P3ڵ<닦ͩZKtTY'3ayHUJ83W-+՗̿bɃA?֪"B|GUBGGQiM"~faHO<[STpyA8kڂE}/qKgv ;5In/ƞ,B OQ08^<um^']fVCei0j䏄躆IvR<-+ e.'@9wjoJ^ )߽NO**H/σ ~mą“hR]ٕ=5qr$sgUrW p޿Eπܒu,c5NXa$٨\!M/#7 e{\ɣ2R!r 5`!KsԄR h ;7̔ d4JȺ89W+XF&䗰4s@r0h\́o@+Gh;|' 5:d Y4JmfYGO%IV@=j<f$lby Y=3h2ŲZ7ÐF Lp`ynv%5BE*foZ";O:ٌq^?z.O[z*˾WFf܃):u˙kKO׻gzm qHs9:/ɶ4E؞{5'.1C+l倳5bjw|dƻTP[S Vͨw(✋'lEdt1$Ѓ¹;_us55Fw/Qv.8CKJI^_}/"y6:9AGu%e6E:0J }ѴykRC$YE *Lψr#MÇhQW%!J3´jټɶz*~OWZYjf,S0ͺiiN֒FnIr仕[ kyL&F>Sxg 8qrPB+P)P(61pk7u.]yh^4\Qw}.&GW0n%k#n"Aƶfpף4lTܹZLXrU5^ ivW*~6\ Gc]?lſ{lb?4W||czO;$-\ղ $e S^͓C0`T.a!@:s:Qx 4JHJ^͓C0`T.a!@:sz=()RPKp7IZ: 5"]2iܪ53J>Bx^byn7(&`+s4;\Wzf*2@k",%+d>I"QoQxl$`u+sF /MLTi7%Wb$Cn̄! ʃ4fa;ťTF߳%N:UUlG19BnR[(e-Ya_1u蓾SUv WPc"ExEAOI 65lDTK|({4~J'tF@(VcRK|gߛnVn,,P-bRw%`&60yOakF'3>iqeOyN@籠Mn3WBwOn}Gb!.JO';iBU 60NO4EbWb դ 8NIAH4}>J#jcRaJJ_4EbWb դ 7: p{r8,AFG88\8?qgl2NE} Jhg9 Ji2h7X.ݷۺ.cW֭;k0`l PNqnH}WwS1ٱzjcIgZMoWQI= ̓ $E[Y̆Yj$Ac"=/jb #C[f8p^tN6NٛG?{*)ػi"dD1!.9_yV]G\5H1U}U.T;amj6LS^oXK9FJP=>|'^li@sl4H\/ ,O*~a+ P9+YO9 Q ! དྷI3 DegTXG9䗝//;XxmT~-shǜ$ B ą "DH0iVuN|Be,&?S;'z~\!9hDDv}wR.X^[HˇTPa7hg}ez6h`s"t'g'<+dnj\ޮ{F:lb̰=^\А1ry[:l <Y0})[,Ӱ:\X3p{*ГE #EـOH(kD7hgw-Out] 2010-12-09 20:30ZCanvas 1Layer 1 libmapper/doc/0000755000175000017500000000000012423630127012566 5ustar tiagotiagolibmapper/doc/tutorials/0000755000175000017500000000000012423630127014614 5ustar tiagotiagolibmapper/doc/tutorials/tutorial_cpp.md0000644000175000017500000004747112423630127017660 0ustar tiagotiagoUsing libmapper and C++ ============ C++ bindings are supplied #include Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a few parameters the constructor: mapper::Device dev( const char *name, mapper.Admin admin ); mapper::Device dev( std::string name, mapper.Admin admin ); In regular usage only the first argument is needed. The optional "admin" parameter can be used to specify different networking parameters, such as specifying the name of the network interface to use. An example of creating a device: mapper::Device dev( "test" ); Polling the device ------------------ The device lifecycle looks like this, in terrible ASCII diagram art: creation --> poll --+--> destruction | | +--<--+ In other words, after a device is created, it must be continuously polled during its lifetime. The polling is necessary for several reasons: to respond to requests on the admin bus; to check for incoming signals; to update outgoing signals. Therefore even a device that does not have signals must be polled. The user program must organize to have a timer or idle handler which can poll the device often enough. Polling interval is not extremely sensitive, but should be at least 100 ms or less. The faster it is polled, the faster it can handle incoming and outgoing signals. The `poll()` function can be blocking or non-blocking, depending on how you want your application to behave. It takes an optional number of milliseconds during which it should do some work before returning: int dev.poll( int block_ms ); An example of calling it with non-blocking behaviour: dev.poll(); If your polling is in the middle of a processing function or in response to a GUI event for example, non-blocking behaviour is desired. On the other hand if you put it in the middle of a loop which reads incoming data at intervals or steps through a simulation for example, you can use `poll()` as your "sleep" function, so that it will react to network activity while waiting. It returns the number of messages handled, so optionally you could continue to call it until there are no more messages waiting. Of course, you should be careful doing that without limiting the time it will loop for, since if the incoming stream is fast enough you might never get anything else done! Note that an important difference between blocking and non-blocking polling is that during the blocking period, messages will be handled immediately as they are received. On the other hand, if you use your own sleep, messages will be queued up until you can call poll(); stated differently, it will "time-quantize" the message handling. This is not necessarily bad, but you should be aware of this effect. Since there is a delay before the device is completely initialized, it is sometimes useful to be able to determine this using `ready()`. Only when `dev.ready()` returns non-zero is it valid to use the device's name. Signals ======= Now that we know how to create a device, poll it, and free it, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- A signal requires a bit more information than a device, much of which is optional: * a name for the signal (must be unique within a devices inputs or outputs) * the signal's vector length * the signal's data type expressed as a character 'i', 'f', 'd' * the signal's unit (optional) * the signal's minimum value (optional) * the signal's maximum value (optional) for input signals there is an additional argument: * a function to be called when the signal is updated examples: mapper::Signal sig_in = dev.add_input( "/my_input", 1, 'f', "m/s", 0, 0, h ) int min[4] = {1,2,3,4}; int max[4] = {10,11,12,13}; mapper::Signal sig_out = dev.add_output( "/my_output", 4, 'i', 0, min, max ) The only _required_ parameters here are the signal "length", its name, and data type. Signals are assumed to be vectors of values, so for usual single-valued signals, a length of 1 should be specified. A signal name should start with "/", as this is how it is represented in the OSC address. (One will be added if you forget to do this.) Finally, supported types are currently 'i', 'f', or 'd' (specified as characters in C, not strings), for `int`, `float`, or `double` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion (from centimeters to inches for example). Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users. Notice that optional values are provided as `void*` pointers. This is because a signal can either be `int`, `float` or `double`, and your maximum and minimum values should correspond in type. So you should pass in a `int*`, `*float` or `*double` by taking the address of a local variable. Lastly, it is usually necessary to be informed when input signal values change. This is done by providing a function to be called whenever its value is modified by an incoming message. It is passed in the `handler` parameter, with context information to be passed to that function during callback in `user_data`. An example of creating a "barebones" `int` scalar output signal with no unit, minimum, or maximum information: mapper::Signal outputA = dev.add_output( "/outA", 1, 'i', 0, 0, 0 ); An example of a `float` signal where some more information is provided: float minimum = 0.0f; float maximum = 5.0f; mapper::Signal sensor1_voltage = mdev.add_output( "/sensor1", 1, 'f', "V", &minimum, &maximum ); So far we know how to create a device and to specify an output signal for it. To recap, let's review the code so far: mapper::Device dev( "test_sender"); mapper::Signal sensor1_voltage = dev( "/sensor1", 1, 'f', "V", &minimum, &maximum ); while ( !done ) { dev.poll( 50 ); ... do stuff ... ... update signals ... } It is possible to retrieve a device's inputs or outputs by name or by index at a later time using the functions `dev.input()` or `dev.output()` with either the signal name or index as an argument. The functions `dev.inputs()` and `dev.outputs()` return an object of type `mapper::Signal::Iterator` which can be used to retrieve all of the input/output signals belonging to a particular device: std::cout << "Signals belonging to " << dev.name() << std::endl; mapper::Signal::Iterator iter = dev.inputs().begin(); for (; iter != dev.inputs().end(); iter++) { std::cout << "input: " << (*iter).full_name() << std::endl; } Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on an network-enable ARM device and reading the ADC register directly, or it could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by the `update()` function: void sig.update( void *value, int count, mapper.Timetag timetag ); The `count` and `timetag` arguments can be ommited, and the `update()` function is overloaded to accept scalars, arrays, and vectors as appropriate for the datatype and lengthof the signal in question. In other words, if the signal is a 10-vector of `int`, then `value` should point to an array or vector of 10 `int`s. If it is a scalar `float`, it should be provided with a `float` variable. The `count` argument allows you to specify the number of value samples that are being updated - for now we will set this to 1. Lastly the `timetag` argument allows you to specify a time associated with the signal update. If your value update was generated locally, or if your program does not have access to upstream timing information (e.g., from a microcontroller sampling sensor values), you can omit the argument and libmapper will tag the update with the current time. So in the "sensor 1 voltage" example, assuming in "do stuff" we have some code which reads sensor 1's value into a float variable called `v1`, the loop becomes: while ( !done ) { dev.poll( 50 ); float v1 = read_sensor_1(); sensor1_voltage.update( v1 ); } This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now map this value to a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technqiue. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensors may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Now that we know how to create a sender, it would be useful to also know how to receive signals, so that we can create a sender-receiver pair to test out the provided mapping functionality. As mentioned above, the `add_input()` function takes an optional `handler` and `user_data`. This is a function that will be called whenever the value of that signal changes. To create a receiver for a synthesizer parameter "pulse width" (given as a ratio between 0 and 1), specify a handler when calling `add_input()`. We'll imagine there is some C++ synthesizer implemented as a class `Synthesizer` which has functions `setPulseWidth()` which sets the pulse width in a thread-safe manner, and `startAudioInBackground()` which sets up the audio thread. Create the handler function, which is fairly simple, void pulsewidth_handler ( mapper::Signal msig, int instance_id, void *value, int count, mapper::Timetag tt ) { Synthesizer *s = (Synthesizer*) msig.properties()->user_data; s->setPulseWidth( *(float*)v ); } First, the pointer to the `Synthesizer` instance is extracted from the `user_data` pointer, then it is dereferenced to set the pulse width according to the value pointed to by `v`. Then `main()` will look like, void main() { Synthesizer synth; synth.startAudioInBackground(); float min_pw = 0.0f; float max_pw = 1.0f; mapper::Device my_receiver( "test_receiver" ); mapper::Signal synth_pulsewidth = dev.add_input( "/synth/pulsewidth", 1, 'f', 0, &min_pw, &max_pw, pulsewidth_handler, &synth ); while ( !done ) dev.poll( 50 ); } Working with timetags ===================== _libmapper_ uses the `Timetag` data structure to store [NTP timestamps](http://en.wikipedia.org/wiki/Network_Time_Protocol#NTP_timestamps). For example, the handler function called when a signal update is received contains a `timetag` argument. This argument indicates the time at which the source signal was _sampled_ (in the case of sensor signals) or _generated_ (in the case of sequenced or algorithimically-generated signals). When updating output signals, using the function `update()` without a timetag argument will automatically label the outgoing signal update with the current time. In cases where the update should more properly be labeled with another time, this can be accomplished by including the timetag argument. This timestamp should only be overridden if your program has access to a more accurate measurement of the real time associated with the signal update, for example if you are writing a driver for an outboard sensor system that provides the sampling time. _libmapper_ also provides helper functions for getting the current device-time, setting the value of a `Timetag` from other representations, and comparing or copying timetags. Check the API documentation for more information. Working with signal instances ============================= _libmapper_ also provides support for signals with multiple _instances_, for example: * control parameters for polyphonic synthesizers; * touches tracked by a multitouch surface; * "blobs" identified by computer vision systems; * objects on a tabletop tangible user interface; * _temporal_ objects such as gestures or trajectories. The important qualities of signal instances in _libmapper_ are: * **instances are interchangeable**: if there are semantics attached to a specific instance it should be represented with separate signals instead. * **instances can be ephemeral**: signal instances can be dynamically created and destroyed. _libmapper_ will ensure that linked devices share a common understanding of the relatonships between instances when they are mapped. * **map once for all instances**: one mapping connection serves to map all of its instances. All signals possess one instance by default. If you would like to reserve more instances you can use: sig.reserve_instances( int num ) After reserving instances you can update a specific instance, for example: sig.update_instance( int instance_id, void *value, int count, Timetag timetag) All of the arguments except one should be familiar from the documentation of `update()` presented earlier. The `instance_id` argument does not have to be considered as an array index - it can be any integer that is convenient for labelling your instance. _libmapper_ will internally create a map from your id label to one of the preallocated instance structures. Receiving instances ------------------- You might have noticed earlier that the handler function called when a signal update is received has a argument called `instance_id`. Here is the function prototype again: void mapper_signal_update_handler(mapper::Signal msig, int instance_id, void *value, int count, mapper::Timetag tt); Under normal usage, this argument will have a value (0 <= n <= num_instances) and can be used as an array index. Remember that you will need to reserve instances for your input signal using `sig.reserve_instances()` if you want to receive instance updates. Instance Stealing ----------------- For handling cases in which the sender signal has more instances than the receiver signal, the _instance allocation mode_ can be set for an input signal to set an action to take in case all allocated instances are in use and a previously unseen instance id is received. Use the function: sig.set_instance_allocation_mode( instance_allocation_type mode ); The argument `mode` can have one of the following values: * `IN_UNDEFINED` Default value, in which no stealing of instances will occur; * `IN_STEAL_OLDEST` Release the oldest active instance and reallocate its resources to the new instance; * `IN_STEAL_NEWEST` Release the newest active instance and reallocate its resources to the new instance; If you want to use another method for determining which active instance to release (e.g. the sound with the lowest volume), you can create an `instance_event_handler` for the signal and write the method yourself: void my_handler(mapper::Signal msig, int instance_id, msig_instance_event_t event, mapper::Timetag tt) { // user code chooses which instance to release int id = choose_instance_to_release(msig); msig.release_instance(id, tt); } For this function to be called when instance stealing is necessary, we need to register it for `IN_OVERFLOW` events: msig.set_instance_event_callback( my_handler, IN_OVERFLOW, *user_context); Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata--information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to give a device X and Y information, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The property interface is through the functions, void dev.properties.set( , ); void sig.set_property( , ); The `` arguments can be a scalar, array or std::vector of type `int`, `float`, `double`, or `char*`. For example, to store a `float` indicating the X position of a device, you can call it like this: dev.set_property( "x", 12.5f ); sig.set_property( "sensingMethod", "resistive" ); In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: device_name, direction, length, max, min, name, type, unit, user_data; for devices, they are: host, port, name, user_data. By the way, if you query or set signal properties using these keywords, you will get or modify the same information that is available directly from the `mapper::DeviceProps` data structure. Therefore this can provide a unified string-based method for accessing any signal property: mapper::SignalProps props = sig.properties(); mapper::Property = props.get("sensingMethod"); Primarily this is an interface meant for network monitors, but may come in useful for an application implementing a device. libmapper/doc/tutorials/tutorial_maxmsp_central.md0000644000175000017500000002653312423630127022107 0ustar tiagotiagoGetting started =============== Note: this tutorial will introduce the original bindings for MaxMSP (before July 2013). You can access the tutorial for the revised multi-object bindings [here](./maxmsp_multiobj.html). To start using the _libmapper_ with MaxMSP you will need to: * Install _libmapper_ for your platform (Linux, OSX, Windows) * Download the `[mapper]` external object from our [downloads page](../downloads.html). Alternatively, you can build the object from [source](http://github.com/malloch/mapper-max-pd) instead. * Download a [graphical user interface](../downloads.html#GUIs) for creating and editing mapping connections. Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a device name to the `[mapper]` object using the property `@alias`. There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. If no name is given libmapper will choose a name for your device starting with the string "maxmsp". If desired, a device definition file can be specified with the property `@definition` or `@def`, which the external will use to add signals to your device. Otherwise, you device will start with no inputs or outputs and you will need to add them using messages. In this tutorial, we will assume that you do not have a prepared device definition file. A third optional parameter of the `[mapper]` object is a network interface name. By default, libmapper will try to guess which network interface to use for mapping, defaulting to the local loopback interface ethernet or wifi is not available. You can force the object to use a particular interface by using the `@interface` property. An example of creating a device: ![Creating a device.](./images/maxmsp_central1.png) Once the object has initialized, it will output its metadata from the right outlet: * The complete device name, including an appended ordinal for distinguishing between multiple active devices with the same name. * The IP address and port in use by the object. * The number of input and output signals associated with the object. * The network interface in use by the object. Signals ======= Now that we have created a device, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- Creating a signal requires two pieces of information: * a name for the signal (must be unique within a devices inputs or outputs) * the signal's data type expressed as a character 'i' for `integer`, 'f' for `float` Additional signal properties can also (optionally) be added: * the signal's vector length * the signal's unit * the signal's minimum value * the signal's maximum value examples: ![Adding signals to a device](./images/maxmsp_central2.png) The only _required_ parameters here are the signal name, and data type. If no `length` property is provided, the signal is assumed to have length 1. A signal name should start with "/", as this is how it is represented in the OSC address. (One will be added if you forget to do this.) Finally, supported types are currently 'i' or 'f' for `int` or `float` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion. (Centimeters to inches for example.) Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users. An example of creating a "barebones" `int` scalar output signal with no unit, minimum, or maximum information: ![Adding a simple integer output signal](./images/maxmsp_central3.png) An example of a `float` signal where some more information is provided: ![Adding a floating-point output signal with some optional properties](./images/maxmsp_central4.png) So far we know how to create a device and to specify an output signal for it. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by passing messages to the `[mapper]` object starting with the signal name: ( ) | So in the "sensor 1 voltage" example, assuming that we have some code which reads sensor 1's value into a float variable in `[p read_sensor]`, the patch becomes: ![Updating a signal](./images/maxmsp_central5.png) This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now be used to create a mapping between this value and a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technique. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensor data may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Receiving signals is even easier: after adding an input using the `add input` message, updates for this signal will be routed to the left output of the `[mapper]` object. Let's try making two devices in the same patch for testing. ![Sending and receiving signal updates](./images/maxmsp_central6.png) If you use your mapping GUI to create a link between the two devices _sender_ and _receiver_ and a connection between your two signals _/sendsig_ and _/recvsig_, any change made to the float value on the left will cause a corresponding output on the right. Congratulations - you have created your first mapping connection! This probably seems quite simplistic, since you could have made a patch-cord between the two float objects and accomplished the same thing, but your "mapping" represents something more: * It can be edited remotely from another machine on the network. * It can connect signals on different computers. * It can connect different signals implemented in different programming languages such as C, C++, Python, Java, and SuperCollider. * It can be edited to provide signal processing, including automatic linear scaling, calibration, muting, clipping, or an arbitrary expression - even FIR and IIR filters. Learn mode ---------- For patches with only outputs, lazy users can also declare the signals automatically using `learn` mode. You can either send the message "learn 1" to turn on learning ("learn 0" to turn it off) or you can instantiate your `[mapper]` object with the learn property set as an argument: ![Enabling learn mode on a device](./images/maxmsp_central7.png) the object will watch its inlet for messages formatted as `/ value(s)` and add any unknown signals automatically. Signals added this way will not have associated minimum or maximum values, however, so it is usually recommended to add the signals explicitly using messages. Device definitions ------------------ If you wish, you can declare your libmapper signals using a device definition file instead of sending messages to the `[mapper]` object. This file should be correctly-formatted JSON with the following structure: { "device" : { "fileversion" : "dot-1", "name" : "tester", "inputs" : [ { "name" : "/in1", "type" : "f" } ], "outputs" : [ { "name" : "/out1", "type" : "f", "units" : "cm", "minimum" : 4.0, "maximum" : 5.1 } ] } } To load your device definition, simply instantiate your `[mapper]` object with the file name as a property: ![Loading a device definition file](./images/maxmsp_central8.png) Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata--information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to label a device with its location, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The MaxMSP bindings for libmapper do not currently allow dynamically changing the properties of a device or signal, however they can be declared when the entity is created by using jitter-style property arguments For example, to store a `float` indicating the X position of a device `dev`, you could instantiate your object like this: ![Adding extra properties to a device](./images/maxmsp_central9.png) To specify a string property of a signal: ![Adding extra properties to a signal](./images/maxmsp_central10.png) In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: `device_name` `direction` `length` `max` `min` `name` `type` `unit` for devices, they are: `host` `port` `name`libmapper/doc/tutorials/tutorial_pure_data.md0000644000175000017500000002440112423630127021026 0ustar tiagotiagoGetting started =============== To start using the _libmapper_ with Pure Data you will need to: * Install _libmapper_ for your platform (Linux, OSX, Windows) * Download the `[mapper]` external object from our [downloads page](../downloads.html). Alternatively, you can build the object from [source](http://github.com/malloch/mapper-max-pd) instead. * Download a [graphical user interface](../downloads.html#GUIs) for creating and editing mapping connections. Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a device name to the `[mapper]` object using the property `@alias`. There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. If no name is given libmapper will choose a name for your device starting with the string "puredata". If desired, a device definition file can be specified with the property `@definition` or `@def`, which the external will use to add signals to your device. Otherwise, you device will start with no inputs or outputs and you will need to add them using messages. In this tutorial, we will assume that you do not have a prepared device definition file. A third optional parameter of the `[mapper]` object is a network interface name. By default, libmapper will try to guess which network interface to use for mapping, defaulting to the local loopback interface ethernet or wifi is not available. You can force the object to use a particular interface by using the `@interface` property. An example of creating a device: ![Creating a device.](./images/puredata1.png) Once the object has initialized, it will output its metadata from the right outlet: * The complete device name, including an appended ordinal for distinguishing between multiple active devices with the same name. * The IP address and port in use by the object. * The number of input and output signals associated with the object. * The network interface in use by the object. Signals ======= Now that we have created a device, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- Creating a signal requires two pieces of information: * a name for the signal (must be unique within a devices inputs or outputs) * the signal's data type expressed as a character 'i' for `integer`, 'f' for `float` Additional signal properties can also (optionally) be added: * the signal's vector length * the signal's unit * the signal's minimum value * the signal's maximum value examples: ![Adding signals to a device](./images/puredata2.png) The only _required_ parameters here are the signal name, and data type. If no `length` property is provided, the signal is assumed to have length 1. A signal name should start with "/", as this is how it is represented in the OSC address. (One will be added if you forget to do this.) Finally, supported types are currently 'i' or 'f' for `int` or `float` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion. (Centimeters to inches for example.) Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users. An example of creating a "barebones" `int` scalar output signal with no unit, minimum, or maximum information: ![Adding a simple integer output signal](./images/puredata3.png) An example of a `float` signal where some more information is provided: ![Adding a floating-point output signal with some optional properties](./images/puredata4.png) So far we know how to create a device and to specify an output signal for it. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by passing messages to the `[mapper]` object starting with the signal name: ( ) | So in the "sensor 1 voltage" example, assuming that we have some code which reads sensor 1's value into a float variable in `[p read_sensor]`, the patch becomes: ![Updating a signal](./images/puredata5.png) This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now be used to create a mapping between this value and a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technique. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensor data may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Receiving signals is even easier: after adding an input using the `add input` message, updates for this signal will be routed to the left output of the `[mapper]` object. Let's try making two devices in the same patch for testing. ![Sending and receiving signal updates](./images/puredata6.png) If you use your mapping GUI to create a link between the two devices _sender_ and _receiver_ and a connection between your two signals _/sendsig_ and _/recvsig_, any change made to the float value on the left will cause a corresponding output on the right. Congratulations - you have created your first mapping connection! This probably seems quite simplistic, since you could have made a patch-cord between the two float objects and accomplished the same thing, but your "mapping" represents something more: * It can be edited remotely from another machine on the network. * It can connect signals on different computers. * It can connect different signals implemented in different programming languages such as C, C++, Python, Java, and SuperCollider. * It can be edited to provide signal processing, including automatic linear scaling, calibration, muting, clipping, or an arbitrary expression - even FIR and IIR filters. Learn mode ---------- For patches with only outputs, lazy users can also declare the signals automatically using `learn` mode. You can either send the message "learn 1" to turn on learning ("learn 0" to turn it off) or you can instantiate your `[mapper]` object with the learn property set as an argument: ![Enabling learn mode on a device](./images/puredata7.png) the object will watch its inlet for messages formatted as `/ value(s)` and add any unknown signals automatically. Signals added this way will not have associated minimum or maximum values, however, so it is usually recommended to add the signals explicitly using messages. Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata--information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to label a device with its location, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The Pure Data bindings for libmapper do not currently allow dynamically changing the properties of a device or signal, however they can be declared when the entity is created by using jitter-style property arguments For example, to store a `float` indicating the X position of a device `dev`, you could instantiate your object like this: ![Adding extra properties to a device](./images/puredata8.png) To specify a string property of a signal: ![Adding extra properties to a signal](./images/puredata9.png) In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: `device_name` `direction` `length` `max` `min` `name` `type` `unit` for devices, they are: `host` `port` `name`libmapper/doc/tutorials/tutorial_python.md0000644000175000017500000004641212423630127020411 0ustar tiagotiagoGetting started =============== Since _libmapper_ uses GNU autoconf, getting started with the library is the same as any other library on Linux; use `./configure` and then `make` to compile it. You'll need `swig` available if you want to compile the Python bindings. On Mac OS X, we provide a precompiled Framework bundle for 32- and 64-bit Intel platforms, so using it with XCode should be a matter of including it in your project. Once you have libmapper installed, it can be imported into your program: import mapper Overview of the API organization ================================ The libmapper API is is divided into the following sections: * Signals * Devices * Admins * Device database * Signal database * Connections database * Links database * Monitors For this tutorial, the only sections to pay attention to are Devices and Signals. Admins is reserved for providing custom networking configurations, but in general you don't need to worry about it. Monitor and the various database modules are used to keep track of what devices, signals and connections are on the network. Devices do not need to worry about this. It is used mainly for creating user interfaces for mapping design and will also not be covered here. Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a device name to the constructor. There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. If no other arguments are given, libmapper will randomly choose a port to use for exchanging signal data. If desired, a second argument setting a specific "starting port" can be given, but the allocation algorithm will possibly choose another port number close to it if the port is in use. A third optional parameter of the constructor is an admin object. It is not necessary to provide this, but can be used to specify different networking parameters, such as specifying the name of the network interface to use. An example of creating a device: dev = mapper.device( "my_device" ) Polling the device ------------------ The device lifecycle looks like this, in terrible ASCII diagram art: creation --> poll --+--> destruction | | +--<--+ In other words, after a device is created, it must be continuously polled during its lifetime. The polling is necessary for several reasons: to respond to requests on the admin bus; to check for incoming signals; to update outgoing signals. Therefore even a device that does not have signals must be polled. The user program must organize to have a timer or idle handler which can poll the device often enough. The polling interval is not extremely sensitive, but should be 100 ms or less. The more often it is polled, the faster it can handle incoming and outgoing signals. The `poll` function can be blocking or non-blocking, depending on how you want your application to behave. It takes a number of milliseconds during which it should do some work, or 0 if it should check for any immediate actions and then return without waiting: int count = dev.poll( int block_ms ) An example of calling it with non-blocking behaviour: dev.poll( 0 ) If your polling is in the middle of a processing function or in response to a GUI event for example, non-blocking behaviour is desired. On the other hand if you put it in the middle of a loop which reads incoming data at intervals or steps through a simulation for example, you can use `poll()` as your "sleep" function, so that it will react to network activity while waiting. It returns the number of messages handled, so optionally you could continue to call it until there are no more messages waiting. Of course, you should be careful doing that without limiting the time it will loop for, since if the incoming stream is fast enough you might never get anything else done! Note that an important difference between blocking and non-blocking polling is that during the blocking period, messages will be handled immediately as they are received. On the other hand, if you use your own sleep, messages will be queued up until you can call `poll()`; stated differently, it will "time-quantize" the message handling. This is not necessarily bad, but you should be aware of this effect. Since there is a delay before the device is completely initialized, it is sometimes useful to be able to determine this using `ready()`. Only when `ready()` returns non-zero is it valid to use the device's name. Signals ======= Now that we know how to create a device and poll it, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- A signal requires a bit more information than a device, much of which is optional: * a name for the signal (must be unique within a devices inputs or outputs) * the signal's vector length * the signal's data type expressed as a character 'i', 'f', 'd' * the signal's unit (optional) * the signal's minimum value (optional) * the signal's maximum value (optional) for input signals there is an additional argument: * a function to be called when the signal is updated examples: sig_in = dev.add_input( "/my_input", 1, 'f', "m/s", -10, 10, h ) sig_out = dev.add_output( "/my_output", 4, 'i', None, 0, 1000 ) The only _required_ parameters here are the signal "length", its name, and data type. Signals are assumed to be vectors of values, so for usual single-valued signals, a length of 1 should be specified. A signal name should start with "/", as this is how it is represented in the OSC address. (One will be added if you forget to do this.) Finally, supported types are currently 'i' or 'f' for `int` or `float` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion. (Centimeters to inches for example.)^[Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users.] Lastly, it is usually necessary to be informed when input signal values change. This is done by providing a function to be called whenever its value is modified by an incoming message. It is passed in the `handler` parameter. An example of creating a "barebones" `int` scalar output signal with no unit, minimum, or maximum information: outA = dev.add_output( "/outA", 1, 'i', None, None, None ) or omitting some arguments: outA = dev.add_output( "/outA", 1, 'i' ) An example of a `float` signal where some more information is provided: sensor1_voltage = dev.add_output( "/sensor1", 1, 'f', "V", 0.0, 5.0 ) So far we know how to create a device and to specify an output signal for it. To recap, let's review the code so far: import mapper dev = mapper.device( "test_sender" ) sensor1_voltage = dev.add_output( "/sensor1", 1, 'f', "V", 0.0, 5.0 ) while 1: dev.poll( 50 ) ... do stuff ... ... update signals ... It is possible to retrieve a device's inputs or outputs by name or by index at a later time using the functions `get__by_`. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on an network-enabled ARM device and reading the ADC register directly, or it could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by the `update` function: .update( ) So in the "sensor 1 voltage" example, assuming in "do stuff" we have some code which reads sensor 1's value into a float variable called `v1`, the loop becomes: while 1: dev.poll( 50 ) v1 = read_sensor_1() sensor1_voltage.update( v1 ) This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now be used to create a mapping between this value and a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technique. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensor data may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Now that we know how to create a sender, it would be useful to also know how to receive signals, so that we can create a sender-receiver pair to test out the provided mapping functionality. As mentioned above, the `add_input` function takes an optional `handler`. This is a function that will be called whenever the value of that signal changes. To create a receiver for a synthesizer parameter "pulse width" (given as a ratio between 0 and 1), specify a handler when calling `add_input`. We'll imagine there is some python synthesizer implemented as a class `synthesizer` which has functions `setPulseWidth()` which sets the pulse width in a thread-safe manner, and `startAudioInBackground()` which sets up the audio thread. Let's use a real-world example using the [pyo DSP library for Python](http://code.google.com/p/pyo/) to create a simple synth consisting of one sine wave. For now, we will only worry about controlling one parameter: the frequency of the sine. We need to create a handler function for libmapper to update the pyo synth: def frequency_handler(sig, id, val, timetag): try: sine.setFreq( val ) except: print 'exception' print sig, val Then our program will look like this: from pyo import * import mapper # Some pyo stuff synth = Server().boot().start() sine = Sine( freq=200, mul=0.5 ).out() def freq_handler( sig, id, val, timetag ): try: sine.setFreq( val ) except: print 'exception' print sig, val dev = mapper.device( 'pyo_example' ) dev.add_input( '/freq', 1, 'f', 'Hz', 20, 2000, freq_handler ) while True: dev.poll( 100 ) synth.stop() Alternately, we can simplify our code by using a `lambda function` instead of a separate handler: from pyo import * import mapper # Some pyo stuff synth = Server().boot().start() sine = Sine( freq=200, mul=0.5 ).out() dev = mapper.device( 'pyo_example' ) dev.add_input( '/freq', 1, 'f', "Hz", 20, 2000, lambda s, i, f, t: sine.setFreq(f) ) while True: dev.poll( 100 ) synth.stop() Working with timetags ===================== _libmapper_ uses the `mapper_timetag_t` data structure internally to store [NTP timestamps](http://en.wikipedia.org/wiki/Network_Time_Protocol#NTP_timestamps), but this value is represented using the `double` type in the python bindings. For example, the handler function called when a signal update is received contains a `timetag` argument. This argument indicates the time at which the source signal was _sampled_ (in the case of sensor signals) or _generated_ (in the case of sequenced or algorithimically-generated signals). The `update` function for output signals is overloaded; calling the function without a timetag argument will automatically label the outgoing signal update with the current time. In cases where the update should more properly be labeled with another time, this can be accomplished by simply adding the timetag as a second argument. This timestamp should only be overridden if your program has access to a more accurate measurement of the real time associated with the signal update, for example if you are writing a driver for an outboard sensor system that provides the sampling time. _libmapper_ also provides helper functions for getting the current device-time: now = .now() Working with signal instances ============================= _libmapper_ also provides support for signals with multiple _instances_, for example: * control parameters for polyphonic synthesizers; * touches tracked by a multitouch surface; * "blobs" identified by computer vision systems; * objects on a tabletop tangible user interface; * _temporal_ objects such as gestures or trajectories. The important qualities of signal instances in _libmapper_ are: * **instances are interchangeable**: if there are semantics attached to a specific instance it should be represented with separate signals instead. * **instances can be ephemeral**: signal instances can be dynamically created and destroyed. _libmapper_ will ensure that linked devices share a common understanding of the relatonships between instances when they are mapped. * **map once for all instances**: one mapping connection serves to map all of its instances. All signals possess one instance by default. If you would like to reserve more instances you can use: .reserve_instances( int num ) After reserving instances you can update a specific instance: .update_instance( int instance_id, ) or .update_instance( int instance_id, , double timetag ) All of the arguments except one should be familiar from the documentation of `msig_update()` presented earlier. The `instance_id` argument does not have to be considered as an array index - it can be any integer that is convenient for labelling your instance. _libmapper_ will internally create a map from your id label to one of the preallocated instance structures. Receiving instances ------------------- You might have noticed earlier that the handler function called when a signal update is received has a argument called `id`. Here is the function prototype again: def frequency_handler( signal, id, value, timetag ): Under normal usage, the `id` argument will have a value (0 <= n <= num_instances) and can be used as an array index. Remember that you will need to reserve instances for your input signal using `.reserve_instances()` if you want to receive instance updates. Instance Stealing ----------------- For handling cases in which the sender signal has more instances than the receiver signal, the _instance allocation mode_ can be set for an input signal to set an action to take in case all allocated instances are in use and a previously unseen instance id is received. Use the function: .set_instance_allocation_mode( mapper_instance_allocation_type mode ); The argument `mode` can have one of the following values: * `mapper.IN_UNDEFINED` Default value, in which no stealing of instances will occur; * `mapper.IN_STEAL_OLDEST` Release the oldest active instance and reallocate its resources to the new instance; * `mapper.IN_STEAL_NEWEST` Release the newest active instance and reallocate its resources to the new instance; If you want to use another method for determining which active instance to release (e.g. the sound with the lowest volume), you can create an `instance_event_handler` for the signal and write the method yourself: def my_handler( sig, id, event, timetag ): # user code chooses which instance to release id = choose_instance_to_release( msig ) sig.release_instance( id, timetag ) For this function to be called when instance stealing is necessary, we need to register it for `mapper.IN_OVERFLOW` events: .set_instance_event_callback( my_handler, mapper.IN_OVERFLOW ) Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata--information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to label a device with its loation, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The property interface is through the functions, set_property( key, value ) where the value can any OSC-compatible type. This function can be called for devices or signals. For example, to store a `float` indicating the X position of a device `dev`, you can call it like this: dev.set_property( "x", 12.5 ) To specify a string property of a signal: sig.set_property( "sensingMethod", "resistive" ) In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: device_name, direction, length, max, min, name, type, unit, user_data for devices, they are: host, port, name, user_data By the way, if you query or set signal properties using these keywords, you will get or modify the same information that is available directly from the `signal` data structure. Therefore this can provide a unified string-based method for accessing any signal property: props = sig.get_properties() sensingMethod = props[ 'sensingMethod' ] Primarily this is an interface meant for network monitors, but may come in useful for an application implementing a device. libmapper/doc/tutorials/tutorial_c.md0000644000175000017500000006064412423630127017315 0ustar tiagotiagoGetting started =============== Since _libmapper_ uses GNU autoconf, getting started with the library is the same as any other library on Linux; use `./configure` and then `make` to compile it. You'll need `swig` available if you want to compile the Python bindings. On Mac OS X, we provide a precompiled Framework bundle for 32- and 64-bit Intel platforms, so using it with XCode should be a matter of including it in your project. // TODO: macports/fink/homebrew/etc Overview of the API organization ================================ If you take a look at the API documentation, there is a section called "modules". This is divided into the following sections: * Signals * Devices * Admins * Device database * Signal database * Connections database * Links database * Monitors For this tutorial, the only sections to pay attention to are Devices and Signals. Admins is reserved for providing custom networking configurations, but in general you don't need to worry about it. Monitor and the various database modules are used to keep track of what devices, signals and connections are on the network. Devices do not need to worry about this. It is used mainly for creating user interfaces for mapping design and will also not be covered here. Functions and types from each module are prefixed with `mapper__`, in order to avoid namespace clashing. However, since this is a bit verbose, it is shortened to `mdev_` and `msig_` for device and signal functions respectively. Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a few parameters to `mdev_new`: mapper_device mdev_new( const char *name_prefix, int initial_port, mapper_admin admin ); Every device on the network needs a name and port. In fact the requested name and port are only "starting values". There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. Similarly, each device gets a unique port to use for exchanging signal data. The provided port number is the "starting port", but the allocation algorithm will possibly choose another port number close to it if someone else on the network is already using it. We usually use a port number of 9000, and let the system decide if this is appropriate.^[Strictly this is only necessary for devices on the same computer, but port numbers are in abundance so we just allocate one per device to keep things consistent.] The third parameter of mdev_new is an optional admin instance. It is not necessary to provide this, but can be used to specify different networking parameters, such as specifying the name of the network interface to use. An example of creating a device: mapper_device my_device = mdev_new( "test", 9000, 0 ); Polling the device ------------------ The device lifecycle looks like this, in terrible ASCII diagram art: mdev_new -> mdev_poll +-> mdev_free | | +----<--+ In other words, after a device is created, it must be continuously polled during its lifetime, and then explicitly freed when it is no longer needed. The polling is necessary for several reasons: to respond to requests on the admin bus; to check for incoming signals; to update outgoing signals. Therefore even a device that does not have signals must be polled. The user program must organize to have a timer or idle handler which can poll the device often enough. Polling interval is not extremely sensitive, but should be at least 100 ms or less. The faster it is polled, the faster it can handle incoming and outgoing signals. The `mdev_poll` function can be blocking or non-blocking, depending on how you want your application to behave. It takes a number of milliseconds during which it should do some work, or 0 if it should check for any immediate actions and then return without waiting: int mdev_poll( mapper_device md, int block_ms ); An example of calling it with non-blocking behaviour: mdev_poll( my_device, 0 ); If your polling is in the middle of a processing function or in response to a GUI event for example, non-blocking behaviour is desired. On the other hand if you put it in the middle of a loop which reads incoming data at intervals or steps through a simulation for example, you can use `mdev_poll` as your "sleep" function, so that it will react to network activity while waiting. It returns the number of messages handled, so optionally you could continue to call it until there are no more messages waiting. Of course, you should be careful doing that without limiting the time it will loop for, since if the incoming stream is fast enough you might never get anything else done! Note that an important difference between blocking and non-blocking polling is that during the blocking period, messages will be handled immediately as they are received. On the other hand, if you use your own sleep, messages will be queued up until you can call poll(); stated differently, it will "time-quantize" the message handling. This is not necessarily bad, but you should be aware of this effect. Since there is a delay before the device is completely initialized, it is sometimes useful to be able to determine this using `mdev_ready`. Only when `mdev_ready` returns non-zero is it valid to use the device's name. Freeing the device ------------------ It is necessary to explicitly free the device at the end of your program. This not only frees memory, but also sends some messages to "politely" remove itself from the network. An example of freeing a device: mdev_free( my_device ); Signals ======= Now that we know how to create a device, poll it, and free it, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- A signal requires a bit more information than a device, much of which is optional: mapper_signal mdev_add_input( mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, mapper_signal_handler *handler, void *user_data ); mapper_signal mdev_add_output( mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum ); The only _required_ parameters here are the signal "length", its name, and data type. Signals are assumed to be vectors of values, so for usual single-valued signals, a length of 1 should be specified. A signal name should start with "/", as this is how it is represented in the OSC address. (One will be added if you forget to do this.) Finally, supported types are currently 'i' or 'f' (specified as characters in C, not strings), for `int` or `float` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion (from centimeters to inches for example). Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users. Notice that optional values are provided as `void*` pointers. This is because a signal can either be `float` or `int`, and your maximum and minimum values should correspond in type. So you should pass in a `float*` or `int*` by taking the address of a local variable. Lastly, it is usually necessary to be informed when input signal values change. This is done by providing a function to be called whenever its value is modified by an incoming message. It is passed in the `handler` parameter, with context information to be passed to that function during callback in `user_data`. An example of creating a "barebones" `int` scalar output signal with no unit, minimum, or maximum information: mapper_signal outputA = mdev_add_output( dev, "/outA", 1, 'i', 0, 0, 0 ); An example of a `float` signal where some more information is provided: float minimum = 0.0f; float maximum = 5.0f; mapper_signal sensor1_voltage = mdev_add_output( dev, "/sensor1", 1, 'f', "V", &minimum, &maximum ); So far we know how to create a device and to specify an output signal for it. To recap, let's review the code so far: mapper_device my_sender = mdev_new( "test_sender", 9000, 0 ); mapper_signal sensor1_voltage = mdev_add_output( my_sender, "/sensor1", 1, 'f', "V", &minimum, &maximum ); while ( !done ) { mdev_poll( my_sender, 50 ); ... do stuff ... ... update signals ... } mdev_free( my_sender ); Note that although you have a pointer to the mapper_signal structure, which was retuned by `mdev_add_output`, its memory is "owned" by the device. In other words, you should not worry about freeing its memory - this will happen automatically when the device is destroyed. It is possible to retrieve a device's inputs or outputs by name or by index at a later time using the functions `mdev_get__by_`. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on an network-enable ARM device and reading the ADC register directly, or it could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by the `msig_update` function: void msig_update( mapper_signal sig, void *value, int count, mapper_timetag_t timetag ); As you can see, a `void*` pointer must be provided. This must point to a data structure identified by the signal's `length` and `type`. In other words, if the signal is a 10-vector of `int`, then `value` should point to the first item in a C array of 10 `int`s. If it is a scalar `float`, it should be provided with the address of a `float` variable. The `count` argument allows you to specify the number of value samples that are being updated - for now we will set this to 1. Lastly the `timetag` argument allows you to specify a time associated with the signal update. If your value update was generated locally, or if your program does not have access to upstream timing information (e.g., from a microcontroller sampling sensor values), you can use the macro `MAPPER_NOW` and libmapper will tag the update with the current time. To simplify things even further, a short-hand is provided for scalar signals of particular types: void msig_update_int( mapper_signal sig, int value ); void msig_update_float( mapper_signal sig, float value ); So in the "sensor 1 voltage" example, assuming in "do stuff" we have some code which reads sensor 1's value into a float variable called `v1`, the loop becomes: while ( !done ) { mdev_poll( my_device, 50 ); float v1 = read_sensor_1(); msig_update_float( sensor1_voltage, v1 ); } This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now map this value to a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technqiue. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensors may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Now that we know how to create a sender, it would be useful to also know how to receive signals, so that we can create a sender-receiver pair to test out the provided mapping functionality. As mentioned above, the `mdev_add_input` function takes an optional `handler` and `user_data`. This is a function that will be called whenever the value of that signal changes. To create a receiver for a synthesizer parameter "pulse width" (given as a ratio between 0 and 1), specify a handler when calling `mdev_add_input`. We'll imagine there is some C++ synthesizer implemented as a class `Synthesizer` which has functions `setPulseWidth()` which sets the pulse width in a thread-safe manner, and `startAudioInBackground()` which sets up the audio thread. Create the handler function, which is fairly simple, void pulsewidth_handler ( mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *tt ) { Synthesizer *s = (Synthesizer*) props->user_data; s->setPulseWidth( *(float*)v ); } First, the pointer to the `Synthesizer` instance is extracted from the `user_data` pointer, then it is dereferenced to set the pulse width according to the value pointed to by `v`. Then `main()` will look like, void main() { Synthesizer synth; synth.startAudioInBackground(); float min_pw = 0.0f; float max_pw = 1.0f; mapper_device my_receiver = mdev_new( "test_receiver", 9000, 0 ); mapper_signal synth_pulsewidth = mdev_add_input( my_receiver, "/synth/pulsewidth", 1, 'f', 0, &min_pw, &max_pw, pulsewidth_handler, &synth ); while ( !done ) mdev_poll( my_receiver, 50 ); mdev_free( my_receiver ); } Working with timetags ===================== _libmapper_ uses the `mapper_timetag_t` data structure to store [NTP timestamps](http://en.wikipedia.org/wiki/Network_Time_Protocol#NTP_timestamps). For example, the handler function called when a signal update is received contains a `timetag` argument. This argument indicates the time at which the source signal was _sampled_ (in the case of sensor signals) or _generated_ (in the case of sequenced or algorithimically-generated signals). When updating output signals, using the functions `msig_update_int()` or `msig_update_float()` will automatically label the outgoing signal update with the current time. In cases where the update should more properly be labeled with another time, this can be accomplished with the function `msig_update()`. This timestamp should only be overridden if your program has access to a more accurate measurement of the real time associated with the signal update, for example if you are writing a driver for an outboard sensor system that provides the sampling time. Otherwise the constant `MAPPER_NOW` can be used as the timetag argument to cause libmapper to provide the current time. _libmapper_ also provides helper functions for getting the current device-time, setting the value of a `mapper_timetag_t` from other representations, and comparing or copying timetags. Check the API documentation for more information. Working with signal instances ============================= _libmapper_ also provides support for signals with multiple _instances_, for example: * control parameters for polyphonic synthesizers; * touches tracked by a multitouch surface; * "blobs" identified by computer vision systems; * objects on a tabletop tangible user interface; * _temporal_ objects such as gestures or trajectories. The important qualities of signal instances in _libmapper_ are: * **instances are interchangeable**: if there are semantics attached to a specific instance it should be represented with separate signals instead. * **instances can be ephemeral**: signal instances can be dynamically created and destroyed. _libmapper_ will ensure that linked devices share a common understanding of the relatonships between instances when they are mapped. * **map once for all instances**: one mapping connection serves to map all of its instances. All signals possess one instance by default. If you would like to reserve more instances you can use: msig_reserve_instances(mapper_signal sig, int num) After reserving instances you can update a specific instance: msig_update_instance(mapper_signal sig, int instance_id, void *value, int count, mapper_timetag_t timetag) All of the arguments except one should be familiar from the documentation of `msig_update()` presented earlier. The `instance_id` argument does not have to be considered as an array index - it can be any integer that is convenient for labelling your instance. _libmapper_ will internally create a map from your id label to one of the preallocated instance structures. Receiving instances ------------------- You might have noticed earlier that the handler function called when a signal update is received has a argument called `instance_id`. Here is the function prototype again: void mapper_signal_update_handler(mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *tt); Under normal usage, this argument will have a value (0 <= n <= num_instances) and can be used as an array index. Remember that you will need to reserve instances for your input signal using `msig_reserve_instance()` if you want to receive instance updates. Instance Stealing ----------------- For handling cases in which the sender signal has more instances than the receiver signal, the _instance allocation mode_ can be set for an input signal to set an action to take in case all allocated instances are in use and a previously unseen instance id is received. Use the function: void msig_set_instance_allocation_mode(mapper_signal sig, mapper_instance_allocation_type mode); The argument `mode` can have one of the following values: * `IN_UNDEFINED` Default value, in which no stealing of instances will occur; * `IN_STEAL_OLDEST` Release the oldest active instance and reallocate its resources to the new instance; * `IN_STEAL_NEWEST` Release the newest active instance and reallocate its resources to the new instance; If you want to use another method for determining which active instance to release (e.g. the sound with the lowest volume), you can create an `instance_event_handler` for the signal and write the method yourself: void my_handler(mapper_signal msig, mapper_db_signal props, int instance_id, msig_instance_event_t event, mapper_timetag_t *tt) { // user code chooses which instance to release int id = choose_instance_to_release(msig); msig_release_instance(msig, id, *tt); } For this function to be called when instance stealing is necessary, we need to register it for `IN_OVERFLOW` events: msig_set_instance_event_callback(msig, my_handler, IN_OVERFLOW, *user_context); Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata--information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to give a device X and Y information, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The property interface is through the functions, void mdev_set_property( mapper_device dev, const char *property, lo_type type, lo_arg *value ); void msig_set_property( mapper_signal sig, const char *property, lo_type type, lo_arg *value ); As you can see, _libmapper_ reuses the `lo_arg` union from the _liblo_ OSC library, which can be used to hold any OSC-compatible value. The type of the `value` argument is specified by `type`, and can be any `lo_type` value; floats are `'f'` or `LO_FLOAT`, 32-bit integers are `'i'` or `LO_INT32`, and strings are `'s'` or `LO_STRING`, but you should consult the _liblo_ documentation for more information. For example, to store a `float` indicating the X position of a device, you can call it like this: lo_arg x; x.f = 12.5; mdev_set_property( my_device, "x", 'f', &x ); In practice it is safe to cast to `lo_arg*`: float x = 12.5; mdev_set_property( my_device, "x", 'f', (lo_arg*)&x ); To specify strings, it is necessary to perform such a cast, since the `lo_arg*` you provide should actually point to the beginning of the string: char *sensingMethod = "resistive"; msig_set_property( sensor1, "sensingMethod", 's', (lo_arg*)sensingMethod ); In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: device_name, direction, length, max, min, name, type, unit, user_data; for devices, they are: host, port, name, user_data. By the way, if you query or set signal properties using these keywords, you will get or modify the same information that is available directly from the `mapper_db_signal` data structure. Therefore this can provide a unified string-based method for accessing any signal property: mapper_db_signal *props = msig_properties( sensor1 ); lo_type type; const lo_arg *value; mapper_db_signal_property_lookup( props, "sensingMethod", &type, &value ); Primarily this is an interface meant for network monitors, but may come in useful for an application implementing a device. libmapper/doc/tutorials/tutorial_introduction.md0000644000175000017500000000356612423630127021614 0ustar tiagotiagoIntroduction ============ These tutorials introduce new users to _libmapper_, providing steps to construct software programs that are compatible with the _libmapper_ network. A program typically implements a libmapper _device_, and declares _signals_, which can be inputs or outputs. After this, run-time _connections_ can be easily created and configured between running devices and signals. libmapper takes care of announcing and discovering available resources on the network, creating and maintaining connections between entities, and various other functions. Often, a device will possess only outputs (e.g. a program that gets information from a human input device like a joystick), or only inputs (e.g. a software-controlled synthesizer). For convenience, in these tutorials we will call devices with outputs "controllers", or "senders", and devices with inputs "synthesizers", or "receivers". This betrays the use case that was in mind when the _libmapper_ system was conceived, but of course receivers could just as well be programs that control motors, lights, or anything else that might need control information. Similarly, senders could easily be programs that generate trajectory data based on algorithmic composition, or whatever you can imagine. It is also possible to create devices which have inputs and outputs, and these can be mapped "in between" senders and receivers in order to perform some intermediate processing for example. However, this is a more advanced topic that won't be covered in this tutorial. Essentially, each device only needs to do a few things: - **start a libmapper "device"** - **add some signals** - **update any outputs periodically** - **poll the device to process incoming messages** Detailed tutorials are provided for using libmapper in the following programming languages and environments: - C - Python - Java - Max/MSP - Puredatalibmapper/doc/tutorials/tutorial_java.md0000644000175000017500000005123112423630127020004 0ustar tiagotiagoGetting started =============== Since _libmapper_ uses GNU autoconf, getting started with the library is the same as any other library on Linux; use `./configure` and then `make` to compile it. You'll need the `Java Developer Kit (JDK)` available if you want to compile the Java bindings. Once you have libmapper installed, it can be imported into your program: import Mapper.*; Overview of the API organization ================================ The libmapper API is is divided into the following sections: * Signals * Devices * Admins * Device database * Signal database * Connections database * Links database * Monitors For this tutorial, the only sections to pay attention to are **Devices** and **Signals**. Use of **Admins** is reserved for providing custom networking configurations, and in general you don't need to worry about it. **Monitors** and the various **database** modules are used to keep track of what devices, signals and connections are on the network. Devices do not need to worry about this. It is used mainly for creating user interfaces for mapping design and will also not be covered in this tutorial. Devices ======= Creating a device ----------------- To create a _libmapper_ device, it is necessary to provide a device name to the constructor. There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. If no other arguments are given, libmapper will randomly choose a port to use for exchanging signal data. If desired, a second argument setting a specific "starting port" can be given, but the allocation algorithm will possibly choose another port number close to it if the port is in use. A third optional parameter of the constructor is an admin object. It is not necessary to provide this, but can be used to specify different networking parameters, such as specifying the name of the network interface to use. An example of creating a device: final Mapper.Device dev = new Mapper.Device( "my_device" ); Polling the device ------------------ The device lifecycle looks like this, in terrible ASCII diagram art: creation --> poll --+--> destruction | | +--<--+ In other words, after a device is created, it must be continuously polled during its lifetime. The polling is necessary for several reasons: to respond to administrative messages; to check for incoming signals. Therefore even a device that does not have signals must be polled. The user program must organize to have a timer or idle handler which can poll the device often enough. The polling interval is not extremely sensitive, but should be 100 ms or less. The more often it is polled, the faster it can handle incoming and outgoing signals. The `poll()` function can be blocking or non-blocking, depending on how you want your application to behave. It takes a number of milliseconds during which it should do some work, or 0 if it should check for any immediate actions and then return without waiting: int count = dev.poll( int block_ms ); An example of calling it with non-blocking behaviour: dev.poll( 0 ); If your polling is in the middle of a processing function or in response to a GUI event for example, non-blocking behaviour is desired. On the other hand if you put it in the middle of a loop which reads incoming data at intervals or steps through a simulation for example, you can use `poll()` as your "sleep" function, so that it will react to network activity while waiting. It returns the number of messages handled, so optionally you could continue to call it until there are no more messages waiting. Of course, you should be careful doing that without limiting the time it will loop for, since if the incoming stream is fast enough you might never get anything else done! Note that an important difference between blocking and non-blocking polling is that during the blocking period, messages will be handled immediately as they are received. On the other hand, if you use your own sleep, messages will be queued up until you can call `poll()`; stated differently, it will "time-quantize" the message handling. This is not necessarily bad, but you should be aware of this effect. Since there is a delay before the device is completely initialized, it is sometimes useful to be able to determine this using `ready()`. Only when `ready()` returns non-zero is it valid to use the device's name. Signals ======= Now that we know how to create a device and poll it, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to update output signals. Creating a signal ----------------- A signal requires a bit more information than a device, much of which is optional: * a name for the signal (must be unique within a device's inputs or outputs) * the signal's vector length * the signal's data type expressed as a character 'i', 'f' or 'd' * the signal's unit (optional) * the signal's minimum value (optional) * the signal's maximum value (optional) for input signals there is an additional argument: * a function to be called when the signal is updated examples: Mapper.Device.Signal in = dev.addInput( "/my_input", 1, 'f', "m/s", new PropertyValue(-10.f), null, new InputListener() { public void onInput( Mapper.Device.Signal sig, int instanceID, float[] value, Mapper.TimeTag tt) { System.out.println("got input for signal "+sig.name); }}); Mapper.Device.Signal out = dev.addOutput( "/my_output", 4, 'i', null, 0, 1000 ) The only _required_ parameters here are the signal "length", its name, and data type. Signals are assumed to be vectors of values, so for usual single-valued signals, a length of 1 should be specified. Finally, supported types are currently 'i', 'f' or 'd' for `int`, `float` or `double` values, respectively. The other parameters are not strictly required, but the more information you provide, the more the mapper can do some things automatically. For example, if the `minimum` and `maximum` properties are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion. (Centimeters to inches for example.)^[Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users.] Lastly, it is usually necessary to be informed when input signal values change. This is done by providing a function to be called whenever its value is modified by an incoming message. It is passed in the `InputListener` parameter. An example of creating a "barebones" integer scalar output signal with no unit, minimum, or maximum information: Mapper.Device.Signal outA = dev.addOutput( "/outA", 1, 'i', null, null, null ); An example of a `float` signal where some more information is provided: Mapper.Device.Signal sensor1_voltage = dev.addOutput( "/sensor1", 1, 'f', "V", 0.0, 5.0 ) So far we know how to create a device and to specify an output signal for it. To recap, let's review the code so far: import Mapper.*; class test { public static void main() { final Mapper.Device dev = new Mapper.Device( "testDevice" ); Mapper.Device.Signal sensor1 = dev.addOutput( "sensor1", 1, 'f', "V", new PropertyValue( 0.f ), new PropertyValue( 5.f ) ); while ( 1 ) { dev.poll(50); ... do stuff ... ... update signals ... } } } It is possible to retrieve a device's inputs or outputs by name or by index at a later time using the functions `getInput()` and `getOutput()`, passing either the signal name or its index as an argument. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on an network-enabled ARM device and reading the ADC register directly, or it could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by the `update()` function: .update( ) So in the "sensor 1 voltage" example, assuming we have some code which reads sensor 1's value into a float variable called `v1`, the loop becomes: while ( 1 ) { dev.poll( 50 ); v1 = read_sensor_1(); sensor1.update( v1 ); } This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now be used to create a mapping between this value and a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage" – it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since end users can demand any mathematical operation be performed on the signal, they can perform whatever mappings between signals they wish. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technique. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensor data may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Now that we know how to create a sender, it would be useful to also know how to receive signals, so that we can create a sender-receiver pair to test out the provided mapping functionality. As mentioned above, the `add_input()` function takes an optional `InputListener`. This is a function that will be called whenever the value of that signal changes. To create a receiver for a synthesizer parameter "pulse width" (given as a ratio between 0 and 1), specify a handler when calling `add_input`. We'll imagine there is some Java synthesizer implemented as a class `Synthesizer` which has functions `setPulseWidth()` which sets the pulse width in a thread-safe manner, and `startAudioInBackground()` which sets up the audio thread. We need to create a handler function for libmapper to update the synth: InputListener freqHandler = new InputListener() { public void onInput( Mapper.Device.Signal sig, int instanceId, float[] value, TimeTag tt ) { setPulseWidth( value ); }} Then our program will look like this: import Mapper.*; # Some synth stuff startAudioInBackground(); InputListener freqHandler = new InputListener() { public void onInput( Mapper.Device.Signal sig, int instanceId, float[] value, Mapper.TimeTag tt ) { setPulseWidth( value ); }} final Mapper.Device dev = new Mapper.Device( "mySynth" ); Mapper.Device.Signal pw = dev.addInput( "pulseWidth", 1, 'f', "Hz", new PropertyValue( 0.f ), new PropertyValue( 1.f ), freqHandler ); while (1) { dev.poll( 100 ); } synth.stop() Alternately, we can declare the InputListener as part of the `addInput()` function: Mapper.Device.Signal pw = dev.addInput( "pulseWidth", 1, 'f', "Hz", new PropertyValue( 0.f ), new PropertyValue( 1.f ), new InputListener() { public void onInput( Mapper.Device.Signal sig, int instanceId, float[] value, Mapper.TimeTag tt ) { setPulseWidth( value ); }}); Working with timetags ===================== _libmapper_ uses the `TimeTag` class to store [NTP timestamps](http://en.wikipedia.org/wiki/Network_Time_Protocol#NTP_timestamps) associated with signal updates. For example, the handler function called when a signal update is received contains a `timetag` argument. This argument indicates the time at which the source signal was _sampled_ (in the case of sensor signals) or _generated_ (in the case of sequenced or algorithimically-generated signals). The signal `update()` function for output signals is overloaded; calling the function without a timetag argument will automatically label the outgoing signal update with the current time. In cases where the update should more properly be labeled with another time, this can be accomplished by simply adding the timetag as a second argument. This timestamp should only be overridden if your program has access to a more accurate measurement of the real time associated with the signal update, for example if you are writing a driver for an outboard sensor system that provides the sampling time. _libmapper_ also provides helper functions for getting the current device-time: Mapper.TimeTag now = .now(); Working with signal instances ============================= _libmapper_ also provides support for signals with multiple _instances_, for example: * control parameters for polyphonic synthesizers; * touches tracked by a multitouch surface; * "blobs" identified by computer vision systems; * objects on a tabletop tangible user interface; * _temporal_ objects such as gestures or trajectories. The important qualities of signal instances in _libmapper_ are: * **instances are interchangeable**: if there are semantics attached to a specific instance it should be represented with separate signals instead. * **instances can be ephemeral**: signal instances can be dynamically created and destroyed. _libmapper_ will ensure that linked devices share a common understanding of the relatonships between instances when they are mapped. * **map once for all instances**: one mapping connection serves to map all of its instances. All signals possess one instance by default. If you would like to reserve more instances you can use: .reserveInstances( int num ); After reserving instances you can update a specific instance: .updateInstance( int instanceId, ); or .updateInstance( int instanceId, , TimeTag tt ); All of the arguments except one should be familiar from the documentation of `update()` presented earlier. The `instanceId` argument does not have to be considered as an array index - it can be any integer that is convenient for labelling your instance. _libmapper_ will internally create a map from your id label to one of the preallocated instance structures. Receiving instances ------------------- You might have noticed earlier that the handler function called when a signal update is received has a argument called `instanceId`. Here again is the function prototype for a float signal: new InputListener( Mapper.Device.Signal sig, int instanceId, float[] value, Mapper.TimeTag tt ); Under normal usage, the `instanceId` argument will have a value (0 <= n <= numInstances) and can be used as an array index. Remember that you will need to reserve instances for your input signal using `.reserveInstances()` if you want to receive instance updates. Instance Stealing ----------------- For handling cases in which the sender signal has more instances than the receiver signal, the _instance allocation mode_ can be set for an input signal to set an action to take in case all allocated instances are in use and a previously unseen instance id is received. Use the function: .setInstanceAllocationMode( mode ); The argument `mode` can have one of the following values: * `Mapper.Signal.IN_UNDEFINED` Default value, in which no stealing of instances will occur; * `Mapper.Signal.IN_STEAL_OLDEST` Release the oldest active instance and reallocate its resources to the new instance; * `Mapper.Signal.IN_STEAL_NEWEST` Release the newest active instance and reallocate its resources to the new instance; If you want to use another method for determining which active instance to release (e.g. the sound with the lowest volume), you can create an `instanceEventListener` for the signal and write the method yourself: Mapper.instanceEventListener myHandler = new Mapper.instanceEventListener() { public void onEvent( Mapper.Device.Signal sig, int instanceId, int event, Mapper.TimeTag tt ) { int id = chooseInstanceToRelease( sig ); // user function sig.releaseInstance( id, tt ); } } For this function to be called when instance stealing is necessary, we need to register it for `Mapper.instanceEventListener.IN_OVERFLOW` events: .setInstanceEventCallback( myHandler, Mapper.instanceEventListener.IN_OVERFLOW ); Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata – information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to label a device with its location, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The property interface is through the functions, .setProperty( String key, PropertyValue value ); where the value can any OSC-compatible type. This function can be called for devices or signals. For example, to store a `float vector` indicating the 2D position of a device `dev`, you can call it like this: dev.setProperty( "position", new PropertyValue( new float[] { 12.5f, 40.f } ) ); To specify a string property of a signal `sig`: sig.setProperty( "sensingMethod", new PropertyValue( "resistive" ) ); In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: device_name, direction, length, max, maximum, min, minimum, name, type, unit, user_data, value for devices, they are: host, port, name, user_data By the way, if you query or set signal properties using these keywords, you will get or modify the same information that is available directly from the `signal` data structure. Therefore this can provide a unified string-based method for accessing any signal property: props = sig.properties(); sensingMethod = props.property( "sensingMethod" ); minimum = props.property( "min" ); Primarily this is an interface meant for network monitors, but may come in useful for an application implementing a device. libmapper/doc/tutorials/tutorial_maxmsp_multiobj.md0000644000175000017500000002373712423630127022307 0ustar tiagotiagoGetting started =============== Note: this tutorial will introduce the revised bindings for MaxMSP (July 2013). You can access the tutorial for the original bindings using the `[mapper]` object [here](./maxmsp_central.html). To start using the _libmapper_ with MaxMSP you will need to: * Install _libmapper_ for your platform (Linux, OSX, Windows) * Download the external objects from our [downloads page](../downloads.html). Alternatively, you can build the object from [source](http://github.com/malloch/mapper-max-pd) instead. * Download a [graphical user interface](../downloads.html#GUIs) for creating and editing mapping connections. Devices ======= Creating a device ----------------- To create a _libmapper_ device, create an object called `[map.device]` with an optional argument specifying the device's name. There is an initialization period after a device is created where a unique ordinal is chosen to append to the device name. This allows multiple devices with the same name to exist on the network. If no name is given libmapper will choose a name for your device starting with the string "maxmsp". Your device will start with no inputs or outputs, so it will not yet show up in most GUIs. You can also provide arbitrary properties to your device using jitter-style properties. By default, libmapper will try to guess which network interface to use for mapping, defaulting to the local loopback interface ethernet or wifi is not available. You can force the object to use a particular interface by using the `@interface` property. An example of creating a device: ![Creating a device.](./images/maxmsp_multiobj1.png) Once the object has initialized, it will output its metadata from its outlet: * The complete device name, including an appended ordinal for distinguishing between multiple active devices with the same name. * The IP address and port in use by the object. * The number of input and output signals associated with the object (none to start). * The network interface in use by the object. If and when this information changes, the object will output the updated property. Multiple devices ---------------- Once you have created a `[map.device]` object in a patcher, it considers itself to be the "parent" device for that patcher and all of its subpatchers. This means that it you try to create a second copy of the device in the same patcher, or in one of its child subpatchers, the object instantiation will fail. When the object is created, it checks whether there is a pre-existing device that would cause a conflict. You can, however, create multiple `[map.device]` objects in the same patch as long as they are both contained in different subpatchers. Signals ======= Now that we have created a device, we only need to know how to add signals in order to give our program some input/output functionality. We'll start with creating a "sender", so we will first talk about how to create and update output signals. Creating a signal ----------------- Creating input and output signals is accomplished with the `[map.in]` and `[map.out]` objects, which requires two pieces of information: * a name for the signal * the signal's data type expressed as a character 'i' for `integer`, 'f' for `float` A third optional integer argument sets the signal's vector length, if it is omitted the signal is assumed to have length 1. Additional signal properties can also (optionally) be added: * the signal's unit, e.g. `@unit Hz` * the signal's minimum value, e.g. `@min 0` * the signal's maximum value, e.g. `@max 100` examples: ![Adding signals to a device](./images/maxmsp_multiobj2.png) The only _required_ parameters here are the signal name and data type, but the more information you provide, the more the mapper can do some things automatically. For example, if `minimum` and `maximum` are provided, it will be possible to create linear-scaled connections very quickly. If `unit` is provided, the mapper will be able to similarly figure out a linear scaling based on unit conversion. (Centimeters to inches for example.) Currently automatic unit-based scaling is not a supported feature, but will be added in the future. You can take advantage of this future development by simply providing unit information whenever it is available. It is also helpful documentation for users. An example of a `float` signal where some more information is provided: ![Adding a floating-point output signal with some optional properties](./images/maxmsp_multiobj3.png) So far we know how to create a device and to specify an output signal for it. Updating signals ---------------- We can imagine the above program getting sensor information in a loop. It could be running on a computer and reading data from an Arduino over a USB serial port, or it could just be a mouse-controlled GUI slider. However it's getting the data, it must provide it to _libmapper_ so that it will be sent to other devices if that signal is mapped. This is accomplished by passing ints or floats to the `[map.out]` object. In the case of vector signals, a list with the same number of elements should be used. So in the "sensor 1 voltage" example, assuming that we have some code which reads sensor 1's value into a float variable in `[p read_sensor]`, the patch becomes: ![Updating a signal](./images/maxmsp_multiobj4.png) This is about all that is needed to expose sensor 1's voltage to the network as a mappable parameter. The _libmapper_ GUI can now be used to create a mapping between this value and a receiver, where it could control a synthesizer parameter or change the brightness of an LED, or whatever else you want to do. Signal conditioning ------------------- Most synthesizers of course will not know what to do with "voltage"--it is an electrical property that has nothing to do with sound or music. This is where _libmapper_ really becomes useful. Scaling or other signal conditioning can be taken care of _before_ exposing the signal, or it can be performed as part of the mapping. Since the end user can demand any mathematical operation be performed on the signal, he can perform whatever mappings between signals as he wishes. As a developer, it is therefore your job to provide information that will be useful to the end user. For example, if sensor 1 is a position sensor, instead of publishing "voltage", you could convert it to centimeters or meters based on the known dimensions of the sensor, and publish a "/sensor1/position" signal instead, providing the unit information as well. We call such signals "semantic", because they provide information with more meaning than a relatively uninformative value based on the electrical properties of the sensing technique. Some sensors can benefit from low-pass filtering or other measures to reduce noise. Some sensor data may need to be combined in order to derive physical meaning. What you choose to expose as outputs of your device is entirely application-dependent. You can even publish both "/sensor1/position" and "/sensor1/voltage" if desired, in order to expose both processed and raw data. Keep in mind that these will not take up significant processing time, and _zero_ network bandwidth, if they are not mapped. Receiving signals ----------------- Receiving signals is even easier: create a `[map.in]` object with a name and type, and updates for this signal will be routed to its outlet. The arguments for the `[map.in]` object are identical to `[map.out]`. Let's try making two devices in the same patch for testing. ![Sending and receiving signal updates](./images/maxmsp_multiobj5.png) If you use your mapping GUI to create a link between the two devices _sender_ and _receiver_ and a connection between your two signals _/sendsig_ and _/recvsig_, any change made to the float value on the left will cause a corresponding output on the right. Congratulations - you have created your first mapping connection! This probably seems quite simplistic, since you could have made a patch-cord between the two float objects and accomplished the same thing, but your "mapping" represents something more: * It can be edited remotely from another machine on the network. * It can connect signals on different computers. * It can connect different signals implemented in different programming languages such as C, C++, Python, Java, and SuperCollider. * It can be edited to provide signal processing, including automatic linear scaling, calibration, muting, clipping, or an arbitrary expression - even FIR and IIR filters. Publishing metadata =================== Things like device names, signal units, and ranges, are examples of metadata — information about the data you are exposing on the network. _libmapper_ also provides the ability to specify arbitrary extra metadata in the form of name-value pairs. These are not interpreted by _libmapper_ in any way, but can be retrieved over the network. This can be used for instance to label a device with its location, or to perhaps give a signal some property like "reliability", or some category like "light", "motor", "shaker", etc. Some GUI implementing a Monitor could then use this information to display information about the network in an intelligent manner. Any time there may be extra knowledge about a signal or device, it is a good idea to represent it by adding such properties, which can be of any OSC-compatible type. (So, numbers and strings, etc.) The MaxMSP bindings for libmapper do not currently allow dynamically changing the properties of a device or signal, however they can be declared when the entity is created by using jitter-style property arguments For example, to store a `float` indicating the X position of a device `dev`, you could instantiate your object like this: ![Adding extra properties to a device](./images/maxmsp_multiobj6.png) To specify a string property of a signal: ![Adding extra properties to a signal](./images/maxmsp_multiobj7.png) In general you can use any property name not already in use by the device or signal data structure. Reserved words for signals are: `device_name` `direction` `length` `name` `type` for devices, they are: `host` `port` `name`libmapper/doc/libmapper.doxyfile.in0000644000175000017500000017375712423630127016737 0ustar tiagotiago# Doxyfile 1.5.8 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PACKAGE_VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, # Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 4 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = YES # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../include/mapper ../src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NONE # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Options related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libmapper/doc/Makefile.in0000644000175000017500000003346012423630127014641 0ustar tiagotiago# 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 = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/libmapper.doxyfile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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 = libmapper.doxyfile 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 = 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) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ MAINTAINERCLEANFILES = Makefile.in CLEANFILES = doxygen-build.stamp DOX = libmapper.doxyfile EXTRA_DIST = expression_syntax.md how_to_compile_and_run.md windows.md \ tutorials/tutorial_c.md tutorials/tutorial_introduction.md \ tutorials/tutorial_maxmsp_central.md \ tutorials/tutorial_maxmsp_multiobj.md \ tutorials/tutorial_pure_data.md tutorials/tutorial_python.md \ tutorials/tutorial_java.md INSTIMAGES = html/doxygen.png DOC_STAMPS = html-build.stamp DOC_DIR = $(HTML_DIR) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libmapper.doxyfile: $(top_builddir)/config.status $(srcdir)/libmapper.doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 all-local 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: 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." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am distclean \ distclean-generic distclean-libtool distclean-local 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am all-local: doxygen-build.stamp doxygen-build.stamp: $(DOX) $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h \ $(top_srcdir)/include/mapper/*.h @echo '*** Running doxygen ***' doxygen $(DOX) touch doxygen-build.stamp clean-local: rm -f *~ *.bak $(DOC_STAMPS) || true if test -d html; then rm -fr html; fi if test -d latex; then rm -fr latex; fi if test -d man; then rm -fr man; fi distclean-local: clean rm -f *.stamp || true if test -d html; then rm -rf html; fi # 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: libmapper/doc/how_to_compile_and_run.md0000644000175000017500000003323412423630127017632 0ustar tiagotiago Building libmapper ================== This file documents the build process for libmapper for various operating systems, and will be updated as the libmapper core project progresses. Linux and OS X -------------- ### Dependencies libmapper currently depends on the SVN repository version of liblo. If you already have liblo's latest release (0.26) installed, we recommend uninstalling it. If this causes trouble due to other packages requiring it, installing SVN liblo to a local prefix may override it, but please be warned that this may complicate the build process. Please consult the [LibLo project page][liblo] for details. [liblo]: http://liblo.sourceforge.net The GNU configure step detects liblo using the "pkg-config" program. This is usually already installed in Linux systems, but on OS X, we recommend installing it via [MacPorts][ports] or [HomeBrew][brew]. In the future libmapper packages for MacPorts and HomeBrew will be directly provided, but this is not yet the case. [ports]: http://www.macports.org [brew]: http://mxcl.github.com/homebrew You may wish to manually check that the correct version of liblo is detected, by running, pkg-config --libs --cflags liblo If the path to liblo is not correct, please set up the `PKG_CONFIG_PATH` environment variable appropriately and try again. libmapper also has optional dependencies on the Java SDK as well as SWIG and Doxygen, for Java and Python bindings, and documentation, respectively. The Java SDK may be installed according to your standard operating system procedure, and you can check if it is already installed by running, javac -version javah -version These should print the installed version numbers of these programs if correctly configured. You may install `swig` and `doxygen` packages using your preferred package manager. The `examples` folder also contains an audio example, which binds to `libasound` on Linux, and CoreAudio on Mac OS X. On Ubuntu, you may wish to installed `libasound-dev` package, or the corresponding package on other Linux distributions. ### Configuring If you have extracted libmapper from a release tarball, run, ./configure to configure the software with default options. If you are using libmapper from a repository, you will need to run, ./autogen.sh which will create the `configure` script and run it for you. You can optionally specify an install location with, ./configure --prefix= It is recommended to either use `/usr/local/` or a directory in your home directory such as `$HOME/.local`. Users of HomeBrew on OS X should always use `/usr/local`. If you will be hacking on libmapper or which to have verbose output while it is running, we recommended enabling debug mode: ./configure --enable-debug Additionally, Java and Python bindings, and audio examples, may be disabled with options `--disable-jni`, `--disable-swig`, and `--disable-audio` respectively. After `configure` runs successfully, the configuration options will be printed for your confirmation. If anything unexpected occurs, be sure to check `config.log` for information about what failed. ### Building Once the build is configured, build it with, make Should any errors occur, please inform the libmapper mailing list. To verify that the library runs without errors, you may run the main test program, available in the test directory: cd test ./test Note that the programs in the test directory are _not_ examples of library usage, as they additionally test some internal functions in the library. Please see the `examples` directory for examples of how to use the library. ### Installing The software may be installed with, make install This should place headers in `/include/mapper-0`, the library in `/lib`, Python bindings in `/lib/pythonXX/site-packages` (where XX is your Python version), and a `pkg-config` information file in `/lib/pkgconfig`. Once installation is successful, you can check that the library is found by `pkg-config`: pkg-config --libs --cflags libmapper-0 Note that the Java bindings are not installed, as there is no standard location in which to put them. However, they can be copied to wherever is convenient for the classpath and java.library.path in your project. Instructions specific to Processing.org can be found in a dedicated section below. ### Testing As mentioned, you can test libmapper by running the test program, test/test This should create two devices, link them, connect their signals, and update a value continuously. The other device should report that it received the value. You may wish to observe the multicast "admin" traffic, which can be done by watching the multicast UDP port for OSC data using liblo's `oscdump` utility: oscdump 7570 224.0.1.3 You can also use a libmapper GUI, such as [webmapper][webmapper], to see that the devices and signals are discovered correctly. You can use the GUI to modify the connection properties, and observe that the received values are changed. [webmapper]: http://github.com/radarsat1/webmapper You should also test the Python and Java bindings, if you plan to use these. Some other programs, such as webmapper, may depend on them, so it is recommended to do so. To test that the Python module is working, it is generally enough to run the following command, python -m mapper This will import the `mapper` module, which will fail if either `mapper.py` or the native portion of the binding are not found. You may need to adjust your `PYTHONPATH` variable to ensure these can be found. You can test running programs by `cd`'ing to the `swig` folder and running, cd swig python test.py or, python tkgui.py for a GUI example which brings up a single, mappable slider. Running multiple copies of `tkgui.py`, you can try mapping one to another to make sure libmapper is functional. Similarly, the Java bindings may be tested by `cd`'ing to the `jni` folder and running `test` with the correct class and library paths: cd jni java -cp libmapper-0.jar -Djava.libraries.path=.libs test Windows ------- Since libmapper was developed on Unix-like systems (Linux and Apple's OS X), building libmapper uses GNU command-line tools. However, it is possible to build it for the Microsoft Windows operating system using the MingW cross-compiler under Linux, or by using MingW from Windows. Please see the file `windows.md` for instructions on how to set up your MingW environment and extra dependencies before compiling libmapper. Briefly, the secret sauce for compiling liblo and libmapper for Windows under an Ubuntu Linux environment is to install the `gcc-mingw32` package, and then provide the following arguments to `configure`: ./configure --host i586-mingw32msvc --prefix=$HOME/.win \ CFLAGS="-DWIN32 -D_WIN32_WINNT=0x501" \ LDFLAGS="-L$HOME/.win/lib" \ LIBS="-lws2_32 -liphlpapi -lpthread" For libmapper, also add the following flags: --disable-examples --disable-audio --disable-jni --disable-docs You should have a Windows version of Python installed, and specify the path to it in CFLAGS, if you want to build the Python bindings, otherwise also provide `--disable-swig`. Note that the above makes a local folder for the install location for Windows targets called `$HOME/.win`, which helps avoid mixing Windows and Linux binaries. LibLo requires that the ["win32" port of pthreads][pthreadwin32] is found in your prefix location, so you should compile and install that before proceeding. [pthreadwin32]: http://sourceware.org/pthreads-win32 Problems areas and topics ------------------------- Please remember that libmapper is still in a development and research phase. Although it is fairly robust at this point, since it is a distributed, asynchronous system there are many pieces involved, and supporting programs may have their own problems. As always, if you find a problem with libmapper or libmapper-enabled programs, please consult the [mailing list][list]. Here, we address some common issues that new users encounter with the core libmapper library. ### Architecture issues We have found that in some cases, especially on Mac OS X, there are programs that do not use the computer's native architecture. For example, Processing.org and Cycling 74's Max/MSP are 32-bit applications, even if you are running a 64-bit version of OS X. Therefore after building libmapper, it _will not work_ with these programs. We recommend that on OS X you build a universal binary. Although it is a pain to perform this extra step, we have found it saves a lot of trouble later on. Note that you must build universal binaries of liblo as well as libmapper. To do so, for both liblo and libmapper, you must perform the `configure` and `make` steps twice, with the following flags, copying the results to a temporary location, and then use the `lipo` utility to put them together into a universal binary: mkdir tmp ./configure CFLAGS='-arch i386' make cp src/.libs/libmapper-0.2.dylib tmp/libmapper-0.2-i386.dylib ./configure CFLAGS='-arch x86_64' make cp src/.libs/libmapper-0.2.dylib tmp/libmapper-0.2-x86_64.dylib lipo -create -output libmapper-0.2.dylib \ -arch i386 tmp/libmapper-0.2-i386.dylib \ -arch x86_64 tmp/libmapper-0.2-x86_64.dylib file libmapper-0.2.dylib The `file` command should list both 32- and 64-bit architectures. Then copy this dylib file to the install location: cp libmapper-0.2.dylib /lib/libmapper-0.2.dylib Although we do not explicitly list them here, similar steps should be performed for liblo, as well as for the native portions of the Java and Python bindings: file jni/.libs/libmapperjni-0.so.2.0.0 file swig/.libs/_mapper.so (Of course, replace "0.2" with the current libmapper version.) ### Processing.org Processing.org is a Java-based IDE and set of libraries for developing visualizations and interactive art. To use libmapper with Processing, you should place the JNI bindings into the appropriate locations. From the libmapper directory, create a directory called `libraries/libmapper/library` under your sketchbook directory: mkdir -p /libraries/libmapper/library Now copy the JNI bindings to this directory, renaming the jar file to match the name of the directory: cp jni/.libs/libmapperjni-0.so.2.0.0 /libraries/libmapper/library/libmapperjni-0.so cp jni/libmapper-0.jar /libraries/libmapper/library/libmapper.jar Create a file `export.txt`: echo 'name = libmapper' > "/libraries/libmapper/library/export.txt" Now, when you run the Processing IDE, you should see "libmapper" listed under "Sketch/Import Library...". Choosing this will insert two lines at the top of your sketch: import Mapper.*; import Mapper.Db.*; You can test it by creating a device and a signal: Device dev = new Device("testdevice", 9000); Device.Signal out_x = dev.add_output("x", 1, 'f', null, new Double(0), new Double(1)); and make sure to poll the device during `draw()`: void draw() { ... dev.poll(0); ... } Running this program should make a device called "testdevice" show up in a libmapper GUI. Use the steps in section "Testing", above, to check that the device is created correctly. We have noticed that Processing.org does not always free devices correctly after closing the canvas window. The Java test program uses the following trick to ensure a finalizer is run when the JVM exits, but it is not clear whether this is a good procedure for Processing.org: // This is how to ensure the device is freed when the program // exits, even on SIGINT. The Device must be declared "final". Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { dev.free(); } }); ### Network interface issues Since libmapper uses multicast instead of a central server, it must be made possible for all computers on the network to see the same multicast bus. A requirement is that they are on the same subnet, which usually means they are connected to the same router. It is possible to change the libmapper "TTL" settings, which expands the reachability of the network to multiple subnet hops, but this is considered an advanced usage scenario. One problem that is often encountered especially by laptop users is that multicast messages are sent to the wrong network interface. Since the multicast IP address does not uniquely identify a single network route, it is necessary for the software to specify the desired NIC to use. Selection of the NIC is supported by libmapper, but programs may not always provide an interface for this.^[Such programs are non-conforming! All libmapper programs should display the current network interface and allow selection of it from a list of the computer's interfaces, either by name or by assigned IP address.] Therefore one issue is especially prevalent, that computers may be connected to the internet via wireless (wifi), and connected to a router via a wired (ethernet) connection. We recommend that laptop users disable all but one interface while using libmapper. If this is unacceptable, the user is responsible for ensuring that libmapper programs are provided the correct NIC information. In the future a better approach may be needed. Two ideas are: * Always send multicast messages on all NICs. * Provide a global configuration file for libmapper specifying which NIC to use. Both of these solutions have their own complications, so if you have an opinion on this topic or a better idea, please post to the [libmapper mailing list][list]. [list]: http://groups.google.com/group/dot_mapper libmapper/doc/windows.md0000644000175000017500000000156012423630127014604 0ustar tiagotiagoNote: This is an on-going document to describe the set-up procedure for compiling libmapper under windows. It is not done yet, sorry. If you use Windows, please feel free to help. How to compile libmapper on Microsoft Windows ============================================= Since libmapper uses open source tools for its build system, the following instructions must be followed to set up a development environment on a Microsoft Windows operating system: Install MingW ------------- mingw-get-inst Install Python -------------- ### Download and install ### Set up distutils for mingw32 boodebr.org/main/python/build-windows-extensions distutils.cfg: [build] compiler = mingw32 Install autotools via mingw-get ------------------------------- Get pkg-config -------------- glib, pkg-config Get source for liblo and libmapper ---------------------------------- libmapper/doc/expression_syntax.md0000644000175000017500000001454712423630127016730 0ustar tiagotiagolibmapper Expression Syntax =========================== Connections between signals that are maintained by libmapper can be configured with optional signal processing in the form of an expression. General Syntax -------------- Expressions in libmapper must always be presented in the form `y = x`, where `x` refers to the updated source value and `y` is the computed value to be forwarded to the destination. Available Functions ------------------- ### Absolute value: * `y = abs(x)` — absolute value ### Exponential functions: * `y = exp(x)` — returns e raised to the given power * `y = exp2(x)` — returns 2 raised to the given power * `y = log(x)` — computes natural ( base e ) logarithm ( to base e ) * `y = log10(x)` — computes common ( base 10 ) logarithm * `y = log2(x)` – computes the binary ( base 2 ) logarithm * `y = logb(x)` — extracts exponent of the number ### Power functions: * `y = sqrt(x)` — square root * `y = cbrt(x)` — cubic root * `y = hypot(x, n)` — square root of the sum of the squares of two given numbers * `y = pow(x, n)` — raise a to the power b ### Trigonometric functions: * `y = sin(x)` — sine * `y = cos(x)` — cosine * `y = tan(x)` — tangent * `y = asin(x)` — arc sine * `y = acos(x)` — arc cosine * `y = atan(x)` — arc tangent * `y = atan2(x, n)` — arc tangent, using signs to determine quadrants ### Hyperbolic functions: * `y = sinh(x)` — hyperbolic sine * `y = cosh(x)` — hyperbolic cosine * `y = tanh(x)` — hyperbolic tangent ### Nearest integer floating point comparisons: * `y = floor(x)` — nearest integer not greater than the given value * `y = round(x)` — nearest integer, rounding away from zero in halfway cases * `y = ceil(x)` — nearest integer not less than the given value * `y = trunc(x)` — nearest integer not greater in magnitude than the given value ### Comparison functions: * `y = min(x, n)` – smaller of two values * `y = max(x, n)` – greater of two values ### Random number generation: * `y = uniform(x)` — uniform random distribution between 0 and the given value ### Conversion functions: * `y = midiToHz(x)` — convert MIDI note value to Hz * `y = hzToMidi(x)` — convert Hz value to MIDI note Vectors ======= Individual elements of variable values can be accessed using the notation `[]`. The index specifies the vector element, and obviously must be `>=0`. Expressions must match the vector lengths of the source and destination signals, and can be used to translate between signals with different vector lengths. ### Vector examples * `y = x[0]` — simple vector indexing * `y = x[1:2]` — specify a range within the vector * `y = [x[1], x[2], x[0]]` — rearranging ("swizzling") vector elements * `y[1] = x` — apply update to a specific element of the output * `y[0:2] = x` — apply update to elements `0-2` of the output vector * `[y[0], y[2]] = x` — apply update to output vector elements `y[0]` and `y[2]` but leave `y[1]` unchanged. ### Vector functions There are two special functions that operate across all elements of the vector: * `y = any(x)` — output `1` if **any** of the elements of `x` are non-zero, otherwise output `0` * `y = all(x)` — output `1` if **all** of the elements of `x` are non-zero, otherwise output `0` FIR and IIR Filters =================== Past samples of expression input and output can be accessed using the notation `{}`. The index specifies the history index in samples, and must be `<=0` for the input (with `0` representing the present input sample) and `<0` for the expression output ( i.e. it cannot be a value that has not been provided or computed yet ). Using only past samples of the expression *input* `x` we can create **Finite Impulse Response** ( FIR ) filters - here are some simple examples: * `y = x - x{-1}` — 2-sample derivative * `y = x + x{-1}` — 2-sample integral Using past samples of the expression *output* `y` we can create **Infinite Impulse Response** ( IIR ) filters - here are some simple examples: * `y = y{-1} * 0.9 + x * 0.1` — exponential moving average with current-sample-weight of `0.1` * `y = y{-1} + x - 1` — leaky integrator with a constant leak of `1` Of course the filter can contain references to past samples of both `x` and `y` - currently libmapper will reject expressions referring to sample delays `> 100`. Initializing filters -------------------- Past values of the filter output `y{-n}` can be set using additional sub-expressions, separated using commas: * `y = y{-1} + x`, `y{-1} = 100` Filter initialization takes place the first time the expression evaluator is called; after this point the initialization sub-expressions will not be evaluated. This means the filter could be initialized with the first sample of `x` for example: * `y = y{-1} + x`, `y{-1} = x * 2` A function could also be used for initialization: * `y = y{-1} + x`, `y{-1} = uniform(1000)` — initialize `y{-1}` to a random value Any past values that are not explicitly initialized are given the value `0`. User-Declared Variables ======================= Up to 8 additional variables can be declared as-needed in the expression. The variable names can be any string except for the reserved variable names `x` and `y` or the name of an existing function. The values of these variables are stored with the connection context and can be accessed in subsequent calls to the evaluator. In the following example, the user-defined variable `ema` is used to keep track of the `exponential moving average` of the input signal value `x`, *independent* of the output value `y` which is set to give the difference between the current sample and the moving average: * `ema = ema{-1} * 0.9 + x * 0.1`, `y = x - ema` Just like the output variable `y` we can initialize past values of user-defined variables before expression evaluation. **Initialization will always be performed first**, after which sub-expressions are evaluated **in the order they are written**. For example, the expression string `y=ema*2, ema=ema{-1}*0.9+x*0.1, ema{-1}=90` will be evaluated in the following order: 1. `ema{-1}=90` — initialize the past value of variable `ema` to `90` 2. `y=ema*2` — set output variable `y` to equal the **current** value of `ema` multiplied by `2`. The current value of `ema` is `0` since it has not yet been set. 3. `ema=ema{-1}*0.9+x*0.1` — set the current value of `ema` using current value of `x` and the past value of `ema` libmapper/doc/Makefile.am0000644000175000017500000000202612423630127014622 0ustar tiagotiago MAINTAINERCLEANFILES=Makefile.in CLEANFILES=doxygen-build.stamp DOX=libmapper.doxyfile EXTRA_DIST=expression_syntax.md how_to_compile_and_run.md windows.md \ tutorials/tutorial_c.md tutorials/tutorial_introduction.md \ tutorials/tutorial_maxmsp_central.md \ tutorials/tutorial_maxmsp_multiobj.md \ tutorials/tutorial_pure_data.md tutorials/tutorial_python.md \ tutorials/tutorial_java.md INSTIMAGES=html/doxygen.png DOC_STAMPS=html-build.stamp DOC_DIR=$(HTML_DIR) all-local: doxygen-build.stamp doxygen-build.stamp: $(DOX) $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h \ $(top_srcdir)/include/mapper/*.h @echo '*** Running doxygen ***' doxygen $(DOX) touch doxygen-build.stamp clean-local: rm -f *~ *.bak $(DOC_STAMPS) || true if test -d html; then rm -fr html; fi if test -d latex; then rm -fr latex; fi if test -d man; then rm -fr man; fi distclean-local: clean rm -f *.stamp || true if test -d html; then rm -rf html; fi libmapper/autogen.sh0000755000175000017500000000772712423630127014037 0ustar tiagotiago#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" DIE=0 (test -f $srcdir/configure.ac) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep -e "^AM_PROG_LIBTOOL" -e "^LT_INIT" $srcdir/configure.ac >/dev/null) && { (libtoolize --version) < /dev/null > /dev/null 2>&1 \ && LIBTOOLIZE=libtoolize || { (glibtoolize --version) < /dev/null > /dev/null 2>&1 \ && LIBTOOLIZE=glibtoolize || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } (git --version) < /dev/null > /dev/null 2>&1 || { NO_GIT=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -name configure.ac -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^AC_PROG_INTLTOOL" configure.ac >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep -e "^AM_PROG_LIBTOOL" -e "^LT_INIT" configure.ac >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." $LIBTOOLIZE --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep -e "^AM_CONFIG_HEADER" -e "^AC_CONFIG_HEADERS" configure.ac \ >/dev/null; then echo "Running autoheader..." autoheader fi if test -z "$NO_GIT" && git branch >/dev/null; then echo "Generating ChangeLog using git ..." git log >ChangeLog else echo "No git, generating stub ChangeLog ..." touch ChangeLog fi # Copy README.markdown for README to make automake happy if ! [ -e README ]; then ln -sv README.markdown README || cp README.markdown README fi # Copy NEWS.markdown for NEWS to make automake happy if ! [ -e NEWS ]; then ln -sv NEWS.markdown NEWS || cp NEWS.markdown NEWS fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags=--enable-maintainer-mode if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi libmapper/NEWS.markdown0000644000175000017500000001341712423630127014347 0ustar tiagotiago # libmapper NEWS Changes from 0.2 to 0.3 ----------------------- Released April 26, 2013. This is still a development release, and includes many API changes, improvements, and new features since 0.2. They are summarized very briefly here: * _Time._ libmapper now supports timetagging every signal update. With this we include the ability to bundle several signal updates together using "queues" which defer sending of updates. We also add an optional `rate` property to signals which can be used to represent regularly-sampled signals. This means that it is possible to support "blocks" of data where each sample does not have the overhead of an individual message header. The default behaviour, however, is still to send each signal update as an individual, time-stamped OSC message, assuming irregular updates. Software sampling sensors should be aware of how to distinguish between regularly- and irregularly-sampled signals and use the correct behaviour accordingly. At low samples rates, of course, the difference is not as important. * _Instances._ libmapper now supports the concept of mapping multiple "instances" of a signal over a single connection. This can be used for supporting interaction with multi-touch devices as well as for polyphonic musical instruments. A sophisticated "ID map" between instances created on a sender and instantiated on the receiver is automatically maintained, allowing the synchronization of behaviours between the two connection endpoints. Allocation of (possibly limited) resources to individual instances can be managed by a callback, which is called when new instances are created and old instances are destroyed. A complete treatment of this topic is not possible here, but will be documented in a forthcoming paper. * _Reverse connections._ A connection mode called `MO_REVERSE` has been added which can be used to establish signal from from output to input. The intention is to use this for training machine learning systems, allowing the construction of so-called example-based "implicit mapping" scenarios. `MO_REVERSE` of course does not invert the mapping expression, so is best-used for direct connections to an intermediate device that sits between a data source and destination. Single "snapshots" of output state can also be acquired by a query system, using `msig_query_remotes()`. * _Compatibility with select()._ It is now possible to get a list of file descriptors that libmapper reads from. This can be used as arguments to select() or poll() in a program that uses libmapper among other sockets or files to read from. * _Local link/connection callbacks._ Programs using libmapper can now know when a local device has been linked or connected by registering a callback for these events. Although it is not encouraged at this time, this can be used for example to implement data transport over alternative protocols, using libmapper only for determining the destination IP and agreeing on the connection details. In the future we plan to add support for alternative protocols within the libmapper framework, so that mapping expressions can still be used even when alternatives to OSC are used to send and receive data. * _Null values._ An important change that users should be aware of is that the signal callback (whose signature has changed) can now be called with the `value` pointer being zero. This indicates that the mapper signal is actually non-existant, i.e. no value is associated with the signal. That is to say that "null" is now considered a valid state for a signal and is different from, for example, a value of zero. User code can choose to ignore this case or to make use of it if there is a semantically relevant action to take. An example of this condition is if some signal does not have a valid value when some other signal is in a certain state, or for reverse connections, a null value might indicate that the output has not been set to anything yet. Local code can query the last-updated value of any signal using the `msig_value` function. The tutorial has also been translated for several supported language bindings: Python, and Max/MSP. Build documentation has also been added. As usual, this release is subject to API changes and breakage, however libmapper is starting to approach a more mature and stable state. Changes from 0.1 to 0.2 ----------------------- Released May 26, 2011. New features: - State queries from inputs to outputs. Allows for "learning" devices to know the state of their destinations. - Element-wise vector mapping. - Removal of misleading "mapper_signal_value_t" union. Replaced everywhere with void*. - Allow setting the multicasting interface. - Launcher to allow multiple copies of Python Slider example on OS X. - SWIG/Python "monitor" and "db" bindings. - JNI/Java bindings for "device" and "signal". - Representation of "null" signal values. (Signals are "off", or value is "unknown".) - Windows support. - Functions "midiToHz" and "hzToMidi". - API stubs for timetag support. Not yet implemented. Bug fixes: - Crash on uninitialized expressions. - Set device name property of existing signals after initialization. - Add input signal handlers added after initialization. - Small memory leak in mdev_add_input. - Remove liblo server method when signal is removed. - Set the multicasting interface to loopback as last resort, making it work on Linux if not connected to network. - Fix erroneous calculation of blocking time in mapper_monitor_poll. - Crash when non-existant signal receives /disconnect. Initial release 0.1 ------------------- Released Dec. 10, 2010. libmapper/ltmain.sh0000644000175000017500000105203012423630127013642 0ustar tiagotiago # 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.10 # 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.10" 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 libmapper/libmapper.pc.in0000644000175000017500000000044312423630127014726 0ustar tiagotiagoprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libmapper Description: A library for mapping controllers and synthesizers. Requires: @LIBLO@ Version: @VERSION@ Libs: -L${libdir} -lmapper-@MAJOR_VERSION@ Cflags: -I${includedir}/mapper-@MAJOR_VERSION@ libmapper/ChangeLog0000644000175000017500000136027312423630127013607 0ustar tiagotiagocommit d986501f03ebcc9b8884d6222ebc06c77e0dbe4e Author: Joseph Malloch Date: Wed Oct 22 16:16:09 2014 +0200 Fixed some doxygen warnings. commit 2ffe49a2931cc917db83441fceb58f6d22032c69 Author: Joseph Malloch Date: Fri Oct 10 15:13:58 2014 +0200 Added functions for adding multi-instance signals. commit 364971e6271d060af6e2f97a554c727f725179fe Author: Joseph Malloch Date: Tue Sep 23 19:40:45 2014 +0200 Fix removal of signals in testsignals program. commit 9825ec60040c780e377bf9d5ede656bae5c23d2b Author: Joseph Malloch Date: Tue Sep 23 19:18:18 2014 +0200 Simplify signal handler somewhat, since instance release messages cannot be embedded in multi-count messages. commit 8f29488d8b741f333894d349b0d1b20c9a158cac Author: Joseph Malloch Date: Tue Sep 23 19:17:10 2014 +0200 Fix expected values in testdb. commit 0b136e47454b7d06b504bcfdac068750dacb91f8 Author: Joseph Malloch Date: Tue Sep 23 19:16:35 2014 +0200 Monitor: prevent addition of duplicate subscriptions. commit 14a695f56f7d8c24537df82f205f385b44ec89e6 Author: Joseph Malloch Date: Tue Sep 23 19:15:57 2014 +0200 Free lib_version string when removing devices. commit 5d5a033531728f101c350afa3bb41bc43adaf32e Author: Joseph Malloch Date: Tue Sep 2 14:51:31 2014 +0200 Add header to jni makefile. commit 5299db7a7602016d4986959136fee646e9509849 Author: Joseph Malloch Date: Tue Sep 2 14:38:51 2014 +0200 Java: updated monitor flag values. commit 1f2fb18cf537face645089bf6f095338c1ea69aa Author: Joseph Malloch Date: Tue Sep 2 14:30:55 2014 +0200 Updated README. commit 9cc1f01bcf16995ea2495f92efefb29ee8ea8418 Author: Joseph Malloch Date: Sat Aug 30 17:38:29 2014 +0200 Update expression syntax in testinstance program. commit c5ee99fc380d0eaf4bfddd446c31a30cf07410a2 Author: Joseph Malloch Date: Sat Aug 30 17:37:42 2014 +0200 C++ bindings: overload device.remove_input/output functions. commit 6ac443707722d86c030df2cc15ec439e87b87516 Author: Joseph Malloch Date: Sat Aug 30 17:36:17 2014 +0200 C++ bindings: handle property queries with null results. commit 9f60ed91c210eaca073bfcca752a7005d4567aad Author: Joseph Malloch Date: Fri Aug 29 15:14:28 2014 +0200 Always use internal count of scopes. commit ef99c97702beee2da087c6f8fea470421e3f52d0 Author: Joseph Malloch Date: Fri Aug 29 15:08:13 2014 +0200 Add .DS_Store files to gitignore. commit 151353988dc59e161244b5e5390ba1b4df1d0ed5 Author: Joseph Malloch Date: Fri Aug 29 15:14:08 2014 +0200 Add unknown devices to db when link or connection received - required for later free(). commit 23b0ffdba4778389539d4332ada6931167c936c6 Author: Joseph Malloch Date: Fri Aug 29 15:13:02 2014 +0200 Clean up output of mapper_db_dump() commit 6e0d5085fe97f8a786230aed4f21a5772e9bb7b6 Author: Joseph Malloch Date: Sat Aug 23 17:59:16 2014 +0200 Removed unused function. Conflicts: src/connection.c commit 375587e0d96f4170c985b860018478c114e46763 Author: Joseph Malloch Date: Tue Sep 23 15:07:30 2014 +0200 Allow setting num_iterations in testparser. commit cfdd31b4b751c8b93d2474f0ef6d42b146d55ca8 Author: Joseph Malloch Date: Tue Sep 23 15:07:02 2014 +0200 Fixed memory errors found during Valgrind profiling. commit a890903f18d68f4c240b8dc5b3cff63743222b90 Author: Joseph Malloch Date: Sat Aug 30 19:20:21 2014 +0200 Fixed implementation of FORCE_ADMIN_TO_BUS flag. commit 0f617011e02e3bb36c4cb946f8a4d30af9a030a0 Author: Joseph Malloch Date: Mon Aug 25 15:41:33 2014 +0200 Monitor: Ensure only one device callback is registered when changing autosubscription flags. commit 5d33efeea8efa714dea65685ee8dfa0b7b1c091a Author: Joseph Malloch Date: Mon Aug 25 15:40:31 2014 +0200 Monitor: Request devices to kick things off if autosubscribe is enabled. commit aed16444bccebbaa918bca98fd37213d45646de8 Author: Joseph Malloch Date: Mon Aug 25 15:39:47 2014 +0200 Fixed potential crash in several message handlers where mdev_name() was assumed to return valid value. commit 25692ac34859bbe290d6d961562c5cb9cc0203c3 Author: Joseph Malloch Date: Mon Aug 25 15:38:47 2014 +0200 Don't edit name string in logout handler before checking if routers/receivers match. commit aedc46ea21f13b385317b15d8d6b614510793243 Author: Joseph Malloch Date: Mon Aug 25 15:37:40 2014 +0200 Don't send subscribe message in response to hash-only /sync message. commit 4368bed90e8f56f80615c45cc335462b18e12010 Author: Joseph Malloch Date: Mon Aug 25 15:36:18 2014 +0200 Disable device link timeouts for now until session recovery daemon is ready. commit 1c5a33717d31946dd2698384912aeaee53bd2b01 Author: Joseph Malloch Date: Mon Aug 25 15:31:40 2014 +0200 Added option for forcing admin traffic to use the multicast bus for easier debugging. commit 2d780d000fe93ae4ce2a23309550ab3683461df2 Author: Joseph Malloch Date: Mon Aug 25 15:29:32 2014 +0200 Add lib_version to retrievable device properties. commit a86762c8f23232e1ddbfac12c90c68104c3a537b Author: Joseph Malloch Date: Sun Aug 24 15:03:41 2014 +0200 Swig/Python: wait for links to be established before connecting in tests. commit a79c83038b1d4b688818591f4b6f7e1096c06037 Merge: 619c0cb 8db662c Author: Joseph Malloch Date: Sun Aug 24 11:35:39 2014 +0200 Merge branch 'output-vector-indexing' Conflicts: src/device.c src/router.c commit 619c0cb60432bfb86316556971a72e5dc324d1fc Author: Joseph Malloch Date: Sat Aug 23 18:43:44 2014 +0200 Fixed alphabetization bug in db device props, switched to using 'num' instead of 'n' throughout for clarity. commit 8db662c5f7372574a94a648e568205adc9f1d77b Merge: 6c2010a 48abbe4 Author: Joseph Malloch Date: Sat Aug 23 11:49:56 2014 +0200 Merge branch 'master' into output-vector-indexing commit 48abbe4c64a9269e16d7dc372ee0002a52249043 Author: Joseph Malloch Date: Sat Aug 23 11:18:29 2014 +0200 Copy device name to signal props structure when signals are added after device registration. commit ebd30322016cf17a59daef1ac073ad153a9f3786 Author: Joseph Malloch Date: Wed Aug 13 17:55:00 2014 +0200 Switched properties named 'n_' to 'num_' for consistency. commit 6c2010ac422e5dfce99cc90264eeebda60bf77e2 Author: Joseph Malloch Date: Wed Aug 13 17:41:15 2014 +0200 Overload min() and max() functions: add unary vector version. commit 63abc2e6af4b1a8d4736312fe1a1fe919304c257 Author: Joseph Malloch Date: Wed Aug 13 17:39:45 2014 +0200 Fixed possible null pointer bug when expression parser fails. commit 3440c5140dd6208055b4b713187ac485bd3ff91a Author: Joseph Malloch Date: Wed Aug 13 16:15:05 2014 +0200 Switch to using semicolons for separating sub-expressions. commit 59755c6f43ae842e9baff6ec11e1217b11baf9ae Author: Joseph Malloch Date: Wed Aug 13 13:29:02 2014 +0200 C++: Fixed problems handling property values that are arrays/vectors of strings. commit 7a1e48cd013c84bee9df1194101b61ded589f3ad Author: Joseph Malloch Date: Mon Aug 11 17:54:44 2014 +0200 Improvements to link sync. commit 09e6bf8ad18a3b480fa2aec87f3983c3913a1979 Author: Joseph Malloch Date: Mon Aug 11 15:24:33 2014 +0200 Use link pinging for estimating clock offsets, network latency and jitter between peers instead of admin-bus /sync messages. Simplify outgoing /sync messages but still accept old version. commit 6e400f6b14249f99d16f59aadaf74203a9671dea Author: Joseph Malloch Date: Fri Aug 8 15:48:33 2014 +0200 Do not check for expired devices on every call to monitor_poll(). commit 095f7ae15dd146a45ea8caa75deb023efbfe0f73 Author: Joseph Malloch Date: Fri Aug 8 15:23:24 2014 +0200 Swig/Python: return timetag from start_queue() function. commit f5f53ec1ff3bb8573fc89a01c687e77153450a71 Author: Joseph Malloch Date: Fri Aug 8 14:22:35 2014 +0200 Test for forbidden keys in msig_set_property() and mdev_set_property(). commit ad2a182f4a1a1dcbcd44cc8c1580d7403bfa0f64 Author: Joseph Malloch Date: Fri Aug 8 14:21:32 2014 +0200 C++: use set() function instead of wonky assignment operator overloading; rearranged class structure to match C API. commit 1c01c4ab070dd5bed94efe2514db6cf8437d4393 Author: Joseph Malloch Date: Thu Aug 7 15:18:35 2014 +0200 C++: Fixed ptr bug commit 92e66d08d035e29696102b77f179b4e678b6a521 Merge: 5dd5623 28388db Author: Joseph Malloch Date: Thu Aug 7 14:50:27 2014 +0200 Merge remote-tracking branch 'steve/master' commit 5dd5623fdc139d4fab270271053b107ef036c9ca Author: Joseph Malloch Date: Thu Aug 7 14:48:02 2014 +0200 C++: pass device or signal parent to property object and overload assignment operator. commit 28388dbadd375e0fba311892db6fa1f74a844060 Author: Stephen Sinclair Date: Thu Aug 7 14:37:20 2014 +0200 Add 'const' qualifier to get() methods, allowing use of C++11 for-iterators. commit 1c6fe6e40e0c16d3a8ce6e8484eb1c7ac8b03ead Author: Stephen Sinclair Date: Thu Aug 7 14:21:31 2014 +0200 Add some missing C++ headers in mapper_cpp.h. commit 66a734fca9c875b2dc61a0ca6535da11aacee0ed Author: Stephen Sinclair Date: Thu Aug 7 14:21:09 2014 +0200 Make variable liblo_CXXFLAGS doesn't exist, pkg-config only supports CFLAGS. commit 616d08dbd80e2358cd152d5f0a12c2d25fb728d7 Author: Stephen Sinclair Date: Thu Aug 7 14:20:32 2014 +0200 Add a check for C++11 compiler flags. Necessary since C++ headers use some C++11 features. (Copied from liblo's configure.ac) commit b01b428879653eedcd552d8b6827013df806e20f Author: Stephen Sinclair Date: Thu Aug 7 14:19:26 2014 +0200 Remove 'ccache' from CXX variable before calling python build system. Otherwise if CXX="ccache g++", then Python tries to build with just "ccache" for some reason, and breaks. commit 6f7444775ba9506b1c160d373f47d1c7d065bf17 Author: Joseph Malloch Date: Wed Aug 6 17:21:36 2014 +0200 C++; added alternate property retrieval for signals and devices. commit ccf9d46261da5bc4d07e7c20b24ab193da12e899 Author: Joseph Malloch Date: Wed Aug 6 15:37:53 2014 +0200 Expression parser: use -1*x instead of 0-x on stack for negation to preserve order-of-operations. commit 0f6ecfe34550fc78fa0c6e14c2b1752a57233c61 Merge: 7c40b9d a6748fb Author: Joseph Malloch Date: Wed Aug 6 15:36:43 2014 +0200 Merge branch 'master' into output-vector-indexing Conflicts: src/connection.c src/router.c test/testquery.c commit a6748fb59b8c8c8bb256bb00c52e65efe86b7024 Author: Joseph Malloch Date: Wed Aug 6 13:32:47 2014 +0200 C++: more consistent function naming. commit 72fae74892b3b36b944a9cc10cf77c773f7c664e Author: Joseph Malloch Date: Wed Aug 6 12:15:48 2014 +0200 Java: simplified some monitor/db bindings. commit fddb515e5359e562505076df3ccc9953e691582e Author: Joseph Malloch Date: Tue Aug 5 17:46:00 2014 +0200 Java: finished adding db object iterators. commit c250c3223006831947f514e37cbb130a8682e922 Author: Joseph Malloch Date: Mon Aug 4 18:06:08 2014 +0200 Added rough C++ tutorial commit 452d1cf839c327ce7d5aee79810664470b2a33c9 Author: Joseph Malloch Date: Mon Aug 4 17:54:02 2014 +0200 Java: Adding iterators for returning db queries. commit 99b14347695e20636f2e4051892374757fbae312 Author: Joseph Malloch Date: Mon Aug 4 17:51:12 2014 +0200 Added libversion() function to python and C++ bindings; use properties interface for C++ device props. commit 52fe6e6b7831172db70e7685be32526c05a99010 Author: Joseph Malloch Date: Mon Aug 4 12:28:06 2014 +0200 C++: Added handling of std::vector property values. commit 6de86285c0b4d05d8ff9f9c6d1f9b62230f05769 Merge: cd72fd8 3705a23 Author: Joseph Malloch Date: Sun Aug 3 17:17:12 2014 +0200 Merge branch 'java-monitors' commit cd72fd8722829db32910aa1cc95776b4ddfe7abe Author: Joseph Malloch Date: Sun Aug 3 15:46:07 2014 +0200 Add testcpp to make tests routine commit 5f7d43dc57a07240471c2c0b7c43ab52b9830bb4 Merge: 3b6493b b6114cd Author: Joseph Malloch Date: Sun Aug 3 15:18:30 2014 +0200 Merge branch 'admin2' into cpp commit b6114cd271b7873ab484c7239ac93715944fef01 Merge: 6e0a012 4baa30d Author: Joseph Malloch Date: Sun Aug 3 15:10:47 2014 +0200 Merge branch 'master' into admin2 commit 3b6493bbe7a642f954d82b0d139b47697ef5e84a Author: Joseph Malloch Date: Sun Aug 3 15:09:45 2014 +0200 C++: more properties, links and connection props. commit 801363bfb4a5343b85be1e81c3005d4d2085ee51 Author: Joseph Malloch Date: Sun Aug 3 08:25:19 2014 +0200 C++: Added db_connection iterators. commit ba181cc1392dfa2160b4c57ed17cfebc758f9c9e Author: Joseph Malloch Date: Sat Aug 2 12:33:15 2014 +0200 C++: More timetag constructors. commit 8f13bb6b68523df0b8b8d362091d165daf099555 Author: Joseph Malloch Date: Sat Aug 2 12:32:37 2014 +0200 Adding iterators for signals and db structures. commit d0fdd9b813e5a177c1518ace590513ac0166c8f8 Author: Joseph Malloch Date: Thu Jul 31 17:26:00 2014 +0200 Swig/Python/Monitors: Re-add request_devices() function. commit 34e58f695c80896b8e0392b54a19d66adb1b0788 Author: Joseph Malloch Date: Thu Jul 31 17:24:45 2014 +0200 C++ bindings... in progress. commit 6e0a01208b8c7dccbba90a6e675ee7ee8681b043 Author: Joseph Malloch Date: Thu Jul 31 17:22:49 2014 +0200 Allow configuration of monitor timeout duration. commit 0aa71efbf336ed85b6c240576e6f14f4798bf872 Author: Joseph Malloch Date: Tue Jul 29 20:47:58 2014 +0200 Working on handling crashed or unresponsive devices in monitor. commit 4261a4be3482de4db8ceebac3a3107affc3a4a6f Author: Joseph Malloch Date: Thu Jul 24 16:19:03 2014 +0200 Monitor: Recover from subscription errors. commit e33f21644ed3c6b795e8c72e1e87a12aa2ceb6ad Author: Joseph Malloch Date: Thu Jul 24 13:25:52 2014 +0200 Monitors: ensure device metadata is included with other subscriptions. commit 4f6b0e777b504f495debc09e81fb1af532707fe7 Author: Joseph Malloch Date: Thu Jul 24 12:27:11 2014 +0200 Admin: do not create new device records when receiving /sync messages since only the device name is known; instead call the monitor autosubscribe handler if it exists. commit a1e61ced9eb9c349d58ef52da394a332349a9b7f Author: Joseph Malloch Date: Wed Jul 23 19:04:58 2014 +0200 Update protocol for setting subscription lease durations. commit ef47a724e59f3a99bac6884013414fec4f82e435 Author: Joseph Malloch Date: Wed Jul 23 18:41:09 2014 +0200 Fixed typos in function names. commit 04a49a3f0c1536744d7450334911e99f5f373493 Author: Joseph Malloch Date: Wed Jul 23 18:40:47 2014 +0200 Explicitly state that link timeout occurred. commit 3049c49105510b941847d2b9a74d5e01fcf86b8c Author: Joseph Malloch Date: Wed Jul 23 17:03:43 2014 +0200 Add active ping to links; remove expired links if e.g. a device crashes. Any automatic restoration of links and connection on restart should be handled by a session-manager such as MASH. commit 54412b652bd3da1371d3894061f67b19d61b8220 Author: Joseph Malloch Date: Wed Jul 23 17:01:21 2014 +0200 Fixed bug when removing monitors that share admins with a device: some OSC handlers are required by both monitors and devices. commit 5924a62b13e3ab57fdf94f9aca35188965b9aa62 Author: Joseph Malloch Date: Wed Jul 23 16:58:16 2014 +0200 Allow monitors to receive device /sync messages even if they share an admin. commit 3db20fedc2f437c59cc35fabd71d5f4b08271fe5 Author: Joseph Malloch Date: Tue Jul 22 14:50:30 2014 +0200 Remove links to/from peers when they log-out. commit 48eb386fa1f251bb037fb4f1668b8ce6ec83c2ee Author: Joseph Malloch Date: Tue Jul 22 14:49:57 2014 +0200 Fixed reference to freed object. commit 3705a23b1935d819a212e992f0b8e09704add692 Author: Joseph Malloch Date: Fri Jun 27 11:14:12 2014 +0200 Java tutorial updates. commit 7c40b9d484ede6941f53021c26ae1c898e533dc1 Author: Joseph Malloch Date: Mon Jun 23 15:16:51 2014 +0200 Reduce memory size of op_table commit c2491621dd6576dcf3f72c0d03220d2bd143083c Author: Joseph Malloch Date: Mon Jun 23 14:27:23 2014 +0200 Optimize expressions containing operations with 0 or 1 as operands. commit 4baa30dd25e3b2116719b7f788cc6c386b0985ff Author: Joseph Malloch Date: Tue Jun 10 13:39:29 2014 +0200 Do not allow user-code to set signal property named value - redirect to msig_update() instead. Allow un-setting signal min and max properties through calls to msig_set_property() with 0 length argument. commit 73dcb2ab37d9a448255c136a51d5fa609b5fd4cc Author: Joseph Malloch Date: Tue Jun 10 13:32:58 2014 +0200 Expression parser: add operation-by-zero results to op_table. commit eefaf653f2ec92f362073a6b4c664063da5a4220 Author: Joseph Malloch Date: Tue Jun 10 13:28:48 2014 +0200 Small optimization of expression parser. commit 5d31a9728a6f243bff229c19db6f92a1ce66a2f7 Author: Joseph Malloch Date: Tue Jun 10 13:07:07 2014 +0200 Added token count and elapsed time to testparser output; added optimization test. commit 4d4d34c49acd635b5ed04ea4e70970ccea57c800 Author: Joseph Malloch Date: Tue Jun 10 13:05:28 2014 +0200 Moved expression precomputation to separate function. commit 9066a0a1317312bc8552433f001ce672aebfb1c6 Author: Joseph Malloch Date: Fri Jun 6 13:25:29 2014 +0200 Moved history_size variable from signal structure to link_signal where it belongs. commit 007fcd4254a8b2dbcdb829441d27d86ac16be897 Author: Joseph Malloch Date: Wed Jun 4 15:13:38 2014 +0200 Add Java tutorial. commit e886e3091c36ba19147fbbc2c89cff9450261fcd Author: Joseph Malloch Date: Wed Jun 4 15:13:17 2014 +0200 Adapt Processing example for API changes. commit f5b8ea60b6f5545efde8959e1fa8b7fa1ab6bebd Author: Joseph Malloch Date: Wed Jun 4 15:12:51 2014 +0200 Overload reserveInstances() function to reduce native code complexity. commit fef89ed5e5558ac4e842cd711e52431ea5c415bd Author: Joseph Malloch Date: Wed Jun 4 10:28:19 2014 +0200 Removing unnecessary signal props argument from handlers. commit d65ec8aaf0af110eb1813822499a0f773b88bffc Author: Joseph Malloch Date: Wed Jun 4 10:27:25 2014 +0200 Overloading device poll() function. commit 3f991471acbd125f1ede0ddacd615cdad9acb57c Merge: fdb39f3 1a20137 Author: Joseph Malloch Date: Tue Jun 3 16:37:24 2014 +0200 Merge branch 'master' into output-vector-indexing Conflicts: src/expression.c commit fdb39f3018c5be45d84bbbb850e0acc3e33e94aa Author: Joseph Malloch Date: Tue Jun 3 15:09:27 2014 +0200 Correct a few bugs in test programs. commit 158b1f73b7e42c062e8ee791a9246fe0b93c7566 Author: Joseph Malloch Date: Sun Jun 1 22:56:35 2014 +0200 Removing OSC-blob approach to multi-sample messages. commit 4cc89649581f442ba58ee0f967dba9761f494b99 Author: Joseph Malloch Date: Mon May 26 14:15:15 2014 +0200 Use src and dest names from arguments. commit ab3a66675bf4adb9105466a4e71b8509bef5725b Author: Joseph Malloch Date: Mon May 26 14:11:02 2014 +0200 Corrected some labels. commit cf987a12a5ba73f803090dd0af6ccdf75d5f9c3d Merge: b0f2049 1a20137 Author: Joseph Malloch Date: Mon May 26 14:06:12 2014 +0200 Merge branch 'master' into java-monitors commit b0f2049761425fcd5b4531bc67522f1cc4de5fe7 Author: Joseph Malloch Date: Sat May 24 18:41:30 2014 +0200 Added testspeed.java for benchmarking speed improvements. commit 8fe66cf9772cc08a029053785d7ae6a591b57909 Author: Joseph Malloch Date: Sat May 24 18:40:23 2014 +0200 Added timetag and Device.now() functions. commit 65fbc9ad3ac2923caa4a50053ea2ad3382fcee68 Author: Joseph Malloch Date: Sat May 24 16:13:05 2014 +0200 Handle connection_modify functionality. commit e3ccaa1438e6184071b4a05a4b227b8a9f8ceb86 Author: Joseph Malloch Date: Sat May 24 15:59:57 2014 +0200 Use more overloading for signal update functions to reduce code replication; removed unnecessary db objects from signal handler arguments; added device properties function; moving remaining public function names to camelCase. commit 1a20137096643a8845387e281bac08ad760efb8a Author: Joseph Malloch Date: Mon May 19 14:57:23 2014 +0200 Updates to roadmap commit 09cd5e9e5382cccc95971f66e2055abfb6f88a20 Author: Joseph Malloch Date: Mon May 19 14:56:57 2014 +0200 Improve readability of testmonitor output. commit a51850e541651042182536bb1513d1bb1af5ec81 Author: Joseph Malloch Date: Mon May 19 14:56:18 2014 +0200 Remove check for range_known prop when adding connection extrema to OSC message. commit e77bc3ef05f136ba0f70c02e81906a6313304bcf Author: Joseph Malloch Date: Mon May 19 14:48:06 2014 +0200 jni monitor bindings: src and dest extrema props for connections. commit fb32f064cf19395c3ae289a130f39731a3a49f41 Author: Joseph Malloch Date: Fri May 16 18:41:03 2014 +0200 jni monitor bindings: connection mode, bound and expression props working. commit 0101bc2606fe477ebe30009a13bbeed379a58f6f Author: Joseph Malloch Date: Fri May 16 14:29:26 2014 +0200 Java monitor bindings: link(), connect() and callbacks working and added to test; still missing writable properties for link and connect. commit 7603f18c55fae2e699e6928a2736d2088e2e7bec Author: Joseph Malloch Date: Wed May 14 17:19:09 2014 +0200 Adding monitor functionality to Java bindings. commit 3bb6836cadc20deb1327bdf4d96844ff2a69f917 Author: Joseph Malloch Date: Tue May 13 14:18:43 2014 +0200 Re-added mapper_monitor_request_devices() function for monitors that wish to quickly scan the network. Under normal usage it is not necessary to call this function since basic device information is included in regular /sync messages. commit 00e917a334fb853a6ece6102bff8eaca19b90c39 Author: Joseph Malloch Date: Tue May 13 13:55:56 2014 +0200 Bugfix commit 8058f287e374b5c4ed6ebe57b23564a681534630 Author: Joseph Malloch Date: Mon May 12 17:21:08 2014 +0200 Fix bug in mdev_get_fds() commit 90a61fa433fcb3d0d3611c325cd898c8178f3605 Author: Joseph Malloch Date: Mon May 12 17:20:41 2014 +0200 Update testvector to wait on link commit 75d65f66ac353de74a72248da727418600261083 Merge: 2193f6e 218fa1a Author: Joseph Malloch Date: Mon May 12 17:20:13 2014 +0200 Merge branch 'master' into admin2 Conflicts: src/admin.c src/mapper_internal.h src/monitor.c src/types_internal.h test/test.c test/testlinear.c test/testquery.c test/testrate.c test/testreverse.c test/testsend.c test/testsignals.c commit 218fa1af2c015d4256bdbc264ee56f554e0fcfea Merge: 2ba01d2 cbfc853 Author: Joseph Malloch Date: Mon May 12 16:13:43 2014 +0200 Merge branch 'more-vector-functions' Conflicts: src/expression.c test/testparser.c commit 7bb0e756f2e1f4391550b7f334871c699d9bb70a Merge: fc84152 2ba01d2 Author: Joseph Malloch Date: Fri May 9 18:05:24 2014 +0200 Merge branch 'master' into output-vector-indexing Conflicts: include/mapper/mapper_db.h src/device.c src/expression.c src/router.c test/testparser.c test/testquery.c test/testreverse.c commit 2ba01d2f814d31f764014285c4ec2b528bdbc9b2 Author: Joseph Malloch Date: Wed May 7 15:57:17 2014 +0200 Added make tests option for running all tests in sequence; modified tests for simpler text output but with verbose option flag. commit 42f21c63db7a400cb72a653b3a95b0d63e728d2e Author: Joseph Malloch Date: Wed May 7 15:48:15 2014 +0200 testcustomtransport: close socket on disconnect. commit 37b631d550ac423b37fbf7d5fa112535fd3af0d4 Author: Joseph Malloch Date: Wed May 7 15:43:49 2014 +0200 Fixed bugs in implementation of testselect program commit d9340f52a92dd835eb13c51b09ed478cd3f05fad Author: Joseph Malloch Date: Wed May 7 15:29:05 2014 +0200 Remove some extra print statements from expression parser. commit fc841527d004a1fbd1a5e2e0aa5c142985fb9266 Author: Joseph Malloch Date: Sat May 3 16:50:13 2014 +0200 Separate datatype and vector length when printing tokens for readability commit 9ae8fc8f74eb9698532917869b3eace408cebffe Author: Joseph Malloch Date: Mon Apr 28 17:01:30 2014 +0200 Removed TODO. commit 51c3b62133ac84e8d95ba557b7e99123533d9d78 Author: Joseph Malloch Date: Mon Apr 28 16:32:58 2014 +0200 Corrected range property usage in testlinear.c commit 017bff16f0b013a955285d7e64ee5b6a18efe7d6 Author: Joseph Malloch Date: Mon Apr 28 16:32:30 2014 +0200 Removed declaration of mapper_signal_value_t/mval from public API. commit a97f8242e91c5526949d6f0cd2653078323dfcfe Author: Joseph Malloch Date: Mon Apr 28 16:07:04 2014 +0200 Removed erroneous cast to mapper_signal_value_t commit 5e70d8b01cab4b6c3d09cdd2168431807232faa6 Author: Joseph Malloch Date: Mon Apr 28 14:39:26 2014 +0200 Fixed a couple of documentation errors. commit c10bd56ade9a93c77ed3fb203d4e4304128088b8 Author: Joseph Malloch Date: Mon Apr 21 20:22:13 2014 +0200 Fixed memory access and management bugs revealed during profiling with Valgrind. commit 7113bc6fd682c650b614828e912c777ba09678eb Author: Joseph Malloch Date: Sat Apr 19 16:41:27 2014 +0200 Evaluate constant expressions in receiver immediately instead of waiting for signal update. commit 66d1e2ff6299109c1f4897a2e3e4f0c827af86e9 Author: Joseph Malloch Date: Fri Apr 18 14:04:42 2014 +0200 Add TODO regarding out-of-order OSC messages. commit 989912aead32f9b7da8f9cb2bf06992d40b4f917 Author: Joseph Malloch Date: Fri Apr 18 12:29:43 2014 +0200 Ensure that admin networking is functional before allowing device ordinal to be locked - prevents faulty device registration in cases where messages are temporarily blocked on startup. commit 00f2c7d257072cb1af102949b5266939cb3bdce8 Author: Joseph Malloch Date: Fri Apr 18 12:17:21 2014 +0200 Do not send /who message unless monitor autorequest is enabled. commit 989b0268468a46e9b49ad12b769edfdd3bafdf28 Author: Joseph Malloch Date: Fri Apr 18 12:14:43 2014 +0200 Cleaned up testmany program. commit 4d17d88009b1890cb2340c8e3e66c780d9484371 Author: Joseph Malloch Date: Wed Apr 16 18:45:59 2014 +0200 Reset signal and connection histories when an active instance is released. commit aad0440b137159903d2c366dba9bae8212d754d1 Author: Joseph Malloch Date: Tue Apr 15 17:07:23 2014 +0200 Added function for retrieving libmapper version from admin. commit 3cade8bf941f5fb36dd66452591492f8efa0a1b0 Author: Joseph Malloch Date: Mon Apr 14 14:58:59 2014 +0200 Fixed query implementation to work with null-padding, type and length coercion. commit 34f220294d6c2dea15ecc5040e19ecc16e8ce75a Author: Joseph Malloch Date: Fri Apr 11 17:18:18 2014 +0200 Fix bug in vector range specification for linear scaling expressions. commit 4c7dfa1b1acd18b9bfdef0aeceafffeb3a86cc20 Author: Joseph Malloch Date: Fri Apr 11 16:08:05 2014 +0200 Store user-variable histories per-instance instead of globally in connection expression structure. commit da07df783111d18686338f5685c41a34d0e2a94d Merge: 5934928 dc17931 Author: Joseph Malloch Date: Mon Mar 24 16:56:25 2014 +0100 Merge branch 'master' into output-vector-indexing Conflicts: src/connection.c test/testreverse.c commit dc17931399c6240581053ebe6b43cf2b39cd15ea Author: Joseph Malloch Date: Mon Mar 24 16:19:56 2014 +0100 Print elapsed time since last sync in testmonitor, don't print keys for missing props. commit 2193f6ee67730ed87a315e477889e5b101fa4779 Merge: 3550c5d a5e7964 Author: Joseph Malloch Date: Mon Mar 24 15:54:37 2014 +0100 Merge branch 'master' into admin2 Conflicts: src/monitor.c test/testmonitor.c commit a5e79643b73d9179047801dc3390084b8472ca84 Author: Joseph Malloch Date: Sun Feb 16 18:38:16 2014 -0500 Fixed bug in starting expression when entering calibrate mode with scalar source. commit 0f3a204fb701c84f1fe1f71faaeb9fe94091add9 Author: Joseph Malloch Date: Thu Feb 13 22:42:52 2014 -0500 Check if range arguments are numbers before trying to evaluate them - prevents e.g. erroneously stringified range arguments from removing previous values. commit 17d7c2b13bfb6759d598a6793489cf84939a6054 Author: Joseph Malloch Date: Thu Feb 13 13:31:14 2014 -0500 Updated test.py for testing device properties and link/connect/modify. commit e3103d7aa5b4dcff6d36522a47c49ffba49b1baa Author: Joseph Malloch Date: Thu Feb 13 13:30:27 2014 -0500 Changed arguments to mapper_monitor_connection_modify() for consistency with mapper_monitor_connect() and _disconnect(). Altered coresponding function name in Swig/Python bindings from .modify() to .modify_connection() since other objects e.g. links can be modified also. commit 2ff516cbf6d62aac1eec8841108ff820f8684783 Author: Joseph Malloch Date: Thu Feb 13 13:27:00 2014 -0500 Added function mdev_properties(), also call it from Swig/Python bindings. commit 32bc52d5dfb88d954e57d9dded5a4c8d9b1cfa8e Author: Joseph Malloch Date: Thu Feb 13 13:24:24 2014 -0500 Swig/Python: Fixed string pointer bugs in py_to_prop() commit ad7507ab7c27ce8b5c3faeb08ec3eee680bbd225 Author: Joseph Malloch Date: Thu Feb 13 13:20:25 2014 -0500 Fixed lo_arg pointer bug in mapper_msg_prepare_params() commit 6c8bfbd6c33fdf40b5c80fcf8e74f4dc9c8c8f38 Author: Joseph Malloch Date: Sun Feb 9 17:06:41 2014 -0500 Enable AUTOREQ_ALL in testmonitor.c commit 578336748547a9e701a2539cc9fba1346a69de8a Author: Joseph Malloch Date: Sun Feb 9 17:06:20 2014 -0500 Update Python bindings for connection db range changes. commit 694de5019bcc852f71cca4444339901173b775a3 Author: Joseph Malloch Date: Sun Feb 9 17:00:11 2014 -0500 Change treatment of src and dest extrema in connection db, allowing proper retrieval of metadata with types. commit a065ede021c500109a7eb0f530ea6647cfd1cb74 Author: Joseph Malloch Date: Tue Feb 4 17:44:00 2014 -0500 Fixed segfault storing/retrieving single strings as static props e.g. units. commit 6c3573765bbf53a24dab0c60cae319ff2c5a55e0 Merge: 00aead7 14b488d Author: Joseph Malloch Date: Tue Feb 4 17:14:16 2014 -0500 Merge remote-tracking branch 'steve/master' commit 00aead71c758836aa817864c69d52a39d896297d Author: Joseph Malloch Date: Tue Feb 4 16:46:01 2014 -0500 Fixed 2 bugs in handling properties with vector values e.g. link scopes commit 14b488d28ce7509c18dfcc0dfa9977f9e82f28a9 Author: Stephen Sinclair Date: Tue Feb 4 22:24:49 2014 +0100 swig: Use alloca() to reserve stack variables used in typemaps. Otherwise, swig sometimes places variables inside scopes, and retaining pointers to these variables causes problems. commit ddd4908574030efaee6e4de8752097a7ab0a509c Author: Stephen Sinclair Date: Tue Feb 4 21:01:16 2014 +0100 Add swig/copywhich.sh to the dist. commit 0ba1b25227f46491cd0f3599b82486a94af3b7e2 Author: Stephen Sinclair Date: Sun Nov 24 14:15:22 2013 +0100 Remove unsigned changes for >= 0 (clang warning) commit d7f12b2df02c2250c5d5132bbe20527f44d2f4ce Author: Joseph Malloch Date: Tue Feb 4 15:43:54 2014 -0500 Fixed bug passing lo_arg arrays for storing vector property values. commit a3e0c663eb7ae3e9f2facd6bf822fd4a8c77eaf1 Author: Joseph Malloch Date: Mon Feb 3 13:24:32 2014 -0500 Swig/Python: Corrected min and max property lengths in testvector.py commit c31909de5b73d7e4fd113cdaa7c8f8c6b3aedc68 Author: Joseph Malloch Date: Mon Feb 3 08:20:17 2014 -0500 Swig/Python: Fixed pointer bug when setting signal min and max. commit cbfc853806bac73dfabd21db09966c64cc42b14a Author: Joseph Malloch Date: Wed Jan 29 16:32:30 2014 -0500 Expanded vector function handling, added functions mean(), sum(), vmax() and vmin(). commit 3550c5dabcfcac56e92b873469ac3ad383c5dc00 Author: Joseph Malloch Date: Tue Jan 21 13:58:42 2014 -0500 Fixed behaviour of unsubscribe functionality. commit 36f4cc633337ba437f999cf6bece84300fee0ede Author: Joseph Malloch Date: Tue Jan 21 13:54:08 2014 -0500 Fixed possible use of uninitialized memory. commit dabf06d4caa03ddc3c036c623a3d676ee27f36ff Merge: e174f0f 75c3c36 Author: Joseph Malloch Date: Tue Jan 21 12:54:56 2014 -0500 Merge branch 'master' into admin2 Conflicts: src/admin.c src/mapper_internal.h src/monitor.c src/receiver.c src/router.c test/test.c test/testlinear.c test/testsend.c test/testvector.c commit 75c3c3643a7e3d595aee8bbcbd0cd87fbe2738f5 Author: Joseph Malloch Date: Mon Jan 20 16:36:22 2014 -0500 Adapt testparams.c for accepting malformed property strings. commit 15c1aa08f88c65866cb6bc0f3754a5acce1af1b2 Author: Joseph Malloch Date: Mon Jan 20 16:35:31 2014 -0500 Fixed bug in message parser. commit 73d8c183ec6afef8eb052285bd4c029bf4066645 Author: Joseph Malloch Date: Mon Jan 20 15:57:22 2014 -0500 Fixed db storage of signal min and max properties. commit 49ae80803ff67dd90e2352dfa1bbf684ddf817cb Merge: de3a5c1 8a57427 Author: Joseph Malloch Date: Mon Jan 20 11:02:27 2014 -0500 Merge branch 'master' into vector-indexing commit 8a574279e3031c45a6e68fa7bd5174f85bb84b3e Author: Joseph Malloch Date: Mon Jan 20 10:58:50 2014 -0500 Improve parsing of connection range properties. commit aeebb4a2e195f3f984a3f6da5ac47b4ee2d5c5cf Author: Joseph Malloch Date: Mon Jan 20 10:07:06 2014 -0500 Reject vector property values with heterogeneous types without crashing. commit de3a5c1d4de1a4b00bf914c33a96c72e39528788 Merge: 99f6895 8427b95 Author: Joseph Malloch Date: Sun Jan 19 21:02:27 2014 -0500 Merge branch 'master' into vector-indexing Conflicts: src/connection.c test/test.c commit 8427b9525845d732cb37a1caa5ea5c90c962f21d Author: Joseph Malloch Date: Sun Jan 19 19:24:35 2014 -0500 Fixed memory errors and leaks exposed by Valgrind. commit d787dc4d78b14037fe9f344ce4e6a6a1110e2fac Merge: 8a86457 2886655 Author: Joseph Malloch Date: Sun Jan 19 14:47:09 2014 -0500 Merge branch 'master' into vector-props2 commit 28866550a1c6a8dc5e4867ef2f0df5c5535f44de Author: Joseph Malloch Date: Sun Jan 19 14:00:28 2014 -0500 Fixed memory errors and leaks exposed by Valgrind. commit 8a86457fa92c8f7aaebf7ddd4018f7224fc59285 Author: Joseph Malloch Date: Sat Jan 18 19:23:15 2014 -0500 Added /link/modify methods and handlers, improved handling of link scope property. commit c23b7815ccbba6464db24edee26a58d730582143 Merge: 6a89eab 1d1778d Author: Joseph Malloch Date: Sat Jan 18 16:28:24 2014 -0500 Merge branch 'master' into vector-props2 Conflicts: src/connection.c test/test.c commit 5934928e46a1a35c0788ad8e022053b7d208747b Author: Joseph Malloch Date: Fri Jan 17 20:23:43 2014 -0500 Repacked expression token and variable structs to reduce memory usage. commit 8c34f4a53021cfb755b409b26b37a211a4dd07d2 Author: Joseph Malloch Date: Wed Dec 18 14:34:59 2013 -0500 Expression parser: removed superfluous function. commit e174f0f34ed008937dc5fe330449e3425299eed7 Author: Joseph Malloch Date: Tue Dec 10 11:53:44 2013 -0500 Added unsubscribe API and protocol handlers. commit b3a34aeba97d38139bec4fc7766d30cdf6fe99ce Merge: 4e0be67 e5f10e0 Author: Joseph Malloch Date: Mon Dec 9 11:22:24 2013 -0500 Merge branch 'admin2' into admin2-simplify commit e5f10e01720c3d629caa00dea892e2b59fdf433f Author: Joseph Malloch Date: Sun Dec 8 22:19:34 2013 -0500 Removed magic numbers in monitor.c; allow admin to resume subscription without resending data if reported device version number matches. commit 221470c5920b8bbffc75f16e65320f843c45155b Author: Joseph Malloch Date: Sun Dec 8 13:59:17 2013 -0500 Test programs: wait for link before sending /connect messages. commit 8b00bf3e2952497a052a90971e053a8d236e9922 Author: Joseph Malloch Date: Sun Dec 8 13:40:14 2013 -0500 Python: Add defaults to subscription arguments. commit 41948d5a5ed28cf39d09a0cbcbe5550b0d0025d6 Author: Joseph Malloch Date: Sun Dec 8 13:39:33 2013 -0500 Add device info handler to mesh handler list. commit 459541240f6d955cc5e2016ad0e931abccb37aa5 Merge: 8e5229d 1d1778d Author: Joseph Malloch Date: Sun Dec 8 12:16:02 2013 -0500 Merge branch 'master' into admin2 commit 91384ce319cb0244293591ceec3bf9648df264d1 Author: Joseph Malloch Date: Sun Dec 8 11:28:40 2013 -0500 Update expression syntax documentation to explain sub-expression evaluation order. commit 4ec638b94425c166a30b94a1a19249e30b783009 Author: Joseph Malloch Date: Sat Dec 7 21:20:00 2013 -0500 Added brief documentation of vector, filter initialization, and user-defined variable syntaxes. commit 5ee6005858d12b1fddafafee8bb4c68b15a9e1e1 Author: Joseph Malloch Date: Sat Dec 7 21:19:11 2013 -0500 Expression parser: disable multiple subexpressions assigned to the same variable to avoid problems with non-outputting conditionals; fixed conditional outputs; initialize output arrays before evaluating in testparser. commit 9ff97e03dc5465cab82957cf8c1216adabb5dc8f Author: Joseph Malloch Date: Fri Dec 6 19:26:47 2013 -0500 Expression parser: enabled user-defined variables in expression. commit ce2967a7c185ad4c06b556cee2e2cbb932b19888 Author: Joseph Malloch Date: Thu Dec 5 18:22:45 2013 -0500 Expression parser: re-order sub-expressions as necessary so that history initialization expressions are evaluated first (these expressions will be skipped in subsequent evaluations). commit 5ae969a5402efd29f6687945a08258f984240686 Author: Joseph Malloch Date: Thu Dec 5 17:09:44 2013 -0500 testparser: added scientific notation test. commit f3b6e768512a0c30c8b6db8700bf9d32baede5ad Author: Joseph Malloch Date: Tue Dec 3 15:37:11 2013 -0500 Expression parser: added more expression syntax tests to testparser. commit 801ceb78e31d4720900ab70ef1eb67539fb677a6 Author: Joseph Malloch Date: Tue Dec 3 15:36:20 2013 -0500 Expression parser: enabled filter history initialization for output (y) - for now initialization expressions must appear first. commit bf96442731cb8cb6bb24e7d788961d44142a87b9 Author: Joseph Malloch Date: Mon Dec 2 12:05:58 2013 -0500 Expression parser: additional checks for bad syntax. commit d3a54f4ce0181dae96d8bdc1a65cc89979d23050 Author: Joseph Malloch Date: Sun Dec 1 21:03:38 2013 -0500 Expression parser: enable vector builder left of assignment operator for e.g. output swizzling. commit b65213be35e577872648873f3aa12f83b9883a1e Author: Joseph Malloch Date: Sun Dec 1 14:39:27 2013 -0500 Do not check link scope with NULL map. commit c2cc7ed88aada8d4c325c9c0b53b710811ec32f4 Merge: c3c34e9 99f6895 Author: Joseph Malloch Date: Sun Dec 1 14:23:10 2013 -0500 Merge branch 'vector-indexing' into output-vector-indexing Conflicts: src/connection.c commit 1d1778d614931b734c7b150133781faa05aea2a0 Author: Joseph Malloch Date: Sun Dec 1 14:16:13 2013 -0500 Fixed min/max datatypes in testreverse program. commit 99f6895033f9fa9f58e4fd4a711076265d667b74 Merge: a040f22 3c4740d Author: Joseph Malloch Date: Sun Dec 1 14:12:20 2013 -0500 Merge branch 'master' into vector-indexing Conflicts: src/connection.c test/test.c commit a040f22dd1f9057482e88ec6e26f9cabde9fa59d Merge: 14e715c 6a89eab Author: Joseph Malloch Date: Sun Dec 1 13:50:40 2013 -0500 Merge branch 'vector-props2' into vector-indexing Conflicts: src/expression.c commit c3c34e9c8a5894f50fb05363ad584d96d66acb9e Author: Joseph Malloch Date: Sun Dec 1 13:47:32 2013 -0500 Added some vector signals to testquery and testreverse. commit 5f42262b0d21bc0b6f4c3de3f37a39faa17f68cf Author: Joseph Malloch Date: Sun Dec 1 13:47:04 2013 -0500 Cleaning up signal handlers & obsolete typestrings; Fixed soem more instance message formatting. commit 96dca70e236f8ec6fdac72106da545781a9506ad Author: Joseph Malloch Date: Sat Nov 30 22:19:55 2013 -0500 Fixed some more instance-sending syntax. commit 821e0d9f6b1db14e18140482ab11c95df893db29 Author: Joseph Malloch Date: Sat Nov 30 21:46:52 2013 -0500 Re-enabled instance updates, but switched to explicit tagging of instance property in message using @instance label as discussed long ago on the mailing list. Instance release messages now require OSC NIL types for each vector element. commit 00f9becee43b8677a5c9018da9c643b1e21bb6f1 Author: Joseph Malloch Date: Sat Nov 30 20:18:45 2013 -0500 Expression parser: eliminate TOK_QUESTION since it was really handled by TOK_OP, use bitflags more efficiently in token type enum. commit 2221e25b409cf611d7b965e5aa9b3a7973fa3414 Author: Joseph Malloch Date: Sat Nov 30 17:08:00 2013 -0500 Expression parser/evaluator: allow multiple sub-expressions for e.g. setting different vector elements/ranges. commit 00489654f078d1e4fa95c94af41fd4b3a93f98ba Author: Joseph Malloch Date: Sat Nov 30 15:01:17 2013 -0500 Fixed bug initializing has_complete_value flags for new signals. commit af15a602a49d624b548c8bf373e82658eda14168 Author: Joseph Malloch Date: Sat Nov 30 14:44:38 2013 -0500 Use null-padding for default linear/calibration expressions in cases when dest_len > src_len. commit e1073502485fe90ecc33f5394a417b76d0d946f3 Author: Joseph Malloch Date: Sat Nov 30 12:34:37 2013 -0500 Handle null-padded signal updates at receiving device. Switched to using generic OSC typestring handler since details of null-padding cannot be known auntil runtime. commit 80457e1781f2f60e93b61ca26ccec5028787cf3e Author: Joseph Malloch Date: Thu Nov 28 19:45:50 2013 -0500 Expression parser: build typestring for evaluated expressions will nulls for missing vector elements. commit c6d2e8eb7ff99c8b352dba88bb7be8731a419d04 Author: Joseph Malloch Date: Thu Nov 28 19:43:35 2013 -0500 Expression parser: add TOK_ASSIGNMENT, enable vector indexing on output variable (y). This will allow null-padding of mapped signals when mapped to partial vectors, as well as assignment to possible additional variables in the future. commit 14e715ce7e28ee5d5298a3d67593b9413d618224 Author: Joseph Malloch Date: Thu Nov 28 10:56:13 2013 -0500 Remove unnessary vectorizer token from expr if vector length is 1. commit ae65c6386c5f9915713c29b701d16217cce3f301 Author: Joseph Malloch Date: Thu Nov 28 10:54:48 2013 -0500 Re-enable maximum history index checks. commit 4e0be67071717449d959f781e668a86f5767b833 Merge: 4b83018 8e5229d Author: Joseph Malloch Date: Wed Nov 27 19:13:57 2013 -0500 Merge branch 'admin2' into admin2-simplify Conflicts: src/monitor.c commit 8e5229d2f9da9cddee5e6a95d4be8c4b0df831d5 Author: Joseph Malloch Date: Tue Nov 26 22:47:57 2013 -0500 Monitor: remove auto-renewing subscription when device logs out. commit 243133a6dd58524beb35f4a1e21f9d41967b4aeb Author: Joseph Malloch Date: Tue Nov 26 19:25:38 2013 -0500 Fixed bugs in signal removal from db. commit f6a5038a34f985f2fe8e42b7bbb4cdd860a18bdd Author: Joseph Malloch Date: Tue Nov 26 15:45:32 2013 -0500 Copy update timetags to connection output buffer. commit 90096d8918f9d234fc9ef79ee8eff48213a6edc2 Author: Joseph Malloch Date: Tue Nov 26 15:28:06 2013 -0500 Expression parser: enable shortened conditional syntex a?:b, added corresponding test. commit 9eb5a75bf9c647ade0f58ebb756cae8145c2e9c2 Author: Joseph Malloch Date: Tue Nov 26 13:24:20 2013 -0500 Fixed bug generating default linear scaling expression when src_len is less than dest_len. commit b80562711cfe31a821a470fe2e4377be54761628 Author: Joseph Malloch Date: Mon Nov 25 16:11:57 2013 -0500 Expression parser: detect illegal token sequences. commit 76bf6d93963be160b95db62417012108afc9f908 Author: Joseph Malloch Date: Sun Nov 24 18:18:27 2013 -0500 Set expression vector length property before attempting precomputation. commit 6a89eab97610af84e1f2e96235efcc2e3138c282 Author: Joseph Malloch Date: Sun Nov 24 14:50:05 2013 -0500 Fix variable name bug. commit 3c4740dd1cdccc383e42329ee0ec2524a36d0d17 Author: Joseph Malloch Date: Sat Nov 23 19:31:44 2013 -0500 Fixed bugs dealing with double signals and linear scaling; added checks for scenarios where min==max; fixed passing of min and max arguments in test program. commit e85e3e2d1bc73c3d7d9cefb107361f03546da9ad Author: Joseph Malloch Date: Sat Nov 23 18:59:46 2013 -0500 Added vfunc enum to token union. commit 4b83018944fe2911c0ccf2e2df7ac4e7e0695538 Author: Joseph Malloch Date: Sat Nov 23 18:35:11 2013 -0500 Remove admin functions related to monitor queries. commit a37d1054b293189b3ad5c88225bb873b97b2f588 Merge: 4fe3ce8 42af497 Author: Joseph Malloch Date: Sat Nov 23 18:28:12 2013 -0500 Merge branch 'admin2' into admin2-simplify commit 42af497eb70c63c751a42b1902fa07c1a6ef690b Author: Joseph Malloch Date: Sat Nov 23 18:17:48 2013 -0500 Return correct number of file descriptors. commit 8fc6e6d16a4f1fca8fc6e7225013310546cf2d8e Author: Joseph Malloch Date: Sat Nov 23 18:06:56 2013 -0500 Send /connectTo message p2p since link src is known. Test programs using monitors need to wait for link to be established before connecting. commit 0ff63134c8dfe6ba8a8f941b7b7cda42786c6ee2 Author: Joseph Malloch Date: Sat Nov 23 16:16:33 2013 -0500 Properly handle changing flags for existing subscriptions. commit 5513a620fb1760de7d94cfa822f986d6754d9fde Author: Joseph Malloch Date: Fri Nov 22 16:30:51 2013 -0500 Python: switch to monitor subscription model. commit dcdadc624bdea082996f12c2a449e47d8ad256b8 Author: Joseph Malloch Date: Fri Nov 22 16:30:18 2013 -0500 Store mesh admin port of remote devices in router/receiver datastructure, use for p2p admin responses. commit 4fe3ce8bdbf2882ef48912c8a6226bfaa01bb1c6 Author: Joseph Malloch Date: Thu Nov 21 17:03:47 2013 -0500 Remove monitor request functions. commit b438fef8821d4325fcf3d1b4e9d502fa4048738e Author: Joseph Malloch Date: Thu Nov 21 16:47:21 2013 -0500 Added subscription-autorenew functionality to monitor. commit dcdb53b9fe108ec4ada2968e3b6f85c2f5974fdc Author: Joseph Malloch Date: Wed Nov 20 10:36:23 2013 -0500 Switched monitors to subscription model. commit 343afcd19b3fd99a600e7961d9b9526339a000a2 Author: Joseph Malloch Date: Tue Nov 19 18:44:26 2013 -0500 More work on monitor subscriptions: added /subscribe message handler with granular control over items of interest (device, inputs, outputs, links, connections). Changed device sync ping to include name, also use for response to /who message. Detailed device metadata available through subscription. commit 2825aa4ba58a27af61b619d6780cf718f44d7c1c Author: Joseph Malloch Date: Sun Nov 17 18:28:40 2013 -0500 First attempt at implementing configurable monitor subscriptions using p2p communications instead of shared bus. commit 811de5093b690c7f201a75181b40fd4e0309f86c Merge: 6bd210c 6a8e558 Author: Joseph Malloch Date: Wed Nov 13 10:58:35 2013 -0500 Merge branch 'vector-props2' into vector-indexing commit 6a8e558a4a358f493a0411b987af99866c2d16c4 Author: Joseph Malloch Date: Wed Nov 13 10:52:32 2013 -0500 Java bindings: enable vector values for signal minima and maxima - using PropertyValue class. commit 7e0a75aa289b71754a625742714ca0dad9db7049 Author: Joseph Malloch Date: Tue Nov 12 17:17:40 2013 -0500 Java bindings: enable vector property values. commit 7c2660ab6cc482e8da9d1195977fd1ba13057853 Merge: 9174b46 37243ed Author: Joseph Malloch Date: Mon Nov 11 11:56:30 2013 -0500 Merge branch 'master' into vector-props2 commit 37243ed573dcdd4859fc78c7bc0a2604e73d9453 Author: Joseph Malloch Date: Mon Nov 11 11:53:16 2013 -0500 Java bindings: fixes for testreverse class commit 409388047e77feddecf8070fd105de25670ff0cf Author: Joseph Malloch Date: Mon Nov 11 11:35:37 2013 -0500 Java bindings: fixed bugs in remote value queries, testquery. commit 2bf64cbaa406010261404bcb79aad637061b44e7 Author: Joseph Malloch Date: Mon Nov 11 10:52:51 2013 -0500 Java bindings: more overloading of reserve_instances() function to allow passing special instance callbacks. commit 2d8d658005fa9c7136263aa2b8843a282d59182f Author: Joseph Malloch Date: Sun Nov 10 21:31:45 2013 -0500 Java bindings: adapting test programs and makefile. commit 6059e91159b3853c871942f714db0d12232dbedb Author: Joseph Malloch Date: Sun Nov 10 20:53:38 2013 -0500 Java bindings: fixed bug in timetag processing. commit 86bb8f6b6a7258300c10defe1c6bc49a268c3288 Author: Joseph Malloch Date: Sun Nov 10 20:39:34 2013 -0500 Java bindings: add methods for handling doubles. commit 12c706a0142d09fe3e7032908dd139dd301444cb Author: Joseph Malloch Date: Sun Nov 10 20:29:21 2013 -0500 Java bindings: update instance reservation functions for compatibility with recent libmapper changes. commit 3a93000d24b4bb7a8f966a756fe80f08b430f513 Author: Joseph Malloch Date: Sun Nov 10 20:19:41 2013 -0500 Java bindings: add device constructor without specifying starting port. commit 73d8dedeaa6ff4d9d14aae38d222596e913ddbab Author: Joseph Malloch Date: Sun Nov 10 12:50:28 2013 -0500 Fixed compilation errors due to enum/int comparisons and uninitialized variable. commit 442c0c3e079159cb16f96a2bbdd82b407ff3ac85 Author: Joseph Malloch Date: Sun Nov 10 11:29:25 2013 -0500 Added rough portfile for MacPorts package manager. commit 9a740652ea683896c140caca51c89cfcd0f43e4c Author: Joseph Malloch Date: Sat Nov 9 15:22:33 2013 -0500 Updates for consistency with previous changes made for Swig 2.0 compatibility. commit 819afff17b59a4fbfcf943b67208b46c97da09a1 Author: Joseph Malloch Date: Thu Oct 31 14:45:45 2013 -0400 Fixed memory leak in expression parser. commit 6bd210ce34eb1e7d85dc69629915ab8fa41809ad Author: Joseph Malloch Date: Tue Oct 22 14:01:42 2013 -0400 Adapted test to utilize linear scaling between vector signals. commit 7f7aae54888f657e319078d89803fb47baf05edb Author: Joseph Malloch Date: Tue Oct 22 14:00:04 2013 -0400 Expression parser: Restored final typecast check. commit d5f9731be2639cf136ba8c067d601cbcbb6bf8c8 Author: Joseph Malloch Date: Tue Oct 22 13:21:33 2013 -0400 Added vector functions all() and any(), expanded and cleaned-up testparser. commit 7f6204a002947a4bc7e9335935338749544bb76d Author: Joseph Malloch Date: Sun Oct 20 16:27:11 2013 -0400 Expression evaluator: moved for() loops inside switch() for efficiency processing vector signals, also use preprocessor to enable/disable debug output. Speedup of approx 100% on testparser. commit 96580483df4fbe8234c19068a0af59713fb75ebb Author: Joseph Malloch Date: Sat Oct 19 21:07:07 2013 -0400 Adapted connection code to correctly generate default expressions for linear and calibrate modes. commit 08ddeeba04279bbd19145d84eedea4ca0d262164 Author: Joseph Malloch Date: Sat Oct 19 20:38:07 2013 -0400 Cleaned up testparser and added more test expressions. commit 81a6f84939a61c2500ef608a5960e0ab5781e264 Author: Joseph Malloch Date: Sat Oct 19 20:36:02 2013 -0400 Expression parser: simplified vector-length and type checking/promotion. commit 9d0833447c864cb5927784c301bd83bd5ea1ee5f Author: Joseph Malloch Date: Thu Oct 17 18:36:47 2013 -0400 Expression parser: fixed typecasting bug. commit c21cc86489e485385f6618e8491ce55620ce9446 Author: Joseph Malloch Date: Thu Oct 17 15:56:50 2013 -0400 Adapted testparser for testing multiple expression strings. commit 6ebc0156869cd760f399d27fee867c13d10821cd Author: Joseph Malloch Date: Thu Oct 17 15:55:41 2013 -0400 Expression parser: fix bug in vectorizer when type is int or double. commit 70f317c76c23599ef3761fdab177141d80709f5e Author: Joseph Malloch Date: Thu Oct 17 15:55:06 2013 -0400 Expression parser: fix typecasting. commit b8814fc3fe08087992ed84c273e91f571dce4f2a Author: Joseph Malloch Date: Thu Oct 17 15:54:08 2013 -0400 Expression parser: Fix references to old variable identifiers. commit d53c622a4d643221fa1876c7f5cbe71018f14b3e Merge: 4c7c0e9 9174b46 Author: Joseph Malloch Date: Wed Oct 16 21:06:14 2013 -0400 Merge branch 'vector-props2' into vector-indexing Conflicts: src/connection.c src/expression.c commit 4c7c0e90ec199ce1e5bb4c12c1fe53b341593ec4 Author: Joseph Malloch Date: Wed Oct 16 17:47:10 2013 -0400 Expression parsing: fixed problem distinguishing between variable vector-indices and standalone vector syntax; fixed vector-length promotion. commit 77bbb58f812d96ed253fa4636dcd2cc1a0a94548 Merge: 612cbfe 6d54605 Author: Joseph Malloch Date: Tue Oct 15 14:30:46 2013 -0400 Merge branch 'master' into vector-indexing commit 9174b46d93e4e2e0ee786dc047f91ffe05937990 Author: Joseph Malloch Date: Tue Oct 15 13:32:26 2013 -0400 Use maybePropVal structure for handling signal update typemapping. commit 4f90b6cd87856c5b6e7869e3a4a42769fa90b9b8 Author: Joseph Malloch Date: Sat Oct 12 19:49:18 2013 -0400 Python bindings: fixed another free() bug commit b6145bcf7d7716a722918ed9d19b47bda9b9f04a Author: Joseph Malloch Date: Sat Oct 12 18:55:08 2013 -0400 Swig/Python bindings: Fixed pointer bug commit a7bb3694ce2a7e814a657de4df505ff8582165c7 Author: Joseph Malloch Date: Sat Oct 12 18:16:02 2013 -0400 Provide vector ranges in test.c commit 1683bc0286e71a4c9ad0cfd539239e15739eb8f4 Author: Joseph Malloch Date: Sat Oct 12 18:15:35 2013 -0400 Fixed bugs freeing and reallocating memory for table values. commit ca996e6ba9657415bf6eef2e48c6650cff1af113 Merge: 856dbd2 6d54605 Author: Joseph Malloch Date: Fri Oct 11 13:23:19 2013 -0400 Merge branch 'master' into vector-props2 commit 6d546058cb6f34f2a7269a0bbf76156c9848a614 Author: Joseph Malloch Date: Thu Oct 10 15:06:59 2013 -0400 Fix tutorial paths needed by make dist commit 856dbd25fd5e6b053c6bf3bf50da814fc17847c0 Author: Joseph Malloch Date: Thu Oct 10 14:50:19 2013 -0400 Added datatype coercion function for maybePropVal struct, fixed bus in set_minimum()/set_maximum() functions. commit f910a57da1e3b68c589908221a8db1b5d4abfa60 Author: Joseph Malloch Date: Tue Oct 8 21:03:40 2013 -0400 Removed remaining usage of mval union in favour of signal-native datatypes for range properties. commit 4a97965707ea322a0d0e01e9c060a0affdc8b3d3 Merge: bc6405b 54d36ec Author: Joseph Malloch Date: Tue Oct 8 20:31:31 2013 -0400 Merge branch 'master' into vector-props2 Conflicts: src/db.c swig/mapper.i commit 54d36ec8120a42df8e5fab77e57dbb6dd2254bda Author: Joseph Malloch Date: Tue Oct 8 20:24:24 2013 -0400 Swig/Python bindings: do not supply default starting ports for devices in test programs. commit 957695b45e59acb6cf9367cb61de0438bc1bee68 Author: Joseph Malloch Date: Tue Oct 8 20:20:25 2013 -0400 Swig/Python bindings: do not supply default starting port to libmapper in device constructor. commit ad12989ab2b9ce98167da53568c393908b6d1a35 Author: Joseph Malloch Date: Tue Oct 8 20:10:38 2013 -0400 Swig/Python bindings: range data should be handled internally as doubles. commit ff1422569eb0e7557ea513a92d5b94ea682bbf37 Author: Joseph Malloch Date: Tue Oct 8 20:09:46 2013 -0400 Handle range data sent as doubles commit 70407bba894296f1a40eeb738b8f275113c1008f Author: Joseph Malloch Date: Tue Oct 8 20:08:58 2013 -0400 Swig/Python bindings: Restored range property to tuple. commit bc6405b69c66d20a956f30a76f7dbc968021b723 Author: Joseph Malloch Date: Tue Oct 8 15:15:06 2013 -0400 Swig/Python bindings: Debugging and simplifying property get/setters. commit da164823b86fdf4035814645f4f4fcdb7d7c0331 Author: Joseph Malloch Date: Thu Oct 3 17:25:05 2013 -0400 Swig/Python bindings: working on changes for vector props. commit 151ecb2c11d5d0f43327330352d6ff1dfffc0815 Author: Joseph Malloch Date: Thu Oct 3 17:24:05 2013 -0400 Switch connection ranges from mval union to arrays with same type as signal. commit a983085b1ba5b4a5edddb82c4fba2fff9790f865 Author: Joseph Malloch Date: Wed Oct 2 08:21:11 2013 -0400 Simplified pointer referencing when storing valuesin string table. commit 875934f7943a5a6e1a85bd04a74d3f846cc7d28e Author: Joseph Malloch Date: Tue Oct 1 21:52:45 2013 -0400 Fixed name of scope_names property in string table. commit 40d5dd4a6885806abcc2cea335fe40d98bcb7852 Author: Joseph Malloch Date: Tue Oct 1 21:39:33 2013 -0400 Update test programs. commit a5b16cc15076b9a9cee5a28b6dc08b01b5130cf3 Author: Joseph Malloch Date: Tue Oct 1 21:39:07 2013 -0400 Added function mapper_prop_pp() for help printing typed values. commit a2c05518d739334892dd1b43279eff4bf8dc9248 Author: Joseph Malloch Date: Tue Oct 1 21:38:14 2013 -0400 Removed more mvals, fixed string pointer bugs. commit 2248de587b0456f0287d5430b4d2d1996174cf10 Author: Joseph Malloch Date: Tue Oct 1 21:36:12 2013 -0400 Initialize lengths of added properties. commit 0e975c8ea8af632307e22738555a8586093e9e87 Author: Joseph Malloch Date: Mon Sep 30 20:02:53 2013 -0400 Trial: moving away from lo_arg union for handling libmapper properties in favour of typed arrays. commit d9e0de731358e2dfc81bc7e8e2f97c0c5a8fa695 Author: Joseph Malloch Date: Fri Sep 27 11:35:48 2013 -0400 Adapt testdb.c for vector extrema properties, remove test for separate range property. commit 93e78ef6016196467f3c389d17cd42cad819601e Author: Joseph Malloch Date: Fri Sep 27 11:34:59 2013 -0400 Parameter parsing: if a property key has no values, set type and value entries to 0. commit a587c8ebf9e5d4275f5d5632c8e2b572af8b927d Author: Joseph Malloch Date: Fri Sep 27 11:33:52 2013 -0400 Allow creation of connection db entries with unknown signal length properties; include signal lengths in mapper_db_dump(). commit 796cbe286a9080d0bda4cab73a064be6bd3efc47 Author: Joseph Malloch Date: Fri Sep 27 11:32:41 2013 -0400 Connection db: Need to parse src and dest length properties before extrema properties in order to known if vector lengths match. commit 48d26031db1c5c7c5f9393d88fe78128caa751ad Merge: b7c491a 1708248 Author: Joseph Malloch Date: Thu Sep 26 18:24:51 2013 -0400 Merge branch 'master' into vector-extrema2 Conflicts: src/monitor.c commit 1708248ac54d4282220a658bb2c6be169c9919d9 Author: Joseph Malloch Date: Thu Sep 26 18:23:23 2013 -0400 Only need to dispatch modify message if it contained properties. commit b7c491a753178190e274f309ca931e0df40516eb Author: Joseph Malloch Date: Thu Sep 26 18:21:58 2013 -0400 test.py: removed range prop, added test for vector extrema. commit 723ded40b2e36e53ebe3062dc27c7874fb5bb9b2 Author: Joseph Malloch Date: Thu Sep 26 18:19:48 2013 -0400 Testparams.c: removed special tests for range property, added test for vector src_min. commit 140524e3db56ad900e30470895719c26b79c5f86 Author: Joseph Malloch Date: Thu Sep 26 18:01:58 2013 -0400 Python bindings: adapted typemaps for vector minima and maxima in db_connection struct. commit 98b19b5fbd3fac8a793c9e031a6d70fe47fe0edd Author: Joseph Malloch Date: Thu Sep 26 18:00:29 2013 -0400 Removing references to obsolete range property. commit cc0edcedf8407ec5cbd8c91f56883b0b9da89dda Author: Joseph Malloch Date: Thu Sep 26 17:58:49 2013 -0400 Pass mapper_db_connection_t to mapper_msg_prepare_params() commit e56f56d04a3a37a6055aa71469899321a2a286ca Author: Joseph Malloch Date: Thu Sep 26 17:57:03 2013 -0400 Fixed error-checking for setting linear expression. commit 660945beb67fcea6d269af544a0be277cae94bb2 Author: Joseph Malloch Date: Thu Sep 26 17:56:12 2013 -0400 Fixed error-checking for boundary processing. commit 903f15eb83aa9ccee24409cd45ad78fed61d57c2 Author: Joseph Malloch Date: Thu Sep 26 17:54:47 2013 -0400 Can't use memcpy for signal value -> mval union. commit da5721e8ed87b0215543561d649c721ef9928b7c Author: Joseph Malloch Date: Thu Sep 26 17:53:39 2013 -0400 Corrected arguments for mapper_expr_evaluate() commit 3c17cf9577e455fcfc5722dac853cbe2964226ee Author: Joseph Malloch Date: Thu Sep 26 17:52:53 2013 -0400 Allocate memory for connection ranges when needed. commit 510b8e03cd2f7818553cd33fb6452a4cc4bd65f9 Author: Joseph Malloch Date: Thu Sep 26 17:47:57 2013 -0400 Added remaining connection props to flags; only attempt to set connection ranges if appropriate types and vector lengths are known. commit 6aba7c23f36467b04c2ececf9c32c6624094a64d Author: Joseph Malloch Date: Thu Sep 26 17:40:59 2013 -0400 Restored arguments for mapper_expr_evaluate(). And one more... commit f1e69499f8868c5aeac4dc5bc01c518d06587d76 Author: Joseph Malloch Date: Thu Sep 26 14:30:50 2013 -0400 Bugfix: calling _link(), _connect(), or _connection_modify() from monitor with string arguments could have resulted in segfault due to admin message bundling. commit 9129f5bcc5064df8607af96055fc658f04e407d5 Author: Joseph Malloch Date: Wed Sep 25 14:57:47 2013 -0400 Revert addition of linear() function and range variables to expression engine. commit 912b462b451b1b768ac5903c91158d18e5b461c5 Merge: cf7adca 1b47cf6 Author: Joseph Malloch Date: Tue Sep 24 11:05:36 2013 -0400 Merge branch 'master' into vector-extrema2 commit 612cbfef51139f553550681f0378973f7ff69693 Author: Joseph Malloch Date: Mon Sep 23 16:20:24 2013 -0400 Define default expressions for unmatched vector lengths - truncation or zero-padding. commit 5ebbccd14b357f6139cf0586f4a22e4fec0b2526 Author: Joseph Malloch Date: Mon Sep 23 16:00:53 2013 -0400 Fixed problems with operators or functions inside vector-builder - necessitated tracking dimensionality of stack in evaluator. Modified printtoken() function to mark tokens with locked vector-lengths, and added debug printing to vectorization in evaluator. commit 70ae831157434e662cb0596cc9296e599191a3ca Author: Joseph Malloch Date: Mon Sep 23 12:58:23 2013 -0400 Allow use of vectors in vector-builder e.g. [x[1:3],0,0]. This requires tracking arity and vector-length of TOK_VECTORIZE separately. commit 871034732d9724455d267ad8d644629a51367593 Author: Joseph Malloch Date: Sun Sep 22 18:44:58 2013 -0400 Run last typecasting check at end of expression parsing. commit 76df2ec50572d44bcedec460d3d2a6b0cdc2ef62 Author: Joseph Malloch Date: Sun Sep 22 18:44:03 2013 -0400 Truncate or zero-pad vector signals as appropriate in bypass mode; default to bypass mode for connections between signals with unmatched vector lengths. commit ee058ad9015244f906eecfe34d5870409da80436 Author: Joseph Malloch Date: Sun Sep 22 18:33:26 2013 -0400 Enable vector index ranges in the form var[a:b] commit 9b10aa3ec5c91a97a66f75adc6270d478793690b Author: Joseph Malloch Date: Sun Sep 22 16:12:07 2013 -0400 Implemented vector element indexing and vector building in expression parser and evaluator. commit 1b47cf61143d96efc72303c640cda002d60d5cf8 Author: Joseph Malloch Date: Sat Sep 21 18:49:43 2013 -0400 Check vector indexes against signal vector lengths. commit cf7adca0a1ab9bdb860b4dbe449c3f33a2b2b3fe Author: Joseph Malloch Date: Sat Sep 21 18:10:01 2013 -0400 Remove superfluous casting commit 7edd987637fa8d7ca31ff9c0feeb3e13bf5a182f Author: Joseph Malloch Date: Sat Sep 21 18:06:54 2013 -0400 pass both input and output vector lengths to mapper_expr_new_from_string() commit 9de057abcd5758f53d6604a0e0cf311bbe32e8d2 Merge: 9af3bdd 0428a21 Author: Joseph Malloch Date: Sat Sep 21 17:00:34 2013 -0400 Merge branch 'master' into expressions commit e357952b0649ed7382ab95fe1ba03f503674f9c2 Author: Joseph Malloch Date: Fri Sep 20 16:56:37 2013 -0400 Use mval union for storing connection ranges. commit 0428a218512fc218cac4cf1a46d76a50180fde47 Author: Joseph Malloch Date: Fri Sep 20 14:10:32 2013 -0400 Cleaning up some test programs: wait until connections have been established before entering loop. commit a4d48233d8365dfac69df79b87a6b9d5621adb60 Merge: 7291445 9af3bdd Author: Joseph Malloch Date: Thu Sep 19 17:35:56 2013 -0400 Merge branch 'expressions' into vector-extrema2 commit 9af3bdd03e79d94869dd42a6257bd568a142b42d Author: Joseph Malloch Date: Thu Sep 19 17:35:22 2013 -0400 Allow double type for range data. commit 72914453b4d9d9a88adf04af5ba54986ac2f9f92 Author: Joseph Malloch Date: Thu Sep 19 17:34:14 2013 -0400 Adapted testlinear program for new range datastructure. commit 79b9ab16ff1c80a7710f177044e1ae450d2344e5 Author: Joseph Malloch Date: Thu Sep 19 17:33:41 2013 -0400 Removing range property from connections. commit ef0d994141f1161ca25a395c638d4f1095720342 Author: Joseph Malloch Date: Thu Sep 19 17:33:04 2013 -0400 Free destination ranges in connection. commit 224b82083bbe1eb9ba548f369fafe8715aff8090 Author: Joseph Malloch Date: Wed Sep 18 16:57:49 2013 -0400 Added missing function to enum. commit 9f34201af9038ce6e93f2c335a702f442e61e5f3 Author: Joseph Malloch Date: Wed Sep 18 16:12:57 2013 -0400 Parse src and dest extrema references as variables in expression engine; allocate memory for vector extrema. commit 969b5fc1f4a8ae3af8cb50faaa369f543ff7d2e4 Author: Joseph Malloch Date: Wed Sep 11 19:10:58 2013 -0400 Implemented vector connection extrema properties, linear scaling as explicit function in expression engine. commit aa4b2972205b14f1aff5532b890bfd4311a3107c Merge: d940c21 60ff039 Author: Joseph Malloch Date: Tue Sep 10 09:55:25 2013 -0400 Merge branch 'master' into expressions commit 60ff03970f139297d0883b4bea5ac23c94840d22 Author: Joseph Malloch Date: Tue Sep 3 17:18:55 2013 -0400 Revise Python reserve_instances() API commit b802b033304382c2c40f8edd1e2ce7eea3d9d1db Author: Joseph Malloch Date: Tue Sep 3 17:18:08 2013 -0400 Call monitor.poll() in Python example programs to trigger admin message bundle. commit fd1f08cbab0b5ec965e63d60e9e2792ff18f6be4 Author: Joseph Malloch Date: Tue Sep 3 17:17:19 2013 -0400 Fix python db function naming commit 9f2c77abbce0cdf2284a503291bdb5dc06a36290 Author: Joseph Malloch Date: Tue Sep 3 17:16:21 2013 -0400 Fix array allocation in swig typemap. commit 66ede884e446338796cec8cbe9bc0d3b36dbdaf4 Merge: b68d01f b05f287 Author: Joseph Malloch Date: Tue Sep 3 14:56:51 2013 -0400 Merge branch 'instances5' commit b05f287132cff98f6c7517c51b6cb7af737a30fa Author: Joseph Malloch Date: Tue Sep 3 14:56:36 2013 -0400 Updated testinstance commit b68d01f6993ce383c947f6ef77ef8bc3f5d70747 Merge: d028df9 2ffa6c4 Author: Joseph Malloch Date: Tue Sep 3 11:45:22 2013 -0400 Merge branch 'instances5' commit d028df955144623170b85bad1ffc55c64c4f63c5 Author: Stephen Sinclair Date: Mon Aug 26 16:41:24 2013 +0200 Consider the arch in the copy step during swig build. Otherwise, if multiple arches are built, the cp command fails since it tries to copy from multiple destinations to one place, i.e.: cp: will not overwrite just-created ‘./_mapper.so’ commit 2ffa6c42293b0de40a71b12745862a9512b7b882 Merge: 2ea8f31 415949b Author: Joseph Malloch Date: Mon Aug 19 15:46:26 2013 -0400 Merge branch 'master' into instances5 commit 415949b59bda4a815cf50301491312eb49ee5f58 Author: Joseph Malloch Date: Tue Jul 30 18:50:30 2013 -0400 Free device server last so that /logout message bundle sends properly. commit b2927b5f5423e69e12a66b0742b8124db055d10b Author: Joseph Malloch Date: Tue Jul 30 00:11:11 2013 -0400 Only add addr argument if admin has device. commit 05955a325709ed151421291755799b65323fb76e Merge: 2265ebf 6755914 Author: Joseph Malloch Date: Mon Jul 29 07:43:56 2013 -0400 Merge branch 'master' into admin-bundles commit 6755914222df23561c81c2d4ed2690a52ff72d58 Merge: 74a2b34 b2dc211 Author: Stephen Sinclair Date: Mon Jul 29 12:00:45 2013 +0200 Merge remote-tracking branch 'malloch/master' commit b2dc211d7f999d5f92232cbab8a698f8e9e2f8e9 Author: Joseph Malloch Date: Fri Jul 26 23:18:40 2013 -0400 Fixed a couple documentation errors. commit 74a2b34c8d02069bd0db06204ea389420490c33c Author: Stephen Sinclair Date: Mon Jul 22 11:17:51 2013 +0200 Check the result of lo_message_get_source() in handler_device(). commit f4ba45adf086c662e05a2889894093a66cb41ce9 Merge: 978eda9 13fb243 Author: Stephen Sinclair Date: Mon Jul 22 11:03:45 2013 +0200 Merge remote-tracking branch 'malloch/master' commit 13fb2437bdbd2dbfb1be7e0e8ea155e52113f344 Author: Joseph Malloch Date: Sun Jul 21 18:01:07 2013 -0400 Added tutorial for Pure Data bindings. commit 09683f12b3feea88648eca1f3c4c6d9fb293cc6a Author: Joseph Malloch Date: Sun Jul 21 17:59:59 2013 -0400 Added tutorial for new multi-object maxmsp bindings. commit 2265ebf9e0211fcc22fe310641c8cf0e089ef874 Author: Joseph Malloch Date: Thu Jul 18 21:24:11 2013 -0400 Use lo_send_bundle_from() commit ac6f6778a1ce396afafbc07d116c656aa52bcd33 Merge: c07084d 4ab138d Author: Joseph Malloch Date: Thu Jul 18 20:03:17 2013 -0400 Merge branch 'master' into admin-bundles Conflicts: src/monitor.c commit 4ab138df974ab9db1dd07463abd671147cb36af7 Author: Joseph Malloch Date: Thu Jul 18 18:38:29 2013 -0400 Don't assume host returned correctly from message. commit 978eda9d7ba6eb97a10f86273ff2f79ba4a7e008 Author: Stephen Sinclair Date: Thu Jul 18 16:12:09 2013 +0200 Add openjdk amd64 to search path. commit 00393de639e2a28168f4f3c1ec4c119820493dd2 Author: Joseph Malloch Date: Thu Jul 18 00:40:27 2013 -0400 Add more metadata for python setup. commit 0f655e1c7bc69d5615a2a08aa881b2e15df64dbd Author: Joseph Malloch Date: Tue Jul 16 12:02:12 2013 -0400 Update liblo configure check for version 0.27 commit 2ea8f311e5bde717e02713b0a421603634aa51fb Merge: 4929f7c e6183d1 Author: Joseph Malloch Date: Thu Jul 11 17:15:51 2013 -0400 Merge branch 'master' into instances5 commit e6183d1ace593117dfd28ac578e3639a40589b8d Author: Joseph Malloch Date: Thu Jul 11 17:15:26 2013 -0400 Added ability to set links to use any scope. commit 498650cbd2fdc4030d92c79c32afa4f8fc531073 Author: Joseph Malloch Date: Thu Jul 11 17:14:42 2013 -0400 Added connection property @send_as_instance to remaining functions. commit 9a14df3439dd88cf549a97fd9b586bd4d87058d7 Author: Joseph Malloch Date: Tue Jul 9 19:28:44 2013 -0400 Python bindings: Use one typemap for both int and float list array updates. commit c07084d388e5391713ea06d526b6385c05eaf598 Merge: f685c37 0cbb10a Author: Joseph Malloch Date: Tue Jul 9 10:22:50 2013 -0400 Merge branch 'master' into admin-bundles commit 0cbb10a32824f9b48559b3705a36ccc41529ea4e Author: Joseph Malloch Date: Tue Jul 9 10:22:01 2013 -0400 Revert "Python db: Added missing iterator for link_by_src_dest_names." This reverts commit cda2d7b73cd890985ce872fffe4fb0ba68a205b9. commit f685c371b3e862be96322e6abf695122cd900755 Merge: c444b55 cda2d7b Author: Joseph Malloch Date: Mon Jul 8 20:22:18 2013 -0400 Merge branch 'master' into admin-bundles commit cda2d7b73cd890985ce872fffe4fb0ba68a205b9 Author: Joseph Malloch Date: Mon Jul 8 20:21:35 2013 -0400 Python db: Added missing iterator for link_by_src_dest_names. commit d940c21f40a82c2aeb06ab58ebb8b1c8ec8d42b7 Author: Joseph Malloch Date: Sun Jul 7 21:03:47 2013 -0400 Fixed bug handling spaces in lexer. commit 8239e873224ea7f83b126f75f5bc654238700f95 Author: Joseph Malloch Date: Sun Jul 7 21:02:59 2013 -0400 Added constant e to lexer/parser. commit c41efe25eae64117e3335da2bf8f87c60513ae1f Author: Joseph Malloch Date: Sun Jul 7 20:09:42 2013 -0400 Properly handle functions with arity==0 commit b6b14626807d68c75f93ebfbe50ab5354f15ddad Author: Joseph Malloch Date: Sun Jul 7 17:06:52 2013 -0400 Expression lexer: Do not precompute uniform() even if argument is constant commit c444b55788bd2bfca4b0a14d298eac8b9195a4c1 Author: Joseph Malloch Date: Sun Jul 7 12:39:37 2013 -0400 Alphabetized admin message enum and string array. commit 36ccaeca1ecdf484105b020eb091a4c9ce5ada25 Author: Joseph Malloch Date: Sat Jul 6 18:02:59 2013 -0400 Corrected implementation of admin message bundling: since liblo doesn't copy the path strings in lo_bundle_add_message() we bundle messages with arbitrary paths, but we can bundle messages that conform to standard libmapper admin messages. commit 89b9cd8fe7ae81a8c0c8cfd1a90207d074794d85 Author: Joseph Malloch Date: Fri Jul 5 20:53:04 2013 -0400 Call mdev_poll() more often in testsignals to speed up batch requests. This will no longer be necessary once select branch is merged. commit 160c26c40293b654cda1d3e8c85ce4aefcc06b3d Author: Joseph Malloch Date: Fri Jul 5 20:42:53 2013 -0400 Bundle essentially all admin messages. Send bundles at the beginning of new call to mapper_admin_poll(), or when the bundle count >= 20 (perhaps we should use lo_bundle_length() instead, but count is cheaper). commit 4929f7cb5891e4705078f47e0862f2bd0214cc60 Author: Joseph Malloch Date: Fri Jul 5 10:58:37 2013 -0400 Refactoring instance id_map variable naming. commit d015ab6d6056d9d5844ce2c2af5fe9f870e8af51 Author: Joseph Malloch Date: Thu Jul 4 21:25:44 2013 -0400 Revised msig_get_instance_with_local_id() for persistent ids. commit 18a8a778632e57cbbcdbb3455678a0d09ca87786 Author: Joseph Malloch Date: Thu Jul 4 16:39:58 2013 -0400 Fix return type for instance bsearch. commit 8d21bb6dbbcd2facb375dfb8863eac89918c1af8 Author: Joseph Malloch Date: Wed Jul 3 16:19:48 2013 -0400 Use bsearch in msig_get/set_instance_data() functions. commit 1b380a926c8cf07afb6ef8817016cbff76c2f40a Author: Joseph Malloch Date: Wed Jul 3 16:19:17 2013 -0400 Rewriting msig_get_instance_with_remote_ids() to support persistent local ids. commit f4c4cf05a8e8c44095d8175dc6820fa92d7adc4d Author: Joseph Malloch Date: Tue Jul 2 19:36:06 2013 -0400 Add msig_remove_instance() to java bindings. commit a745177c67d529e14ec391770880a2cddc1c66c7 Author: Joseph Malloch Date: Tue Jul 2 19:33:48 2013 -0400 Add msig_remove_instance() to python bindings, use it in testinstance.py commit 7e21694f6dd6d29c1daa2c9dc52f036a6981d614 Author: Joseph Malloch Date: Tue Jul 2 19:22:59 2013 -0400 Revise msig_remove_instance() and add to header file. commit 63ba2d59fe9bbac87bb968e5635779073c8331bc Author: Joseph Malloch Date: Tue Jul 2 19:22:25 2013 -0400 Add id and user_data arrays to arguments for msig_reserve_instances(); function now returns number of instances added. Remove default instance of recvsig and add specific ids in testinstance program. commit 831b63e10c372bd905a8bb4704ea8d27f84f3809 Author: Joseph Malloch Date: Mon Jul 1 16:45:15 2013 -0400 Removed todo. commit d4db3060ad4121f51d288e5a8f169d41073ae84c Author: Joseph Malloch Date: Mon Jul 1 15:30:35 2013 -0400 Properly free instance memory; removed unused variable. commit 791eb9d2518b6a1f89b27898e2fc90e1402731b2 Author: Joseph Malloch Date: Mon Jul 1 13:09:24 2013 -0400 Remove old todo. commit 852ca7bda07c8759ebaecf783b9b4b15bde0d424 Author: Joseph Malloch Date: Mon Jul 1 13:08:46 2013 -0400 Fix bugs in new msig_remove_instance() array realloc. commit e06d3940a5af857b3b4cff1d9f2b99a7ef997747 Author: Joseph Malloch Date: Mon Jul 1 13:07:23 2013 -0400 Call instance event handler (if defined) when scope or connection is removed. commit 4eced8b12785d62e3bc0a692c3269d0b28828779 Merge: 3d0d537 b302e31 Author: Joseph Malloch Date: Mon Jul 1 09:26:36 2013 -0400 Merge branch 'master' into instances5 commit b302e315857b235164e221471ca565a35655dfdd Author: Joseph Malloch Date: Mon Jul 1 09:17:17 2013 -0400 Check for null string in mdev_get_*_by_name() commit df11c0649bc231d5251d0f819b6d79e346607718 Author: Joseph Malloch Date: Mon Jul 1 09:16:19 2013 -0400 Restored ability to set ranges in linear mode by message with expression regeneration. commit 3d0d537f7aa17dcc8fa02834bf25c4c40e25cd4c Author: Joseph Malloch Date: Sun Jun 30 16:06:11 2013 -0400 Fixed another pointer bug calling bsearch. commit 781786b9ccf4633f84b16dd1721c8d7c3488a0a7 Author: Joseph Malloch Date: Sun Jun 30 13:42:38 2013 -0400 Added function prototype for msig_reserve_instance(); fixed arguments for instance id bsearch. commit 6f90d4c1b7c9811fb6af982187d82cc2d14ede85 Author: Joseph Malloch Date: Sat Jun 29 23:21:12 2013 -0400 Use pointer array to store signal_instance structs instead of linked list so that we can create persistent associations between user-specified instance ids and user_data context pointers. Keep array sorted and use bsearch to look up instances efficiently by id. commit b8154cc2375833ee7ac2b33fc2233903d4f1e391 Author: Joseph Malloch Date: Fri Jun 28 15:53:06 2013 -0400 Do not use result of unsuccessful router search or lo_message creation. commit 200556cfb889d6832bbedcd0e53444828902c519 Author: Joseph Malloch Date: Sun Jun 16 23:05:25 2013 -0400 Check for required signal prop names in msig_set_property(), and allow some flexibility for name min/minimum max/maximum, unit/units. commit fef7a83c842f80aed3a6ed1946e422e2586b211d Author: Joseph Malloch Date: Fri Jun 14 22:02:49 2013 -0400 Added support for signals with vector (list) values to swig/python bindings. commit 0d31a6d76516e6cd9652217994504b90c0266975 Author: Joseph Malloch Date: Mon Jun 10 21:57:59 2013 -0400 Allow querying the value of an instance that has been released remotely. Also allow instance id-matching. commit 06546a51300eb167817018852c5e6abdf63b3741 Author: Joseph Malloch Date: Mon Jun 10 15:03:06 2013 -0400 Rename two python db functions to match C and Python APIs. commit b34f644ec3c3526987a2bfd688e8c40632fcf2a5 Author: Joseph Malloch Date: Sat Jun 8 16:14:45 2013 -0400 Python tutorial: added instances and timetags, fixed pyo example. commit 27bdd6f1c2b3869ebfaa594908b1bd9565fa1281 Author: Joseph Malloch Date: Sat Jun 1 19:36:13 2013 -0400 Ensure properties of type double are included in mapper_messages. commit 069dcb28811741210c39d28345359112ee28ac0d Merge: ec9aabf 7014b89 Author: Joseph Malloch Date: Sat Jun 1 19:09:45 2013 -0400 Merge branch 'master' into expressions commit 7014b892a2fa5bc3ffa5febc91d9013dcdd6a4bf Author: Joseph Malloch Date: Sat Jun 1 16:04:04 2013 -0400 Added example python program showing demonstrating the use of device connection callbacks to label control widgets with the name sof connected signals. commit b306d80add29a0c102816b41028a0f9077b5ba65 Author: Joseph Malloch Date: Sat Jun 1 16:02:58 2013 -0400 Added python test for device callbacks. commit eac009cbfd55c7b5a13b120e5941cd9fdca1a494 Author: Joseph Malloch Date: Sat Jun 1 15:59:44 2013 -0400 Finish adding device link and connection callbacks to python bindings. commit b4a1420be6324be147ac1213123a0acb004d797b Author: Joseph Malloch Date: Sat Jun 1 15:59:16 2013 -0400 Rename mdev_add_*_callback() functions to mdev_set_*_callback() for API consistency. commit 0ee2ebe4eb36773626bb85170d7306f29fd8e010 Merge: ab3dd63 5f58b8c Author: Joseph Malloch Date: Fri May 31 08:39:29 2013 -0400 Merge branch 'master' into python-device-callbacks Conflicts: swig/mapper.i commit 5f58b8c57fd7db636b2a9211416faa289a4b46b8 Merge: 24c2254 5c69573 Author: Joseph Malloch Date: Thu May 30 23:05:54 2013 -0400 Merge branch 'device-props' commit 24c22548df44d4335f57cbd192a906de09a50c73 Author: Joseph Malloch Date: Thu May 30 23:05:36 2013 -0400 Fixed another memory leak and a bug updating signal minimum/maximum properties in db. commit 5c695730a96fe8ab83f266709d5ae5cdd3a8a5cb Merge: 60e6d9f b77469f Author: Joseph Malloch Date: Thu May 30 21:23:56 2013 -0400 Merge branch 'master' into device-props commit b77469fa04e97f04ae5902bd75959a78f104c54b Author: Joseph Malloch Date: Thu May 30 21:19:44 2013 -0400 Fix Valgrind invalid read warning from strncpy. commit 6de1d7054c32de12b22964640a8f30cd9f1287f0 Author: Joseph Malloch Date: Thu May 30 19:33:54 2013 -0400 Free allocated lo_blobs commit 116a59ff2592a6d6d3fab3d86d23ec587bf80199 Author: Joseph Malloch Date: Thu May 30 17:18:01 2013 -0400 Memory leak fix. commit fa40ea54fb592e7239213b7ff540f1b7a42d3e06 Author: Joseph Malloch Date: Thu May 30 17:09:55 2013 -0400 Fix query-related memory leaks. commit 245407bfa0f089ded66f8633a36ce7099da44ee6 Author: Joseph Malloch Date: Thu May 30 16:56:31 2013 -0400 Do not use lo_arg_pp() to print device name. commit 60e6d9f36cf3e2d9b0940cfebeff8749523f646d Merge: cd44e8e c969854 Author: Joseph Malloch Date: Wed May 29 19:57:42 2013 -0400 Merge branch 'master' into device-props Conflicts: include/mapper/mapper_db.h src/device.c commit c9698542bdb16ab3fb4f2f5cb9b6cf46399c4325 Author: Joseph Malloch Date: Wed May 29 19:54:54 2013 -0400 Fixed memory leaks in db, free db structures at end of testdb program to support valgrind memory profiling. commit cd44e8e45b093c1ed08dca5806bba3576bbfe247 Author: Joseph Malloch Date: Wed May 29 14:25:52 2013 -0400 Remove debug printf commit 7b3e2b20d4c72892a8a64a2956a4f842d0f477f0 Merge: 530b093 b0942ce Author: Joseph Malloch Date: Wed May 29 11:59:04 2013 -0400 Merge branch 'master' into device-props commit b0942ce196dfd5c321ae16245e2744d02af906df Author: Joseph Malloch Date: Wed May 29 11:58:41 2013 -0400 Added signal update queueing to python bindings. commit ab3dd63c1bc5699018077d1b76e998a81cafbb6c Author: Joseph Malloch Date: Wed May 29 11:44:35 2013 -0400 Added device-local callbacks for links and connections to python bindings. commit 2719c51d9e0ed1b44c28d2c54ebc6e4304678052 Author: Joseph Malloch Date: Sun May 26 15:22:15 2013 -0400 Enabled separate control of monitor autorequest functionality for signals, links, and connections. commit a8d09481b63f5f12a34be171e7a7c74929b20efd Author: Joseph Malloch Date: Thu May 16 12:51:12 2013 -0400 Python db bindings: Added missing properties for connections and links (including link scopes). commit 25a28f0a9310e4d44bc997ec3d4611f4430557b3 Author: Joseph Malloch Date: Thu May 16 09:35:43 2013 -0400 Parse and store link scopes in db. commit 0b147376affe98ea84ec359df9c5cbe6d1a18dc6 Author: Joseph Malloch Date: Thu May 16 09:09:08 2013 -0400 Added support for multiple values per key in mapper_message_t commit 600b69f556d5d994a1b7200d18aeceaefdcf1996 Author: Joseph Malloch Date: Thu May 16 08:49:22 2013 -0400 Added test program that creates a device and adds 200 signals - useful for testing monitor batch-requests. commit d05091ccf09eba1c2ac7c976b6c54901591118d9 Author: Joseph Malloch Date: Thu May 16 08:47:38 2013 -0400 Removed use of data type lo_address in public API, since it is usually more straightforward to access host name and port directly. commit 57c7620be2bb83f9156bbdf5a85e0d9c25d0ede3 Author: Joseph Malloch Date: Thu May 16 08:37:40 2013 -0400 Refactored mdev_timetag_now() -> mdev_now() and added equivalent monitor function mapper_monitor_now(). Also added Python bindings for these functions. commit 4c892f47b17ca45f296ac76d997463d29f9d80b9 Author: Joseph Malloch Date: Wed May 15 23:04:51 2013 -0400 Add missing connection properties to db. commit fd42cd8f2e22c9288a452c8c2c13946aaa06befb Author: Joseph Malloch Date: Wed May 15 23:00:52 2013 -0400 Fixed reference counting bug in Python bindings when adding and removing signal callbacks. commit 307e3da8995ac5b557e9b61920d3a99625a3534c Author: Joseph Malloch Date: Wed May 15 22:56:56 2013 -0400 Print all connection metadata, reorganized. commit 6ceba75e3229c4a34c6ca467a16049a48929ce19 Author: Joseph Malloch Date: Wed May 15 22:55:57 2013 -0400 Add missing include for stdlib commit c49fc3c791b8a21945d3694f11b8c180cdec431c Author: Joseph Malloch Date: Mon May 13 18:46:17 2013 -0400 Print link metadata in testmonitor. commit 9d0e7b6bc29de37ce3eebe8c2f78ce7323e56c23 Author: Joseph Malloch Date: Mon May 13 18:45:47 2013 -0400 Make automatic connecting a runtime argument. commit 2bd15450ccc75ab2b20bb88426f9f7a8d016e839 Author: Joseph Malloch Date: Mon May 13 18:43:42 2013 -0400 Fix serious bug in monitor batch requests of signal metadata. commit 8b33caf0600f971110ff99325fcc7bb2012c76af Author: Joseph Malloch Date: Sat May 11 14:57:39 2013 -0400 Cleaned up expression syntax documentation. commit ec9aabfd155812ccb8cb2a8f06f057920c4da749 Merge: df6cb67 a0be6b4 Author: Joseph Malloch Date: Sun May 5 14:18:49 2013 -0400 Merge branch 'master' into expressions Conflicts: src/connection.c commit 530b0935480071d765f1889000519eb372a13aa3 Merge: be7cddf a0be6b4 Author: Joseph Malloch Date: Sun May 5 12:53:05 2013 -0400 Merge branch 'master' into device-props Conflicts: include/mapper/mapper.h include/mapper/mapper_db.h src/admin.c src/db.c src/device.c src/signal.c src/types_internal.h test/testexpression.c test/testqueue.c commit a0be6b4c8ec1c2d5eec6ea12bdb0225c104c52b2 Author: Joseph Malloch Date: Sat May 4 16:32:50 2013 -0400 Handle case where provided count value is negative. commit 15f4baf244a053f11c6a75b2dca9bb45fe084d6c Author: Joseph Malloch Date: Fri May 3 04:49:39 2013 -0400 Fixed some documentation comments. commit 8e834a68759307883035fe6e54871be1c78f9fda Author: Joseph Malloch Date: Sun Apr 28 19:26:40 2013 -0400 Added documentation of results from test/testspeed.c commit 42a81ef14e302055509f5f37486e5e69bc186619 Author: Stephen Sinclair Date: Fri Apr 26 12:53:37 2013 +0200 Add libmapper.org to the README. commit 3e677c29ff8ddf7ec71cf329b3bc682eb7f533aa Author: Stephen Sinclair Date: Fri Apr 26 12:41:08 2013 +0200 Add the RtAudio readmes to the release tarball. commit 236896dfc6482afa6886d90e9396b3fe52a27db7 Merge: cb35a26 708b894 Author: Stephen Sinclair Date: Fri Apr 26 12:33:47 2013 +0200 Merge remote-tracking branch 'malloch/master' commit cb35a26a8fea2d5c8f88ca04b29fffadde4912fb Author: Stephen Sinclair Date: Fri Apr 26 12:32:06 2013 +0200 Keep NEWS in a markdown format. commit 9e5515ef8f281cccf6bdc9c4620bfada8618b1a3 Author: Stephen Sinclair Date: Fri Apr 26 11:52:48 2013 +0200 Add some release notes for upcoming 0.3 release. commit bc90cbcc9ed8f69e8254f751d183d1db0cee506f Author: Stephen Sinclair Date: Fri Apr 26 12:27:31 2013 +0200 Update AUTHORS. commit 9368db55bafe72dfed5c77971ec251554b4e2e8f Author: Stephen Sinclair Date: Fri Apr 26 12:19:42 2013 +0200 Update to RtAudio 4.0.12. commit 5cd67e197e076a8c53d3931297bba60a23c5e485 Author: Stephen Sinclair Date: Fri Apr 26 12:05:46 2013 +0200 Globally refer to "instance management events" as just "instance events". commit 708b8949098ef6920cafa4f9b42c071a9cf76f74 Merge: deb3021 842430e Author: Joseph Malloch Date: Thu Apr 25 22:40:43 2013 -0400 Merge branch 'doc' commit deb30219b545c4d493a06b44994a4fd3d741fbf2 Merge: 58be09b 0092004 Author: Joseph Malloch Date: Thu Apr 25 22:40:25 2013 -0400 Merge branch 'jni' commit 58be09b3c7d302e31278f8525135df7ef3c00513 Merge: af20e50 c5b5fd9 Author: Joseph Malloch Date: Thu Apr 25 22:40:17 2013 -0400 Merge remote-tracking branch 'steve/master' commit af20e50f8ff766ec3f92bcce949b5520e47a5ab6 Author: Joseph Malloch Date: Thu Apr 25 22:39:19 2013 -0400 Do not send instance updates over network until parent device has a registered name (since the name hash is used as group id). Once the device is registered, replace NULL group id in id maps of instances that have already been locally activated. commit 761c5473efd7de5dc0c225ef13ffb4529b463cca Author: Stephen Sinclair Date: Fri Apr 26 00:10:15 2013 +0200 Update EXTRA_DIST for tutorials and other documentation. commit c5b5fd9bbd790c5364e6df731c1da77f1e51705d Merge: ca7b2dd 32b680b Author: Stephen Sinclair Date: Thu Apr 25 23:38:57 2013 +0200 Merge branch 'jni' commit 32b680ba1a4ea8e8c9dfc3baed9852bb9b777977 Author: Stephen Sinclair Date: Thu Apr 25 23:33:19 2013 +0200 JNI: If an instance listener is registered, call instead of signal listener. commit 485288e8e9dc8e0366b7339026717f17ff39177e Author: Stephen Sinclair Date: Thu Apr 25 23:31:40 2013 +0200 JNI: Processing app, register instance listeners in instance event callback. commit 958221164691cde35645df7235071381a07a3136 Author: Stephen Sinclair Date: Thu Apr 25 23:30:36 2013 +0200 JNI: Processing app, wait for ready & set the window title to device name. commit baf42a2867e63811b5982e2b2217a257d9f7fb90 Author: Stephen Sinclair Date: Thu Apr 25 23:30:02 2013 +0200 JNI: Process app, decrease framerate. commit 00920043dc571745f32ea09c418ebb1f39802585 Author: Joseph Malloch Date: Thu Apr 25 16:10:40 2013 -0400 Use jint for return type. commit da9e2cfb34769bd88f512be54d4d623960666240 Author: Stephen Sinclair Date: Thu Apr 25 18:31:39 2013 +0200 JNI: Set `genv' before msig_set_instance_data() since it triggers a callback. commit 38e45e5128029be09e8d227b52d9ddfbdb11b186 Author: Stephen Sinclair Date: Thu Apr 25 18:31:22 2013 +0200 JNI: Fix some wrong uses of the `genv' global variable. commit ca7b2dd8059cf30d58100d1a9d56058702bac223 Author: Joseph Malloch Date: Wed Apr 24 10:43:00 2013 -0400 Parse timetag properties as doubles in device_to_py() commit 842430e8c8dd5c51358175c01a3218e32117b947 Author: Joseph Malloch Date: Wed Apr 24 10:31:28 2013 -0400 Added missing underscore. commit 1866e974d1d24210dd0ea5fbdee3181c96a146b7 Author: Joseph Malloch Date: Wed Apr 24 10:29:34 2013 -0400 Redraw testmonitor display periodically to view device sync timestamps. commit a62f69349f16435acfe3646fa77193ea58ece0a8 Author: Stephen Sinclair Date: Wed Apr 24 14:09:45 2013 +0200 JNI: Create symlinks to the jar and .so from Processing's "code" directory. commit df5ac192e4d1a27972fef6d8b11fa0a7f1ccbbf9 Author: Stephen Sinclair Date: Wed Apr 24 12:48:04 2013 +0200 JNI: A basic Processing project to test the JNI instances bindings. commit c74dcdcabff23c9272d6a27335f854b56e59f1d1 Author: Stephen Sinclair Date: Wed Apr 24 13:29:24 2013 +0200 JNI: Target Java 1.5, for compatibility with Processing. commit 578fc369a5284bc5ad6452deb1bf3423bd1a7e72 Author: Stephen Sinclair Date: Wed Apr 24 00:28:12 2013 +0200 JNI: Switch to Device.Signal.set/get_instance_callback() instead. user_data is always treated as an InputListener. User code will have to instantiate an InputListener per instance. commit cdcf04af7281cf4b7f013b0627d3c23199a4b6a3 Author: Stephen Sinclair Date: Wed Apr 24 00:16:55 2013 +0200 JNI: Add Device.Signal.instance_data() and set_instance_data(). commit 06baad219e42eb3f6631fa3b8ac8843e61490c99 Author: Stephen Sinclair Date: Tue Apr 23 23:51:01 2013 +0200 JNI: Add Device.Signal.oldest/newest_active_instance(). commit ea4f97a2dd7e4858670bb450f1da987d500fb706 Author: Stephen Sinclair Date: Tue Apr 23 23:38:58 2013 +0200 JNI: Add Device.Signal.num_connections(). commit 4905b8fec12492d21d95ec14370a77fdd8c8cc30 Author: Stephen Sinclair Date: Tue Apr 23 23:58:49 2013 +0200 JNI: Make stealing mode constants static. commit da64e4ffabf56fb1b92605d18ca42d6c94a8f1c5 Author: Stephen Sinclair Date: Tue Apr 23 23:55:13 2013 +0200 JNI: Add Device.Signal.instance_allocation_mode(). commit 8e14894f93c1e462c3a2ddc5049bae2141b36252 Author: Stephen Sinclair Date: Tue Apr 23 23:32:03 2013 +0200 JNI: Add Device.Signal.reserve_instances(). commit bd4e69c8cc4c627848a0854d49650803f515124d Author: Stephen Sinclair Date: Tue Apr 23 23:27:27 2013 +0200 JNI: in test.java, change input signal back to 'f' so onInput gets called. commit f255a1352b4cdc46106242a8432dad5dd8ab862f Author: Stephen Sinclair Date: Tue Apr 23 23:23:19 2013 +0200 JNI: Free objects associated with output signals too. commit 9a6de3e56f1a319711bcdcd522a252bf68a77e81 Merge: 7fb3c00 3580968 Author: Stephen Sinclair Date: Tue Apr 23 23:18:58 2013 +0200 Merge branch 'master' into jni - Add timetag parameter to instance management callback. - Remove Device.Signal.start_new_instance() commit 7fb3c00e39f439cb1b2e57c6ebf6ec61293c13ba Author: Stephen Sinclair Date: Tue Apr 23 22:50:28 2013 +0200 JNI: Fix "unknown signal type" when value=null in input handler. commit 716987d7d4445064c1ff38b735649fe472eecffb Author: Stephen Sinclair Date: Tue Apr 23 22:42:29 2013 +0200 JNI: remove old set_callback() implementation. commit ae75b7b6e5801b1d129bc8c93cf78601698de568 Author: Stephen Sinclair Date: Tue Apr 23 19:11:52 2013 +0200 JNI: Create & pass in a TimeTag object during input handler. commit 5bba883e3a3a1505fe01aa84a74c2cf758e09c30 Author: Stephen Sinclair Date: Tue Apr 23 19:10:44 2013 +0200 JNI: Don't assume value!=0 in input handler. commit 2fba08aeca3f04b7d38aa89cf60e0aefb638799e Author: Stephen Sinclair Date: Tue Apr 23 18:42:29 2013 +0200 JNI: Add a check any time Device.Signal gets its mapper_signal pointer. commit 6c36c7bd090dabf6e86aaf58c98c844ef4168a12 Author: Stephen Sinclair Date: Tue Apr 23 18:36:21 2013 +0200 JNI: Add a test for the instance callback. commit 8622a61e3b531cdf9d6a9bdde3e5c25d7cd9a258 Author: Stephen Sinclair Date: Tue Apr 23 18:35:50 2013 +0200 JNI: rename Device.Signal.set_instance_event_callback() to set_instance_callback(). commit 799db4f106e2d34eea9d4bd2df4c658ecc314217 Author: Stephen Sinclair Date: Tue Apr 23 18:35:16 2013 +0200 JNI: Fix InstanceEventListener.onEvent method signature lookup. commit 7bf590e723da68d0b04fd28f3809e36bde03c5cd Author: Stephen Sinclair Date: Tue Apr 23 18:24:07 2013 +0200 JNI: Ensure memory for output signal object refs are initialized to zero. commit 65c0a3967235bd31ce41724b56bd9b006e55dcb0 Author: Stephen Sinclair Date: Tue Apr 23 18:11:53 2013 +0200 JNI: Declare instance event type flags static. commit 70be4b100e4ec63e984e88a4635769d4f46b46df Author: Stephen Sinclair Date: Tue Apr 23 18:06:12 2013 +0200 JNI: Add Device.Signal.instance_value(). commit 2507e020c937b4a13eca84628fb527cea50dc63b Author: Stephen Sinclair Date: Tue Apr 23 17:47:31 2013 +0200 JNI: Make TimeTag argument to Device.Signal.value() optional. commit 0d9911f3f70c328d44653e668d65e5c2d1a4a085 Author: Stephen Sinclair Date: Tue Apr 23 17:25:24 2013 +0200 JNI: Add Device.Signal.update_instance() for all data types. Note, as for Device.Signal.update(), we don't include `count' parameter since it can be calculated from the array length and the signal vector length. commit 2b0187e0f0edc14a950d49cb9df71fb88c0c4be5 Author: Stephen Sinclair Date: Tue Apr 23 14:43:59 2013 +0200 JNI: Allow Device.Signal.release_instance() to be called with a default NOW timetag. commit b41a5a0c1b3c86d39f2d7ec4c8dbe2c78ea7b380 Author: Stephen Sinclair Date: Tue Apr 23 14:43:16 2013 +0200 JNI: Fix TimeTag object reference in Device.Signal.release_instance(). commit 1d47d447a72aa8a4f2d2f8a3dc36a4da7bc52c0c Author: Stephen Sinclair Date: Mon Apr 22 22:55:43 2013 +0200 JNI: Add Device.Signal.match_instances(). commit 88ad2d0b0387c8969d48a097750cbd61c67afe53 Author: Stephen Sinclair Date: Mon Apr 22 22:41:08 2013 +0200 JNI: Add several instances-related functions. - Device.Signal.start_new_instance - Device.Signal.release_instance - Device.Signal.num_active_instances - Device.Signal.num_reserved_instances - Device.Signal.active_instance_id - Device.Signal.set_instance_allocation_mode commit bd60d879b0f50adaebcfebca3dfd224e2f2e16c6 Author: Stephen Sinclair Date: Mon Apr 22 22:30:36 2013 +0200 JNI: Add Signal.set_callback(). commit d469e3d96197af0b1bebedd79f8a59daa62a8c52 Author: Stephen Sinclair Date: Mon Apr 22 22:13:45 2013 +0200 JNI: Add Device.Signal.set_instance_event_callback(). commit 33791e9780eabd971569843112115cbec7345904 Author: Stephen Sinclair Date: Mon Apr 22 22:01:22 2013 +0200 JNI: Remove obsolete msig_set_query_callback() stub. commit 1153b6d16fbccbecd2a571b37a323b0845977077 Author: Stephen Sinclair Date: Mon Apr 22 18:13:28 2013 +0200 JNI: Provide a complete set of arguments to the input handler. Still need to construct a valid TimeTag object however. commit f06bb8d6d91e8ffeb0259ccc6042040233c0a661 Author: Stephen Sinclair Date: Mon Apr 22 17:19:59 2013 +0200 JNI: Keep a reference to a Signal object for each signal. This is so that the Signal object can be passed to the InputListener as an argument without creating a new one every time it is called. Device.add_input() and add_output() are now completely native. commit 44e7ab39e2c82d36510e9dfb5d6b03b751ef0c10 Author: Stephen Sinclair Date: Mon Apr 22 15:41:43 2013 +0200 JNI: Rename TimeTag.IMMEDIATE to TimeTag.NOW. commit 358096853ad12b913e4c9e7c83ae8ca92216f210 Merge: 5a782eb 5e25080 Author: Stephen Sinclair Date: Mon Apr 22 13:08:20 2013 +0200 Merge remote-tracking branch 'malloch/master' commit 5e25080e76e21a5781109104492c3361de08c63c Author: Joseph Malloch Date: Sun Apr 21 15:03:11 2013 -0400 Use uint32 for device name hashes throughout; added property and functions for storing/retrieving timestamp of last device sync from db_device, can be used to watch for unresponsive/crashed devices. commit 1b800b33418680f52377bdc118f25d907a07aefe Author: Joseph Malloch Date: Sun Apr 21 08:17:05 2013 -0400 In testsend program, wait for device to be ready before proceeding. commit b6275df58b2683055eaaab3e92ac0caba13f99ff Merge: 7033bed e392af0 Author: Joseph Malloch Date: Sun Apr 21 08:07:38 2013 -0400 Merge remote-tracking branch 'steve/customtransport' commit 7033beda051ebf95ced18f1d8d290449821acf88 Merge: 5849511 3afa5e0 Author: Joseph Malloch Date: Sun Apr 21 08:07:12 2013 -0400 Merge remote-tracking branch 'steve/customtransport' Conflicts: src/receiver.c src/router.c src/signal.c src/types_internal.h test/Makefile.am commit e392af01668d3084f182b0fa5a1f9671abe20102 Author: Stephen Sinclair Date: Sun Apr 21 00:52:19 2013 +0200 Use ioctl to set non-blocking mode. For better cross-platform compatibility. commit 584951126b881c95352d69aeafcaad6ef60953da Author: Joseph Malloch Date: Sat Apr 20 17:32:06 2013 -0400 Update testexpression and testqueue to use monitors for creating connections, use blocking mdev_poll() instead of usleep(). commit 1f2fdfaeb231159222c4645e16a1d25b0665541e Author: Joseph Malloch Date: Sat Apr 20 17:30:22 2013 -0400 Start a device server immediately whether or not the device owns inputs signals. This greatly simplifies later use of queries or reversed connections. Also added @srcPort and @destPort properties to links, fixed receiver initialization. commit 5bb7ab1feaf4cf1913f9ff5f261060d6ce4b721c Author: Joseph Malloch Date: Sat Apr 20 17:17:44 2013 -0400 Do not send empty bundles on input signal update. commit 3234c6ee0aff31d767493c5685664e19614c4c9d Author: Joseph Malloch Date: Sat Apr 20 17:16:42 2013 -0400 Get file descriptors for destination device. commit 43b3dfb60d5bec9c950a4f387ee4281d4dbfde19 Author: Joseph Malloch Date: Thu Apr 18 11:36:53 2013 -0400 Call instance management handler on new instance if registered. commit 8399e1000f738dda79f58959cff41b48cc769dd1 Author: Joseph Malloch Date: Thu Apr 18 10:32:26 2013 -0400 Add option timetag argument to swig bindings for instance release and queries. commit 94d482bf073abfdc4505c4e3243f8abe8481e63d Merge: 13cebab 5a782eb Author: Stephen Sinclair Date: Wed Apr 17 18:54:40 2013 +0200 Merge branch 'master' into jni - Removes Signal.msig_get_rate() and replaces it with the signal properties interface. commit 5a782ebed10ce91296a02e962df0ac03b71bcf39 Author: Stephen Sinclair Date: Wed Apr 17 18:39:32 2013 +0200 Remove pointless msig_get_rate() and use signal props interface instead. commit 13cebabb9ec3a6959d8d91285d5269323a6dd321 Author: Stephen Sinclair Date: Wed Apr 17 17:51:58 2013 +0200 JNI: Add Signal.set_rate() and Signal.rate(). commit 49f760cebb7caa892ab7201fdfef713f5c86f4b0 Author: Stephen Sinclair Date: Wed Apr 17 17:41:45 2013 +0200 JNI: Add optional timetag argument to Signal.query_remotes(). commit 57c6dd56d065d1fdcc61cba428896d2ca584fe6c Author: Stephen Sinclair Date: Wed Apr 17 15:29:52 2013 +0200 JNI: Add support for msig_value(). User must call Signal.value() with a valid array of the correct size, and optionally a valid TimeTag object. The function returns a boolean indicating whether the signal has a value. commit 7f45588a867881cb9d723fcd65502f46b905fb2c Author: Stephen Sinclair Date: Wed Apr 17 15:28:34 2013 +0200 JNI: Add optional timetag support to Signal.update(). commit d820f071d6943922dee5f57d1541b941827efbcc Author: Stephen Sinclair Date: Wed Apr 17 15:23:30 2013 +0200 JNI: Add an initializer for TimeTag supporting sec/frac pair. commit 147fc09c701aea51f35a26b2244c335123ab2f07 Author: Stephen Sinclair Date: Wed Apr 17 15:20:15 2013 +0200 Update documentation for msig_update() with regards to timetag value. commit e640a6f9fb574af11a3442d46fbf0483853ee615 Author: Stephen Sinclair Date: Wed Apr 17 14:46:27 2013 +0200 Include the other JNI-generated headers, and fix some detected function prototype problems. commit ad9147dafeca483b6863de17ef77a62465a6c478 Author: Joseph Malloch Date: Tue Apr 16 13:47:19 2013 -0400 Working on MaxMSP tutorial, replaced ascii art with screenshot links. commit ec8c19d2183d32227633cbd73566a3086a11ea67 Author: Joseph Malloch Date: Tue Apr 16 10:49:27 2013 -0400 Fixed typo. commit 69d6d3467af482fd0744522491589e638ebe6210 Author: Joseph Malloch Date: Tue Apr 16 10:48:56 2013 -0400 Added sections on timetags and instances to C tutorial. commit 232ba96190b6594d4185533e2365e710dd8e37e2 Author: Joseph Malloch Date: Mon Apr 15 16:59:50 2013 -0400 Small change to avoid problem in device-less testprops scenario. commit db92baa28d4c83a25fca948bf73b95ff1c697f94 Author: Joseph Malloch Date: Mon Apr 15 16:59:14 2013 -0400 When freeing device: first release instances, then routers/receivers, to avoid illegal memory access problems and segfaults in swig bindings. commit 3a39645bb492f52594debed95ab47caa1a682147 Merge: a597d46 6d75225 Author: Joseph Malloch Date: Mon Apr 15 12:45:55 2013 -0400 Merge branch 'instances4' Conflicts: src/router.c commit a597d460b5e32b303b103b5eb2a452be0ae553d2 Author: Joseph Malloch Date: Sun Apr 14 19:27:18 2013 -0400 Clean up signal update functions, add optional timetag to signal instance update. commit be7cddfcb646303b07a168e1476ecefa5af61880 Merge: 1ca21d7 0df8ede Author: Joseph Malloch Date: Sun Apr 14 18:12:24 2013 -0400 Merge branch 'master' into device-props Conflicts: src/admin.c src/db.c src/device.c src/mapper_internal.h src/signal.c src/time.c src/types_internal.h commit 0df8ede7d04dc337d75bfa3079317de1d4134631 Merge: e04af5e 88eaef6 Author: Joseph Malloch Date: Sun Apr 14 12:20:42 2013 -0400 Merge remote-tracking branch 'steve/master' commit e04af5ee8ae5866ccdaadc7de9cf3f17ffb58d5c Merge: a1cd894 2f6e2fd Author: Joseph Malloch Date: Sun Apr 14 12:12:15 2013 -0400 Merge branch 'master' into refactor-clipping commit cfe1ceb24bcee041c5caeb8704eae70fe0742cd4 Author: Stephen Sinclair Date: Sun Apr 14 14:26:42 2013 +0200 Add some missing mdev calls to JNI bindings. The following functions were added: - mdev_num_links_in - mdev_num_links_out - mdev_num_connections_in - mdev_num_connections_out - mdev_id - mdev_start_queue - mdev_send_queue A rudimentary, non-functional TimeTag.java class has been added for the last two functions, but needs work. commit 88eaef613eb3b278d32a72ef525ffa9555614cb9 Author: Stephen Sinclair Date: Sun Apr 14 14:01:18 2013 +0200 Add support for use of select() or poll() for waiting on multiple devices. commit 2f6e2fd7f113478e39962b56d0b36e99f30e0557 Author: Joseph Malloch Date: Sat Apr 13 14:25:23 2013 -0400 Remove db callbacks when freeing monitor -- also fixes segfault on monitor destructor in Python bindings. commit 9a51813765259e1544046201176da77fd17e07e3 Author: Stephen Sinclair Date: Sat Apr 13 13:20:06 2013 +0200 Change bug report email address to the mailing list, add http:// to URL. commit 6d752257950177c01c3ff4290f2e32494a0d5af4 Merge: 28ba2ac 6c427ba Author: Joseph Malloch Date: Fri Apr 12 20:27:23 2013 -0400 Merge branch 'master' into instances4 Conflicts: src/device.c src/receiver.c commit df6cb6734c5df4be5a22b94eb622fb3b97ae032e Merge: 28c9d26 6c427ba Author: Joseph Malloch Date: Fri Apr 12 19:54:15 2013 -0400 Merge branch 'master' into expressions commit a1cd894a1ed08296493d057f711bd40f5fc4bea6 Author: Joseph Malloch Date: Fri Apr 12 19:51:06 2013 -0400 Refactor test programs. commit 4ec2317339c834dcf92e0f4b7f1ca72d25e4f43e Author: Joseph Malloch Date: Fri Apr 12 19:17:40 2013 -0400 Refactor clipping -> boundary for swig bindings commit 87da2117ff0f75d9e6a64e481d68f4e132593c1b Author: Joseph Malloch Date: Fri Apr 12 19:06:04 2013 -0400 Refactoring clip/clipping -> boundary commit 6c427ba48c8e5badf6748d52cc947124e719afea Author: Joseph Malloch Date: Fri Apr 12 12:14:23 2013 -0400 Added @libVersion to device properties, value is generated by autoconf and git. commit ec3f34a1ee6d68d256537677a2f81b1253723a4c Author: Joseph Malloch Date: Thu Apr 11 20:44:05 2013 -0400 Fixed erroneous length for devdb_table and condb_table. commit 82ec0ff22b1ce1eb811f67e57a8d71f2d3d49464 Author: Joseph Malloch Date: Thu Apr 11 20:38:29 2013 -0400 Remove processing of obsolete n_connections property. commit 4500412019f40bf7e58e50e21449a742c1c5d4d2 Author: Joseph Malloch Date: Thu Apr 11 10:33:38 2013 -0400 Fix monitor batch request bug resulting from protocol change in commit c7cf756. commit c9cd40ff69b8cd06220af23939f2404036d5a02c Author: Joseph Malloch Date: Wed Apr 10 12:38:58 2013 -0400 Use real timetags for all messages; disable libmapper clock offset updates for now. commit f2d04ee537f174a8978dcd765d2e2ccd7c498352 Author: Joseph Malloch Date: Wed Apr 10 11:01:19 2013 -0400 More memory leak fixes - Valgrind now reports 0 bytes lost when running test.c commit 9346496ce1242dea1d175a9ad6aa9405cb923863 Author: Joseph Malloch Date: Tue Apr 9 22:03:22 2013 -0400 Reduced memory leaks by approx 1KB according to Valgrind. commit e7c48bcfcedaf02f112562d1b074156885eef1cf Author: Joseph Malloch Date: Tue Apr 9 22:01:43 2013 -0400 Rename mapper_db_remove_device() to mapper_db_remove_device_by_name() to match API. commit 9d754006e181ca95f3d52e0a6e313c945a36c80c Author: Joseph Malloch Date: Tue Apr 9 18:22:06 2013 -0400 Fixed illegal memory access bug. commit ddeb221d993b6c208e7958e0f88f8aeeb4decda7 Author: Joseph Malloch Date: Tue Apr 9 18:21:33 2013 -0400 Fixed bug freeing routers and receivers. commit c0da70ff98e36d83bade69ea8e5aabaedd326519 Author: Joseph Malloch Date: Tue Apr 9 17:38:09 2013 -0400 Free unused connection and link_signal memory. commit 3afa5e01eb1801fa865935218009e4cc0d9e35cd Merge: 539740d 58a3684 Author: Stephen Sinclair Date: Tue Apr 9 13:18:49 2013 +0200 Merge branch 'connectcb' into customtransport commit 58a3684c769189d9f10b424c3f3734dd9d7c246d Author: Joseph Malloch Date: Mon Apr 8 12:38:20 2013 -0400 Refactoring callback names. commit df1487362db7f693ccc64911c649d5e144b797a3 Merge: e5e8faf 873504c Author: Joseph Malloch Date: Mon Apr 8 12:30:08 2013 -0400 Merge branch 'master' into connectcb commit 873504ca68d493ef8c347875bd6878ca7d39a837 Author: Joseph Malloch Date: Mon Apr 8 12:29:47 2013 -0400 Refactoring callback names. commit 539740db62d44ed9e45c9af7ce667475562d582b Merge: c192e71 e5e8faf Author: Stephen Sinclair Date: Mon Apr 8 16:15:37 2013 +0200 Merge branch 'connectcb' into customtransport commit c192e717b0490fe37be99eddaca477c99dc63718 Author: Stephen Sinclair Date: Thu Mar 28 13:08:14 2013 -0400 Implement a custom transport mediated by signal/connection properties. On connection, this program establishes a TCP connection during the connection callback and uses it instead of msig_update(). Therefore, in this case libmapper is used only to determine the destination IP and to establish the connection, but it performs no data transformation or transmission. Rather, the program specifies this itself, determined by specifying a custom transport in the signal properties which are copied to the /connectTo message. commit e5e8faffdd8680d9f9f04b220bd146a995e64451 Author: Joseph Malloch Date: Sun Apr 7 18:46:10 2013 -0400 Add local device name to device-stored link properties since we are now using link props in callbacks. commit eaccdac2ccf1c80cb9806e34f6198f2d979c7656 Author: Joseph Malloch Date: Sun Apr 7 17:35:44 2013 -0400 Always add destination type and length to /connectTo message. commit 6d5145069a59fc68a603ddb538dc45bbedfbe4dc Author: Joseph Malloch Date: Sun Apr 7 15:01:48 2013 -0400 Added function for getting the number of connections attached to a specific signal. commit 058b999c331a6ccc27c0e5c36a9b10b358ffd86f Author: Joseph Malloch Date: Sun Apr 7 15:01:06 2013 -0400 Call link/connection callbacks for inputs (receivers) also. commit c11155bb49145dc2cd8acc39201ec48665bbbc4a Author: Joseph Malloch Date: Sun Apr 7 14:59:14 2013 -0400 Added user_data argument to device-side link/connection callbacks; added signal pointer to connection callback. commit b04cc8303e0102c5c374b37c3afc41a65e16f195 Merge: 6097733 1c66a5b Author: Joseph Malloch Date: Sun Apr 7 09:04:28 2013 -0400 Merge branch 'master' into connectcb commit 1c66a5bfadc2804d99ae4f17f11ba156beb7af4c Author: Joseph Malloch Date: Sat Apr 6 20:03:38 2013 -0400 Added monitor function for getting properties for a specific device. commit a9753c5cd4eef62ff7a3ba0d67d876ba48ded0ec Author: Joseph Malloch Date: Fri Apr 5 21:51:13 2013 -0400 Update python bindings with monitor API changes. commit 578c50195a67b637c7ef665f714ca77fadc5c224 Author: Joseph Malloch Date: Fri Apr 5 21:50:36 2013 -0400 Clarify monitor request function names, add functions for requesting only input or only output signals, or only incoming or only outgaing links or connections. commit 28ba2aceb708851be6e3e7d51bb3959ceb9093f4 Author: Joseph Malloch Date: Thu Apr 4 12:41:19 2013 -0400 Don't check id map until needed. commit 6097733db056f4feff66c13ce1a90f48b9a2ca49 Author: Stephen Sinclair Date: Thu Mar 28 13:06:46 2013 -0400 Add callbacks to the local device when links or connections are made or destroyed. Had to move the definition of struct _mapper_device to mapper_internal.h in order to make reference to function typedefs from mapper.h. commit abd96cc320c3461a035d375e99d863c4261435ff Merge: 499165e 1957f00 Author: Stephen Sinclair Date: Thu Mar 28 11:54:52 2013 -0400 Merge branch 'swig2' Conflicts: src/table.c commit 25f917a939ed2d533ee78b31b2951228cde8c96a Author: Joseph Malloch Date: Sat Mar 16 18:33:20 2013 -0400 Debugging instance id_map synchronization with multiple mapped signals and remote releases. commit 34dc6c17eb4118677b4e2b3a56d86365a28fae70 Author: Joseph Malloch Date: Sat Mar 9 08:15:17 2013 -0500 Fixed bugs in instance id_map reference counting. commit 005cbf794dad1c6f7e3bd5610d6be0f0802cc76e Author: Joseph Malloch Date: Tue Mar 5 20:07:48 2013 -0500 Fixed bug where new instance could be activated by downstream release request. commit a334f7763ecf266beec904073506c23baa63d5ef Author: Joseph Malloch Date: Tue Mar 5 20:06:36 2013 -0500 Corrected remote instance release request message format. commit 4490ef0db055d7132f58e928f4e59c986db305c9 Author: Joseph Malloch Date: Tue Mar 5 20:05:46 2013 -0500 Use incrementing public instance ids. commit 3a2c16b0cb6bd9b51f25dfe8eee0e467a64a696d Author: Joseph Malloch Date: Sat Mar 2 20:41:07 2013 -0500 Release active instances when signal is freed. commit 1d44c0799be325ca4e5e6c01c62625c70cb7df6f Merge: e39f304 499165e Author: Joseph Malloch Date: Fri Mar 1 18:43:06 2013 -0500 Merge branch 'master' into instances4 commit 499165e472402d2eecd972c35951ca3c47cbb5d0 Author: Joseph Malloch Date: Fri Mar 1 14:29:57 2013 -0500 Moved tutorials to own folder in /doc, added versions for python and maxmsp. commit fe1463bd2c80a9b2c08b63b71058eba0cfeee572 Author: Joseph Malloch Date: Fri Mar 1 14:28:19 2013 -0500 Fixed function documentation for msig_update(); fixed some formatting, etc. commit 32abaabe0bf169ed5646ebd01b262d9bb5850f7c Author: Joseph Malloch Date: Fri Mar 1 13:46:45 2013 -0500 Use doubles for timetags in Python bindings. commit 1b788d1915ca575e723585a2527e34574ab6dc27 Author: Joseph Malloch Date: Fri Mar 1 12:38:18 2013 -0500 Fixed error in function documentation. commit e39f304e2faf8ad22031d7e6a41c87a6b981851a Author: Joseph Malloch Date: Thu Feb 28 22:30:49 2013 -0500 Fix send_as_instance property on new connections. commit 63fbf67bb2e8bb068c4c84b2e25ff1cc7af97ca2 Author: Joseph Malloch Date: Mon Feb 25 10:07:43 2013 -0500 Added function for getting signal allocation mode. commit 82c6bea25de50ec48ea2e93c41ba098248e650e3 Author: Joseph Malloch Date: Wed Feb 20 18:02:26 2013 -0500 Remove bitflags for obsolete instance properties. commit 1a6bb3fc845079d20ce025fbb96a980a431e938c Author: Joseph Malloch Date: Tue Feb 19 22:05:09 2013 -0500 Fixed segfault when removing connections. commit 8f99d3e400d7263ff5d70cb621555357e781a685 Author: Joseph Malloch Date: Tue Feb 19 22:04:36 2013 -0500 Use maps with zero remote refcount (might be new map)). commit 6e37ef456f871804069aaa60a87d11ee3c111681 Author: Joseph Malloch Date: Tue Feb 19 22:03:18 2013 -0500 Connections should default to using instances if either endpoint signal has multiple instances. commit d205632469d7959b57f3237fa220b5a63b33cd05 Author: Joseph Malloch Date: Tue Feb 19 22:02:10 2013 -0500 Use real timetags throughout; added timetag argument to instance_get functions in case instance stealing results. commit 8ca7d8689cfea01c306e118db9f326a89b5880f3 Author: Joseph Malloch Date: Fri Feb 15 14:56:34 2013 -0500 Adding signal.update() functions with timetag arguments. commit 385b67ea7aff8314e29640acd0c1efb3493b151f Author: Joseph Malloch Date: Fri Feb 15 14:55:37 2013 -0500 Cleaning up timetag and clock functions. commit 581f264186fcc8e227a610a80a5501d7525c4909 Author: Joseph Malloch Date: Thu Feb 14 14:36:20 2013 -0500 Added timetag to instance management handler parameters (Python bindings). commit 8beffe4dfeadd8b27e8f0b2b092e057801ec56f5 Author: Joseph Malloch Date: Thu Feb 14 14:35:48 2013 -0500 Added timetag to instance management handler parameters. commit 258e7532e4ce679f00e47afc36946db328374368 Author: Joseph Malloch Date: Thu Feb 14 14:19:33 2013 -0500 Call instance management handler (if defined) when upstream release messages are processed by the instance handler. commit 3abed09772766335cbbc1086fbac0dab62d4e804 Author: Joseph Malloch Date: Wed Feb 13 17:59:57 2013 -0500 Fixed email address in AUTHORS. commit dcd8855c55c00d521d6195839e61a37d241d54e2 Author: Joseph Malloch Date: Wed Feb 13 16:46:54 2013 -0500 Add instance management callback to python bindings. commit af727081f88ca4537485c69d5151825d72a6ce67 Author: Joseph Malloch Date: Mon Feb 11 16:57:00 2013 -0500 Use automatic instance stealing, but keep explicit user-code release of receiver-side instances. Instance management handler registered with the IN_OVERFLOW flag will take precedence over instance allocation mode. commit 991deb03baf98dbff9acab22cccc3351bd005953 Author: Joseph Malloch Date: Sat Feb 9 11:23:24 2013 -0500 Free link_signals if corresponding input/output signal has been removed from device. commit 5d81b681a6e7b5bd7ba29a8b55048f9904a5ad79 Author: Joseph Malloch Date: Fri Feb 8 21:10:54 2013 -0500 Revert to freeing signals first in mdev_free, but make sure not to reference freed signal when freeing connections. commit 1d84a940cf28cb9395f3b9bea8b3c4486a06b34b Author: Joseph Malloch Date: Fri Feb 8 20:32:51 2013 -0500 Fixed flag arguments calling msig_get_instance_with_local_id(), leaning up TODOs. commit 4b6951096ec69005163882d3d00f129f63881208 Author: Joseph Malloch Date: Fri Feb 8 19:42:08 2013 -0500 Renamed instance id record to index to better reflect its usage; fixed potential overflow bug in msig_reserve_instances(). commit 683267366fbdbc1d9e01447debe458fbd71007fd Author: Joseph Malloch Date: Sun Feb 3 18:28:29 2013 -0500 Fixed bugs setting id_map release flags, memory freeing when freeing device, pointer bug. commit 50d6dd1165b2c396f09a9278dbee89d3bd68d648 Author: Joseph Malloch Date: Fri Feb 1 10:15:15 2013 -0500 Fixed typos and signal handler arguments in tutorial. commit ef75d69b7b4421f24c93a5d9f2359e8da741fd33 Author: Joseph Malloch Date: Thu Jan 31 22:39:13 2013 -0500 Update testinstance for new instance management approach. commit 9719ecf4553384d9563ed6ce7be6d37584be3909 Author: Joseph Malloch Date: Wed Jan 30 22:50:14 2013 -0500 Removed functions for declaring new instances and for setting instance stealing logic, added functions for user-code to discover oldest or newest active instance. Fixed various bugs in new signal-side id_map scheme, though tracking map status is still buggy. commit 047f23b457c4b898fbeba1283736b1e279ae39d1 Author: Joseph Malloch Date: Sat Jan 26 21:12:08 2013 -0500 Reworking handling of active instances to enable unsynchronized instance lifetimes. commit c5e9982b4d3e2788a7063f9caf08e33bdcd45739 Author: Joseph Malloch Date: Tue Jan 22 14:28:14 2013 -0500 Added new db functions to DLL export list, realphabetized. commit 28c9d26b1c09d4a640a3eee52c31ba799f28729f Merge: edbf20b a49f654 Author: Joseph Malloch Date: Tue Jan 22 14:02:37 2013 -0500 Merge branch 'master' into expressions commit edbf20b4b667e36b5545a184016b463da1e20f3f Author: Joseph Malloch Date: Tue Jan 22 14:00:01 2013 -0500 Restore test expression. commit 57b954b8a358af9106f1a88ce474a1b8739cadc8 Author: Joseph Malloch Date: Tue Jan 22 13:55:16 2013 -0500 Copy expression output when type is double. commit 372e079766857f32cce9e809fd79c812da0646b9 Author: Joseph Malloch Date: Tue Jan 22 13:33:35 2013 -0500 Use run-time type casting where appropriate. commit e0e633c8a626eee7dc3db73008c82e209936b2c3 Author: Joseph Malloch Date: Tue Jan 22 10:07:08 2013 -0500 Add remaining cast operations, cast output as necessary. commit 15ab44fd3e191764f7f70a1a28cd0ffe6533bc06 Merge: 5bec784 292acc1 Author: Joseph Malloch Date: Tue Jan 22 10:05:40 2013 -0500 Merge branch 'doubles' into merge-doubles Conflicts: src/expression.c test/testparser.c commit a49f65401ce181a3ce9ec7ffde642d3a62067cbd Author: Joseph Malloch Date: Mon Jan 21 14:40:51 2013 -0500 Free memory used by mapper_connection commit 324d6d1e041af32ecf479cc675db5478fe2f4016 Author: Joseph Malloch Date: Mon Jan 21 13:44:25 2013 -0500 Added missing db functions to python bindings. commit 5bec784332540aa5cdecbac6e9ab6730612f762a Merge: a1013c8 6ced241 Author: Joseph Malloch Date: Sun Jan 20 16:41:00 2013 -0500 Merge branch 'master' into shunting-yard Conflicts: test/testparser.c commit 6ced24176ea72f7b5e0fbe02151b3ecc57d517cb Author: Joseph Malloch Date: Sun Jan 20 16:29:11 2013 -0500 Restore testmonitor screen clearing. commit 797f1584d480bffcadb30f1b7dc784ff032ba8b0 Author: Joseph Malloch Date: Sun Jan 20 16:28:26 2013 -0500 Modified db update functions to return the number of parameters added or modified. Use this information to only call handlers with MDB_MODIFY if params have actually changed. commit dbc32d51b54fdd8272dedc2089c9063892432769 Author: Joseph Malloch Date: Sun Jan 20 14:23:38 2013 -0500 Added db functions for retrieving exact signals from database; restored substring-matching to cmp_match_signal_device_name(). commit c53f3b4f3639e0626764f9f024d05f72d30ecf96 Author: Joseph Malloch Date: Sun Jan 20 13:34:03 2013 -0500 Fixed bug in signal history reallocation; initialize to zero. commit a1013c891d5276fb3b497394f43273e052590102 Author: Joseph Malloch Date: Sat Jan 19 19:13:35 2013 -0500 Increment output history position pointer after expression evaluation to handle conditional output. commit d58fad5f1a60b0e04abd1cb51a23a65801a8b90c Author: Joseph Malloch Date: Sat Jan 19 19:06:22 2013 -0500 Fixed negate/subtract lexing; fixed history indexing. commit 04528f75df678f8d7ca2d67a9c35734429001f67 Author: Joseph Malloch Date: Sat Jan 19 18:24:41 2013 -0500 Reworked lexer to allow distinguishing between subtract and negate tokens without tracking state. commit 0973a14339ac1e379927abd750039da36ab2939a Author: Joseph Malloch Date: Sat Jan 19 10:40:05 2013 -0500 Increase support for doubles; added int and double version s of functions as appropriate; preliminary support for conditionals. commit 3ed404979484285be74c0c2948431f0ed961c0c2 Author: Joseph Malloch Date: Fri Jan 18 19:57:32 2013 -0500 reduce stack size. commit 0a31c8ff7ed949f49b362702f0be81e03899bc0c Author: Joseph Malloch Date: Fri Jan 18 16:53:23 2013 -0500 Use some macros to simplify code. commit 16be7a4aef14f6eee5ebdfc2929343dbb0cec5d5 Author: Joseph Malloch Date: Fri Jan 18 16:06:32 2013 -0500 Added benchmark for expression engine. commit f819fe12ca7de9f2a9aa947ac6b20961cbbd13ac Author: Joseph Malloch Date: Fri Jan 18 16:03:37 2013 -0500 Working implementation. commit 57eab4814be6b2362ec9acbf9326cc1c4ef6d735 Author: Joseph Malloch Date: Thu Jan 17 09:28:22 2013 -0500 Use strcmp() instead of strstr() when trying to match signal names in monitor - this was preventing monitors from registerings new signals if their name was a substring of an existing signal. commit b97adee86203528081fc922b6b818a2cd1c0a808 Author: Joseph Malloch Date: Wed Jan 16 17:40:23 2013 -0500 Working on another expression parser. commit b2ef45290a051d00a2516f0521ee8bb377a9dfbd Author: Joseph Malloch Date: Mon Jan 14 17:38:05 2013 -0500 Added logical NOT to expression parser and evaluator. commit 292acc1d9e4b02f3c478ad7dfce23b6705fd201e Author: Joseph Malloch Date: Mon Jan 14 17:20:21 2013 -0500 Fix reference to MAPPER_NOW. commit 0df19d84d4aec4d7c55871159d14fddc1c389ce6 Merge: 9e24ef1 467f24a Author: Joseph Malloch Date: Mon Jan 14 16:11:55 2013 -0500 Merge branch 'master' into doubles commit 9e24ef17735324428f58efeadf3d107311c90994 Author: Joseph Malloch Date: Mon Jan 14 16:10:15 2013 -0500 Enabled support for double-precision floating point signals. commit b3c19c671dc7f90abbdfe3d86e99895fa4a9af70 Author: Joseph Malloch Date: Mon Jan 14 15:09:21 2013 -0500 Bugfixes: expression parsing and evaluation now supports doubles. commit 9a9617ce005a148e8c9aec08c1ec650484f49120 Author: Joseph Malloch Date: Mon Jan 14 13:57:34 2013 -0500 Switch to doubles for internal function calculation. commit 2024a798d84c8602d4c79d4b5c6de40979ada7d4 Author: Joseph Malloch Date: Sun Jan 13 21:26:38 2013 -0500 Added reference to logical negation in TODO. commit 61c5378c701c01c8a9c27605e93a245e2671e166 Author: Joseph Malloch Date: Sun Jan 13 21:10:51 2013 -0500 Fail if bitwise operators called on floats. commit 2a7c7f56ac1bf998e8901918ac73026651409473 Merge: acb3eb2 467f24a Author: Joseph Malloch Date: Sun Jan 13 13:03:41 2013 -0500 Merge branch 'master' into expressions commit 467f24a920f543b15db598b9e23445be3cd5703a Author: Joseph Malloch Date: Tue Jan 1 13:18:46 2013 -0500 If input signal is released locally, send release request upstream but do not release instance. commit 6e0ccd3edca78b4604af784eca0e5bd3371f8203 Author: Joseph Malloch Date: Wed Dec 26 13:11:19 2012 -0500 Revision of instance release/release_request logic: devices must pass release messages downstream regardless of whether they are the originating device/instance owner. Release request messages will only be used when sending to instance originator. commit d0ff32eb0cbd60f15bebaf0c87541fcdd36f18fb Merge: 91cb68f 9390417 Author: Joseph Malloch Date: Sat Dec 22 17:21:33 2012 -0500 Merge remote-tracking branch 'steve/master' commit 91cb68f7c8f6c0b9f7a1be988e4efa156b8cc561 Author: Joseph Malloch Date: Wed Dec 19 17:59:25 2012 -0500 Renamed MAPPER_TIMETAG_NOW to MAPPER_NOW; also redefined it internally as {0L,1L} to avoid accidental usage - this does not imply anything about immediate dispatch however, since there is no concept of TT_IMMEDIATE in libmapper and all bundles will have real timetags. commit 9390417bffcf327406ea07574073286b49de395d Author: Stephen Sinclair Date: Tue Dec 18 14:12:39 2012 -0500 Add msig_set_instance_management_callback() to DLL export list. commit 30d202c1d46390e91c73943e0e312cd7809b137c Author: Stephen Sinclair Date: Mon Nov 19 10:19:33 2012 -0500 Add instance-related functions to Windows DLL exports. commit 408515d76ede4739be229a4e300dab39d3466a84 Author: Joseph Malloch Date: Mon Dec 17 21:49:28 2012 -0500 Split bundles of reported signals or connections into multiples of 20 messages to prevent bundle from growing too large. commit 353eb97d4f5a883e0876903d2438ebe6d0127d32 Author: Joseph Malloch Date: Tue Dec 11 21:40:50 2012 -0500 Use bulleted lists. commit 91164b2074b1ea9914ca1171fd8493a08c2c6a3e Author: Joseph Malloch Date: Tue Dec 11 21:31:58 2012 -0500 Added expression syntax description to documentation. commit ddb0de90564ae3e1d6b44690e346341e99a5939e Author: Joseph Malloch Date: Sun Dec 9 19:17:25 2012 -0500 Initial rough commit adding doubles to expression parser/evaluator. commit 1ca21d7bc49276601c58d8269c69a48727fa9e1d Merge: 4879ed8 f9dcccb Author: Joseph Malloch Date: Fri Dec 7 14:43:59 2012 -0500 Merge branch 'master' into device-props Conflicts: include/mapper/mapper_db.h src/admin.c src/params.c commit f9dcccb09fc19c2b21be800545ec7b377d9b4e44 Author: Joseph Malloch Date: Fri Dec 7 13:02:47 2012 -0500 Print incoming message as vector in testrate. commit c7cf756274414f2f4bfbc7c230bddfb5d2d6e944 Author: Joseph Malloch Date: Fri Dec 7 12:56:33 2012 -0500 Track incoming and outgoing links and connections separately. commit 914399e490e981f1935a3fd0d301a0150634aaff Author: Joseph Malloch Date: Fri Dec 7 12:12:37 2012 -0500 Fix bug setting default connection @sendAsInstance property. commit 4879ed8dcd16921ecbdd24ea8a22d6d7b137e5d4 Merge: 49f29f4 de7b13a Author: Joseph Malloch Date: Fri Dec 7 11:59:50 2012 -0500 Merge branch 'master' into device-props Conflicts: src/admin.c src/connection.c src/device.c src/types_internal.h commit de7b13aee762e64ba13f336bde0ae0212ac75693 Author: Joseph Malloch Date: Thu Dec 6 13:41:19 2012 -0500 Protocol change: adding handlers for //links/in/get, //links/out/get, //connections/in/get, //connections/out/get. commit 9e4cab6b84983776d58d4a8649ea4cc14d7843b8 Merge: ecaf88b 7c013bc Author: Joseph Malloch Date: Thu Dec 6 11:58:02 2012 -0500 Merge branch 'master' into receivers Conflicts: src/router.c src/signal.c commit 7c013bc37748deff561c6302c71038491caf2f8f Author: Joseph Malloch Date: Wed Dec 5 18:28:48 2012 -0500 Use uint32_t for incrementing network instance IDs since that is how they are sent. commit df57b1fd4c6e269bbb2cf446138c6c110caaaf87 Author: Joseph Malloch Date: Wed Dec 5 17:44:41 2012 -0500 Check for functions exp() and exp2() in expression parser - these were being treated as malformed exponential notation since they start with an e. commit 2e370fb67bc7e76dbb2095deaddfdeeda933806a Author: Joseph Malloch Date: Wed Dec 5 17:36:55 2012 -0500 Allow positive exponential notation. commit c5b8479773fb9024bf40faa4b61611b1b1aa830e Author: Joseph Malloch Date: Tue Dec 4 12:27:04 2012 -0500 Added property @sendAsInstance to connections. This allows over-riding default instance behaviour, e.g. choosing whether a single-instance signal should update all active instances at the destination or should be treated as a unique instance. commit ecaf88b970bd21beaf27ab7c36332d47fdca093d Merge: 1cacb56 db70a09 Author: Joseph Malloch Date: Sat Dec 1 12:03:31 2012 -0500 Merge branch 'master' into receivers commit 1cacb563d7e753293fce8fbf5ef3f56dc329ebd8 Author: Joseph Malloch Date: Fri Nov 30 18:33:00 2012 -0500 Restored query functionality in java bindings. commit 2d58d2007cdda17188cdf46710fd20198eeec8b3 Author: Joseph Malloch Date: Fri Nov 30 18:26:56 2012 -0500 Restored query functionality in swig/python bindings. commit 6838219c9bfa4a0d5999fe545991e8a33b7b005a Author: Joseph Malloch Date: Fri Nov 30 16:13:55 2012 -0500 Re-added query functionality while keeping reverse connections; re-added testquery.c; alphabetized test program names in makefile. commit 49f29f4d1fa467637d8a704c2258e0172e080c15 Author: Joseph Malloch Date: Wed Nov 28 19:42:09 2012 -0500 Added props struct to devices, moving device properties such as identifier, ordinal, name, port from admin to device. Also make cleaner division between clock functions and admins, devices, etc. commit 1957f00b88d9a1196137563160783ec239c1e127 Author: Stephen Sinclair Date: Wed Nov 21 17:23:49 2012 -0500 swig: Change naming of extended struct to comply with how SWIG 2.x handles structs. commit 7a825602b9687a65d90e4c37d68360567ff46cc4 Author: Stephen Sinclair Date: Wed Nov 21 17:13:13 2012 -0500 swig bindings: Remove extra scope around temporary sigval. In SWIG 2.x, (and maybe 1.3?) this extra level of scope causes the sigval to be destroyed even though a pointer to it is retained and used shortly after, causing a crash. commit b2853039aca8ba663ee4a203d9037642a836406c Author: Stephen Sinclair Date: Wed Nov 21 16:47:15 2012 -0500 Replace a use of strcpy with memcpy, fixing a crash due to inlining. On Linux, a use of strcpy caused a crash for unknown reasons when inlined by -O2, but memcpy does not crash in the same place. commit db70a09b2353296b9810b86b190c2fc93a8da6a4 Author: Stephen Sinclair Date: Thu Nov 15 20:02:16 2012 -0500 Add a function to get access to a device's underlying lo_server. commit 7420e1a0218ecf3e597e63f12f6901c08c92bc56 Author: Stephen Sinclair Date: Tue Nov 13 14:32:43 2012 -0500 Update list of DLL-exported functions for Windows build. commit 6a89e440c6cbc60a4e581dd93fbf0821ce020214 Merge: e9d3558 396e8e5 Author: Stephen Sinclair Date: Tue Nov 13 14:43:11 2012 -0500 Merge remote-tracking branch 'malloch/master' commit 396e8e55896faf3f0607b126c847d9a04db7faa8 Author: Joseph Malloch Date: Tue Nov 13 11:06:59 2012 -0500 Fixed typo in function name. commit f3159b1eab85f9da1a3ae5d4b26bc6447e49823d Author: Joseph Malloch Date: Sat Nov 10 20:29:04 2012 -0500 jni bindings for reverse-connections (untested). commit afdf36fd945624620148761e1bea4a04386b8af8 Author: Joseph Malloch Date: Sat Nov 10 20:09:31 2012 -0500 Swig/Python bindings for reverse-connections. commit 57bd87a073e571472be69b0b1e3aa227e3beb323 Author: Joseph Malloch Date: Sat Nov 10 19:45:47 2012 -0500 Implementation of reverse-connections for transporting remote updates of connected input signals. This technique is meant to replace the previous query-response method for acquiring state of remote inputs used for supervised implicit mapping approaches. To make it clear that reverse connections are transporting destination (input signal) _state_ rather than inverting the mapping connection, reverse connections are accessed as a connection mode and thus cannot be used at the same time as e.g. linear scaling or expressions. Replaced testquery program with testreverse. commit e9d35580b84d8ee58777ec4ad498cbe16ed7f7f8 Author: Stephen Sinclair Date: Thu Nov 8 11:50:27 2012 -0500 Revert "Changes for compatibility with swig 2.x" This reverts commit e6929d24f73dfdf810dee45a308b70ba2d706209. Although the fix for SWIG 2.x made the project compile successfully, it did not function, complaining about problems with constructors and destructors. More work is needed to support SWIG 2.x. commit 45400e6089050319ddef73d9fd4cc1eeecc19d90 Merge: af80a53 5dc1aea Author: Stephen Sinclair Date: Thu Nov 8 09:21:35 2012 -0500 Merge remote-tracking branch 'malloch/master' commit ef179ed04e680b5e3a57b9f92390d8430843aab1 Author: Joseph Malloch Date: Wed Nov 7 19:02:37 2012 -0500 Re-allow instance management callbacks for input signals, update testinstance. commit 964c69b23ab81e061689784934f3cd76c385152b Author: Joseph Malloch Date: Tue Oct 30 22:36:45 2012 -0400 Properly register release request handlers; use lo_send_message_from() for sending /linked message since the receiver needs to know sender's IP and port. commit 5dc1aeaef6278c650787d58fcf857561065ebf3d Author: Joseph Malloch Date: Tue Oct 30 13:45:57 2012 -0400 Add new metadata from repeated linkTo messages; use monitor to create links and connections in test.c commit c35430d3576bf881ec3a1965bf7a6a5fa589ba4f Author: Joseph Malloch Date: Tue Oct 30 13:36:03 2012 -0400 Remove obsolete function mdev_send_signal(). commit 3649eae279e80660f73853903e98fea69648544d Author: Joseph Malloch Date: Tue Oct 30 13:34:06 2012 -0400 Added remote instance release request functionality: when an instance of an input signal is released locally (with a call to msig_release_instance), a release request message is sent to all upstream connected signal belonging to a link scoped for the instance. Output signals can optionally register an instance_management_handler (as before) but now a third argument specifies the type of events to call the handler for. commit 76a9ec705fac6568d6561ec3f591a71d103fcd23 Author: Joseph Malloch Date: Sun Oct 28 20:12:55 2012 -0400 Properly release orphaned instances on unlink or disconnect; added scopes to receiver structure. commit 66b95d9234fff332c594e01952e0130616d1c54b Merge: d9909a8 265bcb5 Author: Joseph Malloch Date: Sun Oct 28 17:22:52 2012 -0400 Merge branch 'master' into receivers Conflicts: src/types_internal.h commit 265bcb57c871418c87a11ea3f9bab37be3a0cf2f Author: Joseph Malloch Date: Sun Oct 28 16:51:39 2012 -0400 Fix for problem with out-of-order packets and instance releases: id maps are not removed until reference count is 0 AND a timeout from last relevant remote release message has been received. During this timeout period remote messages matching the id map will not be processed. commit d9909a8afde911b352a5edf3b85be56e770bcdb0 Author: Joseph Malloch Date: Fri Oct 26 20:01:46 2012 -0400 Finished basic integration of mapper_receiver data structure and functionality, including release of remotely-owned instances on scope removal or unlink. Also streamlined freeing of router structures. commit 267f5cb132ea3e82bf57b2bbc84a9afaf4f85925 Merge: 01b4231 219b82e Author: Joseph Malloch Date: Thu Oct 25 15:15:47 2012 -0400 Merge branch 'master' into merge Conflicts: src/admin.c commit 01b42319aeea3a48ef3a6944338e8f14101f786d Author: Joseph Malloch Date: Thu Oct 25 15:12:03 2012 -0400 Added receiver functions. commit 219b82e0ef0035ad26502aac064c2f359c8307ff Author: Joseph Malloch Date: Thu Oct 25 15:01:37 2012 -0400 Update ID map reference count when calling msig_match_instances(). commit 0fe5e9cd00c91651ee75a5dbac93b96bbba32b99 Author: Joseph Malloch Date: Thu Oct 25 10:51:14 2012 -0400 Do not remove unscoped links. commit af80a53afaf221cc5027f4496aaaa5fc9ad1ed2b Author: Stephen Sinclair Date: Wed Oct 24 22:23:54 2012 -0400 Add a check for lo_bundle_count() to build against older versions of liblo. commit 58bdec7adc9807718c3b1186fa263ffdf0ca780b Author: Joseph Malloch Date: Wed Oct 24 20:07:18 2012 -0400 Added receiver data structure, which sits at the destination of a link and mirrors the router at the sending side. For now this object is intended for holding metadata on the link source and connections, information which is needed for sending remote instance release requests. In the future the receiver object could also help recover mapping state after a source crash, and may have an active role in processing datastreams and combining many-to-one connections. commit b95ce883627c98837278824298d11ac60c091069 Author: Joseph Malloch Date: Tue Oct 23 17:03:50 2012 -0400 Do not send empty bundles. commit f1081b3ab4f7cc54d3683f0f2034e1b3eb7d2390 Author: Joseph Malloch Date: Mon Oct 22 22:38:57 2012 -0400 Bundle query responses and return with timestamp from query message. commit 12aa9dded1027ffa60fcd0c5a52808dc26d2bbf0 Author: Joseph Malloch Date: Mon Oct 22 17:54:59 2012 -0400 Send batch-requested signals and connections in OSC bundles. commit dd7033301f74f957d15c72257c16514765c919a9 Author: Joseph Malloch Date: Mon Oct 22 17:39:22 2012 -0400 Fixed monitor bug for autorequesting large numbers of signals or connections - since e62872b @ID has not been an extra parameter, so the functions on_signal_continue_batch_request() and on_connection_continue_batch_request() could not retrieve IDs. commit bc2491cce756d582e18d6b7a04ae3c604ec4f29b Author: Joseph Malloch Date: Thu Oct 18 14:18:48 2012 -0400 Disable liblo message queueing on admin and signal update servers; use timetagged bundle to transport /sync messages instead of including timetag in message; use double instead of float to represent elapsed time in /sync message. commit 86ab6764012d37a1103591028275eba53b548655 Author: Joseph Malloch Date: Thu Oct 18 11:36:47 2012 -0400 Renamed flags for filtering admin output (avoiding multiple responses per polling-step). commit 1ee500b1036984b85fe2a6e8e78e3b820ebdf847 Author: Joseph Malloch Date: Thu Oct 18 09:18:17 2012 -0400 Cleaning up documentation in header files. commit ce0bd4e15d44d8546c6f8b1ff4c3e9f29cba935d Author: Joseph Malloch Date: Wed Oct 17 16:08:04 2012 -0400 Moved #include from signal.c to params.c - it is used by a function moved in an earlier commit. commit 1d911b5123db14f972ab76b1e875b80085a9dc32 Author: Joseph Malloch Date: Tue Oct 16 18:54:56 2012 -0400 Send bundles with timetag LO_TT_IMMEDIATE for now while debugging. commit b9de307b429b42b13220b44da46c510ac08c99f7 Author: Joseph Malloch Date: Tue Oct 16 17:16:24 2012 -0400 remove check for instance; don't calculate tt if adding 0. commit f1d87d3b895772ea98e04017ec3cb2f30ffe8de6 Author: Joseph Malloch Date: Tue Oct 16 10:39:52 2012 -0400 pwm_example: Check if signal has value in signal callback. commit 7ccc12af9918faafbc4367c98baa4149d3276bce Author: Joseph Malloch Date: Sun Oct 14 09:20:12 2012 -0400 Pass local index ids to signal callback in non-instance handler; check for device in timetag/queue funcitons. commit c75d48012df1f9126f5e5daf72507ee1160d919b Author: Joseph Malloch Date: Sat Oct 13 19:35:42 2012 -0400 Fixed bug in signal handler. commit 81a7cee76bae291f3e8e7e2f1b03b0f607c5a55f Author: Joseph Malloch Date: Sat Oct 13 18:24:13 2012 -0400 Modified examples to match new API changes. commit d61b7c7b761d8c926c6f2567f76f8667c0c0497a Author: Joseph Malloch Date: Sat Oct 13 18:23:50 2012 -0400 Modified java bindings to match new API changes. commit 41d610aef4844b9edb63446b3d91a52aa70e126f Author: Joseph Malloch Date: Sat Oct 13 16:33:09 2012 -0400 Modified python bindings to match new API changes. commit 242afe9146ae8bf470b310d445779ede074c26d5 Author: Joseph Malloch Date: Sat Oct 13 16:05:02 2012 -0400 Fixed typo in function name. commit 6665999dd8f6141130ba9b714353f22efe04ab29 Merge: 6ca1f3c 0c4bafe Author: Joseph Malloch Date: Sat Oct 13 14:41:48 2012 -0400 Merge branch 'master' into refactor-instances Conflicts: include/mapper/mapper.h commit 6ca1f3c38cc15b35121738f0fed7a471e20f08b7 Author: Joseph Malloch Date: Fri Oct 12 13:29:31 2012 -0400 Update all active instances on receipt of non-instance update. commit fe52be244bfb86f729ef4675a555eaf5e7fc3349 Author: Joseph Malloch Date: Thu Oct 11 17:02:48 2012 -0400 Use OSC blobs to send vector updates - this avoids type-string confusion between instance and non-instance messages, as well as avoiding inclusion of ridiculously long type-strings with large vector updates (libmapper vectors are homogenous anyway...). This required adding a count variable to the signal callback, while I was changing API anyway I also adapted msig_update and handlers to be more alike. commit 5ef6d86fdeeecd102f958e663dea55cd8d8432f1 Author: Joseph Malloch Date: Thu Oct 11 10:46:28 2012 -0400 Iterate over vector value updates as necessary - testrate now behaves correctly. commit a7ac3784c7453d32e56d45cbc7693a666f023007 Author: Joseph Malloch Date: Wed Oct 10 21:06:01 2012 -0400 Fixed allocation and freeing of instance signal histories in router data structures; moved n_connections records to ratour also. commit b154465e10dcd9cfd3ce0d82eac2b1b8af523b7b Merge: 0bc33e2 3022a42 Author: Joseph Malloch Date: Wed Oct 10 17:04:54 2012 -0400 Merge branch 'global-sync' into refactor-instances Conflicts: src/device.c commit 0bc33e23c744fc6c54d41a5b6c0d7241d99af7be Author: Joseph Malloch Date: Wed Oct 10 16:49:47 2012 -0400 Working on a major reorganization of the router structure, in order to restore modularity of devices and routers with the new instances functionality. Since I am already rewriting large parts of the router I decided to try to reconcile the timetag/queue functionality with the rate/count changes, and to finish adding timetags to the API as needed. In future commits I will finish working out the rate stuff, this commit focuses on moving signal processing memory from the signal data structure to the router. The routers' conception of a mapped signal has been renamed from mapper_signal_connection to mapper_router_signal; as before this structure contains the connections for a given signal, but now it also contains the signal instance input histories if required by the defined expression. In order to handle passing vectors of signals to the msig_update() functions and still allow queueing, it will be necessary to build the message bundles in the routers as we go rather than queueing a list of updated signal instances, since we need to pass a pointer to the vector to the device/routers. For this reason, I have modified the timetagging/queueing API such that the user simply passes a timetag with each update/release/query message; this timetag will be passed with the message when sent and the message will be sent immediately unless the use first calls mdev_start_queue() with the same timetag. Queues are now indexed only by timetag, and an arbitrary number of queues can be built simultaneously. commit 0c4bafe01b3547fe999f89fa24d9fcbb190b6260 Author: Joseph Malloch Date: Sat Oct 6 20:56:49 2012 -0400 Removed placeholders for old queue/timetag API proposal. commit 593fcae5cbe3609fe9f8513fdc9659ebc184c5a4 Author: Joseph Malloch Date: Sat Oct 6 20:56:22 2012 -0400 Add queue argument to release_instance function in python bindings. commit a2348327ae654f2b6740d42702e71ff6cab0e6d4 Author: Joseph Malloch Date: Fri Oct 5 17:38:20 2012 -0400 Removed whitespace. commit 6302f45542df02ef9fdf50309539ae932e006666 Author: Joseph Malloch Date: Fri Oct 5 17:33:57 2012 -0400 Reorganization and refactoring of the signal functions in header files and signal.c; removed some old unused functions. commit bb175e9d40d1b3bf3b4834d93257e55f11f95cb4 Author: Joseph Malloch Date: Fri Oct 5 14:22:57 2012 -0400 Allow instance releases to be queued also. commit e9f988bb3883d96f27f3f1cfdb77181e6c03d3d7 Author: Joseph Malloch Date: Fri Oct 5 14:12:33 2012 -0400 Cleaned up instance managment handler stuff. commit 67512fe3f80e0190e6851c05050a2b3514c9db12 Author: Joseph Malloch Date: Fri Oct 5 13:25:52 2012 -0400 Alphabetized mapper_msg_params commit c7aee5358adf11454fac91c0b992a50d7ea7b1b7 Author: Joseph Malloch Date: Fri Oct 5 12:34:50 2012 -0400 API simplification: added optional mapper_queue argument to msig_update() and msig_update_instance() functions instead of using separate functions for queued output. commit 430bdc2b5c313e298af02f6dcc2b1ed03c66502c Author: Joseph Malloch Date: Fri Oct 5 12:33:26 2012 -0400 Reserve instances for devices in testinstance.py commit d4d6d4f15a504b5b18acedbbec153ac3825cf950 Author: Joseph Malloch Date: Thu Oct 4 15:46:44 2012 -0400 Removed extraneous variable commit 8322e0bd938eafc02a6bf7dfa4a566990d574261 Author: Joseph Malloch Date: Thu Oct 4 13:57:23 2012 -0400 Removed obsolete num_instances argument in python signal declaration functions. commit c80992c235336a98904f468a79c72edeafce2338 Author: Joseph Malloch Date: Thu Oct 4 13:56:27 2012 -0400 Removed infinite loop in query handler. commit e6929d24f73dfdf810dee45a308b70ba2d706209 Author: Joseph Malloch Date: Thu Oct 4 13:22:41 2012 -0400 Changes for compatibility with swig 2.x commit fa7f43a4d001b08e44e7cce8b647ee51f9e3c7b6 Author: Joseph Malloch Date: Thu Oct 4 13:21:49 2012 -0400 Fixed crash when requesting signal info - rate property was being read as double instead of float; also fixed placement of AT_RATE in mapper_msg_param_t enum. commit 3022a42e1c57381c8a9e535db7dc63b2f5af018f Author: Joseph Malloch Date: Wed Oct 3 16:48:09 2012 -0400 Added standard deviation of clock offsets to testsync display output; added function mapper_timetag_get_double() commit d64e7161590c11d2c9e0371fa9c9c09e5be1a6c2 Author: Joseph Malloch Date: Wed Sep 26 16:47:54 2012 -0400 Fixed weighting of future timetags when adjusting clock. commit 7058743eccbb2bc98326043671712507d5d1b4f9 Author: Joseph Malloch Date: Wed Sep 26 14:15:24 2012 -0400 Fixed CPU usage in testsync program. commit 5ceb95e739b9f5a4237eb3a94e7396ba90156e41 Author: Joseph Malloch Date: Wed Sep 26 13:40:11 2012 -0400 Added testsync program to tests. commit 3cd6d52d2bd7b0fe4894563846d3d8072b06c4b0 Author: Joseph Malloch Date: Wed Sep 26 13:39:35 2012 -0400 Fixed some pointer bugs commit a1e783f2c4f27c56f7b61948cc4c6b8e9acd812f Author: Joseph Malloch Date: Tue Sep 25 13:38:53 2012 -0400 Bug fixes. commit 4e1c5be88721428f57335c31837442f26361dd97 Author: Joseph Malloch Date: Mon Sep 24 17:38:32 2012 -0400 Distributed network time synchronization based loosely on concepts from PTP. Devices occasionally send /sync messages; some of these messages are stamped with arrival time by other peers and cached for inclusion in future /sync messages. commit 03b3f10471386ba7019dbca6740042150e7aecfd Author: Joseph Malloch Date: Thu Sep 20 18:37:55 2012 -0400 Rearranged location of some processing, since the earlier instances-master merge broke sending of NULL values (used for releasing instances), which need to bypass the expression and clipping stages. While I was moving things around, I tried to clarify the semantics of what was going on: mdev_route_instance() now simply iterates through the connection_instances belonging to a given signal_instance; the router function it calls is now renamed from mapper_router_receive_instance() to mapper_router_process_instance(); lastly, the functions mapper_router_send_signal() and mapper_router_send_new_instance() no longer actually send anything, since their output may be queued for bundled output and the new function mapper_router_send() actually does the sending. They have been renamed mapper_router_add_message() and mapper_router_add_new_instance_message(). commit 619b60b5b2658458c8b712b34dd5e56e2791d9ea Merge: d5d9ea6 f50cbcb Author: Joseph Malloch Date: Thu Sep 20 16:41:08 2012 -0400 Merge branch 'reserve-stack' into merge-temp Conflicts: src/signal.c commit d5d9ea6844c40f9e11f31c567e48ee90374442e5 Author: Joseph Malloch Date: Thu Sep 20 16:32:17 2012 -0400 Updates for compatibility with instances and timetags merges. commit def29eec4a7ae724fe0e9516f8dfbc1614c53388 Merge: f03328c 48316f3 Author: Joseph Malloch Date: Thu Sep 20 15:34:13 2012 -0400 Merge branch 'instances3' into merge-temp commit f50cbcb377d7b73334a80be55bb61a4392b9f95f Merge: 0aa2365 48316f3 Author: Joseph Malloch Date: Thu Sep 20 15:25:39 2012 -0400 Merge branch 'instances3' into reserve-stack commit f03328c3148f813502cb7b920fb0d130980e90de Author: Stephen Sinclair Date: Mon Sep 17 18:28:01 2012 -0400 Update queue functionality to handle instances. commit 272ffc0a333bdff7967ecc2d6ceb1534265a1cb8 Author: Stephen Sinclair Date: Mon Sep 17 14:09:38 2012 -0400 Add jni.h search paths for OpenJDK 7. commit 42001e6da69e1dc788e1740e7799331cb0b0c31c Author: Stephen Sinclair Date: Mon Sep 17 13:44:05 2012 -0400 Set count parameter to 0 in SWIG and JNI bindings. commit 35dc7c711c9a55f18167aecf3bbf8423244380c6 Merge: c1a200d 0ab9ec8 Author: Stephen Sinclair Date: Mon Sep 17 12:52:15 2012 -0400 Merge branch 'ttags' Leaves queues broken, since the enqueue/send queue operations need to be updated to support instances. Conflicts: include/mapper/mapper.h src/device.c src/mapper_internal.h src/router.c src/signal.c test/Makefile.am commit c1a200de8be522203cbde5830c4b257a94d67af1 Merge: baa82ed 1b141ee Author: Stephen Sinclair Date: Mon Sep 17 12:37:56 2012 -0400 Merge branch 'rate' Conflicts: src/admin.c src/params.c src/signal.c test/Makefile.am commit baa82ed53692728f08f05f157c03434a42d9ccb1 Merge: 1432679 eb2bb77 Author: Stephen Sinclair Date: Mon Sep 17 12:26:42 2012 -0400 Merge branch 'instances3' commit eb2bb7789fb333030b6e4110b06f2ee04baa4e85 Author: Stephen Sinclair Date: Sun Sep 16 11:30:14 2012 -0400 Reestablish roles between signal/device/router for updating instance values. This patch may seem a bit arbitrary, so some explanation is warranted. For example, it moves `msig_send_instance` into device.c, naming it `mdev_route_instance`, in which the passed-in device pointer is not even used. Previously, we had a structure where signals, when updated, requested that the device send out their new values to the routers: Device / \ Signal Router (Input) | Sig Conn | Connection (Output) In the instances branch, some data per-instance, per-signal, per-connection is required because the output history of expressions may differ between connections for the same signal, on a per-instance basis. We now have something more like, Device / \ Signal Router | \ Sig Inst Sig Conn (Input) \ | \ Conn Inst --> Connection (Output) Ideally, the signal shouldn't know anything about links or connections, but since history information is per-signal and per-connection, it was most convenient and efficient to point directly to the connection-specific data from the signal. Unfortunately, I believe that this odd loop in the data structures, besides breaking some principles of opaqueness and separation of concerns, will almost certainly lead to problems in the future if we want to support the idea of remote routers. So this patch splits up handling of per-connection data processing into a service provided by the device, which hands off processing to the concerned routers. However, no look-up in the device or router structures is needed, because the signal already has this information. Therefore it may seem arbitrary since the device and router are not really needed except for the final transport layer, however I think `mapper_connection_instance` should eventually be made opaque to code in `signal.c`, where signal transformation and handling of `mapper_connection_instance` should be performed entirely in `router.c`. Mainly this change is to help in performing the merge with more recent code in other branches, since it is difficult to understand the merge conflicts when core functions, also modified by other branches, have been eliminated and concentrated in `signal.c`. commit 0ab9ec879c6a00faf3f72a2b147022de08748e26 Author: Stephen Sinclair Date: Sun Sep 16 12:32:00 2012 -0400 Handle bundle mechanics implicitly in the router. Makes sense for device to just tell router to simply receive new signal values, and when to dispatch received messages together. Therefore instead of passing it a bundle explicitly, router builds up the bundle as necessary if it hasn't yet received a "send" instruction. This is of course more stateful and less friendly to concurrency, but, I think, cleaner, as the device doesn't need to worry about allocating resources at the transport layer. commit dae7dead036adde1bc8bdbb8d52bca755b6814c3 Author: Gautam Bhattacharya Date: Thu Sep 13 17:40:23 2012 -0400 Add a queue struct for accumulating signal updates, so they can be bundled before sending. commit 48316f35fe5230c5b91eb056ff6629efc864d0b3 Author: Joseph Malloch Date: Sun Sep 16 19:23:10 2012 -0400 Send instance release messages as appropriate when removing connections. commit c6076657ec3acd13022cb5a6d3379d93679f6098 Author: Joseph Malloch Date: Sun Sep 16 17:41:42 2012 -0400 Report results separately for different instance allocation schemes. commit f0be3b902b46063542feded7ea54ef901c6f0c2d Author: Joseph Malloch Date: Sun Sep 16 17:41:10 2012 -0400 Call instance management handler even if instance is not new. commit d345ecd528125cf40297be0651bf46f0f4775925 Author: Joseph Malloch Date: Sun Sep 16 15:53:13 2012 -0400 Rename a couple of functions to match standard naming scheme. commit 99fe6fa4aa71f58b5c981d36a488cbe8661ff42a Author: Joseph Malloch Date: Sun Sep 16 15:52:35 2012 -0400 Merged instance overflow and management callbacks. commit 440a4c43bd237c978a44d1b65848ce6c36632df0 Author: Stephen Sinclair Date: Sun Sep 16 11:29:08 2012 -0400 Fix unused variable warning. commit 7183a5107c5a609376bea53ef5c4cb8f7732c961 Author: Stephen Sinclair Date: Thu Sep 13 17:36:29 2012 -0400 Move mapper_timetag_t definition so it can eventually be used in db structures. commit 1b141eeb5bb7e8cde7f3a5b03f1a5d6b7e9aac59 Author: Stephen Sinclair Date: Tue Sep 11 20:19:27 2012 -0400 Add a test for rate feature. commit dc56233be207c05e612f8e9646fa67eb40acc060 Author: Stephen Sinclair Date: Tue Sep 11 20:19:04 2012 -0400 Announce the "rate" parameter for signals on admin bus. commit c9a3a01d55180a76afdb1912dabe786b283897a1 Author: Stephen Sinclair Date: Tue Sep 11 19:21:28 2012 -0400 Add basic API for specifying the rate of a signal. After rate is set, assumes that user will provide every sample as a stream, possibly provided in blocks. Therefore, the signal becomes "logically timed" according to the specified rate. commit 14326792350334427a27d898e65aa6ab38b2e59c Merge: 524bb8b 1824072 Author: Joseph Malloch Date: Tue Sep 11 14:09:26 2012 -0400 Merge remote-tracking branch 'steve/master' commit 0aa236551a6145bb59676d8fa6e0df0df8b15f12 Author: Joseph Malloch Date: Tue Sep 11 12:52:10 2012 -0400 Moved signal instances back into separate active and reserve linked-lists. This should allow faster insance look-up in scenarios with many inactive instances. commit a7b792b4782f8d25662194409f658caeeaf06a1f Author: Joseph Malloch Date: Sat Sep 8 14:43:27 2012 -0400 Move instance id maps to active and reserved lists, avoid runtime memory allocation. commit 228bc65f46a50af9a9f3d10d88d6ab299731f9e8 Author: Joseph Malloch Date: Thu Sep 6 13:54:41 2012 -0400 Was erroneously setting instance->is_active before checking if new_instance message should be sent to remotes. commit c5d70bf3edc66e51447b505d0ff88f7b0dac99d0 Author: Joseph Malloch Date: Wed Sep 5 19:01:33 2012 -0400 Fixed bugs in id_map management. commit fce381ad74fbada122936f92c002d1d196c906ae Author: Joseph Malloch Date: Tue Sep 4 23:03:38 2012 -0400 Store reference to device id_map in signal instance data structure. commit 1824072dfb6db44efbad23626b66dbf65a133a7b Author: Stephen Sinclair Date: Tue Sep 4 11:57:02 2012 -0400 Update RtAudio to version 4.0.11. commit 1cc834412ba1fbc920efd9b2e027bf2bbeda0acb Author: Stephen Sinclair Date: Tue Sep 4 11:55:40 2012 -0400 Fix Python native module file extension. It's apparently .so even on OS X. commit 3fe0e823c8833667c1f0e1852a2d314dc8474fd4 Merge: 4c658d6 524bb8b Author: Joseph Malloch Date: Mon Sep 3 16:36:33 2012 -0400 Merge branch 'master' into instances3 Conflicts: test/Makefile.am test/testspeed.c commit 4c658d665905a8502c8056fc4f35dfe30ba2977f Author: Joseph Malloch Date: Sat Sep 1 09:37:15 2012 -0400 Fixed bug in reporting best times. commit 5b316116910808d3e8760ae24d8f31d1f2da19e2 Author: Joseph Malloch Date: Fri Aug 31 17:26:13 2012 -0400 Tweaking testspeed program. commit 524bb8b28cc305e3e8c1be0412b53537200b8952 Author: Joseph Malloch Date: Fri Aug 31 16:51:54 2012 -0400 Added testspeed to tests. commit 037f1f65ba6ad576f35ee519c54a5f4f997f7d06 Author: Joseph Malloch Date: Fri Aug 31 15:24:37 2012 -0400 Alphabetized function enum and table. commit cfee69f21a205265254ec0a170d546394109052f Author: Joseph Malloch Date: Fri Aug 31 14:04:22 2012 -0400 Fixed bug in expression parser - was not always checking stack properly for variable or random function references. This meant that e.g. y=round(uniform(100)) would be evaluated immediately instead of on signal updates. commit b312595c8794a5ab65bb1c89ed077d91a1e6cc90 Author: Stephen Sinclair Date: Tue Aug 28 18:34:36 2012 -0400 Send bundles instead of bare signal value messages. This is to prepare for handing timestamps and larger message bundles. commit 07a45ece6797429d49dda5e13bf546aefc991bb6 Author: Joseph Malloch Date: Tue Aug 28 14:34:47 2012 -0400 Added uniform() function to expression parser. commit 2fedd86c5a7efa5335e86cb893cb034e0ec4547b Author: Joseph Malloch Date: Fri Aug 24 14:37:41 2012 -0400 Rename token_t to mapper_token_t to avoid errors when using XCode 4. commit 373ce79fee50dc73c9b69ce79af474eefb07535d Author: Joseph Malloch Date: Sat Jul 28 14:15:44 2012 -0400 Go back to referring to router destination as dest instead of remote. commit 9678199a45aaa429de45dbcb4abc0fed219f652d Merge: b7186f2 789d197 Author: Joseph Malloch Date: Sat Jul 28 13:06:54 2012 -0400 Merge branch 'instances3' of github.com:malloch/libmapper into instances3 commit 789d19796359b610e233b7bdd21f7f5ee1f6dc33 Author: Joseph Malloch Date: Thu Jul 26 21:16:18 2012 -0400 Fixed trace messages. commit 097db41d27643495863a24fae0e0586b29e390c0 Author: Joseph Malloch Date: Tue Jul 24 22:00:58 2012 -0400 Fixed pointer bug in mapper_router_remove_scope() commit b7186f28f3f47940bba693549b62c36c8176beb8 Author: Joseph Malloch Date: Mon Jul 23 20:11:23 2012 -0400 Go back to referring to router destination as dest instead of remote. commit 5844e03f8c594d07146f3ca8251c35c644649907 Author: Joseph Malloch Date: Mon Jul 23 18:19:57 2012 -0400 Release instances when removing them or removing signal. commit f7d02784c08fe5b78a9f0fd4579d435eb75384ad Author: Joseph Malloch Date: Mon Jul 23 17:49:09 2012 -0400 Added function for synchronizing instance id maps between signals. commit 0454b8f66104fb69e08bd7e1451c7158efa1e6d1 Merge: bbbb1ef 98e96ff Author: Joseph Malloch Date: Sat Jul 21 09:31:00 2012 -0400 Merge branch 'master' into instances3 Conflicts: include/mapper/mapper.h src/mapper_internal.h commit bbbb1ef79918db8c467f396829a769322d85b86f Author: Joseph Malloch Date: Thu Jul 19 20:37:24 2012 -0400 Moved release of orphaned instances to /disconnected and /unlinked handlers in a effort to avoid releasing before the source device has stopped sending updates. This is not entirely successful - probably we will need to use a receiver data structure and unlink from both ends to ensure proper release of orphaned instances. commit 26154cb134d179bb26683f4d93fc8582e51bb0ad Author: Joseph Malloch Date: Thu Jul 19 19:27:24 2012 -0400 Removed admin handlers for link_add_scope and link_remove_scope - for now we will just do this with the link & unlink handlers. Removed >2-device linking. Moved release of orphaned instances from admin to device.c commit 72f1233e41be7b8cec51f42232a0218fb944c272 Author: Joseph Malloch Date: Thu Jul 19 12:14:26 2012 -0400 Fixed bug when adding scope to link. commit 3335fe0d1ac7ddda03dd2c738bdb93212babb5dd Author: Joseph Malloch Date: Wed Jul 18 16:59:05 2012 -0400 Release orphaned instances on /disconnect or /unlink. commit c28f11b755095cade7ecabccab697b1db11cabfc Author: Joseph Malloch Date: Wed Jul 18 16:56:39 2012 -0400 Check hash instead of port. commit 8eee09b612646bb398a2cff791d8a2a5f2aa6dcd Author: Joseph Malloch Date: Wed Jul 18 15:25:20 2012 -0400 Added link properties to swig/python bindings. commit 0b05c03fc2c6d47e4e7cbccdc265b2fbd85efb7a Author: Joseph Malloch Date: Wed Jul 18 15:22:58 2012 -0400 Add scope hashes to link property types. commit b4c8d14fb16a4dcefd8b02c90c53e21cfe8c0bfc Author: Joseph Malloch Date: Wed Jul 18 15:20:26 2012 -0400 Ensure query response callbacks are property registered. commit d9059c18e923226a792d93d03791ade40144345e Author: Joseph Malloch Date: Wed Jul 18 09:51:33 2012 -0400 Tweak hash-collision based allocation scheme to make it compatible with previous library versions. commit 3507a787ba4d3e508b804c519bdd690af3e3aa49 Author: Joseph Malloch Date: Tue Jul 17 22:51:44 2012 -0400 Specify link scopes as strings (device names) instead of IDs. Since we are now using CRC-32 hashes of these names for the instance group ID we can recalculate them as needed. commit 1b37b1e8fb61db4da151e00610f4a971333894ff Author: Joseph Malloch Date: Tue Jul 17 21:53:56 2012 -0400 Handle port suggestion, only report port in device metadata if has been bound. commit 254286c5dfa6ecf8f1a42b0bc6c51cae83ea562f Author: Joseph Malloch Date: Tue Jul 17 21:53:05 2012 -0400 Check for zlib in configure. commit 6d26dc6c3b8c5edbd9afa2dc95450fbd75fa6d4c Merge: 2f76ccc 83b3316 Author: Joseph Malloch Date: Tue Jul 17 20:41:01 2012 -0400 Merge branch 'instances3' into crc-32 Conflicts: src/admin.c src/device.c commit 83b3316feead6944713917f855899373b4e1665e Author: Joseph Malloch Date: Tue Jul 17 20:21:04 2012 -0400 Restore port argument to mdev_new() commit 98e96ff58c37e01631708e896b663b1a55e82f5b Author: Joseph Malloch Date: Tue Jul 17 19:20:36 2012 -0400 Documentation update: fixed some mistakes, added param references. commit 28e8df90a6ccffdfa9eb87ae63d156a2ef77467a Author: Joseph Malloch Date: Tue Jul 17 18:37:06 2012 -0400 Refactoring: changed some mapper_db functions to refer to connection sources and destinations instead of (misused) inputs and outputs. commit 2f76cccdc5a43d00d8ea4be71b868b487eb96470 Author: Joseph Malloch Date: Tue Jul 17 17:03:14 2012 -0400 Switching to allocation scheme which checks CRC-32 hashes of device name + ordinal instead of allocating ordinal alone. This will ensure that device name hashes are unique in the mapping network and can safely be used for identifying signal instance ownership. commit cc68c6d2354d0a7fce04ac45017db6412731c3d4 Author: Joseph Malloch Date: Tue Jul 17 12:28:41 2012 -0400 Release associated receiver instances on /disconnect message. commit bdcd9519f97bd1aa1eb67babefc2d41d7db5d2f2 Merge: 0bae6e6 8881fb8 Author: Joseph Malloch Date: Tue Jul 17 11:27:07 2012 -0400 Merge branch 'instances3' into instance-management Conflicts: src/signal.c commit 8881fb840a813ca2f00f80d6c1ec31412bad51c6 Author: Joseph Malloch Date: Sat Jul 14 18:32:37 2012 -0400 Use ID instead of port in msig functions. commit e91439613dcb11192e687e82244138eabdb44471 Author: Joseph Malloch Date: Sat Jul 14 18:32:02 2012 -0400 Add properties to mapper_monitor_link(). commit fffadf7649a01c3ec84f843b3137c5e3f6aff59f Author: Joseph Malloch Date: Sat Jul 14 00:46:03 2012 -0400 Update test files with API changes. commit fdbd87155313c260ad7df9e66308a23400799f5b Author: Joseph Malloch Date: Sat Jul 14 00:45:06 2012 -0400 Allocate ports internally, device IDs using allocation scheme. commit c41e9cb4d0dbfefc25d0e68f5d3bbde109cb4ad9 Author: Joseph Malloch Date: Fri Jul 13 23:16:12 2012 -0400 Fixed crash when replacing expression with malformed string at runtime. commit f072d433e5a65f56779bb18b81d32e806a4942ac Merge: 3b93b61 26fa707 Author: Joseph Malloch Date: Fri Jul 13 18:08:03 2012 -0400 Merge branch 'master' into instances3 Conflicts: src/admin.c src/connection.c src/db.c src/mapper_internal.h src/router.c src/types_internal.h commit 3b93b6171c9c0d03ab4b0fdf88d1a54e8bdf8189 Merge: a5df281 7704091 Author: Joseph Malloch Date: Fri Jul 13 17:15:32 2012 -0400 Merge branch 'link-scope' into instances3 commit 26fa707ed18de27a63d9f489aea5b1670c6c072d Author: Joseph Malloch Date: Fri Jul 13 16:14:58 2012 -0400 Store and report extra link properties. commit 54119adf397726bcb2478a984619f954239e9261 Author: Joseph Malloch Date: Fri Jul 13 15:48:34 2012 -0400 Store and output extra connection properties. commit 92240667a43e7df0ab75a106543c8bc46d65dc86 Author: Joseph Malloch Date: Fri Jul 13 14:36:35 2012 -0400 Use mapper_db_link struct to store props in router. commit b18e3103216fbffe142b4feb103a0825b1c9103f Author: Joseph Malloch Date: Fri Jul 13 13:51:40 2012 -0400 Forgot closing brace. commit 60f1a22aadbeb02e63bceb071a927fb726f03fe3 Author: Joseph Malloch Date: Fri Jul 13 13:49:02 2012 -0400 Fixed bug in mapper_monitor_connection_modify - can't use props in NULL. commit 7704091219d101c4bb0c39b31734760d0024414f Author: Joseph Malloch Date: Fri Jul 13 12:01:51 2012 -0400 User local ID for link scope if scope property not included in /linkTo message. commit a5df281ca6637bde7a91045b31e6063a6f038a3a Merge: 59b26a0 e556c15 Author: Joseph Malloch Date: Thu Jul 12 00:28:33 2012 -0400 Merge branch 'group-id' into instances3 Conflicts: src/router.c commit f53648804eb773af8709e4235972f520343ad10a Author: Joseph Malloch Date: Tue Jul 10 17:40:10 2012 -0400 Removed whitespace. commit 09ab347aa638645590d1f75c45a0b2fc0424fc6b Author: Joseph Malloch Date: Tue Jul 10 17:39:42 2012 -0400 Added handlers for multi-device unlink, link/addScope, link/removeScope. commit 594c8d6500cb171b754807a64dafc02a21d63752 Author: Joseph Malloch Date: Mon Jul 9 18:15:48 2012 -0400 Add link scopes to /linked messages and routers, use for instance routing. commit 6290187c9ddf745251be7efb330a4665b970230d Author: Joseph Malloch Date: Mon Jul 9 13:10:57 2012 -0400 Fixed bug in /link handler. commit bbd8b6467d0e08b3cf6baaf488c1f51e62ed15cc Author: Joseph Malloch Date: Sun Jul 8 17:47:30 2012 -0400 Adding link scopes, ability to process /link messages with >2 devices. commit 0bae6e628a7945298806a10374609d0978b2a7dc Merge: 9dd80de e556c15 Author: Joseph Malloch Date: Wed Jul 4 16:39:22 2012 -0400 Merge branch 'group-id' into instance-management commit e556c15348b206d22776179b219b3a583931c14b Author: Joseph Malloch Date: Wed Jul 4 16:38:30 2012 -0400 Finished merge. commit 59b26a000116d49f800648b182d9a12b83fbf605 Author: Joseph Malloch Date: Wed Jul 4 16:37:21 2012 -0400 Finished merge. commit 7d26f049bb9f9df87ee925f7c05e49dc280dd6a5 Merge: 860788f 3ebe72a Author: Joseph Malloch Date: Wed Jul 4 16:34:26 2012 -0400 Merge branch 'sync-instances' into group-id Conflicts: src/device.c src/router.c commit 3ebe72a5338b0a29ec7b3cef999fc99c671f1aac Merge: 731a4f1 bd4853c Author: Joseph Malloch Date: Wed Jul 4 16:30:39 2012 -0400 Merge branch 'instances3' into sync-instances Conflicts: src/router.c commit bd4853c131fc976a6e52598133213c88c2af0633 Author: Joseph Malloch Date: Wed Jul 4 16:25:24 2012 -0400 Finish merging master into instances3. commit ce70748b0521ea2f5e285dddf458fbf94a786870 Merge: 320296d 3b6385c Author: Joseph Malloch Date: Wed Jul 4 16:15:37 2012 -0400 Merge branch 'master' into instances3 Conflicts: include/mapper/mapper.h src/admin.c src/device.c src/mapper_internal.h swig/mapper.i test/Makefile.am commit 3b6385c2a63c5faf51c0799e75fdd89f1cc687a4 Author: Joseph Malloch Date: Wed Jul 4 08:26:15 2012 -0400 Set handler and user_data after adding/removing query response callback in device. commit 2d28aeab2490c5ac36c9a951ca0b921cf9b150c0 Author: Joseph Malloch Date: Mon Jul 2 19:46:01 2012 -0400 Coerce query response values at query originator instead. commit ff269e7df15e28655425dd9059ecb164e0f84295 Author: Joseph Malloch Date: Mon Jul 2 18:04:01 2012 -0400 Add java testquery program. commit 7a64e3b9d310fe88ee20bfd80233f19f0217b3f3 Author: Joseph Malloch Date: Mon Jul 2 18:03:21 2012 -0400 Update java bindings for new query API. commit bb4bf76ad2f53ec55253fa958b42c22078a59929 Author: Joseph Malloch Date: Mon Jul 2 18:02:33 2012 -0400 Use different signal types in testquery program. commit cdae39f47b018fb68dc2100b9b8cff75263451cb Author: Joseph Malloch Date: Mon Jul 2 18:02:00 2012 -0400 Pass signal type in query message, coerce types in response. commit c5b0c8f6fdd51491a81f2721829592188fe0c980 Author: Joseph Malloch Date: Mon Jul 2 16:56:29 2012 -0400 Fixed pointer and memory allocation bugs in mapper_router_send_query(). commit 662db13ef257bf0261faf225ef249eec7ff97e49 Author: Joseph Malloch Date: Mon Jul 2 14:27:59 2012 -0400 Update swig/python bindings. commit 709befdfd1e4f0cd32724cf5c127c34f968784ee Author: Joseph Malloch Date: Mon Jul 2 10:52:30 2012 -0400 Use existing handler field for pointer to query response callback; set user_data for query response callbacks. commit 860ffefb5a623f5b165902d84bb8bb2103ca18da Author: Joseph Malloch Date: Sun Jul 1 14:50:27 2012 -0400 Send query response string pre-formed for reverse compatibility. commit 1d6e4f39cf08b81e128e62d99f5ab0b20b56185c Author: Joseph Malloch Date: Sun Jul 1 01:05:09 2012 -0400 Need to poll server if device has query callback even if it has no input signals. commit e2208ca05c2c178522fdb51d5e3cc01a9149b7d6 Author: Joseph Malloch Date: Sat Jun 30 13:45:21 2012 -0400 Fixed problems with query response callbacks, response still not working. commit 17fa86eb326e8df6d16773ceaf916686e0d6c90b Author: Joseph Malloch Date: Fri Jun 29 18:28:18 2012 -0400 Burying signal query functionality in library internals, should make more user-friendly. commit 7e34553ed9f5c83c371d3a61a3b75af53893f646 Author: Joseph Malloch Date: Fri Jun 29 15:44:07 2012 -0400 Fixed bug in expression parser for handling floating-point constants > 0 without preceeding 0. commit c8e04ea758d30599f35099663e0daf5c4f035422 Author: Joseph Malloch Date: Fri Jun 29 14:26:50 2012 -0400 Fix for java hidden signals, switch to boolean for hidden property commit 0368282416dc3a88216ce38c308e592b65af0ff4 Author: Joseph Malloch Date: Fri Jun 29 14:07:35 2012 -0400 Update testquery.c with new hidden signal API. commit 7b41d514a4fac210bd59c19e0b37471479aa70da Author: Joseph Malloch Date: Fri Jun 29 14:06:59 2012 -0400 Update swig/python bindings with new hidden signal API. commit a902958652b8b51105468e1aff6021348b654d50 Author: Joseph Malloch Date: Fri Jun 29 14:06:17 2012 -0400 Update java bindings with new hidden signal API. commit 267f6f55c9ef07b0dc4880f2efe7c75005b17c01 Author: Joseph Malloch Date: Fri Jun 29 14:04:23 2012 -0400 Cleaning up hidden signal code: use settable property instead of separate creation function. commit 5987c14291d23b2676c4dc82722f717358b4b52e Author: Joseph Malloch Date: Fri Jun 29 14:01:40 2012 -0400 Removed references to dummy test program testdynamic. commit 9dd80de7d1bf316b65345937a9e2e987d9197670 Author: Joseph Malloch Date: Thu Jun 28 17:40:58 2012 -0400 Added callbacks for remote instance kill requests, instance management. commit 860788f080ac57ca02960ec40cb41b39140e68a1 Author: Joseph Malloch Date: Thu Jun 28 15:00:44 2012 -0400 Added explicit msig_start_new_instance() function; ensure local instance stealing at sender only occurs if instance is new. commit e713419daa4354489592ee1365ddc2e0598f7de4 Author: Joseph Malloch Date: Tue Jun 26 17:40:41 2012 -0400 Corrected unlink handler response. commit ffab26527cf6a514dd6b1b7df8d85a4f48e56d5c Author: Joseph Malloch Date: Fri Jun 22 17:58:40 2012 -0400 Set active=0 when releasing slave instance. commit 847683bac0fca532e0029527f0aff5965aaff675 Author: Joseph Malloch Date: Wed Jun 20 12:44:42 2012 -0400 Parse ordinal from end of device name string instead of beginning. commit b6b875117203a5907c15eb80fb454aaa94ce9b02 Author: Joseph Malloch Date: Sat Jun 16 22:11:29 2012 -0400 Use existing instance id map if possible. commit fa6da7a82394c2b8216ccd15d36da3e47734a24f Author: Joseph Malloch Date: Sat Jun 16 20:32:08 2012 -0400 Added test program for benchmarking speed or message processing. commit 70cf0c0d7ba8690db464d6654a9a5a46605900fd Author: Joseph Malloch Date: Sat Jun 16 19:01:20 2012 -0400 Use first instance on stack instead of seaching in non-instance handler. commit 5978b3771349bbd581c481a574b3fc5e5de3d302 Author: Joseph Malloch Date: Fri Jun 15 17:42:21 2012 -0400 Use existing instance id map when activating or stealing instances. commit 9a5f8b4a1261304ccf61c9c42f8b84ef4c2034c2 Author: Joseph Malloch Date: Thu Jun 14 17:33:42 2012 -0400 Fixed memory allocation and pointer bugs, to not mark instances as active on local init. commit 20366734f45aeb8bab621c5f0fe26f2bbcec2723 Author: Joseph Malloch Date: Thu Jun 14 17:04:31 2012 -0400 Store instance id maps within signal_instance struct also - we need this information to update or release an instance in case the global map is rewritten by another signal. commit e252d0cee4021c1a5678aa7a1d4d1903b4d7b62f Author: Joseph Malloch Date: Wed Jun 13 12:37:19 2012 -0400 Removed default bidirectional linking - this is no longer necessary since we are using instance group ids to indicate ownership of instances. commit 19d4e4aee4bc48cee82f85144364d23799ca361a Author: Joseph Malloch Date: Tue Jun 12 20:22:01 2012 -0400 Changed TRUE to 1 commit d5d1227d97a77f7a3cf0986f1f46f2a997bff5e3 Author: Joseph Malloch Date: Tue Jun 12 20:18:23 2012 -0400 Complex commit: switched to signle linked-list for storing instances; refinement of instance id synchronization approach; use instance id mapping at sender side also. commit 6963f194724a9aaafb27e1ea9f63f8978ed3435b Author: Joseph Malloch Date: Tue Jun 12 20:15:44 2012 -0400 Adapt instance handler and add liblo methods for new instance message. commit b06df1ce7f32f6a5f6b99f5609fe14003a931fb3 Author: Joseph Malloch Date: Tue Jun 12 20:10:29 2012 -0400 Clean up handler. commit 9e58f6fafcfa0a68ef8f42362828c9158d031f61 Author: Joseph Malloch Date: Tue Jun 12 19:54:52 2012 -0400 Added function mapper_router_send_new_instance(). We need to explicitly send a message indicating that a new instance has been created in order to properly handle voice-stealing when srcInstances > destInstances. commit c0555af35763be196477756cee571edbc64e6054 Author: Joseph Malloch Date: Tue Jun 12 19:49:20 2012 -0400 Added placeholder function for looking up router-groups. commit 9f3f93fd44a9b88a8b35e313ca6d46a050701c11 Author: Joseph Malloch Date: Mon Jun 11 14:15:18 2012 -0400 Only store local map if remote map does not exist. commit 5f5046de4c39f8814fc4010f5cee0915d209c3fe Author: Joseph Malloch Date: Fri Jun 8 18:11:23 2012 -0400 Added locally-activated instances to id map. commit 8edec6e0237d979bf247952c8519c94b33027aef Author: Joseph Malloch Date: Fri Jun 8 17:14:32 2012 -0400 Add locally-activated instances to id map to prevent remote hijacking (not complete). commit fd6e7063357086e0a4d16f3c32c800e17d8d7c90 Author: Joseph Malloch Date: Fri Jun 8 16:00:02 2012 -0400 Renamed devices in testinstance program. commit fb552579d56b82313508b28a15fb4c99aad30643 Author: Joseph Malloch Date: Fri Jun 8 15:59:19 2012 -0400 Fix pointer bug when freeing instance map. commit da3945fd1b3e3be83b45f5ce684d50961d9e6a7b Author: Joseph Malloch Date: Fri Jun 8 15:56:03 2012 -0400 Fix value index in handler_signal_instance; Don't activate new instance if value is NULL. commit e4c0b42786df7b1318ea940756bb213b72584417 Author: Joseph Malloch Date: Fri Jun 8 15:54:11 2012 -0400 Set group ID on outgoing message. commit 82d9afa390ab223362f154d5519931aebedffd8d Merge: e62872b 731a4f1 Author: Joseph Malloch Date: Thu Jun 7 18:30:47 2012 -0400 Merge branch 'sync-instances' into group-id commit 731a4f16804caea487af1369630fff190b0b1740 Merge: 8181f3a 320296d Author: Joseph Malloch Date: Thu Jun 7 18:29:29 2012 -0400 Merge branch 'instances3' into sync-instances commit 320296d06d22e560da032aa1150da8ed142de118 Merge: 8ff9de4 8f36349 Author: Joseph Malloch Date: Thu Jun 7 18:26:55 2012 -0400 Merge branch 'master' into instances3 Conflicts: src/expression.c commit e62872b9b12ebc6f08f4e2f1132394853c25296b Author: Joseph Malloch Date: Thu Jun 7 18:13:36 2012 -0400 Use combination of group id and remote instance id in instance id map; Generate unique id for every device to be used as group id by masters. Using port allocation for unique id for now. commit 8181f3a41152d9ee1ef682c62efa680eea31bc19 Author: Joseph Malloch Date: Wed Jun 6 17:37:12 2012 -0400 Check if sig exists in msig_release_instance() commit 3f2ec4e5abbbc2ce9cffc681d6a1a2563ca112d6 Author: Joseph Malloch Date: Mon May 28 16:38:14 2012 -0400 Unmap instance ids associated with freed routers. commit 5bf1c9ee516bf30af2a309692b299f8f38626e6a Author: Joseph Malloch Date: Mon May 28 16:30:25 2012 -0400 Unlink from destination-side. commit 3fd03f1b7adf7eb0ecb053b18aa9c946f84567be Author: Joseph Malloch Date: Sun May 27 18:56:58 2012 -0400 Pass pointer to router object in mdev_get_local_instance_map(). commit eed498c26ea76f18981ff6b2faa90672a1e383f0 Author: Joseph Malloch Date: Sun May 27 13:20:08 2012 -0400 Specify if message is to be sent with instance id (internal functions); ensure non-instance messages bypass instance id map. commit 846a9274b3a617e2e459f09e6944ef02099ed060 Author: Joseph Malloch Date: Sun May 27 00:42:37 2012 -0400 Moved instance id map to device, compiles and tests ok. commit 22b501dc7992969f196f3d5b271930f93b208ca3 Author: Joseph Malloch Date: Sun May 27 00:41:23 2012 -0400 Corrected linkFrom/linkTo logic. commit f57ed7f36de51c32073fb164245feea516e0192b Author: Joseph Malloch Date: Sat May 26 09:28:30 2012 -0400 Bugfix; added more print statements. commit 936556e43f9f3b360eb40aeac15c2eeaa931f296 Author: Joseph Malloch Date: Fri May 25 11:57:12 2012 -0400 Implementing instance id mapping. commit 8e44e56ae53c4a4c1c253e6a309af50a88851bd5 Author: Joseph Malloch Date: Fri May 25 00:50:41 2012 -0400 Adding functions for mapping and remapping instance ids; use lo_address to store remote device context for now. commit b1f64513f751ccdd34d00119cceee06a70b33665 Author: Joseph Malloch Date: Thu May 24 17:33:25 2012 -0400 Added hostname and port to get/find instance functions, instance overflow handler. commit 53bee7b15fb92b0f74b2e24867e10e85f719c382 Author: Joseph Malloch Date: Thu May 24 16:15:11 2012 -0400 Delay between link and connect. commit 33abbaf5db95e13cef45e28a0d9a2e6db592ab14 Author: Joseph Malloch Date: Thu May 24 16:14:38 2012 -0400 Added linkFrom message and handler; create router object at receiver side on link. commit 6e49bdb6522ea46c56e14936e9e71fa937f2e744 Author: Joseph Malloch Date: Thu May 24 16:11:58 2012 -0400 Refactoring for bidirectional links. commit fc79ad5cdc4aa2d8a1d4dbeadb7f0d561a6f0d8d Author: Joseph Malloch Date: Thu May 24 11:38:38 2012 -0400 Added instance map struct. commit 6cec7ade34c305d0ba9fb56315d304b1ada8ec0f Author: Joseph Malloch Date: Thu May 24 11:36:19 2012 -0400 Refactoring in preparation for bidirectional links. commit 8d070ec7b8b80958af67be0546b2c56747d96468 Author: Joseph Malloch Date: Thu May 24 11:20:00 2012 -0400 Refactoring in preparation for bidirectional links. commit f0767e0a692c5d6868757e9ab9dabf9820f83a38 Author: Joseph Malloch Date: Thu May 24 11:12:26 2012 -0400 Added @syncInstances property. commit 8ff9de4a1045e44dca8e4095a4e55718cc23c0e0 Author: Joseph Malloch Date: Thu May 17 18:48:48 2012 -0400 Handle instance id-mapping on receiver side: can now properly map and steal instances when multiple sources are mapped to the same destination. commit ed942c83a4df19aa0d3ca2a744f6ae9def418fb9 Author: Joseph Malloch Date: Fri Apr 27 19:02:12 2012 -0400 Removed instances from signal creation function arguments for similarity with C functions. commit 80ccde99ced421303bbf393c2475523cda99b471 Author: Joseph Malloch Date: Fri Apr 27 18:56:40 2012 -0400 Fixed argument order. commit c083f9b8371bd7e66afc80b07ce1bad21c483766 Author: Joseph Malloch Date: Thu Apr 26 11:37:36 2012 -0400 Removed references to IN_ADD_INSTANCE stealing mode. commit 66fa282a1cd0510a64bbeddbbaa1ecbdf03b6ede Author: Joseph Malloch Date: Thu Apr 26 11:32:40 2012 -0400 Fixed signal reference; expect failure on first sub-test. commit 78b8a16a13c2c80531229524c35642f25483ee3d Author: Joseph Malloch Date: Thu Apr 26 10:50:13 2012 -0400 Call instance_overflow_handler on sender side also. commit 8f36349103e36222b4fec31ae9842aa7da0e9fee Author: Stephen Sinclair Date: Mon Apr 23 16:15:53 2012 -0400 Expression vector size should be 1, since it is applied element-wise. commit a291f11e1442df951b0698a62b94b4ea97147c48 Author: Stephen Sinclair Date: Mon Apr 16 22:11:25 2012 -0400 Missing include in testmany.c. commit 41dcd323e51a772a67fb2649ad3eceef842c274e Author: Stephen Sinclair Date: Mon Apr 16 22:07:59 2012 -0400 Add missing include for pthread.h. commit d16238af788c1166acf9f8111688f87baf69af8d Author: Joseph Malloch Date: Thu Apr 5 11:29:33 2012 -0400 Updated lambda expressions to include instance id and timetag. commit fb3969bed0243e53c5d810ff73e2676fd8576260 Author: Joseph Malloch Date: Thu Apr 5 11:16:24 2012 -0400 Updated signal handlers for pwm_example commit 6672c04be3623c1f3bbc9559796c9884d8c82039 Merge: 7579965 22f8788 Author: Joseph Malloch Date: Thu Apr 5 11:11:30 2012 -0400 Merge branch 'master' into instances3 Conflicts: swig/mapper.i commit 22f87888a583fdd72910788db19ea2e9e6ab457d Merge: 0cc37d9 9a4607d Author: Joseph Malloch Date: Thu Apr 5 11:05:36 2012 -0400 Merge remote-tracking branch 'steve/master' commit 75799656f53b47ff8b8f9fd5b0725b2ef031f7e6 Author: Joseph Malloch Date: Thu Apr 5 11:04:23 2012 -0400 Added timetag argument to signal handlers in examples. commit 0cc37d9ad7c10a4e3aa6d598d7d1c601ba1d10be Author: Joseph Malloch Date: Tue Apr 3 13:52:42 2012 -0400 Added example pwm synth using pyo. commit 9a4607d659471fe61c8590298ac9d2f4b601c2dc Merge: 1c7718f 451b944 Author: Stephen Sinclair Date: Tue Mar 20 10:14:24 2012 -0700 Merge pull request #3 from fundamental/master Clang 3.0 Compile Fix commit 1c7718f19363fad88ceeb7e19c0e518ab987049c Author: Stephen Sinclair Date: Tue Mar 20 12:11:02 2012 -0400 Update input handler function signatures in pwm_example. commit 451b944ecab81854249796737e7ec55ea8434bca Author: fundamental Date: Tue Mar 20 11:02:57 2012 -0400 Adding missing #include for snprintf commit 5d5909bb0f9cb9435bebdf400827c20f842eadea Author: fundamental Date: Tue Mar 20 10:53:32 2012 -0400 Changed struct offset code to offsetof() - Previous to this commit clang 3.0 falied to compile with: error: initializer element is not a compile-time constant commit 2bb7d06ce8d8eb198ce917a18b29d7a9fc7c3597 Author: Joseph Malloch Date: Thu Mar 15 16:08:52 2012 -0400 Removed whitespace. commit b590a140287c7b37db71651ec6bf69a12dfa666e Author: Joseph Malloch Date: Thu Mar 15 16:08:33 2012 -0400 Added signal instance overflow callback. commit a70ab078bf4393cdb85973060c504b316e8257c9 Author: Joseph Malloch Date: Thu Mar 15 16:05:38 2012 -0400 Added timetags to python signal handler. commit f36317180c15b8b49e32b0ac97ee0e86a59b5984 Author: Joseph Malloch Date: Tue Mar 13 16:45:45 2012 -0400 Update test programs with instances API change. commit 1d43c4b7062469b1b7feb3b4670ad16c57926c99 Author: Joseph Malloch Date: Tue Mar 13 16:45:11 2012 -0400 Update python bindings for experimental API change. commit 3d81001e48d6d287a7a026a60831de19c64cd67d Author: Joseph Malloch Date: Tue Mar 13 16:44:37 2012 -0400 Update java bindings. commit 9fa08cbe4b4263266805c9f2eb627d843dbc27fb Author: Joseph Malloch Date: Tue Mar 13 16:43:59 2012 -0400 Switch to unified callback handler for instances and non-instances; initialize signals with reserved instance. commit 415b05af78722035835900849a2c4e0bc8be1de9 Merge: ca11a28 1c500d8 Author: Joseph Malloch Date: Tue Mar 13 10:25:02 2012 -0400 Merge remote-tracking branch 'steve/master' commit 1e8b455b35b1c46bfeeed77013b09f956d50446f Author: Joseph Malloch Date: Mon Mar 12 17:21:58 2012 -0400 Reverted to msig_reserve_instances() without user_data argument, adapted python bindings and testinstance.py commit c5df7a1139c343e9945f94e2ce975948101f5bcf Author: Joseph Malloch Date: Mon Mar 5 18:00:50 2012 -0500 Cast to appropriate types to reduce warnings when building swig bindings. Conflicts: swig/mapper.i commit 1f8fb1e701ebc890bb50b38cbd33f9682a58919c Author: Joseph Malloch Date: Mon Mar 12 13:46:29 2012 -0400 Remove special treatment for first instance 0. commit 389e27b53f022328344b95d5fe633ed7228ed04f Author: Joseph Malloch Date: Mon Mar 12 13:45:40 2012 -0400 Fixed bug in error-checking. commit 08e4c612db7a5e171790df8ccdb6eeaa4f564082 Author: Joseph Malloch Date: Mon Mar 12 13:28:33 2012 -0400 Switched to mdev_add_signal_with_instances(). commit 45259fc847afa7f35d5bca02ae75306a26d5507b Author: Joseph Malloch Date: Thu Mar 8 17:11:19 2012 -0500 Add functions for adding signals with instances. commit a59dcb76a7774c91c218f95369e1baab78393135 Author: Joseph Malloch Date: Thu Mar 8 14:02:48 2012 -0500 Include user_data in msig_reserve_instances(), and do not reset it in msig_instance_init(). commit 728f31a92212dd4ae38e9281343d85311d5917b5 Author: Joseph Malloch Date: Thu Mar 8 14:00:57 2012 -0500 All signals have at least one instance; enforce maximum instances. commit 08200b8357f0b6dd63adab01d2daf3cd43154810 Author: Joseph Malloch Date: Thu Mar 8 13:55:15 2012 -0500 Added allocation mode selection to swig bindings. commit bcef11bfed7e133eb32dae0f40b5fd130d0c8948 Author: Joseph Malloch Date: Thu Mar 8 13:54:29 2012 -0500 Added id to python instance callback. commit 7b96aaaa315a8a45f1652ab7298ee7d1b7cb8610 Author: Joseph Malloch Date: Thu Mar 8 13:53:04 2012 -0500 Was updating wrong signal in testinstance.py commit 889087581366242b7476d9f36368ade5c81a8a38 Author: Joseph Malloch Date: Tue Mar 6 19:08:07 2012 -0500 Added rough version of testinstance.py commit ca11a28b9513c467fe11f34f766d2165e81ff7cd Author: Joseph Malloch Date: Tue Mar 6 18:28:55 2012 -0500 Shorten run loop in testquery script. commit 76e8e2173eee4687a7386453e03681543f0ca3d2 Author: Joseph Malloch Date: Mon Mar 5 18:05:39 2012 -0500 Added handler and functions for instances to swig bindings. commit 2bcbd3a93b0a827eb67b0dc0fb007239b53ccd7a Author: Joseph Malloch Date: Mon Mar 5 18:00:50 2012 -0500 Cast to appropriate types to reduce warnings when building swig bindings. commit 6d20a8f5b5c57d80b6dc4b0a38b1ff9fbf535749 Author: Joseph Malloch Date: Sun Mar 4 08:09:25 2012 -0500 Add extensible properties to /link handler. commit 66d0da9356fee8bc04b53217c5f2d340f7487843 Author: Joseph Malloch Date: Sun Mar 4 08:08:31 2012 -0500 Include extra params in mapper_msg_prepare_params(). commit acb3eb2eedbd54cccdd5ac686812397eba34b408 Merge: 62484d4 4778ffa Author: Joseph Malloch Date: Tue Feb 28 10:36:31 2012 -0500 Merge branch 'expressions' of github.com:malloch/libmapper into expressions commit 62484d46f2c40b1295a56517d600b2c6d8bd3976 Author: Joseph Malloch Date: Thu Oct 6 21:07:30 2011 -0400 Added comparison, logical and bitwise operators to expression parser and evaluator. commit 58a73286613b969577a31caf0b160a5d85e64021 Merge: 51d09d6 33daef9 Author: Joseph Malloch Date: Mon Feb 27 01:23:28 2012 -0500 Merge branch 'master' into instances2 commit 51d09d6b68d370b45e87d5383040f4106a3b460a Author: Joseph Malloch Date: Mon Feb 27 01:23:16 2012 -0500 Use int instead of mapper_instance_id. commit 1c500d82d030bd86501b92aa05f6859804e78b14 Author: Stephen Sinclair Date: Thu Feb 23 16:26:12 2012 -0500 Mention 'autogen.sh' in the build instructions. commit e914e3367574e3887bbd1200882c26157cd3efc9 Merge: 68c5ae7 33daef9 Author: Stephen Sinclair Date: Thu Feb 23 15:43:50 2012 -0500 Merge remote branch 'malloch/master' commit 68c5ae764256f1f87830690dec9ee774bde7489a Author: Stephen Sinclair Date: Thu Feb 23 12:56:02 2012 -0500 Add a .gitignore file. commit 33daef933c9694aaa24df2670cc31930a36d466b Author: Joseph Malloch Date: Mon Feb 20 13:08:56 2012 -0500 Fixed a few typos in documentation. commit f503f932aee7c6553eb6430386021929b5aacfc1 Merge: 00f5d0a fab748a Author: Joseph Malloch Date: Mon Feb 20 12:51:09 2012 -0500 Merge remote-tracking branch 'steve/master' commit fab748a2b9798e3ad7ced206908d9c570b25835b Author: Stephen Sinclair Date: Sat Feb 18 14:30:48 2012 -0500 Move the tutorial to "doc" and rename it so github recognizes it as markdown. commit eb6c7e87dcd60877a75d186f09cc7533e08a26a5 Author: Stephen Sinclair Date: Sat Feb 18 14:29:12 2012 -0500 Documentation on building and testing libmapper. commit 92e17eb620072908857666656dabdea05a0db070 Author: Stephen Sinclair Date: Fri Feb 17 18:23:24 2012 -0500 Return error code from osc_prefix_cmp() if input string doesn't start with '/'. commit 00f5d0abb8ab0a0e292f12522750f120ebaf1d2a Author: Joseph Malloch Date: Fri Feb 17 13:00:40 2012 -0500 Removed unnecessary mapper_signal reference. commit 6377922d9388a7638c489c3d0cc00051d05b665f Author: Stephen Sinclair Date: Wed Feb 15 13:14:41 2012 -0500 jni: Add internal class files to jar. commit f1a8394aa27775bb39964dc8230d3b921f042ce4 Author: Joseph Malloch Date: Mon Feb 13 17:15:53 2012 -0500 Moved n_links/n_connections tracking into add/remove functions. commit 31ac770b5a5f1e1b3917440d245f7984a9fee795 Author: Joseph Malloch Date: Mon Feb 13 17:14:22 2012 -0500 Remove associated connections before freeing router. commit 01f2b95bc0882b5ddce7da1dc8dd59c330a768a0 Author: Joseph Malloch Date: Sun Feb 12 23:23:44 2012 -0500 Free router in mdev_remove_router(). commit 16eb804513603bbeb5cf2bcb194d647ef1f87ce3 Author: Joseph Malloch Date: Tue Jan 24 16:25:30 2012 -0500 Moved mapper_msg_add_osc_value_table() from table.c to params.c; switched to calling msg_add_lo_arg() instead of lo_message_add() - fix for bug when sending extra params in /connectTo messages. commit 39da44880b57c657647e915dc3a862834fc2f773 Merge: 6f6ab47 84e9343 Author: malloch Date: Mon Jan 23 16:17:30 2012 -0500 Merge branch 'throttle-metadata' commit 84e9343757ea837023711cef51601f8237f62e4e Author: malloch Date: Mon Jan 23 16:07:07 2012 -0500 Added members to mapper_db_device struct and devdb for n_links and n_connections; fixed order of keys in devdb_table, allocate extra tables for connections and links. commit 6f6ab47cb4468ae3da90aea49c2459f3a3bc7a2c Merge: 9bf5ffc 01c01af Author: Stephen Sinclair Date: Sun Jan 22 22:29:13 2012 -0500 Merge remote branch 'malloch/throttle-metadata' commit 9bf5ffce433dd651b8e48561ae3c4a96109df303 Merge: 5e93f10 563eb79 Author: Stephen Sinclair Date: Sun Jan 22 22:26:01 2012 -0500 Merge remote branch 'malloch/monitor_update' commit 5e93f108bd8d2b58dd8fc623cec1c43fe099051c Merge: 79f67e8 aab8f31 Author: Stephen Sinclair Date: Sun Jan 22 17:18:52 2012 -0500 Merge remote branch 'malloch/python-update' commit 79f67e8164d5c3ec768474694fba3414fb9b3808 Author: Stephen Sinclair Date: Fri Nov 25 18:27:17 2011 -0500 Initial work on "How to build on Windows" documentation. commit 6b89352cfa7039905abf8d922a56669c7e9fbb5f Author: Stephen Sinclair Date: Sat Nov 26 12:10:25 2011 -0500 Fix clean files to satisfy distcheck. commit 01c01af2cee8a2a9d7ef9487f6675bf0c37f9b5f Author: Joseph Malloch Date: Thu Jan 19 17:33:01 2012 -0500 Added functions for querying properties of links and connections; finished adding throttling to connection requests. commit 563eb797d2b47a170862e8e2fe5a44e07678b739 Author: Joseph Malloch Date: Wed Jan 18 12:10:32 2012 -0500 Added arguments for setting admin and enable_autorequest to mapper_monitor_new(). Added own_admin member to monitor data structure to track admin ownership and free admin if appropriate in mapper_monitor_free. Updated swig bindings and testmonitor program. commit 50005adbe66e2c9799fc6561962240793b719d21 Author: Joseph Malloch Date: Sat Jan 14 12:50:56 2012 -0500 Include types for ID property in call to mapper_admin_send_osc(). commit 7f1adcf819533615e6cca9140db3b110c966f297 Author: Joseph Malloch Date: Fri Jan 13 20:57:53 2012 -0500 Fix for freeing callback after batch signal request. commit b3a0f91ddcc1d342c06ceb9a6b6872a109f6042e Merge: b0693c9 d8690d8 Author: Joseph Malloch Date: Fri Jan 13 17:11:26 2012 -0500 Merge branch 'master' into throttle-metadata commit b0693c9361c530899a9518f55637275a9961907a Author: Joseph Malloch Date: Fri Jan 13 16:13:29 2012 -0500 Added batch request capabilities to monitor. commit d8690d87b34e7c0fee455e0f2cac779a037dfbaa Author: Joseph Malloch Date: Fri Jan 13 12:11:42 2012 -0500 Added n_inputs, n_outputs, version to mapper_db_device data structure; now stores these properties in devie db record. Fixed bug in mapper_db_property_lookup() - was searching sigdb_table instead of table passed as argument. commit aab8f3130c42699946ed34d14028b03196c478cb Merge: 38fe1ff 7f25c3a Author: Joseph Malloch Date: Tue Jan 10 15:42:42 2012 -0500 Merge branch 'master' into python-update commit eabc10ffa2b7c2834a89700ed7ded631631ba78c Merge: a762d0e 7f25c3a Author: Joseph Malloch Date: Tue Jan 10 15:41:47 2012 -0500 Merged remote branch master. commit 38fe1ff572eabb4806b8df96d7a9cc75e36d5982 Author: Joseph Malloch Date: Wed Dec 14 12:44:02 2011 -0500 Added python binding for mapper_monitor_autorequest(). commit a762d0e73f7b2e4250f4f89ea26a3ce5e93d2283 Author: Joseph Malloch Date: Sun Dec 11 16:54:08 2011 -0500 Add user-data to instance; fail if received instance id not understood. commit 7472172a7014e60c0776be7a4727bce28ffe7841 Author: Stephen Sinclair Date: Sat Nov 26 21:09:56 2011 -0500 Print the active ID instances during testinstances. commit 395a7672b90510dfd578a2534e773269f9aeb06a Author: Stephen Sinclair Date: Sat Nov 26 23:58:04 2011 -0500 First instance gets the original id=0 instance, and restore it on last release. commit 62924c1eb4a21be70ebb8a09f384457ca2dfe7b8 Author: Stephen Sinclair Date: Sat Nov 26 18:05:21 2011 -0500 Proposal for alternative instances API. Uses same implementation internally, but instead of exposing a user-facing mapper_signal_instance data type, it allows user to specify an external ID, and attach an optional data pointer. Allows for consistency in instance IDs across several signals, so that user software can interpret this as representative of an "object" formed of a collection of signal instances. commit 6357f91717bf80769406d6778146f0ea3e7d7bd2 Author: Stephen Sinclair Date: Sat Nov 26 12:09:45 2011 -0500 Fix paths for javac and Python distutils to make VPATH build successful. commit e37c5d061a03b1ac6aef63bc1cc012917cb7e550 Author: Stephen Sinclair Date: Fri Nov 25 14:18:08 2011 -0800 Make Python SWIG module compile correctly on Windows. For this to work, distutils.cfg must be configured for mingw32, and the path to swig.exe must be specified to configure in the variable SWIG. commit 7f25c3acff7f5b28b0ac5e62f04f05271ba46435 Author: Stephen Sinclair Date: Thu Nov 24 15:51:17 2011 -0500 If @IP is not provided in /device, take it from the UDP source IP. commit 5f81715b021c1ceb054379f4826990b0518ca5bb Author: Stephen Sinclair Date: Wed Nov 23 12:22:50 2011 -0500 Problematic type names and header files for building SWIG extension on Windows. commit e1ded6e2bdd7e45d75888b7621c2774d96d6bf03 Author: Stephen Sinclair Date: Tue Nov 22 21:45:03 2011 -0500 Add support for exponent (scientific notation) to float lexer. commit da109b78eb762205fce87c57f19aa1c11f3af23c Author: Stephen Sinclair Date: Tue Nov 22 21:44:41 2011 -0500 Remove extraneous call to snprintf. commit a0fd1a908d46ca33a7c7750a167adc2e32f896c9 Author: Stephen Sinclair Date: Tue Nov 22 21:05:58 2011 -0500 Don't switch to linear mode if the expression did not successfully compile. Certain float values can generate expressions incompatible with the parser. Will fix scientific notation support, but this might remain true for NaN or Inf, for example. commit 5961032d2a527329f84d4c4c765b09cd99d43c83 Merge: 63f8d5c 27e6323 Author: Stephen Sinclair Date: Tue Nov 22 16:55:38 2011 -0500 Merge remote branch 'malloch/master' commit 45784b43cf5017dc9b3d7883a42ff1d5c76bab57 Author: Stephen Sinclair Date: Tue Nov 22 14:09:28 2011 -0500 Don't reallocate signal memory for signals with no expression (ie. direct). commit 4c25ca3ea3d55655bd62fedc2908447db7fca07f Author: Joseph Malloch Date: Mon Nov 14 18:49:30 2011 -0500 Fixed freeing of connection_instances when connections are removed. commit a1d542064cb92d0ffa9e18f29632dae9d2fbaeb0 Author: Joseph Malloch Date: Mon Nov 7 14:08:13 2011 -0500 Removed some whitespace. commit 73446d3dfec217252a4a61491206eae0566b0ff2 Merge: 1be25a1 27e6323 Author: Joseph Malloch Date: Mon Nov 7 10:09:32 2011 -0500 Merge branch 'master' into instances commit 27e632323d8357ad7337f758826003017c21b368 Author: Joseph Malloch Date: Fri Nov 4 14:02:58 2011 -0400 Added capability to process requests for subsets of connection data. commit 1be25a199af43a790be5a052ff31dd9c6e9d3844 Merge: f55bb75 f940ad3 Author: Joseph Malloch Date: Tue Nov 1 14:39:26 2011 -0400 Merge branch 'master' into instances commit f55bb75ced88a9e0731fc63e57974559b1ae537c Author: Joseph Malloch Date: Tue Oct 25 11:10:18 2011 -0400 Fixed indexing bug and removed reference to input_vector in mapper_expr_evaluate(). commit 6a059d10936dfb016c3f5ebc8fcf0f992bbf62df Author: Joseph Malloch Date: Tue Oct 25 11:09:17 2011 -0400 Moved expression data structures back into expression.c. Added functions for retrieving history sizes from an expr object. commit 0cbea450bdad094817b62326a6a187bb0906e93f Author: Joseph Malloch Date: Mon Oct 24 18:42:36 2011 -0400 Pass input and output vector sizes back from expression generator for use in reallocating instance memory. Pull out signal_history reallocation into function mhist_realloc, and switch to using realloc() when possible. commit 1a5ca136eeac3e8d1fe8bc82b0fc78aa1d3ed1db Author: Joseph Malloch Date: Mon Oct 31 12:09:30 2011 -0400 Adapted //signals/get messages to permit requests for subsets of namespace by index. This is a work-around to address lost UDP packets when reporting very large namespaces. commit a1cefa45ca5947eed841b8ba4d4a898d87e9f823 Author: Joseph Malloch Date: Fri Oct 28 18:05:31 2011 -0400 Added query support. commit 56814a951391469798244fcfa5fc4f4d4d751208 Author: Joseph Malloch Date: Fri Oct 28 16:37:54 2011 -0400 Updated signal addition methods in python bindings to match arguments in C API. commit f940ad374515a80d6045247bdc2ed214e55996d4 Author: Joseph Malloch Date: Tue Nov 1 13:38:11 2011 -0400 Fixed bug in db storage of range data. commit 1894bbd73d5239a02a81bf6709bac9d7f62c46a0 Merge: 29d6d45 d7b1831 Author: Joseph Malloch Date: Tue Nov 1 13:32:54 2011 -0400 Merge remote-tracking branch 'steve/master' into fix_merge commit 29d6d4558d851cfc3fc996c33a48b66d8c2e853f Author: Joseph Malloch Date: Tue Nov 1 13:28:14 2011 -0400 Removed reference to network topology limitation, since client-server is actually a subset of possible libmapper topologies. commit 63f8d5c6fea595cbf958bdfa7259dd5fc3434900 Author: Stephen Sinclair Date: Fri Oct 14 16:36:59 2011 -0400 Remove hostname information from /device and /linkTo messages. The handler still parses out the @ip property in case it is provided. Not only for backward compatibility -- perhaps there could be devices which really do need to provide it. However, if not provided, it is extracted from the UDP sender info via liblo. commit 3d13660f1d8c4b53d1ac6ad77f09736478beaede Author: Stephen Sinclair Date: Fri Oct 14 16:16:17 2011 -0400 In /linkTo handler, ignore provided hostname and use UDP sender info instead. commit d7b1831fa84450be8e88488143f8e1c04e9c9e15 Author: Stephen Sinclair Date: Fri Oct 14 15:02:11 2011 -0400 Seed the random number generator. commit 4778ffa1ee2f1e82414668e21ed7d553ff93613d Author: Joseph Malloch Date: Thu Oct 6 21:07:30 2011 -0400 Added comparison, logical and bitwise operators to expression parser and evaluator. commit 1e47f4c3102337ce9c3eaca4e46e4aa9017c61dc Author: Joseph Malloch Date: Sun Oct 2 15:16:49 2011 -0400 Updated query handler to handle instances, signal_history data structure. commit c48cb7bf8e49e7a872ee56a42fcb924a0b2e7c17 Author: Joseph Malloch Date: Sun Oct 2 13:43:35 2011 -0400 Added functions for retrieving a list of active or reserved instances owned by a signal, and iterating through the list. commit 4bca6d29930f5b5c3d4e8e8201566757781c3d80 Author: Joseph Malloch Date: Sun Oct 2 13:24:37 2011 -0400 Renamed sig->input to sig->active; renamed msig_set_stealing_mode to msig_set_instance_allocation_mode; added msig_num_active_instances. commit 768261ca09835be74c68867e52a9b2ea960d78c0 Author: Joseph Malloch Date: Fri Sep 30 17:44:27 2011 -0400 Renamed stealing_type to mapper_instance_allocation_type. commit 3017c9cce127cb59da3c8ad26ab9356f008703c3 Author: Joseph Malloch Date: Fri Sep 30 14:07:00 2011 -0400 Added functions for getting number of reserved instances and for setting a signal's voice-stealing mode. commit b8a590a73ab2d4c14fcf70d1bd6577dcb672666e Author: Joseph Malloch Date: Fri Sep 30 13:47:06 2011 -0400 Added number of instances to stored/reported signal properties. commit 5a88a1ad96f06a80e7b0fb7fd21f4ac8e699c55f Author: Joseph Malloch Date: Fri Sep 30 11:36:47 2011 -0400 Simplifying instances API according to discussion on email list. commit 985af780b9f7f8a0dcca6d975eddc5c7e55755c9 Author: Joseph Malloch Date: Wed Sep 28 16:08:21 2011 -0400 Fixed index in instance handler. commit 6bd80b52b20fb36fd72e46f3764990c364877c3e Author: Joseph Malloch Date: Wed Sep 28 13:16:41 2011 -0400 Now using mapper_signal_value_t only in expression evaluator. All tests run successfully. commit 93a89e8aa9b61bd8f6f3635a83be855492d12036 Author: malloch Date: Tue Sep 27 23:11:11 2011 -0400 Fixed vector indexing in handler functions. commit f4a40eeaab7663b2b57e2baf726725b7c161585c Author: malloch Date: Tue Sep 27 22:26:12 2011 -0400 Fixed instance memory allocation bug. commit 7b602f0714d591857ea3faa00a1020b28935375a Author: malloch Date: Tue Sep 27 21:43:11 2011 -0400 Initialize length property; don't free unallocated memory. commit 0093047e855b4d84702a75198fcf962f5b7d2723 Author: Joseph Malloch Date: Tue Sep 27 16:45:53 2011 -0400 Finished converting internal values to mapper_signal_value_t. Moved vector processing iteration to connection and expression evaluators. commit 42dfec1f779a6f1686f5da4d0f64f88ae1e1d597 Author: Joseph Malloch Date: Tue Sep 27 07:35:59 2011 -0400 Switching internal representation of signal values to mapper_signal_value_t union (not finished). commit 40063a3ca0e5d5c0880e84c0f648814cbf1f6fe3 Author: Joseph Malloch Date: Sun Sep 25 11:17:59 2011 -0400 Added function for finding the current value of an instance; fixed some value indexing bugs. commit 6135f92320e28c64362994dfb6be91a050e8ef22 Author: Joseph Malloch Date: Sun Sep 25 09:57:22 2011 -0400 Added function for returning containing signal of a signal_instance; added comment on copying output history on expression change. commit 70fe08609864c092ac939efdd124e670aad36837 Author: malloch Date: Fri Sep 23 00:19:07 2011 -0400 Copy old history values into new arrays when reallocating instance histories. commit 1708fc1ef47c05d09678b41b4344a41a0a7e203a Author: malloch Date: Thu Sep 22 21:41:55 2011 -0400 Simple integration of optional voice-stealing when fetching reserved instances. commit 5853c8d35bfc12a9a8c712fa306149bca806e469 Author: Joseph Malloch Date: Tue Sep 20 17:58:45 2011 -0400 Updated roadmap commit b3f04b0060c445a2084a3cb567f52294ca7e407a Author: Joseph Malloch Date: Mon Sep 19 18:16:49 2011 -0400 Fixed and added some documentation. commit d1bbe8524d67d67d9ab6c19d64815958779c696c Author: malloch Date: Thu Sep 15 22:46:20 2011 -0400 Fixed bugs when freeing memory. commit 271e4eece44ff211d568702d1402b937a423ad22 Author: Joseph Malloch Date: Thu Sep 15 17:09:34 2011 -0400 Rearranged some of API: added msig_fetch_reserved_instance, msig_get_instance_by_id, msig_get_instance_id; rewrote msig_resume_instance. Added is_active flag to signal instances. commit 3dfa0eb9ee0ab2d6665523ead5b9541c0d8dbadd Author: Joseph Malloch Date: Thu Sep 15 09:36:00 2011 -0400 Added function msig_update_instance_by_id. commit d475986ecc09369f8f5c1222a026694ebf0c90bb Author: Joseph Malloch Date: Wed Sep 14 17:27:07 2011 -0400 Set history_size for signal when reallocating history arrays. commit e4f57ee483c7721e30906f4789a5443d7bb786d5 Author: Joseph Malloch Date: Wed Sep 14 14:57:57 2011 -0400 Call msig_reallocate_instances when expression is modified after mode change. commit 01ce3650b14f82a9c074390d1a2917e9fc3fd092 Author: Joseph Malloch Date: Wed Sep 14 14:32:52 2011 -0400 Removed stray debug printf commit ab7981711002e89d9e88ea1d9414832c84348dcf Author: Joseph Malloch Date: Wed Sep 14 14:23:40 2011 -0400 Call signal handler if signal instance handler doesn't exist; delete instance and query methods from lo_server when a signal is removed. commit 1b15a2907eb33072699faa5dc160b79a15bc9b2a Author: Joseph Malloch Date: Wed Sep 14 14:22:03 2011 -0400 Was copying timetags into incorrect memory location; try iniating all instances with proper id. commit 2372211299193c3de6a35eb09acd5e3452edfcbd Author: Joseph Malloch Date: Tue Sep 13 23:31:16 2011 -0400 Track input and output history vector lengths separately in expression parser and allocate instance history arrays correspondingly. commit 45d645957994b84a92e97dcd8ddfca04740137d0 Author: Joseph Malloch Date: Tue Sep 13 23:25:12 2011 -0400 Reallocate instance history vectors AFTER changing connection type to MO_EXPRESSION. commit 6c8f044ab830d5c1d343464b1088d8ed6e444260 Author: Joseph Malloch Date: Mon Sep 12 18:27:34 2011 -0400 Added message counting and success/failure message. commit 81392e26e32c0842bd08c8142e7a8742d1c919b1 Author: Joseph Malloch Date: Mon Sep 12 18:12:23 2011 -0400 Rewrote most of msig_reallocate_instances. commit 9d44c3fb38e05b3b87e06428bc3862da93faf8f9 Author: Joseph Malloch Date: Mon Sep 12 12:09:43 2011 -0400 Fixed segfault on removal of connections. commit f8644eccefd0a3f0e5f0ebb1042fb84d5a17f5c4 Merge: b55dfa8 2a0e4f8 Author: malloch Date: Sat Sep 10 00:52:24 2011 -0400 Merge branch 'master' into instances commit b55dfa8d6a96a974cf8fa76c34c15e927a6c2ea1 Author: malloch Date: Fri Sep 9 23:18:30 2011 -0400 Removed some commented code; fixed notes. commit 9d89e76962ff11cb89e8094c3f39c4f3b568986c Author: malloch Date: Fri Sep 9 23:03:20 2011 -0400 Renamed mapper_connection_free_instance to msig_free_connection_instance commit f1e3e0db0cf4bae81850f75536a8b8306e653bfd Author: malloch Date: Fri Sep 9 23:01:17 2011 -0400 updated calls to mval_add_to_message to use new arguments. commit 2b1fe0c375f016f24514af8ad7b38a5516d94518 Author: malloch Date: Fri Sep 9 22:40:15 2011 -0400 Fixed pointer bug in msig_suspend_instance; removed debug statements. commit 801087358b1515363ead5278cd92b670e0ada267 Author: Joseph Malloch Date: Fri Sep 9 17:27:36 2011 -0400 Corrected passing of pointer to signal instances to expression evaluator; debugging signal instance linked-lists. commit e60b0b08f8a5326c32afa3cbb5c770e3eb7fe9bf Author: Joseph Malloch Date: Thu Sep 8 22:20:26 2011 -0400 Fixed sending of NULL signals (for terminating instances). Store handler pointer on creation of instances. commit 4bf1d69782c3f1395cc3154181e42277fb9fb596 Author: Joseph Malloch Date: Thu Sep 8 17:02:31 2011 -0400 Debugging instance handlers. commit 9d6a1644e198a72ab5b8f4be67483d085b0f3dc1 Author: Joseph Malloch Date: Thu Sep 8 09:42:34 2011 -0400 Adjusting instance handlers. commit 04490746bf9a648074da66427bca5e7d57d54930 Author: malloch Date: Wed Sep 7 23:08:06 2011 -0400 Added function msig_reserve_instances; update creation time when instance is created or resumed; handle void instance updates. commit 1903932a34147a991b3e2367879b937bf2b8ae2a Author: Joseph Malloch Date: Wed Sep 7 16:07:47 2011 -0400 Work on main loop in testinstance. commit cd4d21bbb928e0e4b5ebceff46f9a130904ec0fd Author: malloch Date: Tue Sep 6 18:19:02 2011 -0400 Working out usage of instance handlers, added data type for voice-stealing strategies. commit 73b6c7cfc0222421e3b824056f14dbc525e883eb Author: Joseph Malloch Date: Tue Sep 6 12:09:37 2011 -0400 Adding instance handlers; cleaning instance ids; simplified mval_add_to_message function; adapted mapper_router_send_signal for sending connection instances. commit 071cfadbee70cac20b56a2351fdc9316feec8378 Author: Joseph Malloch Date: Tue Sep 6 12:06:59 2011 -0400 Adapting testinstance. commit 635ef600fc79201f89b0c2462e276ddf44e736ed Author: malloch Date: Fri Sep 2 17:58:56 2011 -0400 Renamed unused file testdynamic.c to testinstance.c - will adapt for testing signal instances/polyphony. commit 47a81aaf0fa455993e64c953d4c7bbcec7068270 Author: malloch Date: Fri Sep 2 17:19:57 2011 -0400 When reallocating instance history, make sure size is at least 1. commit 8f5188ace4ad90ec2ba41b3a7afd4d4412db1dfe Author: malloch Date: Fri Sep 2 13:31:00 2011 -0400 Made history vector size minimum 1 instead of 0; fix for indexing history vector. commit ee47f8e2b825ee6d017fd7a0e769894d61a44748 Author: malloch Date: Fri Sep 2 10:41:11 2011 -0400 Renamed msig_send_signal to msig_send_instance. Simplified signal update functions. commit 9bd0aa19596297207661790bb267bfef1f80c7a5 Author: malloch Date: Fri Sep 2 10:39:39 2011 -0400 Update instance input vector before calling mapper_expr_evaluate - test now computes correct output. commit f3dc2ca2bc9740df783fe1c4cee21fd2e9f697f8 Author: malloch Date: Fri Sep 2 10:35:53 2011 -0400 Added notes on changes to be made after full vector support. commit d344796cb9e09d1b0b5dbaa1f5f4e2d6355898f7 Author: Joseph Malloch Date: Fri Sep 2 09:29:30 2011 -0400 Adapted testparser for instances. commit bd5b2409e5ee2f866119576537abadc7009c40b0 Author: Joseph Malloch Date: Fri Sep 2 09:29:00 2011 -0400 Fixing connection and expression bugs. commit a7ffae2b0b98e36e5c59ef226acc8e13e3147b84 Author: Joseph Malloch Date: Thu Sep 1 12:07:13 2011 -0400 Moved some expression data structure declarations to header file; added reallocation of instance histories to msig_reallocate_instances. Compiles except for testparser. commit 5ce948a1aaa9561f41f193e183afd4031eac710e Author: Joseph Malloch Date: Wed Aug 31 08:55:03 2011 -0400 Revised some function calls for handling instances instead of signals; removed unused routing function mdev_route_signal; added contents of msig_update_instance function. commit 1c83d36b1e3e5a22cc36834cf96bfc03c4923ee8 Author: Joseph Malloch Date: Mon Aug 29 09:16:47 2011 -0400 Rearranging structure of signal flow. commit eede68f465b2db5a43a10b45378240bcc1ffc57a Author: malloch Date: Fri Aug 26 18:44:43 2011 -0400 Working on expressions. commit f31b5e569355e06e7c53881e26a2772c24537996 Author: malloch Date: Thu Aug 25 17:35:06 2011 -0400 Split instance data structure into signal instances and connection instances, moved value history valiables and data into struct. Not yet working. commit 2dbf394c8ed78e6d2f96be6e7657a451d5cf4176 Author: Joseph Malloch Date: Wed Aug 17 15:40:39 2011 -0400 Fix for msig_kill_instance() commit ae0a16ba1a29eb5cd60036124523e4f1cb92212d Author: Joseph Malloch Date: Fri Aug 12 18:06:39 2011 -0400 Preliminary work on adding support for instances/polyphonic mappings. commit 2a0e4f8a5db3d53549bde21e2269c750bccc05e3 Author: Joseph Malloch Date: Sat Jun 25 22:53:57 2011 -0400 Fixed bug in clipping function producing wrong output when range minimum > maximum. commit cdf9b3cf0840e282f33c39b5f589580bc95b3771 Merge: 3094964 bc6e4aa Author: Joseph Malloch Date: Fri Jun 17 15:22:56 2011 -0400 Merge remote-tracking branch 'steve/master' commit bc6e4aa197af65cf11d5253897673350f36c14d4 Author: Stephen Sinclair Date: Thu May 26 18:32:50 2011 -0400 Bump version to 0.2. commit ba56e6a5b02d8c8266ee47b77e3bf8e9e50ba745 Author: Stephen Sinclair Date: Fri May 27 16:05:54 2011 -0400 Specify pkg-config path when building binaries. commit 70e0aa51ac704294a198198f4f9957da8b73852d Author: Stephen Sinclair Date: Fri May 27 15:07:30 2011 -0400 Fix some warnings about undeclared functions and uninitialized variables. commit 8bbd5096d7a19cc460f14079b51d17efb9e69048 Author: Stephen Sinclair Date: Fri May 27 12:16:45 2011 -0400 Don't use 'find' to look for Python extensions during binary build. commit 30949645f54e25bd3aa088c932dd85dfeb8900ce Merge: b5c7747 97baf94 Author: Joseph Malloch Date: Fri May 27 09:59:56 2011 -0400 Merge branch 'master' of github.com:malloch/libmapper commit b5c7747942ed7e1f9300d1760d61585100997d65 Author: Joseph Malloch Date: Fri May 27 09:59:35 2011 -0400 Fixed messy arrowhead in icon omnigraffle file. commit 8febcb8dbdd282a58612cd3df9a08cc3460c0941 Author: Stephen Sinclair Date: Thu May 26 22:35:28 2011 -0400 Change all instances of the noun "mapping" to "connection." After much deliberation, the decision was made that the word "connection" is less confusing and more consistent for representing the relationship between a single output and a single input. The noun "mapping" is now reserved for refering to a _set_ of particular connections and their associated properties. commit ad27b5697e17717dbe50f96c3180562fcfa02096 Author: Stephen Sinclair Date: Thu May 26 18:57:19 2011 -0400 Ensure install_name_tool succeeds. commit b19460e93b34f0ea4f46005cb677b8a5076ea248 Author: Stephen Sinclair Date: Thu May 26 18:37:31 2011 -0400 JNI bindings: fix a bad return type. commit 6c186215f07b4cb879eb37eb717eac46f823ea13 Author: Joseph Malloch Date: Wed May 18 08:01:11 2011 -0400 Changed unit conversion macro names: midi2hz -> midiToHz, hz2midi -> hzToMidi. commit 6c9b19ae86f8a0e04201a2bf89e61fda0e344ce6 Author: Stephen Sinclair Date: Thu May 26 17:15:53 2011 -0400 JNI bindings: add .java and .h files to dist. Ensure .class dependencies don't get messed up by '$' in the filename, by keeping these in a separate list. commit d530f32433e362115247c28bd4fade23002b26c7 Author: Stephen Sinclair Date: Thu May 26 16:20:57 2011 -0400 JNI bindings: detect JDK paths correctly on Linux and OS X. commit fe7eabf5c8ba3a4bc83f911a25baafeb1e99e0ab Author: Stephen Sinclair Date: Thu May 26 16:09:19 2011 -0400 SWIG bindings: Use configured version in setup.py. commit c1eb6cffdcd37ab5a792a9df5663162d89e495fb Author: Stephen Sinclair Date: Thu May 26 15:12:23 2011 -0400 JNI bindings: Pass value array to input handler. commit 97baf94f1381a6eacbf2b2944035b8d7218ca486 Author: Joseph Malloch Date: Wed May 18 08:01:11 2011 -0400 Changed unit conversion macro names: midi2hz -> midiToHz, hz2midi -> hzToMidi. commit dfecb0a551ea3bc2f059c50e9be3d1c81c2b7057 Author: Stephen Sinclair Date: Fri May 6 16:41:13 2011 -0400 SWIG bindings: input handler's 'tt' parameter should be a pointer. commit e1e6de271e0192bc4616eccf2f723e91dc2e4e97 Author: Stephen Sinclair Date: Fri May 6 16:17:27 2011 -0400 SWIG bindings: return None in input handler if value is null. commit 722516ef7602553e6df6f183e6f77d805527232c Merge: 7882a5b 04918f5 Author: Stephen Sinclair Date: Tue May 3 17:06:53 2011 -0400 Merge branch 'mingw' commit 04918f5fedc39a143c4d7da65f3d3be106ce9996 Author: Stephen Sinclair Date: Tue May 3 11:35:29 2011 -0700 If library compiled as Windows DLL, link tests to object files directly. The tests refer to the internal API which is not exported by the DLL, so this is the only way to compile the tests in this case. commit 7882a5b70db113115d5a67690c394ab32e4a61a2 Author: Joseph Malloch Date: Tue May 3 11:39:28 2011 -0400 Added functions midi2hz() and hz2midi() to expression parser. commit 1b661f38129b174df38c9508baac4c91be2313a9 Author: Joseph Malloch Date: Tue May 3 10:21:27 2011 -0400 Added modulus operator to expression parser/evaluator. commit 2ac73235c02e6d506c723174b970134f9c73a737 Author: Stephen Sinclair Date: Mon May 2 17:25:35 2011 -0400 Add a Windows DLL .def file to list library exports. commit 613ca67b4a9ed95a41a58ecdc098c7189be9ad4c Author: Stephen Sinclair Date: Mon May 2 15:51:49 2011 -0700 On Windows, look only at valid adapters. commit b5be5d1ab03c3cca78cf6a77d5903f3171ae383b Author: Stephen Sinclair Date: Mon May 2 15:51:31 2011 -0700 On Windows, use Sleep() instead of usleep(). commit 93a59083c5e0d51b33b8ce93321fa71609e8d415 Author: Stephen Sinclair Date: Fri Apr 29 11:00:50 2011 -0400 Remove the hack for pkg-config, we'll use it actually. commit 072be04efd234e2be3b10d64bd73a61dd792490c Author: Stephen Sinclair Date: Thu Apr 28 23:07:38 2011 -0400 Detect Windows libraries and compile successfully using autotools cross-compilation. Notable changes: - pkg-config is not used when cross-compiling - audio example is disabled properly when audio system not found - could not use a field called "interface" due to something in Windows headers, so admin struct field was changed to "interface_name" - reimplementation of get_interface_addr() in admin.c using GetAdaptersAddresses - windows compilation currently only works if JNI and SWIG are explictly disabled TODO: test doesn't run, "cannot find free port" replace gettimeofday() commit af4bf044e7e96d7210f267eec2d8d9ea07f85d73 Merge: bcb9151 ab09baf Author: Joseph Malloch Date: Wed Apr 27 14:28:59 2011 -0400 Merge remote branch 'steve/master' commit bcb91514c44eddbb1f9b62bc93fec238c2303ee6 Author: Joseph Malloch Date: Tue Apr 19 17:14:25 2011 -0400 Check if msig_new fails before proceeding. commit a5d6005a3b78a3e6440f2a69c160c89bb904f264 Author: Joseph Malloch Date: Tue Apr 19 16:29:07 2011 -0400 Added some vector signals to test.c commit a1894c48bb05170de0cbb08af5cbc7745fa57a37 Author: Joseph Malloch Date: Mon Apr 18 15:14:01 2011 -0400 update signal length property in db record commit ab09baf8642fa6ac9f5824595a08539fad493145 Author: Stephen Sinclair Date: Fri Apr 15 20:44:21 2011 -0400 Check for non-existent router or mapping in handler_signal_disconnect(). commit 3cf727cb1f31c15ac031d86d78db49558f1619b7 Merge: 1aa6f65 6ddd534 Author: Joseph Malloch Date: Wed Apr 13 12:50:22 2011 -0400 Merge remote branch 'steve/master' commit 6ddd534ff9a9efe835fd612f8a640cc7dcad2b4e Author: Stephen Sinclair Date: Wed Apr 13 11:09:46 2011 -0400 SWIG bindings: Default properties are null for mapper.connect. commit 065e12b7794fed3303869e3226c0dbbd7662c82a Author: Stephen Sinclair Date: Tue Apr 12 15:45:10 2011 -0400 Include src_type, dest_type, src_length and dest_length in /connected messages. commit 8ae46c5674fc3467394dcfc1b1996a7c050e99c5 Author: Stephen Sinclair Date: Tue Apr 12 15:48:03 2011 -0400 SWIG bindings: Apparently need to add mapper_wrap.c as dependency for install hook. commit 1aa6f652618f20721dbca340c6b70fcdf921ccf4 Author: Joseph Malloch Date: Fri Apr 8 13:22:00 2011 -0400 Added units to signal properties sent over admin bus; added example units to test.c commit b21aa37f146e161df09644e512c9de5d65c6778e Author: Stephen Sinclair Date: Tue Apr 5 17:49:12 2011 -0400 Add API function stubs to deal with timetag sending and receiving. commit 78589b653c5828157a2d1056b82e0163dfc6ade4 Merge: a4968a3 2d657fa Author: Stephen Sinclair Date: Wed Apr 6 16:25:45 2011 -0400 Merge remote branch 'malloch/master' into timetags commit a4968a3062f1d0e951b6ff2716fc97ca373a0dc7 Author: Stephen Sinclair Date: Tue Apr 5 11:04:59 2011 -0400 Explicitly link to the math library. commit c276da2901b0a639f3dbaccf8545f32831cc6d39 Author: Stephen Sinclair Date: Tue Apr 5 10:54:39 2011 -0400 Add a libtool macro to check for the math library. commit 5e1994e54b1e4a3499502a15c993ff41e4c92e82 Author: Stephen Sinclair Date: Tue Apr 5 10:52:02 2011 -0400 SWIG bindings: Perform Python's install step on "make install". commit 9cf0c1e3b298df31e393bd4255affb6cb84f8325 Author: Stephen Sinclair Date: Mon Apr 4 16:12:49 2011 -0400 SWIG bindings: use longs instead of ints to store opaque pointers. Was crashing on 64-bit systems. commit c1721bae14c0d1d7f0e8710427a209f2ddc9e507 Author: Stephen Sinclair Date: Wed Mar 30 15:04:29 2011 -0400 SWIG bindings: Add a required header for OS X. Apparently not including arpa/inet.h leads to a segfault if inet_ntoa() is called. (Probably was passing bad data into it too, since wrong data type was being passed as argument.) commit 2d657fa00f625832c5b1ebfece2deeb447fbd0d8 Author: Joseph Malloch Date: Wed Mar 30 15:27:44 2011 -0400 Fixed bug when trying to calibrate with integer-typed source signal. commit 90cf88c76cd7619723ed63cab61c3a49bab7fbe1 Author: Joseph Malloch Date: Tue Mar 29 22:02:29 2011 -0400 Integrated device's update flag into bit flags. commit 90bffe389ec5641a7438c48f6650677f5f617462 Author: Joseph Malloch Date: Fri Mar 25 16:00:59 2011 -0400 Moved paragraph on state queries and implicit mapping from known-limitations section to advantages-of-libmapper section. commit db077aa00533f81a2c6059ca733bf656de0f52bf Author: Joseph Malloch Date: Fri Mar 25 12:06:43 2011 -0400 Only respond once to identical information requests in a given polling step (e.g. from multiple monitors on the network). commit e94b0c02dcdbac654047264f56169b098a169575 Author: Joseph Malloch Date: Wed Mar 23 15:50:50 2011 -0400 Added check for null router return in handler_device_linkTo. commit f4bb3bf3eef00456106c68617858f0ab7fca3990 Merge: 4b76192 4c718ea Author: Joseph Malloch Date: Wed Mar 23 15:45:23 2011 -0400 Merge branch 'null-signals' commit 4b76192d26fc1754beee180094920ed185114296 Author: Joseph Malloch Date: Mon Mar 21 17:35:10 2011 -0400 Changed second argument of msig_query_remote from void* to mapper_signal; added documentation for return value. commit b0faa9b9f3313ba38770b73839f5780a9556d064 Merge: ac6dfd7 5b366f7 Author: Stephen Sinclair Date: Sun Mar 20 16:16:19 2011 -0400 Merge branch 'jni' commit 5b366f723b908e2d6fc598c792246a4f03d8936d Author: Stephen Sinclair Date: Sun Mar 20 16:15:29 2011 -0400 JNI bindings: put the major version number into the name of the .jar file. commit bd683b906f924facb72c4531e0c0b31561b54127 Author: Stephen Sinclair Date: Sun Mar 20 16:06:30 2011 -0400 JNI bindings: allow specifying the path to the JDK during configure. commit cf6d60aa6b39f86ea70ffdd94dad78ecb7a80c99 Author: Stephen Sinclair Date: Sun Mar 20 15:02:44 2011 -0400 JNI bindings: move class list to a single place in makefile, touch headers. Using touch avoids re-running javah on every build, since it seems to not update the file timestamps if they already exist. commit f316562383fe7878e7f42c5b1bae9ca8206a0681 Author: Stephen Sinclair Date: Sun Mar 20 14:42:30 2011 -0400 JNI bindings: build a jar file. commit daf8775554d9dbda3439af99a8297d33ad3ddada Author: Stephen Sinclair Date: Sun Mar 20 12:17:16 2011 -0400 JNI bindings: generate the native library name using autoconf. commit e234ac2ce7b9e5fa88d0376db37c1773c97178b7 Author: Stephen Sinclair Date: Sun Mar 20 02:30:07 2011 -0400 JNI bindings: look for javah properly, check two locations for jni.h. commit cc93342075b820f1014e44ce003af106bd23f6fc Author: Stephen Sinclair Date: Sun Mar 20 02:11:13 2011 -0400 JNI bindings: signal properties. commit 878591bee277bd850bfb645a25851522e7a4f953 Author: Stephen Sinclair Date: Sun Mar 20 00:47:29 2011 -0400 JNI bindings: delete global references created during add_input. commit 9e0955a53c8190468a7ff6c1acd95fd3c1ac6893 Author: Stephen Sinclair Date: Sun Mar 20 00:35:51 2011 -0400 JNI bindings: add_hidden_input and query_remote functions. commit 7f3ec71e99f89e3672d66287474ffc5ab7ebb9ca Author: Stephen Sinclair Date: Sun Mar 20 00:08:59 2011 -0400 JNI bindings: remove some printfs used during development. commit d1b2b4842bbef247c506b463cdda0dd6f28cd323 Author: Stephen Sinclair Date: Sat Mar 19 23:20:46 2011 -0400 JNI bindings: set and remove signal properties. commit 589e4ed0cac2e6fb2ab9bc5678a9b3c287a50838 Author: Stephen Sinclair Date: Fri Mar 18 23:39:11 2011 -0400 JNI bindings: set and remove device properties. commit 74f4fb953a54c520a9e9c6b247dae9f159f11a71 Author: Stephen Sinclair Date: Fri Mar 18 22:35:02 2011 -0400 JNI bindings: declare generated headers correctly for automake. commit 889b52dd36010b8ddf8936500e4928b5bf52723a Author: Stephen Sinclair Date: Thu Mar 17 23:23:14 2011 -0400 JNI bindings: functions for Signal. commit 2bf5204308b5a1d26c713d47cddb94f94d9aefe1 Author: Stephen Sinclair Date: Thu Mar 17 22:41:56 2011 -0400 JNI bindings: convert mapper_signal pointers from jlongs. commit 8c76e54b8996f3635f1a3d5d8f01f8541a8edd37 Author: Stephen Sinclair Date: Thu Mar 17 15:36:41 2011 -0400 JNI bindings: all device functions except properties. commit b8cc9d862e18fe8b0d470e5e72f294b96bb4d14b Author: Stephen Sinclair Date: Thu Mar 17 15:01:07 2011 -0400 JNI bindings: put device checking code for Device.Signal in a function. commit afbe8eb3e2e0d71ee44e6f3c8c81c9b9eccc5f3e Author: Stephen Sinclair Date: Wed Mar 16 23:50:06 2011 -0400 JNI bindings: bail out of the callback chain if an exception occurs. commit 2a7e39599e751491429d42148b04813052c7ffcf Author: Stephen Sinclair Date: Tue Mar 15 18:16:23 2011 -0400 JNI bindings: Retain ref to Device in Signal and potentially throw NullPointerExceptions. commit ac6dfd764212bc834576305f61803fec568b4c56 Author: Stephen Sinclair Date: Wed Mar 16 15:46:42 2011 -0400 Fix unfinished sentence in tutorial. commit 4c718ea75a1bc9ffd7ac409f5c06f02c5c9c8f40 Author: Joseph Malloch Date: Wed Mar 16 11:41:20 2011 -0400 Reverted to passing signal value pointer in signal callback functions, and also added pointer to signal props since type and length are needed to parse value anyway. If the signal has no value, pass NULL. Receipt of empty signal message now sets has_value property to 0. commit aa7388ba6c013d62eeb193effeb95128136539d9 Author: Joseph Malloch Date: Wed Mar 16 11:18:51 2011 -0400 Moved signal has_value property to mapper_db_signal data structure. commit 3e7a81d99ceda8cdf7634935934419407627fd63 Author: Stephen Sinclair Date: Tue Mar 15 18:14:40 2011 -0400 JNI bindings: get signal name. commit cf6a1bf39a78f8e2f6a2165541e592157bf639af Author: Stephen Sinclair Date: Tue Mar 15 17:57:53 2011 -0400 JNI bindings: add output signal to device. commit 8bbc919a3d8eb953972822c6408146206b92d644 Author: Stephen Sinclair Date: Mon Mar 7 14:05:31 2011 -0500 JNI bindings: macros to convert between void* and jlong. commit 036a5b6d5f576a520838bf3c91267c21e2301998 Author: Stephen Sinclair Date: Mon Mar 7 13:22:25 2011 -0500 JNI bindings: call input signal listener. Works, but needs improvement: JVM environment is passed through a global (not thread-safe), and a global reference to the listener is created which is never deleted. commit 093b95180191a395118ab5b829afb63bc79a1f5a Author: Stephen Sinclair Date: Mon Mar 7 11:16:41 2011 -0500 JNI bindings: Add an input signal. Everything but handler works. Note: Only passes min/max information by reference as Double. If I override the function to also pass min/max as Float, Integer, etc, then passing 'null' results in javac complaining about type ambiguity. commit 61c95bb96efd37a270b8a52ad1e3e38ba8b06bf0 Author: Stephen Sinclair Date: Mon Mar 7 10:39:58 2011 -0500 JNI bindings: Ensure device is freed on program exit in test.java. commit 61478f432704c315cea9792443f94451ba54e913 Author: Joseph Malloch Date: Fri Mar 11 13:09:24 2011 -0500 added functions for retrieving number of hidden inputs and device signals commit b86a9a5788713208afd80a9dcb1bdb67edb53bce Author: Joseph Malloch Date: Tue Mar 8 17:16:47 2011 -0500 Changed declaration of signal handler to match current (experimental) usage commit c62b310e2fb6f7db9ac11b315461a890b548d21b Author: Joseph Malloch Date: Mon Mar 7 11:13:56 2011 -0500 Altered testquery program to test empty query responses. commit 8b23f554bd02e6f1909bacd170cb112ea31c2b46 Author: Joseph Malloch Date: Sun Mar 6 19:46:18 2011 -0500 Added methods for sending and receiving empty messages (OSC string + NIL). Altered arguments sent to signal callback functions, and updated test programs accordingly. commit 50a51dffbc3c23365e044723153d6263f7a763af Author: Stephen Sinclair Date: Sun Mar 6 18:53:32 2011 -0500 JNI bindings: Can create and poll a device. commit cf6b1a1387ed4e223b39629ff6927a7ff7dc1581 Author: Stephen Sinclair Date: Sun Mar 6 18:05:07 2011 -0500 JNI bindings: Move code from a "Mapper" class into a "Device" class inside a "Mapper" package. commit a814e011ced8cf3a31c7fae6d436b06e2bbcd8a3 Author: Stephen Sinclair Date: Sun Mar 6 17:37:02 2011 -0500 JNI bindings: Add a skeleton for configuring and compiling the JNI bindings. commit 8b8f571230d576ed85f55f8fe1ad96d30ce4e65f Merge: 415518f 037403e Author: Joseph Malloch Date: Thu Mar 3 17:59:21 2011 -0500 Merge branch 'queries' commit 037403ed92d8ca2aa4e3d6643d1ca9fa452193a0 Author: Joseph Malloch Date: Tue Mar 1 14:16:19 2011 -0500 Moved msig_query_remote from mapper_internal.h to mapper.h commit 32aac9522116363ba177cf3786460b1e72ba46ac Author: Joseph Malloch Date: Tue Mar 1 12:06:50 2011 -0500 Fixed memory allocation bug causing crashes when registering queriable inputs after server start. commit fb3b02f4d8236360554856d47e1aa19812481a85 Author: Joseph Malloch Date: Mon Feb 28 22:00:11 2011 -0500 Fixed error message. commit ec2c48ac62accfad444bd5be0621629830e3fec8 Author: Joseph Malloch Date: Mon Feb 28 21:59:22 2011 -0500 Added testdynamic.c commit b48f4835931a961f8892168eca59787b37cad98e Author: Joseph Malloch Date: Mon Feb 28 20:42:03 2011 -0500 Decrement tally when removing hidden inputs. commit 1b5e86a32df488150d4018a09da319a600fa8fd6 Author: Joseph Malloch Date: Mon Feb 28 17:39:02 2011 -0500 Removed some old comments. commit 27e8885b66e1bd898b4b454e768f035fd3490f18 Author: Joseph Malloch Date: Mon Feb 28 17:38:13 2011 -0500 Set hidden property to 0 in msig_new(). commit 599bc33e3afa4eb536b771ee28017666b02063bb Author: Joseph Malloch Date: Mon Feb 28 11:08:14 2011 -0500 Set sig->has_value to 1 when updating signal. commit 3567e418cb7143ca48eeae269024de8322ebcf77 Author: Joseph Malloch Date: Mon Feb 28 11:04:12 2011 -0500 Check if signal has a value before trying to send it in response to query. commit 7bb14adc7d1b47f843408287ad7d33595aec1ea4 Author: Joseph Malloch Date: Sat Feb 26 16:08:28 2011 -0500 Cleaned up testquery: fixed mistake passing pointer to mdev_add_hidden_input(), cleaned up program output. commit 687193e034aba33867063a68e6b63b9495557bb5 Author: Joseph Malloch Date: Sat Feb 26 15:34:51 2011 -0500 Added function for adding hidden inputs, altered reporting of numInputs to report only public inputs. Now using hidden inputs for testquery. commit 5bf7b782a85929472c9290360ade24517b582bc8 Author: Joseph Malloch Date: Sat Feb 26 14:54:39 2011 -0500 Switched to lo_send_from() for sending queries for remote signals, re-enabled vector query responses, added check for local server before sending query. commit 2a577ebda1c8973559da6e5d1e8950739cad687a Author: Joseph Malloch Date: Fri Feb 25 19:27:14 2011 -0500 Added functions for querying values of connected signals. commit 79beb9a4a29c7484ff3b41f857fbcf2a04b0dc5e Author: Joseph Malloch Date: Thu Feb 24 17:34:18 2011 -0500 Added testquery.c for testing experimental query development (in progress). commit adbe3c4887c289b69db5a66efa3ac6a28e8825f3 Author: malloch Date: Thu Feb 24 11:24:23 2011 -0500 Changed expected query message syntax: if query is sent without arguments, handler will respond using the signal name; if query contains an OSC string as an argument the response will use the string as an alias. commit 95def27d0ddeb6af0fbe0e7cf889a9f29b2d0174 Author: Joseph Malloch Date: Wed Feb 23 20:35:56 2011 -0500 Delete lo_server method for queries when signal is destroyed. commit c296aa13fd2289802352c1e6beb48c4f213eaa98 Author: Joseph Malloch Date: Tue Feb 22 21:21:50 2011 -0500 Fixed terrible string concatenation mistake in previous commit. commit 47764f50e07fe6a2d848f348e8c3edc7a870d671 Author: Joseph Malloch Date: Tue Feb 22 19:14:26 2011 -0500 Added hidden property to signals, added OSC methods for handling value queries. commit 415518f52458a5e665ddfc2a2fe622128400e077 Author: Stephen Sinclair Date: Tue Mar 1 14:48:09 2011 -0500 Python bindings: setting device props, don't call non-existent device.get_properties(). commit f6c5245c804bb0641c82583439695073994630c8 Author: Stephen Sinclair Date: Tue Mar 1 14:28:22 2011 -0500 Python bindings: Release GIL before blocking in poll(), re-aquire during callbacks. commit ee18a400cdc2675e557038d033a8754e961fe912 Author: Stephen Sinclair Date: Tue Mar 1 12:08:57 2011 -0500 Fix calculation of blocking time in mapper_monitor_poll(). commit 271fe3de013708301b0931779e03570781fe252a Author: Stephen Sinclair Date: Mon Feb 28 20:43:39 2011 -0500 Python bindings: override dict for setting properties as l-value. commit 1e3ae1474d99a9f935f8072e5ecd5ac7423e83c9 Merge: 34a518a 1aec23f Author: Stephen Sinclair Date: Mon Feb 28 12:03:29 2011 -0500 Merge branch 'pymon' commit 1aec23f8c024042f04ab37f64225b1c9562a3875 Author: Stephen Sinclair Date: Mon Feb 28 12:00:10 2011 -0500 Python bindings: Allow to set signal and device properties with a dict. Use it with signal's "properties" property. Not like this for device, since device doesn't yet have a "get" function for its properties. commit 34a518ac1e5f9eb66dd10e56d19e3555ded4e729 Author: Stephen Sinclair Date: Mon Feb 28 11:32:23 2011 -0500 Perform null checking when adding lo_args to tables. This helps to support OSC arguments that are contained in the type string, like Nil, Infinitum, True, False, etc. commit 62c34ff19a19279e508cc59a84689f92c184bcf4 Author: Stephen Sinclair Date: Mon Feb 28 11:30:45 2011 -0500 When sending extra params, handle types specifically. Calling lo_message_add with a generic lo_arg was causing problems with certain types. (e.g. float) commit 9da8e4990e26166e92f3f1c714efc57048ee8799 Author: Stephen Sinclair Date: Mon Feb 28 11:30:04 2011 -0500 In db, parse device extra params. commit 7cac8a6ac215d6957c8257561c8c757e647b80aa Author: Stephen Sinclair Date: Sun Feb 27 18:22:17 2011 -0500 Python bindings: add signal/device set_property and remove_property. commit 77c29cca13e34717c358e3ee9f8a77ae492e638b Author: Stephen Sinclair Date: Mon Feb 28 11:28:51 2011 -0500 Python bindings: When converting to dict, handle doubles and long ints. commit d24376f44682f6e9bbab0203f03454b35f0975e1 Author: Stephen Sinclair Date: Sun Feb 27 18:09:33 2011 -0500 Python bindings: database callbacks. commit dd8d94ea4878747c4531b7a8fde25c7701ea92cb Author: Stephen Sinclair Date: Sun Feb 27 17:34:03 2011 -0500 Python bindings: use abstract sequence instead of list for mapping range. commit 9cd2ca27a97ce2233c1cfa63c762708d7b451688 Author: Stephen Sinclair Date: Sun Feb 27 17:31:04 2011 -0500 Python bindings: fix int->float coercion for mapping range. commit 86d92176d222258c5b7a61462f08bf59d861791b Author: Stephen Sinclair Date: Sun Feb 27 17:20:28 2011 -0500 Python bindings: make helper functions static. commit 181c80cdd1fb187f7d448599d20aa8a376b4833a Author: Stephen Sinclair Date: Sun Feb 27 17:17:52 2011 -0500 Python bindings: Wrap admin object to allow special interface/port selection. commit cca53fcbca0c61fd16fae8ce3e2409dafa71db2e Author: Stephen Sinclair Date: Sun Feb 27 15:28:50 2011 -0500 Python bindings: move struct to PyObject conversion to static helpers. Makes returning singular objects (get_link_by_src_dest_name, etc.) work as expected. commit 3b051b96977fc4f131dff139ee6dada0f62f11c0 Author: Stephen Sinclair Date: Sun Feb 27 14:29:34 2011 -0500 Python bindings: Make iterators immediately during class construction. commit f14389f571be0f52130e75925711744d5b83a876 Author: Stephen Sinclair Date: Sun Feb 27 14:04:48 2011 -0500 Python bindings: Add iterators for mappings and links queries. commit 2f5dd06fa854a9048d0b0f00f8bc439aa6a0a06b Author: Stephen Sinclair Date: Sat Feb 26 18:53:38 2011 -0500 Python bindings: add iterators for device and signal search functions. commit 2bc4d2fc8ba0cc374b8f4c1a303c9732ceb85722 Author: Stephen Sinclair Date: Sat Feb 26 17:42:19 2011 -0500 Python bindings: Add iterators for mappings and links. commit 4cce51e1df76111c9804cb7a444816cdc2e350aa Author: Stephen Sinclair Date: Sat Feb 26 16:25:02 2011 -0500 Python bindings: Add iterators for all inputs and all outputs. commit 38d4f0487f3a2c3e426777a247e73188a2db3432 Merge: 232f990 8fef88a Author: Stephen Sinclair Date: Sat Feb 26 18:58:25 2011 -0500 Merge branch 'master' into pymon commit 8fef88a3808b20dd500ad383c911b4e9a82a4e55 Author: Stephen Sinclair Date: Sat Feb 26 18:17:20 2011 -0500 Rename cmp_query_match_device_by_name -> cmp_query_match_devices_by_name, fix const string. commit a972b04dd32cdd139f4525d8b66e9d4c6421067b Author: Stephen Sinclair Date: Sat Feb 26 16:40:58 2011 -0500 In monitor, automatically request signals, links, mappings on seeing new device. commit f869602990f162d9c92a30b9a2d1c9c3e5904c30 Author: Stephen Sinclair Date: Sat Feb 26 16:24:36 2011 -0500 Add function mapper_monitor_request_devices(), which sends /who. commit 232f9904c2065a7c5fec955029f5d981db758cc5 Author: Stephen Sinclair Date: Sat Feb 26 15:47:59 2011 -0500 Python bindings: Expose the iterable list of devices through a generator. commit 0e2724a22a8ada4c9e8fe75571cf5025f6714e84 Author: Stephen Sinclair Date: Fri Feb 25 23:34:33 2011 -0500 Python bindings: expose signal.properties as a dict, add basic monitor actions. For monitor.connect, monitor.modify, converts an input dict to a temporary mapper_db_mapping_t + flags structure which is passed on to the function. commit 20a8c3d8000c7b9c12b9167e18ddf238984a66c2 Author: Stephen Sinclair Date: Sat Feb 19 14:50:16 2011 -0500 Don't try to trace a device name for monitor messages. commit ac51b5ac92b129910b5a6afdd6af47fb9d218188 Author: Joseph Malloch Date: Sun Feb 20 13:35:58 2011 -0500 Check to see if updated signal is output before calling mdev_route_signal() commit 459d7b269315d23167be19f55f3b4ea2093020c9 Author: Joseph Malloch Date: Sun Feb 20 13:27:55 2011 -0500 Moved setting of stored signal value from mdev_route_signal() to the msig_update() functions, since this is conceptually clearer. This is especially important when updating input signal values which may never be routed. commit 1ad76b7935c91e32a18a6aee334ac13625522afb Author: Stephen Sinclair Date: Fri Feb 18 13:48:27 2011 -0500 Add a little OS X App that launches the Slider example, allowing to launch it multiple times. commit 9371931c9a3472bba93c30279df62c1661be960a Author: Stephen Sinclair Date: Thu Feb 3 12:12:44 2011 +0100 Make use of liblo's lo_server_new_multicast_iface() if available. This fixes the problem on Linux of not working when not connected to a network. In general it seems Linux does not default to using the loopback NIC when not connected, therefore it must be specified explicitly. commit 6e19bdc12c07c40080d43e862b71d146bb4fb36b Merge: ac5cda1 92129f1 Author: Stephen Sinclair Date: Mon Jan 31 15:23:43 2011 +0100 Merge branch 'keep_signal_value' Conflicts: src/device.c commit 92129f1434395e843cfe02c734a8ae0a32d0332a Author: Stephen Sinclair Date: Mon Jan 31 15:18:42 2011 +0100 Rename msig_size to msig_vector_bytes to keep things clear. commit e4db1cc7f958734663484a9dcb4ddfa2cb7372f1 Author: Stephen Sinclair Date: Mon Jan 31 15:12:26 2011 +0100 Use msig_size and memcpy, memset in a few more places. commit 07ee5a5345d12868cd271657b330ce2e5ea82a90 Author: Stephen Sinclair Date: Mon Jan 31 15:14:20 2011 +0100 Signal value is a vector so make it a void pointer instead of mapper_signal_value_t*. commit 9e98cd91b76002f8a163982d16c8dca4d271bcf2 Author: Stephen Sinclair Date: Mon Jan 31 12:33:32 2011 +0100 Add a function to get a signal's vector size in bytes and use this for memcpy. commit ac5cda18a0cb1d9e2c14ee81a0080703064d60af Author: Stephen Sinclair Date: Sat Jan 29 03:39:13 2011 +0100 Allow element-wise vector mappings. This doesn't implement full vector support, i.e., N-to-M expressions, but in the meantime it applies the expression to each element in a vector to allow N-to-N mappings. Vector indexing is disallowed. commit fd88e0d3b9e7d0b7af90d350dcb8cf8fc00bc665 Author: Joseph Malloch Date: Fri Jan 28 11:13:38 2011 -0500 update to roadmap commit 223368b5effbb7e4ef36b58aedaddd0438950b3e Author: Joseph Malloch Date: Fri Jan 28 11:08:05 2011 -0500 Delete corresponding liblo server method when input signal is removed. commit 007942d4f37a59bc5057edebc2377e3843f5e875 Merge: 3ee63f1 219ef6d Author: Joseph Malloch Date: Wed Jan 26 22:48:50 2011 -0500 Merge branch 'master' of github.com:malloch/libmapper commit 3ee63f1fb1891d4d667539b3a1652a31bad1e006 Author: Joseph Malloch Date: Wed Jan 26 09:52:40 2011 -0500 Added local storage of signal value to be used for state queries. commit 219ef6dfb5574b933fa6a8fa10bcbb53794bd0d6 Author: Stephen Sinclair Date: Sun Jan 23 03:30:57 2011 +0800 Make sure to free the type string allocated in mdev_add_input. commit a7abc6502cb38cbcec464f9050ef40dbe22b9e63 Author: Stephen Sinclair Date: Sat Jan 22 14:30:57 2011 -0500 Make sure to free the type string allocated in mdev_add_input. commit fc88cfee12fd485f77a4c6f29b5fa8809ddb0cfe Author: Malloch Date: Fri Jan 21 17:22:45 2011 -0500 Input signals added after device registration were not being added to OSC server. commit fdbc11238951299a3685408dbadd624d83f586a2 Author: Malloch Date: Fri Jan 21 16:54:58 2011 -0500 Once admin ordinal is known, set device_name property of exisiting signals. commit 1c0f7c69f9c263317895dad4b9d38be4b2c8d6f2 Author: Joseph Malloch Date: Mon Dec 13 17:15:56 2010 -0500 If a /connect message is sent and the mapping already exists, forward the message to the handler for /connection/modify commit 3d4a1741e0ed3307a4de9de6088604988c46d1fd Author: Joseph Malloch Date: Mon Dec 13 16:37:35 2010 -0500 Slight simplification of last commit, and do not enable expression mode if setting expression fails commit 8ec6fdf9a68e08f1b63d5778145ef9e9a5641bf9 Author: Joseph Malloch Date: Mon Dec 13 13:44:07 2010 -0500 Check if expression has been initialized successfully before entering expression mode; default to y=x if expression string is not set commit f0174a8463518cd8ebc582de93a0822257205770 Author: Stephen Sinclair Date: Fri Dec 10 20:38:06 2010 -0500 In readme, make idmil.org reference into a hyperlink. commit fc3537276d3700181e292fae40bbe3311d777e9d Author: Stephen Sinclair Date: Fri Dec 10 23:25:01 2010 +0000 Remove my name from the tutorial so that anyone can feel free to edit it. commit 733c9e0d89cd11d14007a7abecbe8e3db5d06853 Author: Stephen Sinclair Date: Fri Dec 10 23:16:48 2010 +0000 Reformat some longer lines of code in the tutorial. commit 8f4347db7ec70db2b69665cab56bb3953c4bc3c0 Author: Joseph Malloch Date: Fri Dec 10 23:16:21 2010 +0000 switched "input" and "output" to "source" and "destination" in README for clarity (they were also backwards) commit bc1b66b309e900af94b9440a07359958da941d8e Author: Stephen Sinclair Date: Fri Dec 10 22:59:18 2010 +0000 Add the IDMIL website to the readme. commit bb6c7a27c296e99ba484c60d264df0d12e0bb238 Author: Stephen Sinclair Date: Fri Dec 10 21:39:18 2010 +0000 Fix mistake in last commit, assignment to the mapper_mapping variable after search. commit f30e9ea58a0431a5ce0ddad2cf98044bbfeb8034 Author: Stephen Sinclair Date: Fri Dec 10 21:05:54 2010 +0000 Search for an existing mapping before adding a new one. commit ff8f672fae2c0da7da5a64c827e4438d9e09fc3c Author: Stephen Sinclair Date: Fri Dec 10 20:53:28 2010 +0000 Grab the 'mute' state from incoming messages. commit 4de7c1f8293dcba2e1a2c5be16bdacb5bf36a1df Author: Joseph Malloch Date: Fri Dec 10 20:49:53 2010 +0000 fix calibration bug when source type is int commit 12fef2f24eaeb5794603746735a35e83f5b7b623 Author: Vijay Rudraraju Date: Fri Dec 10 20:43:48 2010 +0000 added mapper_monitor_mapping_modify commit 92f0e5a7d366174728897406c38dda7ade192cc8 Author: Stephen Sinclair Date: Thu Dec 9 21:10:09 2010 +0000 Add the libmapper_doc icon to the Slider and PWM examples. commit 3024d381851e78b70e4e743ef2386fd9371b255b Author: Joseph Malloch Date: Thu Dec 9 20:54:23 2010 +0000 added icon omnigraffle file commit b43d889c5b721638dffe24f0a3b73786e5ee516b Author: Stephen Sinclair Date: Thu Dec 9 20:45:26 2010 +0000 Binary build, fix recompilation of _pwm.so. commit 164680045868341e7caf40fea8ffae8eda202da5 Author: Joseph Malloch Date: Thu Dec 9 20:37:55 2010 +0000 added some icons commit 79be3b6629470898088d3d9ef75907c78d2363d5 Author: Stephen Sinclair Date: Thu Dec 9 20:00:32 2010 +0000 In mapper.framework, put the libmapper headers in the right place. commit 11e59cb97a1ae82c2d01c3f765632ec6770251a5 Author: Stephen Sinclair Date: Thu Dec 9 19:59:06 2010 +0000 In sending /connected, append @range if any part of it is known. Previously it would only be appended if the full range is known. commit 572e3d01fc234b89805a3fd4e8e017a2259b1eab Author: Stephen Sinclair Date: Thu Dec 9 19:31:49 2010 +0000 Set range from message in mapper_db_mapping struct correctly. commit 30fbeaf70326ea7efd3a94a8f66a62ab37bcfb3d Author: Stephen Sinclair Date: Thu Dec 9 18:46:10 2010 +0000 Forgot to remove this throw-away file in last commit. commit 77a8ce68f36f2e6233b81e1d380040a1a8aef19c Author: Stephen Sinclair Date: Thu Dec 9 18:45:03 2010 +0000 Update binary builder to use 10.5 SDK and correctly use @rpath in the framework. commit 9b60ef0cd711c339d866a7eeec034cde9367dc97 Author: Stephen Sinclair Date: Wed Dec 8 16:17:33 2010 +0000 Include the tutorial in dist. commit fd9e1ac73ccf5ccf9d3ab0638640a86a62a4520f Author: Stephen Sinclair Date: Wed Dec 8 16:17:24 2010 +0000 Make out-of-tree build work (VPATH build) by using srcdir, builddir, etc. This makes "make distcheck" finish successfully. commit b81fb469b89f9ce1f774f0dcc8b68ec711f12adc Author: Stephen Sinclair Date: Wed Dec 8 06:38:46 2010 +0000 Script to build binary versions for all architectures, merge them, and make bundles. commit d393b538a50251fa5b593eb3002ee13e3615a7b0 Author: Stephen Sinclair Date: Tue Dec 7 20:41:55 2010 +0000 Add a check to disable vector mapping. Unfortunately the expression compiler and evaluator both need some work before vector mappings are handled properly. Better to disable it for now, since it won't be ready for first release--considered interesting future work: Basically, currently an `x' in an expression is considered the same as `x[0]'. This is wrong, since we don't support a way to build vectors, and therefore it implies that only vector-to-scalar mappings are possible. Two things need to happen: we need a `comma' (e.g. Python) or `space' (e.g. Matlab) operator to allow building vectors in an expression: y = [ x[0]*x[1], x[1]*x[2], x[0]*x[2] ] We also need to treat a long `x' as a reference to the entire vector, treated as a first-class value. The evaluator currently assumes the stack contains only scalars. We need to be able to push an entire vector on the stack and perform operations across its contents. That is, the expression, y = x*10 should multiple each item in `x' by 10, whatever its size. commit ae1930c43537a787a171974a44a4e8b640a9f54f Author: Stephen Sinclair Date: Tue Dec 7 20:41:47 2010 +0000 Fail to create mapping in /connectTo handler if lengths don't match. As noted, in the future the expression should be examined to see if it makes the types work out. For now, we assume the expression is a scalar expression to be applied to each item in the vector. commit 9b6784f328668f7e92e561db5adfccc06da72de8 Author: Stephen Sinclair Date: Tue Dec 7 20:41:40 2010 +0000 Add some debug checks for msig_update_*. Actually it might be nice to include the type/length checks in non-debug build, but let's save a few operations and assume the caller knows what he's doing unless explicitly running debug version. commit 1b5dfb287d0ecb78eca69866d018b2bb48232ffd Author: Stephen Sinclair Date: Tue Dec 7 20:41:32 2010 +0000 Add a test for vector mapping. commit 70f29b6bc54d6f160354fb46a4dde57ee2401ad3 Author: Stephen Sinclair Date: Tue Dec 7 18:57:59 2010 +0000 If server cannot be started because port is unavailable, try allocation again. In order to access liblo error message, it was necessary to add a mutex for thread safety because it can only be passed by global memory due to liblo's error handler design. commit 23e488276383cb1f93330241e2888b921455ce7e Author: Stephen Sinclair Date: Mon Dec 6 17:54:42 2010 +0000 Make testmonitor use the API functions for info requests. commit a6562b0c90c151793b241c4dc27a5ef9b8c82e79 Author: Stephen Sinclair Date: Mon Dec 6 17:49:34 2010 +0000 Provide length information in mapper_db_mapping structure. The length must be required anywhere the type is also required. Could even perhaps create a structure to enforce this, but this should do for now. commit ea138099b903af42b9a33e1021ce1ab110d18af1 Author: Stephen Sinclair Date: Mon Dec 6 17:49:29 2010 +0000 Fix 'enumerate mode and clipping' types TODOs. commit 560ee672cd578966d4c4c0274dafc36e59a343df Author: Stephen Sinclair Date: Mon Dec 6 17:30:50 2010 +0000 Remove TODO about automatic /linkTo. commit 676e79c0682afd41e374b09421993e118acd7cd5 Author: Stephen Sinclair Date: Mon Dec 6 17:28:55 2010 +0000 Explicitly ignore '-' characters in @range arguments. Also, we agreed to take the 'invert' idea out of the protocol and leave it up to the client code. commit efb09be464917373caa6e70829424964656c9b2b Author: Stephen Sinclair Date: Mon Dec 6 17:28:51 2010 +0000 Segfault in /connection/modify handler, don't assume a mapping was found. commit f96097bf2647ca01312cb1d4c8ef866132a9b3ce Author: Stephen Sinclair Date: Sun Dec 5 21:58:42 2010 +0000 Fix memory leak in mapper_router_receive_signal(), strdup introduced in r2073. Router maps the signal by temporarily creating a new signal with the destination name and type. However, no need to actually allocate and copy the destination name, it is not written to and doesn't last long so we can just point to it. commit f4f20d700e0a98d098a379c84338786eb8ce0d98 Author: Stephen Sinclair Date: Sun Dec 5 20:41:00 2010 +0000 Readme, word 'based' used twice in a row. commit 40eced6f844e1434766fdd5cdf1f40c28fb81278 Author: Stephen Sinclair Date: Sun Dec 5 20:40:54 2010 +0000 Readme, rewrite paragraph mentioning Max/Pd object. commit fac262dcfdb368f55ec8d1e3c4977d53ff6ec01e Author: Stephen Sinclair Date: Sun Dec 5 20:40:46 2010 +0000 Readme, reflow some paragraphs. commit 2c2e859aec1dabf3aea4cf30f0a99c5a8db780aa Author: Stephen Sinclair Date: Sun Dec 5 20:40:40 2010 +0000 Make the readme introduction more informative, shorter, make 'history' section. commit 6bbbbb526aec9da0de6cca5be7f6eff410fb7a8c Author: Stephen Sinclair Date: Sun Dec 5 04:20:37 2010 +0000 Fix msig_update, was wrongly taking address of pointer. commit 94f47ae7595fe50953e4eeacd3b7286b9b0bbd14 Author: Stephen Sinclair Date: Sun Dec 5 04:20:23 2010 +0000 Require destination type and length information in mapper_router_add_mapping(). Fixes broken messaging in testlinear, testexpression. Basically this is required information--a mapping should fail to be created if type and length are not provided. commit f306ce4f6435eef9d27e312f0227791b190899b7 Author: Stephen Sinclair Date: Sun Dec 5 00:14:53 2010 +0000 Include Python example main files in dist. commit e245dd0719a74dfde0fb96c4a062ae3b4cafa3ed Author: Stephen Sinclair Date: Sat Dec 4 22:41:56 2010 +0000 Display name and port in both Python examples. commit 1155ed98df9001d067c38781982ddbedfb071cc7 Author: Stephen Sinclair Date: Sat Dec 4 22:14:39 2010 +0000 Check types during clipping. commit b587d3f2bac1d46f864137ac1148d8ef7f22cd8a Author: Stephen Sinclair Date: Sat Dec 4 22:14:32 2010 +0000 For /connectTo, fill in known input properties for missing /connect arguments. Previously it used input properties when /connect args were unspecified, or only /connect args if any were specified. Therefore underspecified /connect messages caused problems. This way, all properties of the input signal are available in /connectTo, unless overridden by what was requested in /connect. commit 096d21a43403589d73dcb1672e59072cbe993843 Author: Stephen Sinclair Date: Sat Dec 4 22:14:22 2010 +0000 Check types during bypass mode perform. commit 6fc6cf48667c726643e80985b53bf9c89be8c02a Author: Stephen Sinclair Date: Sat Dec 4 22:14:12 2010 +0000 Add mapper_admin_send_connected(), use where /connected was constructed manually. commit 9481753ff510bed666d27d3de68ad2953d7855ab Author: Stephen Sinclair Date: Sat Dec 4 22:14:05 2010 +0000 Avoid a liblo error by calling lo_message_add_varargs_internal correctly. commit ee7006f49e4913ab06d5ad02548a12ac8d929d1c Author: Stephen Sinclair Date: Sat Dec 4 22:13:56 2010 +0000 Type coersion for final expression output. commit ffd909c5edf87c6dea5db89a7f656f23ca4ef065 Author: Joseph Malloch Date: Sat Dec 4 21:47:38 2010 +0000 don't seed random number generator commit d1367bec5045df5a93d8544b7dc990dc5fa10440 Author: Stephen Sinclair Date: Fri Dec 3 21:21:42 2010 +0000 Remove "send /modify" TODO statements. This cannot be accomplished in mapping.c, because there is no pointer to admin. Rather, it is already being done after these "set" functions are called in response to /connection/modify messages. commit 16ebe3b30a405104f7f702ab3a716c97c76900eb Author: Joseph Malloch Date: Fri Dec 3 20:09:10 2010 +0000 sped up polling in testmany commit bd4da831691ac618ab72e5433da27308a28b3975 Author: Joseph Malloch Date: Fri Dec 3 15:44:49 2010 +0000 made testmany actually use name allocation commit 8d2661037d4573e19451ed62ecd35861d8f6c663 Author: Stephen Sinclair Date: Fri Dec 3 01:56:54 2010 +0000 Allow parameters to be specified on command line for testmany. commit 33cf63d9ad0b300dadcf0c82ce40eac03e57f72c Author: Stephen Sinclair Date: Fri Dec 3 01:56:43 2010 +0000 Remove the 'qt' prefix from test devices, rename 'test_2' to 'testmany'. commit 19ecf55305afb785f564400be122a5a355d99dda Author: Joseph Malloch Date: Thu Dec 2 21:17:58 2010 +0000 A few small edits on the README commit a50f4fa9f70e3d2f884f2349c245c9acd6379ab8 Author: Stephen Sinclair Date: Thu Dec 2 04:40:04 2010 +0000 Add a tutorial section about adding extra metadata. commit 39c3c1b5a0eb494cbca453e7aef86c8b372e3e81 Author: Stephen Sinclair Date: Thu Dec 2 04:39:56 2010 +0000 Add signal's user_data field to the list of queriable properties. commit 7e9c0e88ce5782cadb4507b22dcfc2ed4b0c895c Author: Stephen Sinclair Date: Thu Dec 2 04:39:46 2010 +0000 When dealing with extra properties which can be any lo_arg type, use lo_type. commit efc9f74ac21dfbe51e252b7aa2d2c821f95950f2 Author: Stephen Sinclair Date: Thu Dec 2 03:19:30 2010 +0000 Forgot to shorten 'maximum' and 'minimum' to 'max' and 'min' in testprops. commit 596ea98e225c474075d7a08da0f736e8800d6043 Author: Stephen Sinclair Date: Wed Dec 1 19:08:18 2010 +0000 Replace obsolete call to update_scalar in tkgui.py. commit 1c66d4d3732a00de041ac2ff8ed3ea3549494a72 Author: Stephen Sinclair Date: Wed Dec 1 19:08:10 2010 +0000 Fix type coersion for max/min values in SWIG binding device.add_input/add_output. commit a2a3a5f9f719332f06ae50304f643f84476ba818 Author: Stephen Sinclair Date: Wed Dec 1 17:21:27 2010 +0000 No point keeping barely-used MSIGVAL and MSIGVALP macros around. commit 3d3e4a579b24a3fbab4dc8fa8365e8293dc92f1f Author: Stephen Sinclair Date: Wed Dec 1 17:19:54 2010 +0000 May as well also remove the use of mapper_signal_value_t in msig_set_max/min. commit a4ff71fc07c076c852f9cd88c077f7a5382322cd Author: Stephen Sinclair Date: Wed Dec 1 17:01:25 2010 +0000 Avoid the warning "function declaration isn't a prototype" when a function has no arguments. commit ca9037e64970181ae5cc93a722b30a8cb8f0acee Author: Stephen Sinclair Date: Wed Dec 1 16:57:15 2010 +0000 In signal handler, provide the value as a void* instead of mapper_signal_value_t*. In fact, the max external made the exact error that this change is intended to prevent! (i.e., indexing into an array of mapper_signal_value_t instead of an array of float/int/etc.) So, shows that it's probably better this way. We need more testing code for vector signals. commit 8ddd4d7b093b0df4cbccf3c67c61f06a899bba42 Author: Stephen Sinclair Date: Wed Dec 1 16:57:00 2010 +0000 mdev_ip4 should return a const pointer. commit 1653430a57207621e37564f040ca95e91dbc5254 Author: Stephen Sinclair Date: Wed Dec 1 16:56:47 2010 +0000 Add some comments for doxygen documentation and normalize some function argument names. commit df7be93d25077c2da6875c5be86b3de05d99eaf2 Author: Stephen Sinclair Date: Tue Nov 30 22:27:50 2010 +0000 Rename mapper_db_create/destroy_mapping and sort out the API for network control. These functions are not db functions, but they do need the monitor pointer in order to get an admin for sending admin messages. Technically a device could do this too, but we assume the use case is for monitors. Add functions to link/unlink, connect/disconnect. Connection properties can be specified by passing a mapper_db_mapping_t structure, along with a bitflag indicating which properties are valid. commit bb971d58c743ab7dde36baee7d072eef372cdaee Author: Stephen Sinclair Date: Tue Nov 30 22:27:39 2010 +0000 Replace clip_lower, clip_upper with clip_min, clip_max in mapper_db_mapping. For consistency. commit bbf7c9131d6e2ede2c7363e70d6a211ffb5d2751 Author: Joseph Malloch Date: Mon Nov 29 23:01:17 2010 +0000 mapper external: fixed bug reading signal max property, added signal removal method commit aa7a488e70bea8176be02a18c9cd0909d1d0ecbc Author: Joseph Malloch Date: Mon Nov 29 16:09:24 2010 +0000 changed SC_ props to MO_ since they are now "modes" not "scaling types" commit fd08a8c760d04e77bd0dbb7a8a276674f18f327c Author: Stephen Sinclair Date: Mon Nov 29 03:12:42 2010 +0000 Fix SWIG bindings for recent API changes--add ip4, interface, ordinal. commit 5a25293d9c5c98e3c37cfba263def03277eec4c4 Author: Joseph Malloch Date: Mon Nov 29 00:54:04 2010 +0000 Pass all destination signal properties with flavourless /connectTo message - allows signal metadata to include clipping behaviour. commit 9298f73346ec6d10a2337c5d3fc5686047942f53 Author: Stephen Sinclair Date: Sun Nov 28 20:43:14 2010 +0000 Make some more device information publically available. Ordinal, IP, interface. commit 8a95c09f275af2af952ecff5326e0693bc091b87 Author: Stephen Sinclair Date: Sun Nov 28 20:42:54 2010 +0000 Rename msig_get_properties() to msig_properties(). commit 16c6e1cb179cd5281a03f71e4ebb7559c88495eb Author: Stephen Sinclair Date: Sun Nov 28 20:42:31 2010 +0000 Move signal's user_data to mapper_db_signal, to make it publically available. commit 8888be93938b8e916418cf122117060ff4f161ec Author: Stephen Sinclair Date: Sun Nov 28 00:18:37 2010 +0000 Add functions to remove signals from a device. commit ed70f67756f40baf00db286878ce17d210b5dde8 Author: Stephen Sinclair Date: Sun Nov 28 00:18:25 2010 +0000 Document the device parameter of mdev_add_*. commit ed487575da88ab51bd79709f1eb0fe6b6e4b925a Author: Stephen Sinclair Date: Sat Nov 27 23:50:29 2010 +0000 Update tutorial to reflect recent changes. commit 22f84a9b8a8b7ab5a1396113b8588b7d8ae6d3d5 Author: Stephen Sinclair Date: Sat Nov 27 23:50:20 2010 +0000 Also don't use mapper_signal_value_t in the msig_update() prototype. Replace msig_update_scalar() with msig_update_float() and msig_update_int() to eliminate need to cast to mapper_signal_value_t. commit 37c7038bd019e6c4d5679e040e3634ffcc170dbe Author: Stephen Sinclair Date: Sat Nov 27 23:18:59 2010 +0000 Rename mdev_find_*_by_name to mdev_get_*_by_name, add _by_index(). Changes the prototype for these functions too. Returns mapper_signal, index is by pointer, instead of the other way around. commit e1d969cbaae5d684b8dc238c14898477da658f45 Author: Stephen Sinclair Date: Sat Nov 27 23:18:48 2010 +0000 Fix calls to mdev_add_input and mdev_add_output in SWIG binding. commit f19d41610d6ec50ad417d431cc07ad2a0337b3c9 Author: Joseph Malloch Date: Sat Nov 27 22:43:36 2010 +0000 added check to see if device owns a signal of the same name before adding a new one commit bcb223d2c26d3e2adf82773c747ba867ec9e4b47 Author: Stephen Sinclair Date: Sat Nov 27 20:43:15 2010 +0000 Remove the 'value' argument for signals. I now think that this would have been somewhat of a misfeature, encouraging a bad programming style to use implicit updates based on non-owned memory. Would have been fragile, prone to mistakes: explicit update and _not_ pointing to user memory is better. commit cd420a28159dec0f6019ae4e9364fa2cab3d63fd Author: Stephen Sinclair Date: Sat Nov 27 20:42:54 2010 +0000 Use a more sensible order for the arguments to mdev_add_input/output. Strictly required arguments first, then optional arguments. This particularly makes the default values more useful for the SWIG bindings. Also, length and type should be next to each other. commit eb9a371480a15f9a66540f947c17d9b843a28e41 Author: Stephen Sinclair Date: Sat Nov 27 20:42:32 2010 +0000 In SWIG bindings, allow handler to be None, give default args to several functions. commit ffd0df23a919728aacdd98622bc4b0d4c0fc6b39 Author: Stephen Sinclair Date: Sat Nov 27 20:42:25 2010 +0000 Remove typed signal constructors from SWIG bindings. commit 9b0811d18aadafe748d49092b1a15600f8af61d4 Author: Stephen Sinclair Date: Sat Nov 27 19:44:58 2010 +0000 Remove type-specific "shortcuts" for adding signals, use void* instead. Realized it would be a mistake to suggest that you can pass an array of mapper_signal_value_t to this function, since the memory layout might not remain the same when we add new types, and we can't count on it lining up with float or int arrays. Instead, just use void*. This makes C perform pointer coercion without a warning, so the need for a macro to convert the pointer to mapper_signal_value_t* goes away. With the observation that calling the full mdev_add_input/output is actually now less characters that using mdev_add_float_input et al., may as well remove these as they aren't really needed or helpful. commit 04390f714da4edda532cd89a60e006a04f9088a1 Author: Stephen Sinclair Date: Sat Nov 27 19:44:41 2010 +0000 Handle the case where signal name is specified without a prefixed slash. commit eaafde5e7a7367e975e3e1038c91ac73c7fadc72 Author: Stephen Sinclair Date: Sat Nov 27 19:44:34 2010 +0000 Remove msig_int and msig_float functions, move msig_new and msig_free to internal header. commit f66a3c2c6d70e2faee1455ec2e6f0562973f0b5f Author: Stephen Sinclair Date: Sat Nov 27 19:44:23 2010 +0000 Restore the 'examples' subdirectory in build. commit fca639243ec78c8ae0677c297fbd0cb00fdbbd13 Author: Vijay Rudraraju Date: Sat Nov 27 00:09:14 2010 +0000 adding support for expressions, ranges, limits, etc...not finished commit a5d50a821dfa713a4e2c32f7a389e8387203a6e0 Author: Joseph Malloch Date: Fri Nov 26 02:13:47 2010 +0000 added low-priority task commit f2ccd34d91aa0dc1b0e68bc1519f7fed533a7964 Author: Stephen Sinclair Date: Thu Nov 25 20:53:01 2010 +0000 A few more files that should go into dist. commit 1373a7257893b1bd67114a48c814c0886b40debc Author: Stephen Sinclair Date: Thu Nov 25 18:54:51 2010 +0000 Remove obsolete reference to operation.h, expression.h in EXTRA_DIST. commit c02aa58d637a3396e0cc9f91158da67a6b6db290 Author: Stephen Sinclair Date: Thu Nov 25 18:53:34 2010 +0000 Missed referencing URL for Arduino in README. commit 4bd1b3ef86c6b8711129324a149122bb0746f32d Author: Stephen Sinclair Date: Thu Nov 25 18:52:27 2010 +0000 Rename README to README.markdown to make github happy. Then copy to README during autogen to make automake happy. commit f3967c7e8d572e5f3e8a6f1e1462e0e6f6854374 Author: Stephen Sinclair Date: Thu Nov 25 18:39:18 2010 +0000 A few more details in README and add URLs for all mentioned external projects. commit 368e1527bdd5633e5a87fb8b7f3a179b2e8fa67b Author: Stephen Sinclair Date: Thu Nov 25 16:58:38 2010 +0000 Add a few more details to README. commit 92a9b2d632695c3b1a7a1c7a98a6abfb59405324 Author: Joseph Malloch Date: Thu Nov 25 13:47:06 2010 +0000 just a couple of typos commit 3c98ee2715d64790b047a84c61bff11a2e455411 Author: Joseph Malloch Date: Thu Nov 25 13:45:21 2010 +0000 changed reported range in test.c to match generated output commit 59cb4d293cde46c628b8beb5ef7a834ae2409df7 Author: Stephen Sinclair Date: Wed Nov 24 23:14:56 2010 +0000 Add license information for the library's dependencies. commit 98deb4906f363acbbf965e42fc7eb3277828c869 Author: Stephen Sinclair Date: Wed Nov 24 22:02:11 2010 +0000 In README, mention many-to-one mappings in the limitations section. commit dbf81bc82238c34f58d4b0ff5f0c6a7acb4b9465 Author: Stephen Sinclair Date: Wed Nov 24 21:06:47 2010 +0000 Update AUTHORS and README. A verbose rant on the purpose of this library, and its advantages and limitations. commit c1dd77130e6d3146983c90db440d0ad6634e2a81 Author: Stephen Sinclair Date: Wed Nov 24 16:22:29 2010 +0000 Fix device polling, returns the number of messages handled, sleeps correctly. Expands on this a little in the tutorial, discussing the effect of blocking/non-blocking polling modes on message handling. commit 7551177bd525f5b5cb5a0a39e6085939c7dfa4ad Author: Stephen Sinclair Date: Wed Nov 24 03:24:27 2010 +0000 Add a simple PWM synthesizer to use as a sound example. This patch pulls in RtAudio 4.0.7 into the project as a minimal way to access platform sound APIs. configure.ac was modified to detect ALSA or CoreAudio and provide the RtAudio compiler flags accordingly. The file `pwm_example` runs this synth with mappable parameters as a command-line tool. In order to provide a GUI, it also includes a second Python project `py_tk_gui` which wraps the synth in a Python module and uses Tkinter to provide mappable knobs. This will of course only work if SWIG is found and enabled. Note that because of RtAudio's C++iness, the examples provided are .cpp files to make autoconf figure out that it needs to use g++ for linking. It might be nice in the future to come up with a C++less alternative, but this'll have to do for now. commit 28bbc6c8e7e641c2078086ad4598ed0ab7becb67 Author: Stephen Sinclair Date: Wed Nov 24 03:23:53 2010 +0000 Fix the SWIG interface to use the mdev_add_* functions instead of mdev_register*. commit 9d5eb76e8e78c789ba1e900b1cab78813a9dac64 Author: Stephen Sinclair Date: Tue Nov 23 21:42:19 2010 +0000 Remove "maximum" and "minimum" and consistenly use "max" and "min" everywhere. commit 45afca5a6bdc2b1c99699b33030a2982531a14ce Author: Stephen Sinclair Date: Tue Nov 23 20:23:43 2010 +0000 Fix: forgot to set is_output in db from @direction param. commit 4a4f6b057fd7cb713a97039f4d1e2e1aa527bfe9 Author: Joseph Malloch Date: Tue Nov 23 00:10:49 2010 +0000 swapped "@rev" attribute for "@hash". This attribute should be incremented whenever the device signal-space changes (adding/removing signals, perhaps changing their attributes in the future). commit 62e486e98c06f9001db25a92103e2497f775a408 Author: Joseph Malloch Date: Mon Nov 22 23:06:04 2010 +0000 Added logout handler to devices for freeing resource suggestions; removed IP and port attributes from logout message since ports will soon be allocated internally commit 1a71a0de89f05c8a0acac9d57ff31d49b1c59371 Author: Joseph Malloch Date: Mon Nov 22 22:39:24 2010 +0000 updated libmapper roadmap commit 6778e830b7cb6700c37a58ebfd157b3611747e1a Author: Joseph Malloch Date: Mon Nov 22 20:45:23 2010 +0000 merged signal creation API as discussed commit fd812decd88b03389a29c922287165bcdfecdb9f Author: Joseph Malloch Date: Mon Nov 22 20:44:30 2010 +0000 removed old reference to can_alias attribute commit 8e9a4ad2a8aa9681e6cbe809c6c949b255cf7fe8 Author: Stephen Sinclair Date: Sun Nov 21 21:21:12 2010 +0000 Most of a tutorial on how to use libmapper to create devices and signals. commit d76f32bcc8ec7710bee64ba43bf58a0176f6905a Author: Stephen Sinclair Date: Sun Nov 21 04:07:06 2010 +0000 Add doxygen group commands to the public header files. This adds a "modules" section to the generated documentation, making it easier to navigate. commit b2a1ca619b5562b6991b0708f6f6e91e593fbd50 Author: Stephen Sinclair Date: Sun Nov 21 04:06:58 2010 +0000 Move mapper_osc_value_t to an internal type. commit d2968839829a095e10ab4aca72e6120fccf13d4e Author: Joseph Malloch Date: Tue Nov 16 17:07:28 2010 +0000 mapper protocol change: /link_to -> /linkTo /connect_to -> /connectTo commit 7fc0a65b0286644f6c1ba8e98a3f1677545b38e8 Author: Joseph Malloch Date: Sun Nov 14 22:51:11 2010 +0000 protocol change: /registered -> /device commit 147178451ee87d7c6ff7d78f499d00d27875f399 Author: Joseph Malloch Date: Sun Nov 14 22:22:14 2010 +0000 removed canAlias attribute; removed debug message from r2456 commit c1602d0977ab0f9f57a3b1e3c97c4fa5ec0a94ac Author: Joseph Malloch Date: Sun Nov 14 22:01:16 2010 +0000 fixed bug where updating expression string would cause switch to linear mode commit bc994d3f0ea85e8626dad2c8dfc5f6f77a49ee14 Author: Joseph Malloch Date: Sun Nov 14 21:33:08 2010 +0000 mdev_poll() now operates much like mapper_admin_poll, using the number of input signals as the max count for reading lo_server_recv_noblock() in a loop. Made both mapper_admin_poll() and mdev_poll return the number of received messages, which could be used to adjust the poll rate and blocking time from the application. It is conceivable that there might be more than n_inputs messages to receive in a given poll period - perhaps we should pass the max count as an argument to mdev_poll as well? commit 8f7c23c7e6432a85fe0f13433e226409f03fd384 Author: Joseph Malloch Date: Sun Nov 14 18:36:27 2010 +0000 testlinear/testexpression: use allocated port commit ce224cb605d9d482ea0f65bde83f3d0dabe90549 Author: Joseph Malloch Date: Sun Nov 14 18:16:28 2010 +0000 Devices now re-send the /register message if signals are added. I added an "update" flag to the device struct; mapper_admin_poll() sends the /registered message if the flag is high and resets the flag. commit 9da2e9b9601e2f05b2d3a21842e33d3734b0def2 Author: Stephen Sinclair Date: Fri Nov 12 04:15:29 2010 +0000 Some mounted filesystems don't do hard links, so use copy instead. This copy was needed to 'rename' the pkg-config file according to the major version number. commit eb38de413b304b77f9d664e27e7c0ee945e43b49 Author: Stephen Sinclair Date: Fri Nov 12 04:04:20 2010 +0000 Avoid interfering with Python distutils CFLAGS. Also fixes assumed system-named directory structure under swig/build, uses wildcard instead. commit 15ca93578b7a26ca51ab561aca5ce83d85b9d6d0 Author: Stephen Sinclair Date: Fri Nov 12 04:04:12 2010 +0000 Fix issue with list_header_t on Darwin 64-bit. Seems the zero-length array used as a stub in list_header_t caused problematic behaviour on Snow Leopard 64-bit, so use a one-value array and calculate the size explicitly which should be system independant. Had to rearrage the structure a little too, since the packing of the enum between void pointers caused extra space to be padded in the case of 64-bit architecture. commit a1933d3292824281918a0ab4710585aa813eb416 Author: Stephen Sinclair Date: Thu Nov 11 02:48:05 2010 +0000 Add the ability to look up signal and device properties by name. Also adds arbitrary 'extra' properties for signals and devices to be used for representing user-defined metadata. Adds API functions for adding properties to owned signals: msig_set_property() msig_remove_property() mdev_set_property() mdev_remove_property() And for looking up properties by name or by index: mapper_db_signal_property_index() mapper_db_signal_property_lookup() mapper_db_device_property_index() mapper_db_device_property_lookup() This patch also moves the non-db half of the signal structure into the internal API. A device handling program may get the signal's property structure through the new function, msig_get_properties(). commit 7418009249552187464abfb4dae97f12baa8978f Author: Stephen Sinclair Date: Thu Nov 11 02:47:45 2010 +0000 Use some autoconf variables in Python setuptools build for SWIG. commit 1192903609e25b3f87f3d253bcd6e93e14e95150 Author: Joseph Malloch Date: Wed Nov 10 20:10:42 2010 +0000 changing @scaling to @mode in mapping protocol - libmapper commit 6d5523ede9241b0b68df78d7c2082df2c256af08 Author: Joseph Malloch Date: Wed Nov 3 22:54:59 2010 +0000 update to libmapper roadmap after meeting commit 3e816f9d6826926c6b5a4bc5a39e88705024995b Author: Joseph Malloch Date: Tue Nov 2 21:48:13 2010 +0000 added elapsed-time-for-allocation printout commit b4bd4706410a27697b8cc123111fc34d20d37d30 Author: Joseph Malloch Date: Mon Nov 1 18:51:04 2010 +0000 libmapper allocation speedup: registered devices suggest alternatives when allocation collisions occur. Also changed behaviour of newly registered devices: instead of sending "/who" they now just send their registration info. Justification: a) only monitors are interested in the entire network, b) the current /link_to syntax includes networking info so that devices do not need to keep records of their peers, and c) reduction of redundant network traffic commit 9dace47a61e4d1c11a0a4e22f3aa57ef5382f19e Author: Joseph Malloch Date: Fri Oct 29 21:28:17 2010 +0000 new signal declaration syntax: /signal /foo.1/out2 @direction output @type f @length 1 @min 6.1 @max 7.1 replaced handler_generic() with handler_signal_info() commit f83d360efcfb94b078c48138cc901ec87cef847b Author: Stephen Sinclair Date: Thu Oct 28 22:50:41 2010 +0000 Add a little string-based lookup table implementation using qsort and bsearch. This uses a sorted array of key-value pairs to store pointers. Insertion should be considered as "slow" (around O(n log n)), look-up as "fast" (around O(log n)). We could always replace it with a hash table in the future if we want O(1), but this should be good enough for now and is a quick and easy solution. commit f65b01bcb8ece01122177aa1ce471db6f2ac3572 Author: Stephen Sinclair Date: Wed Oct 27 22:41:41 2010 +0000 swig: Fix signal types in tkgui example. commit a2516d28c86fd23efcb893e59de42b33526bfe6f Author: Stephen Sinclair Date: Wed Oct 27 22:26:19 2010 +0000 swig: Add a Python Tkinter example showing how to map a scale widget. commit 3a14f0d559738839dfd90674ce437ad5c4b6b5c5 Author: Stephen Sinclair Date: Wed Oct 27 22:26:10 2010 +0000 swig: Perform type coercion before calling msig_update_scalar. commit c3daa2e387586a099c3180f4ce45ce5774902c85 Author: Stephen Sinclair Date: Wed Oct 27 16:05:53 2010 +0000 Fix test.py use of function 'name()' instead of property 'name'. commit 414c761ce096783c03c9c1f2d86bd87aa04df90a Author: Stephen Sinclair Date: Wed Oct 27 16:00:29 2010 +0000 A basic Python interface to device and signal objects using SWIG. While SWIG takes care of most of the work, callbacks and some property-related hackery is Python-specific, so other languages will unfortunately have to be supported explicitly. commit fd7c7e78c223890c88b11507d2f6901455c2ebe2 Author: Stephen Sinclair Date: Wed Oct 27 15:55:13 2010 +0000 Use the specified group/port. commit a78c613dec11d0012fc74a7df6efeed7243eb1b5 Author: Stephen Sinclair Date: Wed Oct 27 15:55:03 2010 +0000 Fix return NULL if admin was not created successfully in mdev_new(). commit 657c19dacfcda4eb86d2cc1ff4d43066acb93212 Author: Stephen Sinclair Date: Wed Oct 27 15:54:57 2010 +0000 Fix freeing previous iface pointer. commit dea3b182dfca435a39fd0ea9d8886113de9e9d96 Author: Stephen Sinclair Date: Wed Oct 27 15:54:51 2010 +0000 Don't assume device exists during signal update. commit ea44e359245f9cb05be62b0bf28e4fbf094c6fcf Author: Joseph Malloch Date: Mon Oct 25 22:15:16 2010 +0000 added length attribute to protocol, updated roadmap commit 175adc88c4fbe321022a50353da6b115056e5285 Author: Joseph Malloch Date: Mon Oct 25 21:02:07 2010 +0000 enabled mute attribute in mapping protocol commit 8144879fc590587c31dda697c38e766083c021bb Author: Joseph Malloch Date: Mon Oct 25 17:20:53 2010 +0000 fixed argument order when calling msig_new commit e02a13debbfc9ec1b7ab68ebc85cdbc2341e642b Author: Stephen Sinclair Date: Wed Oct 20 20:59:15 2010 +0000 Make it possible to allocate an admin and pass it to a device or monitor. This changes the mdev_new() interface, though if 'iface' parameter is zero there is no problem. Now in rare cases where iface, group, or port should be customized, the user can create a custom admin and pass it to device or monitor. Otherwise if it is 0, device or monitor creates and admin with standard values. commit fad3da000b6b63ea522b7675a652cce98b532cdd Author: Stephen Sinclair Date: Wed Oct 20 19:33:04 2010 +0000 libmapper: Update to the roadmap after Oct 20 meeting. commit d8053ae0ef96a3248320c40b87c87b7948bacbd4 Author: Stephen Sinclair Date: Tue Oct 19 20:02:56 2010 +0000 Fix mapper_admin_send_osc for device-named paths. commit d792b756b0b4910120df72ada70a870f35838696 Author: Stephen Sinclair Date: Sun Oct 17 19:18:57 2010 +0000 It's legal to not have a unit for a signal. commit f03f41ca625b5f72bf5022948080e84d16fdd733 Author: Stephen Sinclair Date: Sun Oct 17 19:18:50 2010 +0000 Don't ask for admin name in send_osc when admin has no device. commit eec209ff742b087a5a181fbd6c4ab70b41abd756 Author: Stephen Sinclair Date: Sun Oct 17 18:57:04 2010 +0000 Signal creation specifies min and max by pointer. No longer uses INFINITY as a constant to indicate no min/max. Instead takes a pointer to a value. Also provide setters for min and max, and a general msig_new function, called by msig_float and msig_int. Also provide missing msig_free(), and it's called by mdev_free(). Provide a couple of shorter macros to make casting to mapper_signal_value_t (and a pointer to it) a bit easier. commit 6fede51df93b69d6c1e1bd05f1dd0fe4de6c8d1e Author: Vijay Rudraraju Date: Thu Oct 14 22:21:10 2010 +0000 added a test for larger numbers of devices commit 6f5d853d62ea3e4b3e15166a320857c1c44ef786 Author: Stephen Sinclair Date: Thu Oct 14 21:22:32 2010 +0000 Separate "monitoring" functions from "device" functions. Provides a 'mapper_monitor' object which can be instantiated. The mapper_admin is changed to work with a device, a monitor, or both, performing whatever functions are needed for these cases. The database is now contained inside the monitor, so db functions are given a context pointer, and the user application must get a db pointer from a monitor before passing it in to a database query. Patch also modifies qtmapper to match these changes. commit a43b31135c35b8b04aaa29c9d7c3c9ab24814fa0 Author: Stephen Sinclair Date: Thu Oct 14 02:29:50 2010 +0000 Fix brain-fart getting string length in replace_expression_string(). commit 2181ab7a236b9fa3cf88d8a92eb3d702f60d7f88 Author: Stephen Sinclair Date: Thu Oct 14 00:37:53 2010 +0000 Fix mistake in new interface discovery code: memcpy -> memcmp commit ad9c58296f4959d28de4386eddfb47181446864a Author: Stephen Sinclair Date: Fri Oct 8 02:48:48 2010 +0000 Use a heap-allocated string for interface name. commit 18bce8bdd31f2a13e2528e8b7f1ab4377bfdee0d Author: Stephen Sinclair Date: Thu Oct 7 21:31:54 2010 +0000 Use a better method to select network interface, or allow it to be user-specified. Adds a check for new liblo function lo_address_set_iface(). If it's not available, it is simply not called, and the interface is selected automatically. commit f0b4b12c621c84f93a400266adb86c90e22ec5ff Author: Vijay Rudraraju Date: Tue Oct 5 21:41:51 2010 +0000 added interface for gui to delete mapping commit 96ffecc4601f340cafb6ba0fda2d86c696ef0c67 Author: Vijay Rudraraju Date: Mon Oct 4 22:58:32 2010 +0000 adding flag indicating whether output or input to mapper_db_signal commit f148e5c2cefdc7f5d75db93adc43b5d163f9f189 Author: Stephen Sinclair Date: Wed Sep 29 00:26:38 2010 +0000 Replace the parser/interpreter for efficiency and to support new syntax. Supports vector and history indexing. Compiles expressions to a reverse Polish notation implemented as a linked list and interprets this in an iterative loop with explicit stack. Performs some folding of constant operations. Detects required allocation for signal history based on oldest access. Supports type coersion from int to float. Signal input/output history is moved from struct mapping to expression. Compilation requires knowledge of signal type and vector size, but mapping doesn't have a pointer to signal, so functions that set mapping expression are given a signal parameter. This patch also minimizes externally visible functions related to expression---the API for constructing, freeing, and evaluating expressions is small enough to put in mapper_internal.h, so operations.c/h and expression.h are removed. commit e48c7e8b2403def4f64685216d947a43b8b5491a Author: Stephen Sinclair Date: Tue Sep 28 22:59:25 2010 +0000 Return 0 from non-void functions to eliminate warnings. commit 236f60dd3cffddbc9473b06e93a0821daeae8b16 Author: Vijay Rudraraju Date: Mon Sep 27 23:48:56 2010 +0000 hacked together interface for allowing a gui to add a mapping between signals commit 12ee05f8cc2f12d96a564b31361b55d888a8aaf4 Author: Joseph Malloch Date: Mon Sep 20 01:53:43 2010 +0000 Fixed behaviour of linear mode: changes to range now cause re-evaluation of expression commit 0a9f9bd926e936f101c697b233e61b21ad921144 Author: Joseph Malloch Date: Mon Sep 20 01:42:15 2010 +0000 Fixed behaviour of calibrate mode commit b32f9fdebef8bc0dc7b9606610a77ecd279178f8 Author: Joseph Malloch Date: Sun Sep 19 22:45:25 2010 +0000 libmapper: Fixed property reporting bugs, also updating range info was erroneously altering the scaling property. Testing also revealed that calibrate mode is not working properly, and that updating the ranges while in "linear" mode does not update the expression string or tree (not fixed in this commit) commit d9ff6444150326ababfcbc03ba9058022d553a4e Author: Vijay Rudraraju Date: Fri Sep 17 22:23:11 2010 +0000 fixed bug in handler_device_connections_get (sources were not being iterated through) commit da372454d52a506b5badb895f00696271fc48759 Author: Joseph Malloch Date: Fri Sep 17 21:54:59 2010 +0000 added some default values for new mappings commit eda5d4ccd7d4c9c84e6c26d493eddd19e1b46176 Author: Joseph Malloch Date: Fri Sep 17 21:54:42 2010 +0000 marked a couple of roadmap items as done commit b0608e393b19477bdfe1c980b1604c10ab5294af Author: Vijay Rudraraju Date: Thu Sep 16 02:48:20 2010 +0000 added interface to request signals, links, and mappings commit c6df1452ee0ee16d8eb22535f0898419f79c6633 Author: Joseph Malloch Date: Fri Sep 10 21:58:19 2010 +0000 simplification of mapping creation functions: now only mapper_router_add_mapping() remains commit f90c6029939a592b73b974c84a9b3a8aff712258 Author: Stephen Sinclair Date: Fri Sep 10 20:29:06 2010 +0000 libmapper: use a built-in strndup, since it is not available on all platforms. commit 9e95bdb45989889aa062855fe5080b0388ae8250 Author: Stephen Sinclair Date: Wed Sep 8 18:56:47 2010 +0000 libmapper: rename expression functions and struct to mapper_* naming prefix. Move code from interpreter.c to expression.c, removing need for this file. Make expression.c helper functions declared static. commit f9a44421a3933dba622edcadbfa26d788dadc86f Author: Stephen Sinclair Date: Wed Sep 8 18:56:39 2010 +0000 libmapper: replace uses of sub_string() with strndup(). commit 99a482f2ffa660b59eb2d3dbb8a72a3b9ca7fc75 Author: Stephen Sinclair Date: Wed Sep 8 18:56:31 2010 +0000 libmapper: set expression scaling when adding an expression mapping. commit 8b784fabd9ae47ee3d31ef8469f6f5a6c658cd1a Author: Joseph Malloch Date: Tue Sep 7 20:33:12 2010 +0000 added some tasks to roadmap commit 4964b39803410ab8321940ce1fcde7e0d812d41b Author: Joseph Malloch Date: Sat Sep 4 00:24:42 2010 +0000 fix for updating expressions commit 7a277870396214029853df906d4f69a2d278605a Author: Joseph Malloch Date: Fri Sep 3 22:21:47 2010 +0000 slight protocol tweak for clarity: "namespace" -> "signal" or "signals" commit 3db35d7dcd5d88b5263f98f41f0516f5c9056b2f Author: Joseph Malloch Date: Fri Sep 3 19:01:52 2010 +0000 updated roadmap commit 17c6a19dee2d53c53476bc1fef09007021a4cc3e Author: Joseph Malloch Date: Fri Sep 3 17:51:34 2010 +0000 fixing terminology inconsistencies: sender -> source target, receiver -> destination commit 13142867f24525620296c9b4fb5f67b3665f5cfd Author: Joseph Malloch Date: Thu Sep 2 20:03:46 2010 +0000 adjusted priority list according to discussion commit 8fda160df1079f08b589976326b38817a09643b5 Author: Stephen Sinclair Date: Wed Sep 1 19:19:50 2010 +0000 libmapper: add sqlite and stk to the "to do" list in the roadmap. commit 4370e926e20d7d8e3b8ada8a315b89e29ced6f3e Author: Stephen Sinclair Date: Wed Sep 1 02:30:05 2010 +0000 libmapper: add a development roadmap. commit e7f15ce23ba764e5591e70f59370a921c286a558 Author: Stephen Sinclair Date: Tue Aug 31 18:24:15 2010 +0000 libmapper: remove mappings for devices that are unlinked. commit 9fdc2c7ef3f470dead7c4e59ca50eaefcc985af8 Author: Stephen Sinclair Date: Tue Aug 31 18:06:14 2010 +0000 libmapper: also request connections and links in testmonitor. commit 65642ab37dc514dcc07b44f58b870d5e6ff5489b Author: Stephen Sinclair Date: Tue Aug 31 18:00:15 2010 +0000 libmapper: remove links and mappings on /unlinked and /disconnected. commit 1509e7355e0810e3df24d5ee6863915b94e17f16 Author: Stephen Sinclair Date: Tue Aug 31 17:09:35 2010 +0000 libmapper: change order of removal: mappings, links, signals, then devices. commit 5ef58687721b0d580f869e6bcc8d10ff0cda660b Author: Stephen Sinclair Date: Tue Aug 31 15:01:18 2010 +0000 libmapper: remove a device from signals, mappings, and links dbs when removed. commit ac9ba64658ad369d69e0742ed47707cea30d40cf Author: Stephen Sinclair Date: Tue Aug 31 15:01:08 2010 +0000 libmapper: add queries for all inputs and outputs, use in testmonitor. Previously it only showed signals for which there was an associated device entry; this way we can see everything in the database. commit 4e2d7fc023ad2ac9c1f823a75b77bbe0ea0a5ea6 Author: Stephen Sinclair Date: Tue Aug 31 15:00:55 2010 +0000 libmapper: only update testmonitor's display after a database callback. commit f735b20b8985bc89222e64af33cd503b5300609c Author: Stephen Sinclair Date: Mon Aug 30 21:05:11 2010 +0000 libmapper: remove a device entry from the database on /logout. Still need to remove mappings and signals associated with the device. commit 1d51f1a3ba497bfa7e6fc5e79f6236e0642841a8 Author: Stephen Sinclair Date: Mon Aug 30 21:05:04 2010 +0000 libmapper: send /logout as a result of freeing the admin object. commit 9d342ad69112b5f42cc515f8311418b34a78b474 Author: Stephen Sinclair Date: Mon Aug 30 20:36:16 2010 +0000 libmapper: correctly iterate over the mappings in connections/get handler. Previous version would only hit the first mapping for each signal. commit c2a468a5132ae4713ccd3864eeb543f02d5d27db Author: Joseph Malloch Date: Mon Aug 30 19:49:09 2010 +0000 fixed segfault in handler_device_connections_get() if no connections exist commit 429f6025a0475b84ccb5368f82d4db24bfd1dc12 Author: Joseph Malloch Date: Mon Aug 30 18:49:11 2010 +0000 fix to mapper_router_remove_mapping() - now correctly iterates through all mappings, frees memory commit d8102acd0f079b7a89a5070c0658966f2263f8e3 Author: Stephen Sinclair Date: Mon Aug 30 18:10:17 2010 +0000 libmapper: add a ctrl-c handler in test.c, ensure devices are cleaned up. commit d83c7e7261037bcc52dbc6d16efc260de90da041 Author: Stephen Sinclair Date: Mon Aug 30 18:07:07 2010 +0000 libmapper: add mappings and links to the database, request namespace in testmonitor. commit 9c97e54af4cebc5ed7a94d137086329bb2cc7329 Author: Stephen Sinclair Date: Mon Aug 30 18:07:00 2010 +0000 libmapper: speed up testmonitor, remove pauses by default. commit 2a8d87cedca0d47ecde91eef2cf64a58fb3551d2 Author: Stephen Sinclair Date: Mon Aug 30 17:53:39 2010 +0000 libmapper: remove commented out code in test.c. commit c08bbc84a19c2f14ae68c449f8582be58c71f357 Author: Stephen Sinclair Date: Mon Aug 30 17:49:04 2010 +0000 libmapper: remove mapper_router.num_routers and .num_mappings_out. commit 4d32c4482843f3974e540e5a676e8d0d376bfd02 Author: Stephen Sinclair Date: Mon Aug 30 17:48:57 2010 +0000 libmapper: make sure copied device name gets delimiter in handler_generic(). commit ccf49b470a8980db5d8bd4884badaed366e98adc Author: Stephen Sinclair Date: Mon Aug 30 17:48:51 2010 +0000 libmapper: display list of all mappings, links, in testmonitor. Does not display everything however because functionality is not completely implemented yet. commit 245008c6577c171a4a3de8bc05894b3d76938029 Author: Stephen Sinclair Date: Mon Aug 30 17:48:43 2010 +0000 libmapper: fix comments for get_mappings* routines. commit 0506944c09154130d623af67c6bbffdcba3b0d12 Author: Stephen Sinclair Date: Mon Aug 30 16:20:30 2010 +0000 libmapper: fix the return value of osc_prefix_cmp() when different lengths. commit 46576d4adce698ed04a6211ca062d9ee9c2868ae Author: Stephen Sinclair Date: Mon Aug 30 15:41:39 2010 +0000 libmapper: Fix up the string handling in handler_generic(). commit c5e8fef4509d842ef9b4ef0e1061133b112b3fad Author: Stephen Sinclair Date: Fri Aug 27 22:36:07 2010 +0000 libmapper: add function mapper_db_get_mappings_by_signal_queries(). Replaces previous prototype of mapper_db_get_mappings_by_device_and_signal_queries(), which didn't make sense: the device-name search is embedded within the signal search, since mappings are between signals. commit 3540fadf33ba7abbc80238adefdb93d9c44a64ab Author: Vijay Rudraraju Date: Fri Aug 27 21:30:44 2010 +0000 added handler_generic as a hack to get signals added to the database commit 215b6fe11b9498e843392ad2c17e0e9820e4b2fd Author: Joseph Malloch Date: Fri Aug 27 19:01:17 2010 +0000 changed handler_signal_modify() to handler_signal_connection_modify() commit 15677ffa79052e90cb98b48283a86cb89ca65b17 Author: Joseph Malloch Date: Fri Aug 27 19:00:41 2010 +0000 removed admin bus communication from router.c commit b6e7962ca7e92c1638c9ddd54d343c1ba8faa0ac Author: Joseph Malloch Date: Fri Aug 27 14:59:24 2010 +0000 when removing mappings, set mapping list to NULL if removing last mapping. Fixes segfault on /connections/get when all mappings have been removed commit 615af8fb077710cc56ccf15fa099fcadf25fbdfd Author: Joseph Malloch Date: Fri Aug 27 14:40:24 2010 +0000 simplified disconnect handler commit cf359b623536c47fdbc1ea244de9657909813f7a Author: Joseph Malloch Date: Fri Aug 27 14:09:58 2010 +0000 substituted "signal" for "param" in function and variable names where appropriate commit 81c501475df656d53bc1fc980c5cfe579644b478 Author: Joseph Malloch Date: Fri Aug 27 13:57:21 2010 +0000 added correct return values commit a4221a7f47ffdc7dad75a55b26d18640fcf8ca20 Author: Joseph Malloch Date: Fri Aug 27 12:05:59 2010 +0000 apparently forgot to commit changes to router.c commit d8b360e1302fdc16d4277d1d7df52a1e7f5b2400 Author: Joseph Malloch Date: Thu Aug 26 22:51:39 2010 +0000 enabled "/disconnected" message commit ebaadcfa95e002ecd24d1117f99ee68f44b5bdbe Author: Vijay Rudraraju Date: Thu Aug 26 17:02:01 2010 +0000 added mapper_db.h to install commit 7cb5ef2474abf0dc04c3325d5831092e90a7aa9e Author: Stephen Sinclair Date: Wed Aug 25 02:29:16 2010 +0000 libmapper: add function to find mappings with specific device and signals. commit 05b36cae8f09c4a7e1e8deb43537441d1260ee4c Author: Stephen Sinclair Date: Wed Aug 25 02:29:02 2010 +0000 libmapper: prototypes for searching mappings by specific names or by queries. commit 064f33cb32e2ba8d0dde47829824b87f09c61648 Author: Stephen Sinclair Date: Wed Aug 25 02:28:52 2010 +0000 libmapper: add some functions to query mappings for particular signals. commit c0067fb182e8f1e97d7ab6ccad9f4b3aa7bb89dc Author: Stephen Sinclair Date: Wed Aug 25 02:28:42 2010 +0000 libmapper: correct the comments for mapper_db_mapping* functions. commit 0f04d004c6b819ac661cb93ab3fc00300042735f Author: Stephen Sinclair Date: Wed Aug 25 02:28:32 2010 +0000 libmapper: move mapper_db_add_mapping_callback() to the right section of db.c. commit 2f519b68dc291967522d4a4c658771e24b755b05 Author: Stephen Sinclair Date: Tue Aug 24 03:14:05 2010 +0000 libmapper: add the basic update function for the database of mappings. Left a couple of fields to fill in later. commit 0de5973a5344bd6fecdd2a573d43446fc52440d0 Author: Stephen Sinclair Date: Tue Aug 24 03:13:51 2010 +0000 libmapper: factor out more of the code to update db struct fields from params. commit 24596085841c4c066d4564b4f344e62e01b49ae5 Author: Joseph Malloch Date: Mon Aug 23 20:34:53 2010 +0000 changed enum "error" to "mapper_error" for avoid conflict when building max external commit 51198259f51a6db7da22d710723a1bfbaba60cce Author: Stephen Sinclair Date: Mon Aug 23 16:16:14 2010 +0000 libmapper: redefine the signal handler prototype to reflect recent changes. commit c32847185cb1c5f323105895eeed846b15e1798f Author: Joseph Malloch Date: Mon Aug 23 14:26:01 2010 +0000 folder reorganization commit 47d3b045045f66a9eb05ddef87b5e74396e0f3a5 Author: Joseph Malloch Date: Sun Aug 22 20:41:28 2010 +0000 changed insig handler to pass signal rather than device. Also tweaked testrecv.c and testexpression.c (both now work) commit fd4353a1c0e37085b16efcc8ef2f071cd37b77d9 Author: Stephen Sinclair Date: Sat Aug 21 21:33:49 2010 +0000 libmapper: add a test for matching links against all devices. commit 85ef3c89ef657433c2a5d479de4c9560e6ca84fb Author: Stephen Sinclair Date: Sat Aug 21 21:31:21 2010 +0000 libmapper: query links that match lists of source and destination devices. Demonstrated in testdb, the function mapper_db_get_links_by_source_dest_devices() takes two queries that search the device list, and performs them over the link records to return any links that match the source and destination lists. commit 16a88a44ce61cfd1ca64d5c77c34c64de6251591 Author: Stephen Sinclair Date: Sat Aug 21 21:31:10 2010 +0000 libmapper: implement similar database for links. commit 243f18aff5e710d4253ac5d23e307a143bd3bc5b Author: Stephen Sinclair Date: Sat Aug 21 21:30:59 2010 +0000 libmapper: signal callback add/remove functions. commit 3fb6cf5aa81c9bb15af5cbdeeb1a324faf3e34bd Author: Stephen Sinclair Date: Sat Aug 21 21:30:51 2010 +0000 libmapper: generalize callback list add/remove functions. commit df199c39d3e6415260d25b5e4f2e64741224430a Author: Stephen Sinclair Date: Sat Aug 21 21:30:42 2010 +0000 libmapper: generalize the list iterator function. commit dfd646dca5599863ac9e7db70aa3ee990fddf7ab Author: Joseph Malloch Date: Thu Aug 19 23:29:41 2010 +0000 max libmapper object compiles, instantiates, registers on network :) commit e4ab3e3f6e1f538b11bc6b7cd924e56f391949f7 Author: Stephen Sinclair Date: Thu Aug 19 18:06:29 2010 +0000 libmapper: generalize the query code by passing in a compare function. Provides general functions for creating and freeing query context from a variable number of strings. commit 0eefdc6ee6aebd384c034a1961aa3ee90bebdf2e Author: Stephen Sinclair Date: Thu Aug 19 18:06:23 2010 +0000 libmapper: use a function to prepend an item to a list. commit 14d81a80b33b2e951ed28012911920f3ccae0a65 Author: Stephen Sinclair Date: Thu Aug 19 01:25:01 2010 +0000 libmapper: add internal input and output signal databases with queries by device name. Currently choosing to put a pointer to the device name in the signal struct, but we have to be sure to manage this properly and avoid double-freeing it, since signals in the database will have their own string, but signals belonging to local devices will point back to the device's string. (Or we could leave them as null.) This patch doesn't yet add any handling for the /namespace/ messages. commit 9ef8e59646e46b2b0dde33b419964f1b03ff8e9b Author: Stephen Sinclair Date: Thu Aug 19 01:24:47 2010 +0000 libmapper: Rename mapper_db_add_or_update_params -> ..update_device_params. commit b677fa8764a4f6a94ca151d51592e223b2b296e6 Author: Joseph Malloch Date: Wed Aug 18 21:54:01 2010 +0000 initial (non-working) commit of libmapper max external commit e68b5a9d380b3d0541a8ad83b17fd137793474ab Author: Stephen Sinclair Date: Sun Aug 15 19:03:44 2010 +0000 libmapper: use mapper_mapping_set_linear_range() during calibrate. Changes it to take a pointer to the range structure and handle partially-known range parameters correctly. commit 7128248cfc82d067187fc91d697631fb70a9e545 Author: Stephen Sinclair Date: Sun Aug 15 18:08:05 2010 +0000 libmapper: fix a return value from mapper_mapping_perform(). commit aacc07ebc259f1e54c2a79ce602bd97fe3b2e612 Author: Joseph Malloch Date: Fri Aug 13 22:19:33 2010 +0000 fixed routing of signal from mapping to clipping to output commit 4c33f334f06b427c0818de2bab8a7aaf424788e8 Author: Joseph Malloch Date: Fri Aug 13 21:53:35 2010 +0000 better solution to "@scaling expression" property without supplied expression. Also filtering mapping output by muted property. commit b03d4972854b727a1defafd192cfbe46e7d441b0 Author: Joseph Malloch Date: Fri Aug 13 21:35:41 2010 +0000 changing scaling type to bypass should not change stored expression. Bypass mode indicates that properties are ignored but remain unchanged commit 74c0d031c43294d0537ce791f7d1cd92dbd359cd Author: Joseph Malloch Date: Fri Aug 13 21:31:07 2010 +0000 allow changing scaling type to expression without changing expression commit 0261db9d9f4045de37802ef828a5ea7ce516a103 Author: Joseph Malloch Date: Fri Aug 13 19:05:27 2010 +0000 fixed overwrite of ranges in mapper_mapping_set_from_message() commit 63974b78a56a80a6f3b5f4d5c219b2adfcb7659c Author: Joseph Malloch Date: Fri Aug 13 19:00:38 2010 +0000 updated /connection/modify handler commit 8f731629946d0f9169676a3b0bb861a35d2daf87 Author: Stephen Sinclair Date: Fri Aug 13 02:41:55 2010 +0000 libmapper: proposed API for matching items in the database. Devices, signals, mappings, links. commit b40f3e30f6f0ef9d2ab4c87c01afab5b044e9912 Author: Stephen Sinclair Date: Thu Aug 12 20:49:33 2010 +0000 libmapper: split off the signal struct "properties" into a db struct. Similar to the previous commit, we need to be able to describe properties of a signal independent from the signals actually used by a device. These "properties" are different from the signal "state" like its current value. commit e16bd683017a13ef74b1b2f9722efd76fb40d774 Author: Stephen Sinclair Date: Thu Aug 12 20:09:23 2010 +0000 libmapper: move parts of the mapping struct into a public header. We can reuse the "properties" portion of the mapping structure as a public struct returned by db queries. The "state" portion remains an internal type. This unfortunately means that access to properties of a mapping require "props." prepended everywhere.. commit bc9810d8003b04b00315228dba5b39b8328afd7c Author: Joseph Malloch Date: Thu Aug 12 19:29:34 2010 +0000 added /connected message responses with properties. Also tested clipmodes commit abcf92f6e57d140992b53f69e330c6e09f22084d Author: Stephen Sinclair Date: Thu Aug 12 05:05:59 2010 +0000 libmapper: overhaul of the /connect_to handler, set mapping properties in mapping.c. Keeps basic handler in admin.c, but moves construction of mapping properties from the message parameters into mapping.c. Lays out parameter handling sequentially (with a specific sequence for dealing with range information from the various possible sources) and uses functions on the mapping struct to set the properties; these are split off from the router_add functions in router.c. commit 3abb8bace23ef1cc8b22934bc069e7a8ceed72c5 Author: Stephen Sinclair Date: Thu Aug 12 05:05:50 2010 +0000 libmapper: handle target _signal_ name in mapper_router_find_by_target_name(). commit 6012400c80f562ffdcf7747cd4ebed210e65f2a0 Author: Stephen Sinclair Date: Thu Aug 12 05:05:43 2010 +0000 libmapper: fix device and signals names in testlinear. commit 4072d2e3422b4543ae17d0c22cb629c5167636f5 Author: Stephen Sinclair Date: Thu Aug 12 05:05:36 2010 +0000 libmapper: change mapping 'type' to mapping 'scaling', prepend SC_ prefix to enum. commit 39c3ebac9cc3d64b235b7ee38837efe88fb7f2fe Author: Stephen Sinclair Date: Thu Aug 12 05:05:26 2010 +0000 libmapper: make get_expr_Tree() take a const string. commit ac61813fa51a23968fb1aafa4e59638bdaf060c7 Author: Stephen Sinclair Date: Thu Aug 12 05:05:18 2010 +0000 libmapper: add admin name to a couple more traces. commit b652239212f70f637be2f555e6b9eaf2f66259f2 Author: Stephen Sinclair Date: Thu Aug 12 05:05:11 2010 +0000 libmapper: fix, endless loop in mapper_router_find_by_target_name(). commit 6075d7c0d8191ce71a879f581688453d28310b95 Author: Stephen Sinclair Date: Wed Aug 11 16:56:34 2010 +0000 libmapper: move find-stuff-by-name loops in several handlers into functions. commit f5fd980bf4b7b0de708d5e66ef43bf7244769969 Author: Stephen Sinclair Date: Wed Aug 11 16:56:22 2010 +0000 libmapper: avoid unnecessary strcpy in /link, /linked, /unlink, /unlinked handlers. commit dfac9cbf49c99769b979e33613d47d6cb7b89189 Author: Stephen Sinclair Date: Wed Aug 11 04:11:26 2010 +0000 libmapper: use double-pointers as iterators to walk through a database query. The user must dereference the pointer twice to access the record, and he passes it back in to get the next result. Some nice properties of this approach: In the case of walking all records, no memory allocation is necessary. In the case of searching, a continuation context is passed to allow lazy computation, and reduced memory allocation compared to the eager approach since the iterator is reused. Both cases are transparent to the user. A test program 'testdb' is included. commit f87189cc91a87014c6efcc65de05c6d5eb05dc1c Author: Vijay Rudraraju Date: Tue Aug 10 22:18:29 2010 +0000 corrected second(sigh) _cplusplus to __cplusplus commit e9a1d3933ff6884125abc97f3014e76a02646f07 Author: Vijay Rudraraju Date: Tue Aug 10 22:15:11 2010 +0000 corrected _cplusplus to __cplusplus commit 5001c8be65cb49aa11431da0d49e3420c6d96aed Author: Joseph Malloch Date: Tue Aug 10 21:43:45 2010 +0000 quick rewrite of /connect_to and /connection/modify handlers, adding modification of clipping properties. Runs, but some weirdness to be debugged in the signal output commit 5445049a2db9b9a4d7945d899a36c1149f325348 Author: Vijay Rudraraju Date: Tue Aug 10 21:30:49 2010 +0000 oops, my bad, broke build commit 741e98d6ed59b5cef5d176c330ffa25e24c8dd36 Author: Vijay Rudraraju Date: Tue Aug 10 21:29:34 2010 +0000 Added extern C enclosures to allow c++ to link into library commit 16e624b95b9f871253e68ed97c988145b4fcff5b Author: Joseph Malloch Date: Tue Aug 10 21:23:31 2010 +0000 initial commit of clipping functionality commit 2bea47b26dd58b056f551e08372d935c8103269a Author: Stephen Sinclair Date: Tue Aug 10 19:34:57 2010 +0000 libmapper: add a callback system for modified db records. commit 129690efdbd490279be5a9aeafcd036e2096e0c5 Author: Stephen Sinclair Date: Tue Aug 10 19:01:31 2010 +0000 libmapper: remove bad "#define DEBUG" from header. commit 598f37ff40a9795040d909b40df10c5968d7fba6 Author: Vijay Rudraraju Date: Tue Aug 10 18:22:01 2010 +0000 Added mapper_db_update_new_device_cache function to db.c for use with gui commit 43df3175c4cf48f8d9b5156d3b351eb0c25213d3 Author: Joseph Malloch Date: Tue Aug 10 17:47:31 2010 +0000 substituted calls to mapper_admin_name(admin) for some unnecessary string-fu commit dfeee31c91a2c6ac88257a56180b5bea414698bf Author: Stephen Sinclair Date: Tue Aug 10 17:15:21 2010 +0000 libmapper: forgot to add the testmonitor program! commit b195323ca58aa470530f3bf42248283f3eb0ab91 Author: Stephen Sinclair Date: Tue Aug 10 14:53:44 2010 +0000 libmapper: put compiler/linker flags into variables in test/Makefile.am. commit 61e9fbf1d73ac9d5da2e33a4e7ddebce6656665f Author: Stephen Sinclair Date: Tue Aug 10 14:50:54 2010 +0000 libmapper: add a small test program to clearly monitor the device database. commit 68170a61cb652386c4c9c42ad825bd2124209ae2 Author: Joseph Malloch Date: Tue Aug 10 14:06:02 2010 +0000 updated psuedocode documentation of max allocation algorithms commit b8543a1318371a33332e5ceb6260fcbcd4c5f6ca Author: Stephen Sinclair Date: Tue Aug 10 13:31:30 2010 +0000 libmapper: tabs to spaces commit 103b74608f633b5652219a3367dc85a8548698ba Author: Stephen Sinclair Date: Tue Aug 10 05:13:24 2010 +0000 libmapper: handle /port/registered and /name/registered. Resource allocation should work again. commit 1e926007bd08bd30520e7da2ef07b75333ceeec4 Author: Stephen Sinclair Date: Tue Aug 10 05:13:17 2010 +0000 libmapper: collision_count should be signed, since we use -1. commit 3821cf1d41fbc84173fb77b6b8cd1d5ae0dca5ad Author: Stephen Sinclair Date: Tue Aug 10 05:13:10 2010 +0000 libmapper: fix out-of-bounds string copy in update_device_record_params(). commit 297ad17b5cc0e4fea91d75ac55456623ce19e8b7 Author: Stephen Sinclair Date: Tue Aug 10 05:13:03 2010 +0000 libmapper: seed the random number generator (and use modulo). commit 75503fc4b46c21aef84f93592b851968766c5331 Author: Stephen Sinclair Date: Tue Aug 10 05:12:55 2010 +0000 libmapper: don't continue with test code unless devices are ready. commit 930171de85721d56a56c59391d0b263a826c87ca Author: Stephen Sinclair Date: Tue Aug 10 05:12:46 2010 +0000 libmapper: Add device names to debug tracing. commit a4fff7b445389c68f545b6be3004156fb0940e3b Author: Stephen Sinclair Date: Tue Aug 10 05:12:39 2010 +0000 libmapper: fix, if device server does not start, don't try to add methods. commit 254b9d8f5c5099100a8e94182c20f536dd633601 Author: Stephen Sinclair Date: Mon Aug 9 21:56:31 2010 +0000 libmapper: use parameter parser in /link_to handler, adds some param helpers. commit 5870e5b4e2c5d7045e4d5b1ddff0c066ce7da950 Author: Joseph Malloch Date: Mon Aug 9 21:05:36 2010 +0000 added device /logout message commit aacffe7fb79d3088d2629abc8d26bea98ebe4355 Author: Stephen Sinclair Date: Mon Aug 9 20:35:43 2010 +0000 libmapper: change printf to trace, remove extra printfs. commit e5248e0a98c29f936a35ec3f4492fa83f3378603 Author: Joseph Malloch Date: Mon Aug 9 19:52:51 2010 +0000 fixed memory allocation bug causing strange expression parsing commit b7c38f6619bfbc096a0223ef22e5277b3613c487 Author: Stephen Sinclair Date: Mon Aug 9 19:03:18 2010 +0000 libmapper: move db find function to external API, and use friendlier names. commit 26e9ee140f6c54bf0b92bf67f83d4b0806c1494d Author: Joseph Malloch Date: Mon Aug 9 18:14:10 2010 +0000 added handlers for: /logout /linked /unlinked /connected /diconnected commit e216c5f7151cc80c7117f90dc8a2712c8c69bcde Author: Vijay Rudraraju Date: Mon Aug 9 16:52:19 2010 +0000 added casts to various mallocs in order to comply with stricter c++ rules commit 68cfe9b5225e241f3f3ab642867fb3f9b70a903e Author: Vijay Rudraraju Date: Mon Aug 9 16:38:57 2010 +0000 added casts to various mallocs in order to comply with stricter c++ rules commit fcd917550674899ac3664cf4447fae31fd9e5067 Author: Stephen Sinclair Date: Mon Aug 9 02:12:01 2010 +0000 libmapper: enable device database and fix it up to use parsed parameters. commit 46ce12f51a77ac84b1dbe19cea707df240badfd2 Author: Stephen Sinclair Date: Mon Aug 9 02:11:51 2010 +0000 libmapper: roll back changes to the admin.registered field. commit 394ea8fc30e52b5c8db8bd5d48280e1fcb83c3cc Author: Stephen Sinclair Date: Mon Aug 9 02:11:43 2010 +0000 libmapper: replace more lo_send() calls and note why we don't do it sometimes. commit 88d11913b9265863eeb80c91929515ad0c93a6c6 Author: Stephen Sinclair Date: Sun Aug 8 21:50:24 2010 +0000 libmapper: move admin's OSC handler connections into a struct. commit 05f021573bb687c3d99a54a8f72b72103dbd668e Author: Stephen Sinclair Date: Sun Aug 8 21:23:56 2010 +0000 libmapper: replace lo_send() calls with a function that knows the @-parameter format. commit 6d0aef4e0b46e753bd3c09c9f1d5c0fd4df6c8db Author: Stephen Sinclair Date: Sun Aug 8 21:23:48 2010 +0000 libmapper: add type information to parsed parameter struct. commit c3ccd0150ffb3da0faf4f72be9b1b417c72b9bd8 Author: Stephen Sinclair Date: Sun Aug 8 21:21:21 2010 +0000 libmapper: fix extra slashes at the beginning of admin messages. commit c27693ac7c0ad7ac53159f69d2a41ad80108e807 Author: Stephen Sinclair Date: Sun Aug 8 21:21:14 2010 +0000 libmapper: use direct array access for message parameters. commit 1bdfa29f2c7df5d90ba1f88ed17b3baf8d4a5499 Author: Stephen Sinclair Date: Sun Aug 8 21:21:06 2010 +0000 libmapper: add an assertion macro for debugging, "die_unless()". commit b880fa60e8cd157d2aa7d8355837bab095723a85 Author: Stephen Sinclair Date: Sat Aug 7 21:59:23 2010 +0000 libmapper: Add an internal API for parsing message parameters. commit 5f1193ee7c638c7df0d1e351eb97f6fa1af38e3c Author: Stephen Sinclair Date: Sat Aug 7 20:13:29 2010 +0000 libmapper: Move code that keeps network device info into its own file. commit 984b3fe76a3d3e293685c83bce6d255ea4524f79 Author: Stephen Sinclair Date: Sat Aug 7 20:13:14 2010 +0000 libmapper: fix, msig_full_name() didn't properly null-terminate the string. commit c131bc231f2caec4671ef719f065a28a56190322 Author: Stephen Sinclair Date: Fri Aug 6 17:38:30 2010 +0000 libmapper: fix segfault, initialize admin.name member. commit 204a8dae583543551a5923d7586e0ee02ac002df Author: Stephen Sinclair Date: Thu Aug 5 20:22:35 2010 +0000 libmapper: ran everything through 'indent -kr -nut', with manual clean-up. Everything now fits in 80 columns, no tabs, 4-space indentation. commit c0b08d23e78cf08b2f4d61be0a1007087541d76a Author: Joseph Malloch Date: Wed Aug 4 18:53:12 2010 +0000 handler_device_alloc_name() now only calls on_collision() if the device names match commit 2f65eb856e4c3866f20a31b8078bf50e7d60f599 Author: Stephen Sinclair Date: Wed Aug 4 17:39:23 2010 +0000 Move the STK synth out of the libmapper directory. It uses libmapper, but it is not part of the library. commit 85618290ac30a2a6f1def60671b51ca78944ac57 Author: Stephen Sinclair Date: Wed Aug 4 17:38:04 2010 +0000 libmapper: remove executable of the STK synth. commit 95e9e62cd8dc6a7573d0c34719c8e9d5e8004906 Author: Stephen Sinclair Date: Wed Aug 4 16:45:38 2010 +0000 libmapper: fix, missed one reference to device type enum which was removed. commit 9f34073f0073b566f24379168aee3d14f841d789 Author: Stephen Sinclair Date: Wed Aug 4 16:44:43 2010 +0000 libmapper: fix, forgot to add ..linear_range.. and ..linear_scale.. to header. commit d0dc6a2ed4283586ea3be0f2f785daf22ea7420a Author: Stephen Sinclair Date: Wed Aug 4 16:28:30 2010 +0000 libmapper: Move mapping range info into a substruct and use a "known" bitfield. commit e251cfbd260ae43816e077e68c5036573876f0fb Author: Stephen Sinclair Date: Wed Aug 4 16:28:20 2010 +0000 libmapper: for linear mapping, calculate a scale and offset. commit b5281f28ed3e771c69519a62321886538f67bdb6 Author: Stephen Sinclair Date: Wed Aug 4 16:28:12 2010 +0000 libmapper: get rid of the device_type enum, which is not used. commit 4e02d19371af45fd6b395c958654b06257430ce1 Author: Stephen Sinclair Date: Wed Aug 4 01:24:52 2010 +0000 libmapper: Fix all warnings, mostly unused variables. Now possible to use ./configure --enable-debug again, which turns on -Werror. commit 8320ae3e47e488327d1739f6528771c29251aa09 Author: Joseph Malloch Date: Tue Aug 3 22:30:04 2010 +0000 overhaul of /connect_to handler commit ce22faff851c520b76566b550dcfd567c99db067 Author: Joseph Malloch Date: Tue Aug 3 22:02:55 2010 +0000 added mapper_router_add_blank_mapping function commit e863a27f5a318edbea94dd9e90d869ba7a04ab0c Author: Joseph Malloch Date: Tue Aug 3 22:01:30 2010 +0000 moved /connected message to mapping creation functions commit 52837b7c385893e8548f6eaa7e07c22f240b5c89 Author: Stephen Sinclair Date: Tue Aug 3 21:10:06 2010 +0000 libmapper: function to build device name from prefix and ordinal, use everywhere. Previously this was done with sprintf everywhere. Now this string is built once and cached for later uses. The function is internally called from a macro to help catch instances where it would return null, i.e., if the ordinal is not yet registered. commit af4a93957d424301b8ad2cc6f4b6d9bc311b6f98 Author: Stephen Sinclair Date: Tue Aug 3 21:07:36 2010 +0000 libmapper: rename 'announce' functions to 'probe' and don't specialize in on_collision(). Since proposed resources are announced using the '/probe' message, as differentiated from registered resources that are announced using the '/registered' message, it is better if the source reflects this terminology. Now instead of a specialized switch in on_collision(), we can use a callback to handle formatting the '/registered' message, so that the resource-allocation logic remains independent of message formatting. (e.g., the name.ordinal needs special processing to format the '/registered' message.) commit ea00bb51b9530b84d1b75c557da13bc32692eb5e Author: Stephen Sinclair Date: Tue Aug 3 15:53:54 2010 +0000 libmapper: re-enable older test programs. Some of these currently segfault, revealing some erroneous pointer operations in the library. commit e26591d36795e75e638eaffde80c185500a7b91b Author: Stephen Sinclair Date: Tue Aug 3 14:36:21 2010 +0000 libmapper: Fix crashing on connect, bad arguments to lo_send(). commit 3459c8e14ba4a3b24808b18cf6120181da4f936e Author: Joseph Malloch Date: Tue Aug 3 13:07:28 2010 +0000 progress: compiles and runs, but segfaults on /connect commit f83e51fba5d3537e5d66adb195fcef9588e068a9 Author: Joseph Malloch Date: Mon Aug 2 21:14:14 2010 +0000 simplifying creation of mapping connections - do not compile :) commit a05300b0d724c28e959f82bf6e92a49b1a83378c Author: Joseph Malloch Date: Sat Jul 31 23:04:26 2010 +0000 libmapper: added //connections/get handler commit 3a5ba8690fad4e29c5962863abc3d09c6b3ce669 Author: Joseph Malloch Date: Thu Jul 29 18:26:24 2010 +0000 admin.c: added /links/get message handlers commit ed6354d53ee5c676b874622ba4fcdee2f03f7e4c Author: Joseph Malloch Date: Thu Jul 29 18:13:56 2010 +0000 added /link and /connect automation to test.c commit a528e7f2d5b6306ca73bc8e34c45efd72a1dc868 Author: Stephen Sinclair Date: Wed Jul 28 21:50:24 2010 +0000 Add the pkg-config m4 script for autoconf to the repository. commit 89d50cf432009e735a0dbf4a1c3eba3d2a3971d9 Author: Joseph Malloch Date: Wed Jul 28 21:17:07 2010 +0000 can now correctly create a mapping with non-default properties, but segfaults unless you create and delete default mapping first commit 2e44c4d23b4c4889239a58accd72472b85036254 Author: Joseph Malloch Date: Wed Jul 28 20:38:54 2010 +0000 added GUI OSC messages commit 5f041876f5021c9b628af4cb5e576b8cc412b686 Author: Joseph Malloch Date: Wed Jul 28 20:38:26 2010 +0000 added GUI OSC messages commit bd8d203356a37e163e3d5a9fe612b8993822f535 Author: Joseph Malloch Date: Wed Jul 28 20:14:24 2010 +0000 libmapper: fixed bugs in /connect_to function when called with additional properties commit d2624a5d91a55834f32f45267a29b84a90381c3a Author: Joseph Malloch Date: Wed Jul 28 17:56:01 2010 +0000 libmapper: added range invert commit 4a6e843e497f13c4f37416b6475701bf878d5645 Author: Joseph Malloch Date: Tue Jul 27 22:51:41 2010 +0000 libmapper: added support for "calibrate" scaling type, autocalibration. Also switched expressions generated in "linear" mode to %g to truncate trailing zeros in expression string commit 8d27bab9ec69f3ec5222dec26077de4ecba27a9d Author: Joseph Malloch Date: Sun Jul 25 02:11:52 2010 +0000 reverted some unnecessary changes (from 2068) commit 2547a9220065f3b6684e0590b3c0f2c7c89f5795 Author: Joseph Malloch Date: Sun Jul 25 01:50:19 2010 +0000 - test.c now runs successfully with /link, /unlink, /connect, /disconnect, and /connection/modify. - router struct now stores parameter name without device prepended - /link, /unlink, /connect, /disconnect, /connection/modify handler functions now check for OSC address matches before searching their parameter-space commit 1c88f504bac9953bf3da5d3cc518534d9510f9a3 Author: Joseph Malloch Date: Fri Jul 23 20:03:12 2010 +0000 /connect_to now working properly commit 19ff999454b4ed9f305e124d9f2751ef2804442f Author: Joseph Malloch Date: Fri Jul 23 18:28:17 2010 +0000 /connect now working properly - still some problems with /connect_to commit aecf619aa20e822e464bcdfdd1937916b2f68e0d Author: Joseph Malloch Date: Fri Jul 23 13:42:12 2010 +0000 small changes commit 27311db5482bd49d87481fe1e30c39aca340ee0f Author: Joseph Malloch Date: Wed Jul 21 02:57:27 2010 +0000 only destination device responds to /connect message. Signal type still not reported correctly commit c12e91276d64984af83fb45d84e886fb3ab666f5 Author: Joseph Malloch Date: Wed Jul 21 02:56:31 2010 +0000 added signal type to data structure commit 17015f174d1ffd57dd9c3a8877b9dfcfd292fefb Author: Stephen Sinclair Date: Tue Jul 20 18:06:43 2010 +0000 Remove executable permission from C files. commit 60e018e4e8e2e346e55d80f24b7c01a4b0f2d3d1 Author: Joseph Malloch Date: Mon Jul 19 22:35:41 2010 +0000 cleanup commit fb14211e48da703d0ed1de0499c12af42c809a85 Author: Joseph Malloch Date: Mon Jul 19 22:02:21 2010 +0000 modified /link protocol to work without storing all device metadata commit 05d15e2fb9025309ac3bd3636c73f0f04e7a9821 Author: Joseph Malloch Date: Mon Jul 19 19:53:59 2010 +0000 updated definition of mapper_clipping_type commit ee393e7559a5a1ab05db8d8f6f56c94e3387fa0e Author: Jérôme Nika Date: Sat Jul 17 00:27:00 2010 +0000 B3 synth commit ccf1afc46702bc5dcd92f6cc9efa141da42416e7 Author: Joseph Malloch Date: Fri Jul 16 20:16:13 2010 +0000 added Jerome Nika to libmapper AUTHORS commit b52b3858a9b64e5602fdcf91223d5beb20482bdf Author: Stephen Sinclair Date: Wed Jul 14 21:05:09 2010 +0000 Add a clean command for pkg-config file. commit 5df58fdfb8ad9c154114ebf3dcbec3a7e4abc67b Author: Stephen Sinclair Date: Wed Jul 14 21:05:03 2010 +0000 autogen: Use git to check for git. commit 9e4b1e31ef7ed326c51bf61e658ff4a8412220be Author: Jérôme Nika Date: Tue Jul 13 15:32:21 2010 +0000 Problems in /disconnect fixed. commit 5a519fb01be6911e012062c091897718066e976c Author: Jérôme Nika Date: Wed Jul 7 20:51:04 2010 +0000 (Almost) final version. Last methods implemented, commented, still little problem with /disconnect... commit cb8b259198ca33e49061f7a2fdafae93c64992a3 Author: Jérôme Nika Date: Tue Jul 6 22:31:47 2010 +0000 unlink, unconnected. With /unlink, /disconnect, properties for /connect_to, /connexion/modify commit 0b403004093345ae831fcbfd87c2d19d892406bc Author: Jérôme Nika Date: Mon Jul 5 16:24:57 2010 +0000 Unlinked and unconnected. Properties added for /connect_to, /unlink and /disconnect implemented but still problems with /disconnect. Missing /connection/modify, and still "unreadable"... commit f150ee79100b23dd60a5504780a6cbaef08c5d7a Author: Joseph Malloch Date: Fri Jul 2 17:02:41 2010 +0000 update to DOT protocol documentation commit 274ef7fc45935da5c0230fbaa3034fc00348f558 Author: Jérôme Nika Date: Fri Jun 25 16:14:38 2010 +0000 Unlinked and unconnected version (not yet commented and organized) commit d7e808a56472602243818458b40b0451ac0d8144 Author: Stephen Sinclair Date: Thu Jun 17 21:10:32 2010 +0000 configure: Check for swig and python-config instead of using SWIG_PYTHON macro. It seems AC_PYTHON_DEVEL (used by SWIG_PYTHON) is broken on OS X and Debian/Ubuntu, because it provides compiler flags that don't successfully compile, and it hasn't been maintained since 2006. Instead, use the python-config program to extract required Python flags. Check for python-config only if SWIG bindings are specified, and use AC_CHECK_PROG to find the swig executable. commit d3a951ec5039c6d0379e04bcf66108d5b319f517 Author: Stephen Sinclair Date: Thu Jun 17 21:10:27 2010 +0000 Depend on an older version of libtool (for OS X) commit 6af4ac29c8178b507e104b2c1a38bd80dd475e64 Author: Stephen Sinclair Date: Tue Jun 15 16:25:57 2010 +0000 configure: Check for programs according to enable options and describe status when done. commit da9c18f7a05882dbca4aad25ad20b299621020ca Author: Stephen Sinclair Date: Tue Jun 15 15:46:49 2010 +0000 Warn about problems with libssl and libcrypto packaging if Python needs them. Found an annoying problem with compiling against Python. The configure check would fail because it couldn't link against libssl and libcrypto, neither which is used here. However, Python wanted them, but the symbolic links for these libraries were not present on Debian-based systems even though the packages are installed. It turns out the dev packages for these libraries must be installed for AC_PYTHON_DEVEL (which uses Python's distutils to determine library dependencies) to be satisfied. Solution is to either not use AC_PYTHON_DEVEL or to just warn the user that these dev packages need to be installed, so I chose the latter. Unfortunately AC_PYTHON_DEVEL (called by SWIG_PYTHON) doesn't give us an opportunity to provide a message on failure, so we have to add the warning just before calling it. This doesn't seem to be a problem on OS X, but more testing is needed. commit 779c1cf4c3ef8f2bd301cd9a34b9ccc14c95e354 Author: Jérôme Nika Date: Mon Jun 14 17:18:14 2010 +0000 version with expression interpreter with the string received from the terminal commit a756ebcdbcdf4dd11ff3877de358e2952cedea76 Author: Joseph Malloch Date: Wed Jun 9 21:17:41 2010 +0000 updated mapping message documentation commit aeef83f402598d6d8dd3a88233bd0d46d058dc90 Author: Stephen Sinclair Date: Tue May 4 03:58:22 2010 +0000 Move signal mapping into its own function, and account for higher-order polynomials. Note that this assumes coefficients are floats. commit 4f59ff5acf7d896259e3b9723cc81946b1352f95 Author: Stephen Sinclair Date: Tue May 4 03:58:17 2010 +0000 Typo in README. commit d6471c2c7b9bfbbbf3f9aa515f302d09a4c87cca Author: Joseph Malloch Date: Fri Apr 9 04:09:27 2010 +0000 changed logout message from "/device/logout" to "/logout" commit 1eb353cbab86d3b1089599460baf1199fa147b0e Author: Joseph Malloch Date: Thu Mar 18 22:02:40 2010 +0000 update to DOT message documentation commit 6b88d68a57483fd3eb71124bd8faf062fe48803a Author: Joseph Malloch Date: Wed Mar 17 19:10:05 2010 +0000 removed /connection/properties message - replaced with /connected commit 646cf7e019e827b286fd2dc2188b4740bf02d147 Author: Joseph Malloch Date: Wed Mar 17 18:30:59 2010 +0000 updated documentation of mapping messages to include 2-stage connection, @canAlias and @hash properties commit 91ba3c09509d13f9a6726d909fd3aaa778814b3d Author: Joseph Malloch Date: Wed Mar 17 17:52:09 2010 +0000 corrected documentation of mapping messages commit 9e766c8f76ec8b8149b66d09249ba99592b515b5 Author: Joseph Malloch Date: Sun Jan 10 21:53:28 2010 +0000 added message documentation to libmapper/notes/ commit 9c45f1ba44e1a48e0aa68707edea3fa38d859b44 Author: Stephen Sinclair Date: Mon Jan 4 05:22:19 2010 +0000 Add data structures for mapping behaviour and do a linear scaling. commit 486da6c09d9fdd03617f075508168800027e1712 Author: Stephen Sinclair Date: Mon Jan 4 05:22:14 2010 +0000 Add a test for sending and receiving through a linear mapping. commit 83c23ef3f3e096bc165b5acd66666c91c3f0173b Author: Stephen Sinclair Date: Mon Jan 4 05:22:09 2010 +0000 Fix erroneous doxygen comments in types_internal.h. commit f911e4017c106573f4a9e8ce817caa5b53b9b847 Author: Stephen Sinclair Date: Mon Jan 4 05:22:06 2010 +0000 Add necessary files to compile a Doxygen internal reference. commit b29f3509fcb22fe174afe3331ae40589d899cd41 Author: Stephen Sinclair Date: Mon Jan 4 05:22:01 2010 +0000 Add a debug trace if no interface was found. commit 6136d415b17c9276fac29bcee34421dede89e43c Author: Stephen Sinclair Date: Sat Jan 2 20:55:39 2010 +0000 Make testrecv wait for and use the signal name. commit 81d2b5d7a6e1fdf040840f7b7f1753b2aa55d7f6 Author: Stephen Sinclair Date: Sat Jan 2 20:55:34 2010 +0000 Wait for both ordinal and port to be allocated before starting server. Otherwise msig_full_name() may return error after port allocation but before ordinal allocation, and handlers can't be registered. commit 2defc5a12ce0f0579427a0250d5fa6183f2cf9d9 Author: Stephen Sinclair Date: Sat Jan 2 20:55:25 2010 +0000 When polling admin, process more than one message at once if available. Processes maximum 10 messages, probably adequate for now. commit 90b420f992f02196a7984a12dc172c8742960f4b Author: Stephen Sinclair Date: Sat Jan 2 20:55:19 2010 +0000 Add a function to get the name of a signal. commit 57c086eb6e27046e48a1ef7b64caa7d0eb2c6e36 Author: Stephen Sinclair Date: Sat Jan 2 20:55:14 2010 +0000 Handle error condition when admin cannot be created. This occurred when an old version of oscdump was used, and the port was reserved non-multicast and thereforenot available. Instead of segfault, mdev_new() should return NULL. commit f3e262934197e4cea79f977633cda9bf328d6db7 Author: Stephen Sinclair Date: Sat Jan 2 20:55:02 2010 +0000 Add a debug option to configure. commit 1c69f86ef3874f0742e4c812b20a9b8f5280024f Author: Stephen Sinclair Date: Sat Jan 2 20:54:41 2010 +0000 In get_interface_addr, encountered a case where sa=0, so check for it. It doesn't seem to be documented what to do in this case, but it would seem natural to at least report the condition in debug mode and then skip the case. (Instead of segfaulting.) commit d7013eaa57ae42c2d309ca594c948207ce923e21 Author: Stephen Sinclair Date: Tue Dec 29 06:46:48 2009 +0000 Work around an apparent bug in gcc's optimizer, which breaks grow_ptr_array on O2 or O3. commit 44c7ba1656743949b1e932fc6367457f58eea225 Author: Stephen Sinclair Date: Tue Dec 29 06:22:58 2009 +0000 Fix using wrong value (dumb mistake) in mval_add_to_message(). commit f02c0683168d360da3b064ddb18ab023dda67bec Author: Stephen Sinclair Date: Tue Dec 29 06:22:55 2009 +0000 Do not install test programs. commit 3f96a48fb485ca604d7c4807b78a6aa4b7d0ea9c Author: Stephen Sinclair Date: Tue Dec 29 06:22:52 2009 +0000 Put header files into mapper-0/mapper directory and include extra headers in dist. commit ece1c8e8d2886c2fc617042c8cc87dc88b6e304b Author: Stephen Sinclair Date: Tue Dec 29 06:22:47 2009 +0000 Fix trace macro in non-debug mode. commit df74164dee7a6d618fb41d189e0365999d621182 Author: Stephen Sinclair Date: Tue Dec 29 05:17:24 2009 +0000 Rewrite enumeration of device namespace. The code to do this is in admin, accessing device data structures. If more cases are found where namespace enumeration would be useful, it might be better to provide an enumerator interface for the input and output lists. commit 46900773846c619ebbf544105a29f42aac52085f Author: Stephen Sinclair Date: Tue Dec 29 03:55:39 2009 +0000 In testrecv, send messages in test and actually check whether they were received. commit d6bbce06228d855cc040465aefdbd31f19f08a97 Author: Stephen Sinclair Date: Tue Dec 29 03:22:50 2009 +0000 Add functionality for specifying receive handlers and opening a server. This commit also refactors the 'trace' debug function into an internally global macro. commit c867b3c50d8ca3480307d3aa4022dd327c06ed09 Author: Stephen Sinclair Date: Tue Dec 29 03:22:15 2009 +0000 Add a callback field to the signal struct to be used for handling input. commit 40f2f3b73472f52c9fd314be5e1696990cf331fd Author: Stephen Sinclair Date: Tue Dec 29 03:21:19 2009 +0000 Move controller and admin tests into their own test programs. commit 6657c004c0c2ad3510a8b3d605889b195012d252 Author: Stephen Sinclair Date: Fri Dec 25 21:54:36 2009 +0000 Add functionality to maintain a list of signal mappings. commit e0d25bf37b8cbfa6fcf592cd82f945c348236f95 Author: Stephen Sinclair Date: Fri Dec 25 21:54:33 2009 +0000 Change some string pointers to const. commit 67c1cbfd074e4e86b116adde8176c9c8030351a0 Author: Stephen Sinclair Date: Fri Dec 25 21:54:30 2009 +0000 Add some internal structs to handle mappings. commit ad0cf488dd72f0cf1868469614a80ca7a47bd719 Author: Stephen Sinclair Date: Thu Dec 24 01:18:22 2009 +0000 Fix some warnings. commit 614243f279cca2eb1d2b2a512b03362a1d94cf45 Author: Stephen Sinclair Date: Thu Dec 24 01:18:21 2009 +0000 Mistaken double-pointer type for router list in device struct. commit 342027fecf0d6e2dd6da3a4a3df72f2a4b78ab3e Author: Stephen Sinclair Date: Thu Dec 24 01:18:19 2009 +0000 Put 'mapper_' prefix on router routines. commit 98e71c692f3203be23f4ef4cf071c8aa4f296ff3 Author: Stephen Sinclair Date: Thu Dec 24 01:18:17 2009 +0000 Add a define to configure.ac to avoid conflicts with pyconfig.h. This is a work-around for an apparent annoyance in Python's header files. "configure" would fail because Python also defines HAVE_GETTIMEOFDAY. commit a1e5a40a4db296e95f933b2c28185db869dc4d6d Author: Stephen Sinclair Date: Thu Dec 24 01:18:15 2009 +0000 Remove test2. commit 5317644346966fd9e8198d4a68ede62514156a1c Author: Stephen Sinclair Date: Thu Dec 24 01:18:13 2009 +0000 Forgot to add router.c in previous commit. commit 9ebaa11f364532e4dd7202115cfedf508252ee5e Author: Stephen Sinclair Date: Fri Dec 18 05:14:59 2009 +0000 Add a skeleton router interface. commit 955e9105a7ed081b16a455ed9d04c1496078c58c Author: Stephen Sinclair Date: Fri Dec 18 05:14:58 2009 +0000 Add a liblo error handler for admin server. commit 0b89fa7051c77ced4c94b1dd396c2e08408dc8ef Author: Stephen Sinclair Date: Fri Dec 18 05:14:56 2009 +0000 Call msig_update_scalar() during controller test. commit 6d5d22857a052caaac7a9071e3a1bfe7fa81f4e0 Author: Stephen Sinclair Date: Fri Dec 18 05:14:54 2009 +0000 Actually block in mdev_poll() if requested. (This will change to a lo_server_recv_noblock() call in the future.) commit 82320ee6770ff80973c9ebe3cc4c337fd1da8c64 Author: Stephen Sinclair Date: Fri Dec 18 05:14:52 2009 +0000 Add function prototypes for updating signal values. commit ab25b2a34346a7e5748d96a7fe228a478efc566e Author: Stephen Sinclair Date: Sun Dec 6 05:12:52 2009 +0000 libmapper: Forgot to remove a line in testmapper testing the name assertion. commit 250b996d2c2ee3d4b44ce37df4355c66c6a8338d Author: Stephen Sinclair Date: Sun Dec 6 03:37:33 2009 +0000 libmapper: Add an interface to fill in signal definitions easily. Perhaps this could be used to just directly register signals? commit bbf2c499eb0f747e8e4145b3ab43e39aebabf58c Author: Stephen Sinclair Date: Sun Dec 6 03:37:31 2009 +0000 libmapper: Go ahead and require C99. commit 4c3d5febdd9c1a675c9df629e964a872be5e13b8 Author: Stephen Sinclair Date: Sun Dec 6 03:37:29 2009 +0000 libmapper: Hide mapper_device structure properly by putting it in an internal header. commit 3571b42f1196a30deaaa9ef394b50017a9a33ff0 Author: Stephen Sinclair Date: Sun Dec 6 03:37:27 2009 +0000 libmapper: Check for POSIX functions, give errors when gettimeofday not found. commit f1c272462458f89269be048e90ed6530ccbbaafa Author: Stephen Sinclair Date: Sun Dec 6 03:37:25 2009 +0000 libmapper: Re-organization of the data structures into 'admin' and 'device'. A 'device' handles its signals and namespace, the admin deals with talking on the admin bus. There is some overlap here that needs to be worked out. In any case, abort the 'mapper_method_*' interface in favour of the signal definitions. commit 18d8f4a6cb4e6b314bee0990f37010b09d5beef3 Author: Stephen Sinclair Date: Sun Dec 6 03:37:21 2009 +0000 libmapper: Compile the 'test' directory on make. commit 288feff1c0dab033dd21b1ede830b008294a67de Author: Stephen Sinclair Date: Sat Dec 5 22:58:26 2009 +0000 libmapper: Add pkg-config file. commit c9b98eea4edd79359d6c8a1ebd4a96e239af5c80 Author: Stephen Sinclair Date: Sat Dec 5 22:58:24 2009 +0000 libmapper: Begin designing a new interface. commit a11f3841735c0e0f40ca075748adf2b9c4a77bfa Author: Stephen Sinclair Date: Sat Dec 5 22:58:22 2009 +0000 libmapper: Fix warnings and get test program to compile. commit decf4131d780318e4df98e078f85c0bd1f0b9136 Author: Stephen Sinclair Date: Sat Dec 5 22:07:38 2009 +0000 libmapper: Add autoconf files. commit ac31bfd9c74cf29a3e14a3e42036baa79e221f25 Author: Stephen Sinclair Date: Sat Dec 5 22:07:35 2009 +0000 libmapper: Add GNU-standard information files. LGPL license 2.1 or later. commit 67fd060886e14a2356cb3c8288fa03f0f5f7586c Author: Stephen Sinclair Date: Sat Dec 5 22:07:32 2009 +0000 libmapper: Add previous work on C implementation (libmapper) and some new protocol notes. libmapper/configure.ac0000644000175000017500000002362112423630127014313 0ustar tiagotiagoAC_PREREQ(2.61) AC_INIT([libmapper],[m4_esyscmd_s([git describe --always])],[dot_mapper@googlegroups.com],[],[http://libmapper.org]) # libtool version: current:revision:age # # If the library source code has changed at all since the last update, then # increment revision (`c:r:a' becomes `c:r+1:a'). # # If any interfaces have been added, removed, or changed since the last update, # increment current, and set revision to 0. # # If any interfaces have been added since the last public release, then # increment age. # # If any interfaces have been removed since the last public release, then set # age to 0. SO_VERSION=2:0:0 AC_CONFIG_SRCDIR([src/device.c]) AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_ENABLE_STATIC(no) AC_ENABLE_SHARED(yes) AC_SUBST(SO_VERSION) MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) AC_SUBST(MAJOR_VERSION) AM_SANITY_CHECK # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/time.h unistd.h termios.h fcntl.h errno.h]) AC_CHECK_HEADERS([arpa/inet.h]) AC_CHECK_HEADERS([zlib.h]) AC_CHECK_HEADERS([winsock2.h]) AC_CHECK_FUNC([inet_ptoa],[AC_DEFINE([HAVE_INET_PTOA],[],[Define if inet_ptoa() is available.])],[]) AC_CHECK_FUNC([getifaddrs],[AC_DEFINE([HAVE_GETIFADDRS],[],[Define if getifaddrs() is available.])],[ AC_CHECK_LIB([iphlpapi],[exit],[ # Need some functions not available before Windows XP CFLAGS="$CFLAGS -DWIN32 -D_WIN32_WINNT=0x501" AC_DEFINE([HAVE_LIBIPHLPAPI],[],[Define if iphlpapi library is available. (Windows)]) is_windows=yes ],[])]) AC_CHECK_FUNC([gettimeofday],[AC_DEFINE([HAVE_GETTIMEOFDAY],[],[Define if gettimeofday() is available.])], [AC_ERROR([This is not a POSIX system!])]) AC_CHECK_LIB([z], [gzread], , [AC_MSG_ERROR([zlib not found, see http://www.zlib.net])]) AM_CONDITIONAL(WINDOWS, test x$is_windows = xyes) AM_CONDITIONAL(WINDOWS_DLL, test x$is_windows = xyes && test x$enable_shared = xyes) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T # pthreads AX_PTHREAD # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CC_C99 AC_PROG_CXX # libtool AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL # Check for the math library LT_LIB_M LIBS="$LIBS $LIBM" # Check for C++11 features _CXXFLAGS="$CXXFLAGS" AC_LANG_PUSH([C++]) AC_MSG_CHECKING([whether C++11 lambdas are supported]) CXXFLAGS="$_CXXFLAGS -std=c++11" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ],[[[]](std::function f){f();}([[]](){0;});])], [AC_MSG_RESULT([yes]) HAVE_LAMBDA=yes], [ CXXFLAGS="$_CXXFLAGS -std=c++0x" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ],[[[]](std::function f){f();}([[]](){0;});])], [AC_MSG_RESULT([yes]) HAVE_LAMBDA=yes], [ CXXFLAGS="$_CXXFLAGS -std=c++11 -stdlib=libc++" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include ],[[[]](std::function f){f();}([[]](){0;});])], [AC_MSG_RESULT([yes]) HAVE_LAMBDA=yes], [AC_MSG_RESULT([no]) CXXFLAGS="$_CXXFLAGS"])])]) AM_CONDITIONAL([HAVE_LAMBDA],[test x$HAVE_LAMBDA = xyes]) # If we can add -Qunused-arguments, add it. # This error occurs when ccache and clang are used together. AC_MSG_CHECKING([whether to add -Qunused-arguments (C++)]) _CXXFLAGS="$CXXFLAGS" CXXFLAGS="$_CXXFLAGS -Qunused-arguments" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([],[])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) CXXFLAGS="$_CXXFLAGS"]) AC_LANG_POP([C++]) # Check options AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[compile with debug flags])], enable_debug=yes) AC_ARG_ENABLE(tests, [ --disable-tests don't build test programs.],, enable_tests=yes) AC_ARG_ENABLE(docs, [ --disable-docs don't build the documentation.],, enable_docs=yes) AC_ARG_ENABLE(audio, [ --disable-audio don't build the audio examples.],, enable_audio=yes) swig_enabled=yes AC_ARG_ENABLE(swig, [ --disable-swig don't build the SWIG bindings.], swig_enabled=$enableval) jni_enabled=yes AC_ARG_ENABLE(jni, [ --disable-jni don't build the Java JNI bindings.], jni_enabled=$enableval) if test x$swig_enabled = xyes; then AC_CHECK_PROG([SWIG], [swig], [swig]) if test x$SWIG = x; then swig_enabled=no swig_explain="(swig not found)" else AM_PATH_PYTHON(2.3, [have_python="yes"], [have_python="no"]) if test x$have_python = xyes; then SWIGDIR=swig AC_SUBST(SWIGDIR) PYEXT=$($PYTHON -c "import sys; print {'win32':'pyd','darwin':'so','linux2':'so'}[[sys.platform]]") AC_SUBST(PYEXT) else swig_enabled=no swig_explain="(python not found)" fi fi fi # Check for JNI if test x$jni_enabled = xyes; then JDKPATH= if test -d /usr/lib/jvm/java-7-openjdk-i386; then JDKPATH=/usr/lib/jvm/java-7-openjdk-i386 elif test -d /usr/lib/jvm/java-7-openjdk-amd64; then JDKPATH=/usr/lib/jvm/java-7-openjdk-amd64 elif test -d /usr/lib/jvm/java-7-openjdk-x86_64; then JDKPATH=/usr/lib/jvm/java-7-openjdk-x86_64 elif test -d /usr/lib/jvm/java-6-openjdk; then JDKPATH=/usr/lib/jvm/java-6-openjdk elif test -d /System/Library/Frameworks/JavaVM.framework/Headers; then JDKPATH=/System/Library/Frameworks/JavaVM.framework fi AC_ARG_WITH([jdk-path], AS_HELP_STRING([--with-jdk-path],[specify the path to the JDK]), [JDKPATH="$withval"]) if test x"$JNIPATH" = x; then if test -f "$JDKPATH"/Headers/jni.h; then JNIPATH="$JDKPATH"/Headers elif test -f "$JDKPATH"/include/jni.h; then JNIPATH="$JDKPATH"/include fi fi if test x"$JDKBINPATH" = x; then if test -f "$JDKPATH"/Commands/javac; then JDKBINPATH="$JDKPATH"/Commands elif test -f "$JDKPATH"/bin/javac; then JDKBINPATH="$JDKPATH"/bin fi fi AC_PATH_PROG([JAVAC], [javac], [], ["$JDKBINPATH"$PATH_SEPARATOR$PATH]) AC_PATH_PROG([JAVAH], [javah], [], ["$JDKBINPATH"$PATH_SEPARATOR$PATH]) AC_PATH_PROG([JAR], [jar], [], ["$JDKBINPATH"$PATH_SEPARATOR$PATH]) if test x$JAVAC = x; then jni_enabled=no jni_explain="(javac not found)" elif test x$JAVAH = x; then jni_enabled=no jni_explain="(javah not found)" elif test x$JAR = x; then jni_enabled=no jni_explain="(jar not found)" else AC_CHECK_HEADER([$JNIPATH/jni.h], [jni_enabled=yes], [jni_enabled=no; jni_explain="(jni.h not found)"]) if test x$jni_enabled = xyes; then JNI=jni AC_SUBST(JNIPATH) AC_SUBST(JNI) fi fi fi # Check for audio libraries supported by RtAudio if test x$enable_audio = xyes; then # Try ALSA AC_CHECK_LIB(asound, snd_ctl_open, [RTAUDIO_CFLAGS="-D__LINUX_ALSA__ -D__LITTLE_ENDIAN__" RTAUDIO_LIBS=-lasound audio_explain="(ALSA)"]) # Look for CoreAudio (This could be more sophisticated) echo -n Checking for CoreAudio... if test -e /System/Library/Frameworks/CoreAudio.framework; then RTAUDIO_CFLAGS="-D__MACOSX_CORE__ -D__LITTLE_ENDIAN__" RTAUDIO_LIBS="-framework CoreAudio -framework CoreFoundation" audio_explain="(CoreAudio)" echo yes else echo no fi if test -z "$RTAUDIO_CFLAGS"; then enable_audio=no audio_explain="(no supported audio system found.)" fi fi AC_SUBST(RTAUDIO_CFLAGS) AC_SUBST(RTAUDIO_LIBS) # Doxygen if test x$enable_docs = xyes; then AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], []) AC_SUBST(DOXYGEN) if test x$DOXYGEN = x; then enable_docs=no docs_explain="(doxygen not found.)" fi fi # pkg-config PKG_PROG_PKG_CONFIG # Check for liblo AC_ARG_WITH([liblo], AS_HELP_STRING([--without-liblo],[compile without liblo, disable OSC])) AS_IF([test x$with_liblo != xno],[ PKG_CHECK_MODULES([liblo], [liblo >= 0.27])]) AS_IF([test "x$liblo_LIBS" = x], [with_liblo=no]) AS_IF([test x$with_liblo != xno],[ AC_DEFINE([HAVE_LIBLO],[],[Define to enable Open Sound Control support with liblo]) AC_SUBST(LIBLO,liblo) tmpLIBS="$LIBS" LIBS="$LIBS $liblo_LIBS" AC_CHECK_FUNC([lo_address_set_iface], [AC_DEFINE([HAVE_LIBLO_SET_IFACE],[],[Define to use lo_address_set_iface function in liblo.])]) AC_CHECK_FUNC([lo_server_new_multicast_iface], [AC_DEFINE([HAVE_LIBLO_SERVER_IFACE],[],[Define to use lo_server_new_multicast_iface function in liblo.])]) AC_CHECK_FUNC([lo_bundle_count], [AC_DEFINE([HAVE_LIBLO_BUNDLE_COUNT],[],[Define to use lo_bundle_count function in liblo.])]) LIBS="$tmpLIBS" ]) # Debug mode AS_IF([test x$enable_debug = xyes], [CFLAGS="-g -O0 -Wall -Werror -DDEBUG `echo $CFLAGS | sed 's/-O2//'`"], [CFLAGS="$CFLAGS -DNDEBUG"]) # Add -I. so that config.h is found correctly during VPATH builds # (see autoconf manual section 4.9) CFLAGS="-I. $CFLAGS" AM_CONDITIONAL(TESTS, test x$enable_tests = xyes) AM_CONDITIONAL(HAVE_DOXYGEN, test "x$DOXYGEN" != x) AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = xyes) AM_CONDITIONAL(HAVE_SWIG, test "x$swig_enabled" = xyes) AM_CONDITIONAL(HAVE_AUDIO, test "x$enable_audio" = xyes) AC_CONFIG_FILES([ Makefile src/Makefile include/Makefile test/Makefile doc/Makefile doc/libmapper.doxyfile swig/Makefile swig/setup.py jni/Makefile jni/Mapper/NativeLib.java examples/Makefile examples/pwm_synth/Makefile examples/py_tk_gui/Makefile examples/py_tk_gui/setup.py extra/Makefile extra/osx/Makefile libmapper.pc ]) AC_OUTPUT # Messages to user. echo echo libmapper configured: echo -------------------------------------------------- echo "building documention... " $enable_docs $docs_explain echo "building tests... " $enable_tests echo "building SWIG bindings... " $swig_enabled $swig_explain echo "building Java bindings... " $jni_enabled $jni_explain echo "building audio examples... " $enable_audio $audio_explain AS_IF([test x$enable_debug = xyes], [echo "Debug flags enabled."]) echo -------------------------------------------------- libmapper/notes/0000755000175000017500000000000012423630127013151 5ustar tiagotiagolibmapper/notes/behaviour.hs0000644000175000017500000000621112423630127015471 0ustar tiagotiago import IO data SignalUnits = NA | Normalized | Boolean deriving (Show, Eq) data SignalValue = SignalInt Int | SignalFloat Float | Empty deriving (Show) toSignalFloat :: SignalValue -> SignalValue toSignalFloat (SignalInt i) = SignalFloat (fromIntegral i) toSignalFloat (SignalFloat f) = SignalFloat f toSignalFloat Empty = Empty instance Eq SignalValue where _ == Empty = False Empty == _ = False (SignalInt a) == (SignalInt b) = a == b (SignalFloat a) == (SignalFloat b) = a == b a == b = (toSignalFloat a) == (toSignalFloat b) -- Type of signal is 'f' or 'i' with an optional array size. data SignalType = SigTypeFloat (Maybe Int) | SigTypeInt (Maybe Int) deriving (Eq) instance Show SignalType where show (SigTypeInt Nothing) = "i" show (SigTypeFloat Nothing) = "f" show (SigTypeInt (Just i)) = ("i["++(show i)++"]") show (SigTypeFloat (Just i)) = ("f["++(show i)++"]") data Signal = Signal { sigName :: String, sigMin :: SignalValue, sigMax :: SignalValue, sigUnits :: SignalUnits, sigType :: SignalType } deriving (Show, Eq) -- A normalized signal is a float value not in an array with min=0 and max=1. -- A boolean signal is an integer value 0 or 1, not in an array. newSignal :: SignalUnits -> String -> Signal newSignal u n | u == Normalized = Signal n (SignalFloat 0.0) (SignalFloat 1.0) u (SigTypeFloat Nothing) | u == Boolean = Signal n (SignalInt 0) (SignalInt 1) u (SigTypeInt Nothing) data Device = Controller { deviceRootName :: String, deviceOutputs :: [Signal] } | Synth { deviceRootName :: String, deviceInputs :: [Signal] } | Router { deviceRootName :: String, deviceInputs :: [Signal], deviceOutputs :: [Signal] } deriving (Show, Eq) data MessageValue = MsgValString String | MsgValInt Int | MsgValFloat Float deriving (Eq) instance Show MessageValue where show (MsgValString s) = s show (MsgValInt i) = show i show (MsgValFloat f) = show f data Message = Message { msgPath :: String, msgArgs :: [MessageValue] } deriving (Show, Eq) receive :: Message -> String receive (Message path args) = "received " ++ path ++ (foldl1 (++) $ map (\x -> (++) " " (show x)) args) dispatch :: Message -> String dispatch (Message "/link" [MsgValString a, MsgValString b]) = "linking " ++ a ++ " and " ++ b dispatch (Message a b) = "Unknown message " ++ a ++ " " ++ (show b) adc1 = newSignal Normalized "adc1" pin2 = newSignal Boolean "pin2" pin3 = Signal "pin2" (SignalFloat 0.0) Empty NA (SigTypeFloat (Just 2)) tstick = Controller "tstick" [adc1] modal = Synth "modal" [pin2, pin3] main :: IO () main = do putStrLn $ show $ receive $ Message "/link" [(MsgValString "/tstick/1"), (MsgValString "/modal/1")] putStrLn $ show $ dispatch $ Message "/link" [(MsgValString "/tstick/1"), (MsgValString "/modal/1")] putStrLn $ show $ dispatch $ Message "/link" [(MsgValString "/tstick/1"), (MsgValString "/modal/1"), (MsgValInt 2)] libmapper/notes/recorded_messages.txt0000644000175000017500000001016412423630127017372 0ustar tiagotiago/modify "/output/2/channel/1" "/input/2/channel/4" "@scaling" "expression" "@expression" "(x-10)" "*" 80 /properties "/output/2/channel/1" "/input/2/channel/4" "@scaling" "expression" /properties "/output/2/channel/1" "/input/2/channel/4" "@expression" "(x-10)" "*" 80 /properties "/output/2/channel/1" "/input/2/channel/4" "@clipping" "none" /device/who /device/*/links/get /device "/output/1" "@IP" "132.206.14.194" "@port" 4003 "@class" "/output" "@outputs" 10 "@inputs" 0 /device "/input/2" "@IP" "132.206.14.194" "@port" 4000 "@class" "/input" "@inputs" 10 "@outputs" 0 /device "/input/3" "@IP" "132.206.14.194" "@port" 4002 "@class" "/input" "@inputs" 10 "@outputs" 0 /device "/output/2" "@IP" "132.206.14.194" "@port" 4004 "@class" "/output" "@outputs" 10 "@inputs" 0 /linked "/output/2" "/input/2" /output/2/namespace/get /output/2/connections/get /input/2/namespace/get /input/2/connections/get /output/2/namespace/output "/output/2/channel/1" "@type" "f" "@min" 0 "@max" 256 /output/2/namespace/output "/output/2/channel/2" "@type" "f" "@min" 0 "@max" 256 /connected "/output/2/channel/1" "/input/2/channel/3" "@scaling" "bypass" "@clipping" "none" /connected "/output/2/channel/1" "/input/2/channel/4" "@scaling" "expression" "@expression" "(x-10)" "*" 80 "@clipping" "none" /input/2/namespace/input "/input/2/channel/3" "@type" "f" "@min" 0 "@max" 256 /input/2/namespace/input "/input/2/channel/4" "@type" "f" "@min" 0 "@max" 256 /properties/get "/output/2/channel/1" "/input/2/channel/4" /properties "/output/2/channel/1" "/input/2/channel/4" "@scaling" "expression" "@expression" "(x-10)" "*" 80 "@clipping" "none" /modify "/output/2/channel/1" "/input/2/channel/4" "@scaling" "bypass" /properties "/output/2/channel/1" "/input/2/channel/4" "@scaling" "bypass" /properties "/output/2/channel/1" "/input/2/channel/4" "@expression" "(x-10)" "*" 80 /properties "/output/2/channel/1" "/input/2/channel/4" "@clipping" "none" /properties/get "/output/2/channel/1" "/input/2/channel/3" /properties "/output/2/channel/1" "/input/2/channel/3" "@scaling" "bypass" "@clipping" "none" /modify "/output/2/channel/1" "/input/2/channel/3" "@scaling" "linear" 0 256 0 256 /properties "/output/2/channel/1" "/input/2/channel/3" "@scaling" "linear" 0.000000 0.000000 256.000000 0.000000 "@expression" "(x" "-" "0.000000)" "*" 256.000000 "+" 1.000000 /properties "/output/2/channel/1" "/input/2/channel/3" "@clipping" "none" /modify "/output/2/channel/1" "/input/2/channel/3" "@scaling" "calibrating" 0 256 /properties "/output/2/channel/1" "/input/2/channel/3" "@scaling" "calibrating" 0 256 /properties "/output/2/channel/1" "/input/2/channel/3" "@clipping" "none" /modify "/output/2/channel/1" "/input/2/channel/3" "@scaling" "expression" "@expression" "(x" "-" "0.000000)" "*" 0.000000 "+" 1.000000 /properties "/output/2/channel/1" "/input/2/channel/3" "@scaling" "expression" /properties "/output/2/channel/1" "/input/2/channel/3" "@expression" "(x" "-" "0.000000)" "*" 0.000000 "+" 1.000000 /properties "/output/2/channel/1" "/input/2/channel/3" "@clipping" "none" /disconnect "/output/2/channel/1" "/input/2/channel/3" "@scaling" "bypass" "@clipping" "none" /disconnected "/output/2/channel/1" "/input/2/channel/3" /properties/get "/output/2/channel/1" "/input/2/channel/4" /properties "/output/2/channel/1" "/input/2/channel/4" "@scaling" "bypass" "@expression" "(x-10)" "*" 80 "@clipping" "none" /disconnect "/output/2/channel/1" "/input/2/channel/4" "@scaling" "bypass" "@clipping" "none" /disconnected "/output/2/channel/1" "/input/2/channel/4" /device/who /device/*/links/get /device "/output/1" "@IP" "132.206.14.194" "@port" 4003 "@class" "/output" "@outputs" 10 "@inputs" 0 /device "/input/2" "@IP" "132.206.14.194" "@port" 4000 "@class" "/input" "@inputs" 10 "@outputs" 0 /device "/input/3" "@IP" "132.206.14.194" "@port" 4002 "@class" "/input" "@inputs" 10 "@outputs" 0 /device "/output/2" "@IP" "132.206.14.194" "@port" 4004 "@class" "/output" "@outputs" 10 "@inputs" 0 /linked "/output/2" "/input/2" /unlink "/output/2" "/input/2" "@scaling" "bypass" "@clipping" "none" /unlinked "/output/2" "/input/2" "@scaling" "bypass" "@clipping" "none" libmapper/notes/messages.txt0000644000175000017500000000407112423630127015523 0ustar tiagotiago Messages exchanged by the mapper ================================ Discovery (Device) ------------------ on: /device/who respond: /registered @class @IP @port @inputs @outputs controller: /device/registered /tstick/1 @inputs 1 @outputs 52 @class /tstick @IP 192.168.0.3 @port 8001 synth: /device/registered /granul8/1 @inputs 80 @outputs 0 @class /granul8 @IP 192.168.0.4 @port 8000 Device Connections (Router) --------------------------- on: /link /tstick/1 /granul8/1 respond: /linked /tstick/1 /granul8/1 on: /unlink /tstick/1 /granul8/1 respond: /unlinked /tstick/1 /granul8/1 Signal Connections (Router) --------------------------- on: /connect /tstick/1/raw/pressure/1 /granul8/1/gain @scaling expression @expression x*10 @clipping minimum 0 respond: /connected /tstick/1/raw/pressure/1 /granul8/1/gain example: /properties /tstick/1/raw/pressure/1 /granul8/1/gain @scaling expression example: /properties /tstick/1/raw/pressure/1 /granul8/1/gain @expression x*10 example: /properties /tstick/1/raw/pressure/1 /granul8/1/gain @clipping minimum 0 on: /disconnect /tstick/1/raw/pressure/1 /granul8/1/gain respond: /disconnected /tstick/1/raw/pressure/1 /granul8/1/gain Connection Properties (Router) ------------------------------ on: /connection/properties/get /tstick/1/raw/pressure/1 /granul8/1/gain on: /connection/modify /tstick/1/raw/pressure/1 /granul8/1/gain respond: /connection/properties /tstick/1/raw/pressure/1 /granul8/1/gain <@scaling...> Namespace (Device) ------------------ on: /tstick/namespace/get respond: /tstick/namespace/output /tstick/raw/piezo @type i @min 0 @max 255 @units na Router ------ on: /router/connections respond: /router/connected Unknown messages ---------------- /add /available /clear /cleared /connections/get /default /delete /device/logout /display /dump /filter /length /links/get /load /lookup ../namespace/numInputs ../namespace/numOutputs /prefix /probe remove/ /request /request b 1 2000 /save /view libmapper/notes/GUI-messages.txt0000644000175000017500000000135512423630127016147 0ustar tiagotiagoGUI - multicast group 224.0.1.3 port 7570 { on load: SEND: "/who" switch (received OSC) { CASE: "/registered [optional properties: @numInputs @numOutputs @IP @port @canAlias]" break CASE: "//namespace/ /.ID/ [optional properties: @type, @units, @min, @max]" break CASE: "/linked / /" break; CASE: "/unlinked / /" break; CASE: "/connected // /device2_name/ [optional properties: @scaling, @range, @expression, @clipMin, @clipMax @canAlias]" break CASE: "/disconnected // /device2_name/" break } }libmapper/notes/testspeed_results.txt0000644000175000017500000000637112423630127017502 0ustar tiagotiagoMac Book Pro Processor: 2.2 GHz Intel Core i7, Memory: 4 GB 1333 MHz DDR3, OSX 10.7.4 20120901 debug enabled, branch master best trial: 100000 messages processed in 2.272467 seconds debug disabled, branch master best trial: 100000 messages processed in 2.266428 seconds best trial: 100000 messages processed in 2.264463 seconds debug enabled, branch instances msig_update_instance best trial: 100000 messages in 2.518687 seconds best trial: 100000 messages in 2.514839 seconds best trial: 100000 messages in 2.537608 seconds msig_update best trial: 100000 messages in 2.358548 seconds best trial: 100000 messages in 2.387972 seconds best trial: 100000 messages in 2.491243 seconds debug disabled, branch instances msig_update_instance best trial: 100000 messages in 2.487252 seconds best trial: 100000 messages in 2.510718 seconds msig_update best trial: 100000 messages in 2.347747 seconds best trial: 100000 messages in 2.355204 seconds 20120908 debug disabled, branch instances msig_update_instance best trial: 100000 messages in 2.289347 seconds best trial: 100000 messages in 2.470370 seconds best trial: 100000 messages in 2.321279 seconds best trial: 100000 messages in 2.411698 seconds msig_update best trial: 100000 messages in 2.212077 seconds best trial: 100000 messages in 2.311361 seconds best trial: 100000 messages in 2.252731 seconds best trial: 100000 messages in 2.176074 seconds debug disabled, branch master best trial: 100000 messages processed in 2.275975 seconds best trial: 100000 messages processed in 2.591912 seconds 20120911 branch reserve-stack msig_update_instance best trial: 100000 messages in 2.296756 seconds best trial: 100000 messages in 2.321285 seconds msig_update best trial: 100000 messages in 2.254267 seconds best trial: 100000 messages in 2.263255 seconds msig_update (all other instances released) best trial: 100000 messages in 2.209709 seconds best trial: 100000 messages in 2.237359 seconds branch id_map-refcount msig_update_instance best trial: 100000 messages in 2.234120 seconds best trial: 100000 messages in 2.268620 seconds best trial: 100000 messages in 2.287506 seconds best trial: 100000 messages in 2.277549 seconds msig_update best trial: 100000 messages in 2.168036 seconds best trial: 100000 messages in 2.145210 seconds best trial: 100000 messages in 2.174459 seconds best trial: 100000 messages in 2.214697 seconds branch instances3: msig_update_instance best trial: 100000 messages in 2.368650 seconds best trial: 100000 messages in 2.235514 seconds best trial: 100000 messages in 2.261996 seconds msig_update best trial: 100000 messages in 2.244762 seconds best trial: 100000 messages in 2.177155 seconds best trial: 100000 messages in 2.194841 seconds branch master best trial: 100000 messages processed in 2.223340 seconds best trial: 100000 messages processed in 2.234057 secondslibmapper/notes/DOT-messages.txt0000644000175000017500000001610012423630127016143 0ustar tiagotiagoname_allocation - multicast group 224.0.1.3 port 7571 { ID = random_number SEND: "/name/request " if ((receive "/name/available ") AND ( == )) SEND: "/name/probe " else if timeout { tentative_name = class. SEND: "/name/probe " } while (got_name==0) { if ((receive "/name/registered " AND ( == )) { choose new tentative_name by changing SEND: "/name/probe " } else if timeout { my_name = tentative_name SEND: "/name/registered " got_name = 1 } } while(1) { if ((receive "/name/probe ") SEND: "/name/registered " if (==1) // become name request server for switch (received OSC) { CASE: "/name/registered ." if (==) store for reference break CASE: "/name/request " if (==) { choose an unused ordinal SEND: "/name/available . " } break } } } } port_allocation - multicast group 224.0.1.3 port 7572 { ID = random_number SEND: "/port/request " if ((receive "/port/available ") AND ( == )) SEND: "/port/probe " while (got_port==0) { if ((receive "/port/registered ") AND ( == )) { choose new tentative_port SEND: "/port/probe " } else if timeout { my_port = tentative_port SEND: "/port/registered " got_port = 1 } } while(1) { if ((receive "/port/probe ") SEND: "/port/registered " if = starting port // become port request server { switch (received OSC) { CASE: "/port/registered " store for reference break CASE: "/port/request " choose an unsused port SEND: "/port/available " break } } } } mapping administration - multicast group 224.0.1.3 port 7570 { once port and name are established SEND: "/who" when destroyed SEND: "/logout " switch (received OSC) { CASE: "/who" SEND: "/registered @numInputs @numOutputs @IP @port @canAlias @hash " break * CASE: "/registered @numInputs @numOutputs @IP @port " AND !=my_name store name, IP, and port for reference break CASE: "/my_name/info/get" SEND: "/registered @numInputs @numOutputs @IP @port @canAlias @hash " break CASE: "/my_name/namespace/get" for (parameters) SEND: "/my_name/namespace/ / @type @units @minimum @maximum " break CASE: "/my_name/namespace/input/get" for (input parameters) SEND: "/my_name/namespace/input / @type @units @minimum @maximum " break CASE: "/my_name/namespace/output/get" for (output parameters) SEND: "/my_name/namespace/output / @type @units @minimum @maximum " break * CASE: "//namespace/ break CASE: "/link / /my_name" if (not already linked) { SEND: "/link_to / /my_name @IP @port @type @min @max } CASE: "/link_to /my_name / " if (not already linked) { create network link to device SEND: "/linked /my_name /" } break CASE: "/unlink /my_name /" destroy network link to other device SEND: "/unlinked /my_name /" break * CASE: "/unlinked / break; CASE: "/unlink / /my_name" destroy feedback network link to other device SEND: "/fb/unlinked /my_name /" break CASE: "/my_name/links/get" OR "/*/links/get" for (links_to_other_devices) SEND: "/linked /my_name /" break CASE: "/connect // /my_name/ [optional properties: @scaling, @range, @expression, @clipMin, @clipMax]" if ( exists) create feedback mapping connection SEND: "/connect_to // /my_name/ @type @range " break CASE: "/connect_to /my_name/ // [optional properties: @scaling, @range, @expression, @clipMin, @clipMax @canAlias]" if ( exists) { create mapping connection SEND: "/connected /my_name/ // @scaling @range @expression @clipMin @clipMax " } break * CASE: "/connected // /my_name/ [optional properties: @scaling, @range, @expression, @clipMin, @clipMax @canAlias]" break CASE: "/disconnect /my_name/ //" destroy mapping connection SEND: "/disconnected /my_name/ //" break * CASE: "/disconnected break CASE: "/my_name/connections/get" for (connections) { SEND: "/connected /my_name/ // @scaling @range @expression @clipMin @clipMax " } break CASE: "/connection/modify /my_name/ // [connection properties]" alter mapping connection per received properties SEND: "/connected /my_name/ // @scaling @range @expression @clipMin @clipMax " break } } GUI - multicast group 224.0.1.3 port 7570 { on load: SEND: "/who" switch (received OSC) { CASE: "/registered @numInputs @numOutputs @IP @port " AND !=my_name store name, IP, and port for reference break CASE: "//namespace/ /.ID/ [optional properties: @type, @units, @min, @max]" break CASE: "/linked / break; CASE: "/unlinked / break; CASE: "/connected // /my_name/ [optional properties: @scaling, @range, @expression, @clipMin, @clipMax @canAlias]" break CASE: "/disconnected break } }libmapper/notes/behaviour.txt0000644000175000017500000001002212423630127015671 0ustar tiagotiago device: root_name (string) name (string) = $root_name/$(unique name) class (string) numInputs (integer) = $(length inputs) numOutputs (integer) = $(length outputs) inputs (signal list) outputs (signal list) signal: name (string) type (type_id) minimum (value $units) maximum (value $units) units (unit_id) unit_id: na normalized = (range 0 1) degrees = (range 0 360) radians = (range 0 pi*2) = degrees*pi/180 volts = voltage ohms amps = amperes decimeters = dm = meters/10 centimeters = cm = meters/100 millimeters = mm = meters/1000 meters inches feet = 12*inches type_id: f i array = type_id[integer] on /$name/namespace/get <- send ( (map (/$name/namespace/input /$name/$signal <@type $type> <@min $min> <@max $max> <@units $units>) inputs) : (map (/$name/namespace/output /$name/$signal <@type $type> <@min $min> <@max $max> <@units $units>) outputs) ) on /link <$name1> <$name2> <- send /linked <$name1> <$name2> on /unlink <$name1> <$name2> <- send /unlinked <$name1> <$name2> NOTE: certain values of some properties can imply that other properties must be known property: expression = $exp scaling = 'expression' -> required expression clipping 'minimum' $operation clipping 'maximum' $operation on /connect <$in> <$out> [property list] <- send /connected <$in> <$out> dot.admin ========= admin bus --------- multicast_send group 224.0.1.3 port 7570 multicast_recv group 224.0.1.3 port 7570 devices ------- route /who /registered /registered -> store in local coll /who -> answer if name and port are allocated answer /who -> /registered @class @IP @port @inputs @outputs where is / loadbang -> random wait ((rand 1000) + 500) -> del 4000 random wait -> dot.namealloc group 224.0.1.3 port 7571 -> dot.portalloc group 224.0.1.3 port 7572 starting at 4000 -> get local IP address based on chosen local NIC link-unlink ----------- route /link /unlink /connect /disconnect /connection/modify /connection/properties/get /disconnected /connected /link, /unlink, /disconnected, /connected -> #0-from_admin /connect -> link & connect -> delays /connect by 300 ms, sends /link for known devices (in #0-device_coll) -> #0-from_admin /disconnect -> squeuedlim 50 -> #0-from_admin /connection/modify -> /modify -> #0-from_admin /connection/properties/get -> /properties/get -> #0-from_admin local input ----------- #0-from_admin -> link-unlink -> thispatcher, mappingcoll link-unlink: route /link /unlink /links/get /link -> store in #0-linked, create dot.router -> thispatcher /unlink -> remove from #0-linked, delete dot.route -> thispatcher /links/get -> dump #0-linked -> #0-to_admin mappingcoll: route /connections/get /clear /load /save /view /length /disconnect /connect /modify /properties/default /properties/get /lookup /connections/get -> dump #0-mapped -> /connected -> #0-to_admin ;; note: do load, save, view only apply to mapper GUI? /clear -> clear #0-mapped, /cleared -> #0-to_admin /load -> read #0-mapped /save -> write #0-mapped /view -> open #0-mapped /length -> length #0-mapped -> ? /disconnect -> remove from #0-mapped -> /disconnected -> #0-to_admin /connect -> add to #0-mapped -> /connected -> #0-to_admin /modify -> set property value -> if master_mode -> /connection/properties /properties/default -> ? /properties/get -> /connection/properties properties are: @clipMax, @clipMin, @repetition, @expression, @range, @scaling /lookup -> route /source /destination /index -> dump source, destination, index from #0-mapped -> ? device definition ----------------- #0-from_admin -> route /namespace/get /namespace/get -> ../namespace/numInputs, ../namespace/numOutputs, dump #0-inputNamespace -> /input, dump #0-outputNamespace -> /output from user -> route add input, add output, add both -> store #0-inputNamespace, store #0-outputNamespace libmapper/notes/c_interface.txt0000644000175000017500000000235712423630127016163 0ustar tiagotiago The realistic plan is to create a C mapper library, with SWIG bindings for Python, Scheme, Java, etc. How would a C application deal with the mapper. Controller: Have a collection of output signals, so the application can broadcast these to a router, and the mapper library will handle announcing the namespace on the admin bus. Router: The router is a middle layer residing controller-side, accepting signals from the controller but transforming them with mapping definitions before transmitting on the network. Synthesizers: Have a collection of input signals, so the application can specify what happens when a new signal value is acquired. A common API to register "signals", consisting of either a function interface, or for convenience a pointer-to-value interface. Provide a non-blocking update routine that must be called regularly. A signal value can be updated by a function call. Signals can consist of floats, ints, bools, or arrays of these. Each signal has a name, an optional unit, and optional value range. A device must be registered with a name---this will not block, but setting the name triggers port/name allocation on the admin bus. A flag is set when the name and port have been specified, an optional callback can be provided. libmapper/notes/roadmap.txt0000644000175000017500000000677112423630127015350 0ustar tiagotiago% Roadmap for libmapper This document contains information on what remains to be accomplished in the library, and what features might be added in the future. Current Status ============== The current status is summarized here: * Name/port allocation works. Allocation speedup works. * A device and signal API is established, allowing polling of the network, responding to incoming signal values, and updating registered output signals. * Network routing (called Links) and Mappings (called Connections can be established, and all required signal conditioning functions have been implemented, including support for vectors, conditionals. * A device is able to also monitor the network and store information about other devices, signals, links, and mappings, and this information can be queried. * MaxMSP and puredata external objects working. * Python bindings working. * Java bindings working for end-device functionality. * Signal queries and reverse-mode connections for implicit mappers working * Demos working on Linux, OSX, Windows * Instances working Tasks To Do =========== The following tasks currently need to be accomplished: * Create example program for interfacing with Wiimote, HID? Try to do this through pd objects with libmapper external. Kinect? (Joe) * Include some Max/MSP standalone versions of controllers, Granul8, etc? (Joe) * Add saving/loading of json mapping files * webmapper GUI needs CSS work, saving/loading * Documentation, tutorials. * External API. (Steve) * How to create a signal-combining device? * Videos. * Connect slider * Wiimote library * Kinect OpenFrameworks * maxmsp * puredata * using expressions * Explicitly state known deficiencies * No many-to-one mapping * No stored curves or tables Lower priority tasks ==================== * finish timetag integration - delays, destination interpolation, timetag manipulation, timed filters. (In progress) * Java bindings for monitor functionality. (In progress) * Ensure correct action is taken (if any) when signals are registered and unregistered, or devices disappear and reappear. (Depends on namespace hashing, save for later.) * Implement OSC aliasing for more efficient signal connections. * Look into usage on embedded platforms. (Works on gumstix!) * In support of the previous point, implement the proposal for pre-defined expressions ("fixed" processing type). * Consider using a back-end such as SQLite for database searching. (May be more efficient for supporting large networks.) * Check for disallowed OSC characters. Security testing. * Add default MAX_CONNECTIONS, MAX_SIGNALS * TCP transport (In progress) * Shared memory * Many-to-one mapping External tasks ============== There are some tasks which address uses of the library/protocol rather than being tasks for the library development itself. * Development of SuperCollider usage, either using library or reimplemented in SC to some extent. * Modify some of the FAUST architectures (e.g., Jack) to automatically create a libmapper interface for input and output signals. * Wrap all STK instruments as mapper-compatible synths. Future developments =================== Ideas that we consider to have potential but are not being considered for current work. * Audio-rate signal connections via Jack, SoundFlower, etc. * Interpolation for filtering of sporadic signals * Many-to-one mapping. * Add documentation and icon URLs to device properties. Add to GUI. libmapper/config.guess0000755000175000017500000012355012423630127014347 0ustar tiagotiago#! /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: libmapper/AUTHORS0000644000175000017500000000051412423630127013071 0ustar tiagotiago Principle authors: * Stephen Sinclair * Joseph Malloch Contributions: * Jérome Nika * Vijay Rudraraju * Gautam Bhattacharya * fundamental libmapper/COPYING0000644000175000017500000006350212423630127013062 0ustar tiagotiago GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libmapper/README0000777000175000017500000000000012423630127015377 2README.markdownustar tiagotiagolibmapper/src/0000755000175000017500000000000012423630127012610 5ustar tiagotiagolibmapper/src/expression.c0000644000175000017500000031111612423630127015156 0ustar tiagotiago#include #include #include #include #include #include "mapper_internal.h" #define MAX_HISTORY -100 #define STACK_SIZE 128 #define VAR_SIZE 8 #ifdef DEBUG #define TRACING 0 /* Set non-zero to see trace during parse & eval. */ #else #define TRACING 0 #endif #define lex_error trace #define parse_error trace typedef union _mapper_signal_value { float f; double d; int i32; } mapper_signal_value_t, mval; static int mini(int x, int y) { if (y < x) return y; else return x; } static float minf(float x, float y) { if (y < x) return y; else return x; } static double mind(double x, double y) { if (y < x) return y; else return x; } static int maxi(int x, int y) { if (y > x) return y; else return x; } static float maxf(float x, float y) { if (y > x) return y; else return x; } static double maxd(double x, double y) { if (y > x) return y; else return x; } static float pif() { return M_PI; } static double pid() { return M_PI; } static float ef() { return M_E; } static double ed() { return M_E; } static float midiToHzf(float x) { return 440. * pow(2.0, (x - 69) / 12.0); } static double midiToHzd(double x) { return 440. * pow(2.0, (x - 69) / 12.0); } static float hzToMidif(float x) { return 69. + 12. * log2(x / 440.); } static double hzToMidid(double x) { return 69. + 12. * log2(x / 440.); } static float uniformf(float x) { return rand() / (RAND_MAX + 1.0) * x; } static double uniformd(double x) { return rand() / (RAND_MAX + 1.0) * x; } static int alli(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].i32 == 0) { return 0; } } return 1; } static int allf(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].f == 0) { return 0; } } return 1; } static int alld(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].d == 0) { return 0; } } return 1; } static int anyi(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].i32 != 0) { return 1; } } return 0; } static float anyf(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].f != 0.f) { return 1; } } return 0; } static double anyd(mapper_signal_value_t *val, int length) { int i; for (i = 0; i < length; i++) { if (val[i].d != 0.) { return 1; } } return 0; } static int sumi(mapper_signal_value_t *val, int length) { int i, aggregate = 0; for (i = 0; i < length; i++) { aggregate += val[i].i32; } return aggregate; } static float sumf(mapper_signal_value_t *val, int length) { int i; float aggregate = 0.f; for (i = 0; i < length; i++) { aggregate += val[i].f; } return aggregate; } static double sumd(mapper_signal_value_t *val, int length) { int i; double aggregate = 0.; for (i = 0; i < length; i++) { aggregate += val[i].d; } return aggregate; } static float meanf(mapper_signal_value_t *val, int length) { return sumf(val, length) / (float)length; } static double meand(mapper_signal_value_t *val, int length) { return sumd(val, length) / (double)length; } static int vmaxi(mapper_signal_value_t *val, int length) { int i, max = val[0].i32; for (i = 1; i < length; i++) { if (val[i].i32 > max) max = val[i].i32; } return max; } static float vmaxf(mapper_signal_value_t *val, int length) { int i; float max = val[0].f; for (i = 1; i < length; i++) { if (val[i].f > max) max = val[i].f; } return max; } static double vmaxd(mapper_signal_value_t *val, int length) { int i; double max = val[0].d; for (i = 1; i < length; i++) { if (val[i].d > max) max = val[i].d; } return max; } static int vmini(mapper_signal_value_t *val, int length) { int i, min = val[0].i32; for (i = 1; i < length; i++) { if (val[i].i32 < min) min = val[i].i32; } return min; } static float vminf(mapper_signal_value_t *val, int length) { int i; float min = val[0].f; for (i = 1; i < length; i++) { if (val[i].f < min) min = val[i].f; } return min; } static double vmind(mapper_signal_value_t *val, int length) { int i; double min = val[0].d; for (i = 1; i < length; i++) { if (val[i].d < min) min = val[i].d; } return min; } typedef enum { VAR_UNKNOWN=-1, VAR_X=0, VAR_Y, N_VARS } expr_var_t; const char *var_strings[] = { "x", "y", }; typedef enum { FUNC_UNKNOWN=-1, FUNC_ABS=0, FUNC_ACOS, FUNC_ACOSH, FUNC_ASIN, FUNC_ASINH, FUNC_ATAN, FUNC_ATAN2, FUNC_ATANH, FUNC_CBRT, FUNC_CEIL, FUNC_COS, FUNC_COSH, FUNC_E, FUNC_EXP, FUNC_EXP2, FUNC_FLOOR, FUNC_HYPOT, FUNC_HZTOMIDI, FUNC_LOG, FUNC_LOG10, FUNC_LOG2, FUNC_LOGB, FUNC_MAX, FUNC_MIDITOHZ, FUNC_MIN, FUNC_PI, FUNC_POW, FUNC_ROUND, FUNC_SIN, FUNC_SINH, FUNC_SQRT, FUNC_TAN, FUNC_TANH, FUNC_TRUNC, /* place functions which should never be precomputed below this point */ FUNC_UNIFORM, N_FUNCS } expr_func_t; static struct { const char *name; unsigned int arity; void *func_int32; void *func_float; void *func_double; } function_table[] = { { "abs", 1, abs, fabsf, fabs }, { "acos", 1, 0, acosf, acos }, { "acosh", 1, 0, acoshf, acosh }, { "asin", 1, 0, asinf, asin }, { "asinh", 1, 0, asinhf, asinh }, { "atan", 1, 0, atanf, atan }, { "atan2", 2, 0, atan2f, atan2 }, { "atanh", 1, 0, atanhf, atanh }, { "cbrt", 1, 0, cbrtf, cbrt }, { "ceil", 1, 0, ceilf, ceil }, { "cos", 1, 0, cosf, cos }, { "cosh", 1, 0, coshf, cosh }, { "e", 0, 0, ef, ed }, { "exp", 1, 0, expf, exp }, { "exp2", 1, 0, exp2f, exp2 }, { "floor", 1, 0, floorf, floor }, { "hypot", 2, 0, hypotf, hypot }, { "hzToMidi", 1, 0, hzToMidif, hzToMidid }, { "log", 1, 0, logf, log }, { "log10", 1, 0, log10f, log10 }, { "log2", 1, 0, log2f, log2 }, { "logb", 1, 0, logbf, logb }, { "max", 2, maxi, maxf, maxd }, { "midiToHz", 1, 0, midiToHzf, midiToHzd }, { "min", 2, mini, minf, mind }, { "pi", 0, 0, pif, pid }, { "pow", 2, 0, powf, pow }, { "round", 1, 0, roundf, round }, { "sin", 1, 0, sinf, sin }, { "sinh", 1, 0, sinhf, sinh }, { "sqrt", 1, 0, sqrtf, sqrt }, { "tan", 1, 0, tanf, tan }, { "tanh", 1, 0, tanhf, tanh }, { "trunc", 1, 0, truncf, trunc }, /* place functions which should never be precomputed below this point */ { "uniform", 1, 0, uniformf, uniformd }, }; typedef enum { VFUNC_UNKNOWN=-1, VFUNC_ALL=0, VFUNC_ANY, VFUNC_MEAN, VFUNC_SUM, VFUNC_MAX, VFUNC_MIN, N_VFUNCS } expr_vfunc_t; static struct { const char *name; unsigned int arity; void *func_int32; void *func_float; void *func_double; } vfunction_table[] = { { "all", 1, alli, allf, alld }, { "any", 1, anyi, anyf, anyd }, { "mean", 1, 0, meanf, meand }, { "sum", 1, sumi, sumf, sumd }, { "max", 1, vmaxi, vmaxf, vmaxd }, { "min", 1, vmini, vminf, vmind }, }; typedef enum { OP_LOGICAL_NOT, OP_MULTIPLY, OP_DIVIDE, OP_MODULO, OP_ADD, OP_SUBTRACT, OP_LEFT_BIT_SHIFT, OP_RIGHT_BIT_SHIFT, OP_IS_GREATER_THAN, OP_IS_GREATER_THAN_OR_EQUAL, OP_IS_LESS_THAN, OP_IS_LESS_THAN_OR_EQUAL, OP_IS_EQUAL, OP_IS_NOT_EQUAL, OP_BITWISE_AND, OP_BITWISE_XOR, OP_BITWISE_OR, OP_LOGICAL_AND, OP_LOGICAL_OR, OP_CONDITIONAL_IF_THEN, OP_CONDITIONAL_IF_ELSE, OP_CONDITIONAL_IF_THEN_ELSE, } expr_op_t; #define NONE 0x0 #define GET_ZERO 0x1 #define GET_ONE 0x2 #define GET_OPER 0x4 #define ERROR 0x8 static struct { const char *name; char arity; char precedence; uint16_t optimize_const_operands; } op_table[] = { { "!", 1, 11, GET_ONE | GET_ONE <<4 | GET_ZERO <<8 | GET_ZERO <<12 }, { "*", 2, 10, GET_ZERO | GET_ZERO <<4 | GET_OPER <<8 | GET_OPER <<12 }, { "/", 2, 10, GET_ZERO | ERROR <<4 | NONE <<8 | GET_OPER <<12 }, { "%", 2, 10, GET_ZERO | GET_OPER <<4 | GET_ONE <<8 | GET_OPER <<12 }, { "+", 2, 9, GET_OPER | GET_OPER <<4 | NONE <<8 | NONE <<12 }, { "-", 2, 9, NONE | GET_OPER <<4 | NONE <<8 | NONE <<12 }, { "<<", 2, 8, GET_ZERO | GET_OPER <<4 | NONE <<8 | NONE <<12 }, { ">>", 2, 8, GET_ZERO | GET_OPER <<4 | NONE <<8 | NONE <<12 }, { ">", 2, 7, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { ">=", 2, 7, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "<", 2, 7, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "<=", 2, 7, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "==", 2, 6, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "!=", 2, 6, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "&", 2, 5, GET_ZERO | GET_ZERO <<4 | NONE <<8 | NONE <<12 }, { "^", 2, 4, GET_OPER | GET_OPER <<4 | NONE <<8 | NONE <<12 }, { "|", 2, 3, GET_OPER | GET_OPER <<4 | GET_ONE <<8 | GET_ONE <<12 }, { "&&", 2, 2, GET_ZERO | GET_ZERO <<4 | NONE <<8 | NONE <<12 }, { "||", 2, 1, GET_OPER | GET_OPER <<4 | GET_ONE <<8 | GET_ONE <<12 }, // TODO: handle ternary operator { "IFTHEN", 2, 0, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "IFELSE", 2, 0, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, { "IFTHENELSE", 3, 0, NONE | NONE <<4 | NONE <<8 | NONE <<12 }, }; typedef int func_int32_arity0(); typedef int func_int32_arity1(int); typedef int func_int32_arity2(int,int); typedef float func_float_arity0(); typedef float func_float_arity1(float); typedef float func_float_arity2(float,float); typedef double func_double_arity0(); typedef double func_double_arity1(double); typedef double func_double_arity2(double,double); typedef int vfunc_int32_arity1(mapper_signal_value_t*, int); typedef float vfunc_float_arity1(mapper_signal_value_t*, int); typedef double vfunc_double_arity1(mapper_signal_value_t*, int); typedef struct _token { enum { TOK_CONST = 0x0001, TOK_NEGATE = 0x0002, TOK_FUNC = 0x0003, TOK_VFUNC = 0x0004, TOK_OPEN_PAREN = 0x0005, TOK_OPEN_SQUARE = 0x0010, TOK_OPEN_CURLY = 0x0020, TOK_CLOSE_PAREN = 0x0040, TOK_CLOSE_SQUARE = 0x0080, TOK_CLOSE_CURLY = 0x0100, TOK_VAR = 0x0200, TOK_OP = 0x0400, TOK_COMMA = 0x0800, TOK_COLON = 0x1000, TOK_SEMICOLON = 0x2000, TOK_ASSIGNMENT = 0x4000, TOK_VECTORIZE, TOK_END, } toktype; union { float f; int i; double d; expr_var_t var; expr_op_t op; expr_func_t func; expr_vfunc_t vfunc; }; union { char casttype; int assignment_offset; }; int vector_length; union { int vector_index; int arity; }; char history_index; char vector_length_locked; char datatype; } mapper_token_t, *mapper_token; typedef struct _variable { char *name; int vector_index; int vector_length; char datatype; char casttype; char history_size; char vector_length_locked; char assigned; } mapper_variable_t, *mapper_variable; static expr_func_t function_lookup(const char *s, int len) { int i; for (i=0; idatatype = 'i'; tok->casttype = 0; tok->vector_length = 1; tok->vector_index = 0; tok->vector_length_locked = 0; int n, i; char c = str[index]; int integer_found = 0; if (c==0) { tok->toktype = TOK_END; return index; } again: i = index; if (isdigit(c)) { do { c = str[++index]; } while (c && isdigit(c)); n = atoi(str+i); integer_found = 1; if (c!='.' && c!='e') { tok->i = n; tok->toktype = TOK_CONST; tok->datatype = 'i'; return index; } } switch (c) { case '.': c = str[++index]; if (!isdigit(c) && c!='e' && integer_found) { tok->toktype = TOK_CONST; tok->f = (float)n; tok->datatype = 'f'; return index; } if (!isdigit(c) && c!='e') break; do { c = str[++index]; } while (c && isdigit(c)); if (c!='e') { tok->f = atof(str+i); tok->toktype = TOK_CONST; tok->datatype = 'f'; return index; } case 'e': if (!integer_found) { n = index; while (c && (isalpha(c) || isdigit(c))) c = str[++index]; tok->toktype = TOK_FUNC; if ((tok->func = function_lookup(str+i, index-i)) != FUNC_UNKNOWN) { tok->toktype = TOK_FUNC; } else if ((tok->vfunc = vfunction_lookup(str+i, index-i)) != VFUNC_UNKNOWN) { tok->toktype = TOK_VFUNC; } else { tok->var = variable_lookup(str+i, index-i); tok->toktype = TOK_VAR; } return index; } c = str[++index]; if (c!='-' && c!='+' && !isdigit(c)) { lex_error("Incomplete scientific notation `%s'.\n", str+i); break; } if (c=='-' || c=='+') c = str[++index]; while (c && isdigit(c)) c = str[++index]; tok->toktype = TOK_CONST; tok->datatype = 'f'; tok->f = atof(str+i); return index; case '+': tok->toktype = TOK_OP; tok->op = OP_ADD; return ++index; case '-': // could be either subtraction or negation i = index-1; // back up one character while (i && strchr(" \t\r\n", str[i])) i--; if (isalpha(str[i]) || isdigit(str[i]) || strchr(")]}", str[i])) { tok->toktype = TOK_OP; tok->op = OP_SUBTRACT; } else { tok->toktype = TOK_NEGATE; } return ++index; case '/': tok->toktype = TOK_OP; tok->op = OP_DIVIDE; return ++index; case '*': tok->toktype = TOK_OP; tok->op = OP_MULTIPLY; return ++index; case '%': tok->toktype = TOK_OP; tok->op = OP_MODULO; return ++index; case '=': // could be '=', '==' c = str[++index]; if (c == '=') { tok->toktype = TOK_OP; tok->op = OP_IS_EQUAL; ++index; } else { tok->toktype = TOK_ASSIGNMENT; } return index; case '<': // could be '<', '<=', '<<' tok->toktype = TOK_OP; tok->op = OP_IS_LESS_THAN; c = str[++index]; if (c == '=') { tok->op = OP_IS_LESS_THAN_OR_EQUAL; ++index; } else if (c == '<') { tok->op = OP_LEFT_BIT_SHIFT; ++index; } return index; case '>': // could be '>', '>=', '>>' tok->toktype = TOK_OP; tok->op = OP_IS_GREATER_THAN; c = str[++index]; if (c == '=') { tok->op = OP_IS_GREATER_THAN_OR_EQUAL; ++index; } else if (c == '>') { tok->op = OP_RIGHT_BIT_SHIFT; ++index; } return index; case '!': // could be '!', '!=' // TODO: handle factorial case tok->toktype = TOK_OP; tok->op = OP_LOGICAL_NOT; c = str[++index]; if (c == '=') { tok->op = OP_IS_NOT_EQUAL; ++index; } return index; case '&': // could be '&', '&&' tok->toktype = TOK_OP; tok->op = OP_BITWISE_AND; c = str[++index]; if (c == '&') { tok->op = OP_LOGICAL_AND; ++index; } return index; case '|': // could be '|', '||' tok->toktype = TOK_OP; tok->op = OP_BITWISE_OR; c = str[++index]; if (c == '|') { tok->op = OP_LOGICAL_OR; ++index; } return index; case '^': // bitwise XOR tok->toktype = TOK_OP; tok->op = OP_BITWISE_XOR; return ++index; case '(': tok->toktype = TOK_OPEN_PAREN; return ++index; case ')': tok->toktype = TOK_CLOSE_PAREN; return ++index; case '[': tok->toktype = TOK_OPEN_SQUARE; return ++index; case ']': tok->toktype = TOK_CLOSE_SQUARE; return ++index; case '{': tok->toktype = TOK_OPEN_CURLY; return ++index; case '}': tok->toktype = TOK_CLOSE_CURLY; return ++index; case ' ': case '\t': case '\r': case '\n': c = str[++index]; goto again; case ',': tok->toktype = TOK_COMMA; return ++index; case '?': // conditional tok->toktype = TOK_OP; tok->op = OP_CONDITIONAL_IF_THEN; c = str[++index]; if (c == ':') { tok->op = OP_CONDITIONAL_IF_ELSE; ++index; } return index; case ':': tok->toktype = TOK_COLON; return ++index; case ';': tok->toktype = TOK_SEMICOLON; return ++index; default: if (!isalpha(c)) { lex_error("unknown character '%c' in lexer\n", c); break; } while (c && (isalpha(c) || isdigit(c))) c = str[++index]; if ((tok->func = function_lookup(str+i, index-i)) != FUNC_UNKNOWN) { tok->toktype = TOK_FUNC; } else if ((tok->vfunc = vfunction_lookup(str+i, index-i)) != VFUNC_UNKNOWN) { tok->toktype = TOK_VFUNC; } else { tok->var = variable_lookup(str+i, index-i); tok->toktype = TOK_VAR; } return index; } return 1; } struct _mapper_expr { mapper_token tokens; mapper_token start; int length; int vector_size; int input_history_size; int output_history_size; mapper_variable variables; int num_variables; int constant_output; }; void mapper_expr_free(mapper_expr expr) { int i; if (expr->tokens) free(expr->tokens); if (expr->num_variables && expr->variables) { for (i = 0; i < expr->num_variables; i++) { free(expr->variables[i].name); } free(expr->variables); } free(expr); } #ifdef DEBUG void printtoken(mapper_token_t tok) { int i; char tokstr[32]; switch (tok.toktype) { case TOK_CONST: switch (tok.datatype) { case 'f': snprintf(tokstr, 32, "%f", tok.f); break; case 'd': snprintf(tokstr, 32, "%f", tok.d); break; case 'i': snprintf(tokstr, 32, "%d", tok.i); break; } break; case TOK_OP: snprintf(tokstr, 32, "%s", op_table[tok.op].name); break; case TOK_OPEN_CURLY: snprintf(tokstr, 32, "{"); break; case TOK_OPEN_PAREN: snprintf(tokstr, 32, "("); break; case TOK_OPEN_SQUARE: snprintf(tokstr, 32, "["); break; case TOK_CLOSE_CURLY: snprintf(tokstr, 32, "}"); break; case TOK_CLOSE_PAREN: snprintf(tokstr, 32, ")"); break; case TOK_CLOSE_SQUARE: snprintf(tokstr, 32, "]"); break; case TOK_VAR: if (tok.var[%d]", var_strings[tok.var], tok.history_index, tok.assignment_offset, tok.vector_index); else snprintf(tokstr, 32, "ASSIGN_TO:var%d{%d}[%d]->[%d]", tok.var-N_VARS, tok.history_index, tok.assignment_offset, tok.vector_index); break; case TOK_END: printf("END\n"); return; default: printf("(unknown token)"); return; } printf("%s", tokstr); // indent int len = strlen(tokstr); for (i = len; i < 30; i++) { printf(" "); } printf("%c[%d]", tok.datatype, tok.vector_length); if (tok.vector_length_locked) printf("L"); if (tok.casttype) printf("->%c", tok.casttype); printf("\n"); } void printstack(const char *s, mapper_token_t *stack, int top) { int i, j, indent = 0; printf("%s ", s); if (s) indent = strlen(s) + 1; for (i=0; i<=top; i++) { if (i != 0) { for (j=0; jtokens, e->length-1); } #endif static char compare_token_datatype(mapper_token_t tok, char type) { // return the higher datatype if (tok.datatype == 'd' || type == 'd') return 'd'; else if (tok.datatype == 'f' || type == 'f') return 'f'; else return 'i'; } static char promote_token_datatype(mapper_token_t *tok, char type) { tok->casttype = 0; if (tok->datatype == type) return type; if (tok->toktype == TOK_ASSIGNMENT) { if (tok->var < N_VARS) { // typecasting is not possible return tok->datatype; } else { // user-defined variable, can typecast tok->casttype = type; return type; } } if (tok->toktype == TOK_CONST) { // constants can be cast immediately if (tok->datatype == 'i') { if (type == 'f') { tok->f = (float)tok->i; tok->datatype = type; } else if (type == 'd') { tok->d = (double)tok->i; tok->datatype = type; } } else if (tok->datatype == 'f') { if (type == 'd') { tok->d = (double)tok->f; tok->datatype = type; } else if (type == 'i') { tok->casttype = type; } } else { tok->casttype = type; } return type; } else if (tok->toktype == TOK_VAR) { // we need to cast at runtime tok->casttype = type; return type; } else { if (tok->datatype == 'i' || type == 'd') { tok->datatype = type; return type; } else { tok->casttype = type; return tok->datatype; } } return type; } static void lock_vector_lengths(mapper_token_t *stack, int top) { int i=top, arity=1; while ((i >= 0) && arity--) { stack[i].vector_length_locked = 1; if (stack[i].toktype == TOK_OP) arity += op_table[stack[i].op].arity; else if (stack[i].toktype == TOK_FUNC) arity += function_table[stack[i].func].arity; else if (stack[i].toktype == TOK_VECTORIZE) arity += stack[i].arity; i--; } } static int precompute(mapper_token_t *stack, int length, int vector_length) { struct _mapper_expr e; e.start = stack; e.length = length; e.vector_size = vector_length; e.variables = 0; e.num_variables = 0; mapper_signal_history_t h; // TODO: this variable should not be mapper_signal_value_t? mapper_signal_value_t v; h.type = stack[length-1].datatype; h.value = &v; h.position = -1; h.length = 1; h.size = 1; if (!mapper_expr_evaluate(&e, 0, 0, &h, 0)) return 0; switch (stack[length-1].datatype) { case 'f': stack[0].f = v.f; break; case 'd': stack[0].d = v.d; break; case 'i': stack[0].i = v.i32; break; default: return 0; break; } stack[0].toktype = TOK_CONST; stack[0].datatype = stack[length-1].datatype; return length-1; } static int check_types_and_lengths(mapper_token_t *stack, int top) { // TODO: allow precomputation of const-only vectors int i, arity, can_precompute = 1, optimize = NONE; char type = stack[top].datatype; int vector_length = stack[top].vector_length; switch (stack[top].toktype) { case TOK_OP: arity = op_table[stack[top].op].arity; break; case TOK_FUNC: arity = function_table[stack[top].func].arity; if (stack[top].func >= FUNC_UNIFORM) can_precompute = 0; break; case TOK_VFUNC: arity = vfunction_table[stack[top].func].arity; break; case TOK_VECTORIZE: arity = stack[top].arity; can_precompute = 0; break; case TOK_ASSIGNMENT: arity = 1; can_precompute = 0; break; default: return top; } if (arity) { // find operator or function inputs i = top; int skip = 0; int depth = arity; int operand; // last arg of op or func is at top-1 type = compare_token_datatype(stack[top-1], type); if (stack[top-1].vector_length > vector_length) vector_length = stack[top-1].vector_length; /* Walk down stack distance of arity, checking datatypes * and vector lengths. */ while (--i >= 0) { if (stack[i].toktype == TOK_FUNC && function_table[stack[i].func].arity) can_precompute = 0; else if (stack[i].toktype != TOK_CONST) can_precompute = 0; if (skip == 0) { if (stack[i].toktype == TOK_CONST && stack[top].toktype == TOK_OP && depth <= op_table[stack[top].op].arity) { if (const_tok_is_zero(stack[i])) { // mask and bitshift, depth == 1 or 2 optimize = (op_table[stack[top].op].optimize_const_operands >>(depth-1)*4) & 0xF; } else if (const_tok_is_one(stack[i])) { optimize = (op_table[stack[top].op].optimize_const_operands >>(depth+1)*4) & 0xF; } if (optimize == GET_OPER) { if (i == top-1) { // optimize immediately without moving other operand return top-2; } else { // store position of non-zero operand operand = top-1; } } } type = compare_token_datatype(stack[i], type); if (stack[i].toktype == TOK_VFUNC) stack[i].vector_length = vector_length; else if (stack[i].vector_length > vector_length) vector_length = stack[i].vector_length; depth--; if (depth == 0) break; } else skip--; if (stack[i].toktype == TOK_OP) skip += op_table[stack[i].op].arity; else if (stack[i].toktype == TOK_FUNC) skip += function_table[stack[i].func].arity; else if (stack[i].toktype == TOK_VFUNC) skip += vfunction_table[stack[i].func].arity; else if (stack[i].toktype == TOK_VECTORIZE) skip += stack[i].arity; } if (depth) return -1; if (!can_precompute) { switch (optimize) { case ERROR: { parse_error("Operator '%s' cannot have zero operand.\n", op_table[stack[top].op].name); return -1; } case GET_ZERO: case GET_ONE: { // finish walking down compound arity int _arity = 0; while ((_arity += tok_arity(stack[i])) && i >= 0) { _arity--; i--; } stack[i].toktype = TOK_CONST; stack[i].datatype = 'i'; stack[i].i = optimize == GET_ZERO ? 0 : 1; stack[i].vector_length = vector_length; stack[i].vector_length_locked = 0; stack[i].casttype = 0; return i; } case GET_OPER: // copy tokens for non-zero operand for (; i < operand; i++) { // shunt tokens down stack memcpy(stack+i, stack+i+1, sizeof(mapper_token_t)); } // we may need to promote vector length, so do not return yet top = operand-1; default: break; } } /* walk down stack distance of arity again, promoting datatypes * and vector lengths */ i = top; if (stack[top].toktype == TOK_VECTORIZE) { skip = stack[top].arity; depth = 0; } else if (stack[top].toktype == TOK_VFUNC) { skip = 1; depth = 0; } else { skip = 0; depth = arity; } type = promote_token_datatype(&stack[i], type); while (--i >= 0) { // we will promote types within range of compound arity type = promote_token_datatype(&stack[i], type); if (skip <= 0) { // also check/promote vector length if (!stack[i].vector_length_locked) { if (stack[i].toktype == TOK_VFUNC) { if (stack[i].vector_length != vector_length) { parse_error("Vector length mismatch (%d != %d).\n", stack[i].vector_length, vector_length); return -1; } } else stack[i].vector_length = vector_length; } else if (stack[i].vector_length != vector_length) { parse_error("Vector length mismatch (%d != %d).\n", stack[i].vector_length, vector_length); return -1; } } if (stack[i].toktype == TOK_OP) { if (skip > 0) skip += op_table[stack[i].op].arity; else depth += op_table[stack[i].op].arity; } else if (stack[i].toktype == TOK_FUNC) { if (skip > 0) skip += function_table[stack[i].func].arity; else depth += function_table[stack[i].func].arity; } else if (stack[i].toktype == TOK_VFUNC) skip = 2; else if (stack[i].toktype == TOK_VECTORIZE) skip = stack[i].arity + 1; if (skip > 0) skip--; else depth--; if (depth <= 0 && skip <= 0) break; } if (!stack[top].vector_length_locked) { if (stack[top].toktype != TOK_VFUNC) stack[top].vector_length = vector_length; } else if (stack[top].vector_length != vector_length) { parse_error("Vector length mismatch (%d != %d).\n", stack[top].vector_length, vector_length); return -1; } } else { stack[top].datatype = 'f'; } // if stack within bounds of arity was only constants, we're ok to compute if (can_precompute) return top - precompute(&stack[top-arity], arity+1, vector_length); else return top; } static int check_assignment_types_and_lengths(mapper_token_t *stack, int top) { int i = top, vector_length = 0; expr_var_t var = stack[top].var; while (i >= 0 && stack[i].toktype == TOK_ASSIGNMENT) { if (stack[i].var != var) { parse_error("Cannot mix variable references in assignment\n"); return -1; } vector_length += stack[i].vector_length; i--; } if (i < 0) { parse_error("Malformed expression (1)."); return -1; } if (stack[i].vector_length != vector_length) { parse_error("Vector length mismatch (%d != %d).\n", stack[i].vector_length, vector_length); return -1; } promote_token_datatype(&stack[i], stack[top].datatype); if (check_types_and_lengths(stack, i) == -1) return -1; promote_token_datatype(&stack[i], stack[top].datatype); if (stack[top].history_index == 0 || i == 0) return 0; // Move assignment expression to beginning of stack int j = 0, expr_length = top-i+1; if (stack[i].toktype == TOK_VECTORIZE) expr_length += stack[i].arity; mapper_token_t temp[expr_length]; for (i = top-expr_length+1; i <= top; i++) memcpy(&temp[j++], &stack[i], sizeof(mapper_token_t)); for (i = top-expr_length; i >= 0; i--) memcpy(&stack[i+expr_length], &stack[i], sizeof(mapper_token_t)); for (i = 0; i < expr_length; i++) memcpy(&stack[i], &temp[i], sizeof(mapper_token_t)); return 0; } /* Macros to help express stack operations in parser. */ #define FAIL(msg) { \ parse_error("%s\n", msg); \ while (--num_variables >= 0) \ free(variables[num_variables].name); \ return 0; \ } #define PUSH_TO_OUTPUT(x) \ { \ if (++outstack_index >= STACK_SIZE) \ {FAIL("Stack size exceeded.");} \ memcpy(outstack + outstack_index, &x, sizeof(mapper_token_t)); \ } #define PUSH_TO_OPERATOR(x) \ { \ if (++opstack_index >= STACK_SIZE) \ {FAIL("Stack size exceeded.");} \ memcpy(opstack + opstack_index, &x, sizeof(mapper_token_t)); \ } #define POP_OPERATOR() ( opstack_index-- ) #define POP_OPERATOR_TO_OUTPUT() \ { \ PUSH_TO_OUTPUT(opstack[opstack_index]); \ outstack_index = check_types_and_lengths(outstack, \ outstack_index); \ if (outstack_index < 0) \ {FAIL("Malformed expression (2).");} \ POP_OPERATOR(); \ } #define GET_NEXT_TOKEN(x) \ { \ lex_index = expr_lex(str, lex_index, &x); \ if (!lex_index) \ {FAIL("Error in lexer.");} \ } /*! Use Dijkstra's shunting-yard algorithm to parse expression into RPN stack. */ mapper_expr mapper_expr_new_from_string(const char *str, char input_type, char output_type, int input_vector_size, int output_vector_size) { if (!str) return 0; if (input_type != 'i' && input_type != 'f' && input_type != 'd') return 0; if (output_type != 'i' && output_type != 'f' && output_type != 'd') return 0; mapper_token_t outstack[STACK_SIZE]; mapper_token_t opstack[STACK_SIZE]; int i, lex_index = 0, outstack_index = -1, opstack_index = -1; int oldest_input = 0, oldest_output = 0, max_vector = 1; int assigning = 0; int output_assigned = 0; int vectorizing = 0; int variable = 0; int allow_toktype = 0xFFFF; int constant_output = 1; mapper_variable_t variables[VAR_SIZE]; int num_variables = 0; int assign_mask = TOK_VAR | TOK_OPEN_SQUARE | TOK_COMMA | TOK_CLOSE_SQUARE; int OBJECT_TOKENS = (TOK_VAR | TOK_CONST | TOK_FUNC | TOK_VFUNC | TOK_NEGATE | TOK_OPEN_PAREN | TOK_OPEN_SQUARE); mapper_token_t tok; // all expressions must start with assignment e.g. "y=" (ignoring spaces) while (str[lex_index] == ' ') lex_index++; if (!str[lex_index]) {FAIL("No expression found.");} assigning = 1; allow_toktype = TOK_VAR | TOK_OPEN_SQUARE; while (str[lex_index]) { GET_NEXT_TOKEN(tok); if (variable && tok.toktype != TOK_OPEN_SQUARE && tok.toktype != TOK_OPEN_CURLY) variable = 0; if (!((tok.toktype & allow_toktype & (assigning ? assign_mask : 0xFFFF)) | (assigning ? TOK_ASSIGNMENT : 0))) { {FAIL("Illegal token sequence.");} } switch (tok.toktype) { case TOK_CONST: // push to output stack PUSH_TO_OUTPUT(tok); allow_toktype = (TOK_OP | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE | TOK_COMMA | TOK_COLON | TOK_SEMICOLON); break; case TOK_VAR: // set datatype if (tok.var == VAR_X) { tok.datatype = input_type; tok.vector_length = input_vector_size; tok.vector_length_locked = 1; constant_output = 0; } else if (tok.var == VAR_Y) { tok.datatype = output_type; tok.vector_length = output_vector_size; tok.vector_length_locked = 1; } else { // get name of variable int index = lex_index-1; char c = str[index]; while (index >= 0 && c && (isalpha(c) || isdigit(c))) { if (--index >= 0) c = str[index]; } // check if variable name matches known variable int i; for (i = 0; i < num_variables; i++) { if (strncmp(variables[i].name, str+index+1, lex_index-index-1)==0) { tok.var = i + N_VARS; tok.datatype = variables[i].datatype; tok.vector_length = variables[i].vector_length; break; } } if (i == num_variables) { if (num_variables >= VAR_SIZE) {FAIL("Maximum number of variables exceeded.");} // need to store new variable variables[num_variables].name = malloc(lex_index-index); snprintf(variables[num_variables].name, lex_index-index, "%s", str+index+1); variables[num_variables].datatype = 'd'; variables[num_variables].vector_length = 1; variables[num_variables].history_size = 1; variables[num_variables].assigned = 0; #if TRACING printf("Stored new variable '%s' at index %i\n", variables[num_variables].name, num_variables); #endif tok.var = num_variables + N_VARS; tok.datatype = 'd'; num_variables++; } } tok.history_index = 0; tok.vector_index = 0; PUSH_TO_OUTPUT(tok); // variables can have vector and history indices variable = TOK_OPEN_SQUARE | TOK_OPEN_CURLY; allow_toktype = (TOK_OP | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE | TOK_COMMA | TOK_COLON | TOK_SEMICOLON | variable | (assigning ? TOK_ASSIGNMENT : 0)); break; case TOK_FUNC: if (function_table[tok.func].func_int32) tok.datatype = 'i'; else tok.datatype = 'f'; PUSH_TO_OPERATOR(tok); if (!function_table[tok.func].arity) { POP_OPERATOR_TO_OUTPUT(); } if (function_table[tok.func].arity) allow_toktype = TOK_OPEN_PAREN; else allow_toktype = (TOK_OP | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE | TOK_COMMA | TOK_COLON | TOK_SEMICOLON); if (tok.func >= FUNC_UNIFORM) constant_output = 0; break; case TOK_VFUNC: if (vfunction_table[tok.func].func_int32) tok.datatype = 'i'; else tok.datatype = 'f'; PUSH_TO_OPERATOR(tok); allow_toktype = TOK_OPEN_PAREN; break; case TOK_OPEN_PAREN: tok.arity = 1; PUSH_TO_OPERATOR(tok); allow_toktype = OBJECT_TOKENS; break; case TOK_CLOSE_PAREN: // pop from operator stack to output until left parenthesis found while (opstack_index >= 0 && opstack[opstack_index].toktype != TOK_OPEN_PAREN) { POP_OPERATOR_TO_OUTPUT(); } if (opstack_index < 0) {FAIL("Unmatched parentheses or misplaced comma.");} int arity = opstack[opstack_index].arity; // remove left parenthesis from operator stack POP_OPERATOR(); // if stack[top] is tok_func or tok_vfunc, pop to output if (opstack[opstack_index].toktype == TOK_FUNC) { // check for overloaded functions if (arity == 1) { if (opstack[opstack_index].func == FUNC_MIN) { opstack[opstack_index].toktype = TOK_VFUNC; opstack[opstack_index].vfunc = VFUNC_MIN; } else if (opstack[opstack_index].func == FUNC_MAX) { opstack[opstack_index].toktype = TOK_VFUNC; opstack[opstack_index].vfunc = VFUNC_MAX; } } POP_OPERATOR_TO_OUTPUT(); } else if (opstack[opstack_index].toktype == TOK_VFUNC) POP_OPERATOR_TO_OUTPUT(); allow_toktype = (TOK_OP | TOK_COLON | TOK_SEMICOLON | TOK_COMMA | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE); break; case TOK_COMMA: // pop from operator stack to output until left parenthesis or TOK_VECTORIZE found while (opstack_index >= 0 && opstack[opstack_index].toktype != TOK_OPEN_PAREN && opstack[opstack_index].toktype != TOK_VECTORIZE) { POP_OPERATOR_TO_OUTPUT(); } if (opstack_index < 0) { {FAIL("Malformed expression (3).");} break; } if (opstack[opstack_index].toktype == TOK_VECTORIZE) { opstack[opstack_index].vector_index++; opstack[opstack_index].vector_length += outstack[outstack_index].vector_length; lock_vector_lengths(outstack, outstack_index); } else { // open paren opstack[opstack_index].arity++; } allow_toktype = OBJECT_TOKENS; break; case TOK_COLON: // pop from operator stack to output until conditional found while (opstack_index >= 0 && (opstack[opstack_index].toktype != TOK_OP || opstack[opstack_index].op != OP_CONDITIONAL_IF_THEN)) { POP_OPERATOR_TO_OUTPUT(); } if (opstack_index < 0) {FAIL("Unmatched colon.");} opstack[opstack_index].op = OP_CONDITIONAL_IF_THEN_ELSE; allow_toktype = OBJECT_TOKENS; break; case TOK_SEMICOLON: while (opstack_index >= 0) { POP_OPERATOR_TO_OUTPUT(); } if (opstack_index > 0) {FAIL("Malformed expression (4).");} // check if last expression was assigned correcty if (outstack[outstack_index].toktype != TOK_ASSIGNMENT) {FAIL("Malformed expression (5).");} if (check_assignment_types_and_lengths(outstack, outstack_index) == -1) {FAIL("Malformed expression (6).");} // start another sub-expression assigning = 1; allow_toktype = TOK_VAR; break; case TOK_OP: // check precedence of operators on stack while (opstack_index >= 0 && opstack[opstack_index].toktype == TOK_OP && op_table[opstack[opstack_index].op].precedence >= op_table[tok.op].precedence) { /* If operands are constants, we will pop operators of equal * precendence to the output stack to allow precomputation, * otherwise only pop operators with greater precedence. * This results in a more efficient representation. */ int i, consts_only = 1; for (i = 0; i < op_table[opstack[opstack_index].op].arity; i++) { if (outstack[outstack_index-i].toktype != TOK_CONST) consts_only = 0; } if (!consts_only && op_table[opstack[opstack_index].op].precedence == op_table[tok.op].precedence) break; POP_OPERATOR_TO_OUTPUT(); } PUSH_TO_OPERATOR(tok); allow_toktype = OBJECT_TOKENS; break; case TOK_OPEN_SQUARE: if (variable & TOK_OPEN_SQUARE) { // vector index not set GET_NEXT_TOKEN(tok); if (tok.toktype != TOK_CONST || tok.datatype != 'i') {FAIL("Non-integer vector index.");} if (outstack[outstack_index].var < VAR_Y) { if (tok.i >= input_vector_size) {FAIL("Index exceeds input vector length.");} } else if (tok.i >= output_vector_size) {FAIL("Index exceeds output vector length.");} outstack[outstack_index].vector_index = tok.i; outstack[outstack_index].vector_length = 1; outstack[outstack_index].vector_length_locked = 1; GET_NEXT_TOKEN(tok); if (tok.toktype == TOK_COLON) { // index is range A:B GET_NEXT_TOKEN(tok); if (tok.toktype != TOK_CONST || tok.datatype != 'i') {FAIL("Malformed vector index.");} if (outstack[outstack_index].var < VAR_Y) { if (tok.i >= input_vector_size) {FAIL("Index exceeds vector length.");} } else if (tok.i >= output_vector_size) {FAIL("Index exceeds vector length.");} if (tok.i <= outstack[outstack_index].vector_index) {FAIL("Malformed vector index.");} outstack[outstack_index].vector_length = tok.i - outstack[outstack_index].vector_index + 1; GET_NEXT_TOKEN(tok); } if (tok.toktype != TOK_CLOSE_SQUARE) {FAIL("Unmatched bracket.");} // vector index set variable &= ~TOK_OPEN_SQUARE; allow_toktype = (TOK_OP | TOK_COMMA | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE | TOK_COLON | TOK_SEMICOLON | variable | (assigning ? TOK_ASSIGNMENT : 0)); } else { if (vectorizing) {FAIL("Nested (multidimensional) vectors not allowed.");} tok.toktype = TOK_VECTORIZE; tok.vector_length = 0; tok.arity = 0; PUSH_TO_OPERATOR(tok); vectorizing = 1; allow_toktype = OBJECT_TOKENS & ~TOK_OPEN_SQUARE; } break; case TOK_CLOSE_SQUARE: // pop from operator stack to output until TOK_VECTORIZE found while (opstack_index >= 0 && opstack[opstack_index].toktype != TOK_VECTORIZE) { POP_OPERATOR_TO_OUTPUT(); } if (opstack_index < 0) {FAIL("Unmatched brackets or misplaced comma.");} if (opstack[opstack_index].vector_length) { opstack[opstack_index].vector_length_locked = 1; opstack[opstack_index].arity++; opstack[opstack_index].vector_length += outstack[outstack_index].vector_length; lock_vector_lengths(outstack, outstack_index); POP_OPERATOR_TO_OUTPUT(); } else { // we do not need vectorizer token if vector length == 1 POP_OPERATOR(); } vectorizing = 0; allow_toktype = (TOK_OP | TOK_CLOSE_PAREN | TOK_COMMA | TOK_COLON | TOK_SEMICOLON); break; case TOK_OPEN_CURLY: if (!(variable & TOK_OPEN_CURLY)) // history index already set {FAIL("Misplaced brace.");} GET_NEXT_TOKEN(tok); if (tok.toktype == TOK_NEGATE) { // if negative sign found, get next token outstack[outstack_index].history_index = -1; GET_NEXT_TOKEN(tok); } if (tok.toktype != TOK_CONST || tok.datatype != 'i') {FAIL("Non-integer history index.");} outstack[outstack_index].history_index *= tok.i; if (outstack[outstack_index].var == VAR_Y) { if (outstack[outstack_index].history_index > -1) {FAIL("Output history index cannot be > -1.");} else if (outstack[outstack_index].history_index < MAX_HISTORY) {FAIL("Output history index cannot be < -100.");} } else { if (outstack[outstack_index].history_index > 0) {FAIL("Input history index cannot be > 0.");} else if (outstack[outstack_index].history_index < MAX_HISTORY) {FAIL("Input history index cannot be < -100.");} } if (outstack[outstack_index].var == VAR_X && outstack[outstack_index].history_index < oldest_input) oldest_input = outstack[outstack_index].history_index; else if (outstack[outstack_index].var == VAR_Y && outstack[outstack_index].history_index < oldest_output) oldest_output = outstack[outstack_index].history_index; else if (outstack[outstack_index].var >= N_VARS) { // user-defined variable int var_idx = outstack[outstack_index].var - N_VARS; int hist_idx = outstack[outstack_index].history_index; if ((hist_idx * -1 + 1) > variables[var_idx].history_size) variables[var_idx].history_size = hist_idx * -1 + 1; } GET_NEXT_TOKEN(tok); if (tok.toktype != TOK_CLOSE_CURLY) {FAIL("Unmatched brace.");} variable &= ~TOK_OPEN_CURLY; allow_toktype = (TOK_OP | TOK_COMMA | TOK_CLOSE_PAREN | TOK_CLOSE_SQUARE | TOK_COLON | TOK_SEMICOLON | variable | (assigning ? TOK_ASSIGNMENT : 0)); break; case TOK_NEGATE: // push '-1' to output stack, and '*' to operator stack tok.toktype = TOK_CONST; tok.datatype = 'i'; tok.i = -1; PUSH_TO_OUTPUT(tok); tok.toktype = TOK_OP; tok.op = OP_MULTIPLY; PUSH_TO_OPERATOR(tok); allow_toktype = TOK_CONST | TOK_VAR | TOK_FUNC | TOK_VFUNC; break; case TOK_ASSIGNMENT: // assignment to variable // for now we assume variable is output (VAR_Y) if (!assigning) {FAIL("Misplaced assignment operator.");} if (opstack_index >= 0 || outstack_index < 0) {FAIL("Malformed expression left of assignment.");} if (outstack[outstack_index].toktype == TOK_VAR) { int var = outstack[outstack_index].var; if (var == VAR_X) {FAIL("Cannot assign to input variable 'x'.");} else if (var == VAR_Y) { if (outstack[outstack_index].history_index == 0) { if (output_assigned) {FAIL("Variable 'y' already assigned.");} output_assigned = 1; } } else if (var >= N_VARS) { if (outstack[outstack_index].history_index == 0) { if (variables[var-N_VARS].assigned) {FAIL("Variable already assigned.");} variables[var-N_VARS].assigned = 1; } } // nothing extraordinary, continue as normal outstack[outstack_index].toktype = TOK_ASSIGNMENT; outstack[outstack_index].assignment_offset = 0; PUSH_TO_OPERATOR(outstack[outstack_index]); outstack_index--; } else if (outstack[outstack_index].toktype == TOK_VECTORIZE) { // outstack token is vectorizer outstack_index--; if (outstack[outstack_index].toktype != TOK_VAR) {FAIL("Illegal tokens left of assignment.");} int var = outstack[outstack_index].var; if (var == VAR_X) {FAIL("Cannot assign to input variable 'x'.");} else if (var == VAR_Y) { if (outstack[outstack_index].history_index == 0) { if (output_assigned) {FAIL("Variable 'y' already assigned.");} output_assigned = 1; } } else if (var >= N_VARS) { if (outstack[outstack_index].history_index == 0) { if (variables[var-N_VARS].assigned) {FAIL("Variable already assigned.");} variables[var-N_VARS].assigned = 1; } } while (outstack_index >= 0) { if (outstack[outstack_index].toktype != TOK_VAR) {FAIL("Illegal tokens left of assignment.");} else if (outstack[outstack_index].var != var) {FAIL("Cannot mix variables in vector assignment.");} outstack[outstack_index].toktype = TOK_ASSIGNMENT; PUSH_TO_OPERATOR(outstack[outstack_index]); outstack_index--; } int index = opstack_index, vector_count = 0; while (index >= 0) { opstack[index].assignment_offset = vector_count; vector_count += opstack[index].vector_length; index--; } } else {FAIL("Malformed expression left of assignment.");} assigning = 0; allow_toktype = 0xFFFF; break; default: {FAIL("Unknown token type.");} break; } #if TRACING printstack("OUTPUT STACK:", outstack, outstack_index); printstack("OPERATOR STACK:", opstack, opstack_index); #endif } if (allow_toktype & TOK_CONST || assigning || !output_assigned) {FAIL("Expression has no output assignment.");} // check that all used-defined variables were assigned for (i = 0; i < num_variables; i++) { if (!variables[i].assigned) {FAIL("User-defined variable not assigned.");} } // finish popping operators to output, check for unbalanced parentheses while (opstack_index >= 0 && opstack[opstack_index].toktype != TOK_ASSIGNMENT) { if (opstack[opstack_index].toktype == TOK_OPEN_PAREN) {FAIL("Unmatched parentheses or misplaced comma.");} POP_OPERATOR_TO_OUTPUT(); } // pop assignment operator(s) to output while (opstack_index >= 0) { if (opstack[opstack_index].toktype != TOK_ASSIGNMENT) {FAIL("Malformed expression (5).");} PUSH_TO_OUTPUT(opstack[opstack_index]); POP_OPERATOR(); } // check vector length and type if (check_assignment_types_and_lengths(outstack, outstack_index) == -1) {FAIL("Malformed expression (6).");} #if TRACING printstack("--->OUTPUT STACK:", outstack, outstack_index); printstack("--->OPERATOR STACK:", opstack, opstack_index); #endif // Check for maximum vector length used in stack for (i = 0; i < outstack_index; i++) { if (outstack[i].vector_length > max_vector) max_vector = outstack[i].vector_length; } mapper_expr expr = malloc(sizeof(struct _mapper_expr)); expr->length = outstack_index + 1; // copy tokens expr->tokens = malloc(sizeof(struct _token)*expr->length); memcpy(expr->tokens, &outstack, sizeof(struct _token)*expr->length); expr->start = expr->tokens; expr->vector_size = max_vector; expr->input_history_size = -oldest_input+1; expr->output_history_size = -oldest_output+1; expr->constant_output = constant_output; if (num_variables) { // copy user-defined variables expr->variables = malloc(sizeof(mapper_variable_t)*num_variables); memcpy(expr->variables, variables, sizeof(mapper_variable_t)*num_variables); } expr->num_variables = num_variables; return expr; } int mapper_expr_input_history_size(mapper_expr expr) { return expr->input_history_size; } int mapper_expr_output_history_size(mapper_expr expr) { return expr->output_history_size; } int mapper_expr_num_variables(mapper_expr expr) { return expr->num_variables; } int mapper_expr_variable_history_size(mapper_expr expr, int index) { if (index >= expr->num_variables) return 0; else return expr->variables[index].history_size; } int mapper_expr_variable_vector_length(mapper_expr expr, int index) { if (index >= expr->num_variables) return 0; else return expr->variables[index].vector_length; } int mapper_expr_constant_output(mapper_expr expr) { if (expr->constant_output) return 1; return 0; } #if TRACING static void print_stack_vector(mapper_signal_value_t *stack, char type, int vector_length) { int i; if (vector_length > 1) printf("["); switch (type) { case 'i': for (i = 0; i < vector_length; i++) printf("%d, ", stack[i].i32); break; case 'f': for (i = 0; i < vector_length; i++) printf("%f, ", stack[i].f); break; case 'd': for (i = 0; i < vector_length; i++) printf("%f, ", stack[i].d); break; default: break; } if (vector_length > 1) printf("\b\b]"); else printf("\b\b"); } #endif int mapper_expr_evaluate(mapper_expr expr, mapper_signal_history_t *from, mapper_signal_history_t **expr_vars, mapper_signal_history_t *to, char *typestring) { mapper_signal_value_t stack[expr->length][expr->vector_size]; int dims[expr->length]; int i, j, k, top = -1, count = 0, found, updated = 0; mapper_token_t *tok = expr->start; // init typestring if (typestring) memset(typestring, 'N', to->length); /* Increment index position of output data structure. */ to->position = (to->position + 1) % to->size; while (count < expr->length && tok->toktype != TOK_END) { switch (tok->toktype) { case TOK_CONST: ++top; dims[top] = tok->vector_length; #if TRACING if (tok->datatype == 'f') printf("storing const %f\n", tok->f); else if (tok->datatype == 'i') printf("storing const %i\n", tok->i); else if (tok->datatype == 'd') printf("storing const %f\n", tok->d); #endif if (tok->datatype == 'f') { for (i = 0; i < tok->vector_length; i++) stack[top][i].f = tok->f; } else if (tok->datatype == 'd') { for (i = 0; i < tok->vector_length; i++) stack[top][i].d = tok->d; } else if (tok->datatype == 'i') { for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = tok->i; } break; case TOK_VAR: { int idx; switch (tok->var) { case VAR_X: ++top; dims[top] = tok->vector_length; idx = ((tok->history_index + from->position + from->size) % from->size); if (from->type == 'd') { double *v = from->value + idx * from->length * mapper_type_size(from->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].d = v[i+tok->vector_index]; } else if (from->type == 'f') { float *v = from->value + idx * from->length * mapper_type_size(from->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].f = v[i+tok->vector_index]; } else if (from->type == 'i') { int *v = from->value + idx * from->length * mapper_type_size(from->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = v[i+tok->vector_index]; } break; case VAR_Y: ++top; dims[top] = tok->vector_length; idx = ((tok->history_index + to->position + to->size) % to->size); if (to->type == 'd') { double *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].d = v[i+tok->vector_index]; } else if (to->type == 'f') { float *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].f = v[i+tok->vector_index]; } else if (to->type == 'i') { int *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = v[i+tok->vector_index]; } break; default: // TODO: allow other data types? if (tok->var > expr->num_variables + N_VARS) goto error; ++top; dims[top] = tok->vector_length; mapper_variable var = &expr->variables[tok->var - N_VARS]; mapper_signal_history_t *h = *expr_vars + (tok->var - N_VARS); idx = ((tok->history_index + h->position + var->history_size) % var->history_size); double *v = h->value + idx * var->vector_length * mapper_type_size(var->datatype); for (i = 0; i < tok->vector_length; i++) stack[top][i].d = v[i+tok->vector_index]; } } break; case TOK_OP: top -= op_table[tok->op].arity-1; dims[top] = tok->vector_length; #if TRACING if (tok->op == OP_CONDITIONAL_IF_THEN || tok->op == OP_CONDITIONAL_IF_ELSE || tok->op == OP_CONDITIONAL_IF_THEN_ELSE) { printf("IF "); print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" THEN "); if (tok->op == OP_CONDITIONAL_IF_ELSE) { print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" ELSE "); print_stack_vector(stack[top+1], tok->datatype, tok->vector_length); } else { print_stack_vector(stack[top+1], tok->datatype, tok->vector_length); if (tok->op == OP_CONDITIONAL_IF_THEN_ELSE) { printf(" ELSE "); print_stack_vector(stack[top+2], tok->datatype, tok->vector_length); } } } else { print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" %s%c ", op_table[tok->op].name, tok->datatype); print_stack_vector(stack[top+1], tok->datatype, tok->vector_length); } #endif if (tok->datatype == 'f') { switch (tok->op) { case OP_ADD: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f + stack[top+1][i].f; break; case OP_SUBTRACT: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f - stack[top+1][i].f; break; case OP_MULTIPLY: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f * stack[top+1][i].f; break; case OP_DIVIDE: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f / stack[top+1][i].f; break; case OP_MODULO: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = fmod(stack[top][i].f, stack[top+1][i].f); break; case OP_IS_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f == stack[top+1][i].f; break; case OP_IS_NOT_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f != stack[top+1][i].f; break; case OP_IS_LESS_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f < stack[top+1][i].f; break; case OP_IS_LESS_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f <= stack[top+1][i].f; break; case OP_IS_GREATER_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f > stack[top+1][i].f; break; case OP_IS_GREATER_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f >= stack[top+1][i].f; break; case OP_LOGICAL_AND: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f && stack[top+1][i].f; break; case OP_LOGICAL_OR: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = stack[top][i].f || stack[top+1][i].f; break; case OP_LOGICAL_NOT: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = !stack[top][i].f; break; case OP_CONDITIONAL_IF_THEN: // TODO: should not permit implicit any()/all() for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].f) stack[top][i].f = stack[top+1][i].f; else { // skip ahead until after assignment found = 0; tok++; count++; while (count < expr->length && tok->toktype != TOK_END) { if (tok->toktype == TOK_ASSIGNMENT) found = 1; else if (found) { --tok; --count; break; } tok++; count++; } } } break; case OP_CONDITIONAL_IF_ELSE: for (i = 0; i < tok->vector_length; i++) { if (!stack[top][i].f) stack[top][i].f = stack[top+1][i].f; } break; case OP_CONDITIONAL_IF_THEN_ELSE: for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].f) stack[top][i].f = stack[top+1][i].f; else stack[top][i].f = stack[top+2][i].f; } break; default: goto error; } } else if (tok->datatype == 'd') { switch (tok->op) { case OP_ADD: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d + stack[top+1][i].d; break; case OP_SUBTRACT: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d - stack[top+1][i].d; break; case OP_MULTIPLY: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d * stack[top+1][i].d; break; case OP_DIVIDE: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d / stack[top+1][i].d; break; case OP_MODULO: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = fmod(stack[top][i].d, stack[top+1][i].d); break; case OP_IS_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d == stack[top+1][i].d; break; case OP_IS_NOT_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d != stack[top+1][i].d; break; case OP_IS_LESS_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d < stack[top+1][i].d; break; case OP_IS_LESS_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d <= stack[top+1][i].d; break; case OP_IS_GREATER_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d > stack[top+1][i].d; break; case OP_IS_GREATER_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d >= stack[top+1][i].d; break; case OP_LOGICAL_AND: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d && stack[top+1][i].d; break; case OP_LOGICAL_OR: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = stack[top][i].d || stack[top+1][i].d; break; case OP_LOGICAL_NOT: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = !stack[top][i].d; break; case OP_CONDITIONAL_IF_THEN: for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].d) stack[top][i].d = stack[top+1][i].d; else { // skip ahead until after assignment found = 0; // found assignment tok++; count++; while (count < expr->length && tok->toktype != TOK_END) { if (tok->toktype == TOK_ASSIGNMENT) found = 1; else if (found) { --tok; --count; break; } tok++; count++; } } } break; case OP_CONDITIONAL_IF_ELSE: for (i = 0; i < tok->vector_length; i++) { if (!stack[top][i].d) stack[top][i].d = stack[top+1][i].d; } break; case OP_CONDITIONAL_IF_THEN_ELSE: for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].d) stack[top][i].d = stack[top+1][i].d; else stack[top][i].d = stack[top+2][i].d; } break; default: goto error; } } else { switch (tok->op) { case OP_ADD: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 + stack[top+1][i].i32; break; case OP_SUBTRACT: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 - stack[top+1][i].i32; break; case OP_MULTIPLY: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 * stack[top+1][i].i32; break; case OP_DIVIDE: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 / stack[top+1][i].i32; break; case OP_MODULO: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 % stack[top+1][i].i32; break; case OP_IS_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 == stack[top+1][i].i32; break; case OP_IS_NOT_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 != stack[top+1][i].i32; break; case OP_IS_LESS_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 < stack[top+1][i].i32; break; case OP_IS_LESS_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 <= stack[top+1][i].i32; break; case OP_IS_GREATER_THAN: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 > stack[top+1][i].i32; break; case OP_IS_GREATER_THAN_OR_EQUAL: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 >= stack[top+1][i].i32; break; case OP_LEFT_BIT_SHIFT: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 << stack[top+1][i].i32; break; case OP_RIGHT_BIT_SHIFT: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 >> stack[top+1][i].i32; break; case OP_BITWISE_AND: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 & stack[top+1][i].i32; break; case OP_BITWISE_OR: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 | stack[top+1][i].i32; break; case OP_BITWISE_XOR: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 ^ stack[top+1][i].i32; break; case OP_LOGICAL_AND: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 && stack[top+1][i].i32; break; case OP_LOGICAL_OR: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][i].i32 || stack[top+1][i].i32; break; case OP_LOGICAL_NOT: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = !stack[top][i].i32; break; case OP_CONDITIONAL_IF_THEN: for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].i32) stack[top][i].i32 = stack[top+1][i].i32; else { // skip ahead until after assignment found = 0; // found assignment tok++; count++; while (count < expr->length && tok->toktype != TOK_END) { if (tok->toktype == TOK_ASSIGNMENT) found = 1; else if (found) { --tok; --count; break; } tok++; count++; } } } break; case OP_CONDITIONAL_IF_ELSE: for (i = 0; i < tok->vector_length; i++) { if (!stack[top][i].i32) stack[top][i].i32 = stack[top+1][i].i32; } break; case OP_CONDITIONAL_IF_THEN_ELSE: for (i = 0; i < tok->vector_length; i++) { if (stack[top][i].i32) stack[top][i].i32 = stack[top+1][i].i32; else stack[top][i].i32 = stack[top+2][i].i32; } break; default: goto error; } } #if TRACING printf(" = "); print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" \n"); #endif break; case TOK_FUNC: top -= function_table[tok->func].arity-1; dims[top] = tok->vector_length; #if TRACING printf("%s%c(", function_table[tok->func].name, tok->datatype); for (i = 0; i < function_table[tok->func].arity; i++) { print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(", "); } printf("%s)", function_table[tok->func].arity ? "\b\b" : ""); #endif if (tok->datatype == 'f') { switch (function_table[tok->func].arity) { case 0: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = ((func_float_arity0*)function_table[tok->func].func_float)(); break; case 1: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = ((func_float_arity1*)function_table[tok->func].func_float)(stack[top][i].f); break; case 2: for (i = 0; i < tok->vector_length; i++) stack[top][i].f = ((func_float_arity2*)function_table[tok->func].func_float)(stack[top][i].f, stack[top+1][i].f); break; default: goto error; } } else if (tok->datatype == 'd') { switch (function_table[tok->func].arity) { case 0: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = ((func_double_arity0*)function_table[tok->func].func_double)(); break; case 1: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = ((func_double_arity1*)function_table[tok->func].func_double)(stack[top][i].d); break; case 2: for (i = 0; i < tok->vector_length; i++) stack[top][i].d = ((func_double_arity2*)function_table[tok->func].func_double)(stack[top][i].d, stack[top+1][i].d); break; default: goto error; } } else if (tok->datatype == 'i') { switch (function_table[tok->func].arity) { case 0: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = ((func_int32_arity0*)function_table[tok->func].func_int32)(); break; case 1: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = ((func_int32_arity1*)function_table[tok->func].func_int32)(stack[top][i].i32); break; case 2: for (i = 0; i < tok->vector_length; i++) stack[top][i].i32 = ((func_int32_arity2*)function_table[tok->func].func_int32)(stack[top][i].i32, stack[top+1][i].i32); break; default: goto error; } } #if TRACING printf(" = "); print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" \n"); #endif break; case TOK_VFUNC: top -= function_table[tok->func].arity-1; #if TRACING printf("%s%c(", vfunction_table[tok->func].name, tok->datatype); for (i = 0; i < vfunction_table[tok->func].arity; i++) { print_stack_vector(stack[top], tok->datatype, dims[top]); printf(", "); } printf("\b\b)"); #endif if (tok->datatype == 'f') { switch (vfunction_table[tok->func].arity) { case 1: stack[top][0].f = ((vfunc_float_arity1*)vfunction_table[tok->func].func_float)(stack[top], dims[top]); for (i = 1; i < tok->vector_length; i++) stack[top][i].f = stack[top][0].f; break; default: goto error; } } else if (tok->datatype == 'd') { switch (vfunction_table[tok->func].arity) { case 1: stack[top][0].d = ((vfunc_double_arity1*)vfunction_table[tok->func].func_double)(stack[top], dims[top]); for (i = 1; i < tok->vector_length; i++) stack[top][i].d = stack[top][0].d; break; default: goto error; } } else if (tok->datatype == 'i') { switch (vfunction_table[tok->func].arity) { case 1: stack[top][0].i32 = ((vfunc_int32_arity1*)vfunction_table[tok->func].func_int32)(stack[top], dims[top]); for (i = 1; i < tok->vector_length; i++) stack[top][i].i32 = stack[top][0].i32; break; default: goto error; } } dims[top] = tok->vector_length; #if TRACING printf(" = "); print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" \n"); #endif break; case TOK_VECTORIZE: // don't need to copy vector elements from first token top -= tok->arity-1; k = dims[top]; if (tok->datatype == 'f') { for (i = 1; i < tok->arity; i++) { for (j = 0; j < dims[top+1]; j++) stack[top][k++].f = stack[top+i][j].f; } } else if (tok->datatype == 'i') { for (i = 1; i < tok->arity; i++) { for (j = 0; j < dims[top+1]; j++) stack[top][k++].i32 = stack[top+i][j].i32; } } else if (tok->datatype == 'd') { for (i = 1; i < tok->arity; i++) { for (j = 0; j < dims[top+1]; j++) stack[top][k++].d = stack[top+i][j].d; } } dims[top] = tok->vector_length; #if TRACING printf("built %i-element vector: ", tok->vector_length); print_stack_vector(stack[top], tok->datatype, tok->vector_length); printf(" \n"); #endif break; case TOK_ASSIGNMENT: #if TRACING if (tok->var < N_VARS) printf("assigning values to %s_%c%d{%i}[%i]\n", var_strings[tok->var], tok->datatype, tok->vector_length, tok->history_index, tok->vector_index); else printf("assigning values to var%d_%c%d{%i}[%i]\n", tok->var - N_VARS, tok->datatype, tok->vector_length, tok->history_index, tok->vector_index); #endif updated++; if (tok->var == VAR_Y) { int idx = (tok->history_index + to->position + to->size); if (idx < 0) idx = to->size - idx; else idx %= to->size; if (to->type == 'f') { float *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) v[i + tok->vector_index] = stack[top][i + tok->assignment_offset].f; } else if (to->type == 'i') { int *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) v[i + tok->vector_index] = stack[top][i + tok->assignment_offset].i32; } else if (to->type == 'd') { double *v = to->value + idx * to->length * mapper_type_size(to->type); for (i = 0; i < tok->vector_length; i++) v[i + tok->vector_index] = stack[top][i + tok->assignment_offset].d; } if (typestring) { for (i = tok->vector_index; i < tok->vector_index + tok->vector_length; i++) { typestring[i] = tok->datatype; } } } else if (tok->var >= 0 && tok->var < expr->num_variables + N_VARS) { // passed the address of an array of mapper_signal_history structs mapper_signal_history_t *h = *expr_vars + (tok->var - N_VARS); // increment position h->position = (h->position + 1) % h->size; mapper_variable var = &expr->variables[tok->var - N_VARS]; int idx = (tok->history_index + h->position + var->history_size) % var->history_size; double *v = h->value + idx * var->vector_length * mapper_type_size(var->datatype); for (i = 0; i < tok->vector_length; i++) v[i + tok->vector_index] = stack[top][i + tok->assignment_offset].d; // Also copy timetag from input mapper_timetag_t *ttfrom = msig_history_tt_pointer(*from); mapper_timetag_t *ttvar = msig_history_tt_pointer(*h); memcpy(ttvar, ttfrom, sizeof(mapper_timetag_t)); } /* If assignment was history initialization, move expression start * token pointer so we don't evaluate this section again. */ if (tok->history_index != 0) { int offset = tok - expr->start + 1; expr->start = tok+1; expr->length -= offset; count -= offset; } break; default: goto error; } if (tok->casttype) { #if TRACING printf("casting from %c to %c\n", tok->datatype, tok->casttype); #endif // need to cast to a different type if (tok->datatype == 'i') { if (tok->casttype == 'f') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].f = (float)stack[top][i].i32; } } else if (tok->casttype == 'd') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].d = (double)stack[top][i].i32; } } } else if (tok->datatype == 'f') { if (tok->casttype == 'i') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].i32 = (int)stack[top][i].f; } } else if (tok->casttype == 'd') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].d = (double)stack[top][i].f; } } } else if (tok->datatype == 'd') { if (tok->casttype == 'i') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].i32 = (int)stack[top][i].d; } } else if (tok->casttype == 'f') { for (i = 0; i < tok->vector_length; i++) { stack[top][i].f = (float)stack[top][i].d; } } } } tok++; count++; } if (!typestring) { /* Internal evaluation during parsing doesn't contain assignment token, * so we need to copy to output here. */ /* Increment index position of output data structure. */ to->position = (to->position + 1) % to->size; if (to->type == 'f') { float *v = msig_history_value_pointer(*to); for (i = 0; i < to->length; i++) v[i] = stack[top][i].f; } else if (to->type == 'i') { int *v = msig_history_value_pointer(*to); for (i = 0; i < to->length; i++) v[i] = stack[top][i].i32; } else if (to->type == 'd') { double *v = msig_history_value_pointer(*to); for (i = 0; i < to->length; i++) v[i] = stack[top][i].d; } return 1; } /* Undo position increment if nothing was updated. */ if (!updated) { --to->position; if (to->position < 0) to->position = to->size - 1; return 0; } else if (from) { // Also copy timetag from input mapper_timetag_t *ttfrom = msig_history_tt_pointer(*from); mapper_timetag_t *ttto = msig_history_tt_pointer(*to); memcpy(ttto, ttfrom, sizeof(mapper_timetag_t)); } return 1; error: trace("Unexpected token in expression."); return 0; } libmapper/src/time.c0000644000175000017500000000331212423630127013711 0ustar tiagotiago #include "config.h" #include #include #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include static double multiplier = 1.0/((double)(1LL<<32)); void mapper_clock_init(mapper_clock clock) { mapper_clock_now(clock, &clock->now); clock->next_ping = clock->now.sec; } void mapper_clock_now(mapper_clock clock, mapper_timetag_t *timetag) { lo_timetag_now((lo_timetag*)timetag); } double mapper_timetag_difference(mapper_timetag_t a, mapper_timetag_t b) { return (double)a.sec - (double)b.sec + ((double)a.frac - (double)b.frac) * multiplier; } void mapper_timetag_add_seconds(mapper_timetag_t *a, double b) { if (!b) return; b += (double)a->frac * multiplier; a->sec += floor(b); b -= floor(b); if (b < 0.0) { a->sec--; b = 1.0 - b; } a->frac = (uint32_t) (((double)b) * (double)(1LL<<32)); } double mapper_timetag_get_double(mapper_timetag_t timetag) { return (double)timetag.sec + (double)timetag.frac * multiplier; } void mapper_timetag_set_int(mapper_timetag_t *tt, int value) { tt->sec = value; tt->frac = 0; } void mapper_timetag_set_float(mapper_timetag_t *tt, float value) { tt->sec = floor(value); value -= tt->sec; tt->frac = (uint32_t) (((float)value) * (double)(1LL<<32)); } void mapper_timetag_set_double(mapper_timetag_t *tt, double value) { tt->sec = floor(value); value -= tt->sec; tt->frac = (uint32_t) (((double)value) * (double)(1LL<<32)); } void mapper_timetag_cpy(mapper_timetag_t *ttl, mapper_timetag_t ttr) { ttl->sec = ttr.sec; ttl->frac = ttr.frac; } libmapper/src/libmapper.def0000644000175000017500000001553212423630127015251 0ustar tiagotiagoEXPORTS mapper_admin_free @1 mapper_admin_new @2 mapper_db_add_device_callback @3 mapper_db_add_link_callback @4 mapper_db_add_connection_callback @5 mapper_db_add_signal_callback @6 mapper_db_connection_done @7 mapper_db_connection_next @8 mapper_db_connection_property_index @9 mapper_db_connection_property_lookup @10 mapper_db_device_done @11 mapper_db_device_next @12 mapper_db_device_property_index @13 mapper_db_device_property_lookup @14 mapper_db_get_all_devices @15 mapper_db_get_all_inputs @16 mapper_db_get_all_connections @17 mapper_db_get_all_links @18 mapper_db_get_all_outputs @19 mapper_db_get_connection_by_signal_full_names @20 mapper_db_get_connections_by_src_device_and_signal_names @21 mapper_db_get_connections_by_dest_device_and_signal_names @22 mapper_db_get_connections_by_dest_signal_name @23 mapper_db_get_connections_by_device_and_signal_names @24 mapper_db_get_connections_by_device_name @25 mapper_db_get_connections_by_signal_queries @26 mapper_db_get_connections_by_src_signal_name @27 mapper_db_get_connections_by_src_dest_device_names @28 mapper_db_get_device_by_name @29 mapper_db_get_input_by_device_and_signal_names @30 mapper_db_get_inputs_by_device_name @31 mapper_db_get_link_by_src_dest_names @32 mapper_db_get_links_by_dest_device_name @33 mapper_db_get_links_by_device_name @34 mapper_db_get_links_by_src_dest_devices @35 mapper_db_get_links_by_src_device_name @36 mapper_db_get_output_by_device_and_signal_names @37 mapper_db_get_outputs_by_device_name @38 mapper_db_link_done @39 mapper_db_link_next @40 mapper_db_match_devices_by_name @41 mapper_db_match_inputs_by_device_name @42 mapper_db_match_outputs_by_device_name @43 mapper_db_remove_connection_callback @44 mapper_db_remove_device_callback @45 mapper_db_remove_link_callback @46 mapper_db_remove_signal_callback @47 mapper_db_signal_done @48 mapper_db_signal_next @49 mapper_db_signal_property_index @50 mapper_db_signal_property_lookup @51 mapper_monitor_autosubscribe @52 mapper_monitor_connect @53 mapper_monitor_connection_modify @54 mapper_monitor_disconnect @55 mapper_monitor_free @56 mapper_monitor_get_db @57 mapper_monitor_link @58 mapper_monitor_new @59 mapper_monitor_poll @60 mapper_monitor_subscribe @61 mapper_monitor_unlink @62 mapper_monitor_unsubscribe @63 mdev_add_input @64 mdev_add_output @65 mdev_free @66 mdev_get_input_by_index @67 mdev_get_input_by_name @68 mdev_get_inputs @69 mdev_get_lo_server @70 mdev_get_output_by_index @71 mdev_get_output_by_name @72 mdev_get_outputs @73 mdev_interface @74 mdev_ip4 @75 mdev_name @76 mdev_new @77 mdev_num_inputs @78 mdev_num_outputs @79 mdev_ordinal @80 mdev_poll @81 mdev_port @82 mdev_ready @83 mdev_remove_input @84 mdev_remove_output @85 mdev_remove_property @86 mdev_set_property @87 msig_active_instance_id @88 msig_full_name @89 msig_num_active_instances @90 msig_num_reserved_instances @91 msig_properties @92 msig_query_remotes @93 msig_release_instance @94 msig_remove_property @95 msig_reserve_instances @96 msig_set_instance_allocation_mode @97 msig_set_instance_event_callback @98 msig_set_maximum @99 msig_set_minimum @100 msig_set_property @101 msig_update @102 msig_update_float @103 msig_update_instance @104 msig_update_int @105 msig_value @106 libmapper/src/config.h.in0000644000175000017500000000630712423630127014641 0ustar tiagotiago/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define if getifaddrs() is available. */ #undef HAVE_GETIFADDRS /* Define if gettimeofday() is available. */ #undef HAVE_GETTIMEOFDAY /* Define if inet_ptoa() is available. */ #undef HAVE_INET_PTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if iphlpapi library is available. (Windows) */ #undef HAVE_LIBIPHLPAPI /* Define to enable Open Sound Control support with liblo */ #undef HAVE_LIBLO /* Define to use lo_bundle_count function in liblo. */ #undef HAVE_LIBLO_BUNDLE_COUNT /* Define to use lo_server_new_multicast_iface function in liblo. */ #undef HAVE_LIBLO_SERVER_IFACE /* Define to use lo_address_set_iface function in liblo. */ #undef HAVE_LIBLO_SET_IFACE /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* 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 necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t libmapper/src/Makefile.in0000644000175000017500000011251612423630127014663 0ustar tiagotiago# 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 $(top_srcdir)/depcomp $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = 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)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libmapper_@MAJOR_VERSION@_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libmapper_@MAJOR_VERSION@_la_OBJECTS = \ libmapper_@MAJOR_VERSION@_la-expression.lo \ libmapper_@MAJOR_VERSION@_la-device.lo \ libmapper_@MAJOR_VERSION@_la-admin.lo \ libmapper_@MAJOR_VERSION@_la-signal.lo \ libmapper_@MAJOR_VERSION@_la-receiver.lo \ libmapper_@MAJOR_VERSION@_la-router.lo \ libmapper_@MAJOR_VERSION@_la-connection.lo \ libmapper_@MAJOR_VERSION@_la-db.lo \ libmapper_@MAJOR_VERSION@_la-params.lo \ libmapper_@MAJOR_VERSION@_la-monitor.lo \ libmapper_@MAJOR_VERSION@_la-table.lo \ libmapper_@MAJOR_VERSION@_la-time.lo libmapper_@MAJOR_VERSION@_la_OBJECTS = \ $(am_libmapper_@MAJOR_VERSION@_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 = libmapper_@MAJOR_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) \ $(libmapper_@MAJOR_VERSION@_la_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@ 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 = $(libmapper_@MAJOR_VERSION@_la_SOURCES) DIST_SOURCES = $(libmapper_@MAJOR_VERSION@_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ noinst_HEADERS = mapper_internal.h types_internal.h EXTRA_DIST = libmapper.def @WINDOWS_DLL_TRUE@lt_windows = -no-undefined -export-symbols libmapper.def lib_LTLIBRARIES = libmapper-@MAJOR_VERSION@.la libmapper_@MAJOR_VERSION@_la_CFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) libmapper_@MAJOR_VERSION@_la_SOURCES = expression.c device.c admin.c signal.c \ receiver.c router.c connection.c db.c params.c monitor.c table.c time.c libmapper_@MAJOR_VERSION@_la_LIBADD = $(liblo_LIBS) libmapper_@MAJOR_VERSION@_la_LDFLAGS = $(lt_windows) -export-dynamic -version-info @SO_VERSION@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-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}; \ } libmapper-@MAJOR_VERSION@.la: $(libmapper_@MAJOR_VERSION@_la_OBJECTS) $(libmapper_@MAJOR_VERSION@_la_DEPENDENCIES) $(EXTRA_libmapper_@MAJOR_VERSION@_la_DEPENDENCIES) $(AM_V_CCLD)$(libmapper_@MAJOR_VERSION@_la_LINK) -rpath $(libdir) $(libmapper_@MAJOR_VERSION@_la_OBJECTS) $(libmapper_@MAJOR_VERSION@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-admin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-db.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-expression.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-params.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-receiver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-router.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-signal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapper_@MAJOR_VERSION@_la-time.Plo@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 $@ $< libmapper_@MAJOR_VERSION@_la-expression.lo: expression.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-expression.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-expression.Tpo -c -o libmapper_@MAJOR_VERSION@_la-expression.lo `test -f 'expression.c' || echo '$(srcdir)/'`expression.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-expression.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-expression.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='expression.c' object='libmapper_@MAJOR_VERSION@_la-expression.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-expression.lo `test -f 'expression.c' || echo '$(srcdir)/'`expression.c libmapper_@MAJOR_VERSION@_la-device.lo: device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-device.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-device.Tpo -c -o libmapper_@MAJOR_VERSION@_la-device.lo `test -f 'device.c' || echo '$(srcdir)/'`device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-device.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='device.c' object='libmapper_@MAJOR_VERSION@_la-device.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-device.lo `test -f 'device.c' || echo '$(srcdir)/'`device.c libmapper_@MAJOR_VERSION@_la-admin.lo: admin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-admin.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-admin.Tpo -c -o libmapper_@MAJOR_VERSION@_la-admin.lo `test -f 'admin.c' || echo '$(srcdir)/'`admin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-admin.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-admin.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='admin.c' object='libmapper_@MAJOR_VERSION@_la-admin.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-admin.lo `test -f 'admin.c' || echo '$(srcdir)/'`admin.c libmapper_@MAJOR_VERSION@_la-signal.lo: signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-signal.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-signal.Tpo -c -o libmapper_@MAJOR_VERSION@_la-signal.lo `test -f 'signal.c' || echo '$(srcdir)/'`signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-signal.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-signal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signal.c' object='libmapper_@MAJOR_VERSION@_la-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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-signal.lo `test -f 'signal.c' || echo '$(srcdir)/'`signal.c libmapper_@MAJOR_VERSION@_la-receiver.lo: receiver.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-receiver.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-receiver.Tpo -c -o libmapper_@MAJOR_VERSION@_la-receiver.lo `test -f 'receiver.c' || echo '$(srcdir)/'`receiver.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-receiver.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-receiver.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='receiver.c' object='libmapper_@MAJOR_VERSION@_la-receiver.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-receiver.lo `test -f 'receiver.c' || echo '$(srcdir)/'`receiver.c libmapper_@MAJOR_VERSION@_la-router.lo: router.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-router.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-router.Tpo -c -o libmapper_@MAJOR_VERSION@_la-router.lo `test -f 'router.c' || echo '$(srcdir)/'`router.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-router.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-router.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='router.c' object='libmapper_@MAJOR_VERSION@_la-router.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-router.lo `test -f 'router.c' || echo '$(srcdir)/'`router.c libmapper_@MAJOR_VERSION@_la-connection.lo: connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-connection.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-connection.Tpo -c -o libmapper_@MAJOR_VERSION@_la-connection.lo `test -f 'connection.c' || echo '$(srcdir)/'`connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-connection.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-connection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='connection.c' object='libmapper_@MAJOR_VERSION@_la-connection.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-connection.lo `test -f 'connection.c' || echo '$(srcdir)/'`connection.c libmapper_@MAJOR_VERSION@_la-db.lo: db.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-db.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-db.Tpo -c -o libmapper_@MAJOR_VERSION@_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-db.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-db.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='db.c' object='libmapper_@MAJOR_VERSION@_la-db.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c libmapper_@MAJOR_VERSION@_la-params.lo: params.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-params.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-params.Tpo -c -o libmapper_@MAJOR_VERSION@_la-params.lo `test -f 'params.c' || echo '$(srcdir)/'`params.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-params.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-params.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='params.c' object='libmapper_@MAJOR_VERSION@_la-params.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-params.lo `test -f 'params.c' || echo '$(srcdir)/'`params.c libmapper_@MAJOR_VERSION@_la-monitor.lo: monitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-monitor.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-monitor.Tpo -c -o libmapper_@MAJOR_VERSION@_la-monitor.lo `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-monitor.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-monitor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='monitor.c' object='libmapper_@MAJOR_VERSION@_la-monitor.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-monitor.lo `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c libmapper_@MAJOR_VERSION@_la-table.lo: table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-table.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-table.Tpo -c -o libmapper_@MAJOR_VERSION@_la-table.lo `test -f 'table.c' || echo '$(srcdir)/'`table.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-table.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-table.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='table.c' object='libmapper_@MAJOR_VERSION@_la-table.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-table.lo `test -f 'table.c' || echo '$(srcdir)/'`table.c libmapper_@MAJOR_VERSION@_la-time.lo: time.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapper_@MAJOR_VERSION@_la-time.lo -MD -MP -MF $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-time.Tpo -c -o libmapper_@MAJOR_VERSION@_la-time.lo `test -f 'time.c' || echo '$(srcdir)/'`time.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-time.Tpo $(DEPDIR)/libmapper_@MAJOR_VERSION@_la-time.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time.c' object='libmapper_@MAJOR_VERSION@_la-time.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapper_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapper_@MAJOR_VERSION@_la-time.lo `test -f 'time.c' || echo '$(srcdir)/'`time.c 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 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 $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)"; 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-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-hdr 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-libLTLIBRARIES 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: uninstall-libLTLIBRARIES .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile 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-libLTLIBRARIES \ 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 tags tags-am uninstall \ uninstall-am uninstall-libLTLIBRARIES # 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: libmapper/src/types_internal.h0000644000175000017500000003477512423630127016041 0ustar tiagotiago #ifndef __MAPPER_TYPES_H__ #define __MAPPER_TYPES_H__ #include #include "config.h" #ifdef HAVE_ARPA_INET_H #include #else #ifdef HAVE_WINSOCK2_H #include #endif #endif #include /**** Defined in mapper.h ****/ /* Types defined here replace opaque prototypes in mapper.h, thus we * cannot include it here. Instead we include some prototypes here. * Typedefs cannot be repeated, therefore they are refered to by * struct name. */ struct _mapper_signal; struct _mapper_admin; typedef struct _mapper_expr *mapper_expr; /* Forward declarations for this file. */ struct _mapper_admin_allocated_t; struct _mapper_device; struct _mapper_id_map; /**** String tables ****/ /*! A pair representing an arbitrary parameter value and its * type. (Re-using liblo's OSC-oriented lo_arg data structure.) If * type is a string, the allocated size may be longer than * sizeof(mapper_osc_arg_t). */ typedef struct _mapper_prop_value { char type; int length; void *value; } mapper_prop_value_t; /*! Used to hold string look-up table nodes. */ typedef struct { const char *key; void *value; int is_prop; } string_table_node_t; /*! Used to hold string look-up tables. */ typedef struct _mapper_string_table { string_table_node_t *store; int len; int alloced; } mapper_string_table_t, *table; /**** Admin bus ****/ /*! Some useful strings for sending admin messages. */ /*! Symbolic representation of recognized @-parameters. */ typedef enum { ADM_CONNECT, ADM_CONNECT_TO, ADM_CONNECTED, ADM_CONNECTION_MODIFY, ADM_DEVICE, ADM_DISCONNECT, ADM_DISCONNECTED, ADM_LINK, ADM_LINK_MODIFY, ADM_LINK_TO, ADM_LINKED, ADM_LINK_PING, ADM_LOGOUT, ADM_SIGNAL, ADM_INPUT, ADM_OUTPUT, ADM_INPUT_REMOVED, ADM_OUTPUT_REMOVED, ADM_SUBSCRIBE, ADM_UNSUBSCRIBE, ADM_SYNC, ADM_UNLINK, ADM_UNLINKED, ADM_WHO } admin_msg_t; /*! Function to call when an allocated resource is locked. */ typedef void mapper_admin_resource_on_lock(struct _mapper_device *md, struct _mapper_admin_allocated_t *resource); /*! Function to call when an allocated resource encounters a collision. */ typedef void mapper_admin_resource_on_collision(struct _mapper_admin *admin); /*! Allocated resources */ typedef struct _mapper_admin_allocated_t { unsigned int value; //!< The resource to be allocated. int collision_count; /*!< The number of collisions * detected for this resource. */ double count_time; /*!< The last time at which the * collision count was updated. */ int locked; /*!< Whether or not the value has * been locked in (allocated). */ double suggestion[8]; /*!< Availability of a range of resource values. */ //!< Function to call when resource becomes locked. mapper_admin_resource_on_lock *on_lock; //! Function to call when resource collision occurs. mapper_admin_resource_on_collision *on_collision; } mapper_admin_allocated_t; /*! Clock and timing information. */ typedef struct _mapper_sync_timetag_t { int message_id; lo_timetag timetag; } mapper_sync_timetag_t; typedef struct _mapper_clock_t { mapper_timetag_t now; uint32_t next_ping; } mapper_clock_t, *mapper_clock; typedef struct _mapper_sync_clock_t { double rate; double offset; double latency; double jitter; mapper_sync_timetag_t sent; mapper_sync_timetag_t response; int new; } mapper_sync_clock_t, *mapper_sync_clock; typedef struct _mapper_admin_subscriber { lo_address address; uint32_t lease_expiration_sec; int flags; struct _mapper_admin_subscriber *next; } *mapper_admin_subscriber; /*! A structure that keeps information about a device. */ typedef struct _mapper_admin { int random_id; /*!< Random ID for allocation speedup. */ lo_server_thread bus_server; /*!< LibLo server thread for the * admin bus. */ int msgs_recvd; /*!< Number of messages received on the admin bus. */ lo_address bus_addr; /*!< LibLo address for the admin * bus. */ lo_server_thread mesh_server; /*!< LibLo server thread for the * admin mesh. */ char *interface_name; /*!< The name of the network * interface for receiving * messages. */ struct in_addr interface_ip; /*!< The IP address of interface. */ struct _mapper_device *device; /*!< Device that this admin is * in charge of. */ struct _mapper_monitor *monitor; /*!< Monitor that this admin is * in charge of. */ mapper_clock_t clock; /*!< Clock for providing global * time syncronization. */ lo_bundle bundle; /*!< Bundle pointer for sending * messages on the admin bus. */ lo_address bundle_dest; int message_type; mapper_admin_subscriber subscribers; /*!< Linked-list of subscribed peers. */ } mapper_admin_t; /*! The handle to this device is a pointer. */ typedef mapper_admin_t *mapper_admin; #define ADMIN_TIMEOUT_SEC 10 // timeout after 10 seconds without ping /**** Router ****/ /*! The router_connection structure is a linked list of connections for a * given signal. Each signal can be associated with multiple * outputs. This structure only contains state information used for * performing mapping, the connection properties are publically * defined in mapper_db.h. */ typedef struct _mapper_connection { mapper_db_connection_t props; //!< Properties struct _mapper_link_signal *parent; /*!< Parent signal reference * in router or receiver. */ int calibrating; /*!< 1 if the source range is * currently being calibrated, * 0 otherwise. */ mapper_expr expr; //!< The mapping expression. mapper_signal_history_t **expr_vars; //!< User variables values. int num_expr_vars; //!< Number of user variables. mapper_signal_history_t *history; /*!< Array of output histories * for each signal instance. */ struct _mapper_connection *next; //!< Next connection in the list. } *mapper_connection; /*! The link_signal is a linked list containing a signal and a * list of connections. TODO: This should be replaced with a more * efficient approach such as a hash table or search tree. */ typedef struct _mapper_link_signal { struct _mapper_link *link; //!< The parent link. struct _mapper_signal *signal; //!< The associated signal. int num_instances; //!< Number of instances allocated. // int max_output_size; /*!< Maximum output vector size in // * child connections. */ mapper_signal_history_t *history; /*!< Array of value histories * for each signal instance. */ int history_size; /*! Size of the history vector. */ mapper_connection connections; /*!< The first connection for * this signal. */ struct _mapper_link_signal *next; /*!< The next signal connection * in the list. */ } *mapper_link_signal, *mapper_router_signal, *mapper_receiver_signal; typedef struct _mapper_queue { mapper_timetag_t tt; lo_bundle bundle; struct _mapper_queue *next; } *mapper_queue; /*! The link structure is a linked list of links each associated * with a destination address that belong to a controller device. */ typedef struct _mapper_link { lo_address admin_addr; //!< Network address of remote endpoint lo_address data_addr; //!< Network address of remote endpoint mapper_db_link_t props; //!< Properties. struct _mapper_device *device; /*!< The device associated with * this link */ mapper_link_signal signals; /*!< The list of connections * for each signal. */ int num_connections; //!< Number of connections in link. mapper_queue queues; /*!< Linked-list of message queues * waiting to be sent. */ mapper_sync_clock_t clock; struct _mapper_link *next; //!< Next link in the list. } *mapper_link, *mapper_router, *mapper_receiver; /*! The instance ID map is a linked list of int32 instance ids for coordinating * remote and local instances. */ typedef struct _mapper_id_map { int local; //!< Local instance id to map. uint32_t origin; //!< Hash for originating device. uint32_t public; //!< Public instance id to map. int refcount_local; int refcount_remote; struct _mapper_id_map *next; //!< The next id map in the list. } *mapper_id_map; /**** Device ****/ struct _mapper_device; typedef struct _mapper_device *mapper_device; /*! Bit flags indicating if information has already been * sent in a given polling step. */ #define FLAGS_SENT_DEVICE_INFO 0x01 #define FLAGS_SENT_DEVICE_INPUTS 0x02 #define FLAGS_SENT_DEVICE_OUTPUTS 0x04 #define FLAGS_SENT_DEVICE_LINKS_IN 0x08 #define FLAGS_SENT_DEVICE_LINKS_OUT 0x10 #define FLAGS_SENT_DEVICE_CONNECTIONS_IN 0x20 #define FLAGS_SENT_DEVICE_CONNECTIONS_OUT 0x40 #define FLAGS_SENT_ALL_DEVICE_MESSAGES 0x7F #define FLAGS_DEVICE_ATTRIBS_CHANGED 0x80 /**** Monitor ****/ /*! A list of function and context pointers. */ typedef struct _fptr_list { void *f; void *context; struct _fptr_list *next; } *fptr_list; typedef struct _mapper_db { mapper_db_device registered_devices; // #include #include #include "types_internal.h" #include "mapper_internal.h" const char* mapper_msg_param_strings[] = { "@boundMax", /* AT_BOUND_MAX */ "@boundMin", /* AT_BOUND_MIN */ "@destLength", /* AT_DEST_LENGTH */ "@destMax", /* AT_DEST_MAX */ "@destMin", /* AT_DEST_MIN */ "@destPort", /* AT_DEST_PORT */ "@destType", /* AT_DEST_TYPE */ "@direction", /* AT_DIRECTION */ "@expression", /* AT_EXPRESSION */ "@ID", /* AT_ID */ "@instances", /* AT_INSTANCES */ "@IP", /* AT_IP */ "@length", /* AT_LENGTH */ "@libVersion", /* AT_LIB_VERSION */ "@max", /* AT_MAX */ "@min", /* AT_MIN */ "@mode", /* AT_MODE */ "@mute", /* AT_MUTE */ "@numConnectsIn", /* AT_NUM_CONNECTIONS_IN */ "@numConnectsOut", /* AT_NUM_CONNECTIONS_OUT */ "@numInputs", /* AT_NUM_INPUTS */ "@numLinksIn", /* AT_NUM_LINKS_IN */ "@numLinksOut", /* AT_NUM_LINKS_OUT */ "@numOutputs", /* AT_NUM_OUTPUTS */ "@port", /* AT_PORT */ "@rate", /* AT_RATE */ "@rev", /* AT_REV */ "@scope", /* AT_SCOPE */ "@sendAsInstance", /* AT_SEND_AS_INSTANCE */ "@srcLength", /* AT_SRC_LENGTH */ "@srcMax", /* AT_SRC_MAX */ "@srcMin", /* AT_SRC_MIN */ "@srcPort", /* AT_SRC_PORT */ "@srcType", /* AT_SRC_TYPE */ "@type", /* AT_TYPE */ "@units", /* AT_UNITS */ "", /* AT_EXTRA (special case, does not represent a * specific property name) */ }; int mapper_msg_parse_params(mapper_message_t *msg, const char *path, const char *types, int argc, lo_arg **argv) { int i, j; /* Sanity check: complain loudly and quit string if number of * strings and params doesn't match up. */ die_unless(sizeof(mapper_msg_param_strings)/sizeof(const char*) == N_AT_PARAMS, "libmapper ERROR: wrong number of known parameters\n"); memset(msg, 0, sizeof(mapper_message_t)); msg->path = path; msg->extra_args[0] = 0; int extra_count = 0; for (i=0; is, mapper_msg_param_strings[j])==0) break; if (j==N_AT_PARAMS) { if (argv[i]->s == '@' && extra_count < N_EXTRA_PARAMS) { /* Unknown "extra" parameter, record the key index. */ msg->extra_args[extra_count] = &argv[i]; msg->extra_types[extra_count] = types[i+1]; msg->extra_lengths[extra_count] = 0; while (++i < argc) { if ((types[i] == 's' || types[i] == 'S') && (&argv[i]->s)[0] == '@') { /* arrived at next parameter index. */ i--; break; } else if (types[i] != msg->extra_types[extra_count]) { trace("message %s, value vector for key %s has heterogeneous types.\n", path, &(*msg->extra_args[extra_count])->s); msg->extra_lengths[extra_count] = 0; break; } msg->extra_lengths[extra_count]++; } if (!msg->extra_lengths[extra_count]) { trace("message %s, key %s has no values.\n", path, &(*msg->extra_args[extra_count])->s); msg->extra_args[extra_count] = 0; msg->extra_types[extra_count] = 0; continue; } extra_count++; continue; } else /* Skip non-keyed parameters */ continue; } msg->types[j] = &types[i+1]; msg->values[j] = &argv[i+1]; msg->lengths[j] = 0; while (++i < argc) { if ((types[i] == 's' || types[i] == 'S') && (&argv[i]->s)[0] == '@') { /* Arrived at next param index. */ i--; break; } else if (types[i] != *msg->types[j]) { trace("message %s, value vector for key %s has heterogeneous types.\n", path, mapper_msg_param_strings[j]); msg->lengths[j] = 0; break; } msg->lengths[j]++; } if (!msg->lengths[j]) { trace("message %s, key %s has no values.\n", path, mapper_msg_param_strings[j]); msg->types[j] = 0; msg->values[j] = 0; continue; } } return 0; } lo_arg** mapper_msg_get_param(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); return msg->values[param]; } const char* mapper_msg_get_type(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); return msg->types[param]; } int mapper_msg_get_length(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); return msg->lengths[param]; } const char* mapper_msg_get_param_if_string(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !(*a)) return 0; const char *t = mapper_msg_get_type(msg, param); if (!t) return 0; if (t[0] != 's' && t[0] != 'S') return 0; return &(*a)->s; } const char* mapper_msg_get_param_if_char(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !(*a)) return 0; const char *t = mapper_msg_get_type(msg, param); if (!t) return 0; if ((t[0] == 's' || t[0] == 'S') && (&(*a)->s)[0] && (&(*a)->s)[1]==0) return &(*a)->s; if (t[0] == 'c') return (char*)&(*a)->c; return 0; } int mapper_msg_get_param_if_int(mapper_message_t *msg, mapper_msg_param_t param, int *value) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); die_unless(value!=0, "bad pointer"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !(*a)) return 1; const char *t = mapper_msg_get_type(msg, param); if (!t) return 1; if (t[0] != 'i') return 1; *value = (*a)->i; return 0; } int mapper_msg_get_param_if_float(mapper_message_t *msg, mapper_msg_param_t param, float *value) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); die_unless(value!=0, "bad pointer"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !(*a)) return 1; const char *t = mapper_msg_get_type(msg, param); if (!t) return 1; if (t[0] != 'f') return 1; *value = (*a)->f; return 0; } int mapper_msg_get_param_if_double(mapper_message_t *msg, mapper_msg_param_t param, double *value) { die_unless(param < N_AT_PARAMS, "error, unknown parameter\n"); die_unless(value!=0, "bad pointer"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !(*a)) return 1; const char *t = mapper_msg_get_type(msg, param); if (!t) return 1; if (t[0] != 'd') return 1; *value = (*a)->d; return 0; } int mapper_msg_add_or_update_extra_params(table t, mapper_message_t *params) { int i=0, updated=0; while (params->extra_args[i]) { const char *key = ¶ms->extra_args[i][0]->s + 1; // skip '@' char type = params->extra_types[i]; int length = params->extra_lengths[i]; updated += mapper_table_add_or_update_msg_value(t, key, type, ¶ms->extra_args[i][1], length); i++; } return updated; } /* helper for mapper_msg_prepare_varargs() */ void msg_add_typed_value(lo_message m, char type, int length, void *value) { int i; if (length < 1) return; switch (type) { case 's': case 'S': { if (length == 1) lo_message_add_string(m, (char*)value); else { char **vals = (char**)value; for (i = 0; i < length; i++) lo_message_add_string(m, vals[i]); } break; } case 'f': { float *vals = (float*)value; for (i = 0; i < length; i++) lo_message_add_float(m, vals[i]); break; } case 'd': { double *vals = (double*)value; for (i = 0; i < length; i++) lo_message_add_double(m, vals[i]); break; } case 'i': { int *vals = (int*)value; for (i = 0; i < length; i++) lo_message_add_int32(m, vals[i]); break; } case 'h': { int64_t *vals = (int64_t*)value; for (i = 0; i < length; i++) lo_message_add_int64(m, vals[i]); break; } case 't': { mapper_timetag_t *vals = (mapper_timetag_t*)value; for (i = 0; i < length; i++) lo_message_add_timetag(m, vals[i]); break; } case 'c': { char *vals = (char*)value; for (i = 0; i < length; i++) lo_message_add_char(m, vals[i]); break; } default: break; } } void mapper_msg_prepare_varargs(lo_message m, va_list aq) { char *s; int i; char t[] = " "; table tab; mapper_signal sig; mapper_msg_param_t pa = (mapper_msg_param_t) va_arg(aq, int); mapper_db_connection_t *con; while (pa != N_AT_PARAMS) { /* if parameter is -1, it means to skip this entry */ if ((int)pa == -1) { pa = (mapper_msg_param_t) va_arg(aq, int); pa = (mapper_msg_param_t) va_arg(aq, int); continue; } /* Only "extra" is not a real property name */ #ifdef DEBUG if ((int)pa >= 0 && pa < N_AT_PARAMS) #endif if (pa != AT_EXTRA) lo_message_add_string(m, mapper_msg_param_strings[pa]); switch (pa) { case AT_IP: s = va_arg(aq, char*); lo_message_add_string(m, s); break; case AT_DEST_LENGTH: case AT_DEST_PORT: case AT_ID: case AT_LENGTH: case AT_NUM_CONNECTIONS_IN: case AT_NUM_CONNECTIONS_OUT: case AT_NUM_INPUTS: case AT_NUM_LINKS_IN: case AT_NUM_LINKS_OUT: case AT_NUM_OUTPUTS: case AT_PORT: case AT_REV: case AT_SEND_AS_INSTANCE: case AT_SRC_LENGTH: case AT_SRC_PORT: i = va_arg(aq, int); lo_message_add_int32(m, i); break; case AT_TYPE: case AT_SRC_TYPE: case AT_DEST_TYPE: i = va_arg(aq, int); t[0] = (char)i; lo_message_add_string(m, t); break; case AT_UNITS: sig = va_arg(aq, mapper_signal); lo_message_add_string(m, sig->props.unit); break; case AT_MIN: sig = va_arg(aq, mapper_signal); msg_add_typed_value(m, sig->props.type, sig->props.length, sig->props.minimum); break; case AT_MAX: sig = va_arg(aq, mapper_signal); msg_add_typed_value(m, sig->props.type, sig->props.length, sig->props.maximum); break; case AT_RATE: sig = va_arg(aq, mapper_signal); lo_message_add_float(m, sig->props.rate); break; case AT_MODE: i = va_arg(aq, int); if (i >= 0 && i < N_MAPPER_MODE_TYPES) lo_message_add_string(m, mapper_mode_type_strings[i]); else lo_message_add_string(m, "unknown"); break; case AT_EXPRESSION: s = va_arg(aq, char*); lo_message_add_string(m, s); break; case AT_BOUND_MIN: case AT_BOUND_MAX: i = va_arg(aq, int); if (i >= 0 && i < N_MAPPER_BOUNDARY_ACTIONS) lo_message_add_string(m, mapper_boundary_action_strings[i]); else lo_message_add_string(m, "unknown"); break; case AT_SRC_MIN: con = va_arg(aq, mapper_db_connection_t*); msg_add_typed_value(m, con->src_type, con->src_length, con->src_min); break; case AT_SRC_MAX: con = va_arg(aq, mapper_db_connection_t*); msg_add_typed_value(m, con->src_type, con->src_length, con->src_max); break; case AT_DEST_MIN: con = va_arg(aq, mapper_db_connection_t*); msg_add_typed_value(m, con->dest_type, con->dest_length, con->dest_min); break; case AT_DEST_MAX: con = va_arg(aq, mapper_db_connection_t*); msg_add_typed_value(m, con->dest_type, con->dest_length, con->dest_max); break; case AT_MUTE: i = va_arg(aq, int); lo_message_add_int32(m, i!=0); break; case AT_DIRECTION: s = va_arg(aq, char*); lo_message_add_string(m, s); break; case AT_INSTANCES: sig = va_arg(aq, mapper_signal); lo_message_add_int32(m, sig->props.num_instances); break; case AT_LIB_VERSION: s = va_arg(aq, char*); lo_message_add_string(m, s); break; case AT_EXTRA: tab = va_arg(aq, table); i = 0; { mapper_prop_value_t *prop; prop = table_value_at_index_p(tab, i++); while(prop) { const char *k = table_key_at_index(tab, i-1); char key[256] = "@"; strncpy(&key[1], k, 254); lo_message_add_string(m, key); msg_add_typed_value(m, prop->type, prop->length, prop->value); prop = table_value_at_index_p(tab, i++); } } break; default: die_unless(0, "unknown parameter %d\n", pa); } pa = (mapper_msg_param_t) va_arg(aq, int); } } /* helper for mapper_msg_prepare_params() */ static void msg_add_lo_arg(lo_message m, char type, lo_arg *a) { switch (type) { case 'i': lo_message_add_int32(m, a->i); break; case 'f': lo_message_add_float(m, a->f); break; case 'd': lo_message_add_double(m, a->d); break; case 's': lo_message_add_string(m, &a->s); break; case 'c': lo_message_add_char(m, a->c); break; default: trace("unknown type in msg_add_lo_arg()\n"); break; } } void mapper_msg_add_value_table(lo_message m, table t) { string_table_node_t *n = t->store; int i; for (i=0; ilen; i++) { char keyname[256]; snprintf(keyname, 256, "@%s", n->key); lo_message_add_string(m, keyname); mapper_prop_value_t *v = n->value; msg_add_typed_value(m, v->type, v->length, v->value); n++; } } void mapper_msg_prepare_params(lo_message m, mapper_message_t *msg) { int i; mapper_msg_param_t pa = (mapper_msg_param_t) 0; for (pa = (mapper_msg_param_t) 0; pa < N_AT_PARAMS; pa = (mapper_msg_param_t) (pa + 1)) { if (!msg->values[pa]) continue; lo_arg **a = msg->values[pa]; if (!a) continue; lo_message_add_string(m, mapper_msg_param_strings[pa]); for (i = 0; i < msg->lengths[pa]; i++) { msg_add_lo_arg(m, *msg->types[pa], a[i]); } } pa = 0; while (msg->extra_args[pa]) { msg_add_lo_arg(m, 's', (lo_arg*) (&msg->extra_args[pa][0]->s)); for (i = 0; i < msg->extra_lengths[pa]; i++) { msg_add_lo_arg(m, msg->extra_types[pa], *(msg->extra_args[pa]+i+1)); } pa++; } } void mapper_link_prepare_osc_message(lo_message m, mapper_link link) { int i; // Add link scopes lo_message_add_string(m, mapper_msg_param_strings[AT_SCOPE]); if (link->props.num_scopes) { for (i=0; iprops.num_scopes; i++) lo_message_add_string(m, link->props.scope_names[i]); } else lo_message_add_string(m, "none"); mapper_msg_add_value_table(m, link->props.extra); } void mapper_connection_prepare_osc_message(lo_message m, mapper_connection con) { if (con->props.mode) { lo_message_add_string(m, mapper_msg_param_strings[AT_MODE]); lo_message_add_string(m, mapper_mode_type_strings[con->props.mode]); } if (con->props.expression) { lo_message_add_string(m, mapper_msg_param_strings[AT_EXPRESSION]); lo_message_add_string(m, con->props.expression); } if (con->props.range_known & CONNECTION_RANGE_SRC_MIN) { lo_message_add_string(m, mapper_msg_param_strings[AT_SRC_MIN]); msg_add_typed_value(m, con->props.src_type, con->props.src_length, con->props.src_min); } if (con->props.range_known & CONNECTION_RANGE_SRC_MAX) { lo_message_add_string(m, mapper_msg_param_strings[AT_SRC_MAX]); msg_add_typed_value(m, con->props.src_type, con->props.src_length, con->props.src_max); } if (con->props.range_known & CONNECTION_RANGE_DEST_MIN) { lo_message_add_string(m, mapper_msg_param_strings[AT_DEST_MIN]); msg_add_typed_value(m, con->props.dest_type, con->props.dest_length, con->props.dest_min); } if (con->props.range_known & CONNECTION_RANGE_DEST_MAX) { lo_message_add_string(m, mapper_msg_param_strings[AT_DEST_MAX]); msg_add_typed_value(m, con->props.dest_type, con->props.dest_length, con->props.dest_max); } lo_message_add_string(m, mapper_msg_param_strings[AT_BOUND_MIN]); lo_message_add_string(m, mapper_boundary_action_strings[con->props.bound_min]); lo_message_add_string(m, mapper_msg_param_strings[AT_BOUND_MAX]); lo_message_add_string(m, mapper_boundary_action_strings[con->props.bound_max]); lo_message_add_string(m, mapper_msg_param_strings[AT_MUTE]); lo_message_add_int32(m, con->props.muted); lo_message_add_string(m, mapper_msg_param_strings[AT_SRC_TYPE]); lo_message_add_char(m, con->props.src_type); lo_message_add_string(m, mapper_msg_param_strings[AT_DEST_TYPE]); lo_message_add_char(m, con->props.dest_type); lo_message_add_string(m, mapper_msg_param_strings[AT_SRC_LENGTH]); lo_message_add_int32(m, con->props.src_length); lo_message_add_string(m, mapper_msg_param_strings[AT_DEST_LENGTH]); lo_message_add_int32(m, con->props.dest_length); lo_message_add_string(m, mapper_msg_param_strings[AT_SEND_AS_INSTANCE]); lo_message_add_int32(m, con->props.send_as_instance); mapper_msg_add_value_table(m, con->props.extra); } mapper_mode_type mapper_msg_get_direction(mapper_message_t *msg) { lo_arg **a = mapper_msg_get_param(msg, AT_DIRECTION); if (!a || !*a) return -1; if (strcmp(&(*a)->s, "input") == 0) return 0; else if (strcmp(&(*a)->s, "output") == 0) return 1; else return -1; return -1; } mapper_mode_type mapper_msg_get_mode(mapper_message_t *msg) { lo_arg **a = mapper_msg_get_param(msg, AT_MODE); if (!a || !*a) return -1; if (strcmp(&(*a)->s, "bypass") == 0) return MO_BYPASS; else if (strcmp(&(*a)->s, "linear") == 0) return MO_LINEAR; else if (strcmp(&(*a)->s, "expression") == 0) return MO_EXPRESSION; else if (strcmp(&(*a)->s, "calibrate") == 0) return MO_CALIBRATE; else if (strcmp(&(*a)->s, "reverse") == 0) return MO_REVERSE; else return -1; return -1; } mapper_boundary_action mapper_msg_get_boundary_action(mapper_message_t *msg, mapper_msg_param_t param) { die_unless(param == AT_BOUND_MIN || param == AT_BOUND_MAX, "bad param in mapper_msg_get_boundary_action()\n"); lo_arg **a = mapper_msg_get_param(msg, param); if (!a || !*a) return -1; if (strcmp(&(*a)->s, "none") == 0) return BA_NONE; if (strcmp(&(*a)->s, "mute") == 0) return BA_MUTE; if (strcmp(&(*a)->s, "clamp") == 0) return BA_CLAMP; if (strcmp(&(*a)->s, "fold") == 0) return BA_FOLD; if (strcmp(&(*a)->s, "wrap") == 0) return BA_WRAP; return -1; } int mapper_msg_get_mute(mapper_message_t *msg) { lo_arg **a = mapper_msg_get_param(msg, AT_MUTE); const char *t = mapper_msg_get_type(msg, AT_MUTE); if (!a || !*a || !t) return -1; if (*t == 'i') return (*a)->i; else if (*t == LO_TRUE) return 1; else if (*t == LO_FALSE) return 0; else return -1; } // Helper for setting property value from different lo_arg types int propval_set_from_lo_arg(void *dest, const char dest_type, lo_arg *src, const char src_type, int index) { if (dest_type == 'f') { float *temp = (float*)dest; if (src_type == 'f') { if (temp[index] != src->f) { temp[index] = src->f; return 1; } } else if (src_type == 'i') { if (temp[index] != (float)src->i) { temp[index] = (float)src->i; return 1; } } else if (src_type == 'd') { if (temp[index] != (float)src->d) { temp[index] = (float)src->d; return 1; } } else return -1; } else if (dest_type == 'i') { int *temp = (int*)dest; if (src_type == 'f') { if (temp[index] != (int)src->f) { temp[index] = (int)src->f; return 1; } } else if (src_type == 'i') { if (temp[index] != src->i) { temp[index] = src->i; return 1; } } else if (src_type == 'd') { if (temp[index] != (int)src->d) { temp[index] = (int)src->d; return 1; } } else return -1; } else if (dest_type == 'd') { double *temp = (double*)dest; if (src_type == 'f') { if (temp[index] != (double)src->f) { temp[index] = (double)src->f; return 1; } } else if (src_type == 'i') { if (temp[index] != (double)src->i) { temp[index] = (double)src->i; return 1; } } else if (src_type == 'd') { if (temp[index] != src->d) { temp[index] = src->d; return 1; } } else return -1; } else return -1; return 0; } void mapper_prop_pp(char type, int length, const void *value) { int i; if (!value || length < 1) return; if (length > 1) printf("["); switch (type) { case 's': case 'S': { if (length == 1) printf("'%s', ", (char*)value); else { char **ps = (char**)value; for (i = 0; i < length; i++) printf("'%s', ", ps[i]); } break; } case 'f': { float *pf = (float*)value; for (i = 0; i < length; i++) printf("%f, ", pf[i]); break; } case 'i': { int *pi = (int*)value; for (i = 0; i < length; i++) printf("%d, ", pi[i]); break; } case 'd': { double *pd = (double*)value; for (i = 0; i < length; i++) printf("%f, ", pd[i]); break; } case 'h': { int64_t *pi = (int64_t*)value; for (i = 0; i < length; i++) printf("%lli, ", pi[i]); break; } case 't': { mapper_timetag_t *pt = (mapper_timetag_t*)value; for (i = 0; i < length; i++) printf("%f, ", mapper_timetag_get_double(pt[i])); break; } case 'c': { char *pi = (char*)value; for (i = 0; i < length; i++) printf("%c, ", pi[i]); break; } default: break; } if (length > 1) printf("\b\b]"); else printf("\b\b"); } libmapper/src/mapper_internal.h0000644000175000017500000011411512423630127016144 0ustar tiagotiago #ifndef __MAPPER_INTERNAL_H__ #define __MAPPER_INTERNAL_H__ #include "types_internal.h" #include // Structs that refer to things defined in mapper.h are declared here // instead of in types_internal.h /**** Signals ****/ struct _mapper_signal_id_map_t; /*! A signal is defined as a vector of values, along with some * metadata. */ struct _mapper_signal { /*! Properties of this signal. */ mapper_db_signal_t props; /*! The device associated with this signal. */ struct _mapper_device *device; /*! ID maps and active instances. */ struct _mapper_signal_id_map *id_maps; int id_map_length; /*! Array of pointers to the signal instances. */ struct _mapper_signal_instance **instances; /*! Bitflag value when entire signal vector is known. */ char *has_complete_value; /*! Type of voice stealing to perform on instances. */ mapper_instance_allocation_type instance_allocation_type; /*! An optional function to be called when the signal value * changes. */ mapper_signal_update_handler *handler; /*! An optional function to be called when the signal instance management * events occur. */ mapper_signal_instance_event_handler *instance_event_handler; /*! Flags for deciding when to call the instance event handler. */ int instance_event_flags; }; /**** Devices ****/ struct _mapper_device { mapper_db_device_t props; //!< Properties. mapper_admin_allocated_t ordinal; /*!< A unique ordinal for this * device instance. */ int registered; /*!< Non-zero if this device has * been registered. */ /*! Non-zero if this device is the sole owner of this admin, i.e., * it was created during mdev_new() and should be freed during * mdev_free(). */ int own_admin; mapper_admin admin; struct _mapper_signal **inputs; struct _mapper_signal **outputs; int n_alloc_inputs; int n_alloc_outputs; int n_output_callbacks; int version; int flags; /*!< Bitflags indicating if information has already been * sent in a given polling step. */ mapper_router routers; mapper_receiver receivers; /*! Function to call for custom link handling. */ mapper_device_link_handler *link_cb; void *link_cb_userdata; /*! Function to call for custom connection handling. */ mapper_device_connection_handler *connection_cb; void *connection_cb_userdata; /*! The list of active instance id mappings. */ struct _mapper_id_map *active_id_map; /*! The list of reserve instance id mappings. */ struct _mapper_id_map *reserve_id_map; uint32_t id_counter; int link_timeout_sec; /* Number of seconds after which unresponsive * links will be removed, or 0 for never. */ /*! Server used to handle incoming messages. */ lo_server server; }; /**** Instances ****/ /*! A signal instance is defined as a vector of values, along with some * metadata. */ typedef struct _mapper_signal_instance { /*! User-assignable instance id. */ int id; /*! Index for accessing associated value history */ int index; /*! Status of this instance. */ int is_active; /*! User data of this instance. */ void *user_data; /*! The instance's creation timestamp. */ mapper_timetag_t creation_time; /*! Indicates whether this instance has a value. */ int has_value; char *has_value_flags; /*! The current value of this signal instance. */ void *value; /*! The timetag associated with the current value. */ mapper_timetag_t timetag; } mapper_signal_instance_t, *mapper_signal_instance; /*! Bit flags for indicating signal instance status. */ #define IN_RELEASED_LOCALLY 0x01 #define IN_RELEASED_REMOTELY 0x02 typedef struct _mapper_signal_id_map { /*! Pointer to id_map in use */ struct _mapper_id_map *map; /*! Pointer to signal instance. */ struct _mapper_signal_instance *instance; /*! Status of the id_map. Can be either 0 or a combination of * IN_RELEASED_LOCALLY and IN_RELEASED_REMOTELY. */ int status; } mapper_signal_id_map_t; // Mapper internal functions /**** Admin ****/ void mapper_admin_add_device(mapper_admin admin, mapper_device dev); void mapper_admin_add_monitor(mapper_admin admin, mapper_monitor mon); void mapper_admin_remove_monitor(mapper_admin admin, mapper_monitor mon); int mapper_admin_poll(mapper_admin admin); void mapper_admin_set_bundle_dest_bus(mapper_admin admin); void mapper_admin_set_bundle_dest_mesh(mapper_admin admin, lo_address address); void mapper_admin_set_bundle_dest_subscribers(mapper_admin admin, int type); void mapper_admin_send_bundle(mapper_admin admin); void mapper_admin_send_signal(mapper_admin admin, mapper_device md, mapper_signal sig); void mapper_admin_send_signal_removed(mapper_admin admin, mapper_device md, mapper_signal sig); /*! Macro for calling message-sending function. */ #define mapper_admin_bundle_message(...) \ _real_mapper_admin_bundle_message(__VA_ARGS__, N_AT_PARAMS) /*! Message-sending function, not to be called directly. */ void _real_mapper_admin_bundle_message(mapper_admin admin, int msg_index, const char *path, const char *types, ...); /*! Message-sending function which appends a parameter list at the end. */ void _real_mapper_admin_bundle_message_with_params(mapper_admin admin, mapper_message_t *params, mapper_string_table_t *extra, int msg_index, const char *path, const char *types, ...); #define mapper_admin_bundle_message_with_params(...) \ _real_mapper_admin_bundle_message_with_params(__VA_ARGS__, N_AT_PARAMS) /***** Device *****/ void mdev_registered(mapper_device md); void mdev_add_signal_methods(mapper_device md, mapper_signal sig); void mdev_remove_signal_methods(mapper_device md, mapper_signal sig); void mdev_add_instance_release_request_callback(mapper_device md, mapper_signal sig); void mdev_remove_instance_release_request_callback(mapper_device md, mapper_signal sig); void mdev_num_instances_changed(mapper_device md, mapper_signal sig, int size); void mdev_route_signal(mapper_device md, mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t tt); int mdev_route_query(mapper_device md, mapper_signal sig, mapper_timetag_t tt); void mdev_route_released(mapper_device md, mapper_signal sig, int instance_index, mapper_timetag_t tt); void mdev_add_router(mapper_device md, mapper_router rt); void mdev_remove_router(mapper_device md, mapper_router rt); void mdev_add_receiver(mapper_device md, mapper_receiver r); void mdev_remove_receiver(mapper_device md, mapper_receiver r); void mdev_receive_update(mapper_device md, mapper_signal sig, int instance_index, mapper_timetag_t tt); void mdev_release_scope(mapper_device md, const char *scope); void mdev_start_server(mapper_device mdev, int port); void mdev_on_id_and_ordinal(mapper_device md, mapper_admin_allocated_t *resource); mapper_id_map mdev_add_instance_id_map(mapper_device device, int local_id, int origin, int public_id); void mdev_remove_instance_id_map(mapper_device device, mapper_id_map map); mapper_id_map mdev_find_instance_id_map_by_local(mapper_device device, int local_id); mapper_id_map mdev_find_instance_id_map_by_remote(mapper_device device, int origin, int public_id); const char *mdev_name(mapper_device md); /***** Router *****/ mapper_router mapper_router_new(mapper_device device, const char *host, int admin_port, int data_port, const char *name); void mapper_router_free(mapper_router router); /*! Set a router's properties based on message parameters. */ int mapper_router_set_from_message(mapper_router router, mapper_message_t *msg); void mapper_router_num_instances_changed(mapper_router r, mapper_signal sig, int size); /*! For a given connection instance, construct a mapped signal and * send it on to the destination. */ void mapper_router_process_signal(mapper_router r, mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t timetag); lo_message mapper_router_build_message(void *value, int length, char type, char *typestring, mapper_id_map id_map); int mapper_router_send_query(mapper_router router, mapper_signal sig, mapper_timetag_t tt); mapper_connection mapper_router_add_connection(mapper_router router, mapper_signal sig, const char *dest_name, char dest_type, int dest_length); int mapper_router_remove_connection(mapper_router router, mapper_connection connection); /*! Find a connection in a router by source and destination signal names. */ mapper_connection mapper_router_find_connection_by_names(mapper_router rt, const char* src_name, const char* dest_name); int mapper_router_in_scope(mapper_router router, uint32_t origin); /*! Find a router by destination address in a linked list of routers. */ mapper_router mapper_router_find_by_dest_address(mapper_router routers, const char *host, int port); /*! Find a router by destination device name in a linked list of routers. */ mapper_router mapper_router_find_by_dest_name(mapper_router routers, const char *dest_name); /*! Find a router by destination device hash in a linked list of routers. */ mapper_router mapper_router_find_by_dest_hash(mapper_router routers, uint32_t hash); void mapper_router_start_queue(mapper_router router, mapper_timetag_t tt); void mapper_router_send_queue(mapper_router router, mapper_timetag_t tt); /***** Receiver *****/ mapper_receiver mapper_receiver_new(mapper_device device, const char *host, int admin_port, int data_port, const char *name); void mapper_receiver_free(mapper_receiver receiver); /*! Set a router's properties based on message parameters. */ int mapper_receiver_set_from_message(mapper_receiver receiver, mapper_message_t *msg); void mapper_receiver_send_update(mapper_receiver r, mapper_signal sig, int instance_index, mapper_timetag_t tt); void mapper_receiver_send_released(mapper_receiver r, mapper_signal sig, int instance_index, mapper_timetag_t tt); mapper_connection mapper_receiver_add_connection(mapper_receiver receiver, mapper_signal sig, const char *src_name, char src_type, int src_length); int mapper_receiver_remove_connection(mapper_receiver receiver, mapper_connection connection); /*! Find a connection in a receiver by source and destination signal names. */ mapper_connection mapper_receiver_find_connection_by_names(mapper_receiver rc, const char* src_name, const char* dest_name); int mapper_receiver_in_scope(mapper_receiver receiver, uint32_t origin); /*! Find a receiver by source address in a linked list of receivers. */ mapper_receiver mapper_receiver_find_by_src_address(mapper_receiver receivers, const char *host, int port); /*! Find a receiver by source device name in a linked list of receivers. */ mapper_receiver mapper_receiver_find_by_src_name(mapper_receiver receivers, const char *src_name); /*! Find a receiver by source device hash in a linked list of receivers. */ mapper_receiver mapper_receiver_find_by_src_hash(mapper_receiver receivers, uint32_t hash); int mapper_receiver_add_scope(mapper_receiver receiver, const char *scope); int mapper_receiver_remove_scope(mapper_receiver receiver, const char *scope); /**** Signals ****/ /*! Create a signal structure and fill it with provided * arguments. Values and strings pointed to by this call (except * user_data) will be copied. Signals should be freed by msig_free() * only if they are not registered with a device. * For minimum, maximum, and value, if type='f', should be float*, or * if type='i', then should be int*. * \param name The name of the signal, starting with '/'. * \param length The length of the signal vector, or 1 for a scalar. * \param type The type fo the signal value. * \param is_output The direction of the signal, 1 for output, 0 for input. * \param unit The unit of the signal, or 0 for none. * \param minimum Pointer to a minimum value, or 0 for none. * \param maximum Pointer to a maximum value, or 0 for none. * \param number of signal instances. * \param handler Function to be called when the value of the * signal is updated. * \param user_data User context pointer to be passed to handler. */ mapper_signal msig_new(const char *name, int length, char type, int is_output, const char *unit, void *minimum, void *maximum, int num_instances, mapper_signal_update_handler *handler, void *user_data); /*! Free memory used by a mapper_signal. Call this only for signals * that are not registered with a device. Registered signals will be * freed by mdev_free(). * \param sig The signal to free. */ void msig_free(mapper_signal sig); /*! Coerce a signal instance value to a particular type and vector length * and add it to a lo_message. */ void message_add_coerced_signal_instance_value(lo_message m, mapper_signal sig, mapper_signal_instance si, int length, const char type); /**** Instances ****/ /*! Store an instance id_map record. * \param sig The signal owning the instance. * \param si A pointer to the signal instance structure. * \param map The id map matched to this instance. * \return The index at which the record was stored. */ int msig_add_id_map(mapper_signal sig, mapper_signal_instance si, mapper_id_map map); /*! Find an active instance with the given instance ID. * \param sig The signal owning the desired instance. * \param id The requested signal instance ID. * \param flags Bitflags indicating if search should include released instances. * \return The index of the retrieved signal instance, or -1 if no active * instances match the specified instance ID. */ int msig_find_instance_with_local_id(mapper_signal sig, int id, int flags); /*! Find an active instance with the given instance ID. * \param sig The signal owning the desired instance. * \param origin Unique hash identifying the device that activated this instance. * \param public_id The public id of this instance. * \param flags Bitflags indicating if search should include released instances. * \return The index of the retrieved signal instance, or -1 if no active * instances match the specified instance ID map. */ int msig_find_instance_with_remote_ids(mapper_signal sig, int origin, int public_id, int flags); /*! Fetch a reserved (preallocated) signal instance using an instance id, * activating it if necessary. * \param sig The signal owning the desired instance. * \param id The requested signal instance ID. * \param flags Bitflags indicating if search should include released instances. * \param tt Timetag associated with this action. * \return The index of the retrieved signal instance, or -1 if no free * instances were available and allocation of a new instance * was unsuccessful according to the selected allocation * strategy. */ int msig_get_instance_with_local_id(mapper_signal sig, int id, int flags, mapper_timetag_t *tt); /*! Fetch a reserved (preallocated) signal instance using instance id map, * activating it if necessary. * \param sig The signal owning the desired instance. * \param origin Unique hash identifying the device that activated this instance. * \param public_id The public id of this instance. * \param flags Bitflags indicating if search should include released instances. * \param tt Timetag associated with this action. * \return The index of the retrieved signal instance, or NULL if no free * instances were available and allocation of a new instance * was unsuccessful according to the selected allocation * strategy. */ int msig_get_instance_with_remote_ids(mapper_signal sig, int origin, int public_id, int flags, mapper_timetag_t *tt); /*! Release a specific signal instance. */ void msig_release_instance_internal(mapper_signal sig, int instance_index, mapper_timetag_t timetag); /**** connections ****/ /*! Perform the connection from a value vector to a scalar. The * result of this operation should be sent to the destination. * \param connection The mapping process to perform. * \param from_value Pointer to current value of the source signal. * \param to_value Pointer to a value to receive the result. * \return Zero if the operation was muted, or one if it was performed. */ int mapper_connection_perform(mapper_connection connection, mapper_signal_history_t *from_value, mapper_signal_history_t **expr_vars, mapper_signal_history_t *to_value, char *typestring); int mapper_boundary_perform(mapper_connection connection, mapper_signal_history_t *from_value); /*! Set a connection's properties based on message parameters. */ int mapper_connection_set_from_message(mapper_connection connection, mapper_message_t *msg); void mapper_connection_set_mode_direct(mapper_connection connection); void mapper_connection_set_mode_linear(mapper_connection connection); void mapper_connection_set_mode_expression(mapper_connection connection, const char *expr); void mapper_connection_set_mode_calibrate(mapper_connection connection); const char *mapper_get_boundary_action_string(mapper_boundary_action bound); const char *mapper_get_mode_type_string(mapper_mode_type mode); /**** Local device database ****/ /*! Add or update an entry in the device database using parsed message * parameters. * \param db The database to operate on. * \param device_name The name of the device. * \param params The parsed message parameters containing new device * information. * \param current_time The current time. * \return Non-zero if device was added to the database, or * zero if it was already present. */ int mapper_db_add_or_update_device_params(mapper_db db, const char *device_name, mapper_message_t *params, mapper_timetag_t *current_time); /*! Add or update an entry in the signal database using parsed message * parameters. * \param db The database to operate on. * \param signal_name The name of the signal. * \param device_name The name of the device associated with this signal. * \param params The parsed message parameters containing new signal * information. * \return Non-zero if signal was added to the database, or * zero if it was already present. */ int mapper_db_add_or_update_signal_params(mapper_db db, const char *signal_name, const char *device_name, mapper_message_t *params); /*! Initialize an already-allocated mapper_db_signal structure. */ void mapper_db_signal_init(mapper_db_signal sig, int is_output, char type, int length, const char *name, const char *unit); /*! Add or update an entry in the connection database using parsed * message parameters. * \param db The database to operate on. * \param src_name The full name of the source signal. * \param dest_name The full name of the destination signal. * \param params The parsed message parameters containing new * connection information. * \return Non-zero if connection was added to the database, * or zero if it was already present. */ int mapper_db_add_or_update_connection_params(mapper_db db, const char *src_name, const char *dest_name, mapper_message_t *params); /*! Remove a named device from the database if it exists. */ void mapper_db_remove_device_by_name(mapper_db db, const char *name); /*! Remove a named input signal from the database if it exists. */ void mapper_db_remove_input_by_name(mapper_db db, const char *dev_name, const char *sig_name); /*! Remove a named output signal from the database if it exists. */ void mapper_db_remove_output_by_name(mapper_db db, const char *dev_name, const char *sig_name); /*! Remove signals in the provided query. */ void mapper_db_remove_inputs_by_query(mapper_db db, mapper_db_signal_t **s); /*! Remove signals in the provided query. */ void mapper_db_remove_outputs_by_query(mapper_db db, mapper_db_signal_t **s); /*! Remove connections in the provided query. */ void mapper_db_remove_connections_by_query(mapper_db db, mapper_db_connection_t **c); /*! Remove a specific connection from the database. */ void mapper_db_remove_connection(mapper_db db, mapper_db_connection map); /*! Remove links in the provided query. */ void mapper_db_remove_links_by_query(mapper_db db, mapper_db_link_t **s); /*! Remove a specific link from the database. */ void mapper_db_remove_link(mapper_db db, mapper_db_link map); /*! Dump device information database to the screen. Useful for * debugging, only works when compiled in debug mode. */ void mapper_db_dump(mapper_db db); void mapper_db_remove_all_callbacks(mapper_db db); /*! Check device records for unresponsive devices. */ void mapper_db_check_device_status(mapper_db db, uint32_t now_sec); /*! Flush device records for unresponsive devices. */ int mapper_db_flush(mapper_db db, uint32_t current_time, uint32_t timeout, int quiet); /**** Links ****/ /*! Add or update an entry in the link database using parsed message * parameters. * \param db The database to operate on. * \param src_name The name of the source device. * \param dest_name The name of the destination device. * \param params The parsed message parameters containing new link * information. * \return Non-zero if link was added to the database, or * zero if it was already present. */ int mapper_db_add_or_update_link_params(mapper_db db, const char *src_name, const char *dest_name, mapper_message_t *params); /*! Add a scope identifier to a given link record. */ int mapper_db_link_add_scope(mapper_db_link link, const char *scope); /*! Remove a scope identifier from a given link record. */ int mapper_db_link_remove_scope(mapper_db_link link, const char *scope); /**** Connections ****/ void mhist_realloc(mapper_signal_history_t *history, int history_size, int sample_size, int is_output); /**** Messages ****/ /*! Parse a message based on an OSC path and parameters. * \param msg Structure to receive parameter info. * \param path String containing message address. * \param types String containing message parameter types. * \param argc Number of arguments in the argv array. * \param argv Vector of lo_arg structures. * \return Non-zero indicates error in parsing. */ int mapper_msg_parse_params(mapper_message_t *msg, const char *path, const char *types, int argc, lo_arg **argv); /*! Look up the value of a message parameter by symbolic identifier. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \return Pointer to lo_arg, or zero if not found. */ lo_arg** mapper_msg_get_param(mapper_message_t *msg, mapper_msg_param_t param); /*! Look up the type of a message parameter by symbolic identifier. * Note that it's possible the returned type string will be longer * than the actual contents pointed to; it is up to the usage of this * function to ensure it only processes the a priori expected number * of parameters. The number of parameter elements can be retrieved * using the function mapper_msg_get_length(). * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \return String containing type of each parameter argument. */ const char* mapper_msg_get_type(mapper_message_t *msg, mapper_msg_param_t param); /*! Look up the vector length of a message parameter by symbolic identifier. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \return Integer containing the length of the parameter vector. */ int mapper_msg_get_length(mapper_message_t *msg, mapper_msg_param_t param); /*! Helper to get a direct parameter value only if it's a string. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \return A string containing the parameter value or zero if * not found. */ const char* mapper_msg_get_param_if_string(mapper_message_t *msg, mapper_msg_param_t param); /*! Helper to get a direct parameter value only if it's a char type, * or if it's a string of length one. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \return A string containing the parameter value or zero if * not found. */ const char* mapper_msg_get_param_if_char(mapper_message_t *msg, mapper_msg_param_t param); /*! Helper to get a direct parameter value only if it's an int. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \param value Location of int to receive value. * \return Zero if not found, otherwise non-zero. */ int mapper_msg_get_param_if_int(mapper_message_t *msg, mapper_msg_param_t param, int *value); /*! Helper to get a direct parameter value only if it's a float. * \param msg Structure containing parameter info. * \param param Symbolic identifier of the parameter to look for. * \param value Location of float to receive value. * \return Zero if not found, otherwise non-zero. */ int mapper_msg_get_param_if_float(mapper_message_t *msg, mapper_msg_param_t param, float *value); /*! Helper to return the boundary action from a message parameter. * \param msg Structure containing parameter info. * \param param Either AT_BOUND_MIN or AT_BOUND_MAX. * \return The boundary action, or -1 if not found. */ mapper_boundary_action mapper_msg_get_boundary_action(mapper_message_t *msg, mapper_msg_param_t param); /*! Helper to return the signal direction from a message parameter. * \param msg Structure containing parameter info. * \return 0 for input, 1 for output, or -1 if not found. */ mapper_mode_type mapper_msg_get_direction(mapper_message_t *msg); /*! Helper to return the mode type from a message parameter. * \param msg Structure containing parameter info. * \return The mode type, or -1 if not found. */ mapper_mode_type mapper_msg_get_mode(mapper_message_t *msg); /*! Helper to return the 'mute' state from a message parameter. * \param msg Structure containing parameter info. * \return The muted state (0 or 1), or -1 if not found. */ int mapper_msg_get_mute(mapper_message_t *msg); /*! Store 'extra' parameters specified in a mapper_message to a table. * \param t Table to edit. * \param params Message containing parameters. * \return The number of parameters added or modified. */ int mapper_msg_add_or_update_extra_params(table t, mapper_message_t *params); /*! Prepare a lo_message for sending based on a vararg list of * parameter pairs. */ void mapper_msg_prepare_varargs(lo_message m, va_list aq); /*! Prepare a lo_message for sending based on a set of parameters. */ void mapper_msg_prepare_params(lo_message m, mapper_message_t *params); /*! Prepare a lo_message for sending based on a connection struct. */ void mapper_link_prepare_osc_message(lo_message m, mapper_router router); /*! Prepare a lo_message for sending based on a connection struct. */ void mapper_connection_prepare_osc_message(lo_message m, mapper_connection c); // Helper for setting property value from different lo_arg types int propval_set_from_lo_arg(void *dest, const char dest_type, lo_arg *src, const char src_type, int index); /**** Expression parser/evaluator ****/ mapper_expr mapper_expr_new_from_string(const char *str, char input_type, char output_type, int input_vector_size, int output_vector_size); int mapper_expr_input_history_size(mapper_expr expr); int mapper_expr_output_history_size(mapper_expr expr); int mapper_expr_num_variables(mapper_expr expr); int mapper_expr_variable_history_size(mapper_expr expr, int index); int mapper_expr_variable_vector_length(mapper_expr expr, int index); #ifdef DEBUG void printexpr(const char*, mapper_expr); #endif int mapper_expr_evaluate(mapper_expr expr, mapper_signal_history_t *from_value, mapper_signal_history_t **expr_vars, mapper_signal_history_t *to_value, char *typestring); int mapper_expr_constant_output(mapper_expr expr); void mapper_expr_free(mapper_expr expr); /**** String tables ****/ /*! Create a new string table. */ table table_new(); /*! Free a string table. * \param t Table to free. * \param free_values Non-zero to free all values, otherwise zero. */ void table_free(table t, int free_values); /*! Add a string to a table. */ void table_add(table t, const char *key, void *value, int is_mapper_prop); /*! Sort a table. Call this after table_add and before table_find. */ void table_sort(table t); /*! Look up a value in a table. Returns 0 if found, 1 if not found, * and fills in value if found. */ int table_find(table t, const char *key, void **value); /*! Look up a value in a table. Returns the value directly, which may * be zero, but also returns 0 if not found. */ void *table_find_p(table t, const char *key); /*! Look up a value in a table. Returns a pointer to the value, * allowing it to be modified in-place. Returns 0 if not found. */ void **table_find_pp(table t, const char *key); /*! Remove a key-value pair from a table (by key). free_key is * non-zero to indicate that key should be free()'d. */ void table_remove_key(table t, const char *key, int free_key); /*! Get the value at a particular index. */ void *table_value_at_index_p(table t, unsigned int index); /*! Get the key at a particular index. */ const char *table_key_at_index(table t, unsigned int index); /*! Update a value in a table if the key already exists, or add it * otherwise. Returns 0 if no add took place. Sorts the table * before exiting, so this should be considered a longer operation * than table_add. */ int table_add_or_update(table t, const char *key, void *value); #ifdef DEBUG /*! Dump a table of OSC values. */ void table_dump_osc_values(table t); #endif /*! Add a typed OSC argument from a mapper_msg to a string table. * \param t Table to update. * \param key Key to store. * \param type OSC type of value to add. * \param arg Array of OSC values to add * \param length Number of OSC argument in array * \return The number of table values added or modified. */ int mapper_table_add_or_update_msg_value(table t, const char *key, lo_type type, lo_arg **args, int length); /*! Add a typed argument to a string table. * \param t Table to update. * \param key Key to store. * \param type OSC type of value to add. * \param arg Value(s) to add * \param length Number of OSC argument in array * \return The number of table values added or modified. */ int mapper_table_add_or_update_typed_value(table t, const char *key, char type, void *args, int length); /*! Add arguments contained in a string table to a lo_message */ void mapper_msg_add_value_table(lo_message m, table t); /**** Clock synchronization ****/ /*! Initialize a mapper_clock. */ void mapper_clock_init(mapper_clock clock); /*! Get the current time from a mapper_clock. */ void mapper_clock_now(mapper_clock clock, mapper_timetag_t *timetag); /**** Debug macros ****/ /*! Debug tracer */ #ifdef DEBUG #ifdef __GNUC__ #include #include #define trace(...) { printf("-- " __VA_ARGS__); } #define die_unless(a, ...) { if (!(a)) { printf("-- " __VA_ARGS__); assert(a); } } #else static void trace(...) { }; static void die_unless(...) {}; #endif #else #ifdef __GNUC__ #define trace(...) {} #define die_unless(...) {} #else static void trace(...) { }; static void die_unless(...) {}; #endif #endif /*! Helper to find size of signal value types. */ inline static int mapper_type_size(char type) { switch (type) { case 'i': return sizeof(int); case 'f': return sizeof(float); case 'd': return sizeof(double); case 's': case 'S': return sizeof(char*); case 'h': return sizeof(int64_t); case 't': return sizeof(mapper_timetag_t); case 'c': return sizeof(char); default: die_unless(0, "getting size of unknown type %c\n", type); return 0; } } /*! Helper to find the size in bytes of a signal's full vector. */ inline static size_t msig_vector_bytes(mapper_signal sig) { return mapper_type_size(sig->props.type) * sig->props.length; } /*! Helper to find the pointer to the current value in a mapper_signal_history_t. */ inline static void* msig_history_value_pointer(mapper_signal_history_t h) { return h.value + h.position * h.length * mapper_type_size(h.type); } /*! Helper to find the pointer to the current timetag in a mapper_signal_history_t. */ inline static void* msig_history_tt_pointer(mapper_signal_history_t h) { return &h.timetag[h.position]; } #endif // __MAPPER_INTERNAL_H__ libmapper/src/receiver.c0000644000175000017500000004433612423630127014572 0ustar tiagotiago #include #include #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include mapper_receiver mapper_receiver_new(mapper_device device, const char *host, int admin_port, int data_port, const char *name) { char str[16]; mapper_receiver r = (mapper_receiver) calloc(1, sizeof(struct _mapper_link)); r->props.src_host = strdup(host); r->props.src_port = data_port; sprintf(str, "%d", data_port); r->data_addr = lo_address_new(host, str); sprintf(str, "%d", admin_port); r->admin_addr = lo_address_new(host, str); r->props.src_name = strdup(name); r->props.src_name_hash = crc32(0L, (const Bytef *)name, strlen(name)); r->props.dest_name = strdup(mdev_name(device)); r->props.num_scopes = 1; r->props.scope_names = (char **) malloc(sizeof(char *)); r->props.scope_names[0] = strdup(name); r->props.scope_hashes = (uint32_t *) malloc(sizeof(uint32_t)); r->props.scope_hashes[0] = crc32(0L, (const Bytef *)name, strlen(name)); r->props.extra = table_new(); r->device = device; r->signals = 0; r->num_connections = 0; r->clock.new = 1; r->clock.sent.message_id = 0; r->clock.response.message_id = -1; if (!r->data_addr) { mapper_receiver_free(r); return 0; } return r; } void mapper_receiver_free(mapper_receiver r) { int i; if (r) { if (r->props.src_name) free(r->props.src_name); if (r->props.src_host) free(r->props.src_host); if (r->admin_addr) lo_address_free(r->admin_addr); if (r->data_addr) lo_address_free(r->data_addr); if (r->props.dest_name) free(r->props.dest_name); while (r->signals && r->signals->connections) { // receiver_signal is freed with last child connection mapper_receiver_remove_connection(r, r->signals->connections); } for (i=0; iprops.num_scopes; i++) { free(r->props.scope_names[i]); } free(r->props.scope_names); free(r->props.scope_hashes); if (r->props.extra) table_free(r->props.extra, 1); free(r); } } /*! Set a router's properties based on message parameters. */ int mapper_receiver_set_from_message(mapper_receiver r, mapper_message_t *msg) { int i, j, num_scopes, updated = 0; lo_arg **a_scopes = mapper_msg_get_param(msg, AT_SCOPE); num_scopes = mapper_msg_get_length(msg, AT_SCOPE); if (num_scopes) { // First remove old scopes that are missing for (i=0; iprops.num_scopes; i++) { int found = 0; for (j=0; jprops.scope_names[i], &a_scopes[j]->s) == 0) { found = 1; break; } } if (!found) { mapper_db_link_remove_scope(&r->props, r->props.scope_names[i]); updated++; } } // ...then add any new scopes for (i=0; iprops, &a_scopes[i]->s)); if (num_scopes != r->props.num_scopes) { r->props.num_scopes = num_scopes; } } updated += mapper_msg_add_or_update_extra_params(r->props.extra, msg); return updated; } void mapper_receiver_send_update(mapper_receiver r, mapper_signal sig, int instance_index, mapper_timetag_t tt) { // TODO: check vector has_values flags, include defined elements even if !has_value? int count=0; mapper_id_map map = sig->id_maps[instance_index].map; if (!map) return; int in_scope = map ? mapper_receiver_in_scope(r, map->origin) : 0; // find the signal connection mapper_receiver_signal rc = r->signals; while (rc) { if (rc->signal == sig) break; rc = rc->next; } if (!rc) return; mapper_connection c = rc->connections; while (c) { if (c->props.mode == MO_REVERSE) count++; c = c->next; } if (!count) return; lo_bundle b = lo_bundle_new(tt); c = rc->connections; while (c) { if (c->props.mode != MO_REVERSE || (c->props.send_as_instance && !in_scope)) { c = c->next; continue; } lo_message m = lo_message_new(); if (!m) return; mapper_signal_instance si = sig->id_maps[instance_index].instance; message_add_coerced_signal_instance_value(m, sig, si, c->props.src_length, c->props.src_type); if (c->props.send_as_instance) { lo_message_add_string(m, "@instance"); lo_message_add_int32(m, map->origin); lo_message_add_int32(m, map->public); } lo_bundle_add_message(b, c->props.query_name, m); c = c->next; } lo_send_bundle(r->data_addr, b); lo_bundle_free_messages(b); } void mapper_receiver_send_released(mapper_receiver r, mapper_signal sig, int instance_index, mapper_timetag_t tt) { mapper_receiver_signal rs = r->signals; mapper_connection c; mapper_id_map map = sig->id_maps[instance_index].map; if (!mapper_receiver_in_scope(r, map->origin)) return; while (rs) { if (rs->signal == sig) break; rs = rs->next; } if (!rs) return; lo_bundle b = lo_bundle_new(tt); c = rs->connections; int i; while (c) { lo_message m = lo_message_new(); if (!m) return; for (i = 0; i < c->props.src_length; i++) lo_message_add_nil(m); lo_message_add_string(m, "@instance"); lo_message_add_int32(m, map->origin); lo_message_add_int32(m, map->public); lo_bundle_add_message(b, c->props.src_name, m); c = c->next; } if (lo_bundle_count(b)) lo_send_bundle_from(r->data_addr, r->device->server, b); lo_bundle_free_messages(b); } mapper_connection mapper_receiver_add_connection(mapper_receiver r, mapper_signal sig, const char *src_name, char src_type, int src_length) { // find signal in signal connection list mapper_receiver_signal rs = r->signals; while (rs && rs->signal != sig) rs = rs->next; // if not found, create a new list entry if (!rs) { rs = (mapper_receiver_signal) calloc(1, sizeof(struct _mapper_link_signal)); rs->signal = sig; rs->next = r->signals; r->signals = rs; } mapper_connection c = (mapper_connection) calloc(1, sizeof(struct _mapper_connection)); c->props.src_name = strdup(src_name); c->props.src_type = src_type; c->props.src_length = src_length; c->props.dest_name = strdup(sig->props.name); c->props.dest_type = sig->props.type; c->props.dest_length = sig->props.length; c->props.mode = MO_UNDEFINED; c->props.expression = 0; c->props.bound_min = BA_NONE; c->props.bound_max = BA_NONE; c->props.muted = 0; c->props.src_min = 0; c->props.src_max = 0; c->props.dest_min = 0; c->props.dest_max = 0; c->props.range_known = 0; c->props.extra = table_new(); int len = strlen(src_name) + 5; c->props.query_name = malloc(len); snprintf(c->props.query_name, len, "%s%s", src_name, "/got"); // add new connection to this signal's list c->next = rs->connections; rs->connections = c; c->parent = rs; r->num_connections++; return c; } static void mapper_receiver_free_connection(mapper_receiver r, mapper_connection c) { int i, j; if (r && c) { if (c->props.src_name) free(c->props.src_name); if (c->props.dest_name) free(c->props.dest_name); if (c->expr) mapper_expr_free(c->expr); if (c->props.expression) free(c->props.expression); if (c->props.query_name) free(c->props.query_name); if (c->props.src_min) free(c->props.src_min); if (c->props.src_max) free(c->props.src_max); if (c->props.dest_min) free(c->props.dest_min); if (c->props.dest_max) free(c->props.dest_max); table_free(c->props.extra, 1); for (i=0; iparent->num_instances; i++) { free(c->history[i].value); free(c->history[i].timetag); if (c->num_expr_vars) { for (j=0; jnum_expr_vars; j++) { free(c->expr_vars[i][j].value); free(c->expr_vars[i][j].timetag); } free(c->expr_vars[i]); } } if (c->expr_vars) free(c->expr_vars); if (c->history) free(c->history); free(c); r->num_connections--; return; } } int mapper_receiver_remove_connection(mapper_receiver r, mapper_connection c) { int i = 0, j, found = 0, count = 0; mapper_receiver_signal rs = c->parent; /* Release signal instances owned by remote device. This is a bit tricky * since there may be other remote signals connected to this signal. * We will check: a) if the parent link contains other connections to * the target signal of this connection, and b) if other links contain * connections to this signal. In the latter case, we can still release * instances scoped uniquely to this connection's receiver. */ // TODO: this situation should be avoided using e.g. signal "slots" mapper_connection *ctemp = &c->parent->connections; while (*ctemp) { i++; ctemp = &(*ctemp)->next; } if (i <= 1 && c->parent->signal) { /* need to compile a list of scopes used by this link not used by other * links including connections to this signal. */ int count = 0; int *scope_matches = (int *) calloc(1, sizeof(int) * r->props.num_scopes); mapper_receiver rtemp = r->device->receivers; while (rtemp) { if (rtemp == r) { rtemp = rtemp->next; continue; } mapper_receiver_signal stemp = rtemp->signals; while (stemp) { if (stemp->signal == rs->signal) { // check if scopes are shared for (i=0; iprops.num_scopes; i++) { if (mapper_receiver_in_scope(r, rtemp->props.scope_hashes[i])) { if (scope_matches[i] == 0) { count++; if (count >= r->props.num_scopes) break; } scope_matches[i] = 1; } } if (count >= r->props.num_scopes) break; } stemp = stemp->next; } if (count >= r->props.num_scopes) break; rtemp = rtemp->next; } mapper_timetag_t *tt = &r->device->admin->clock.now; mdev_now(r->device, tt); if (count < r->props.num_scopes) { // can release instances with untouched scopes for (i = 0; i < rs->signal->id_map_length; i++) { mapper_signal_id_map_t *id_map = &rs->signal->id_maps[i]; if (!id_map->map || !id_map->instance || id_map->status & IN_RELEASED_REMOTELY) continue; for (j = 0; j < r->props.num_scopes; j++) { if (scope_matches[j]) { // scope is used by another link continue; } if (id_map->map->origin == r->props.scope_hashes[j]) { if (rs->signal->instance_event_handler && (rs->signal->instance_event_flags & IN_UPSTREAM_RELEASE)) { rs->signal->instance_event_handler(rs->signal, &rs->signal->props, id_map->map->local, IN_UPSTREAM_RELEASE, tt); } else if (rs->signal->handler) rs->signal->handler(rs->signal, &rs->signal->props, id_map->map->local, 0, 0, tt); continue; } } } } free(scope_matches); } // Now free the connection mapper_connection *temp = &c->parent->connections; while (*temp) { if (*temp == c) { *temp = c->next; mapper_receiver_free_connection(r, c); r->num_connections--; found = 1; break; } temp = &(*temp)->next; } // Count remaining connections temp = &rs->connections; while (*temp) { count++; temp = &(*temp)->next; } if (!count) { // We need to remove the router_signal also mapper_router_signal *rstemp = &r->signals; while (*rstemp) { if (*rstemp == rs) { *rstemp = rs->next; int i; for (i=0; i < rs->num_instances; i++) { free(rs->history[i].value); free(rs->history[i].timetag); } free(rs->history); free(rs); break; } rstemp = &(*rstemp)->next; } } return !found; } mapper_connection mapper_receiver_find_connection_by_names(mapper_receiver rc, const char* src_name, const char* dest_name) { // find associated receiver_signal mapper_receiver_signal rs = rc->signals; while (rs && strcmp(rs->signal->props.name, dest_name) != 0) rs = rs->next; if (!rs) return NULL; // find associated connection mapper_connection c = rs->connections; while (c && strcmp(c->props.src_name, src_name) != 0) c = c->next; if (!c) return NULL; else return c; } int mapper_receiver_add_scope(mapper_receiver r, const char *scope) { return mapper_db_link_add_scope(&r->props, scope); } int mapper_receiver_remove_scope(mapper_receiver receiver, const char *scope) { mapper_device md = receiver->device; if (mapper_db_link_remove_scope(&receiver->props, scope)) return 1; /* If there are other incoming links with this scope, do not continue. */ /* TODO: really we should proceed but with caution: we can release input * instances as long as the signals are not mapped from another link with * this scope. */ mapper_receiver rc = md->receivers; uint32_t hash = crc32(0L, (const Bytef *)scope, strlen(scope)); while (rc) { if (rc != receiver && mapper_receiver_in_scope(rc, hash)) return 0; rc = rc->next; } /* Release input instances owned by remote device. */ mapper_timetag_t *tt = &md->admin->clock.now; mdev_now(md, tt); mapper_receiver_signal rs = receiver->signals; while (rs) { int i; for (i = 0; i < rs->signal->id_map_length; i++) { mapper_id_map map = rs->signal->id_maps[i].map; if (map->origin == hash) { if (rs->signal->instance_event_handler && (rs->signal->instance_event_flags & IN_UPSTREAM_RELEASE)) { rs->signal->instance_event_handler(rs->signal, &rs->signal->props, map->local, IN_UPSTREAM_RELEASE, tt); } else if (rs->signal->handler) { rs->signal->handler(rs->signal, &rs->signal->props, map->local, 0, 0, tt); } continue; } } rs = rs->next; } /* Rather than releasing output signal instances owned by the remote scope, * we will trust that whatever mechanism created these instances is also * capable of releasing them appropriately when the input handlers are called. * Likewise, we will not remove instance maps referring to the remote device * since local instances may be using them. The maps will be removed * automatically once all referring instances have been released. */ return 0; } int mapper_receiver_in_scope(mapper_receiver r, uint32_t name_hash) { int i; for (i=0; iprops.num_scopes; i++) if (r->props.scope_hashes[i] == name_hash) return 1; return 0; } mapper_receiver mapper_receiver_find_by_src_address(mapper_receiver r, const char *host, int port) { while (r) { if (r->props.src_port == port && (strcmp(r->props.src_host, host)==0)) return r; r = r->next; } return 0; } mapper_receiver mapper_receiver_find_by_src_name(mapper_receiver r, const char *src_name) { int n = strlen(src_name); const char *slash = strchr(src_name+1, '/'); if (slash) n = slash - src_name; while (r) { if (strncmp(r->props.src_name, src_name, n)==0) return r; r = r->next; } return 0; } mapper_receiver mapper_receiver_find_by_src_hash(mapper_receiver r, uint32_t name_hash) { while (r) { if (name_hash == r->props.src_name_hash) return r; r = r->next; } return 0; } libmapper/src/router.c0000644000175000017500000006107112423630127014301 0ustar tiagotiago #include #include #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include static void mapper_router_send_or_bundle_message(mapper_router router, const char *path, lo_message m, mapper_timetag_t tt); mapper_router mapper_router_new(mapper_device device, const char *host, int admin_port, int data_port, const char *name) { char str[16]; mapper_router r = (mapper_router) calloc(1, sizeof(struct _mapper_link)); r->props.src_name = strdup(mdev_name(device)); r->props.dest_host = strdup(host); r->props.dest_port = data_port; sprintf(str, "%d", data_port); r->data_addr = lo_address_new(host, str); sprintf(str, "%d", admin_port); r->admin_addr = lo_address_new(host, str); r->props.dest_name = strdup(name); r->props.dest_name_hash = crc32(0L, (const Bytef *)name, strlen(name)); r->props.num_scopes = 1; r->props.scope_names = (char **) malloc(sizeof(char *)); r->props.scope_names[0] = strdup(mdev_name(device)); r->props.scope_hashes = (uint32_t *) malloc(sizeof(uint32_t)); r->props.scope_hashes[0] = mdev_id(device); r->props.extra = table_new(); r->device = device; r->signals = 0; r->num_connections = 0; r->clock.new = 1; r->clock.sent.message_id = 0; r->clock.response.message_id = -1; if (!r->data_addr) { mapper_router_free(r); return 0; } return r; } void mapper_router_free(mapper_router r) { int i; if (r) { if (r->props.src_name) free(r->props.src_name); if (r->props.dest_host) free(r->props.dest_host); if (r->props.dest_name) free(r->props.dest_name); if (r->admin_addr) lo_address_free(r->admin_addr); if (r->data_addr) lo_address_free(r->data_addr); while (r->signals && r->signals->connections) { // router_signal is freed with last child connection mapper_router_remove_connection(r, r->signals->connections); } while (r->queues) { mapper_queue q = r->queues; lo_bundle_free_messages(q->bundle); r->queues = q->next; free(q); } for (i=0; iprops.num_scopes; i++) { free(r->props.scope_names[i]); } free(r->props.scope_names); free(r->props.scope_hashes); if (r->props.extra) table_free(r->props.extra, 1); free(r); } } int mapper_router_set_from_message(mapper_router r, mapper_message_t *msg) { int i, j, num_scopes, updated = 0; lo_arg **a_scopes = mapper_msg_get_param(msg, AT_SCOPE); num_scopes = mapper_msg_get_length(msg, AT_SCOPE); if (a_scopes && *a_scopes) { if (num_scopes == 1 && strcmp(&a_scopes[0]->s, "none")==0) num_scopes = 0; // First remove old scopes that are missing for (i=0; iprops.num_scopes; i++) { int found = 0; for (j=0; jprops.scope_names[i], &a_scopes[j]->s) == 0) { found = 1; break; } } if (!found) { mapper_db_link_remove_scope(&r->props, r->props.scope_names[i]); updated++; } } // ...then add any new scopes for (i=0; iprops, &a_scopes[i]->s)); if (num_scopes != r->props.num_scopes) { r->props.num_scopes = num_scopes; } } if (updated) updated = 1; updated += mapper_msg_add_or_update_extra_params(r->props.extra, msg); return updated; } void mapper_router_num_instances_changed(mapper_router r, mapper_signal sig, int size) { // check if we have a reference to this signal mapper_router_signal rs = r->signals; while (rs) { if (rs->signal == sig) break; rs = rs->next; } if (!rs) { // The signal is not mapped through this router. return; } if (size <= rs->num_instances) return; // Need to allocate more instances rs->history = realloc(rs->history, sizeof(struct _mapper_signal_history) * size); int i, j; for (i=rs->num_instances; ihistory[i].type = sig->props.type; rs->history[i].length = sig->props.length; rs->history[i].size = rs->history_size; rs->history[i].value = calloc(1, msig_vector_bytes(sig) * rs->history_size); rs->history[i].timetag = calloc(1, sizeof(mapper_timetag_t) * rs->history_size); rs->history[i].position = -1; } // reallocate connection instances mapper_connection c = rs->connections; while (c) { c->history = realloc(c->history, sizeof(struct _mapper_signal_history) * size); c->expr_vars = realloc(c->expr_vars, sizeof(mapper_signal_history_t*) * size); for (i=rs->num_instances; ihistory[i].type = c->props.dest_type; c->history[i].length = c->props.dest_length; c->history[i].size = c->props.dest_history_size; c->history[i].value = calloc(1, mapper_type_size(c->props.dest_type) * c->props.dest_history_size); c->history[i].timetag = calloc(1, sizeof(mapper_timetag_t) * c->props.dest_history_size); c->history[i].position = -1; c->expr_vars[i] = malloc(sizeof(struct _mapper_signal_history) * c->num_expr_vars); } if (rs->num_instances > 0 && c->num_expr_vars > 0) { for (i=rs->num_instances; inum_expr_vars; j++) { c->expr_vars[i][j].type = c->expr_vars[0][j].type; c->expr_vars[i][j].length = c->expr_vars[0][j].length; c->expr_vars[i][j].size = c->expr_vars[0][j].size; c->expr_vars[i][j].position = -1; c->expr_vars[i][j].value = calloc(1, sizeof(double) * c->expr_vars[i][j].length * c->expr_vars[i][j].size); c->expr_vars[i][j].timetag = calloc(1, sizeof(mapper_timetag_t) * c->expr_vars[i][j].size); } } } c = c->next; } rs->num_instances = size; } void mapper_router_process_signal(mapper_router r, mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t tt) { mapper_id_map map = sig->id_maps[instance_index].map; int in_scope = mapper_router_in_scope(r, map->origin); lo_message m; // find the signal connection mapper_router_signal rs = r->signals; while (rs) { if (rs->signal == sig) break; rs = rs->next; } if (!rs) return; int id = sig->id_maps[instance_index].instance->index; mapper_connection c; if (!value) { rs->history[id].position = -1; // reset associated input memory for this instance memset(rs->history[id].value, 0, rs->history_size * msig_vector_bytes(rs->signal)); memset(rs->history[id].timetag, 0, rs->history_size * sizeof(mapper_timetag_t)); c = rs->connections; while (c) { c->history[id].position = -1; if ((c->props.mode != MO_REVERSE) && (!c->props.send_as_instance || in_scope)) { m = mapper_router_build_message(0, c->props.dest_length, c->props.dest_type, 0, c->props.send_as_instance ? map : 0); if (m) mapper_router_send_or_bundle_message(r, c->props.dest_name, m, tt); } // also need to reset associated output memory memset(c->history[id].value, 0, c->props.dest_history_size * c->props.dest_length * mapper_type_size(c->props.dest_type)); memset(c->history[id].timetag, 0, c->props.dest_history_size * sizeof(mapper_timetag_t)); c = c->next; } return; } // if count > 1, we need to allocate sufficient memory for largest output // vector so that we can store calculated values before sending // TODO: calculate max_output_size, cache in link_signal void *out_value_p = count == 1 ? 0 : alloca(count * sig->props.length * sizeof(double)); int i, j; c = rs->connections; while (c) { if ((c->props.mode == MO_REVERSE) || (c->props.send_as_instance && !in_scope)) { c = c->next; continue; } char typestring[c->props.dest_length * count]; j = 0; for (i = 0; i < count; i++) { // copy input history size_t n = msig_vector_bytes(sig); rs->history[id].position = ((rs->history[id].position + 1) % rs->history[id].size); memcpy(msig_history_value_pointer(rs->history[id]), value + n * i, n); memcpy(msig_history_tt_pointer(rs->history[id]), &tt, sizeof(mapper_timetag_t)); // handle cases in which part of count update does not cause output if (!(mapper_connection_perform(c, &rs->history[id], &c->expr_vars[id], &c->history[id], typestring+c->props.dest_length*j))) continue; if (!(mapper_boundary_perform(c, &c->history[id]))) continue; if (count > 1) { memcpy((char*)out_value_p + mapper_type_size(c->props.dest_type) * c->props.dest_length * i, msig_history_value_pointer(c->history[id]), mapper_type_size(c->props.dest_type) * c->props.dest_length); } else { m = mapper_router_build_message(msig_history_value_pointer(c->history[id]), c->props.dest_length, c->props.dest_type, typestring, c->props.send_as_instance ? map : 0); if (m) mapper_router_send_or_bundle_message(r, c->props.dest_name, m, tt); } j++; } if (count > 1 && (c->props.mode != MO_REVERSE) && (!c->props.send_as_instance || in_scope)) { m = mapper_router_build_message(out_value_p, c->props.dest_length * j, c->props.dest_type, typestring, c->props.send_as_instance ? map : 0); if (m) mapper_router_send_or_bundle_message(r, c->props.dest_name, m, tt); } c = c->next; } } /*! Build a value update message for a given connection. */ lo_message mapper_router_build_message(void *value, int length, char type, char *typestring, mapper_id_map id_map) { int i; lo_message m = lo_message_new(); if (!m) return 0; if (value && typestring) { if (type == 'f') { float *v = (float*)value; for (i = 0; i < length; i++) { if (typestring[i] == 'N') lo_message_add_nil(m); else lo_message_add_float(m, v[i]); } } else if (type == 'i') { int *v = (int*)value; for (i = 0; i < length; i++) { if (typestring[i] == 'N') lo_message_add_nil(m); else lo_message_add_int32(m, v[i]); } } else if (type == 'd') { double *v = (double*)value; for (i = 0; i < length; i++) { if (typestring[i] == 'N') lo_message_add_nil(m); else lo_message_add_double(m, v[i]); } } } else if (id_map) { for (i = 0; i < length; i++) lo_message_add_nil(m); } if (id_map) { lo_message_add_string(m, "@instance"); lo_message_add_int32(m, id_map->origin); lo_message_add_int32(m, id_map->public); } return m; } int mapper_router_send_query(mapper_router r, mapper_signal sig, mapper_timetag_t tt) { // TODO: cache the response string // find this signal in list of connections mapper_router_signal rs = r->signals; while (rs && rs->signal != sig) rs = rs->next; // exit without failure if signal is not mapped if (!rs) { return 0; } // for each connection, query the remote signal mapper_connection c = rs->connections; int count = 0; int response_len = (int) strlen(sig->props.name) + 5; char *response_string = (char*) malloc(response_len); snprintf(response_string, response_len, "%s%s", sig->props.name, "/got"); while (c) { lo_message m = lo_message_new(); if (!m) continue; lo_message_add_string(m, response_string); lo_message_add_int32(m, sig->props.length); // include response address as argument to allow TCP queries? // TODO: always use TCP for queries? lo_message_add_char(m, sig->props.type); mapper_router_send_or_bundle_message(r, c->props.query_name, m, tt); count++; c = c->next; } free(response_string); return count; } // note on memory handling of mapper_router_bundle_message(): // path: not owned, will not be freed (assumed is signal name, owned // by signal) // message: will be owned, will be freed when done void mapper_router_send_or_bundle_message(mapper_router r, const char *path, lo_message m, mapper_timetag_t tt) { // Check if a matching bundle exists mapper_queue q = r->queues; while (q) { if (memcmp(&q->tt, &tt, sizeof(mapper_timetag_t))==0) break; q = q->next; } if (q) { // Add message to existing bundle lo_bundle_add_message(q->bundle, path, m); } else { // Send message immediately lo_bundle b = lo_bundle_new(tt); lo_bundle_add_message(b, path, m); lo_send_bundle_from(r->data_addr, r->device->server, b); lo_bundle_free_messages(b); } } void mapper_router_start_queue(mapper_router r, mapper_timetag_t tt) { // first check if queue already exists mapper_queue q = r->queues; while (q) { if (memcmp(&q->tt, &tt, sizeof(mapper_timetag_t))==0) return; q = q->next; } // need to create new queue q = malloc(sizeof(struct _mapper_queue)); memcpy(&q->tt, &tt, sizeof(mapper_timetag_t)); q->bundle = lo_bundle_new(tt); q->next = r->queues; r->queues = q; } void mapper_router_release_queue(mapper_router r, mapper_queue q) { mapper_queue *temp = &r->queues; while (*temp) { if (*temp == q) { *temp = q->next; free(q); return; } temp = &(*temp)->next; } } void mapper_router_send_queue(mapper_router r, mapper_timetag_t tt) { mapper_queue q = r->queues; while (q) { if (memcmp(&q->tt, &tt, sizeof(mapper_timetag_t))==0) break; q = q->next; } if (q) { #ifdef HAVE_LIBLO_BUNDLE_COUNT if (lo_bundle_count(q->bundle)) #endif lo_send_bundle_from(r->data_addr, r->device->server, q->bundle); lo_bundle_free_messages(q->bundle); mapper_router_release_queue(r, q); } } mapper_connection mapper_router_add_connection(mapper_router r, mapper_signal sig, const char *dest_name, char dest_type, int dest_length) { // find signal in router_signal list mapper_router_signal rs = r->signals; while (rs && rs->signal != sig) rs = rs->next; // if not found, create a new list entry if (!rs) { rs = (mapper_router_signal) calloc(1, sizeof(struct _mapper_link_signal)); rs->signal = sig; rs->num_instances = sig->props.num_instances; rs->history = malloc(sizeof(struct _mapper_signal_history) * rs->num_instances); int i; for (i=0; inum_instances; i++) { rs->history[i].type = sig->props.type; rs->history[i].length = sig->props.length; rs->history[i].size = 1; rs->history[i].value = calloc(1, msig_vector_bytes(sig)); rs->history[i].timetag = calloc(1, sizeof(mapper_timetag_t)); rs->history[i].position = -1; } rs->next = r->signals; r->signals = rs; } mapper_connection c = (mapper_connection) calloc(1, sizeof(struct _mapper_connection)); c->props.src_name = strdup(sig->props.name); c->props.src_type = sig->props.type; c->props.src_length = sig->props.length; c->props.dest_name = strdup(dest_name); c->props.dest_type = dest_type; c->props.dest_length = dest_length; c->props.mode = MO_UNDEFINED; c->props.expression = 0; c->props.bound_min = BA_NONE; c->props.bound_max = BA_NONE; c->props.muted = 0; c->props.send_as_instance = (rs->num_instances > 1); c->props.src_min = 0; c->props.src_max = 0; c->props.dest_min = 0; c->props.dest_max = 0; c->props.range_known = 0; c->props.extra = table_new(); int len = strlen(dest_name) + 5; c->props.query_name = malloc(len); snprintf(c->props.query_name, len, "%s%s", dest_name, "/get"); c->history = malloc(sizeof(struct _mapper_signal_history) * rs->num_instances); c->expr_vars = calloc(1, sizeof(mapper_signal_history_t*) * rs->num_instances); c->num_expr_vars = 0; int i; for (i=0; inum_instances; i++) { // allocate history vectors c->history[i].type = dest_type; c->history[i].length = dest_length; c->history[i].size = 1; c->history[i].value = calloc(1, mapper_type_size(c->props.dest_type) * c->props.dest_length); c->history[i].timetag = calloc(1, sizeof(mapper_timetag_t)); c->history[i].position = -1; } // add new connection to this signal's list c->next = rs->connections; rs->connections = c; c->parent = rs; r->num_connections++; return c; } static void mapper_router_free_connection(mapper_router r, mapper_connection c) { int i, j; if (r && c) { if (c->props.src_name) free(c->props.src_name); if (c->props.dest_name) free(c->props.dest_name); if (c->props.query_name) free(c->props.query_name); if (c->props.src_min) free(c->props.src_min); if (c->props.src_max) free(c->props.src_max); if (c->props.dest_min) free(c->props.dest_min); if (c->props.dest_max) free(c->props.dest_max); table_free(c->props.extra, 1); for (i=0; iparent->num_instances; i++) { free(c->history[i].value); free(c->history[i].timetag); if (c->num_expr_vars) { for (j=0; jnum_expr_vars; j++) { free(c->expr_vars[i][j].value); free(c->expr_vars[i][j].timetag); } } free(c->expr_vars[i]); } if (c->expr_vars) free(c->expr_vars); if (c->history) free(c->history); if (c->expr) mapper_expr_free(c->expr); if (c->props.expression) free(c->props.expression); free(c); } } int mapper_router_remove_connection(mapper_router r, mapper_connection c) { int found = 0, count = 0; mapper_router_signal rs = c->parent; mapper_connection *temp = &c->parent->connections; while (*temp) { if (*temp == c) { *temp = c->next; mapper_router_free_connection(r, c); r->num_connections--; found = 1; break; } temp = &(*temp)->next; } // Count remaining connections temp = &rs->connections; while (*temp) { count++; temp = &(*temp)->next; } if (!count) { // We need to remove the router_signal also mapper_router_signal *rstemp = &r->signals; while (*rstemp) { if (*rstemp == rs) { *rstemp = rs->next; int i; for (i=0; inum_instances; i++) { free(rs->history[i].value); free(rs->history[i].timetag); } free(rs->history); free(rs); break; } rstemp = &(*rstemp)->next; } } return !found; } mapper_connection mapper_router_find_connection_by_names(mapper_router rt, const char* src_name, const char* dest_name) { // find associated router_signal mapper_router_signal rs = rt->signals; while (rs && strcmp(rs->signal->props.name, src_name) != 0) rs = rs->next; if (!rs) return NULL; // find associated connection mapper_connection c = rs->connections; while (c && strcmp(c->props.dest_name, dest_name) != 0) c = c->next; if (!c) return NULL; else return c; } int mapper_router_in_scope(mapper_router router, uint32_t name_hash) { int i; for (i=0; iprops.num_scopes; i++) if (router->props.scope_hashes[i] == name_hash || router->props.scope_hashes[i] == 0) return 1; return 0; } mapper_router mapper_router_find_by_dest_address(mapper_router r, const char *host, int port) { while (r) { if (r->props.dest_port == port && (strcmp(r->props.dest_host, host)==0)) return r; r = r->next; } return 0; } mapper_router mapper_router_find_by_dest_name(mapper_router router, const char *dest_name) { int n = strlen(dest_name); const char *slash = strchr(dest_name+1, '/'); if (slash) n = slash - dest_name; while (router) { if (strncmp(router->props.dest_name, dest_name, n)==0) return router; router = router->next; } return 0; } mapper_router mapper_router_find_by_dest_hash(mapper_router router, uint32_t name_hash) { while (router) { if (name_hash == router->props.dest_name_hash) return router; router = router->next; } return 0; } libmapper/src/table.c0000644000175000017500000003003412423630127014043 0ustar tiagotiago #include #include #include #include "mapper_internal.h" int compare_node_keys(const void *l, const void *r) { return strcmp(((string_table_node_t*)l)->key, ((string_table_node_t*)r)->key); } table table_new() { table t = (table)malloc(sizeof(mapper_string_table_t)); if (!t) return 0; t->len = 0; t->alloced = 1; t->store = (string_table_node_t*)malloc(sizeof(string_table_node_t)); return t; } void table_free(table t, int free_values) { int i, j; for (i=0; ilen; i++) { if (t->store[i].key) free((char*)t->store[i].key); if (free_values && t->store[i].value) { if (t->store[i].is_prop) { mapper_prop_value_t *prop = t->store[i].value; if ((prop->type == 's' || prop->type == 'S') && prop->length > 1) { char **vals = (char**)prop->value; for (j = 0; j < prop->length; j++) { if (vals[j]) free(vals[j]); } } free(prop->value); } free(t->store[i].value); } } free(t->store); free(t); } void table_add(table t, const char *key, void *value, int is_prop) { t->len += 1; if (t->len > t->alloced) { while (t->len > t->alloced) t->alloced *= 2; t->store = realloc(t->store, t->alloced * sizeof(string_table_node_t)); } t->store[t->len-1].key = strdup(key); t->store[t->len-1].value = value; t->store[t->len-1].is_prop = is_prop; } void table_sort(table t) { qsort(t->store, t->len, sizeof(string_table_node_t), compare_node_keys); } string_table_node_t *table_find_node(table t, const char *key) { string_table_node_t tmp; tmp.key = key; string_table_node_t *n = 0; n = bsearch(&tmp, t->store, t->len, sizeof(string_table_node_t), compare_node_keys); return n; } void *table_find_p(table t, const char *key) { string_table_node_t tmp; tmp.key = key; string_table_node_t *n = bsearch(&tmp, t->store, t->len, sizeof(string_table_node_t), compare_node_keys); return n ? n->value : 0; } void **table_find_pp(table t, const char *key) { string_table_node_t tmp; tmp.key = key; string_table_node_t *n = bsearch(&tmp, t->store, t->len, sizeof(string_table_node_t), compare_node_keys); return n ? &n->value : 0; } void table_remove_key(table t, const char *key, int free_value) { void **v = table_find_pp(t, key); if (v) { /* Some pointer magic to jump back to the beginning of the table node. */ string_table_node_t *n = 0; n = (string_table_node_t*)((char*)v-((char*)&n->value - (char*)n)); /* Calcuate its index in the store. */ int i, index = n - t->store; free((char*)n->key); if (free_value) { if (n->is_prop) { mapper_prop_value_t *prop = n->value; if (prop->value) { if ((prop->type == 's' || prop->type == 'S') && prop->length > 1) { char **vals = (char**)prop->value; for (i = 0; i < prop->length; i++) { if (vals[i]) free(vals[i]); } } free(prop->value); } } free(n->value); } for (i=index+1; i < t->len; i++) t->store[i-1] = t->store[i]; t->len --; } } int table_add_or_update(table t, const char *key, void *value) { void **val = table_find_pp(t, key); if (val) { *val = value; return 0; } else { table_add(t, key, value, 0); table_sort(t); return 1; } } void *table_value_at_index_p(table t, unsigned int index) { if (index >= t->len) return 0; return t->store[index].value; } const char *table_key_at_index(table t, unsigned int index) { if (index >= t->len) return 0; return t->store[index].key; } int table_size(table t) { return t->len; } static void mapper_table_update_value_elements(mapper_prop_value_t *prop, int length, char type, void *args) { /* For unknown reasons, strcpy crashes here with -O2, so * we'll use memcpy instead, which does not crash. */ int i; if (length < 1) return; /* If destination is a string, reallocate and copy the new * string, otherwise just copy over the old value. */ if (type == 's' || type == 'S') { char **from = (char**)args; if (length == 1) { free(prop->value); prop->value = strdup(*from); } else { char **to = (char**)prop->value; for (i = 0; i < length; i++) { int n = strlen(from[i]); to[i] = malloc(n+1); memcpy(to[i], from[i], n+1); } } } else { switch (type) { case 'f': { float *from = (float*)args; float *to = (float*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } case 'i': { int32_t *from = (int32_t*)args; int32_t *to = (int32_t*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } case 'd': { double *from = (double*)args; double *to = (double*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } case 'h': { int64_t *from = (int64_t*)args; int64_t *to = (int64_t*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } case 't': { mapper_timetag_t *from = (mapper_timetag_t*)args; mapper_timetag_t *to = (mapper_timetag_t*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } case 'c': { char *from = (char*)args; char *to = (char*)prop->value; for (i = 0; i < length; i++) to[i] = from[i]; break; } default: break; } } } /* Higher-level interface, where table stores arbitrary arguments along * with their type. */ int mapper_table_add_or_update_typed_value(table t, const char *key, char type, void *args, int length) { int i; string_table_node_t *node = table_find_node(t, key); if (node) { die_unless(node->value!=0, "parameter value already in " "table cannot be null.\n"); mapper_prop_value_t *prop = node->value; if ((prop->type == 's' || prop->type == 'S') && prop->length > 1) { char **vals = prop->value; for (i = 0; i < prop->length; i++) { free(vals[i]); } } prop->value = realloc(prop->value, mapper_type_size(type) * length); mapper_table_update_value_elements(prop, length, type, args); prop->length = length; prop->type = type; } else { /* Need to add a new entry. */ mapper_prop_value_t *prop = malloc(sizeof(mapper_prop_value_t)); prop->value = malloc(mapper_type_size(type) * length); prop->length = 0; mapper_table_update_value_elements(prop, length, type, args); prop->length = length; prop->type = type; table_add(t, key, prop, 1); table_sort(t); return 1; } return 0; } static void mapper_table_update_value_elements_osc(mapper_prop_value_t *prop, int length, char type, lo_arg **args) { /* For unknown reasons, strcpy crashes here with -O2, so * we'll use memcpy instead, which does not crash. */ int i; /* If destination is a string, reallocate and copy the new * string, otherwise just copy over the old value. */ if (type == 's' || type == 'S') { if (length == 1) { free(prop->value); prop->value = strdup((char*)&args[0]->s); } else if (length > 1) { char **to = (char**)prop->value; char **from = (char**)args; for (i = 0; i < length; i++) { int n = strlen(from[i]); to[i] = malloc(n+1); memcpy(to[i], from[i], n+1); } } } else { switch (type) { case 'f': { float *vals = (float*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->f; break; } case 'i': { int32_t *vals = (int32_t*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->i32; break; } case 'd': { double *vals = (double*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->d; break; } case 'h': { int64_t *vals = (int64_t*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->h; break; } case 't': { mapper_timetag_t *vals = (mapper_timetag_t*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->t; break; } case 'c': { char *vals = (char*)prop->value; for (i = 0; i < length; i++) vals[i] = args[i]->c; break; } default: break; } } } /* Higher-level interface, where table stores arbitrary OSC arguments * parsed from a mapper_msg along with their type. */ int mapper_table_add_or_update_msg_value(table t, const char *key, lo_type type, lo_arg **args, int length) { int i; string_table_node_t *node = table_find_node(t, key); if (node) { die_unless(node->value!=0, "parameter value already in " "table cannot be null.\n"); mapper_prop_value_t *prop = node->value; if ((prop->type == 's' || prop->type == 'S') && prop->length > 1) { char **vals = prop->value; for (i = 0; i < prop->length; i++) { free(vals[i]); } } prop->value = realloc(prop->value, mapper_type_size(type) * length); mapper_table_update_value_elements_osc(prop, length, type, args); prop->length = length; prop->type = type; } else { /* Need to add a new entry. */ mapper_prop_value_t *prop = malloc(sizeof(mapper_prop_value_t)); prop->value = malloc(mapper_type_size(type) * length); prop->length = 0; mapper_table_update_value_elements_osc(prop, length, type, args); prop->length = length; prop->type = type; table_add(t, key, prop, 1); table_sort(t); return 1; } return 0; } #ifdef DEBUG void table_dump_prop_values(table t) { string_table_node_t *n = t->store; int i; for (i=0; ilen; i++) { printf("%s: ", n->key); mapper_prop_value_t *prop = n->value; mapper_prop_pp(prop->type, prop->length, prop->value); printf("\n"); n++; } } #endif libmapper/src/signal.c0000644000175000017500000011070412423630127014234 0ustar tiagotiago #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include #define MAX_INSTANCES 128 static void msig_update_internal(mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t timetag); static void *msig_instance_value_internal(mapper_signal sig, int instance_index, mapper_timetag_t *timetag); static int msig_get_oldest_active_instance_internal(mapper_signal sig); static int msig_get_newest_active_instance_internal(mapper_signal sig); static int compare_ids(const void *l, const void *r) { if ((*(mapper_signal_instance *)l)->id < (*(mapper_signal_instance *)r)->id) return -1; if ((*(mapper_signal_instance *)l)->id == (*(mapper_signal_instance *)r)->id) return 0; else return 1; } static mapper_signal_instance find_instance_by_id(mapper_signal sig, int instance_id) { if (!sig->props.num_instances) return 0; mapper_signal_instance_t si; mapper_signal_instance sip = &si; si.id = instance_id; mapper_signal_instance *sipp = bsearch(&sip, sig->instances, sig->props.num_instances, sizeof(mapper_signal_instance), compare_ids); if (sipp && *sipp) return *sipp; return 0; } mapper_signal msig_new(const char *name, int length, char type, int is_output, const char *unit, void *minimum, void *maximum, int num_instances, mapper_signal_update_handler *handler, void *user_data) { int i; if (length < 1) return 0; if (!name) return 0; if (type != 'f' && type != 'i' && type != 'd') return 0; mapper_signal sig = (mapper_signal) calloc(1, sizeof(struct _mapper_signal)); mapper_db_signal_init(&sig->props, is_output, type, length, name, unit); sig->handler = handler; sig->has_complete_value = calloc(1, length / 8 + 1); for (i = 0; i < length; i++) { sig->has_complete_value[i/8] |= 1 << (i % 8); } sig->props.user_data = user_data; msig_set_minimum(sig, minimum); msig_set_maximum(sig, maximum); if (num_instances < 0) { // this is a single-instance signal sig->props.num_instances = 0; // Reserve one instance to start msig_reserve_instances(sig, 1, 0, 0); } else { sig->props.num_instances = msig_reserve_instances(sig, num_instances, 0, 0); } // Reserve one instance id map sig->id_map_length = 1; sig->id_maps = calloc(1, sizeof(struct _mapper_signal_id_map)); return sig; } void msig_free(mapper_signal sig) { int i; if (!sig) return; // Free instances for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance) { msig_release_instance_internal(sig, i, MAPPER_NOW); } } free(sig->id_maps); for (i = 0; i < sig->props.num_instances; i++) { if (sig->instances[i]->value) free(sig->instances[i]->value); if (sig->instances[i]->has_value_flags) free(sig->instances[i]->has_value_flags); free(sig->instances[i]); } free(sig->instances); if (sig->props.minimum) free(sig->props.minimum); if (sig->props.maximum) free(sig->props.maximum); if (sig->props.name) free((char*)sig->props.name); if (sig->props.unit) free((char*)sig->props.unit); if (sig->has_complete_value) free(sig->has_complete_value); if (sig->props.extra) table_free(sig->props.extra, 1); free(sig); } void msig_update(mapper_signal sig, void *value, int count, mapper_timetag_t tt) { if (!sig) return; mapper_timetag_t *ttp; if (memcmp(&tt, &MAPPER_NOW, sizeof(mapper_timetag_t))==0) { ttp = &sig->device->admin->clock.now; mdev_now(sig->device, ttp); } else ttp = &tt; int index = 0; if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 0, ttp); msig_update_internal(sig, index, value, count, *ttp); } void msig_update_int(mapper_signal sig, int value) { if (!sig) return; #ifdef DEBUG if (sig->props.type != 'i') { trace("called msig_update_int() on non-int signal!\n"); return; } if (sig->props.length != 1) { trace("called msig_update_int() on non-scalar signal!\n"); return; } if (!sig->device) { trace("signal does not have a device in msig_update_int().\n"); return; } #endif mapper_timetag_t *tt = &sig->device->admin->clock.now; mdev_now(sig->device, tt); int index = 0; if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 0, tt); msig_update_internal(sig, index, &value, 1, *tt); } void msig_update_float(mapper_signal sig, float value) { if (!sig) return; #ifdef DEBUG if (sig->props.type != 'f') { trace("called msig_update_float() on non-float signal!\n"); return; } if (sig->props.length != 1) { trace("called msig_update_float() on non-scalar signal!\n"); return; } if (!sig->device) { trace("signal does not have a device in msig_update_float().\n"); return; } #endif mapper_timetag_t *tt = &sig->device->admin->clock.now; mdev_now(sig->device, tt); int index = 0; if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 0, tt); msig_update_internal(sig, index, &value, 1, *tt); } void msig_update_double(mapper_signal sig, double value) { if (!sig) return; #ifdef DEBUG if (sig->props.type != 'd') { trace("called msig_update_double() on non-double signal!\n"); return; } if (sig->props.length != 1) { trace("called msig_update_double() on non-scalar signal!\n"); return; } if (!sig->device) { trace("signal does not have a device in msig_update_double().\n"); return; } #endif mapper_timetag_t *tt = &sig->device->admin->clock.now; mdev_now(sig->device, tt); int index = 0; if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 0, tt); msig_update_internal(sig, index, &value, 1, *tt); } void *msig_value(mapper_signal sig, mapper_timetag_t *timetag) { if (!sig) return 0; int index = 0; if (!sig->id_maps[0].instance) index = msig_find_instance_with_local_id(sig, 0, 0); if (index < 0) return 0; return msig_instance_value_internal(sig, index, timetag); } /**** Instances ****/ static void msig_init_instance(mapper_signal_instance si) { si->has_value = 0; lo_timetag_now(&si->creation_time); } int msig_find_instance_with_local_id(mapper_signal sig, int id, int flags) { int i; for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance && sig->id_maps[i].map->local == id) { if (sig->id_maps[i].status & ~flags) return -1; else return i; } } return -1; } int msig_find_instance_with_remote_ids(mapper_signal sig, int origin, int public_id, int flags) { int i; for (i = 0; i < sig->id_map_length; i++) { if (!sig->id_maps[i].map) continue; if (sig->id_maps[i].map->origin == origin && sig->id_maps[i].map->public == public_id) { if (sig->id_maps[i].status & ~flags) return -1; else return i; } } return -1; } static mapper_signal_instance get_reserved_instance(mapper_signal sig) { int i; for (i = 0; i < sig->props.num_instances; i++) { if (!sig->instances[i]->is_active) { return sig->instances[i]; } } return 0; } int msig_get_instance_with_local_id(mapper_signal sig, int instance_id, int flags, mapper_timetag_t *tt) { if (!sig) return 0; mapper_signal_id_map_t *maps = sig->id_maps; mapper_signal_instance si; int i; for (i = 0; i < sig->id_map_length; i++) { if (maps[i].instance && maps[i].map->local == instance_id) { if (maps[i].status & ~flags) return -1; else { return i; } } } // check if device has record of id map mapper_id_map map = mdev_find_instance_id_map_by_local(sig->device, instance_id); // no instance with that id exists - need to try to activate instance and create new id map if ((si = find_instance_by_id(sig, instance_id))) { if (!map) { // Claim id map locally, add id map to device and link from signal map = mdev_add_instance_id_map(sig->device, instance_id, mdev_id(sig->device), sig->device->id_counter++); map->refcount_local = 1; } else { map->refcount_local++; } // store pointer to device map in a new signal map msig_init_instance(si); i = msig_add_id_map(sig, si, map); if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, instance_id, IN_NEW, tt); } return i; } if (sig->instance_event_handler && (sig->instance_event_flags & IN_OVERFLOW)) { // call instance event handler sig->instance_event_handler(sig, &sig->props, -1, IN_OVERFLOW, tt); } else if (sig->handler) { if (sig->instance_allocation_type == IN_STEAL_OLDEST) { i = msig_get_oldest_active_instance_internal(sig); if (i < 0) return -1; sig->handler(sig, &sig->props, sig->id_maps[i].map->local, 0, 0, tt); } else if (sig->instance_allocation_type == IN_STEAL_NEWEST) { i = msig_get_newest_active_instance_internal(sig); if (i < 0) return -1; sig->handler(sig, &sig->props, sig->id_maps[i].map->local, 0, 0, tt); } else return -1; } else return -1; // try again if ((si = find_instance_by_id(sig, instance_id))) { if (!map) { // Claim id map locally add id map to device and link from signal map = mdev_add_instance_id_map(sig->device, instance_id, mdev_id(sig->device), sig->device->id_counter++); map->refcount_local = 1; } else { map->refcount_local++; } msig_init_instance(si); i = msig_add_id_map(sig, si, map); if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, instance_id, IN_NEW, tt); } return i; } return -1; } int msig_get_instance_with_remote_ids(mapper_signal sig, int origin, int public_id, int flags, mapper_timetag_t *tt) { if (!sig) return 0; mapper_signal_id_map_t *maps = sig->id_maps; mapper_signal_instance si; int i; for (i = 0; i < sig->id_map_length; i++) { if (maps[i].instance && maps[i].map->origin == origin && maps[i].map->public == public_id) { if (maps[i].status & ~flags) return -1; else { return i; } } } // check if the device already has a map for this remote mapper_id_map map = mdev_find_instance_id_map_by_remote(sig->device, origin, public_id); if (!map) { /* Here we still risk creating conflicting maps if two signals are updated asynchronously. * This is easy to avoid by not allowing a local id to be used with multiple active remote * maps, however users may wish to create devices with multiple object classes which do not * require mutual instance id synchronization - e.g. instance 1 of object class A is not * related to instance 1 of object B. */ // TODO: add object groups for explictly sharing id maps if ((si = get_reserved_instance(sig))) { map = mdev_add_instance_id_map(sig->device, si->id, origin, public_id); map->refcount_remote = 1; si->is_active = 1; msig_init_instance(si); i = msig_add_id_map(sig, si, map); if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, si->id, IN_NEW, tt); } return i; } } else { si = find_instance_by_id(sig, map->local); if (!si) { // TODO: Once signal groups are explicit, allow re-mapping to another instance if possible. trace("Signal %s has no instance %i available.\n", sig->props.name, map->local); return -1; } else if (!si->is_active) { si->is_active = 1; msig_init_instance(si); i = msig_add_id_map(sig, si, map); map->refcount_remote++; if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, si->id, IN_NEW, tt); } return i; } } // try releasing instance in use if (sig->instance_event_handler && (sig->instance_event_flags & IN_OVERFLOW)) { // call instance event handler sig->instance_event_handler(sig, &sig->props, -1, IN_OVERFLOW, tt); } else if (sig->handler) { if (sig->instance_allocation_type == IN_STEAL_OLDEST) { i = msig_get_oldest_active_instance_internal(sig); if (i < 0) return -1; sig->handler(sig, &sig->props, sig->id_maps[i].map->local, 0, 0, tt); } else if (sig->instance_allocation_type == IN_STEAL_NEWEST) { i = msig_get_newest_active_instance_internal(sig); if (i < 0) return -1; sig->handler(sig, &sig->props, sig->id_maps[i].map->local, 0, 0, tt); } else return -1; } else return -1; // try again if (!map) { if ((si = get_reserved_instance(sig))) { map = mdev_add_instance_id_map(sig->device, si->id, origin, public_id); map->refcount_remote = 1; si->is_active = 1; msig_init_instance(si); i = msig_add_id_map(sig, si, map); if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, si->id, IN_NEW, tt); } return i; } } else { si = find_instance_by_id(sig, map->local); if (!si) { trace("Signal %s has no instance %i available.", sig->props.name, map->local); return -1; } if (si) { if (si->is_active) { return -1; } si->is_active = 1; msig_init_instance(si); i = msig_add_id_map(sig, si, map); map->refcount_remote++; if (sig->instance_event_handler && (sig->instance_event_flags & IN_NEW)) { sig->instance_event_handler(sig, &sig->props, si->id, IN_NEW, tt); } return i; } } return -1; } static int msig_reserve_instance_internal(mapper_signal sig, int *id, void *user_data) { if (!sig || sig->props.num_instances >= MAX_INSTANCES) return -1; int i, lowest, found; mapper_signal_instance si; // check if instance with this id already exists! If so, stop here. if (id && find_instance_by_id(sig, *id)) return -1; // reallocate array of instances sig->instances = realloc(sig->instances, sizeof(mapper_signal_instance) * (sig->props.num_instances+1)); sig->instances[sig->props.num_instances] = (mapper_signal_instance) calloc(1, sizeof(struct _mapper_signal_instance)); si = sig->instances[sig->props.num_instances]; si->value = calloc(1, msig_vector_bytes(sig)); si->has_value_flags = calloc(1, sig->props.length / 8 + 1); si->has_value = 0; if (id) si->id = *id; else { // find lowest unused positive id lowest = -1, found = 0; while (!found) { lowest++; found = 1; for (i = 0; i < sig->props.num_instances; i++) { if (sig->instances[i]->id == lowest) { found = 0; break; } } } si->id = lowest; } // find lowest unused positive index lowest = -1, found = 0; while (!found) { lowest++; found = 1; for (i = 0; i < sig->props.num_instances; i++) { if (sig->instances[i]->index == lowest) { found = 0; break; } } } si->index = lowest; msig_init_instance(si); si->user_data = user_data; sig->props.num_instances ++; qsort(sig->instances, sig->props.num_instances, sizeof(mapper_signal_instance), compare_ids); // return largest index int highest = -1; for (i = 0; i < sig->props.num_instances; i++) { if (sig->instances[i]->index > highest) highest = sig->instances[i]->index; } return highest; } int msig_reserve_instances(mapper_signal sig, int num, int *ids, void **user_data) { int i, count = 0, highest = -1; for (i = 0; i < num; i++) { int result = msig_reserve_instance_internal(sig, ids ? &ids[i] : 0, user_data ? user_data[i] : 0); if (result == -1) continue; highest = result; count++; } if (highest != -1) mdev_num_instances_changed(sig->device, sig, highest + 1); return count; } void msig_update_instance(mapper_signal sig, int instance_id, void *value, int count, mapper_timetag_t timetag) { if (!sig) return; if (!value) { msig_release_instance(sig, instance_id, timetag); return; } int index = msig_get_instance_with_local_id(sig, instance_id, 0, &timetag); if (index >= 0) msig_update_internal(sig, index, value, count, timetag); } int msig_get_oldest_active_instance(mapper_signal sig, int *id) { int index = msig_get_oldest_active_instance_internal(sig); if (index < 0) return 1; else *id = sig->id_maps[index].map->local; return 0; } int msig_get_oldest_active_instance_internal(mapper_signal sig) { int i; mapper_signal_instance si; for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance) break; } if (i == sig->id_map_length) { // no active instances to steal! return -1; } int oldest = i; for (i = oldest+1; i < sig->id_map_length; i++) { if (!(si = sig->id_maps[i].instance)) continue; if ((si->creation_time.sec < sig->id_maps[oldest].instance->creation_time.sec) || (si->creation_time.sec == sig->id_maps[oldest].instance->creation_time.sec && si->creation_time.frac < sig->id_maps[oldest].instance->creation_time.frac)) oldest = i; } return oldest; } int msig_get_newest_active_instance(mapper_signal sig, int *id) { int index = msig_get_newest_active_instance_internal(sig); if (index < 0) return 1; else *id = sig->id_maps[index].map->local; return 0; } int msig_get_newest_active_instance_internal(mapper_signal sig) { int i; mapper_signal_instance si; for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance) break; } if (i == sig->id_map_length) { // no active instances to steal! return -1; } int newest = i; for (i = newest+1; i < sig->id_map_length; i++) { if (!(si = sig->id_maps[i].instance)) continue; if ((si->creation_time.sec > sig->id_maps[newest].instance->creation_time.sec) || (si->creation_time.sec == sig->id_maps[newest].instance->creation_time.sec && si->creation_time.frac > sig->id_maps[newest].instance->creation_time.frac)) newest = i; } return newest; } static void msig_update_internal(mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t tt) { mapper_signal_instance si = sig->id_maps[instance_index].instance; /* We have to assume that value points to an array of correct type * and size. */ if (value) { if (count<=0) count=1; size_t n = msig_vector_bytes(sig); memcpy(si->value, value + n*(count-1), n); si->has_value = 1; } else { si->has_value = 0; } if (memcmp(&tt, &MAPPER_NOW, sizeof(mapper_timetag_t))==0) mdev_now(sig->device, &si->timetag); else memcpy(&si->timetag, &tt, sizeof(mapper_timetag_t)); if (sig->props.is_output) { mdev_route_signal(sig->device, sig, instance_index, value, count, si->timetag); } else { mdev_receive_update(sig->device, sig, instance_index, si->timetag); } } void msig_release_instance(mapper_signal sig, int id, mapper_timetag_t timetag) { if (!sig) return; int index = msig_find_instance_with_local_id(sig, id, IN_RELEASED_REMOTELY); if (index >= 0) msig_release_instance_internal(sig, index, timetag); } void msig_release_instance_internal(mapper_signal sig, int instance_index, mapper_timetag_t tt) { mapper_signal_id_map_t *smap = &sig->id_maps[instance_index]; if (!smap->instance) return; mapper_timetag_t *ttp; if (memcmp(&tt, &MAPPER_NOW, sizeof(mapper_timetag_t))==0) { ttp = &sig->device->admin->clock.now; mdev_now(sig->device, ttp); } else ttp = &tt; if (!(smap->status & IN_RELEASED_REMOTELY)) { mdev_route_released(sig->device, sig, instance_index, *ttp); } smap->map->refcount_local--; if (smap->map->refcount_local <= 0 && smap->map->refcount_remote <= 0) { mdev_remove_instance_id_map(sig->device, smap->map); smap->map = 0; } else if (sig->props.is_output || smap->status & IN_RELEASED_REMOTELY) { // TODO: consider multiple upstream source instances? smap->map = 0; } else { // mark map as locally-released but do not remove it sig->id_maps[instance_index].status |= IN_RELEASED_LOCALLY; } // Put instance back in reserve list smap->instance->is_active = 0; smap->instance = 0; } void msig_remove_instance(mapper_signal sig, int instance_id) { if (!sig) return; int i; for (i = 0; i < sig->props.num_instances; i++) { if (sig->instances[i]->id == instance_id) { if (sig->instances[i]->is_active) { // First release instance mapper_timetag_t tt = sig->device->admin->clock.now; mdev_now(sig->device, &tt); msig_release_instance_internal(sig, i, tt); } break; } } if (i == sig->props.num_instances) return; if (sig->instances[i]->value) free(sig->instances[i]->value); if (sig->instances[i]->has_value_flags) free(sig->instances[i]->has_value_flags); free(sig->instances[i]); i++; for (; i < sig->props.num_instances; i++) { sig->instances[i-1] = sig->instances[i]; } --sig->props.num_instances; sig->instances = realloc(sig->instances, sizeof(mapper_signal_instance) * sig->props.num_instances); // TODO: could also realloc signal value histories } static void *msig_instance_value_internal(mapper_signal sig, int instance_index, mapper_timetag_t *timetag) { mapper_signal_instance si = sig->id_maps[instance_index].instance; if (!si) return 0; if (!si->has_value) return 0; if (timetag) timetag = &si->timetag; return si->value; } void *msig_instance_value(mapper_signal sig, int instance_id, mapper_timetag_t *timetag) { int index = msig_find_instance_with_local_id(sig, instance_id, IN_RELEASED_REMOTELY); if (index < 0) return 0; return msig_instance_value_internal(sig, index, timetag); } void msig_match_instances(mapper_signal from, mapper_signal to, int instance_id) { // TODO: remove this function if (from == to) return; // Find "from" instance int index = msig_find_instance_with_local_id(from, instance_id, IN_RELEASED_REMOTELY); if (index < 0) return; mapper_timetag_t tt = from->device->admin->clock.now; mdev_now(from->device, &tt); // Get "to" instance with same map msig_get_instance_with_remote_ids(to, from->id_maps[index].map->origin, from->id_maps[index].map->public, 0, &tt); } int msig_num_active_instances(mapper_signal sig) { if (!sig) return -1; int i, j = 0; for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance) j++; } return j; } int msig_num_reserved_instances(mapper_signal sig) { if (!sig) return -1; int i, j = 0; for (i = 0; i < sig->props.num_instances; i++) { if (!sig->instances[i]->is_active) j++; } return j; } int msig_active_instance_id(mapper_signal sig, int index) { int i, j = -1; for (i = 0; i < sig->id_map_length; i++) { if (sig->id_maps[i].instance) j++; if (j >= index) return sig->id_maps[i].map->local; } return -1; } void msig_set_instance_allocation_mode(mapper_signal sig, mapper_instance_allocation_type mode) { if (sig) sig->instance_allocation_type = mode; } mapper_instance_allocation_type msig_get_instance_allocation_mode(mapper_signal sig) { if (sig) return sig->instance_allocation_type; return 0; } void msig_set_instance_event_callback(mapper_signal sig, mapper_signal_instance_event_handler h, int flags, void *user_data) { if (!sig) return; if (!h || !flags) { sig->instance_event_handler = 0; sig->instance_event_flags = 0; return; } sig->instance_event_handler = h; // TODO: use separate user_data for instance event callback? sig->props.user_data = user_data; if (flags & IN_DOWNSTREAM_RELEASE) { if (!(sig->instance_event_flags & IN_DOWNSTREAM_RELEASE)) { // Add liblo method for processing instance release requests sig->instance_event_flags = flags; mdev_add_instance_release_request_callback(sig->device, sig); } } else { if (sig->instance_event_flags & IN_DOWNSTREAM_RELEASE) { // Remove liblo method for processing instance release requests sig->instance_event_flags = flags; mdev_remove_instance_release_request_callback(sig->device, sig); } } sig->instance_event_flags = flags; } void msig_set_instance_data(mapper_signal sig, int instance_id, void *user_data) { mapper_signal_instance si = find_instance_by_id(sig, instance_id); if (si) si->user_data = user_data; } void *msig_get_instance_data(mapper_signal sig, int instance_id) { mapper_signal_instance si = find_instance_by_id(sig, instance_id); if (si) return si->user_data; return 0; } /**** Queries and reverse connections ****/ void msig_set_callback(mapper_signal sig, mapper_signal_update_handler *handler, void *user_data) { if (!sig) return; if (!sig->handler && handler) { // Need to register a new liblo methods sig->handler = handler; sig->props.user_data = user_data; mdev_add_signal_methods(sig->device, sig); } else if (sig->handler && !handler) { // Need to remove liblo methods sig->handler = 0; sig->props.user_data = user_data; mdev_remove_signal_methods(sig->device, sig); } } int msig_query_remotes(mapper_signal sig, mapper_timetag_t tt) { // TODO: process queries on inputs also if (!sig->props.is_output) return -1; if (!sig->handler) { // no handler defined so we cannot process query responses return -1; } return mdev_route_query(sig->device, sig, tt); } /**** Signal Properties ****/ int msig_full_name(mapper_signal sig, char *name, int len) { const char *mdname = mdev_name(sig->device); if (!mdname) return 0; int mdlen = strlen(mdname); if (mdlen >= len) return 0; if ((mdlen + strlen(sig->props.name)) > len) return 0; strncpy(name, mdname, len); strncat(name, sig->props.name, len); return strlen(name); } void msig_set_minimum(mapper_signal sig, void *minimum) { if (minimum) { if (!sig->props.minimum) sig->props.minimum = malloc(msig_vector_bytes(sig)); memcpy(sig->props.minimum, minimum, msig_vector_bytes(sig)); } else { if (sig->props.minimum) free(sig->props.minimum); sig->props.minimum = 0; } } void msig_set_maximum(mapper_signal sig, void *maximum) { if (maximum) { if (!sig->props.maximum) sig->props.maximum = malloc(msig_vector_bytes(sig)); memcpy(sig->props.maximum, maximum, msig_vector_bytes(sig)); } else { if (sig->props.maximum) free(sig->props.maximum); sig->props.maximum = 0; } } void msig_set_rate(mapper_signal sig, float rate) { sig->props.rate = rate; } mapper_db_signal msig_properties(mapper_signal sig) { return &sig->props; } void msig_set_property(mapper_signal sig, const char *property, char type, void *value, int length) { if (strcmp(property, "device_name") == 0 || strcmp(property, "name") == 0 || strcmp(property, "type") == 0 || strcmp(property, "length") == 0 || strcmp(property, "direction") == 0 || strcmp(property, "user_data") == 0) { trace("Cannot set locked signal property '%s'\n", property); return; } if (strcmp(property, "min") == 0 || strcmp(property, "minimum") == 0) { if (!length || !value) msig_set_minimum(sig, 0); else if (length == sig->props.length && type == sig->props.type) msig_set_minimum(sig, value); // TODO: if types differ need to cast entire vector return; } else if (strcmp(property, "max") == 0 || strcmp(property, "maximum") == 0) { if (!length || !value) msig_set_maximum(sig, 0); else if (length == sig->props.length && type == sig->props.type) msig_set_maximum(sig, value); // TODO: if types differ need to cast entire vector return; } else if ((strcmp(property, "unit") == 0 || strcmp(property, "units") == 0) && (type == 's' || type == 'S')) { if (!length || !value) { if (sig->props.unit) { free(sig->props.unit); sig->props.unit = 0; } return; } if (!sig->props.unit || strcmp(sig->props.unit, (char*)value)) { sig->props.unit = realloc(sig->props.unit, strlen((char*)value)+1); strcpy(sig->props.unit, (char*)value); } return; } else if (strcmp(property, "value") == 0) { if (!length || !value) msig_update(sig, 0, 0, MAPPER_NOW); else if (length == sig->props.length || type == sig->props.type) msig_update(sig, value, 1, MAPPER_NOW); return; } mapper_table_add_or_update_typed_value(sig->props.extra, property, type, value, length); } void msig_remove_property(mapper_signal sig, const char *property) { table_remove_key(sig->props.extra, property, 1); } int msig_add_id_map(mapper_signal sig, mapper_signal_instance si, mapper_id_map map) { // find unused signal map int i; for (i = 0; i < sig->id_map_length; i++) { if (!sig->id_maps[i].map) break; } if (i == sig->id_map_length) { // need more memory if (sig->id_map_length >= MAX_INSTANCES) { // Arbitrary limit to number of tracked id_maps return -1; } sig->id_map_length *= 2; sig->id_maps = realloc(sig->id_maps, sig->id_map_length * sizeof(struct _mapper_signal_id_map)); memset(sig->id_maps + i, 0, (sig->id_map_length - i) * sizeof(struct _mapper_signal_id_map)); } sig->id_maps[i].map = map; sig->id_maps[i].instance = si; sig->id_maps[i].status = 0; return i; } int msig_num_connections(mapper_signal sig) { mapper_link l = sig->props.is_output ? sig->device->routers : sig->device->receivers; int count = 0; while (l) { mapper_link_signal ls = l->signals; while (ls) { if (ls->signal == sig) { mapper_connection c = ls->connections; while (c) { count++; c = c->next; } } ls = ls->next; } l = l->next; } return count; } void message_add_coerced_signal_instance_value(lo_message m, mapper_signal sig, mapper_signal_instance si, int length, const char type) { int i; int min_length = length < sig->props.length ? length : sig->props.length; if (sig->props.type == 'f') { float *v = (float *) si->value; for (i = 0; i < min_length; i++) { if (!si->has_value && !(si->has_value_flags[i/8] & 1 << (i % 8))) lo_message_add_nil(m); else if (type == 'f') lo_message_add_float(m, v[i]); else if (type == 'i') lo_message_add_int32(m, (int)v[i]); else if (type == 'd') lo_message_add_double(m, (double)v[i]); } } else if (sig->props.type == 'i') { int *v = (int *) si->value; for (i = 0; i < min_length; i++) { if (!si->has_value && !(si->has_value_flags[i/8] & 1 << (i % 8))) lo_message_add_nil(m); else if (type == 'i') lo_message_add_int32(m, v[i]); else if (type == 'f') lo_message_add_float(m, (float)v[i]); else if (type == 'd') lo_message_add_double(m, (double)v[i]); } } else if (sig->props.type == 'd') { double *v = (double *) si->value; for (i = 0; i < min_length; i++) { if (!si->has_value && !(si->has_value_flags[i/8] & 1 << (i % 8))) lo_message_add_nil(m); else if (type == 'd') lo_message_add_double(m, (int)v[i]); else if (type == 'i') lo_message_add_int32(m, (int)v[i]); else if (type == 'f') lo_message_add_float(m, (float)v[i]); } } for (i = min_length; i < length; i++) lo_message_add_nil(m); } libmapper/src/db.c0000644000175000017500000025105512423630127013351 0ustar tiagotiago #include #include #include #include #include #include #include "mapper_internal.h" /* Some useful local list functions. */ /* * Note on the trick used here: Presuming that we can have lists as * the result of a search query, we need to be able to return a linked * list composed of pointers to arbitrary database items. However a * very common operation will be to walk through all the entries. We * prepend a header containing a pointer to the next item and a * pointer to the current item, and return the address of the current * pointer. * In the normal case, the address of the self-pointer can therefore * be used to locate the actual database entry, and we can walk along * the actual list without needing to allocate any memory for a list * header. However, in the case where we want to walk along the * result of a query, we can allocate a dynamic set of list headers, * and still have 'self' point to the actual database item. * Both types of queries can use the returned double-pointer as * context for the search as well as for returning the desired value. * This allows us to avoid requiring the user to manage a separate * iterator object. */ typedef enum { QUERY_STATIC, QUERY_DYNAMIC } query_type_t; typedef struct { void *next; void *self; struct _query_info *query_context; query_type_t query_type; int data[1]; // stub } list_header_t; #define LIST_HEADER_SIZE (sizeof(list_header_t)-sizeof(int[1])) /*! Reserve memory for a list item. Reserves an extra pointer at the * beginning of the structure to allow for a list pointer. */ static list_header_t* list_new_item(size_t size) { list_header_t *lh=0; // make sure the compiler is doing what we think it's doing with // the size of list_header_t and location of data die_unless(LIST_HEADER_SIZE == sizeof(void*)*3 + sizeof(query_type_t), "unexpected size for list_header_t"); die_unless(((char*)&lh->data - (char*)lh) == LIST_HEADER_SIZE, "unexpected offset for data in list_header_t"); size += LIST_HEADER_SIZE; lh = malloc(size); if (!lh) return 0; memset(lh, 0, size); lh->self = &lh->data; lh->query_type = QUERY_STATIC; return (list_header_t*)&lh->data; } /*! Get the list header for memory returned from list_new_item(). */ static list_header_t* list_get_header_by_data(void *data) { return (list_header_t*)(data - LIST_HEADER_SIZE); } /*! Get the list header for memory returned from list_new_item(). */ static list_header_t* list_get_header_by_self(void *self) { list_header_t *lh=0; return (list_header_t*)(self - ((void*)&lh->self - (void*)lh)); } /*! Set the next pointer in memory returned from list_new_item(). */ static void list_set_next(void *mem, void *next) { list_get_header_by_data(mem)->next = next; } /*! Get the next pointer in memory returned from list_new_item(). */ static void* list_get_next(void *mem) { return list_get_header_by_data(mem)->next; } /*! Prepend an item to the beginning of a list. */ static void* list_prepend_item(void *item, void **list) { list_set_next(item, *list); *list = item; return item; } /*! Remove an item from a list and free its memory. */ void list_remove_item(void *item, void **head) { void *prev_node = 0, *node = *head; while (node) { if (node == item) break; prev_node = node; node = list_get_next(node); } if (!node) return; if (prev_node) list_set_next(prev_node, list_get_next(node)); else *head = list_get_next(node); free(list_get_header_by_data(node)); } /** Structures and functions for performing dynamic queries **/ /* Here are some generalized routines for dealing with typical context * format and query continuation. Functions specific to particular * queries are defined further down with their compare operation. */ /*! Function for query comparison */ typedef int query_compare_func_t(void *context_data, void *item); /*! Function for freeing query context */ typedef void query_free_func_t(list_header_t *lh); /*! Contains some function pointers and data for handling query context. */ typedef struct _query_info { unsigned int size; query_compare_func_t *query_compare; query_free_func_t *query_free; int data[0]; // stub } query_info_t; static void **dynamic_query_continuation(list_header_t *lh) { void *item = list_get_header_by_data(lh->self)->next; while (item) { if (lh->query_context->query_compare(&lh->query_context->data, item)) break; item = list_get_next(item); } if (item) { lh->self = item; return &lh->self; } // Clean up if (lh->query_context->query_free) lh->query_context->query_free(lh); return 0; } static void free_query_single_context(list_header_t *lh) { free(lh->query_context); free(lh); } static list_header_t *construct_query_context_from_strings( query_compare_func_t *f, ...) { list_header_t *lh = (list_header_t*)malloc(LIST_HEADER_SIZE); lh->next = dynamic_query_continuation; lh->query_type = QUERY_DYNAMIC; va_list aq; va_start(aq, f); int size = 0; const char *s = va_arg(aq, const char*); while (s) { size += strlen(s) + 1; s = va_arg(aq, const char*); }; va_end(aq); lh->query_context = (query_info_t*)malloc(sizeof(query_info_t)+size); char *t = (char*)&lh->query_context->data; va_start(aq, f); s = va_arg(aq, const char*); while (s) { while (*s) { *t++ = *s++; } *t++ = 0; s = va_arg(aq, const char*); }; va_end(aq); lh->query_context->size = sizeof(query_info_t)+size; lh->query_context->query_compare = f; lh->query_context->query_free = (query_free_func_t*)free_query_single_context; return lh; } static void save_query_single_context(list_header_t *src, void *mem, unsigned int size) { int needed = LIST_HEADER_SIZE; if (src->query_context) needed += src->query_context->size; else needed += sizeof(unsigned int); die_unless(size >= needed, "not enough memory provided to save query context.\n"); memcpy(mem, src, LIST_HEADER_SIZE); if (src->query_context) memcpy(mem+LIST_HEADER_SIZE, src->query_context, src->query_context->size); else ((query_info_t*)(mem+LIST_HEADER_SIZE))->size = 0; } static void restore_query_single_context(list_header_t *dest, void *mem) { query_info_t *qi = mem + LIST_HEADER_SIZE; if (qi->size > 0) die_unless(dest->query_context && dest->query_context->size >= qi->size, "not enough memory provided to restore query context.\n"); void *qc = dest->query_context; memcpy(dest, mem, LIST_HEADER_SIZE); if (qi->size == 0) dest->query_context = 0; else { memcpy(qc, qi, qi->size); dest->query_context = qc; } } // May be useful in the future. #if 0 static list_header_t *dup_query_single_context(list_header_t *lh) { list_header_t *result = (list_header_t*) malloc(sizeof(list_header_t*)); memcpy(result, lh, LIST_HEADER_SIZE); if (lh->query_context) { result->query_context = malloc(lh->query_context->size); memcpy(result->query_context, lh->query_context, lh->query_context->size); } return result; } static void copy_query_single_context(list_header_t *src, list_header_t *dest) { memcpy(src, dest, LIST_HEADER_SIZE); if (src->query_context) { die_unless(dest->query_context!=0, "error, no destination query context to copy to."); die_unless(dest->query_context->size == src->query_context->size, "error, query context sizes don't match on copy."); memcpy(dest->query_context, src->query_context, src->query_context->size); } } #endif static void **iterator_next(void** p) { if (!p) { trace("bad pointer in iterator_next()\n"); return 0; } if (!*p) { trace("pointer in iterator_next() points nowhere\n"); return 0; } list_header_t *lh1 = list_get_header_by_self(p); if (!lh1->next) return 0; if (lh1->query_type == QUERY_STATIC) { list_header_t *lh2 = list_get_header_by_data(lh1->next); die_unless(lh2->self == &lh2->data, "bad self pointer in list structure"); return (void**)&lh2->self; } else if (lh1->query_type == QUERY_DYNAMIC) { /* Here we treat next as a pointer to a continuation function, * so we can return items from the database computed lazily. * The context is simply the string(s) to match. In the * future, it might point to the results of a SQL query for * example. */ void **(*f) (list_header_t*) = lh1->next; return f(lh1); } return 0; } void add_callback(fptr_list *head, void *f, void *user) { fptr_list cb = (fptr_list)malloc(sizeof(struct _fptr_list)); cb->f = f; cb->context = user; cb->next = *head; *head = cb; } void remove_callback(fptr_list *head, void *f, void *user) { fptr_list cb = *head; fptr_list prevcb = 0; while (cb) { if (cb->f == f && cb->context == user) break; prevcb = cb; cb = cb->next; } if (!cb) return; if (prevcb) prevcb->next = cb->next; else *head = cb->next; free(cb); } /* Helper functions for queries that take two queries as parameters. */ typedef struct { list_header_t *lh_src_head; list_header_t *lh_dest_head; } src_dest_queries_t; static void free_query_src_dest_queries(list_header_t *lh) { query_info_t *qi = lh->query_context; src_dest_queries_t *d = (src_dest_queries_t*)&qi->data; qi = d->lh_src_head->query_context; if (d->lh_src_head->query_type == QUERY_DYNAMIC && qi->query_free) qi->query_free(d->lh_src_head); qi = d->lh_dest_head->query_context; if (d->lh_dest_head->query_type == QUERY_DYNAMIC && qi->query_free) qi->query_free(d->lh_dest_head); free_query_single_context(lh); } static int update_string_if_different(char **pdest_str, const char *src_str) { if (!(*pdest_str) || strcmp((*pdest_str), src_str)) { char *str = (char*) realloc((void*)(*pdest_str), strlen(src_str)+1); strcpy(str, src_str); (*pdest_str) = str; return 1; } return 0; } static int update_string_if_arg(char **pdest_str, mapper_message_t *params, mapper_msg_param_t field) { lo_arg **a = mapper_msg_get_param(params, field); const char *type = mapper_msg_get_type(params, field); if (a && (*a) && (type[0]=='s' || type[0]=='S') && (!(*pdest_str) || strcmp((*pdest_str), &(*a)->s))) { char *str = (char*) realloc((void*)(*pdest_str), strlen(&(*a)->s)+1); strcpy(str, &(*a)->s); (*pdest_str) = str; return 1; } return 0; } static int update_char_if_arg(char *pdest_char, mapper_message_t *params, mapper_msg_param_t field) { lo_arg **a = mapper_msg_get_param(params, field); const char *type = mapper_msg_get_type(params, field); if (a && (*a) && (type[0]=='s' || type[0]=='S')) { if (*pdest_char != (&(*a)->s)[0]) { (*pdest_char) = (&(*a)->s)[0]; return 1; } } else if (a && (*a) && type[0]=='c') { if (*pdest_char != (*a)->c) { (*pdest_char) = (*a)->c; return 1; } } return 0; } static int update_int_if_arg(int *pdest_int, mapper_message_t *params, mapper_msg_param_t field) { lo_arg **a = mapper_msg_get_param(params, field); const char *type = mapper_msg_get_type(params, field); if (a && (*a) && (type[0]=='i') && (*pdest_int != (&(*a)->i)[0])) { (*pdest_int) = (&(*a)->i)[0]; return 1; } return 0; } /* Static data for property tables embedded in the db data * structures. * * Signals and devices have properties that can be indexed by name, * and can have extra properties attached to them if these appear in * the OSC message describing the resource. The utility of this is to * allow for attaching of arbitrary metadata to objects on the * network. For example, signals can have 'x' and 'y' values to * indicate their physical position in the room. * * It is also useful to be able to look up standard properties like * vector length, name, or unit by specifying these as a string. * * The following data provides a string table (as usable by the * implementation in table.c) for indexing the static data existing in * the mapper_db_* data structures. Some of these static properties * may not actually exist, such as 'minimum' and 'maximum' which are * optional properties of signals. Therefore an 'indirect' form is * available where the table points to a pointer to the value, which * may be null. * * A property lookup consists of looking through the 'extra' * properties of a structure. If the requested property is not found, * then the 'static' properties are searched---in the worst case, an * unsuccessful lookup may therefore take twice as long. * * To iterate through all available properties, the caller must * request by index, starting at 0, and incrementing until failure. * They are not guaranteed to be in a particular order. */ typedef struct { char type; union { int indirect; int alt_type; }; int length; // lengths stored as negatives, lookup lengths as offsets int offset; } property_table_value_t; #define SIGDB_OFFSET(x) offsetof(mapper_db_signal_t, x) #define DEVDB_OFFSET(x) offsetof(mapper_db_device_t, x) #define LINKDB_OFFSET(x) offsetof(mapper_db_link_t, x) #define CONDB_OFFSET(x) offsetof(mapper_db_connection_t, x) #define SIG_TYPE (SIGDB_OFFSET(type)) #define SRC_TYPE (CONDB_OFFSET(src_type)) #define DEST_TYPE (CONDB_OFFSET(dest_type)) #define SIG_LENGTH (SIGDB_OFFSET(length)) #define SRC_LENGTH (CONDB_OFFSET(src_length)) #define DEST_LENGTH (CONDB_OFFSET(dest_length)) #define NUM_SCOPES (LINKDB_OFFSET(num_scopes)) /* Here type 'o', which is not an OSC type, was reserved to mean "same * type as the signal's type". The lookup and index functions will * return the sig->type instead of the value's type. */ static property_table_value_t sigdb_values[] = { { 's', {1}, -1, SIGDB_OFFSET(device_name) }, { 'i', {0}, -1, SIGDB_OFFSET(is_output) }, { 'i', {0}, -1, SIGDB_OFFSET(length) }, { 'o', {SIG_TYPE}, SIG_LENGTH, SIGDB_OFFSET(maximum) }, { 'o', {SIG_TYPE}, SIG_LENGTH, SIGDB_OFFSET(minimum) }, { 's', {1}, -1, SIGDB_OFFSET(name) }, { 'f', {0}, -1, SIGDB_OFFSET(rate) }, { 'c', {0}, -1, SIGDB_OFFSET(type) }, { 's', {1}, -1, SIGDB_OFFSET(unit) }, { 'i', {0}, 0, SIGDB_OFFSET(user_data) }, }; /* This table must remain in alphabetical order. */ static string_table_node_t sigdb_nodes[] = { { "device_name", &sigdb_values[0] }, { "direction", &sigdb_values[1] }, { "length", &sigdb_values[2] }, { "max", &sigdb_values[3] }, { "min", &sigdb_values[4] }, { "name", &sigdb_values[5] }, { "rate", &sigdb_values[6] }, { "type", &sigdb_values[7] }, { "unit", &sigdb_values[8] }, { "user_data", &sigdb_values[9] }, }; static mapper_string_table_t sigdb_table = { sigdb_nodes, 10, 10 }; static property_table_value_t devdb_values[] = { { 's', {1}, -1, DEVDB_OFFSET(host) }, { 's', {1}, -1, DEVDB_OFFSET(lib_version) }, { 's', {1}, -1, DEVDB_OFFSET(name) }, { 'i', {0}, -1, DEVDB_OFFSET(num_connections_in) }, { 'i', {0}, -1, DEVDB_OFFSET(num_connections_out) }, { 'i', {0}, -1, DEVDB_OFFSET(num_inputs) }, { 'i', {0}, -1, DEVDB_OFFSET(num_links_in) }, { 'i', {0}, -1, DEVDB_OFFSET(num_links_out) }, { 'i', {0}, -1, DEVDB_OFFSET(num_outputs) }, { 'i', {0}, -1, DEVDB_OFFSET(port) }, { 't', {0}, -1, DEVDB_OFFSET(synced) }, { 'i', {0}, 0, DEVDB_OFFSET(user_data) }, { 'i', {0}, -1, DEVDB_OFFSET(version) }, }; /* This table must remain in alphabetical order. */ static string_table_node_t devdb_nodes[] = { { "host", &devdb_values[0] }, { "lib_version", &devdb_values[1] }, { "name", &devdb_values[2] }, { "num_connections_in", &devdb_values[3] }, { "num_connections_out", &devdb_values[4] }, { "num_inputs", &devdb_values[5] }, { "num_links_in", &devdb_values[6] }, { "num_links_out", &devdb_values[7] }, { "num_outputs", &devdb_values[8] }, { "port", &devdb_values[9] }, { "synced", &devdb_values[10] }, { "user_data", &devdb_values[11] }, { "version", &devdb_values[12] }, }; static mapper_string_table_t devdb_table = { devdb_nodes, 13, 13 }; static property_table_value_t linkdb_values[] = { { 's', {1}, -1, LINKDB_OFFSET(dest_host) }, { 's', {1}, -1, LINKDB_OFFSET(dest_name) }, { 'i', {0}, -1, LINKDB_OFFSET(dest_port) }, { 'i', {0}, -1, LINKDB_OFFSET(num_scopes) }, { 's', {1}, NUM_SCOPES, LINKDB_OFFSET(scope_names)}, { 'i', {1}, NUM_SCOPES, LINKDB_OFFSET(scope_hashes)}, { 's', {1}, -1, LINKDB_OFFSET(src_host) }, { 's', {1}, -1, LINKDB_OFFSET(src_name) }, { 'i', {0}, -1, LINKDB_OFFSET(src_port) }, }; /* This table must remain in alphabetical order. */ static string_table_node_t linkdb_nodes[] = { { "dest_host", &linkdb_values[0] }, { "dest_name", &linkdb_values[1] }, { "dest_port", &linkdb_values[2] }, { "num_scopes", &linkdb_values[3] }, { "scope_names", &linkdb_values[4] }, { "scope_hashes", &linkdb_values[5]}, { "src_host", &linkdb_values[6] }, { "src_name", &linkdb_values[7] }, { "src_port", &linkdb_values[8] }, }; static mapper_string_table_t linkdb_table = { linkdb_nodes, 9, 9 }; static property_table_value_t condb_values[] = { { 'i', {0}, -1, CONDB_OFFSET(bound_min) }, { 'i', {0}, -1, CONDB_OFFSET(bound_max) }, { 'i', {0}, -1, CONDB_OFFSET(dest_length) }, { 'o', {DEST_TYPE}, DEST_LENGTH, CONDB_OFFSET(dest_max) }, { 'o', {DEST_TYPE}, DEST_LENGTH, CONDB_OFFSET(dest_min) }, { 's', {1}, -1, CONDB_OFFSET(dest_name) }, { 'c', {0}, -1, CONDB_OFFSET(dest_type) }, { 's', {1}, -1, CONDB_OFFSET(expression) }, { 'i', {0}, -1, CONDB_OFFSET(mode) }, { 'i', {0}, -1, CONDB_OFFSET(muted) }, { 'i', {0}, -1, CONDB_OFFSET(src_length) }, { 'o', {SRC_TYPE}, SRC_LENGTH, CONDB_OFFSET(src_max) }, { 'o', {SRC_TYPE}, SRC_LENGTH, CONDB_OFFSET(src_min) }, { 's', {1}, -1, CONDB_OFFSET(src_name) }, { 'c', {0}, -1, CONDB_OFFSET(src_type) }, }; /* This table must remain in alphabetical order. */ static string_table_node_t condb_nodes[] = { { "bound_min", &condb_values[0] }, { "bound_max", &condb_values[1] }, { "dest_length", &condb_values[2] }, { "dest_max", &condb_values[3] }, { "dest_min", &condb_values[4] }, { "dest_name", &condb_values[5] }, { "dest_type", &condb_values[6] }, { "expression", &condb_values[7] }, { "mode", &condb_values[8] }, { "muted", &condb_values[9] }, { "src_length", &condb_values[10] }, { "src_max", &condb_values[11] }, { "src_min", &condb_values[12] }, { "src_name", &condb_values[13] }, { "src_type", &condb_values[14] }, }; static mapper_string_table_t condb_table = { condb_nodes, 15, 15 }; /* Generic index and lookup functions to which the above tables would * be passed. These are called for specific types below. */ static int mapper_db_property_index(void *thestruct, table extra, unsigned int index, const char **property, char *type, const void **value, int *length, table proptable) { die_unless(type!=0, "type parameter cannot be null.\n"); die_unless(value!=0, "value parameter cannot be null.\n"); die_unless(length!=0, "length parameter cannot be null.\n"); int i=0, j=0; /* Unfortunately due to "optional" properties like * minimum/maximum, unit, etc, we cannot use an O(1) lookup here-- * the index changes according to availability of properties. * Thus, we have to search through properties linearly, * incrementing a counter along the way, so indexed lookup is * O(N). Meaning iterating through all indexes is O(N^2). A * better way would be to use an iterator-style interface if * efficiency was important for iteration. */ /* First search static properties */ property_table_value_t *prop; for (i=0; i < proptable->len; i++) { prop = table_value_at_index_p(proptable, i); if (prop->indirect) { void **pp = (void**)((char*)thestruct + prop->offset); if (*pp) { if (j==index) { if (property) *property = table_key_at_index(proptable, i); if (prop->type == 'o') *type = *((char*)thestruct + prop->alt_type); else *type = prop->type; if (prop->length > 0) *length = *(int*)((char*)thestruct + prop->length); else *length = prop->length * -1; if (prop->type == 's' && prop->length > 0 && *length == 1) { // In this case pass the char* rather than the array char **temp = *pp; *value = temp[0]; } else *value = *pp; return 0; } j++; } } else { if (j==index) { if (property) *property = table_key_at_index(proptable, i); if (prop->type == 'o') *type = *((char*)thestruct + prop->alt_type); else *type = prop->type; *value = (lo_arg*)((char*)thestruct + prop->offset); if (prop->length > 0) *length = *(int*)((char*)thestruct + prop->length); else *length = prop->length * -1; return 0; } j++; } } index -= j; mapper_prop_value_t *val; val = table_value_at_index_p(extra, index); if (val) { if (property) *property = table_key_at_index(extra, index); *type = val->type; *value = val->value; *length = val->length; return 0; } return 1; } static int mapper_db_property_lookup(void *thestruct, table extra, const char *property, char *type, const void **value, int *length, table proptable) { die_unless(type!=0, "type parameter cannot be null.\n"); die_unless(value!=0, "value parameter cannot be null.\n"); die_unless(length!=0, "length parameter cannot be null.\n"); const mapper_prop_value_t *val; val = table_find_p(extra, property); if (val) { *type = val->type; *value = val->value; *length = val->length; return 0; } property_table_value_t *prop; prop = table_find_p(proptable, property); if (prop) { if (prop->type == 'o') *type = *((char*)thestruct + prop->alt_type); else *type = prop->type; if (prop->length > 0) *length = *(int*)((char*)thestruct + prop->length); else *length = prop->length * -1; if (prop->indirect) { void **pp = (void**)((char*)thestruct + prop->offset); if (*pp) { if (prop->type == 's' && prop->length > 0 && *length == 1) { // In this case pass the char* rather than the array char **temp = *pp; *value = temp[0]; } else *value = *pp; } else return 1; } else *value = (void*)((char*)thestruct + prop->offset); return 0; } return 1; } /**** Device records ****/ /*! Update information about a given device record based on message * parameters. */ static int update_device_record_params(mapper_db_device reg, const char *name, mapper_message_t *params, mapper_timetag_t *current_time) { int updated = 0; updated += update_string_if_different(®->name, name); if (updated) reg->name_hash = crc32(0L, (const Bytef *)name, strlen(name)); if (current_time) mapper_timetag_cpy(®->synced, *current_time); if (!params) return updated; updated += update_string_if_arg(®->host, params, AT_IP); updated += update_string_if_arg(®->lib_version, params, AT_LIB_VERSION); updated += update_int_if_arg(®->port, params, AT_PORT); updated += update_int_if_arg(®->num_inputs, params, AT_NUM_INPUTS); updated += update_int_if_arg(®->num_outputs, params, AT_NUM_OUTPUTS); updated += update_int_if_arg(®->num_links_in, params, AT_NUM_LINKS_IN); updated += update_int_if_arg(®->num_links_out, params, AT_NUM_LINKS_OUT); updated += update_int_if_arg(®->num_connections_in, params, AT_NUM_CONNECTIONS_IN); updated += update_int_if_arg(®->num_connections_out, params, AT_NUM_CONNECTIONS_OUT); updated += update_int_if_arg(®->version, params, AT_REV); updated += mapper_msg_add_or_update_extra_params(reg->extra, params); return updated; } int mapper_db_add_or_update_device_params(mapper_db db, const char *name, mapper_message_t *params, mapper_timetag_t *current_time) { mapper_db_device reg = mapper_db_get_device_by_name(db, name); int rc = 0, updated = 0; if (!reg) { reg = (mapper_db_device) list_new_item(sizeof(*reg)); reg->extra = table_new(); rc = 1; list_prepend_item(reg, (void**)&db->registered_devices); } if (reg) { updated = update_device_record_params(reg, name, params, current_time); if (rc || updated) { fptr_list cb = db->device_callbacks; while (cb) { mapper_db_device_handler *h = cb->f; h(reg, rc ? MDB_NEW : MDB_MODIFY, cb->context); cb = cb->next; } } } return rc; } int mapper_db_device_property_index(mapper_db_device dev, unsigned int index, const char **property, char *type, const void **value, int *length) { return mapper_db_property_index(dev, dev->extra, index, property, type, value, length, &devdb_table); } int mapper_db_device_property_lookup(mapper_db_device dev, const char *property, char *type, const void **value, int *length) { return mapper_db_property_lookup(dev, dev->extra, property, type, value, length, &devdb_table); } static void db_remove_device_internal(mapper_db db, mapper_db_device dev, int quiet) { if (!dev) return; mapper_db_remove_connections_by_query(db, mapper_db_get_connections_by_device_name(db, dev->name)); mapper_db_remove_links_by_query(db, mapper_db_get_links_by_device_name(db, dev->name)); mapper_db_remove_inputs_by_query(db, mapper_db_get_inputs_by_device_name(db, dev->name)); mapper_db_remove_outputs_by_query(db, mapper_db_get_outputs_by_device_name(db, dev->name)); if (!quiet) { fptr_list cb = db->device_callbacks; while (cb) { mapper_db_device_handler *h = cb->f; h(dev, MDB_REMOVE, cb->context); cb = cb->next; } } if (dev->name) free(dev->name); if (dev->host) free(dev->host); if (dev->lib_version) free(dev->lib_version); if (dev->extra) table_free(dev->extra, 1); list_remove_item(dev, (void**)&db->registered_devices); } void mapper_db_remove_device_by_name(mapper_db db, const char *name) { mapper_db_device dev = mapper_db_get_device_by_name(db, name); if (!dev) return; db_remove_device_internal(db, dev, 0); } mapper_db_device mapper_db_get_device_by_name(mapper_db db, const char *name) { mapper_db_device reg = db->registered_devices; while (reg) { if (strcmp(reg->name, name)==0) return reg; reg = list_get_next(reg); } return 0; } mapper_db_device mapper_db_get_device_by_name_hash(mapper_db db, uint32_t name_hash) { mapper_db_device reg = db->registered_devices; while (reg) { if (name_hash == reg->name_hash) return reg; reg = list_get_next(reg); } return 0; } mapper_db_device *mapper_db_get_all_devices(mapper_db db) { if (!db->registered_devices) return 0; list_header_t *lh = list_get_header_by_data(db->registered_devices); die_unless(lh->self == &lh->data, "bad self pointer in list structure"); return (mapper_db_device*)&lh->self; } static int cmp_query_match_devices_by_name(void *context_data, mapper_db_device dev) { const char *device_pattern = (const char*)context_data; return strstr(dev->name, device_pattern)!=0; } mapper_db_device *mapper_db_match_devices_by_name(mapper_db db, const char *str) { mapper_db_device dev = db->registered_devices; if (!dev) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_match_devices_by_name, str, 0); lh->self = dev; if (cmp_query_match_devices_by_name((void*)str, dev)) return (mapper_db_device*)&lh->self; return (mapper_db_device*)dynamic_query_continuation(lh); } mapper_db_device *mapper_db_device_next(mapper_db_device* p) { return (mapper_db_device*) iterator_next((void**)p); } void mapper_db_device_done(mapper_db_device_t **d) { if (!d) return; list_header_t *lh = list_get_header_by_data(*d); if (lh->query_type == QUERY_DYNAMIC && lh->query_context->query_free) lh->query_context->query_free(lh); } void mapper_db_dump(mapper_db db) { #ifdef DEBUG mapper_db_device reg = db->registered_devices; printf("Registered devices:\n"); while (reg) { printf(" name=%s, host=%s, port=%d\n", reg->name, reg->host, reg->port); reg = list_get_next(reg); } mapper_db_signal sig = db->registered_inputs; printf("Registered inputs:\n"); while (sig) { printf(" name=%s%s\n", sig->device_name, sig->name); sig = list_get_next(sig); } sig = db->registered_outputs; printf("Registered outputs:\n"); while (sig) { printf(" name=%s%s\n", sig->device_name, sig->name); sig = list_get_next(sig); } mapper_db_link link = db->registered_links; printf("Registered links:\n"); while (link) { printf(" source=%s, dest=%s\n", link->src_name, link->dest_name); link = list_get_next(link); } mapper_db_connection con = db->registered_connections; printf("Registered connections:\n"); while (con) { printf(" src_name=%s, dest_name=%s,\n" " src_type=%c, dest_type=%c,\n" " src_length=%d, dest_length=%d,\n" " bound_max=%s, bound_min=%s,\n" " expression=%s, mode=%s, muted=%d\n", con->src_name, con->dest_name, con->src_type, con->dest_type, con->src_length, con->dest_length, mapper_get_boundary_action_string(con->bound_max), mapper_get_boundary_action_string(con->bound_min), con->expression, mapper_get_mode_type_string(con->mode), con->muted); if (con->range_known & CONNECTION_RANGE_SRC_MIN) { printf(" src_min="); mapper_prop_pp(con->src_type, con->src_length, con->src_min); printf("\n"); } if (con->range_known & CONNECTION_RANGE_SRC_MAX) { printf(" src_max="); mapper_prop_pp(con->src_type, con->src_length, con->src_max); printf("\n"); } if (con->range_known & CONNECTION_RANGE_DEST_MIN) { printf(" dest_min="); mapper_prop_pp(con->dest_type, con->dest_length, con->dest_min); printf("\n"); } if (con->range_known & CONNECTION_RANGE_DEST_MAX) { printf(" dest_max="); mapper_prop_pp(con->dest_type, con->dest_length, con->dest_max); printf("\n"); } con = list_get_next(con); } #endif } void mapper_db_add_device_callback(mapper_db db, mapper_db_device_handler *h, void *user) { add_callback(&db->device_callbacks, h, user); } void mapper_db_remove_device_callback(mapper_db db, mapper_db_device_handler *h, void *user) { remove_callback(&db->device_callbacks, h, user); } void mapper_db_check_device_status(mapper_db db, uint32_t thresh_time_sec) { mapper_db_device reg = db->registered_devices; while (reg) { // check if device has "checked in" recently // this could be /sync ping or any sent metadata if (reg->synced.sec && (reg->synced.sec < thresh_time_sec)) { fptr_list cb = db->device_callbacks; while (cb) { mapper_db_device_handler *h = cb->f; h(reg, MDB_UNRESPONSIVE, cb->context); cb = cb->next; } } reg = list_get_next(reg); } } int mapper_db_flush(mapper_db db, uint32_t current_time, uint32_t timeout, int quiet) { mapper_db_device reg = db->registered_devices; int removed = 0; while (reg) { if (reg->synced.sec && (current_time - reg->synced.sec > timeout)) { db_remove_device_internal(db, reg, quiet); removed++; } reg = list_get_next(reg); } return removed; } /**** Signals ****/ /*! Update information about a given signal record based on message * parameters. */ static int update_signal_record_params(mapper_db_signal sig, const char *name, const char *device_name, mapper_message_t *params) { lo_arg **args; const char *types; int length, updated = 0, result; updated += update_string_if_different((char**)&sig->name, name); updated += update_string_if_different((char**)&sig->device_name, device_name); if (!params) return updated; updated += update_int_if_arg(&sig->id, params, AT_ID); updated += update_char_if_arg(&sig->type, params, AT_TYPE); updated += update_int_if_arg(&sig->length, params, AT_LENGTH); updated += update_string_if_arg((char**)&sig->unit, params, AT_UNITS); /* @max */ args = mapper_msg_get_param(params, AT_MAX); types = mapper_msg_get_type(params, AT_MAX); length = mapper_msg_get_length(params, AT_MAX); if (args && types) { if (length == sig->length) { if (!sig->maximum) sig->maximum = calloc(1, length * mapper_type_size(sig->type)); int i; for (i=0; imaximum, sig->type, args[i], types[i], i); if (result == -1) { free(sig->maximum); sig->maximum = 0; break; } else updated += result; } } } /* @min */ args = mapper_msg_get_param(params, AT_MIN); types = mapper_msg_get_type(params, AT_MIN); length = mapper_msg_get_length(params, AT_MIN); if (args && types) { if (length == sig->length) { if (!sig->minimum) sig->minimum = calloc(1, length * mapper_type_size(sig->type)); int i; for (i=0; iminimum, sig->type, args[i], types[i], i); if (result == -1) { free(sig->minimum); sig->minimum = 0; break; } else updated += result; } } } int is_output = mapper_msg_get_direction(params); if (is_output != -1 && is_output != sig->is_output) { sig->is_output = is_output; updated++; } updated += update_int_if_arg(&sig->num_instances, params, AT_INSTANCES); updated += mapper_msg_add_or_update_extra_params(sig->extra, params); return updated; } int mapper_db_add_or_update_signal_params(mapper_db db, const char *name, const char *device_name, mapper_message_t *params) { mapper_db_signal sig; int rc = 0, updated = 0; //need to find out if signal is output from params int is_output = mapper_msg_get_direction(params); if (is_output == 1) sig = mapper_db_get_output_by_device_and_signal_names(db, device_name, name); else if (is_output == 0) sig = mapper_db_get_input_by_device_and_signal_names(db, device_name, name); else return 0; if (!sig) { sig = (mapper_db_signal) list_new_item(sizeof(mapper_db_signal_t)); // Defaults (int, length=1) mapper_db_signal_init(sig, is_output, 'i', 1, 0, 0); rc = 1; } if (sig) { update_signal_record_params(sig, name, device_name, params); if (rc) list_prepend_item(sig, (void**)(is_output ? &db->registered_outputs : &db->registered_inputs)); if (rc || updated) { // TODO: Should we really allow callbacks to free themselves? fptr_list cb = db->signal_callbacks, temp; while (cb) { temp = cb->next; mapper_db_signal_handler *h = cb->f; h(sig, rc ? MDB_NEW : MDB_MODIFY, cb->context); cb = temp; } } } return rc; } void mapper_db_signal_init(mapper_db_signal sig, int is_output, char type, int length, const char *name, const char *unit) { sig->is_output = is_output; sig->type = type; sig->length = length; sig->unit = unit ? strdup(unit) : 0; sig->extra = table_new(); sig->minimum = sig->maximum = 0; if (!name) return; if (name[0]=='/') sig->name = strdup(name); else { char *str = malloc(strlen(name)+2); if (str) { str[0] = '/'; str[1] = 0; strcat(str, name); sig->name = str; } } } int mapper_db_signal_property_index(mapper_db_signal sig, unsigned int index, const char **property, char *type, const void **value, int *length) { return mapper_db_property_index(sig, sig->extra, index, property, type, value, length, &sigdb_table); } int mapper_db_signal_property_lookup(mapper_db_signal sig, const char *property, char *type, const void **value, int *length) { return mapper_db_property_lookup(sig, sig->extra, property, type, value, length, &sigdb_table); } void mapper_db_add_signal_callback(mapper_db db, mapper_db_signal_handler *h, void *user) { add_callback(&db->signal_callbacks, h, user); } void mapper_db_remove_signal_callback(mapper_db db, mapper_db_signal_handler *h, void *user) { remove_callback(&db->signal_callbacks, h, user); } mapper_db_signal_t **mapper_db_get_all_inputs(mapper_db db) { if (!db->registered_inputs) return 0; list_header_t *lh = list_get_header_by_data(db->registered_inputs); die_unless(lh->self == &lh->data, "bad self pointer in list structure"); return (mapper_db_signal*)&lh->self; } mapper_db_signal_t **mapper_db_get_all_outputs(mapper_db db) { if (!db->registered_outputs) return 0; list_header_t *lh = list_get_header_by_data(db->registered_outputs); die_unless(lh->self == &lh->data, "bad self pointer in list structure"); return (mapper_db_signal*)&lh->self; } static int cmp_query_signal_exact_device_name(void *context_data, mapper_db_signal sig) { const char *device_name = (const char*)context_data; return strcmp(device_name, sig->device_name)==0; } mapper_db_signal_t **mapper_db_get_inputs_by_device_name( mapper_db db, const char *device_name) { mapper_db_signal sig = db->registered_inputs; if (!sig) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_signal_exact_device_name, device_name, 0); lh->self = sig; if (cmp_query_signal_exact_device_name((void*)device_name, sig)) return (mapper_db_signal*)&lh->self; return (mapper_db_signal*)dynamic_query_continuation(lh); } mapper_db_signal_t **mapper_db_get_outputs_by_device_name( mapper_db db, const char *device_name) { mapper_db_signal sig = db->registered_outputs; if (!sig) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_signal_exact_device_name, device_name, 0); lh->self = sig; if (cmp_query_signal_exact_device_name((void*)device_name, sig)) return (mapper_db_signal*)&lh->self; return (mapper_db_signal*)dynamic_query_continuation(lh); } mapper_db_signal mapper_db_get_input_by_device_and_signal_names( mapper_db db, const char *device_name, const char *signal_name) { mapper_db_signal sig = db->registered_inputs; if (!sig) return 0; while (sig) { if (strcmp(sig->device_name, device_name)==0 && strcmp(sig->name, signal_name)==0) return sig; sig = list_get_next(sig); } return 0; } mapper_db_signal mapper_db_get_output_by_device_and_signal_names( mapper_db db, const char *device_name, const char *signal_name) { mapper_db_signal sig = db->registered_outputs; if (!sig) return 0; while (sig) { if (strcmp(sig->device_name, device_name)==0 && strcmp(sig->name, signal_name)==0) return sig; sig = list_get_next(sig); } return 0; } static int cmp_match_signal_device_name(void *context_data, mapper_db_signal sig) { const char *device_name = (const char*)context_data; const char *signal_pattern = ((const char*)context_data + strlen(device_name) + 1); return strcmp(device_name, sig->device_name)==0 && strstr(sig->name, signal_pattern); } mapper_db_signal_t **mapper_db_match_inputs_by_device_name( mapper_db db, const char *device_name, const char *input_pattern) { mapper_db_signal sig = db->registered_inputs; if (!sig) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_match_signal_device_name, device_name, input_pattern, 0); lh->self = sig; if (cmp_match_signal_device_name(&lh->query_context->data, sig)) return (mapper_db_signal*)&lh->self; return (mapper_db_signal*)dynamic_query_continuation(lh); } mapper_db_signal_t **mapper_db_match_outputs_by_device_name( mapper_db db, const char *device_name, char const *output_pattern) { mapper_db_signal sig = db->registered_outputs; if (!sig) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_match_signal_device_name, device_name, output_pattern, 0); lh->self = sig; if (cmp_match_signal_device_name(&lh->query_context->data, sig)) return (mapper_db_signal*)&lh->self; return (mapper_db_signal*)dynamic_query_continuation(lh); } mapper_db_signal_t **mapper_db_signal_next(mapper_db_signal_t** p) { return (mapper_db_signal*) iterator_next((void**)p); } void mapper_db_signal_done(mapper_db_signal_t **s) { if (!s) return; list_header_t *lh = list_get_header_by_data(*s); if (lh->query_type == QUERY_DYNAMIC && lh->query_context->query_free) lh->query_context->query_free(lh); } static void mapper_db_remove_signal(mapper_db db, mapper_db_signal sig, int is_output) { fptr_list cb = db->signal_callbacks; while (cb) { mapper_db_signal_handler *h = cb->f; h(sig, MDB_REMOVE, cb->context); cb = cb->next; } if (sig->name) free(sig->name); if (sig->device_name) free(sig->device_name); if (sig->unit) free(sig->unit); if (sig->minimum) free(sig->minimum); if (sig->maximum) free(sig->maximum); if (sig->extra) table_free(sig->extra, 1); if (is_output) list_remove_item(sig, (void**)&db->registered_outputs); else list_remove_item(sig, (void**)&db->registered_inputs); } void mapper_db_remove_input_by_name(mapper_db db, const char *device_name, const char *signal_name) { mapper_db_signal sig; sig = mapper_db_get_input_by_device_and_signal_names(db, device_name, signal_name); if (!sig) return; mapper_db_remove_connections_by_query(db, mapper_db_get_connections_by_dest_device_and_signal_names(db, device_name, signal_name)); mapper_db_remove_signal(db, sig, 0); } void mapper_db_remove_inputs_by_query(mapper_db db, mapper_db_signal_t **s) { while (s) { mapper_db_signal sig = *s; s = mapper_db_signal_next(s); mapper_db_remove_signal(db, sig, 0); } } void mapper_db_remove_output_by_name(mapper_db db, const char *device_name, const char *signal_name) { mapper_db_signal sig; sig = mapper_db_get_output_by_device_and_signal_names(db, device_name, signal_name); if (!sig) return; mapper_db_remove_connections_by_query(db, mapper_db_get_connections_by_src_device_and_signal_names(db, device_name, signal_name)); mapper_db_remove_signal(db, sig, 1); } void mapper_db_remove_outputs_by_query(mapper_db db, mapper_db_signal_t **s) { while (s) { mapper_db_signal sig = *s; s = mapper_db_signal_next(s); mapper_db_remove_signal(db, sig, 1); } } /**** Connection records ****/ /*! Update information about a given connection record based on * message parameters. */ static int update_connection_record_params(mapper_db_connection con, const char *src_name, const char *dest_name, mapper_message_t *params) { lo_arg **args; const char *types; int updated = 0, result; updated += update_string_if_different(&con->src_name, src_name); updated += update_string_if_different(&con->dest_name, dest_name); if (!params) return updated; updated += update_char_if_arg(&con->src_type, params, AT_SRC_TYPE); updated += update_char_if_arg(&con->dest_type, params, AT_DEST_TYPE); updated += update_int_if_arg(&con->src_length, params, AT_SRC_LENGTH); updated += update_int_if_arg(&con->dest_length, params, AT_DEST_LENGTH); mapper_boundary_action bound; bound = mapper_msg_get_boundary_action(params, AT_BOUND_MAX); if ((int)bound != -1 && bound != con->bound_max) { con->bound_max = bound; updated++; } bound = mapper_msg_get_boundary_action(params, AT_BOUND_MIN); if ((int)bound != -1 && bound != con->bound_min) { con->bound_min = bound; updated++; } /* @srcMax */ args = mapper_msg_get_param(params, AT_SRC_MAX); types = mapper_msg_get_type(params, AT_SRC_MAX); int length = mapper_msg_get_length(params, AT_SRC_MAX); if (args && types) { if (length == con->src_length) { if (!con->src_max) con->src_max = calloc(1, length * mapper_type_size(con->src_type)); con->range_known |= CONNECTION_RANGE_SRC_MAX; int i; for (i=0; isrc_max, con->src_type, args[i], types[i], i); if (result == -1) { con->range_known &= ~CONNECTION_RANGE_SRC_MAX; break; } else updated += result; } } else con->range_known &= ~CONNECTION_RANGE_SRC_MAX; } /* @srcMin */ args = mapper_msg_get_param(params, AT_SRC_MIN); types = mapper_msg_get_type(params, AT_SRC_MIN); length = mapper_msg_get_length(params, AT_SRC_MIN); if (args && types) { if (length == con->src_length) { if (!con->src_min) con->src_min = calloc(1, length * mapper_type_size(con->src_type)); con->range_known |= CONNECTION_RANGE_SRC_MIN; int i; for (i=0; isrc_min, con->src_type, args[i], types[i], i); if (result == -1) { con->range_known &= ~CONNECTION_RANGE_SRC_MIN; break; } else updated += result; } } else con->range_known &= ~CONNECTION_RANGE_SRC_MIN; } /* @destMax */ args = mapper_msg_get_param(params, AT_DEST_MAX); types = mapper_msg_get_type(params, AT_DEST_MAX); length = mapper_msg_get_length(params, AT_DEST_MAX); if (args && types) { if (length == con->dest_length) { if (!con->dest_max) con->dest_max = calloc(1, length * mapper_type_size(con->dest_type)); con->range_known |= CONNECTION_RANGE_DEST_MAX; int i; for (i=0; idest_max, con->dest_type, args[i], types[i], i); if (result == -1) { con->range_known &= ~CONNECTION_RANGE_DEST_MAX; break; } else updated += result; } } else con->range_known &= ~CONNECTION_RANGE_DEST_MAX; } /* @destMin */ args = mapper_msg_get_param(params, AT_DEST_MIN); types = mapper_msg_get_type(params, AT_DEST_MIN); length = mapper_msg_get_length(params, AT_DEST_MIN); if (args && types) { if (length == con->dest_length) { if (!con->dest_min) con->dest_min = calloc(1, length * mapper_type_size(con->dest_type)); con->range_known |= CONNECTION_RANGE_DEST_MIN; int i; for (i=0; idest_min, con->dest_type, args[i], types[i], i); if (result == -1) { con->range_known &= ~CONNECTION_RANGE_DEST_MIN; break; } else updated += result; } } else con->range_known &= ~CONNECTION_RANGE_DEST_MIN; } updated += update_int_if_arg(&con->id, params, AT_ID); updated += update_string_if_arg(&con->expression, params, AT_EXPRESSION); mapper_mode_type mode = mapper_msg_get_mode(params); if ((int)mode != -1 && mode != con->mode) { con->mode = mode; updated++; } int mute = mapper_msg_get_mute(params); if (mute != -1 && mute != con->muted) { con->muted = mute; updated++; } updated += mapper_msg_add_or_update_extra_params(con->extra, params); return updated; } int mapper_db_add_or_update_connection_params(mapper_db db, const char *src_name, const char *dest_name, mapper_message_t *params) { mapper_db_connection con; int rc = 0, updated = 0, i; con = mapper_db_get_connection_by_signal_full_names(db, src_name, dest_name); if (!con) { con = (mapper_db_connection) list_new_item(sizeof(mapper_db_connection_t)); con->src_min = 0; con->src_max = 0; con->extra = table_new(); rc = 1; // also add devices if necessary char devname[128]= "/"; for (i = 1; i < 127 && src_name[i] != '/' ; i++) devname[i] = src_name[i]; devname[i] = '\0'; mapper_db_add_or_update_device_params(db, devname, 0, 0); for (i = 1; i < 127 && dest_name[i] != '/' ; i++) devname[i] = dest_name[i]; devname[i] = '\0'; mapper_db_add_or_update_device_params(db, devname, 0, 0); } if (con) { updated = update_connection_record_params(con, src_name, dest_name, params); if (rc) list_prepend_item(con, (void**)&db->registered_connections); if (rc || updated) { fptr_list cb = db->connection_callbacks; while (cb) { mapper_db_connection_handler *h = cb->f; h(con, rc ? MDB_NEW : MDB_MODIFY, cb->context); cb = cb->next; } } } return rc; } int mapper_db_connection_property_index(mapper_db_connection con, unsigned int index, const char **property, char *type, const void **value, int *length) { return mapper_db_property_index(con, con->extra, index, property, type, value, length, &condb_table); } int mapper_db_connection_property_lookup(mapper_db_connection con, const char *property, char *type, const void **value, int *length) { return mapper_db_property_lookup(con, con->extra, property, type, value, length, &condb_table); } mapper_db_connection_t **mapper_db_get_all_connections(mapper_db db) { if (!db->registered_connections) return 0; list_header_t *lh = list_get_header_by_data(db->registered_connections); die_unless(lh->self == &lh->data, "bad self pointer in list structure"); return (mapper_db_connection*)&lh->self; } void mapper_db_add_connection_callback(mapper_db db, mapper_db_connection_handler *h, void *user) { add_callback(&db->connection_callbacks, h, user); } void mapper_db_remove_connection_callback(mapper_db db, mapper_db_connection_handler *h, void *user) { remove_callback(&db->connection_callbacks, h, user); } static int cmp_query_get_connections_by_device_name(void *context_data, mapper_db_connection con) { const char *devname = (const char*)context_data; unsigned int devnamelen = strlen(devname); return ( strncmp(con->src_name+1, devname, devnamelen)==0 || strncmp(con->dest_name+1, devname, devnamelen)==0 ); } mapper_db_connection_t **mapper_db_get_connections_by_device_name( mapper_db db, const char *device_name) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; // query skips first '/' in the name if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_device_name, device_name[0]=='/' ? device_name+1 : device_name, 0); lh->self = connection; if (cmp_query_get_connections_by_device_name( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_query_get_connections_by_src_dest_device_names( void *context_data, mapper_db_connection con) { const char *srcdevname = (const char*)context_data; unsigned int srcdevnamelen = strlen(srcdevname); const char *destdevname = srcdevname + srcdevnamelen + 1; unsigned int destdevnamelen = strlen(destdevname); return ( strncmp(con->src_name+1, srcdevname, srcdevnamelen)==0 && strncmp(con->dest_name+1, destdevname, destdevnamelen)==0 ); } mapper_db_connection_t **mapper_db_get_connections_by_src_dest_device_names( mapper_db db, const char *src_device_name, const char *dest_device_name) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; // query skips first '/' in the name if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_src_dest_device_names, src_device_name[0]=='/' ? src_device_name+1 : src_device_name, dest_device_name[0]=='/' ? dest_device_name+1 : dest_device_name, 0); lh->self = connection; if (cmp_query_get_connections_by_src_dest_device_names( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_query_get_connections_by_src_signal_name(void *context_data, mapper_db_connection con) { const char *src_name = (const char*)context_data; const char *map_src_name = con->src_name+1; while (*map_src_name && *map_src_name != '/') // find the signal name map_src_name++; map_src_name++; return strcmp(map_src_name, src_name)==0; } mapper_db_connection_t **mapper_db_get_connections_by_src_signal_name( mapper_db db, const char *src_signal) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; // query skips first '/' in the name if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_src_signal_name, src_signal[0]=='/' ? src_signal+1 : src_signal, 0); lh->self = connection; if (cmp_query_get_connections_by_src_signal_name( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_query_get_connections_by_src_device_and_signal_names( void *context_data, mapper_db_connection con) { const char *name = (const char*) context_data; return strcmp(con->src_name, name)==0; } mapper_db_connection_t **mapper_db_get_connections_by_src_device_and_signal_names( mapper_db db, const char *src_device, const char *src_signal) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; // query skips first '/' in both names if it is provided char name[1024]; snprintf(name, 1024, "/%s/%s", src_device[0]=='/' ? src_device+1 : src_device, src_signal[0]=='/' ? src_signal+1 : src_signal); list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_src_device_and_signal_names, name, 0); lh->self = connection; if (cmp_query_get_connections_by_src_device_and_signal_names( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_query_get_connections_by_dest_signal_name(void *context_data, mapper_db_connection con) { const char *dest_name = (const char*)context_data; const char *map_dest_name = con->dest_name+1; while (*map_dest_name && *map_dest_name != '/') // find the signal name map_dest_name++; map_dest_name++; return strcmp(map_dest_name, dest_name)==0; } mapper_db_connection_t **mapper_db_get_connections_by_dest_signal_name( mapper_db db, const char *dest_name) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; // query skips first '/' in the name if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_dest_signal_name, dest_name[0]=='/' ? dest_name+1 : dest_name, 0); lh->self = connection; if (cmp_query_get_connections_by_dest_signal_name( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_query_get_connections_by_dest_device_and_signal_names( void *context_data, mapper_db_connection con) { const char *name = (const char*) context_data; return strcmp(con->dest_name, name)==0; } mapper_db_connection_t **mapper_db_get_connections_by_dest_device_and_signal_names( mapper_db db, const char *dest_device, const char *dest_signal) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; char name[1024]; snprintf(name, 1024, "/%s/%s", dest_device[0]=='/' ? dest_device+1 : dest_device, dest_signal[0]=='/' ? dest_signal+1 : dest_signal); // query skips first '/' in both names if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_dest_device_and_signal_names, name, 0); lh->self = connection; if (cmp_query_get_connections_by_dest_device_and_signal_names( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } mapper_db_connection mapper_db_get_connection_by_signal_full_names( mapper_db db, const char *src_name, const char *dest_name) { mapper_db_connection con = db->registered_connections; if (!con) return 0; while (con) { if (strcmp(con->src_name, src_name)==0 && strcmp(con->dest_name, dest_name)==0) return con; con = list_get_next(con); } return 0; } static int cmp_query_get_connections_by_device_and_signal_names( void *context_data, mapper_db_connection con) { const char *src_name = (const char*) context_data; if (strcmp(con->src_name, src_name)!=0) return 0; const char *dest_name = src_name + strlen(src_name) + 1; return strcmp(con->dest_name, dest_name)==0; } mapper_db_connection_t **mapper_db_get_connections_by_device_and_signal_names( mapper_db db, const char *src_device, const char *src_signal, const char *dest_device, const char *dest_signal) { mapper_db_connection connection = db->registered_connections; if (!connection) return 0; char inname[1024]; snprintf(inname, 1024, "/%s/%s", (src_device[0]=='/' ? src_device+1 : src_device), src_signal[0]=='/' ? src_signal+1 : src_signal); char outname[1024]; snprintf(outname, 1024, "/%s/%s", (dest_device[0]=='/' ? dest_device+1 : dest_device), dest_signal[0]=='/' ? dest_signal+1 : dest_signal); // query skips first '/' in both names if it is provided list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_connections_by_device_and_signal_names, inname, outname, 0); lh->self = connection; if (cmp_query_get_connections_by_device_and_signal_names( &lh->query_context->data, connection)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } static int cmp_get_connections_by_signal_queries(void *context_data, mapper_db_connection con) { src_dest_queries_t *qsig = (src_dest_queries_t*) context_data; char ctx_backup[1024]; /* Save the source list context so we can restart the query on the * next pass. */ save_query_single_context(qsig->lh_src_head, ctx_backup, 1024); /* Indicate not to free memory at the end of the pass. */ if (qsig->lh_src_head->query_type == QUERY_DYNAMIC && qsig->lh_src_head->query_context) qsig->lh_src_head->query_context->query_free = 0; /* Find at least one signal in the source list that matches. */ mapper_db_signal *srcsig = (mapper_db_signal*)&qsig->lh_src_head->self; unsigned int devnamelen = strlen((*srcsig)->device_name); while (srcsig && *srcsig) { if (strncmp((*srcsig)->device_name, con->src_name, devnamelen)==0 && strcmp((*srcsig)->name, con->src_name+devnamelen)==0) break; srcsig = mapper_db_signal_next(srcsig); } mapper_db_signal_done(srcsig); restore_query_single_context(qsig->lh_src_head, ctx_backup); if (!srcsig) return 0; /* Save the destination list context so we can restart the query * on the next pass. */ save_query_single_context(qsig->lh_dest_head, ctx_backup, 1024); /* Indicate not to free memory at the end of the pass. */ if (qsig->lh_dest_head->query_type == QUERY_DYNAMIC && qsig->lh_dest_head->query_context) qsig->lh_dest_head->query_context->query_free = 0; /* Find at least one signal in the destination list that matches. */ mapper_db_signal *destsig = (mapper_db_signal*)&qsig->lh_dest_head->self; devnamelen = strlen((*destsig)->device_name); while (destsig && *destsig) { if (strncmp((*destsig)->device_name, con->dest_name, devnamelen)==0 && strcmp((*destsig)->name, con->dest_name+devnamelen)==0) break; destsig = mapper_db_signal_next(destsig); } restore_query_single_context(qsig->lh_dest_head, ctx_backup); mapper_db_signal_done(destsig); if (!destsig) return 0; return 1; } mapper_db_connection_t **mapper_db_get_connections_by_signal_queries( mapper_db db, mapper_db_signal_t **src, mapper_db_signal_t **dest) { mapper_db_connection maps = db->registered_connections; if (!maps) return 0; if (!(src && dest)) return 0; query_info_t *qi = (query_info_t*) malloc(sizeof(query_info_t) + sizeof(src_dest_queries_t)); qi->size = sizeof(query_info_t) + sizeof(src_dest_queries_t); qi->query_compare = (query_compare_func_t*) cmp_get_connections_by_signal_queries; qi->query_free = free_query_src_dest_queries; src_dest_queries_t *qdata = (src_dest_queries_t*)&qi->data; qdata->lh_src_head = list_get_header_by_self(src); qdata->lh_dest_head = list_get_header_by_self(dest); list_header_t *lh = (list_header_t*) malloc(LIST_HEADER_SIZE); lh->self = maps; lh->next = dynamic_query_continuation; lh->query_type = QUERY_DYNAMIC; lh->query_context = qi; if (cmp_get_connections_by_signal_queries( &lh->query_context->data, maps)) return (mapper_db_connection*)&lh->self; return (mapper_db_connection*)dynamic_query_continuation(lh); } mapper_db_connection_t **mapper_db_connection_next(mapper_db_connection_t** c) { return (mapper_db_connection*) iterator_next((void**)c); } void mapper_db_connection_done(mapper_db_connection_t **d) { if (!d) return; list_header_t *lh = list_get_header_by_data(*d); if (lh->query_type == QUERY_DYNAMIC && lh->query_context->query_free) lh->query_context->query_free(lh); } void mapper_db_remove_connections_by_query(mapper_db db, mapper_db_connection_t **c) { while (c) { mapper_db_connection con = *c; c = mapper_db_connection_next(c); mapper_db_remove_connection(db, con); } } void mapper_db_remove_connection(mapper_db db, mapper_db_connection con) { if (!con) return; fptr_list cb = db->connection_callbacks; while (cb) { mapper_db_connection_handler *h = cb->f; h(con, MDB_REMOVE, cb->context); cb = cb->next; } if (con->src_name) free(con->src_name); if (con->dest_name) free(con->dest_name); if (con->expression) free(con->expression); if (con->src_min) free(con->src_min); if (con->src_max) free(con->src_max); if (con->dest_min) free(con->dest_min); if (con->dest_max) free(con->dest_max); if (con->extra) table_free(con->extra, 1); list_remove_item(con, (void**)&db->registered_connections); } /**** Link records ****/ int mapper_db_link_add_scope(mapper_db_link link, const char *scope) { int i; if (!link || !scope) return 1; // Check if scope is already stored for this link uint32_t hash; if (strcmp(scope, "all")==0) hash = 0; else hash = crc32(0L, (const Bytef *)scope, strlen(scope)); for (i=0; inum_scopes; i++) if (link->scope_hashes[i] == hash) return 1; // not found - add a new scope i = ++link->num_scopes; link->scope_names = realloc(link->scope_names, i * sizeof(char *)); link->scope_names[i-1] = strdup(scope); link->scope_hashes = realloc(link->scope_hashes, i * sizeof(uint32_t)); link->scope_hashes[i-1] = hash; return 0; } int mapper_db_link_remove_scope(mapper_db_link link, const char *scope) { int i, j; if (!link || !scope) return 1; uint32_t hash; if (strcmp(scope, "all")==0) hash = 0; else hash = crc32(0L, (const Bytef *)scope, strlen(scope)); for (i=0; inum_scopes; i++) { if (link->scope_hashes[i] == hash) { free(link->scope_names[i]); for (j=i+1; jnum_scopes; j++) { link->scope_names[j-1] = link->scope_names[j]; link->scope_hashes[j-1] = link->scope_hashes[j]; } link->num_scopes--; link->scope_names = realloc(link->scope_names, link->num_scopes * sizeof(char *)); link->scope_hashes = realloc(link->scope_hashes, link->num_scopes * sizeof(uint32_t)); return 0; } } return 1; } /*! Update information about a given link record based on message * parameters. */ static int update_link_record_params(mapper_db_link link, const char *src_name, const char *dest_name, mapper_message_t *params) { int i, j, num_scopes = 0, updated = 0; updated += update_string_if_different(&link->src_name, src_name); updated += update_string_if_different(&link->dest_name, dest_name); if (!params) return updated; updated += update_int_if_arg(&link->src_port, params, AT_SRC_PORT); updated += update_int_if_arg(&link->dest_port, params, AT_DEST_PORT); lo_arg **a_scopes = mapper_msg_get_param(params, AT_SCOPE); num_scopes = mapper_msg_get_length(params, AT_SCOPE); // First remove old scopes that are missing for (i=0; inum_scopes; i++) { int found = 0; for (j=0; jscope_names[i], &a_scopes[j]->s) == 0) { found = 1; break; } } if (!found) { mapper_db_link_remove_scope(link, link->scope_names[i]); updated++; } } // ...then add any new scopes for (i=0; is)); updated += mapper_msg_add_or_update_extra_params(link->extra, params); return updated; } int mapper_db_add_or_update_link_params(mapper_db db, const char *src_name, const char *dest_name, mapper_message_t *params) { mapper_db_link link; int rc = 0, updated = 0; link = mapper_db_get_link_by_src_dest_names(db, src_name, dest_name); if (!link) { link = (mapper_db_link) list_new_item(sizeof(mapper_db_link_t)); link->extra = table_new(); rc = 1; // also add devices if neccesary mapper_db_add_or_update_device_params(db, src_name, 0, 0); mapper_db_add_or_update_device_params(db, dest_name, 0, 0); } if (link) { updated = update_link_record_params(link, src_name, dest_name, params); if (rc) list_prepend_item(link, (void**)&db->registered_links); if (rc || updated) { fptr_list cb = db->link_callbacks; while (cb) { mapper_db_link_handler *h = cb->f; h(link, rc ? MDB_NEW : MDB_MODIFY, cb->context); cb = cb->next; } } } else { trace("couldn't find or create link in " "mapper_db_add_or_update_link_params()\n"); } return rc; } int mapper_db_link_property_index(mapper_db_link link, unsigned int index, const char **property, char *type, const void **value, int *length) { return mapper_db_property_index(link, link->extra, index, property, type, value, length, &linkdb_table); } int mapper_db_link_property_lookup(mapper_db_link link, const char *property, char *type, const void **value, int *length) { return mapper_db_property_lookup(link, link->extra, property, type, value, length, &linkdb_table); } void mapper_db_add_link_callback(mapper_db db, mapper_db_link_handler *h, void *user) { add_callback(&db->link_callbacks, h, user); } void mapper_db_remove_link_callback(mapper_db db, mapper_db_link_handler *h, void *user) { remove_callback(&db->link_callbacks, h, user); } mapper_db_link_t **mapper_db_get_all_links(mapper_db db) { if (!db->registered_links) return 0; list_header_t *lh = list_get_header_by_data(db->registered_links); die_unless(lh->self == &lh->data, "bad self pointer in list structure"); return (mapper_db_link*)&lh->self; } mapper_db_link mapper_db_get_link_by_src_dest_names( mapper_db db, const char *src_device_name, const char *dest_device_name) { mapper_db_link link = db->registered_links; while (link) { if (strcmp(link->src_name, src_device_name)==0 && strcmp(link->dest_name, dest_device_name)==0) break; link = list_get_next(link); } return link; } static int cmp_query_get_links_by_device_name(void *context_data, mapper_db_link link) { const char *devname = (const char*)context_data; return ( strcmp(link->src_name+1, devname)==0 || strcmp(link->dest_name+1, devname)==0 ); } mapper_db_link_t **mapper_db_get_links_by_device_name( mapper_db db, const char *device_name) { mapper_db_link link = db->registered_links; if (!link) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_links_by_device_name, device_name[0]=='/' ? device_name+1 : device_name, 0); lh->self = link; if (cmp_query_get_links_by_device_name( &lh->query_context->data, link)) return (mapper_db_link*)&lh->self; return (mapper_db_link*)dynamic_query_continuation(lh); } static int cmp_query_get_links_by_src_device_name(void *context_data, mapper_db_link link) { const char *src = (const char*)context_data; return strcmp(link->src_name, src)==0; } mapper_db_link_t **mapper_db_get_links_by_src_device_name( mapper_db db, const char *src_device_name) { mapper_db_link link = db->registered_links; if (!link) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_links_by_src_device_name, src_device_name, 0); lh->self = link; if (cmp_query_get_links_by_src_device_name( &lh->query_context->data, link)) return (mapper_db_link*)&lh->self; return (mapper_db_link*)dynamic_query_continuation(lh); } static int cmp_query_get_links_by_dest_device_name(void *context_data, mapper_db_link link) { const char *dest = (const char*)context_data; return strcmp(link->dest_name, dest)==0; } mapper_db_link_t **mapper_db_get_links_by_dest_device_name( mapper_db db, const char *dest_device_name) { mapper_db_link link = db->registered_links; if (!link) return 0; list_header_t *lh = construct_query_context_from_strings( (query_compare_func_t*)cmp_query_get_links_by_dest_device_name, dest_device_name, 0); lh->self = link; if (cmp_query_get_links_by_dest_device_name( &lh->query_context->data, link)) return (mapper_db_link*)&lh->self; return (mapper_db_link*)dynamic_query_continuation(lh); } static int cmp_get_links_by_src_dest_devices(void *context_data, mapper_db_link link) { src_dest_queries_t *qdata = (src_dest_queries_t*)context_data; char ctx_backup[1024]; /* Save the source list context so we can restart the query on the * next pass. */ save_query_single_context(qdata->lh_src_head, ctx_backup, 1024); /* Indicate not to free memory at the end of the pass. */ if (qdata->lh_src_head->query_type == QUERY_DYNAMIC && qdata->lh_src_head->query_context) qdata->lh_src_head->query_context->query_free = 0; /* Find at least one device in the source list that matches. */ mapper_db_device *src = (mapper_db_device*)&qdata->lh_src_head->self; while (src && *src) { if (strcmp((*src)->name, link->src_name)==0) break; src = mapper_db_device_next(src); } mapper_db_device_done(src); restore_query_single_context(qdata->lh_src_head, ctx_backup); if (!src) return 0; /* Save the destination list context so we can restart the query * on the next pass. */ save_query_single_context(qdata->lh_dest_head, ctx_backup, 1024); /* Indicate not to free memory at the end of the pass. */ if (qdata->lh_dest_head->query_type == QUERY_DYNAMIC && qdata->lh_dest_head->query_context) qdata->lh_dest_head->query_context->query_free = 0; /* Find at least one device in the destination list that matches. */ mapper_db_device *dest = (mapper_db_device*)&qdata->lh_dest_head->self; while (dest && *dest) { if (strcmp((*dest)->name, link->dest_name)==0) break; dest = mapper_db_device_next(dest); } restore_query_single_context(qdata->lh_dest_head, ctx_backup); mapper_db_device_done(dest); if (!dest) return 0; return 1; } mapper_db_link_t **mapper_db_get_links_by_src_dest_devices( mapper_db db, mapper_db_device_t **src_device_list, mapper_db_device_t **dest_device_list) { mapper_db_link link = db->registered_links; if (!link) return 0; query_info_t *qi = (query_info_t*) malloc(sizeof(query_info_t) + sizeof(src_dest_queries_t)); qi->size = sizeof(query_info_t) + sizeof(src_dest_queries_t); qi->query_compare = (query_compare_func_t*) cmp_get_links_by_src_dest_devices; qi->query_free = free_query_src_dest_queries; src_dest_queries_t *qdata = (src_dest_queries_t*)&qi->data; qdata->lh_src_head = list_get_header_by_self(src_device_list); qdata->lh_dest_head = list_get_header_by_self(dest_device_list); list_header_t *lh = (list_header_t*) malloc(LIST_HEADER_SIZE); lh->self = link; lh->next = dynamic_query_continuation; lh->query_type = QUERY_DYNAMIC; lh->query_context = qi; if (cmp_get_links_by_src_dest_devices( &lh->query_context->data, link)) return (mapper_db_link*)&lh->self; return (mapper_db_link*)dynamic_query_continuation(lh); } mapper_db_link_t **mapper_db_link_next(mapper_db_link_t** p) { return (mapper_db_link*) iterator_next((void**)p); } void mapper_db_link_done(mapper_db_link_t **s) { if (!s) return; list_header_t *lh = list_get_header_by_data(*s); if (lh->query_type == QUERY_DYNAMIC && lh->query_context->query_free) lh->query_context->query_free(lh); } void mapper_db_remove_links_by_query(mapper_db db, mapper_db_link_t **s) { while (s) { mapper_db_link link = *s; s = mapper_db_link_next(s); mapper_db_remove_link(db, link); } } void mapper_db_remove_link(mapper_db db, mapper_db_link link) { int i; if (!link) return; fptr_list cb = db->link_callbacks; while (cb) { mapper_db_link_handler *h = cb->f; h(link, MDB_REMOVE, cb->context); cb = cb->next; } if (link->src_name) free(link->src_name); if (link->dest_name) free(link->dest_name); if (link->num_scopes && link->scope_names) { for (i=0; inum_scopes; i++) free(link->scope_names[i]); free(link->scope_names); free(link->scope_hashes); } if (link->extra) table_free(link->extra, 1); list_remove_item(link, (void**)&db->registered_links); } void mapper_db_remove_all_callbacks(mapper_db db) { fptr_list cb; while ((cb = db->device_callbacks)) { db->device_callbacks = db->device_callbacks->next; free(cb); } while ((cb = db->signal_callbacks)) { db->signal_callbacks = db->signal_callbacks->next; free(cb); } while ((cb = db->link_callbacks)) { db->link_callbacks = db->link_callbacks->next; free(cb); } while ((cb = db->connection_callbacks)) { db->connection_callbacks = db->connection_callbacks->next; free(cb); } } libmapper/src/Makefile.am0000644000175000017500000000112312423630127014641 0ustar tiagotiago noinst_HEADERS = mapper_internal.h types_internal.h EXTRA_DIST = libmapper.def if WINDOWS_DLL lt_windows = -no-undefined -export-symbols libmapper.def endif lib_LTLIBRARIES = libmapper-@MAJOR_VERSION@.la libmapper_@MAJOR_VERSION@_la_CFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) libmapper_@MAJOR_VERSION@_la_SOURCES = expression.c device.c admin.c signal.c \ receiver.c router.c connection.c db.c params.c monitor.c table.c time.c libmapper_@MAJOR_VERSION@_la_LIBADD = $(liblo_LIBS) libmapper_@MAJOR_VERSION@_la_LDFLAGS = $(lt_windows) -export-dynamic -version-info @SO_VERSION@ libmapper/src/device.c0000644000175000017500000011756412423630127014231 0ustar tiagotiago #include #include #include #include #include #include #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include "config.h" #include #ifdef HAVE_PTHREAD #include #endif /*! Internal function to get the current time. */ static double get_current_time() { #ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; #else #error No timing method known on this platform. #endif } //! Allocate and initialize a mapper device. mapper_device mdev_new(const char *name_prefix, int port, mapper_admin admin) { mapper_device md = (mapper_device) calloc(1, sizeof(struct _mapper_device)); if (admin) { md->admin = admin; md->own_admin = 0; } else { md->admin = mapper_admin_new(0, 0, 0); md->own_admin = 1; } mdev_start_server(md, port); if (!md->admin || !md->server) { mdev_free(md); return NULL; } md->props.identifier = strdup(name_prefix); md->props.name = 0; md->props.name_hash = 0; md->ordinal.value = 1; md->ordinal.locked = 0; md->registered = 0; md->routers = 0; md->active_id_map = 0; md->reserve_id_map = 0; md->id_counter = 0; md->props.extra = table_new(); md->flags = 0; // md->link_timeout_sec = ADMIN_TIMEOUT_SEC; md->link_timeout_sec = 0; mapper_admin_add_device(md->admin, md); return md; } //! Free resources used by a mapper device. void mdev_free(mapper_device md) { int i, j; if (!md) return; if (md->registered) { // A registered device must tell the network it is leaving. mapper_admin_set_bundle_dest_bus(md->admin); mapper_admin_bundle_message(md->admin, ADM_LOGOUT, 0, "s", mdev_name(md)); } // First release active instances mapper_signal sig; if (md->outputs) { // release all active output instances for (i = 0; i < md->props.num_outputs; i++) { sig = md->outputs[i]; for (j = 0; j < sig->id_map_length; j++) { if (sig->id_maps[j].instance) { msig_release_instance_internal(sig, j, MAPPER_NOW); } } } } if (md->inputs) { // release all active input instances for (i = 0; i < md->props.num_inputs; i++) { sig = md->inputs[i]; for (j = 0; j < sig->id_map_length; j++) { if (sig->id_maps[j].instance) { msig_release_instance_internal(sig, j, MAPPER_NOW); } } } } // Routers and receivers reference parent signals so release them first while (md->routers) mdev_remove_router(md, md->routers); while (md->receivers) mdev_remove_receiver(md, md->receivers); if (md->outputs) { for (i = 0; i < md->props.num_outputs; i++) msig_free(md->outputs[i]); free(md->outputs); } if (md->inputs) { for (i = 0; i < md->props.num_inputs; i++) { msig_free(md->inputs[i]); } free(md->inputs); } // Release device id maps mapper_id_map map; while (md->active_id_map) { map = md->active_id_map; md->active_id_map = map->next; free(map); } while (md->reserve_id_map) { map = md->reserve_id_map; md->reserve_id_map = map->next; free(map); } if (md->props.extra) table_free(md->props.extra, 1); if (md->props.identifier) free(md->props.identifier); if (md->props.name) free(md->props.name); if (md->props.host) free(md->props.host); if (md->admin) { if (md->own_admin) mapper_admin_free(md->admin); else md->admin->device = 0; } if (md->server) lo_server_free(md->server); free(md); } void mdev_registered(mapper_device md) { int i, j; md->registered = 1; /* Add device name to signals. Also add device name hash to * locally-activated signal instances. */ for (i = 0; i < md->props.num_inputs; i++) { md->inputs[i]->props.device_name = (char *)mdev_name(md); for (j = 0; j < md->inputs[i]->id_map_length; j++) { if (md->inputs[i]->id_maps[j].map && md->inputs[i]->id_maps[j].map->origin == 0) md->inputs[i]->id_maps[j].map->origin = md->props.name_hash; } } for (i = 0; i < md->props.num_outputs; i++) { md->outputs[i]->props.device_name = (char *)mdev_name(md); for (j = 0; j < md->outputs[i]->id_map_length; j++) { if (md->outputs[i]->id_maps[j].map && md->outputs[i]->id_maps[j].map->origin == 0) md->outputs[i]->id_maps[j].map->origin = md->props.name_hash; } } } #ifdef __GNUC__ // when gcc inlines this with O2 or O3, it causes a crash. bug? __attribute__ ((noinline)) #endif static void grow_ptr_array(void **array, int length, int *size) { if (*size < length && !*size) (*size)++; while (*size < length) (*size) *= 2; *array = realloc(*array, sizeof(void *) * (*size)); } static void mdev_increment_version(mapper_device md) { md->props.version ++; if (md->registered) { md->flags |= FLAGS_DEVICE_ATTRIBS_CHANGED; } } /* This handler needs to be able to handle a number of overlapping cases: * - scalar and vector signal values * - null vector elements * - entirely null typestrings (used to release instances) * - multiple signal samples in one message ("count" > 1) */ static int handler_signal(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_signal sig = (mapper_signal) user_data; mapper_device md; int i = 0, j, k, count = 1, nulls = 0; int index = 0, is_instance_update = 0, origin, public_id; mapper_id_map map; if (!sig || !sig->handler || !(md = sig->device)) { trace("error, cannot retrieve user_data\n"); return 0; } if (!argc) return 0; // We need to consider that there may be properties appended to the msg // check length and types int value_len = 0; while (value_len < argc && types[value_len] != 's' && types[value_len] != 'S') { if (types[i] == 'N') nulls++; else if (types[i] != sig->props.type) { trace("error: unexpected typestring for signal %s\n", sig->props.name); return 0; } value_len++; } if (value_len < sig->props.length || value_len % sig->props.length != 0) { trace("error: unexpected length for signal %s\n", sig->props.name); return 0; } count = value_len / sig->props.length; if (argc >= value_len + 3) { // could be update of specific instance if (types[value_len] != 's' && types[value_len] != 'S') return 0; if (strcmp(&argv[value_len]->s, "@instance") != 0) return 0; if (types[value_len+1] != 'i' || types[value_len+2] != 'i') return 0; is_instance_update = 1; origin = argv[value_len+1]->i32; public_id = argv[value_len+2]->i32; } // TODO: optionally discard out-of-order messages // requires timebase sync for many-to-one connections or local updates // if (sig->discard_out_of_order && out_of_order(si->timetag, tt)) // return 0; lo_timetag tt = lo_message_get_timestamp(msg); if (is_instance_update) { index = msig_find_instance_with_remote_ids(sig, origin, public_id, IN_RELEASED_REMOTELY); if (index < 0) { // no instance found with this map // Don't activate instance just to release it again if (count == 1 && nulls == sig->props.length) return 0; // otherwise try to init reserved/stolen instance with device map index = msig_get_instance_with_remote_ids(sig, origin, public_id, 0, &tt); if (index < 0) { trace("no local instances available for remote instance %ld:%ld\n", (long)origin, (long)public_id); return 0; } } else { if (sig->id_maps[index].status & IN_RELEASED_LOCALLY) { // map was already released locally, we are only interested in release messages if (count == 1 && nulls == sig->props.length) { // we can clear signal's reference to map map = sig->id_maps[index].map; sig->id_maps[index].map = 0; map->refcount_remote--; if (map->refcount_remote <= 0 && map->refcount_local <= 0) { mdev_remove_instance_id_map(md, map); } } return 0; } else if (!sig->id_maps[index].instance) { trace("error: missing instance!\n"); return 0; } } } else { index = 0; if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 1, &tt); if (index < 0) return 0; } mapper_signal_instance si = sig->id_maps[index].instance; map = sig->id_maps[index].map; // TODO: alter timetags for multicount updates with missing handler calls? si->timetag.sec = tt.sec; si->timetag.frac = tt.frac; int size = mapper_type_size(sig->props.type); void *out_buffer = count == 1 ? 0 : alloca(count * sig->props.length * size); int vals, out_count = 0; /* As currently implemented, instance release messages cannot be embedded in * multi-count messages. */ for (i = 0, k = 0; i < count; i++) { // check if each update will result in a handler call // all nulls -> release instance, sig has no value, break "count" vals = 0; for (j = 0; j < sig->props.length; j++, k++) { if (types[k] == 'N') continue; memcpy(si->value + j * size, argv[k], size); si->has_value_flags[j / 8] |= 1 << (j % 8); vals++; } if (vals == 0) { // protocol: update with all nulls sets signal has_value to 0 if (si->has_value) { si->has_value = 0; memset(si->has_value_flags, 0, sig->props.length / 8 + 1); if (is_instance_update) { // TODO: handle multiple upstream devices sig->id_maps[index].status |= IN_RELEASED_REMOTELY; map->refcount_remote--; if (sig->instance_event_handler && (sig->instance_event_flags & IN_UPSTREAM_RELEASE)) { sig->instance_event_handler(sig, &sig->props, map->local, IN_UPSTREAM_RELEASE, &tt); } else if (sig->handler) sig->handler(sig, &sig->props, map->local, 0, 1, &tt); } else { // call handler with null value sig->handler(sig, &sig->props, map->local, 0, 1, &tt); } } return 0; } if (si->has_value || memcmp(si->has_value_flags, sig->has_complete_value, sig->props.length / 8 + 1)==0) { if (count > 1) { memcpy(out_buffer + out_count * sig->props.length * size, si->value, size); out_count++; } else sig->handler(sig, &sig->props, map->local, si->value, 1, &tt); si->has_value = 1; } else { // Call handler with NULL value sig->handler(sig, &sig->props, map->local, 0, 0, &tt); } } if (out_count) { sig->handler(sig, &sig->props, map->local, out_buffer, out_count, &tt); } // TODO: handle cases where count > 1 if (!sig->props.is_output) { mdev_receive_update(md, sig, index, tt); } return 0; } static int handler_instance_release_request(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_signal sig = (mapper_signal) user_data; mapper_device md = sig->device; if (!md) return 0; if (!sig->instance_event_handler || !(sig->instance_event_flags & IN_DOWNSTREAM_RELEASE)) return 0; lo_timetag tt = lo_message_get_timestamp(msg); int index = msig_find_instance_with_remote_ids(sig, argv[0]->i32, argv[1]->i32, 0); if (index < 0) return 0; if (sig->instance_event_handler) { sig->instance_event_handler(sig, &sig->props, sig->id_maps[index].map->local, IN_DOWNSTREAM_RELEASE, &tt); } return 0; } static int handler_query(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_signal sig = (mapper_signal) user_data; mapper_device md = sig->device; int length = sig->props.length; char type = sig->props.type; if (!md) { trace("error, sig->device==0\n"); return 0; } if (!argc) return 0; else if (types[0] != 's' && types[0] != 'S') return 0; int i, j, sent = 0; // respond with same timestamp as query // TODO: should we also include actual timestamp for signal value? lo_timetag tt = lo_message_get_timestamp(msg); lo_bundle b = lo_bundle_new(tt); // query response string is first argument const char *response_path = &argv[0]->s; // vector length and data type may also be provided if (argc >= 3) { if (types[1] == 'i') length = argv[1]->i32; if (types[2] == 'c') type = argv[2]->c; } mapper_signal_instance si; for (i = 0; i < sig->id_map_length; i++) { if (!(si = sig->id_maps[i].instance)) continue; lo_message m = lo_message_new(); if (!m) continue; message_add_coerced_signal_instance_value(m, sig, si, length, type); if (sig->props.num_instances > 1) { lo_message_add_string(m, "@instance"); lo_message_add_int32(m, (long)sig->id_maps[i].map->origin); lo_message_add_int32(m, (long)sig->id_maps[i].map->public); } lo_bundle_add_message(b, response_path, m); sent++; } if (!sent) { // If there are no active instances, send a single null response lo_message m = lo_message_new(); if (m) { for (j = 0; j < length; j++) lo_message_add_nil(m); lo_bundle_add_message(b, response_path, m); } } // TODO: do we need to free the lo_address here? lo_send_bundle(lo_message_get_source(msg), b); lo_bundle_free_messages(b); return 0; } static mapper_signal add_input_internal(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances, mapper_signal_update_handler *handler, void *user_data) { if (mdev_get_input_by_name(md, name, 0)) return 0; char *signal_get = 0; mapper_signal sig = msig_new(name, length, type, 0, unit, minimum, maximum, num_instances, handler, user_data); if (!sig) return 0; md->props.num_inputs++; grow_ptr_array((void **) &md->inputs, md->props.num_inputs, &md->n_alloc_inputs); mdev_increment_version(md); md->inputs[md->props.num_inputs - 1] = sig; sig->device = md; lo_server_add_method(md->server, sig->props.name, NULL, handler_signal, (void *) (sig)); int len = strlen(sig->props.name) + 5; signal_get = (char*) realloc(signal_get, len); snprintf(signal_get, len, "%s%s", sig->props.name, "/get"); lo_server_add_method(md->server, signal_get, NULL, handler_query, (void *) (sig)); free(signal_get); if (md->registered) { sig->props.device_name = (char *)mdev_name(md); // Notify subscribers mapper_admin_set_bundle_dest_subscribers(md->admin, SUB_DEVICE_INPUTS); mapper_admin_send_signal(md->admin, md, sig); } return sig; } // Add an input signal to a mapper device. mapper_signal mdev_add_input(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, mapper_signal_update_handler *handler, void *user_data) { return add_input_internal(md, name, length, type, unit, minimum, maximum, -1, handler, user_data); } // Add an input signal with multiple instances to a mapper device. mapper_signal mdev_add_poly_input(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances, mapper_signal_update_handler *handler, void *user_data) { if (num_instances < 0) num_instances = 0; return add_input_internal(md, name, length, type, unit, minimum, maximum, num_instances, handler, user_data); } // Add an output signal to a mapper device. static mapper_signal add_output_internal(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances) { if (mdev_get_output_by_name(md, name, 0)) return 0; mapper_signal sig = msig_new(name, length, type, 1, unit, minimum, maximum, num_instances, 0, 0); if (!sig) return 0; md->props.num_outputs++; grow_ptr_array((void **) &md->outputs, md->props.num_outputs, &md->n_alloc_outputs); mdev_increment_version(md); md->outputs[md->props.num_outputs - 1] = sig; sig->device = md; if (md->registered) { sig->props.device_name = (char *)mdev_name(md); // Notify subscribers mapper_admin_set_bundle_dest_subscribers(md->admin, SUB_DEVICE_OUTPUTS); mapper_admin_send_signal(md->admin, md, sig); } return sig; } // Add an output signal to a mapper device. mapper_signal mdev_add_output(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum) { return add_output_internal(md, name, length, type, unit, minimum, maximum, -1); } // Add an output signal with multiple instances to a mapper device. mapper_signal mdev_add_poly_output(mapper_device md, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances) { if (num_instances < 0) num_instances = 0; return add_output_internal(md, name, length, type, unit, minimum, maximum, num_instances); } void mdev_add_signal_methods(mapper_device md, mapper_signal sig) { // TODO: handle adding and removing input signal methods also? if (!sig->props.is_output) return; char *type = 0, *path = 0; int len; len = (int) strlen(sig->props.name) + 5; path = (char*) realloc(path, len); snprintf(path, len, "%s%s", sig->props.name, "/got"); type = (char*) realloc(type, sig->props.length + 3); type[0] = type[1] = 'i'; memset(type + 2, sig->props.type, sig->props.length); type[sig->props.length + 2] = 0; lo_server_add_method(md->server, path, NULL, handler_signal, (void *)sig); md->n_output_callbacks ++; free(path); free(type); } void mdev_remove_signal_methods(mapper_device md, mapper_signal sig) { char *path = 0; int len, i; if (!md || !sig) return; for (i=0; iprops.num_outputs; i++) { if (md->outputs[i] == sig) break; } if (i==md->props.num_outputs) return; len = (int) strlen(sig->props.name) + 5; path = (char*) realloc(path, len); snprintf(path, len, "%s%s", sig->props.name, "/got"); lo_server_del_method(md->server, path, NULL); md->n_output_callbacks --; } void mdev_add_instance_release_request_callback(mapper_device md, mapper_signal sig) { if (!sig->props.is_output) return; // TODO: use normal release message? lo_server_add_method(md->server, sig->props.name, "iiF", handler_instance_release_request, (void *) (sig)); md->n_output_callbacks ++; } void mdev_remove_instance_release_request_callback(mapper_device md, mapper_signal sig) { int i; if (!md || !sig) return; for (i=0; iprops.num_outputs; i++) { if (md->outputs[i] == sig) break; } if (i==md->props.num_outputs) return; lo_server_del_method(md->server, sig->props.name, "iiF"); md->n_output_callbacks --; } void mdev_remove_input(mapper_device md, mapper_signal sig) { int i, n; char str1[1024], str2[1024]; for (i=0; iprops.num_inputs; i++) { if (md->inputs[i] == sig) break; } if (i==md->props.num_inputs) return; for (n=i; n<(md->props.num_inputs-1); n++) { md->inputs[n] = md->inputs[n+1]; } lo_server_del_method(md->server, sig->props.name, NULL); snprintf(str1, 1024, "%s/get", sig->props.name); lo_server_del_method(md->server, str1, NULL); mapper_receiver r = md->receivers; msig_full_name(sig, str2, 1024); while (r) { mapper_receiver_signal rs = r->signals; while (rs) { if (rs->signal == sig) { // need to disconnect? mapper_admin_set_bundle_dest_mesh(md->admin, r->admin_addr); mapper_connection c = rs->connections; while (c) { snprintf(str1, 1024, "%s%s", r->props.src_name, c->props.src_name); // TODO: send directly to source device? mapper_admin_bundle_message(md->admin, ADM_DISCONNECT, 0, "ss", str1, str2); mapper_connection temp = c->next; mapper_receiver_remove_connection(r, c); c = temp; } break; } rs = rs->next; } r = r->next; } if (md->registered) { // Notify subscribers mapper_admin_set_bundle_dest_subscribers(md->admin, SUB_DEVICE_INPUTS); mapper_admin_send_signal_removed(md->admin, md, sig); } md->props.num_inputs --; mdev_increment_version(md); msig_free(sig); } void mdev_remove_output(mapper_device md, mapper_signal sig) { int i, n; char str1[1024], str2[1024]; for (i=0; iprops.num_outputs; i++) { if (md->outputs[i] == sig) break; } if (i==md->props.num_outputs) return; for (n=i; n<(md->props.num_outputs-1); n++) { md->outputs[n] = md->outputs[n+1]; } if (sig->handler) { snprintf(str1, 1024, "%s/got", sig->props.name); lo_server_del_method(md->server, str1, NULL); } if (sig->instance_event_handler && (sig->instance_event_flags & IN_DOWNSTREAM_RELEASE)) { lo_server_del_method(md->server, sig->props.name, "iiF"); } mapper_router r = md->routers; msig_full_name(sig, str1, 1024); while (r) { mapper_router_signal rs = r->signals; while (rs) { if (rs->signal == sig) { // need to disconnect? mapper_admin_set_bundle_dest_mesh(md->admin, r->admin_addr); mapper_connection c = rs->connections; while (c) { snprintf(str2, 1024, "%s%s", r->props.dest_name, c->props.dest_name); // TODO: send directly to source device? mapper_admin_bundle_message(md->admin, ADM_DISCONNECTED, 0, "ss", str1, str2); mapper_connection temp = c->next; mapper_router_remove_connection(r, c); c = temp; } break; } rs = rs->next; } r = r->next; } if (md->registered) { // Notify subscribers mapper_admin_set_bundle_dest_subscribers(md->admin, SUB_DEVICE_OUTPUTS); mapper_admin_send_signal_removed(md->admin, md, sig); } md->props.num_outputs --; mdev_increment_version(md); msig_free(sig); } int mdev_num_inputs(mapper_device md) { return md->props.num_inputs; } int mdev_num_outputs(mapper_device md) { return md->props.num_outputs; } int mdev_num_links_in(mapper_device md) { return md->props.num_links_in; } int mdev_num_links_out(mapper_device md) { return md->props.num_links_out; } int mdev_num_connections_in(mapper_device md) { mapper_receiver r = md->receivers; int count = 0; while (r) { count += r->num_connections; r = r->next; } return count; } int mdev_num_connections_out(mapper_device md) { mapper_router r = md->routers; int count = 0; while (r) { count += r->num_connections; r = r->next; } return count; } mapper_signal *mdev_get_inputs(mapper_device md) { return md->inputs; } mapper_signal *mdev_get_outputs(mapper_device md) { return md->outputs; } mapper_signal mdev_get_input_by_name(mapper_device md, const char *name, int *index) { int i, slash; if (!name) return 0; slash = name[0]=='/' ? 1 : 0; for (i=0; iprops.num_inputs; i++) { if (strcmp(md->inputs[i]->props.name + 1, name + slash)==0) { if (index) *index = i; return md->inputs[i]; } } return 0; } mapper_signal mdev_get_output_by_name(mapper_device md, const char *name, int *index) { int i, slash; if (!name) return 0; slash = name[0]=='/' ? 1 : 0; for (i=0; iprops.num_outputs; i++) { if (strcmp(md->outputs[i]->props.name + 1, name + slash)==0) { if (index) *index = i; return md->outputs[i]; } } return 0; } mapper_signal mdev_get_input_by_index(mapper_device md, int index) { if (index >= 0 && index < md->props.num_inputs) return md->inputs[index]; return 0; } mapper_signal mdev_get_output_by_index(mapper_device md, int index) { if (index >= 0 && index < md->props.num_outputs) return md->outputs[index]; return 0; } int mdev_poll(mapper_device md, int block_ms) { int admin_count = mapper_admin_poll(md->admin); int count = 0; if (md->server) { /* If a timeout is specified, loop until the time is up. */ if (block_ms) { double then = get_current_time(); int left_ms = block_ms; while (left_ms > 0) { if (lo_server_recv_noblock(md->server, left_ms)) count++; double elapsed = get_current_time() - then; left_ms = block_ms - (int)(elapsed*1000); } } /* When done, or if non-blocking, check for remaining messages * up to a proportion of the number of input * signals. Arbitrarily choosing 1 for now, since we don't * support "combining" multiple incoming streams, so there's * no point. Perhaps if this is supported in the future it * can be a heuristic based on a recent number of messages per * channel per poll. */ while (count < (md->props.num_inputs + md->n_output_callbacks)*1 && lo_server_recv_noblock(md->server, 0)) count++; } else if (block_ms) { #ifdef WIN32 Sleep(block_ms); #else usleep(block_ms * 1000); #endif } return admin_count + count; } int mdev_num_fds(mapper_device md) { // Two for the admin inputs (bus and mesh), and one for the signal input. return 3; } int mdev_get_fds(mapper_device md, int *fds, int num) { if (num > 0) fds[0] = lo_server_get_socket_fd(md->admin->bus_server); if (num > 1) { fds[1] = lo_server_get_socket_fd(md->admin->mesh_server); if (num > 2) fds[2] = lo_server_get_socket_fd(md->server); else return 2; } else return 1; return 3; } void mdev_service_fd(mapper_device md, int fd) { // TODO: separate fds for bus and mesh comms if (fd == lo_server_get_socket_fd(md->admin->bus_server)) mapper_admin_poll(md->admin); else if (md->server && fd == lo_server_get_socket_fd(md->server)) lo_server_recv_noblock(md->server, 0); } void mdev_num_instances_changed(mapper_device md, mapper_signal sig, int size) { if (!md) return; mapper_router r = md->routers; while (r) { mapper_router_num_instances_changed(r, sig, size); r = r->next; } } void mdev_route_signal(mapper_device md, mapper_signal sig, int instance_index, void *value, int count, mapper_timetag_t timetag) { // pass update to each router in turn mapper_router r = md->routers; while (r) { mapper_router_process_signal(r, sig, instance_index, value, count, timetag); r = r->next; } } void mdev_receive_update(mapper_device md, mapper_signal sig, int instance_index, mapper_timetag_t tt) { // pass update to each receiver in turn mapper_receiver r = md->receivers; while (r) { mapper_receiver_send_update(r, sig, instance_index, tt); r = r->next; } return; } // Function to start a mapper queue void mdev_start_queue(mapper_device md, mapper_timetag_t tt) { if (!md) return; mapper_router r = md->routers; while (r) { mapper_router_start_queue(r, tt); r = r->next; } } void mdev_send_queue(mapper_device md, mapper_timetag_t tt) { if (!md) return; mapper_router r = md->routers; while (r) { mapper_router_send_queue(r, tt); r = r->next; } } int mdev_route_query(mapper_device md, mapper_signal sig, mapper_timetag_t tt) { int count = 0; mapper_router r = md->routers; while (r) { count += mapper_router_send_query(r, sig, tt); r = r->next; } return count; } void mdev_route_released(mapper_device md, mapper_signal sig, int instance_index, mapper_timetag_t tt) { if (sig->props.is_output) mdev_route_signal(md, sig, instance_index, 0, 0, tt); else { // pass update to each receiver in turn mapper_receiver r = md->receivers; while (r) { mapper_receiver_send_released(r, sig, instance_index, tt); r = r->next; } } } void mdev_add_router(mapper_device md, mapper_router rt) { mapper_router *r = &md->routers; rt->next = *r; *r = rt; md->props.num_links_out++; } void mdev_remove_router(mapper_device md, mapper_router rt) { mapper_router *r = &md->routers; while (*r) { if (*r == rt) { *r = rt->next; mapper_router_free(rt); md->props.num_links_out--; break; } r = &(*r)->next; } } void mdev_add_receiver(mapper_device md, mapper_receiver rc) { mapper_receiver *r = &md->receivers; rc->next = *r; *r = rc; md->props.num_links_in++; } void mdev_remove_receiver(mapper_device md, mapper_receiver rc) { // remove receiver mapper_receiver *r = &md->receivers; while (*r) { if (*r == rc) { *r = rc->next; mapper_receiver_free(rc); md->props.num_links_in--; break; } r = &(*r)->next; } } void mdev_reserve_instance_id_map(mapper_device dev) { mapper_id_map map; map = (mapper_id_map)calloc(1, sizeof(struct _mapper_id_map)); map->next = dev->reserve_id_map; dev->reserve_id_map = map; } mapper_id_map mdev_add_instance_id_map(mapper_device dev, int local_id, int origin, int public_id) { if (!dev->reserve_id_map) mdev_reserve_instance_id_map(dev); mapper_id_map map = dev->reserve_id_map; map->local = local_id; map->origin = origin; map->public = public_id; map->refcount_local = 0; map->refcount_remote = 0; dev->reserve_id_map = map->next; map->next = dev->active_id_map; dev->active_id_map = map; return map; } void mdev_remove_instance_id_map(mapper_device dev, mapper_id_map map) { mapper_id_map *id_map = &dev->active_id_map; while (*id_map) { if ((*id_map) == map) { *id_map = (*id_map)->next; map->next = dev->reserve_id_map; dev->reserve_id_map = map; break; } id_map = &(*id_map)->next; } } mapper_id_map mdev_find_instance_id_map_by_local(mapper_device dev, int local_id) { mapper_id_map map = dev->active_id_map; while (map) { if (map->local == local_id) return map; map = map->next; } return 0; } mapper_id_map mdev_find_instance_id_map_by_remote(mapper_device dev, int origin, int public_id) { mapper_id_map map = dev->active_id_map; while (map) { if (map->origin == origin && map->public == public_id) return map; map = map->next; } return 0; } /* Note: any call to liblo where get_liblo_error will be called * afterwards must lock this mutex, otherwise there is a race * condition on receiving this information. Could be fixed by the * liblo error handler having a user context pointer. */ static int liblo_error_num = 0; static void liblo_error_handler(int num, const char *msg, const char *path) { liblo_error_num = num; if (num == LO_NOPORT) { trace("liblo could not start a server because port unavailable\n"); } else fprintf(stderr, "[libmapper] liblo server error %d in path %s: %s\n", num, path, msg); } void mdev_start_server(mapper_device md, int starting_port) { if (!md->server) { int i; char port[16], *pport = port, *path = 0; if (starting_port) sprintf(port, "%d", starting_port); else pport = 0; while (!(md->server = lo_server_new(pport, liblo_error_handler))) { pport = 0; } // Disable liblo message queueing lo_server_enable_queue(md->server, 0, 1); md->props.port = lo_server_get_port(md->server); trace("bound to port %i\n", md->props.port); for (i = 0; i < md->props.num_inputs; i++) { lo_server_add_method(md->server, md->inputs[i]->props.name, NULL, handler_signal, (void *) (md->inputs[i])); int len = (int) strlen(md->inputs[i]->props.name) + 5; path = (char*) realloc(path, len); snprintf(path, len, "%s%s", md->inputs[i]->props.name, "/get"); lo_server_add_method(md->server, path, NULL, handler_query, (void *) (md->inputs[i])); } for (i = 0; i < md->props.num_outputs; i++) { if (md->outputs[i]->handler) { int len = (int) strlen(md->outputs[i]->props.name) + 5; path = (char*) realloc(path, len); snprintf(path, len, "%s%s", md->outputs[i]->props.name, "/got"); lo_server_add_method(md->server, path, NULL, handler_signal, (void *) (md->outputs[i])); md->n_output_callbacks ++; } if (md->outputs[i]->instance_event_handler && (md->outputs[i]->instance_event_flags & IN_DOWNSTREAM_RELEASE)) { lo_server_add_method(md->server, md->outputs[i]->props.name, "iiF", handler_instance_release_request, (void *) (md->outputs[i])); md->n_output_callbacks ++; } } free(path); } } const char *mdev_name(mapper_device md) { if (!md->registered || !md->ordinal.locked) return 0; if (md->props.name) return md->props.name; unsigned int len = strlen(md->props.identifier) + 6; md->props.name = (char *) malloc(len); md->props.name[0] = 0; snprintf(md->props.name, len, "/%s.%d", md->props.identifier, md->ordinal.value); return md->props.name; } unsigned int mdev_id(mapper_device md) { if (md->registered) return md->props.name_hash; else return 0; } unsigned int mdev_port(mapper_device md) { if (md->registered) return md->props.port; else return 0; } const struct in_addr *mdev_ip4(mapper_device md) { if (md->registered) return &md->admin->interface_ip; else return 0; } const char *mdev_interface(mapper_device md) { return md->admin->interface_name; } unsigned int mdev_ordinal(mapper_device md) { if (md->registered) return md->ordinal.value; else return 0; } int mdev_ready(mapper_device device) { if (!device) return 0; return device->registered; } mapper_db_device mdev_properties(mapper_device dev) { return &dev->props; } void mdev_set_property(mapper_device dev, const char *property, char type, void *value, int length) { if (strcmp(property, "name") == 0 || strcmp(property, "host") == 0 || strcmp(property, "port") == 0 || strcmp(property, "user_data") == 0) { trace("Cannot set locked device property '%s'\n", property); return; } mapper_table_add_or_update_typed_value(dev->props.extra, property, type, value, length); } void mdev_remove_property(mapper_device dev, const char *property) { table_remove_key(dev->props.extra, property, 1); } lo_server mdev_get_lo_server(mapper_device md) { return md->server; } void mdev_now(mapper_device dev, mapper_timetag_t *timetag) { mapper_clock_now(&dev->admin->clock, timetag); } void mdev_set_link_callback(mapper_device dev, mapper_device_link_handler *h, void *user) { dev->link_cb = h; dev->link_cb_userdata = user; } void mdev_set_connection_callback(mapper_device dev, mapper_device_connection_handler *h, void *user) { dev->connection_cb = h; dev->connection_cb_userdata = user; } libmapper/src/methodlist.c0000644000175000017500000000470712423630127015140 0ustar tiagotiago #include #include #include int mapper_method_add(mapper_method *head, const char *path, const char *types) { /* Allocate new structure */ mapper_method method = malloc(sizeof(mapper_method_t)); if (!method) return 0; method->path = strdup(path); if (!method->path) { free(method); return 0; } method->types = strdup(types); if (!method->types) { free(method->path); free(method); return 0; } method->next = NULL; if (*head) { /* Find end of list. Check if same method has been previously * added while we're at it */ mapper_method node = *head; while (node->next) { if (strcmp(node->path, path) == 0 && strcmp(node->types, types) == 0) { free(method->path); free(method->types); free(method); return 0; } node = node->next; } if (strcmp(node->path, path) == 0 && strcmp(node->types, types) == 0) { free(method->path); free(method->types); free(method); return 0; } node->next = method; } else { *head = method; } return 1; } int mapper_method_remove(mapper_method *head, const char *path, const char *types) { if (*head) { /* Find specified method */ mapper_method node = *head; mapper_method *prev = head; while (node) { if (strcmp(node->path, path) == 0 && strcmp(node->types, types) == 0) break; prev = &node->next; node = node->next; } if (node) { /* Remove it from the list */ *prev = node->next; free(node->path); free(node->types); free(node); } else return 0; } else { return 0; } } int mapper_method_list_free(mapper_method *head) { mapper_method node, tmp; node = *head; *head = 0; while (node) { tmp = node->next; free(node->path); free(node->types); free(node); node = tmp; } } int mapper_method_list_count(mapper_method head) { mapper_method node = head; int count = 0; while (node) { count++; node = node->next; } return count; } libmapper/src/admin.c0000644000175000017500000031254112423630127014052 0ustar tiagotiago #include "config.h" #include #include #include #include #include #include #include #include #ifdef HAVE_GETIFADDRS #include #include #endif #ifdef HAVE_ARPA_INET_H #include #else #ifdef HAVE_WINSOCK2_H #include #include #include #endif #endif #include "mapper_internal.h" #include "types_internal.h" #include "config.h" #include // set to 1 to force mesh comms to use admin bus instead for debugging #define FORCE_ADMIN_TO_BUS 0 #define BUNDLE_DEST_SUBSCRIBERS (void*)-1 #define BUNDLE_DEST_BUS 0 /*! Internal function to get the current time. */ static double get_current_time() { #ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; #else #error No timing method known on this platform. #endif } /* Note: any call to liblo where get_liblo_error will be called * afterwards must lock this mutex, otherwise there is a race * condition on receiving this information. Could be fixed by the * liblo error handler having a user context pointer. */ static int liblo_error_num = 0; static void liblo_error_handler(int num, const char *msg, const char *path) { liblo_error_num = num; if (num == LO_NOPORT) { trace("liblo could not start a server because port unavailable\n"); } else fprintf(stderr, "[libmapper] liblo server error %d in path %s: %s\n", num, path, msg); } const char* admin_msg_strings[] = { "/connect", /* ADM_CONNECT */ "/connectTo", /* ADM_CONNECT_TO */ "/connected", /* ADM_CONNECTED */ "/connection/modify", /* ADM_CONNECTION_MODIFY */ "/device", /* ADM_DEVICE */ "/disconnect", /* ADM_DISCONNECT */ "/disconnected", /* ADM_DISCONNECTED */ "/link", /* ADM_LINK */ "/link/modify", /* ADM_LINK_MODIFY */ "/linkTo", /* ADM_LINK_TO */ "/linked", /* ADM_LINKED */ "/link/ping", /* ADM_LINK_PING */ "/logout", /* ADM_LOGOUT */ "/signal", /* ADM_SIGNAL */ "/input", /* ADM_INPUT */ "/output", /* ADM_OUTPUT */ "/input/removed", /* ADM_INPUT_SIGNAL_REMOVED */ "/output/removed", /* ADM_OUTPUT_SIGNAL_REMOVED */ "%s/subscribe", /* ADM_SUBSCRIBE */ "%s/unsubscribe", /* ADM_UNSUBSCRIBE */ "/sync", /* ADM_SYNC */ "/unlink", /* ADM_UNLINK */ "/unlinked", /* ADM_UNLINKED */ "/who", /* ADM_WHO */ }; /* Internal functions for sending admin messages. */ static void mapper_admin_send_device(mapper_admin admin, mapper_device device); static void mapper_admin_send_linked(mapper_admin admin, mapper_link link, int is_outgoing); static void mapper_admin_send_connected(mapper_admin admin, mapper_link link, mapper_connection c, int index, int is_outgoing); /* Internal message handler prototypes. */ static int handler_who(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_logout(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_subscribe(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_unsubscribe(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_info(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_input_signal_removed(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_output_signal_removed(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_name_probe(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_name_registered(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_link(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_linkTo(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_linked(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_link_modify(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_link_ping(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_unlink(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_device_unlinked(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_connect(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_connectTo(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_connected(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_connection_modify(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_disconnect(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_signal_disconnected(const char *, const char *, lo_arg **, int, lo_message, void *); static int handler_sync(const char *, const char *, lo_arg **, int, lo_message, void *); /* Handler <-> Message relationships */ struct handler_method_assoc { int str_index; char *types; lo_method_handler h; }; // handlers needed by both "devices" and "monitors" static struct handler_method_assoc admin_bus_handlers[] = { {ADM_LOGOUT, NULL, handler_logout}, }; const int N_ADMIN_BUS_HANDLERS = sizeof(admin_bus_handlers)/sizeof(admin_bus_handlers[0]); static struct handler_method_assoc admin_mesh_handlers[] = { {ADM_LINKED, NULL, handler_device_linked}, {ADM_UNLINKED, NULL, handler_device_unlinked}, {ADM_CONNECTED, NULL, handler_signal_connected}, {ADM_DISCONNECTED, "ss", handler_signal_disconnected}, }; const int N_ADMIN_MESH_HANDLERS = sizeof(admin_mesh_handlers)/sizeof(admin_mesh_handlers[0]); static struct handler_method_assoc device_bus_handlers[] = { {ADM_WHO, NULL, handler_who}, {ADM_LINK, NULL, handler_device_link}, {ADM_LINK_TO, NULL, handler_device_linkTo}, {ADM_LINKED, NULL, handler_device_linked}, {ADM_LINK_MODIFY, NULL, handler_device_link_modify}, {ADM_UNLINK, NULL, handler_device_unlink}, {ADM_UNLINKED, NULL, handler_device_unlinked}, {ADM_SUBSCRIBE, NULL, handler_device_subscribe}, {ADM_UNSUBSCRIBE, NULL, handler_device_unsubscribe}, {ADM_CONNECT, NULL, handler_signal_connect}, {ADM_CONNECT_TO, NULL, handler_signal_connectTo}, {ADM_CONNECTED, NULL, handler_signal_connected}, {ADM_CONNECTION_MODIFY, NULL, handler_signal_connection_modify}, {ADM_DISCONNECT, "ss", handler_signal_disconnect}, {ADM_DISCONNECTED, "ss", handler_signal_disconnected}, }; const int N_DEVICE_BUS_HANDLERS = sizeof(device_bus_handlers)/sizeof(device_bus_handlers[0]); static struct handler_method_assoc device_mesh_handlers[] = { {ADM_SUBSCRIBE, NULL, handler_device_subscribe}, {ADM_UNSUBSCRIBE, NULL, handler_device_unsubscribe}, {ADM_CONNECT_TO, NULL, handler_signal_connectTo}, {ADM_LINK_PING, "iiid", handler_device_link_ping}, }; const int N_DEVICE_MESH_HANDLERS = sizeof(device_mesh_handlers)/sizeof(device_mesh_handlers[0]); static struct handler_method_assoc monitor_bus_handlers[] = { {ADM_DEVICE, NULL, handler_device}, {ADM_SYNC, NULL, handler_sync}, }; const int N_MONITOR_BUS_HANDLERS = sizeof(monitor_bus_handlers)/sizeof(monitor_bus_handlers[0]); static struct handler_method_assoc monitor_mesh_handlers[] = { {ADM_DEVICE, NULL, handler_device}, {ADM_SIGNAL, NULL, handler_signal_info}, {ADM_INPUT_REMOVED, "s", handler_input_signal_removed}, {ADM_OUTPUT_REMOVED, "s", handler_output_signal_removed}, }; const int N_MONITOR_MESH_HANDLERS = sizeof(monitor_mesh_handlers)/sizeof(monitor_mesh_handlers[0]); /* Internal LibLo error handler */ static void handler_error(int num, const char *msg, const char *where) { printf("[libmapper] liblo server error %d in path %s: %s\n", num, where, msg); } /* Functions for handling the resource allocation scheme. If * check_collisions() returns 1, the resource in question should be * probed on the admin bus. */ static int check_collisions(mapper_admin admin, mapper_admin_allocated_t *resource); /*! Local function to get the IP address of a network interface. */ static int get_interface_addr(const char* pref, struct in_addr* addr, char **iface) { struct in_addr zero; struct sockaddr_in *sa; *(unsigned int *)&zero = inet_addr("0.0.0.0"); #ifdef HAVE_GETIFADDRS struct ifaddrs *ifaphead; struct ifaddrs *ifap; struct ifaddrs *iflo=0, *ifchosen=0; if (getifaddrs(&ifaphead) != 0) return 1; ifap = ifaphead; while (ifap) { sa = (struct sockaddr_in *) ifap->ifa_addr; if (!sa) { ifap = ifap->ifa_next; continue; } // Note, we could also check for IFF_MULTICAST-- however this // is the data-sending port, not the admin bus port. if (sa->sin_family == AF_INET && ifap->ifa_flags & IFF_UP && memcmp(&sa->sin_addr, &zero, sizeof(struct in_addr))!=0) { ifchosen = ifap; if (pref && strcmp(ifap->ifa_name, pref)==0) break; else if (ifap->ifa_flags & IFF_LOOPBACK) iflo = ifap; } ifap = ifap->ifa_next; } // Default to loopback address in case user is working locally. if (!ifchosen) ifchosen = iflo; if (ifchosen) { if (*iface) free(*iface); *iface = strdup(ifchosen->ifa_name); sa = (struct sockaddr_in *) ifchosen->ifa_addr; *addr = sa->sin_addr; freeifaddrs(ifaphead); return 0; } freeifaddrs(ifaphead); #else // !HAVE_GETIFADDRS #ifdef HAVE_LIBIPHLPAPI // TODO consider "pref" as well /* Start with recommended 15k buffer for GetAdaptersAddresses. */ ULONG size = 15*1024/2; int tries = 3; PIP_ADAPTER_ADDRESSES paa = malloc(size*2); DWORD rc = ERROR_SUCCESS-1; while (rc!=ERROR_SUCCESS && paa && tries-- > 0) { size *= 2; paa = realloc(paa, size); rc = GetAdaptersAddresses(AF_INET, 0, 0, paa, &size); } if (rc!=ERROR_SUCCESS) return 2; PIP_ADAPTER_ADDRESSES loaa=0, aa = paa; PIP_ADAPTER_UNICAST_ADDRESS lopua=0; while (aa && rc==ERROR_SUCCESS) { PIP_ADAPTER_UNICAST_ADDRESS pua = aa->FirstUnicastAddress; // Skip adapters that are not "Up". if (pua && aa->OperStatus == IfOperStatusUp) { if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) { loaa = aa; lopua = pua; } else { // Skip addresses starting with 0.X.X.X or 169.X.X.X. sa = (struct sockaddr_in *) pua->Address.lpSockaddr; unsigned char prefix = sa->sin_addr.s_addr&0xFF; if (prefix!=0xA9 && prefix!=0) { if (*iface) free(*iface); *iface = strdup(aa->AdapterName); *addr = sa->sin_addr; free(paa); return 0; } } } aa = aa->Next; } if (loaa && lopua) { if (*iface) free(*iface); *iface = strdup(loaa->AdapterName); sa = (struct sockaddr_in *) lopua->Address.lpSockaddr; *addr = sa->sin_addr; free(paa); return 0; } if (paa) free(paa); #else #error No known method on this system to get the network interface address. #endif // HAVE_LIBIPHLPAPI #endif // !HAVE_GETIFADDRS return 2; } /*! A helper function to seed the random number generator. */ static void seed_srand() { unsigned int s; #ifndef WIN32 FILE *f = fopen("/dev/random", "rb"); if (f) { if (fread(&s, 4, 1, f)==1) { srand(s); fclose(f); return; } fclose(f); } #endif double d = get_current_time(); s = (unsigned int)((d-(unsigned long)d)*100000); srand(s); } static void mapper_admin_add_admin_methods(mapper_admin admin) { int i; for (i=0; i < N_ADMIN_BUS_HANDLERS; i++) { lo_server_add_method(admin->bus_server, admin_msg_strings[admin_bus_handlers[i].str_index], admin_bus_handlers[i].types, admin_bus_handlers[i].h, admin); } for (i=0; i < N_ADMIN_MESH_HANDLERS; i++) { lo_server_add_method(admin->mesh_server, admin_msg_strings[admin_mesh_handlers[i].str_index], admin_mesh_handlers[i].types, admin_mesh_handlers[i].h, admin); // add them for bus also lo_server_add_method(admin->bus_server, admin_msg_strings[admin_mesh_handlers[i].str_index], admin_mesh_handlers[i].types, admin_mesh_handlers[i].h, admin); } } static void mapper_admin_add_device_methods(mapper_admin admin, mapper_device device) { int i; char fullpath[256]; for (i=0; i < N_DEVICE_BUS_HANDLERS; i++) { snprintf(fullpath, 256, admin_msg_strings[device_bus_handlers[i].str_index], mdev_name(admin->device)); lo_server_add_method(admin->bus_server, fullpath, device_bus_handlers[i].types, device_bus_handlers[i].h, admin); } for (i=0; i < N_DEVICE_MESH_HANDLERS; i++) { snprintf(fullpath, 256, admin_msg_strings[device_mesh_handlers[i].str_index], mdev_name(admin->device)); lo_server_add_method(admin->mesh_server, fullpath, device_mesh_handlers[i].types, device_mesh_handlers[i].h, admin); // add them for bus also lo_server_add_method(admin->bus_server, fullpath, device_mesh_handlers[i].types, device_mesh_handlers[i].h, admin); } } static void mapper_admin_add_monitor_methods(mapper_admin admin) { int i; for (i=0; i < N_MONITOR_BUS_HANDLERS; i++) { lo_server_add_method(admin->bus_server, admin_msg_strings[monitor_bus_handlers[i].str_index], monitor_bus_handlers[i].types, monitor_bus_handlers[i].h, admin); } for (i=0; i < N_MONITOR_MESH_HANDLERS; i++) { lo_server_add_method(admin->mesh_server, admin_msg_strings[monitor_mesh_handlers[i].str_index], monitor_mesh_handlers[i].types, monitor_mesh_handlers[i].h, admin); // add them for bus also lo_server_add_method(admin->bus_server, admin_msg_strings[monitor_mesh_handlers[i].str_index], monitor_mesh_handlers[i].types, monitor_mesh_handlers[i].h, admin); } } static void mapper_admin_remove_monitor_methods(mapper_admin admin) { int i; for (i=0; i < N_MONITOR_BUS_HANDLERS; i++) { lo_server_del_method(admin->bus_server, admin_msg_strings[monitor_bus_handlers[i].str_index], monitor_bus_handlers[i].types); } for (i=0; i < N_MONITOR_MESH_HANDLERS; i++) { lo_server_del_method(admin->mesh_server, admin_msg_strings[monitor_mesh_handlers[i].str_index], monitor_mesh_handlers[i].types); lo_server_del_method(admin->bus_server, admin_msg_strings[monitor_mesh_handlers[i].str_index], monitor_mesh_handlers[i].types); } } mapper_admin mapper_admin_new(const char *iface, const char *group, int port) { mapper_admin admin = (mapper_admin)calloc(1, sizeof(mapper_admin_t)); if (!admin) return NULL; admin->interface_name = 0; /* Default standard ip and port is group 224.0.1.3, port 7570 */ char port_str[10], *s_port = port_str; if (!group) group = "224.0.1.3"; if (port==0) s_port = "7570"; else snprintf(port_str, 10, "%d", port); /* Initialize interface information. */ if (get_interface_addr(iface, &admin->interface_ip, &admin->interface_name)) trace("no interface found\n"); /* Open address */ admin->bus_addr = lo_address_new(group, s_port); if (!admin->bus_addr) { free(admin); return NULL; } /* Set TTL for packet to 1 -> local subnet */ lo_address_set_ttl(admin->bus_addr, 1); /* Specify the interface to use for multicasting */ #ifdef HAVE_LIBLO_SET_IFACE lo_address_set_iface(admin->bus_addr, admin->interface_name, 0); #endif /* Open server for multicast group 224.0.1.3, port 7570 */ admin->bus_server = #ifdef HAVE_LIBLO_SERVER_IFACE lo_server_new_multicast_iface(group, s_port, admin->interface_name, 0, handler_error); #else lo_server_new_multicast(group, s_port, handler_error); #endif if (!admin->bus_server) { lo_address_free(admin->bus_addr); free(admin); return NULL; } // Also open address/server for mesh-style admin communications // TODO: use TCP instead? while (!(admin->mesh_server = lo_server_new(0, liblo_error_handler))) {} // Disable liblo message queueing. lo_server_enable_queue(admin->bus_server, 0, 1); lo_server_enable_queue(admin->mesh_server, 0, 1); // Add methods required by both devices and monitors mapper_admin_add_admin_methods(admin); return admin; } const char *mapper_admin_libversion(mapper_admin admin) { return PACKAGE_VERSION; } void mapper_admin_send_bundle(mapper_admin admin) { if (!admin->bundle) return; #if FORCE_ADMIN_TO_BUS lo_send_bundle_from(admin->bus_addr, admin->mesh_server, admin->bundle); #else if (admin->bundle_dest == BUNDLE_DEST_SUBSCRIBERS) { mapper_admin_subscriber *s = &admin->subscribers; if (*s) { mapper_clock_now(&admin->clock, &admin->clock.now); } while (*s) { if ((*s)->lease_expiration_sec < admin->clock.now.sec || !(*s)->flags) { // subscription expired, remove from subscriber list mapper_admin_subscriber temp = *s; *s = temp->next; if (temp->address) lo_address_free(temp->address); free(temp); continue; } if ((*s)->flags & admin->message_type) { lo_send_bundle_from((*s)->address, admin->mesh_server, admin->bundle); } s = &(*s)->next; } } else if (admin->bundle_dest == BUNDLE_DEST_BUS) { lo_send_bundle_from(admin->bus_addr, admin->mesh_server, admin->bundle); } else { lo_send_bundle_from(admin->bundle_dest, admin->mesh_server, admin->bundle); } #endif lo_bundle_free_messages(admin->bundle); admin->bundle = 0; } static int mapper_admin_init_bundle(mapper_admin admin) { if (admin->bundle) mapper_admin_send_bundle(admin); mapper_clock_now(&admin->clock, &admin->clock.now); admin->bundle = lo_bundle_new(admin->clock.now); if (!admin->bundle) { trace("couldn't allocate lo_bundle\n"); return 1; } return 0; } void mapper_admin_set_bundle_dest_bus(mapper_admin admin) { if (admin->bundle && admin->bundle_dest != BUNDLE_DEST_BUS) mapper_admin_send_bundle(admin); admin->bundle_dest = 0; if (!admin->bundle) mapper_admin_init_bundle(admin); } void mapper_admin_set_bundle_dest_mesh(mapper_admin admin, lo_address address) { if (admin->bundle && admin->bundle_dest != address) mapper_admin_send_bundle(admin); admin->bundle_dest = address; if (!admin->bundle) mapper_admin_init_bundle(admin); } void mapper_admin_set_bundle_dest_subscribers(mapper_admin admin, int type) { if ((admin->bundle && admin->bundle_dest != BUNDLE_DEST_SUBSCRIBERS) || (admin->message_type != type)) mapper_admin_send_bundle(admin); admin->bundle_dest = BUNDLE_DEST_SUBSCRIBERS; admin->message_type = type; if (!admin->bundle) mapper_admin_init_bundle(admin); } /*! Free the memory allocated by a mapper admin structure. * \param admin An admin structure handle. */ void mapper_admin_free(mapper_admin admin) { if (!admin) return; // send out any cached messages mapper_admin_send_bundle(admin); if (admin->interface_name) free(admin->interface_name); if (admin->bus_server) lo_server_free(admin->bus_server); if (admin->mesh_server) lo_server_free(admin->mesh_server); if (admin->bus_addr) lo_address_free(admin->bus_addr); mapper_admin_subscriber s; while (admin->subscribers) { s = admin->subscribers; if (s->address) lo_address_free(s->address); admin->subscribers = s->next; free(s); } free(admin); } /*! Probe the admin bus to see if a device's proposed name.ordinal is * already taken. */ static void mapper_admin_probe_device_name(mapper_admin admin, mapper_device device) { device->ordinal.collision_count = -1; device->ordinal.count_time = get_current_time(); /* Note: mdev_name() would refuse here since the * ordinal is not yet locked, so we have to build it manually at * this point. */ char name[256]; trace(" probing name\n", device->props.identifier, admin); snprintf(name, 256, "/%s.%d", device->props.identifier, device->ordinal.value); /* Calculate a hash from the name and store it in id.value */ device->props.name_hash = crc32(0L, (const Bytef *)name, strlen(name)); /* For the same reason, we can't use mapper_admin_send() * here. */ lo_send(admin->bus_addr, "/name/probe", "si", name, admin->random_id); } /*! Add an uninitialized device to this admin. */ void mapper_admin_add_device(mapper_admin admin, mapper_device dev) { /* Initialize data structures */ if (dev) { admin->device = dev; // TODO: should we init clocks for monitors also? mapper_clock_init(&admin->clock); /* Seed the random number generator. */ seed_srand(); /* Choose a random ID for allocation speedup */ admin->random_id = rand(); /* Add methods for admin bus. Only add methods needed for * allocation here. Further methods are added when the device is * registered. */ lo_server_add_method(admin->bus_server, "/name/probe", NULL, handler_device_name_probe, admin); lo_server_add_method(admin->bus_server, "/name/registered", NULL, handler_device_name_registered, admin); /* Probe potential name to admin bus. */ mapper_admin_probe_device_name(admin, dev); } } /*! Add an uninitialized monitor to this admin. */ void mapper_admin_add_monitor(mapper_admin admin, mapper_monitor mon) { /* Initialize monitor methods. */ if (mon) { admin->monitor = mon; mapper_admin_add_monitor_methods(admin); } } void mapper_admin_remove_monitor(mapper_admin admin, mapper_monitor mon) { if (mon) { admin->monitor = 0; mapper_admin_remove_monitor_methods(admin); } } static void mapper_admin_maybe_send_ping(mapper_admin admin, int force) { mapper_device md = admin->device; int go = 0; mapper_clock_t *clock = &admin->clock; mapper_clock_now(clock, &clock->now); if (force || (clock->now.sec >= clock->next_ping)) { go = 1; clock->next_ping = clock->now.sec + 5 + (rand() % 4); } if (!md || !go) return; mapper_admin_set_bundle_dest_bus(admin); mapper_admin_bundle_message(admin, ADM_SYNC, 0, "si", mdev_name(md), md->props.version); int elapsed; // some housekeeping: periodically check if our links are still active mapper_router router = md->routers; while (router) { if (router->props.dest_name_hash == md->props.name_hash) { // don't bother sending pings to self router = router->next; continue; } mapper_sync_clock sync = &router->clock; elapsed = (sync->response.timetag.sec ? clock->now.sec - sync->response.timetag.sec : 0); if (md->link_timeout_sec && elapsed > md->link_timeout_sec) { if (sync->response.message_id > 0) { trace("<%s> Lost contact with linked device %s " "(%d seconds since sync).\n", mdev_name(md), router->props.dest_name, elapsed); // tentatively mark link as expired sync->response.message_id = -1; sync->response.timetag.sec = clock->now.sec; } else { trace("<%s> Removing link to unresponsive device %s " "(%d seconds since warning).\n", mdev_name(md), router->props.dest_name, elapsed); // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &router->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); // inform subscribers of link timeout mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_OUT); mapper_admin_bundle_message(admin, ADM_UNLINKED, 0, "ssss", mdev_name(md), router->props.dest_name, "@status", "timeout"); // remove related data structures mdev_remove_router(md, router); } } else { lo_bundle b = lo_bundle_new(clock->now); lo_message m = lo_message_new(); lo_message_add_int32(m, mdev_id(md)); ++sync->sent.message_id; if (sync->sent.message_id < 0) sync->sent.message_id = 0; lo_message_add_int32(m, sync->sent.message_id); lo_message_add_int32(m, sync->response.message_id); if (sync->response.timetag.sec) lo_message_add_double(m, mapper_timetag_difference(clock->now, sync->response.timetag)); else lo_message_add_double(m, 0.); // need to send immediately lo_bundle_add_message(b, admin_msg_strings[ADM_LINK_PING], m); #if FORCE_ADMIN_TO_BUS lo_send_bundle_from(admin->bus_addr, admin->mesh_server, b); #else lo_send_bundle_from(router->admin_addr, admin->mesh_server, b); #endif mapper_timetag_cpy(&sync->sent.timetag, lo_bundle_get_timestamp(b)); lo_bundle_free_messages(b); } router = router->next; } mapper_receiver receiver = md->receivers; while (receiver) { if (receiver->props.src_name_hash == md->props.name_hash) { // don't bother sending pings to self receiver = receiver->next; continue; } mapper_sync_clock sync = &receiver->clock; elapsed = (sync->response.timetag.sec ? clock->now.sec - sync->response.timetag.sec : 0); if (md->link_timeout_sec && elapsed > md->link_timeout_sec) { if (sync->response.message_id > 0) { trace("<%s> Lost contact with linked device %s " "(%d seconds since sync).\n", mdev_name(md), receiver->props.src_name, elapsed); // tentatively mark link as expired sync->response.message_id = -1; sync->response.timetag.sec = clock->now.sec; } else { trace("<%s> Removing link from unresponsive device %s " "(%d seconds since warning).\n", mdev_name(md), receiver->props.dest_name, elapsed); // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &receiver->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); // inform subscribers of link timeout mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_IN); mapper_admin_bundle_message(admin, ADM_UNLINKED, 0, "ssss", receiver->props.src_name, mdev_name(md), "@status", "timeout"); // remove related data structures mdev_remove_receiver(md, receiver); } } else { lo_bundle b = lo_bundle_new(clock->now); lo_message m = lo_message_new(); lo_message_add_int32(m, mdev_id(md)); ++sync->sent.message_id; if (sync->sent.message_id < 0) sync->sent.message_id = 0; lo_message_add_int32(m, sync->sent.message_id); lo_message_add_int32(m, sync->response.message_id); if (sync->response.timetag.sec) lo_message_add_double(m, mapper_timetag_difference(clock->now, sync->response.timetag)); else lo_message_add_double(m, 0.); // need to send immediately lo_bundle_add_message(b, admin_msg_strings[ADM_LINK_PING], m); #ifdef FORCE_ADMIN_TO_BUS lo_send_bundle_from(admin->bus_addr, admin->mesh_server, b); #else lo_send_bundle_from(receiver->admin_addr, admin->mesh_server, b); #endif mapper_timetag_cpy(&sync->sent.timetag, lo_bundle_get_timestamp(b)); lo_bundle_free_messages(b); } receiver = receiver->next; } } /*! This is the main function to be called once in a while from a * program so that the admin bus can be automatically managed. */ int mapper_admin_poll(mapper_admin admin) { int count = 0, status; mapper_device md = admin->device; // send out any cached messages mapper_admin_send_bundle(admin); if (md) md->flags &= ~FLAGS_SENT_ALL_DEVICE_MESSAGES; while (count < 10 && (lo_server_recv_noblock(admin->bus_server, 0) + lo_server_recv_noblock(admin->mesh_server, 0))) { count++; } admin->msgs_recvd += count; if (!md) { mapper_admin_maybe_send_ping(admin, 0); return count; } /* If the ordinal is not yet locked, process collision timing. * Once the ordinal is locked it won't change. */ if (!md->registered) { status = check_collisions(admin, &md->ordinal); if (status == 1) { /* If the ordinal has changed, re-probe the new name. */ mapper_admin_probe_device_name(admin, md); } /* If we are ready to register the device, add the needed message * handlers. */ if (md->ordinal.locked) { mdev_registered(md); /* Send registered msg. */ lo_send(admin->bus_addr, "/name/registered", "s", mdev_name(md)); mapper_admin_add_device_methods(admin, md); mapper_admin_maybe_send_ping(admin, 1); trace(" registered as <%s>\n", md->props.identifier, admin, mdev_name(md)); md->flags |= FLAGS_DEVICE_ATTRIBS_CHANGED; } } else { // Send out clock sync messages occasionally mapper_admin_maybe_send_ping(admin, 0); } return count; } /*! Algorithm for checking collisions and allocating resources. */ static int check_collisions(mapper_admin admin, mapper_admin_allocated_t *resource) { double timediff; if (resource->locked) return 0; timediff = get_current_time() - resource->count_time; if (!admin->msgs_recvd) { if (timediff >= 5.0) { // reprobe with the same value return 1; } return 0; } else if (timediff >= 2.0 && resource->collision_count <= 1) { resource->locked = 1; if (resource->on_lock) resource->on_lock(admin->device, resource); return 2; } else if (timediff >= 0.5 && resource->collision_count > 0) { /* If resource collisions were found within 500 milliseconds of the * last probe, add a random number based on the number of * collisions. */ resource->value += rand() % (resource->collision_count + 1); /* Prepare for causing new resource collisions. */ resource->collision_count = -1; resource->count_time = get_current_time(); /* Indicate that we need to re-probe the new value. */ return 1; } return 0; } void _real_mapper_admin_bundle_message(mapper_admin admin, int msg_index, const char *path, const char *types, ...) { char t[]=" "; lo_message m = lo_message_new(); if (!m) { trace("couldn't allocate lo_message\n"); return; } va_list aq; va_start(aq, types); while (types && *types) { t[0] = types[0]; switch (t[0]) { case 'i': lo_message_add(m, t, va_arg(aq, int)); break; case 's': lo_message_add(m, t, va_arg(aq, char*)); break; case 'f': case 'd': lo_message_add(m, t, va_arg(aq, double)); break; default: die_unless(0, "message %s, unknown type '%c'\n", path, t[0]); } types++; } mapper_msg_prepare_varargs(m, aq); va_end(aq); lo_bundle_add_message(admin->bundle, msg_index == -1 ? path : admin_msg_strings[msg_index], m); /* Since liblo doesn't cache path strings, we must send the bundle * immediately if the path is non-standard. */ if (msg_index == -1) mapper_admin_send_bundle(admin); } void _real_mapper_admin_bundle_message_with_params(mapper_admin admin, mapper_message_t *params, mapper_string_table_t *extra, int msg_index, const char *path, const char *types, ...) { char t[]=" "; lo_message m = lo_message_new(); if (!m) { trace("couldn't allocate lo_message\n"); return; } va_list aq; va_start(aq, types); while (types && *types) { t[0] = types[0]; switch (t[0]) { case 'i': lo_message_add(m, t, va_arg(aq, int)); break; case 's': lo_message_add(m, t, va_arg(aq, char*)); break; case 'f': lo_message_add(m, t, va_arg(aq, double)); break; default: die_unless(0, "message %s, unknown type '%c'\n", path, t[0]); } types++; } mapper_msg_prepare_varargs(m, aq); va_end(aq); mapper_msg_prepare_params(m, params); if (extra) mapper_msg_add_value_table(m, extra); lo_bundle_add_message(admin->bundle, msg_index == -1 ? path : admin_msg_strings[msg_index], m); /* Since liblo doesn't cache path strings, we must send the bundle * immediately if the path is non-standard. */ if (msg_index == -1) mapper_admin_send_bundle(admin); } static void mapper_admin_send_device(mapper_admin admin, mapper_device device) { if (!device) return; if (device->flags & FLAGS_SENT_DEVICE_INFO) return; mapper_admin_bundle_message( admin, ADM_DEVICE, 0, "s", mdev_name(device), AT_LIB_VERSION, PACKAGE_VERSION, AT_PORT, device->props.port, AT_NUM_INPUTS, mdev_num_inputs(device), AT_NUM_OUTPUTS, mdev_num_outputs(device), AT_NUM_LINKS_IN, mdev_num_links_in(device), AT_NUM_LINKS_OUT, mdev_num_links_out(device), AT_NUM_CONNECTIONS_IN, mdev_num_connections_in(device), AT_NUM_CONNECTIONS_OUT, mdev_num_connections_out(device), AT_REV, device->props.version, AT_EXTRA, device->props.extra); device->flags |= FLAGS_SENT_DEVICE_INFO; } void mapper_admin_send_signal(mapper_admin admin, mapper_device md, mapper_signal sig) { char sig_name[1024]; msig_full_name(sig, sig_name, 1024); mapper_admin_bundle_message( admin, ADM_SIGNAL, 0, "s", sig_name, AT_DIRECTION, sig->props.is_output ? "output" : "input", AT_TYPE, sig->props.type, AT_LENGTH, sig->props.length, sig->props.unit ? AT_UNITS : -1, sig, sig->props.minimum ? AT_MIN : -1, sig, sig->props.maximum ? AT_MAX : -1, sig, sig->props.num_instances > 1 ? AT_INSTANCES : -1, sig, sig->props.rate ? AT_RATE : -1, sig, AT_EXTRA, sig->props.extra); } void mapper_admin_send_signal_removed(mapper_admin admin, mapper_device md, mapper_signal sig) { char sig_name[1024]; msig_full_name(sig, sig_name, 1024); mapper_admin_bundle_message(admin, sig->props.is_output ? ADM_OUTPUT_REMOVED : ADM_INPUT_REMOVED, 0, "s", sig_name); } static void mapper_admin_send_inputs(mapper_admin admin, mapper_device md, int min, int max) { if (min < 0) min = 0; else if (min > md->props.num_inputs) return; if (max < 0 || max > md->props.num_inputs) max = md->props.num_inputs-1; int i = min; for (; i <= max; i++) mapper_admin_send_signal(admin, md, md->inputs[i]); } static void mapper_admin_send_outputs(mapper_admin admin, mapper_device md, int min, int max) { if (min < 0) min = 0; else if (min > md->props.num_outputs) return; if (max < 0 || max > md->props.num_outputs) max = md->props.num_outputs-1; int i = min; for (; i <= max; i++) mapper_admin_send_signal(admin, md, md->outputs[i]); } static void mapper_admin_send_linked(mapper_admin admin, mapper_link link, int is_outgoing) { // Send /linked message lo_message m = lo_message_new(); if (!m) { trace("couldn't allocate lo_message\n"); return; } if (is_outgoing) { lo_message_add_string(m, mdev_name(link->device)); lo_message_add_string(m, link->props.dest_name); lo_message_add_string(m, "@srcPort"); lo_message_add_int32(m, link->device->props.port); lo_message_add_string(m, "@destPort"); lo_message_add_int32(m, link->props.dest_port); } else { lo_message_add_string(m, link->props.src_name); lo_message_add_string(m, mdev_name(link->device)); lo_message_add_string(m, "@srcPort"); lo_message_add_int32(m, link->props.src_port); lo_message_add_string(m, "@destPort"); lo_message_add_int32(m, link->device->props.port); } mapper_link_prepare_osc_message(m, link); lo_bundle_add_message(admin->bundle, "/linked", m); } static void mapper_admin_send_links_in(mapper_admin admin, mapper_device md) { mapper_receiver r = md->receivers; while (r) { mapper_admin_send_linked(admin, r, 0); r = r->next; } } static void mapper_admin_send_links_out(mapper_admin admin, mapper_device md) { mapper_router r = md->routers; while (r) { mapper_admin_send_linked(admin, r, 1); r = r->next; } } static void mapper_admin_send_connected(mapper_admin admin, mapper_link link, mapper_connection c, int index, int is_outgoing) { // Send /connected message lo_message m = lo_message_new(); if (!m) { trace("couldn't allocate lo_message\n"); return; } char src_name[1024], dest_name[1024]; snprintf(src_name, 1024, "%s%s", is_outgoing ? mdev_name(link->device) : link->props.src_name, c->props.src_name); snprintf(dest_name, 1024, "%s%s", is_outgoing ? link->props.dest_name : mdev_name(link->device), c->props.dest_name); lo_message_add_string(m, src_name); lo_message_add_string(m, dest_name); if (index != -1) { lo_message_add_string(m, "@ID"); lo_message_add_int32(m, index); } mapper_connection_prepare_osc_message(m, c); lo_bundle_add_message(admin->bundle, "/connected", m); } static void mapper_admin_send_connections_in(mapper_admin admin, mapper_device md, int min, int max) { // TODO: allow requesting connections by parent link? int i = 0; mapper_receiver rc = md->receivers; while (rc) { mapper_receiver_signal rs = rc->signals; while (rs) { mapper_connection c = rs->connections; while (c) { if (max > 0 && i > max) break; if (i >= min) { mapper_admin_send_connected(admin, rc, c, i, 0); } c = c->next; i++; } rs = rs->next; } rc = rc->next; } } static void mapper_admin_send_connections_out(mapper_admin admin, mapper_device md, int min, int max) { // TODO: allow requesting connections by parent link? int i = 0; mapper_router rt = md->routers; while (rt) { mapper_router_signal rs = rt->signals; while (rs) { mapper_connection c = rs->connections; while (c) { if (max > 0 && i > max) break; if (i >= min) { mapper_admin_send_connected(admin, rt, c, i, 1); } c = c->next; i++; } rs = rs->next; } rt = rt->next; } } /**********************************/ /* Internal OSC message handlers. */ /**********************************/ /*! Respond to /who by announcing the basic device information. */ static int handler_who(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_admin_maybe_send_ping(admin, 1); trace("%s received /who\n", mdev_name(admin->device)); return 0; } /*! Register information about port and host for the device. */ static int handler_device(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); if (argc < 1) return 0; if (types[0] != 's' && types[0] != 'S') return 0; const char *name = &argv[0]->s; trace(" got /device %s + %i arguments\n", name, argc-1); mapper_message_t params; mapper_msg_parse_params(¶ms, path, &types[1], argc-1, &argv[1]); if (params.types[AT_IP]==0 || params.values[AT_IP]==0) { // Find the sender's hostname lo_address a = lo_message_get_source(msg); if (a) { const char *host = lo_address_get_hostname(a); if (host) { params.types[AT_IP] = types; // 's' params.values[AT_IP] = (lo_arg**)&host; params.lengths[AT_IP] = 1; } } else trace("Couldn't retrieve host for device %s.\n", name); } mapper_clock_now(&admin->clock, &admin->clock.now); mapper_db_add_or_update_device_params(db, name, ¶ms, &admin->clock.now); return 0; } /*! Respond to /logout by deleting record of device. */ static int handler_logout(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); int diff, ordinal; char *s; if (argc < 1) return 0; if (types[0] != 's' && types[0] != 'S') return 0; char *name = &argv[0]->s; trace("<%s> got /logout %s\n", (md && md->ordinal.locked) ? mdev_name(md) : "monitor", name); if (mon) { mapper_db_remove_device_by_name(db, name); // remove subscriptions mapper_monitor_unsubscribe(mon, name); } // If device exists and is registered if (md && md->ordinal.locked) { // Check if we have any links to this device, if so remove them mapper_router router = mapper_router_find_by_dest_name(md->routers, name); if (router) { // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &router->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); trace("<%s> Removing link to expired device %s.\n", mdev_name(md), router->props.dest_name); mdev_remove_router(md, router); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_OUT); mapper_admin_bundle_message(admin, ADM_UNLINKED, 0, "ss", mdev_name(md), name); } mapper_receiver receiver = mapper_receiver_find_by_src_name(md->receivers, name); if (receiver) { // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &receiver->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); trace("<%s> Removing link from expired device %s.\n", mdev_name(md), receiver->props.dest_name); mdev_remove_receiver(md, receiver); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_IN); mapper_admin_bundle_message(admin, ADM_UNLINKED, 0, "ss", name, mdev_name(md)); } /* Parse the ordinal from the complete name which is in the * format: /. */ s = name; if (*s++ != '/') return 0; while (*s != '.' && *s++) {} ordinal = atoi(++s); // If device name matches strtok(name, "."); name++; if (strcmp(name, md->props.identifier) == 0) { // if registered ordinal is within my block, free it diff = ordinal - md->ordinal.value; if (diff > 0 && diff < 9) { md->ordinal.suggestion[diff-1] = 0; } } } return 0; } // Add/renew/remove a monitor subscription. static void mapper_admin_manage_subscriber(mapper_admin admin, lo_address address, int flags, int timeout_seconds, int revision) { mapper_admin_subscriber *s = &admin->subscribers; const char *ip = lo_address_get_hostname(address); const char *port = lo_address_get_port(address); if (!ip || !port) return; mapper_clock_t *clock = &admin->clock; mapper_clock_now(clock, &clock->now); while (*s) { if (strcmp(ip, lo_address_get_hostname((*s)->address))==0 && strcmp(port, lo_address_get_port((*s)->address))==0) { // subscriber already exists if (!flags || !timeout_seconds) { // remove subscription mapper_admin_subscriber temp = *s; int prev_flags = temp->flags; *s = temp->next; if (temp->address) lo_address_free(temp->address); free(temp); if (!flags || !(flags &= ~prev_flags)) return; } else { // reset timeout (*s)->lease_expiration_sec = clock->now.sec + timeout_seconds; if ((*s)->flags == flags) { if (revision) return; else break; } int temp = flags; flags &= ~(*s)->flags; (*s)->flags = temp; } break; } s = &(*s)->next; } if (!flags) return; if (!(*s)) { // add new subscriber mapper_admin_subscriber sub = malloc(sizeof(struct _mapper_admin_subscriber)); sub->address = lo_address_new(ip, port); sub->lease_expiration_sec = clock->now.sec + timeout_seconds; sub->flags = flags; sub->next = admin->subscribers; admin->subscribers = sub; s = ⊂ } if (revision == admin->device->props.version) return; // bring new subscriber up to date mapper_admin_set_bundle_dest_mesh(admin, (*s)->address); if (flags & SUB_DEVICE) mapper_admin_send_device(admin, admin->device); if (flags & SUB_DEVICE_INPUTS) mapper_admin_send_inputs(admin, admin->device, -1, -1); if (flags & SUB_DEVICE_OUTPUTS) mapper_admin_send_outputs(admin, admin->device, -1, -1); if (flags & SUB_DEVICE_LINKS_IN) mapper_admin_send_links_in(admin, admin->device); if (flags & SUB_DEVICE_LINKS_OUT) mapper_admin_send_links_out(admin, admin->device); if (flags & SUB_DEVICE_CONNECTIONS_IN) mapper_admin_send_connections_in(admin, admin->device, -1, -1); if (flags & SUB_DEVICE_CONNECTIONS_OUT) mapper_admin_send_connections_out(admin, admin->device, -1, -1); } /*! Respond to /subscribe message by adding or renewing a subscription. */ static int handler_device_subscribe(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; int version = -1; lo_address a = lo_message_get_source(msg); if (!a || !argc) return 0; int i, flags = 0, timeout_seconds = 0; for (i = 0; i < argc; i++) { if (types[i] != 's' && types[i] != 'S') break; else if (strcmp(&argv[i]->s, "all")==0) flags = SUB_DEVICE_ALL; else if (strcmp(&argv[i]->s, "device")==0) flags |= SUB_DEVICE; else if (strcmp(&argv[i]->s, "inputs")==0) flags |= SUB_DEVICE_INPUTS; else if (strcmp(&argv[i]->s, "outputs")==0) flags |= SUB_DEVICE_OUTPUTS; else if (strcmp(&argv[i]->s, "links")==0) flags |= SUB_DEVICE_LINKS; else if (strcmp(&argv[i]->s, "links_in")==0) flags |= SUB_DEVICE_LINKS_IN; else if (strcmp(&argv[i]->s, "links_out")==0) flags |= SUB_DEVICE_LINKS_OUT; else if (strcmp(&argv[i]->s, "connections")==0) flags |= SUB_DEVICE_CONNECTIONS; else if (strcmp(&argv[i]->s, "connections_in")==0) flags |= SUB_DEVICE_CONNECTIONS_IN; else if (strcmp(&argv[i]->s, "connections_out")==0) flags |= SUB_DEVICE_CONNECTIONS_OUT; else if (strcmp(&argv[i]->s, "@version")==0) { // next argument is last device version recorded by subscriber ++i; if (i < argc && types[i] == 'i') version = argv[i]->i; } else if (strcmp(&argv[i]->s, "@lease")==0) { // next argument is lease timeout in seconds ++i; if (types[i] == 'i') timeout_seconds = argv[i]->i; else if (types[i] == 'f') timeout_seconds = (int)argv[i]->f; else if (types[i] == 'd') timeout_seconds = (int)argv[i]->d; else { trace("<%s> error parsing @lease property in /subscribe.\n", mdev_name(md)); } } } // add or renew subscription mapper_admin_manage_subscriber(admin, a, flags, timeout_seconds, version); return 0; } /*! Respond to /unsubscribe message by removing a subscription. */ static int handler_device_unsubscribe(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; lo_address a = lo_message_get_source(msg); if (!a) return 0; // remove subscription mapper_admin_manage_subscriber(admin, a, 0, 0, 0); return 0; } /*! Register information about a signal. */ static int handler_signal_info(const char *path, const char *types, lo_arg **argv, int argc, lo_message m, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); if (argc < 2) return 1; if (types[0] != 's' && types[0] != 'S') return 1; const char *full_sig_name = &argv[0]->s; const char *sig_name = strchr(full_sig_name+1, '/'); if (!sig_name) return 1; int devnamelen = sig_name-full_sig_name; if (devnamelen >= 1024) return 0; char devname[1024]; strncpy(devname, full_sig_name, devnamelen); devname[devnamelen]=0; mapper_message_t params; mapper_msg_parse_params(¶ms, path, &types[1], argc-1, &argv[1]); mapper_db_add_or_update_signal_params( db, sig_name, devname, ¶ms ); return 0; } /*! Unregister information about a removed input signal. */ static int handler_input_signal_removed(const char *path, const char *types, lo_arg **argv, int argc, lo_message m, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); if (argc < 1) return 1; if (types[0] != 's' && types[0] != 'S') return 1; const char *full_sig_name = &argv[0]->s; const char *sig_name = strchr(full_sig_name+1, '/'); if (!sig_name) return 1; int dev_name_len = sig_name-full_sig_name; if (dev_name_len >= 1024) return 0; char dev_name[1024]; strncpy(dev_name, full_sig_name, dev_name_len); dev_name[dev_name_len]=0; mapper_db_remove_input_by_name(db, dev_name, sig_name); return 0; } /*! Unregister information about a removed input signal. */ static int handler_output_signal_removed(const char *path, const char *types, lo_arg **argv, int argc, lo_message m, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); if (argc < 1) return 1; if (types[0] != 's' && types[0] != 'S') return 1; const char *full_sig_name = &argv[0]->s; const char *sig_name = strchr(full_sig_name+1, '/'); if (!sig_name) return 1; int dev_name_len = sig_name-full_sig_name; if (dev_name_len >= 1024) return 0; char dev_name[1024]; strncpy(dev_name, full_sig_name, dev_name_len); dev_name[dev_name_len]=0; mapper_db_remove_output_by_name(db, dev_name, sig_name); return 0; } /*! Repond to name collisions during allocation, help suggest IDs once allocated. */ static int handler_device_name_registered(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; char *name, *s; int hash, ordinal, diff; int temp_id = -1, suggestion = -1; if (argc < 1) return 0; if (types[0] != 's' && types[0] != 'S') return 0; name = &argv[0]->s; trace(" got /name/registered %s %i \n", md->props.identifier, admin, name, temp_id); if (md->ordinal.locked) { /* Parse the ordinal from the complete name which is in the * format: /. */ s = name; if (*s != '/') return 0; s = strrchr(s, '.'); if (!s) return 0; ordinal = atoi(s+1); *s = 0; // If device name matches if (strcmp(name+1, md->props.identifier) == 0) { // if id is locked and registered id is within my block, store it diff = ordinal - md->ordinal.value; if (diff > 0 && diff < 9) { md->ordinal.suggestion[diff-1] = -1; } } } else { hash = crc32(0L, (const Bytef *)name, strlen(name)); if (hash == md->props.name_hash) { if (argc > 1) { if (types[1] == 'i') temp_id = argv[1]->i; if (types[2] == 'i') suggestion = argv[2]->i; } if (temp_id == admin->random_id && suggestion != md->ordinal.value && suggestion > 0) { md->ordinal.value = suggestion; mapper_admin_probe_device_name(admin, md); } else { /* Count ordinal collisions. */ md->ordinal.collision_count++; md->ordinal.count_time = get_current_time(); } } } return 0; } /*! Repond to name probes during allocation, help suggest names once allocated. */ static int handler_device_name_probe(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; char *name; double current_time; int hash, temp_id = -1, i; if (types[0] == 's' || types[0] == 'S') name = &argv[0]->s; else return 0; if (argc > 0) { if (types[1] == 'i') temp_id = argv[1]->i; else if (types[1] == 'f') temp_id = (int) argv[1]->f; } trace(" got /name/probe %s %i \n", md->props.identifier, admin, name, temp_id); hash = crc32(0L, (const Bytef *)name, strlen(name)); if (hash == md->props.name_hash) { if (md->ordinal.locked) { current_time = get_current_time(); for (i=0; i<8; i++) { if (md->ordinal.suggestion[i] >= 0 && (current_time - md->ordinal.suggestion[i]) > 2.0) { // reserve suggested ordinal md->ordinal.suggestion[i] = get_current_time(); break; } } /* Name may not yet be registered, so we can't use * mapper_admin_send() here. */ lo_send(admin->bus_addr, "/name/registered", "sii", name, temp_id, (md->ordinal.value+i+1)); } else { md->ordinal.collision_count++; md->ordinal.count_time = get_current_time(); } } return 0; } /*! Link two devices. */ static int handler_device_link(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; const char *src_name, *dest_name; if (argc < 2) return 0; // Need at least 2 devices to link if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; if (strcmp(mdev_name(md), dest_name)) return 0; trace("<%s> got /link %s %s\n", mdev_name(md), src_name, dest_name); mapper_message_t params; // add arguments from /link if any if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /link.\n", mdev_name(md)); return 0; } lo_arg *arg_port = (lo_arg*) &md->props.port; params.values[AT_DEST_PORT] = &arg_port; params.types[AT_DEST_PORT] = "i"; params.lengths[AT_DEST_PORT] = 1; // TODO: check if src ip and port are available as metadata, send directly mapper_admin_set_bundle_dest_bus(admin); mapper_admin_bundle_message_with_params( admin, ¶ms, 0, ADM_LINK_TO, 0, "ss", src_name, dest_name); return 0; } /*! Link two devices... continued. */ static int handler_device_linkTo(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; const char *src_name, *dest_name, *host=0, *admin_port; int data_port; mapper_message_t params; lo_address a = NULL; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; if (strcmp(src_name, mdev_name(md))) { trace("<%s> ignoring /linkTo %s %s\n", mdev_name(md), src_name, dest_name); return 0; } trace("<%s> got /linkTo %s %s\n", mdev_name(md), src_name, dest_name); // Parse the message. if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /linkTo.\n", mdev_name(md)); return 0; } // Discover whether the device is already linked. mapper_router router = mapper_router_find_by_dest_name(md->routers, dest_name); if (router) { // Already linked, forward to link/modify handler. handler_device_link_modify(path, types, argv, argc, msg, user_data); return 0; } // Find the sender's hostname a = lo_message_get_source(msg); host = lo_address_get_hostname(a); admin_port = lo_address_get_port(a); if (!host) { trace("can't perform /linkTo, host unknown\n"); return 0; } // Retrieve the port if (mapper_msg_get_param_if_int(¶ms, AT_DEST_PORT, &data_port)) { trace("can't perform /linkTo, port unknown\n"); return 0; } // Creation of a new router added to the source. router = mapper_router_new(md, host, atoi(admin_port), data_port, dest_name); if (!router) { trace("can't perform /linkTo, NULL router\n"); return 0; } mdev_add_router(md, router); if (argc > 2) mapper_router_set_from_message(router, ¶ms); // Call local link handler if it exists if (md->link_cb) md->link_cb(md, &router->props, MDEV_LOCAL_ESTABLISHED, md->link_cb_userdata); // Announce the result to destination and subscribers. if (!a) mapper_admin_set_bundle_dest_bus(admin); else mapper_admin_set_bundle_dest_mesh(admin, a); mapper_admin_send_linked(admin, router, 1); mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_OUT); mapper_admin_send_linked(admin, router, 1); trace("<%s> added new router to %s -> host: %s, port: %d\n", mdev_name(md), dest_name, host, data_port); return 0; } /*! Store record of linked devices. */ static int handler_device_linked(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_monitor mon = admin->monitor; mapper_db db = mapper_monitor_get_db(mon); const char *src_name, *dest_name, *host=0, *admin_port; int data_port = -1; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; trace(" got /linked %s %s\n", src_name, dest_name); mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, types+2, argc-2, argv+2)) return 0; if (mon) mapper_db_add_or_update_link_params(db, src_name, dest_name, ¶ms); if (!md || !mdev_name(md) || strcmp(mdev_name(md), dest_name)) return 0; // Add a receiver data structure mapper_receiver receiver = mapper_receiver_find_by_src_name(md->receivers, src_name); if (receiver) { // Already linked, add metadata. if (argc <= 2) return 0; if (mapper_receiver_set_from_message(receiver, ¶ms)) { // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_IN); mapper_admin_send_linked(admin, receiver, 0); // Call local link handler if it exists if (md->link_cb) md->link_cb(md, &receiver->props, MDEV_LOCAL_MODIFIED, md->link_cb_userdata); } return 0; } // Find the sender's hostname lo_address a = lo_message_get_source(msg); host = lo_address_get_hostname(a); admin_port = lo_address_get_port(a); if (!host || !admin_port) { trace("can't add receiver on /linked, host unknown\n"); return 0; } // Retrieve the src device port if it is defined mapper_msg_get_param_if_int(¶ms, AT_SRC_PORT, &data_port); receiver = mapper_receiver_new(md, host, atoi(admin_port), data_port, src_name); if (!receiver) { trace("Error: NULL receiver\n"); return 0; } mdev_add_receiver(md, receiver); if (argc > 2) mapper_receiver_set_from_message(receiver, ¶ms); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_IN); mapper_admin_send_linked(admin, receiver, 0); // Call local link handler if it exists if (md->link_cb) md->link_cb(md, &receiver->props, MDEV_LOCAL_ESTABLISHED, md->link_cb_userdata); return 0; } /*! Modify the link properties : scope, etc. */ static int handler_device_link_modify(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; const char *src_name, *dest_name; int updated; mapper_message_t params; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; if (strcmp(src_name, mdev_name(md))) { trace("<%s> ignoring /link/modify %s %s\n", mdev_name(md), src_name, dest_name); return 0; } trace("<%s> got /link/modify %s %s\n", mdev_name(md), src_name, dest_name); // Discover whether the device is already linked. mapper_router router = mapper_router_find_by_dest_name(md->routers, dest_name); if (!router) return 0; // Parse the message. if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /link/modify.\n", mdev_name(md)); return 0; } updated = mapper_router_set_from_message(router, ¶ms); if (updated) { // increment device version md->version += updated; // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_OUT); mapper_admin_send_linked(admin, router, 0); // Call local link handler if it exists if (md->link_cb) md->link_cb(md, &router->props, MDEV_LOCAL_MODIFIED, md->link_cb_userdata); trace("<%s> modified link to %s\n", mdev_name(md), dest_name); } return 0; } /*! Unlink two devices. */ static int handler_device_unlink(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { const char *src_name, *dest_name; mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; trace("<%s> got /unlink %s %s + %i arguments\n", mdev_name(md), src_name, dest_name, argc-2); mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /unlink.\n", mdev_name(md)); return 0; } if (strcmp(mdev_name(md), src_name)) return 0; /* Remove the router for the destination. */ mapper_router router = mapper_router_find_by_dest_name(md->routers, dest_name); if (router) { // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &router->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); // Inform destination mapper_admin_set_bundle_dest_mesh(admin, router->admin_addr); mapper_admin_bundle_message_with_params(admin, ¶ms, 0, ADM_UNLINKED, 0, "ss", mdev_name(md), dest_name); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_OUT); mapper_admin_bundle_message_with_params(admin, ¶ms, 0, ADM_UNLINKED, 0, "ss", mdev_name(md), dest_name); mdev_remove_router(md, router); } else { trace("<%s> no router for %s found in /unlink handler\n", mdev_name(md), dest_name); } return 0; } /*! Respond to /unlinked by removing link from database. */ static int handler_device_unlinked(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_device md = admin->device; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; const char *src_name = &argv[0]->s; const char *dest_name = &argv[1]->s; mapper_message_t params; memset(¶ms, 0, sizeof(mapper_message_t)); // add arguments from /unlink if any if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /unlinked.\n", mdev_name(md)); return 0; } if (mon) { trace(" got /unlinked %s %s + %i arguments\n", src_name, dest_name, argc-2); mapper_db db = mapper_monitor_get_db(mon); mapper_db_remove_connections_by_query(db, mapper_db_get_connections_by_src_dest_device_names(db, src_name, dest_name)); mapper_db_remove_link(db, mapper_db_get_link_by_src_dest_names(db, src_name, dest_name)); } if (md && mdev_name(md)) { trace("<%s> got /unlinked %s %s + %i arguments\n", mdev_name(md), src_name, dest_name, argc-2); if (strcmp(mdev_name(md), dest_name)) return 0; mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /unlinked.\n", mdev_name(md)); return 0; } /* Remove the receiver for the source. */ mapper_receiver receiver = mapper_receiver_find_by_src_name(md->receivers, src_name); if (receiver) { // Call the local link handler if it exists if (md->link_cb) md->link_cb(md, &receiver->props, MDEV_LOCAL_DESTROYED, md->link_cb_userdata); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_LINKS_IN); mapper_admin_bundle_message(admin, ADM_UNLINKED, 0, "ss", mdev_name(md), dest_name); mdev_remove_receiver(md, receiver); } else { trace("<%s> no receiver for %s found in /unlinked handler\n", mdev_name(md), src_name); } } return 0; } /* Helper function to check if the prefix matches. Like strcmp(), * returns 0 if they match (up to the second '/'), non-0 otherwise. * Also optionally returns a pointer to the remainder of str1 after * the prefix. */ static int prefix_cmp(const char *str1, const char *str2, const char **rest) { if (str1[0]!='/') { trace("String '%s' does not start with '/'.\n", str1); return -1; } if (str2[0]!='/') { trace("String '%s' does not start with '/'.\n", str2); return -1; } // skip first slash const char *s1=str1+1, *s2=str2+1; while (*s1 && (*s1)!='/') s1++; while (*s2 && (*s2)!='/') s2++; int n1 = s1-str1, n2 = s2-str2; if (n1!=n2) return 1; if (rest) *rest = s1; return strncmp(str1, str2, n1); } /*! When the /connect message is received by the destination device, * send a connectTo message to the source device. */ static int handler_signal_connect(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_signal input; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; dest_name = &argv[1]->s; if (prefix_cmp(dest_name, mdev_name(md), &dest_signal_name)) return 0; src_name = &argv[0]->s; src_signal_name = strchr(src_name+1, '/'); if (!src_signal_name) { trace("<%s> source '%s' has no parameter in /connect.\n", mdev_name(md), src_name); return 0; } trace("<%s> got /connect %s %s\n", mdev_name(md), src_name, dest_name); if (!(input=mdev_get_input_by_name(md, dest_signal_name, 0))) { trace("<%s> no input signal found for '%s' in /connect\n", mdev_name(md), dest_signal_name); return 0; } mapper_message_t params; // add arguments from /connect if any if (mapper_msg_parse_params(¶ms, path, &types[2], argc-2, &argv[2])) { trace("<%s> error parsing message parameters in /connect.\n", mdev_name(md)); return 0; } mapper_receiver receiver = mapper_receiver_find_by_src_name(md->receivers, src_name); /* If no link found, we simply stop here. The idea was floated * that we could automatically create links, but it was agreed * that this kind of logic would be best left up to client * applications. */ if (!receiver) { trace("<%s> not linked from '%s' on /connect.\n", mdev_name(md), src_name); return 0; } // substitute some missing parameters with known properties lo_arg *arg_type = (lo_arg*) &input->props.type; params.values[AT_TYPE] = &arg_type; params.types[AT_TYPE] = "c"; params.lengths[AT_TYPE] = 1; lo_arg *arg_length = (lo_arg*) &input->props.length; params.values[AT_LENGTH] = &arg_length; params.types[AT_LENGTH] = "i"; params.lengths[AT_LENGTH] = 1; lo_arg *arg_num_instances = (lo_arg*) &input->props.num_instances; params.values[AT_INSTANCES] = &arg_num_instances; params.types[AT_INSTANCES] = "i"; params.lengths[AT_INSTANCES] = 1; mapper_admin_set_bundle_dest_mesh(admin, receiver->admin_addr); mapper_admin_bundle_message_with_params( admin, ¶ms, input->props.extra, ADM_CONNECT_TO, 0, "ss", src_name, dest_name, (!params.values[AT_MIN] && input->props.minimum) ? AT_MIN : -1, input, (!params.values[AT_MAX] && input->props.maximum) ? AT_MAX : -1, input); return 0; } /*! Connect two signals. */ static int handler_signal_connectTo(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_signal output; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 2) return 0; if ((types[0] != 's' && types[0] != 'S') || (types[1] != 's' && types[1] != 'S')) return 0; src_name = &argv[0]->s; if (prefix_cmp(src_name, mdev_name(md), &src_signal_name)) return 0; dest_name = &argv[1]->s; dest_signal_name = strchr(dest_name+1, '/'); if (!dest_signal_name) { trace("<%s> destination '%s' has no parameter in /connectTo.\n", mdev_name(md), dest_name); return 0; } trace("<%s> got /connectTo %s %s + %d arguments\n", mdev_name(md), src_name, dest_name, argc-2); if (!(output=mdev_get_output_by_name(md, src_signal_name, 0))) { trace("<%s> no output signal found for '%s' in /connectTo\n", mdev_name(md), src_signal_name); return 0; } mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, types+2, argc-2, &argv[2])) { trace("<%s> error parsing parameters in /connectTo, " "continuing anyway.\n", mdev_name(md)); } mapper_router router = mapper_router_find_by_dest_name(md->routers, dest_name); /* If no link found, we simply stop here. The idea was floated * that we could automatically create links, but it was agreed * that this kind of logic would be best left up to client * applications. */ if (!router) { trace("<%s> not linked to '%s' on /connectTo.\n", mdev_name(md), dest_name); return 0; } mapper_connection c = mapper_router_find_connection_by_names(router, src_signal_name, dest_signal_name); /* If a connection connection already exists between these two signals, * forward the message to handler_signal_connection_modify() and stop. */ if (c) { handler_signal_connection_modify(path, types, argv, argc, msg, user_data); return 0; } /* Creation of a connection requires the type and length info. */ if (!params.values[AT_TYPE] || !params.values[AT_LENGTH]) return 0; char dest_type = 0; if (*params.types[AT_TYPE] == 'c') dest_type = (*params.values[AT_TYPE])->c; else if (*params.types[AT_TYPE] == 's') dest_type = (*params.values[AT_TYPE])->s; else return 0; int dest_length = 0; if (*params.types[AT_LENGTH] == 'i') dest_length = (*params.values[AT_LENGTH])->i; else return 0; /* Add a flavourless connection */ c = mapper_router_add_connection(router, output, dest_signal_name, dest_type, dest_length); if (!c) { trace("couldn't create mapper_connection " "in handler_signal_connectTo\n"); return 0; } if (argc > 2) { /* If send_as_instance property is not set, make connection * default to passing updates as instances if either source * or destination signals have multiple instances. */ if (!params.values[AT_SEND_AS_INSTANCE]) { int dest_instances = 0; mapper_msg_get_param_if_int(¶ms, AT_INSTANCES, &dest_instances); if (dest_instances > 1 || output->props.num_instances > 1) { c->props.send_as_instance = 1; } else c->props.send_as_instance = 0; } /* Set its properties. */ mapper_connection_set_from_message(c, ¶ms); } // Inform destination device mapper_admin_set_bundle_dest_mesh(admin, router->admin_addr); mapper_admin_send_connected(admin, router, c, -1, 1); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_OUT); mapper_admin_send_connected(admin, router, c, -1, 1); // Call local connection handler if it exists if (md->connection_cb) md->connection_cb(md, &router->props, output, &c->props, MDEV_LOCAL_ESTABLISHED, md->connection_cb_userdata); return 0; } /*! Respond to /connected by storing connection in database. */ static int handler_signal_connected(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_monitor mon = admin->monitor; mapper_signal input; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, types+2, argc-2, argv+2)) { trace("<%s> error parsing parameters in /connected, " "continuing anyway.\n", mdev_name(md)); } if (mon) { mapper_db db = mapper_monitor_get_db(mon); trace(" got /connected %s %s\n", src_name, dest_name); mapper_db_add_or_update_connection_params(db, src_name, dest_name, ¶ms); } if (!md || !mdev_name(md) || prefix_cmp(dest_name, mdev_name(md), &dest_signal_name)) return 0; trace("<%s> got /connected %s %s + %d arguments\n", mdev_name(md), src_name, dest_name, argc-2); src_signal_name = strchr(src_name+1, '/'); if (!src_signal_name) return 0; if (!(input=mdev_get_input_by_name(md, dest_signal_name, 0))) return 0; mapper_receiver receiver = mapper_receiver_find_by_src_name(md->receivers, src_name); if (!receiver) { trace("<%s> not linked from '%s' on /connected.\n", mdev_name(md), src_name); return 0; } mapper_connection c = mapper_receiver_find_connection_by_names(receiver, src_signal_name, dest_signal_name); if (c) { if (argc <= 2) return 0; // connection already exists, add metadata int updated = mapper_connection_set_from_message(c, ¶ms); if (updated) { // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_IN); mapper_admin_send_connected(admin, receiver, c, -1, 0); // Call local connection handler if it exists if (md->connection_cb) md->connection_cb(md, &receiver->props, input, &c->props, MDEV_LOCAL_MODIFIED, md->connection_cb_userdata); } return 0; } else { /* Creation of a connection requires the type and length info. */ if (!params.values[AT_SRC_TYPE] || !params.values[AT_SRC_LENGTH]) return 0; char src_type = 0; if (*params.types[AT_SRC_TYPE] == 'c') src_type = (*params.values[AT_SRC_TYPE])->c; else if (*params.types[AT_SRC_TYPE] == 's') src_type = (*params.values[AT_SRC_TYPE])->s; else return 0; int src_length = 0; if (*params.types[AT_SRC_LENGTH] == 'i') src_length = (*params.values[AT_SRC_LENGTH])->i; else return 0; // Add a flavourless connection c = mapper_receiver_add_connection(receiver, input, src_signal_name, src_type, src_length); /* Set its properties. */ mapper_connection_set_from_message(c, ¶ms); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_IN); mapper_admin_send_connected(admin, receiver, c, -1, 0); // Call local connection handler if it exists if (md->connection_cb) md->connection_cb(md, &receiver->props, input, &c->props, MDEV_LOCAL_ESTABLISHED, md->connection_cb_userdata); } return 0; } /*! Modify the connection properties : mode, range, expression, * boundMin, boundMax. */ static int handler_signal_connection_modify(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_signal output; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 4) return 0; if ((types[0] != 's' && types[0] != 'S') || (types[1] != 's' && types[1] != 'S') || (types[2] != 's' && types[2] != 'S')) return 0; src_name = &argv[0]->s; if (prefix_cmp(src_name, mdev_name(md), &src_signal_name)) return 0; dest_name = &argv[1]->s; dest_signal_name = strchr(dest_name+1, '/'); if (!dest_signal_name) { trace("<%s> destination '%s' has no parameter in /connection/modify.\n", mdev_name(md), dest_name); return 0; } if (!(output=mdev_get_output_by_name(md, src_signal_name, 0))) { trace("<%s> no output signal found for '%s' in /connection/modify\n", mdev_name(md), src_signal_name); return 0; } mapper_router router = mapper_router_find_by_dest_name(md->routers, &argv[1]->s); if (!router) { trace("<%s> no router found for '%s' in /connection/modify\n", mdev_name(md), &argv[1]->s); return 0; } mapper_connection c = mapper_router_find_connection_by_names(router, src_signal_name, dest_signal_name); if (!c) return 0; mapper_message_t params; if (mapper_msg_parse_params(¶ms, path, types+2, argc-2, &argv[2])) { trace("<%s> error parsing parameters in /connection/modify, " "continuing anyway.\n", mdev_name(md)); } int updated = mapper_connection_set_from_message(c, ¶ms); if (updated) { // Inform destination device mapper_admin_set_bundle_dest_mesh(admin, router->admin_addr); mapper_admin_send_connected(admin, router, c, -1, 1); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_OUT); mapper_admin_send_connected(admin, router, c, -1, 1); // Call local connection handler if it exists if (md->connection_cb) md->connection_cb(md, &router->props, output, &c->props, MDEV_LOCAL_MODIFIED, md->connection_cb_userdata); } return 0; } /*! Disconnect two signals. */ static int handler_signal_disconnect(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_signal sig; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; if (prefix_cmp(src_name, mdev_name(md), &src_signal_name) != 0) return 0; dest_name = &argv[1]->s; dest_signal_name = strchr(dest_name+1, '/'); if (!dest_signal_name) { trace("<%s> destination '%s' has no parameter in /disconnect.\n", mdev_name(md), dest_name); return 0; } if (!(sig=mdev_get_output_by_name(md, src_signal_name, 0))) { trace("<%s> no output signal found for '%s' in /disconnect\n", mdev_name(md), src_name); return 0; } mapper_router r = mapper_router_find_by_dest_name(md->routers, dest_name); if (!r) { trace("<%s> ignoring /disconnect, no router found for '%s'\n", mdev_name(md), dest_name); return 0; } mapper_connection c = mapper_router_find_connection_by_names(r, src_signal_name, dest_signal_name); if (!c) { trace("<%s> ignoring /disconnect, " "no connection found for '%s' -> '%s'\n", mdev_name(md), src_name, dest_name); return 0; } // Call local connection handler if it exists if (md->connection_cb) md->connection_cb(md, &r->props, sig, &c->props, MDEV_LOCAL_DESTROYED, md->connection_cb_userdata); /* The connection is removed. */ if (mapper_router_remove_connection(r, c)) { return 0; } // Inform destination and subscribers mapper_admin_set_bundle_dest_mesh(admin, r->admin_addr); mapper_admin_bundle_message(admin, ADM_DISCONNECTED, 0, "ss", src_name, dest_name); mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_OUT); mapper_admin_bundle_message(admin, ADM_DISCONNECTED, 0, "ss", src_name, dest_name); return 0; } /*! Respond to /disconnected by removing connection from database. */ static int handler_signal_disconnected(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; mapper_device md = admin->device; const char *src_signal_name, *src_name; const char *dest_signal_name, *dest_name; if (argc < 2) return 0; if (types[0] != 's' && types[0] != 'S' && types[1] != 's' && types[1] != 'S') return 0; src_name = &argv[0]->s; dest_name = &argv[1]->s; if (mon) { mapper_db db = mapper_monitor_get_db(mon); trace(" got /disconnected %s %s\n", src_name, dest_name); mapper_db_remove_connection(db, mapper_db_get_connection_by_signal_full_names(db, src_name, dest_name)); } if (!md || !mdev_name(md) || prefix_cmp(dest_name, mdev_name(md), &dest_signal_name)) return 0; src_signal_name = strchr(src_name+1, '/'); if (!src_signal_name) return 0; trace("<%s> got /disconnected %s %s\n", mdev_name(md), src_name, dest_name); mapper_signal sig; if (!(sig=mdev_get_input_by_name(md, dest_signal_name, 0))) return 0; mapper_receiver r = mapper_receiver_find_by_src_name(md->receivers, src_name); if (!r) { trace("<%s> ignoring /disconnected, no receiver found for '%s'\n", mdev_name(md), src_name); return 0; } mapper_connection c = mapper_receiver_find_connection_by_names(r, src_signal_name, dest_signal_name); if (!c) { trace("<%s> ignoring /disconnected, " "no connection found for '%s' -> '%s'\n", mdev_name(md), src_name, dest_name); return 0; } // Inform user code of the destroyed connection if requested if (md->connection_cb) md->connection_cb(md, &r->props, sig, &c->props, MDEV_LOCAL_DESTROYED, md->connection_cb_userdata); // Inform subscribers mapper_admin_set_bundle_dest_subscribers(admin, SUB_DEVICE_CONNECTIONS_IN); mapper_admin_bundle_message(admin, ADM_DISCONNECTED, 0, "ss", src_name, dest_name); /* The connection is removed. */ if (mapper_receiver_remove_connection(r, c)) { return 0; } return 0; } static int handler_device_link_ping(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { // TODO: use only one ping between devices (bidirectional links?) // message args: remote_device_hash, message_id, last_message_id, elapsed_time mapper_admin admin = (mapper_admin) user_data; mapper_device md = admin->device; mapper_clock_t *clock = &admin->clock; if (!md) return 0; mapper_timetag_t now; mapper_clock_now(clock, &now); lo_timetag then = lo_message_get_timestamp(msg); mapper_router router = mapper_router_find_by_dest_hash(md->routers, argv[0]->i); if (router) { if (argv[2]->i == router->clock.sent.message_id) { // total elapsed time since ping sent double elapsed = mapper_timetag_difference(now, router->clock.sent.timetag); // assume symmetrical latency double latency = (elapsed - argv[3]->d) * 0.5; // difference between remote and local clocks (latency compensated) double offset = mapper_timetag_difference(now, then) - latency; if (latency < 0) { trace("error: latency cannot be < 0"); return 0; } if (router->clock.new == 1) { router->clock.offset = offset; router->clock.latency = latency; router->clock.jitter = 0; router->clock.new = 0; } else { router->clock.jitter = router->clock.jitter * 0.9 + fabs(router->clock.latency - latency) * 0.1; if (offset > router->clock.offset) { // remote timetag is in the future router->clock.offset = offset; } else if (latency < router->clock.latency + router->clock.jitter && latency > router->clock.latency - router->clock.jitter) { router->clock.offset = router->clock.offset * 0.9 + offset * 0.1; router->clock.latency = router->clock.latency * 0.9 + latency * 0.1; } } } // update sync status mapper_timetag_cpy(&router->clock.response.timetag, now); router->clock.response.message_id = argv[1]->i; } mapper_receiver receiver = mapper_receiver_find_by_src_hash(md->receivers, argv[0]->i); if (receiver) { if (argv[2]->i == receiver->clock.sent.message_id) { // total elapsed time since ping sent double elapsed = mapper_timetag_difference(now, receiver->clock.sent.timetag); // assume symmetrical latency double latency = (elapsed - argv[3]->d) * 0.5; // difference between remote and local clocks (latency compensated) double offset = mapper_timetag_difference(now, then) - latency; if (latency < 0) { trace("error: latency cannot be < 0"); return 0; } if (receiver->clock.new == 1) { receiver->clock.offset = offset; receiver->clock.latency = latency; receiver->clock.jitter = 0; receiver->clock.new = 0; } else { receiver->clock.jitter = receiver->clock.jitter * 0.9 + fabs(receiver->clock.latency - latency) * 0.1; if (offset > receiver->clock.offset) { // remote timetag is in the future receiver->clock.offset = offset; } else if (latency < receiver->clock.latency + receiver->clock.jitter && latency > receiver->clock.latency - receiver->clock.jitter) { receiver->clock.offset = receiver->clock.offset * 0.9 + offset * 0.1; receiver->clock.latency = receiver->clock.latency * 0.9 + latency * 0.1; } } } // update sync status mapper_timetag_cpy(&receiver->clock.response.timetag, now); receiver->clock.response.message_id = argv[1]->i; } return 0; } static int handler_sync(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { mapper_admin admin = (mapper_admin) user_data; mapper_monitor mon = admin->monitor; if (!mon || !argc) return 0; mapper_db_device reg = 0; if (types[0] == 's' || types[0] == 'S') { if ((reg = mapper_db_get_device_by_name(&mon->db, &argv[0]->s))) mapper_timetag_cpy(®->synced, lo_message_get_timestamp(msg)); else if (mon->autosubscribe) { // only create device record after requesting more information mapper_monitor_subscribe(mon, &argv[0]->s, mon->autosubscribe, -1); } } else if (types[0] == 'i') { if ((reg = mapper_db_get_device_by_name_hash(&mon->db, argv[0]->i))) mapper_timetag_cpy(®->synced, lo_message_get_timestamp(msg)); } return 0; } libmapper/src/monitor.c0000644000175000017500000004535412423630127014456 0ustar tiagotiago #include #include #include #include #include #include "config.h" #include "mapper_internal.h" #define AUTOSUBSCRIBE_INTERVAL 60 /*! Internal function to get the current time. */ static double get_current_time() { #ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; #else #error No timing method known on this platform. #endif } // function prototypes static void monitor_subscribe_internal(mapper_monitor mon, const char *device_name, int subscribe_flags, int timeout, int version); typedef enum _db_request_direction { DIRECTION_IN, DIRECTION_OUT, DIRECTION_BOTH } db_request_direction; mapper_monitor mapper_monitor_new(mapper_admin admin, int autosubscribe_flags) { mapper_monitor mon = (mapper_monitor) calloc(1, sizeof(struct _mapper_monitor)); if (admin) { mon->admin = admin; mon->own_admin = 0; } else { mon->admin = mapper_admin_new(0, 0, 0); mon->own_admin = 1; } if (!mon->admin) { mapper_monitor_free(mon); return NULL; } mon->timeout_sec = ADMIN_TIMEOUT_SEC; mapper_admin_add_monitor(mon->admin, mon); if (autosubscribe_flags) { mapper_monitor_autosubscribe(mon, autosubscribe_flags); mapper_monitor_request_devices(mon); } return mon; } void mapper_monitor_free(mapper_monitor mon) { if (!mon) return; // remove callbacks now so they won't be called when removing devices mapper_db_remove_all_callbacks(&mon->db); // unsubscribe from and remove any autorenewing subscriptions while (mon->subscriptions) { mapper_monitor_unsubscribe(mon, mon->subscriptions->name); } while (mon->db.registered_devices) mapper_db_remove_device_by_name(&mon->db, mon->db.registered_devices->name); if (mon->admin) { if (mon->own_admin) mapper_admin_free(mon->admin); else mapper_admin_remove_monitor(mon->admin, mon); } free(mon); } int mapper_monitor_poll(mapper_monitor mon, int block_ms) { int ping_time = mon->admin->clock.next_ping; int admin_count = mapper_admin_poll(mon->admin); mapper_clock_now(&mon->admin->clock, &mon->admin->clock.now); // check if any subscriptions need to be renewed mapper_monitor_subscription s = mon->subscriptions; while (s) { if (s->lease_expiration_sec < mon->admin->clock.now.sec) { monitor_subscribe_internal(mon, s->name, s->flags, AUTOSUBSCRIBE_INTERVAL, -1); // leave 10-second buffer for subscription renewal s->lease_expiration_sec = mon->admin->clock.now.sec + AUTOSUBSCRIBE_INTERVAL - 10; } s = s->next; } if (block_ms) { double then = get_current_time(); while ((get_current_time() - then)*1000 < block_ms) { admin_count += mapper_admin_poll(mon->admin); #ifdef WIN32 Sleep(block_ms); #else usleep(block_ms * 100); #endif } } if (ping_time != mon->admin->clock.next_ping) { // some housekeeping: check if any devices have timed out mapper_db_check_device_status(&mon->db, mon->admin->clock.now.sec - mon->timeout_sec); } return admin_count; } mapper_db mapper_monitor_get_db(mapper_monitor mon) { return &mon->db; } static void mapper_monitor_set_bundle_dest(mapper_monitor mon, const char *name) { // TODO: look up device info, maybe send directly mapper_admin_set_bundle_dest_bus(mon->admin); } static void monitor_subscribe_internal(mapper_monitor mon, const char *device_name, int subscribe_flags, int timeout, int version) { char cmd[1024]; snprintf(cmd, 1024, "%s/subscribe", device_name); mapper_monitor_set_bundle_dest(mon, device_name); lo_message m = lo_message_new(); if (m) { if (subscribe_flags & SUB_DEVICE_ALL) lo_message_add_string(m, "all"); else { if (subscribe_flags & SUB_DEVICE) lo_message_add_string(m, "device"); if (subscribe_flags & SUB_DEVICE_SIGNALS) lo_message_add_string(m, "signals"); else { if (subscribe_flags & SUB_DEVICE_INPUTS) lo_message_add_string(m, "inputs"); else if (subscribe_flags & SUB_DEVICE_OUTPUTS) lo_message_add_string(m, "outputs"); } if (subscribe_flags & SUB_DEVICE_LINKS) lo_message_add_string(m, "links"); else { if (subscribe_flags & SUB_DEVICE_LINKS_IN) lo_message_add_string(m, "links_in"); else if (subscribe_flags & SUB_DEVICE_LINKS_OUT) lo_message_add_string(m, "links_out"); } if (subscribe_flags & SUB_DEVICE_CONNECTIONS) lo_message_add_string(m, "connections"); else { if (subscribe_flags & SUB_DEVICE_CONNECTIONS_IN) lo_message_add_string(m, "connections_in"); else if (subscribe_flags & SUB_DEVICE_CONNECTIONS_OUT) lo_message_add_string(m, "connections_out"); } } lo_message_add_string(m, "@lease"); lo_message_add_int32(m, timeout); if (version >= 0) { lo_message_add_string(m, "@version"); lo_message_add_int32(m, version); } lo_bundle_add_message(mon->admin->bundle, cmd, m); mapper_admin_send_bundle(mon->admin); } } void mapper_monitor_subscribe(mapper_monitor mon, const char *device_name, int subscribe_flags, int timeout) { mapper_db_device found = 0; if (timeout == -1) { // special case: autorenew subscription lease // first check if subscription already exists mapper_monitor_subscription s = mon->subscriptions; while (s) { if (strcmp(device_name, s->name)==0) { s->flags = subscribe_flags; // subscription already exists; check if monitor has device record if ((found = mapper_db_get_device_by_name(&mon->db, device_name))) return; break; } s = s->next; } if (!s) { // store subscription record s = malloc(sizeof(struct _mapper_monitor_subscription)); s->name = strdup(device_name); s->flags = subscribe_flags; s->next = mon->subscriptions; mon->subscriptions = s; } mapper_clock_now(&mon->admin->clock, &mon->admin->clock.now); // leave 10-second buffer for subscription lease s->lease_expiration_sec = mon->admin->clock.now.sec + AUTOSUBSCRIBE_INTERVAL - 10; timeout = AUTOSUBSCRIBE_INTERVAL; } monitor_subscribe_internal(mon, device_name, subscribe_flags, timeout, 0); } static void mapper_monitor_unsubscribe_internal(mapper_monitor mon, const char *device_name, int send_message) { char cmd[1024]; // check if autorenewing subscription exists mapper_monitor_subscription *s = &mon->subscriptions; while (*s) { if (strcmp((*s)->name, device_name)==0) { if (send_message) { snprintf(cmd, 1024, "%s/unsubscribe", device_name); mapper_monitor_set_bundle_dest(mon, device_name); lo_message m = lo_message_new(); if (!m) break; lo_bundle_add_message(mon->admin->bundle, cmd, m); mapper_admin_send_bundle(mon->admin); } // remove from subscriber list mapper_monitor_subscription temp = *s; *s = temp->next; if (temp->name) free(temp->name); free(temp); return; } s = &(*s)->next; } } void mapper_monitor_unsubscribe(mapper_monitor mon, const char *device_name) { mapper_monitor_unsubscribe_internal(mon, device_name, 1); } void mapper_monitor_request_devices(mapper_monitor mon) { mapper_admin_set_bundle_dest_bus(mon->admin); mapper_admin_bundle_message(mon->admin, ADM_WHO, 0, ""); } void mapper_monitor_link(mapper_monitor mon, const char* source_device, const char* dest_device, mapper_db_link_t *props, unsigned int props_flags) { if (props && (props_flags & LINK_NUM_SCOPES) && props->num_scopes && ((props_flags & LINK_SCOPE_NAMES) || (props_flags & LINK_SCOPE_HASHES))) { lo_message m = lo_message_new(); if (!m) return; lo_message_add_string(m, source_device); lo_message_add_string(m, dest_device); lo_message_add_string(m, "@scope"); int i; if (props_flags & LINK_SCOPE_NAMES) { for (i=0; inum_scopes; i++) { lo_message_add_string(m, props->scope_names[i]); } } else if (props_flags & LINK_SCOPE_HASHES) { for (i=0; inum_scopes; i++) { lo_message_add_int32(m, props->scope_hashes[i]); } } mapper_monitor_set_bundle_dest(mon, dest_device); // TODO: switch scopes to regular props lo_send_message(mon->admin->bus_addr, "/link", m); free(m); } else { mapper_admin_set_bundle_dest_bus(mon->admin); mapper_admin_bundle_message( mon->admin, ADM_LINK, 0, "ss", source_device, dest_device ); } /* We cannot depend on string arguments sticking around for liblo to * serialize later: trigger immediate dispatch. */ mapper_admin_send_bundle(mon->admin); } void mapper_monitor_unlink(mapper_monitor mon, const char* src_device, const char* dest_device) { mapper_monitor_set_bundle_dest(mon, src_device); mapper_admin_bundle_message(mon->admin, ADM_UNLINK, 0, "ss", src_device, dest_device); } void mapper_monitor_connection_modify(mapper_monitor mon, const char *source_signal, const char *dest_signal, mapper_db_connection_t *props, unsigned int props_flags) { if (props) { // TODO: lookup device ip/ports, send directly? mapper_admin_set_bundle_dest_bus(mon->admin); mapper_admin_bundle_message(mon->admin, ADM_CONNECTION_MODIFY, 0, "ss", source_signal, dest_signal, (props_flags & CONNECTION_BOUND_MIN) ? AT_BOUND_MIN : -1, props->bound_min, (props_flags & CONNECTION_BOUND_MAX) ? AT_BOUND_MAX : -1, props->bound_max, ((props_flags & CONNECTION_RANGE_SRC_MIN) && (props_flags & CONNECTION_SRC_TYPE) && (props_flags & CONNECTION_SRC_LENGTH)) ? AT_SRC_MIN : -1, props, ((props_flags & CONNECTION_RANGE_SRC_MAX) && (props_flags & CONNECTION_SRC_TYPE) && (props_flags & CONNECTION_SRC_LENGTH)) ? AT_SRC_MAX : -1, props, ((props_flags & CONNECTION_RANGE_DEST_MIN) && (props_flags & CONNECTION_DEST_TYPE) && (props_flags & CONNECTION_DEST_LENGTH)) ? AT_DEST_MIN : -1, props, ((props_flags & CONNECTION_RANGE_DEST_MAX) && (props_flags & CONNECTION_DEST_TYPE) && (props_flags & CONNECTION_DEST_LENGTH)) ? AT_DEST_MAX : -1, props, (props_flags & CONNECTION_EXPRESSION) ? AT_EXPRESSION : -1, props->expression, (props_flags & CONNECTION_MODE) ? AT_MODE : -1, props->mode, (props_flags & CONNECTION_MUTED) ? AT_MUTE : -1, props->muted, (props_flags & CONNECTION_SEND_AS_INSTANCE) ? AT_SEND_AS_INSTANCE : -1, props->send_as_instance); /* We cannot depend on string arguments sticking around for liblo to * serialize later: trigger immediate dispatch. */ mapper_admin_send_bundle(mon->admin); } } void mapper_monitor_connect(mapper_monitor mon, const char* source_signal, const char* dest_signal, mapper_db_connection_t *props, unsigned int props_flags) { // TODO: lookup device ip/ports, send directly? mapper_admin_set_bundle_dest_bus(mon->admin); if (props) { mapper_admin_bundle_message(mon->admin, ADM_CONNECT, 0, "ss", source_signal, dest_signal, (props_flags & CONNECTION_BOUND_MIN) ? AT_BOUND_MIN : -1, props->bound_min, (props_flags & CONNECTION_BOUND_MAX) ? AT_BOUND_MAX : -1, props->bound_max, ((props_flags & CONNECTION_RANGE_SRC_MIN) && (props_flags & CONNECTION_SRC_TYPE) && (props_flags & CONNECTION_SRC_LENGTH)) ? AT_SRC_MIN : -1, props, ((props_flags & CONNECTION_RANGE_SRC_MAX) && (props_flags & CONNECTION_SRC_TYPE) && (props_flags & CONNECTION_SRC_LENGTH)) ? AT_SRC_MAX : -1, props, ((props_flags & CONNECTION_RANGE_DEST_MIN) && (props_flags & CONNECTION_DEST_TYPE) && (props_flags & CONNECTION_DEST_LENGTH)) ? AT_DEST_MIN : -1, props, ((props_flags & CONNECTION_RANGE_DEST_MAX) && (props_flags & CONNECTION_DEST_TYPE) && (props_flags & CONNECTION_DEST_LENGTH)) ? AT_DEST_MAX : -1, props, (props_flags & CONNECTION_EXPRESSION) ? AT_EXPRESSION : -1, props->expression, (props_flags & CONNECTION_MODE) ? AT_MODE : -1, props->mode, (props_flags & CONNECTION_MUTED) ? AT_MUTE : -1, props->muted, (props_flags & CONNECTION_SEND_AS_INSTANCE) ? AT_SEND_AS_INSTANCE : -1, props->send_as_instance ); } else mapper_admin_bundle_message(mon->admin, ADM_CONNECT, 0, "ss", source_signal, dest_signal); /* We cannot depend on string arguments sticking around for liblo to * serialize later: trigger immediate dispatch. */ mapper_admin_send_bundle(mon->admin); } void mapper_monitor_disconnect(mapper_monitor mon, const char* source_signal, const char* dest_signal) { // TODO: lookup device ip/ports, send directly? mapper_admin_set_bundle_dest_bus(mon->admin); mapper_admin_bundle_message(mon->admin, ADM_DISCONNECT, 0, "ss", source_signal, dest_signal); } static void on_device_autosubscribe(mapper_db_device dev, mapper_db_action_t a, void *user) { mapper_monitor mon = (mapper_monitor)(user); if (a == MDB_NEW) { // Subscribe to signals, links, and/or connections for new devices. if (mon->autosubscribe) mapper_monitor_subscribe(mon, dev->name, mon->autosubscribe, -1); } else if (a == MDB_REMOVE) { mapper_monitor_unsubscribe_internal(mon, dev->name, 0); } } void mapper_monitor_autosubscribe(mapper_monitor mon, int autosubscribe_flags) { // TODO: remove autorenewing subscription record if necessary if (!mon->autosubscribe && autosubscribe_flags) mapper_db_add_device_callback(&mon->db, on_device_autosubscribe, mon); else if (mon->autosubscribe && !autosubscribe_flags) { mapper_db_remove_device_callback(&mon->db, on_device_autosubscribe, mon); while (mon->subscriptions) { mapper_monitor_unsubscribe_internal(mon, mon->subscriptions->name, 1); } } mon->autosubscribe = autosubscribe_flags; } void mapper_monitor_now(mapper_monitor mon, mapper_timetag_t *tt) { mapper_clock_now(&mon->admin->clock, tt); } void mapper_monitor_set_timeout(mapper_monitor mon, int timeout_sec) { if (timeout_sec < 0) timeout_sec = ADMIN_TIMEOUT_SEC; mon->timeout_sec = timeout_sec; } int mapper_monitor_get_timeout(mapper_monitor mon) { return mon->timeout_sec; } void mapper_monitor_flush_db(mapper_monitor mon, int timeout_sec, int quiet) { mapper_clock_now(&mon->admin->clock, &mon->admin->clock.now); // flush expired device records mapper_db_flush(&mon->db, mon->admin->clock.now.sec, timeout_sec, quiet); // also need to remove subscriptions mapper_monitor_subscription *s = &mon->subscriptions; while (*s) { if (!mapper_db_get_device_by_name(&mon->db, (*s)->name)) { // don't bother sending '/unsubscribe' since device is unresponsive // remove from subscriber list mapper_monitor_subscription temp = *s; *s = temp->next; if (temp->name) free(temp->name); free(temp); } else s = &(*s)->next; } } libmapper/src/connection.c0000644000175000017500000013502412423630127015120 0ustar tiagotiago #include #include #include #include #include "mapper_internal.h" #include "types_internal.h" #include /*! Reallocate memory used by connection. */ static void reallocate_connection_histories(mapper_connection c, int input_history_size, int output_history_size); const char* mapper_boundary_action_strings[] = { "none", /* BA_NONE */ "mute", /* BA_MUTE */ "clamp", /* BA_CLAMP */ "fold", /* BA_FOLD */ "wrap", /* BA_WRAP */ }; const char* mapper_mode_type_strings[] = { NULL, /* MO_UNDEFINED */ "bypass", /* MO_BYPASS */ "linear", /* MO_LINEAR */ "expression", /* MO_EXPRESSION */ "calibrate", /* MO_CALIBRATE */ "reverse", /* MO_REVERSE */ }; const char *mapper_get_boundary_action_string(mapper_boundary_action bound) { die_unless(bound < N_MAPPER_BOUNDARY_ACTIONS, "called mapper_get_boundary_action_string() with " "bad parameter.\n"); return mapper_boundary_action_strings[bound]; } const char *mapper_get_mode_type_string(mapper_mode_type mode) { die_unless(mode < N_MAPPER_MODE_TYPES, "called mapper_get_mode_type_string() with " "bad parameter.\n"); return mapper_mode_type_strings[mode]; } int mapper_connection_perform(mapper_connection connection, mapper_signal_history_t *from, mapper_signal_history_t **expr_vars, mapper_signal_history_t *to, char *typestring) { int changed = 0, i; int vector_length = from->length < to->length ? from->length : to->length; if (connection->props.muted) return 0; /* If the destination type is unknown, we can't do anything * intelligent here -- even bypass mode might screw up if we * assume the types work out. */ if (connection->props.dest_type != 'f' && connection->props.dest_type != 'i' && connection->props.dest_type != 'd') { return 0; } if (!connection->props.mode || connection->props.mode == MO_BYPASS) { /* Increment index position of output data structure. */ to->position = (to->position + 1) % to->size; if (connection->props.src_type == connection->props.dest_type) { memcpy(msig_history_value_pointer(*to), msig_history_value_pointer(*from), mapper_type_size(to->type) * vector_length); memset(msig_history_value_pointer(*to) + mapper_type_size(to->type) * vector_length, 0, (to->length - vector_length) * mapper_type_size(to->type)); } else if (connection->props.src_type == 'f') { float *vfrom = msig_history_value_pointer(*from); if (connection->props.dest_type == 'i') { int *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (int)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } else if (connection->props.dest_type == 'd') { double *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (double)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } } else if (connection->props.src_type == 'i') { int *vfrom = msig_history_value_pointer(*from); if (connection->props.dest_type == 'f') { float *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (float)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } else if (connection->props.dest_type == 'd') { double *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (double)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } } else if (connection->props.src_type == 'd') { double *vfrom = msig_history_value_pointer(*from); if (connection->props.dest_type == 'i') { int *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (int)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } else if (connection->props.dest_type == 'f') { float *vto = msig_history_value_pointer(*to); for (i = 0; i < vector_length; i++) { vto[i] = (float)vfrom[i]; } for (; i < to->length; i++) { vto[i] = 0; } } } for (i = 0; i < vector_length; i++) { typestring[i] = to->type; } return 1; } else if (connection->props.mode == MO_EXPRESSION || connection->props.mode == MO_LINEAR) { die_unless(connection->expr!=0, "Missing expression.\n"); return (mapper_expr_evaluate(connection->expr, from, expr_vars, to, typestring)); } else if (connection->props.mode == MO_CALIBRATE) { /* Increment index position of output data structure. */ to->position = (to->position + 1) % to->size; if (!connection->props.src_min) { connection->props.src_min = malloc(connection->props.src_length * mapper_type_size(connection->props.src_type)); } if (!connection->props.src_max) { connection->props.src_max = malloc(connection->props.src_length * mapper_type_size(connection->props.src_type)); } /* If calibration mode has just taken effect, first data * sample sets source min and max */ if (connection->props.src_type == 'f') { float *v = msig_history_value_pointer(*from); float *src_min = (float*)connection->props.src_min; float *src_max = (float*)connection->props.src_max; if (!connection->calibrating) { for (i = 0; i < from->length; i++) { src_min[i] = v[i]; src_max[i] = v[i]; } connection->calibrating = 1; changed = 1; } else { for (i = 0; i < from->length; i++) { if (v[i] < src_min[i]) { src_min[i] = v[i]; changed = 1; } if (v[i] > src_max[i]) { src_max[i] = v[i]; changed = 1; } } } } else if (connection->props.src_type == 'i') { int *v = msig_history_value_pointer(*from); int *src_min = (int*)connection->props.src_min; int *src_max = (int*)connection->props.src_max; if (!connection->calibrating) { for (i = 0; i < from->length; i++) { src_min[i] = v[i]; src_max[i] = v[i]; } connection->calibrating = 1; changed = 1; } else { for (i = 0; i < from->length; i++) { if (v[i] < src_min[i]) { src_min[i] = v[i]; changed = 1; } if (v[i] > src_max[i]) { src_max[i] = v[i]; changed = 1; } } } } else if (connection->props.src_type == 'd') { double *v = msig_history_value_pointer(*from); double *src_min = (double*)connection->props.src_min; double *src_max = (double*)connection->props.src_max; if (!connection->calibrating) { for (i = 0; i < from->length; i++) { src_min[i] = v[i]; src_max[i] = v[i]; } connection->calibrating = 1; changed = 1; } else { for (i = 0; i < from->length; i++) { if (v[i] < src_min[i]) { src_min[i] = v[i]; changed = 1; } if (v[i] > src_max[i]) { src_max[i] = v[i]; changed = 1; } } } } if (changed) { mapper_connection_set_mode_linear(connection); /* Stay in calibrate mode. */ connection->props.mode = MO_CALIBRATE; } if (connection->expr) return (mapper_expr_evaluate(connection->expr, from, expr_vars, to, typestring)); else return 0; } return 1; } static double propval_get_double(void *value, const char type, int index) { switch (type) { case 'f': { float *temp = (float*)value; return (double)temp[index]; break; } case 'i': { int *temp = (int*)value; return (double)temp[index]; break; } case 'd': { double *temp = (double*)value; return temp[index]; break; } default: return 0; break; } } static void propval_set_double(void *to, const char type, int index, double from) { switch (type) { case 'f': { float *temp = (float*)to; temp[index] = (float)from; break; } case 'i': { int *temp = (int*)to; temp[index] = (int)from; break; } case 'd': { double *temp = (double*)to; temp[index] = from; break; default: return; break; } } } int mapper_boundary_perform(mapper_connection connection, mapper_signal_history_t *history) { /* TODO: We are currently saving the processed values to output history. * it needs to be decided whether boundary processing should be inside the * feedback loop when past samples are called in expressions. */ int i, muted = 0; double value; double dest_min, dest_max, swap, total_range, difference, modulo_difference; mapper_boundary_action bound_min, bound_max; if (connection->props.bound_min == BA_NONE && connection->props.bound_max == BA_NONE) { return 1; } if (!(connection->props.range_known & CONNECTION_RANGE_DEST_MIN) && (connection->props.bound_min != BA_NONE || connection->props.bound_max == BA_WRAP)) { return 1; } if (!(connection->props.range_known & CONNECTION_RANGE_DEST_MAX) && (connection->props.bound_max != BA_NONE || connection->props.bound_min == BA_WRAP)) { return 1; } for (i = 0; i < history->length; i++) { value = propval_get_double(msig_history_value_pointer(*history), connection->props.dest_type, i); dest_min = propval_get_double(connection->props.dest_min, connection->props.dest_type, i); dest_max = propval_get_double(connection->props.dest_max, connection->props.dest_type, i); if (dest_min < dest_max) { bound_min = connection->props.bound_min; bound_max = connection->props.bound_max; } else { bound_min = connection->props.bound_max; bound_max = connection->props.bound_min; swap = dest_max; dest_max = dest_min; dest_min = swap; } total_range = fabs(dest_max - dest_min); if (value < dest_min) { switch (bound_min) { case BA_MUTE: // need to prevent value from being sent at all muted = 1; break; case BA_CLAMP: // clamp value to range minimum value = dest_min; break; case BA_FOLD: // fold value around range minimum difference = fabsf(value - dest_min); value = dest_min + difference; if (value > dest_max) { // value now exceeds range maximum! switch (bound_max) { case BA_MUTE: // need to prevent value from being sent at all muted = 1; break; case BA_CLAMP: // clamp value to range minimum value = dest_max; break; case BA_FOLD: // both boundary actions are set to fold! difference = fabsf(value - dest_max); modulo_difference = difference - ((int)(difference / total_range) * total_range); if ((int)(difference / total_range) % 2 == 0) { value = dest_max - modulo_difference; } else value = dest_min + modulo_difference; break; case BA_WRAP: // wrap value back from range minimum difference = fabsf(value - dest_max); modulo_difference = difference - ((int)(difference / total_range) * total_range); value = dest_min + modulo_difference; break; default: break; } } break; case BA_WRAP: // wrap value back from range maximum difference = fabsf(value - dest_min); modulo_difference = difference - (int)(difference / total_range) * total_range; value = dest_max - modulo_difference; break; default: // leave the value unchanged break; } } else if (value > dest_max) { switch (bound_max) { case BA_MUTE: // need to prevent value from being sent at all muted = 1; break; case BA_CLAMP: // clamp value to range maximum value = dest_max; break; case BA_FOLD: // fold value around range maximum difference = fabsf(value - dest_max); value = dest_max - difference; if (value < dest_min) { // value now exceeds range minimum! switch (bound_min) { case BA_MUTE: // need to prevent value from being sent at all muted = 1; break; case BA_CLAMP: // clamp value to range minimum value = dest_min; break; case BA_FOLD: // both boundary actions are set to fold! difference = fabsf(value - dest_min); modulo_difference = difference - ((int)(difference / total_range) * total_range); if ((int)(difference / total_range) % 2 == 0) { value = dest_max + modulo_difference; } else value = dest_min - modulo_difference; break; case BA_WRAP: // wrap value back from range maximum difference = fabsf(value - dest_min); modulo_difference = difference - ((int)(difference / total_range) * total_range); value = dest_max - modulo_difference; break; default: break; } } break; case BA_WRAP: // wrap value back from range minimum difference = fabsf(value - dest_max); modulo_difference = difference - (int)(difference / total_range) * total_range; value = dest_min + modulo_difference; break; default: break; } } propval_set_double(msig_history_value_pointer(*history), connection->props.dest_type, i, value); } return !muted; } /* Helper to replace a connection's expression only if the given string * parses successfully. Returns 0 on success, non-zero on error. */ static int replace_expression_string(mapper_connection c, const char *expr_str, int *input_history_size, int *output_history_size) { mapper_expr expr = mapper_expr_new_from_string( expr_str, c->props.src_type, c->props.dest_type, c->props.src_length, c->props.dest_length); if (!expr) return 1; *input_history_size = mapper_expr_input_history_size(expr); *output_history_size = mapper_expr_output_history_size(expr); if (c->expr) mapper_expr_free(c->expr); c->expr = expr; if (c->props.expression == expr_str) return 0; int len = strlen(expr_str); if (!c->props.expression || len > strlen(c->props.expression)) c->props.expression = realloc(c->props.expression, len+1); /* Using strncpy() here causes memory profiling errors due to possible * overlapping memory (e.g. expr_str == c->props.expression). */ memcpy(c->props.expression, expr_str, len); c->props.expression[len] = '\0'; return 0; } void mapper_connection_set_mode_direct(mapper_connection c) { c->props.mode = MO_BYPASS; reallocate_connection_histories(c, 1, 1); } void mapper_connection_set_mode_linear(mapper_connection c) { int i, len; char expr[256] = ""; const char *e = expr; if (c->props.range_known != CONNECTION_RANGE_KNOWN) return; int min_length = c->props.src_length < c->props.dest_length ? c->props.src_length : c->props.dest_length; double src_min, src_max, dest_min, dest_max; if (c->props.dest_length == c->props.src_length) snprintf(expr, 256, "y=x*"); else if (c->props.dest_length > c->props.src_length) { if (min_length == 1) snprintf(expr, 256, "y[0]=x*"); else snprintf(expr, 256, "y[0:%i]=x*", min_length-1); } else { if (min_length == 1) snprintf(expr, 256, "y=x[0]*"); else snprintf(expr, 256, "y=x[0:%i]*", min_length-1); } if (min_length > 1) { len = strlen(expr); snprintf(expr+len, 256-len, "["); } for (i = 0; i < min_length; i++) { // get multiplier src_min = propval_get_double(c->props.src_min, c->props.src_type, i); src_max = propval_get_double(c->props.src_max, c->props.src_type, i); len = strlen(expr); if (src_min == src_max) snprintf(expr+len, 256-len, "0,"); else { dest_min = propval_get_double(c->props.dest_min, c->props.dest_type, i); dest_max = propval_get_double(c->props.dest_max, c->props.dest_type, i); if ((src_min == dest_min) && (src_max == dest_max)) { snprintf(expr+len, 256-len, "1,"); } else { double scale = ((dest_min - dest_max) / (src_min - src_max)); snprintf(expr+len, 256-len, "%g,", scale); } } } len = strlen(expr); if (min_length > 1) snprintf(expr+len-1, 256-len+1, "]+["); else snprintf(expr+len-1, 256-len+1, "+"); // add offset for (i=0; iprops.src_min, c->props.src_type, i); src_max = propval_get_double(c->props.src_max, c->props.src_type, i); len = strlen(expr); if (src_min == src_max) snprintf(expr+len, 256-len, "%g,", dest_min); else { dest_min = propval_get_double(c->props.dest_min, c->props.dest_type, i); dest_max = propval_get_double(c->props.dest_max, c->props.dest_type, i); if ((src_min == dest_min) && (src_max == dest_max)) { snprintf(expr+len, 256-len, "0,"); } else { double offset = ((dest_max * src_min - dest_min * src_max) / (src_min - src_max)); snprintf(expr+len, 256-len, "%g,", offset); } } } len = strlen(expr); if (min_length > 1) snprintf(expr+len-1, 256-len+1, "]"); else expr[len-1] = '\0'; // If everything is successful, replace the connection's expression. if (e) { int input_history_size, output_history_size; if (!replace_expression_string(c, e, &input_history_size, &output_history_size)) { reallocate_connection_histories(c, 1, 1); c->props.mode = MO_LINEAR; } } } void mapper_connection_set_mode_expression(mapper_connection c, const char *expr) { int input_history_size, output_history_size; if (replace_expression_string(c, expr, &input_history_size, &output_history_size)) return; c->props.mode = MO_EXPRESSION; reallocate_connection_histories(c, input_history_size, output_history_size); /* Special case: if we are the receiver and the new expression * evaluates to a constant we can update immediately. */ /* TODO: should call handler for all instances updated * through this connection. */ mapper_signal sig = c->parent->signal; if (!sig->props.is_output && mapper_expr_constant_output(c->expr) && !c->props.send_as_instance) { int index = 0; mapper_timetag_t now; mapper_clock_now(&sig->device->admin->clock, &now); if (!sig->id_maps[0].instance) index = msig_get_instance_with_local_id(sig, 0, 1, &now); if (index < 0) return; mapper_signal_instance si = sig->id_maps[index].instance; // evaluate expression mapper_signal_history_t h; h.type = sig->props.type; h.value = si->value; h.position = -1; h.length = sig->props.length; h.size = 1; char typestring[h.length]; mapper_expr_evaluate(c->expr, 0, &c->expr_vars[si->index], &h, typestring); // call handler if it exists if (sig->handler) sig->handler(sig, &sig->props, 0, si->value, 1, &now); } } void mapper_connection_set_mode_reverse(mapper_connection c) { c->props.mode = MO_REVERSE; } void mapper_connection_set_mode_calibrate(mapper_connection c) { c->props.mode = MO_CALIBRATE; if (c->props.expression) free(c->props.expression); char expr[256]; int i, len; int min_length = c->props.src_length < c->props.dest_length ? c->props.src_length : c->props.dest_length; if (c->props.dest_length > c->props.src_length) { if (min_length == 1) snprintf(expr, 256, "y[0]="); else snprintf(expr, 256, "y[0:%i]=", min_length-1); } else snprintf(expr, 256, "y="); if (c->props.dest_length > 1) { len = strlen(expr); snprintf(expr+len, 256-len, "["); } if (c->props.dest_type == 'f') { float *temp = (float*)c->props.dest_min; for (i=0; iprops.dest_length; i++) { len = strlen(expr); snprintf(expr+len, 256-len, "%g,", temp[i]); } } else if (c->props.dest_type == 'i') { int *temp = (int*)c->props.dest_min; for (i=0; iprops.dest_length; i++) { len = strlen(expr); snprintf(expr+len, 256-len, "%i,", temp[i]); } } else if (c->props.dest_type == 'd') { double *temp = (double*)c->props.dest_min; for (i=0; iprops.dest_length; i++) { len = strlen(expr); snprintf(expr+len, 256-len, "%g,", temp[i]); } } len = strlen(expr); if (c->props.dest_length > 1) snprintf(expr+len-1, 256-len+1, "]"); else expr[len-1] = '\0'; c->props.expression = strdup(expr); c->calibrating = 0; } /* Helper to check if type is a number. */ static int is_number_type(const char type) { switch (type) { case 'i': return 1; case 'f': return 1; case 'd': return 1; default: return 0; } } /* Helper to fill in the range (src_min, src_max, dest_min, dest_max) * based on message parameters and known connection and signal * properties; return flags to indicate which parts of the range were * found. */ static int set_range(mapper_connection c, mapper_message_t *msg) { lo_arg **args = NULL; const char *types = NULL; int i, length = 0, updated = 0, result; if (!c) return 0; /* The logic here is to first try to use information from the * message, starting with @srcMax, @srcMin, @destMax, @destMin, * and then @min and @max. * Next priority is already-known properties of the connection. * Lastly, we fill in source range from the signal. */ /* @srcMax */ args = mapper_msg_get_param(msg, AT_SRC_MAX); types = mapper_msg_get_type(msg, AT_SRC_MAX); length = mapper_msg_get_length(msg, AT_SRC_MAX); if (args && types && is_number_type(types[0])) { if (length == c->props.src_length) { if (!c->props.src_max) c->props.src_max = calloc(1, length * c->props.src_type); c->props.range_known |= CONNECTION_RANGE_SRC_MAX; for (i=0; iprops.src_max, c->props.src_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_SRC_MAX; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_SRC_MAX; } /* @srcMin */ args = mapper_msg_get_param(msg, AT_SRC_MIN); types = mapper_msg_get_type(msg, AT_SRC_MIN); length = mapper_msg_get_length(msg, AT_SRC_MIN); if (args && types && is_number_type(types[0])) { if (length == c->props.src_length) { if (!c->props.src_min) c->props.src_min = calloc(1, length * c->props.src_type); c->props.range_known |= CONNECTION_RANGE_SRC_MIN; for (i=0; iprops.src_min, c->props.src_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_SRC_MIN; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_SRC_MIN; } /* @destMax */ args = mapper_msg_get_param(msg, AT_DEST_MAX); types = mapper_msg_get_type(msg, AT_DEST_MAX); length = mapper_msg_get_length(msg, AT_DEST_MAX); if (args && types && is_number_type(types[0])) { if (length == c->props.dest_length) { if (!c->props.dest_max) c->props.dest_max = calloc(1, length * c->props.dest_type); c->props.range_known |= CONNECTION_RANGE_DEST_MAX; for (i=0; iprops.dest_max, c->props.dest_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_DEST_MAX; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_DEST_MAX; } /* @destMin */ args = mapper_msg_get_param(msg, AT_DEST_MIN); types = mapper_msg_get_type(msg, AT_DEST_MIN); length = mapper_msg_get_length(msg, AT_DEST_MIN); if (args && types && is_number_type(types[0])) { if (length == c->props.dest_length) { if (!c->props.dest_min) c->props.dest_min = calloc(1, length * c->props.dest_type); c->props.range_known |= CONNECTION_RANGE_DEST_MIN; for (i=0; iprops.dest_min, c->props.dest_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_DEST_MIN; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_DEST_MIN; } /* @min, @max */ if (!(c->props.range_known & CONNECTION_RANGE_DEST_MIN)) { args = mapper_msg_get_param(msg, AT_MIN); types = mapper_msg_get_type(msg, AT_MIN); length = mapper_msg_get_length(msg, AT_MIN); if (args && types && is_number_type(types[0])) { if (length == c->props.dest_length) { if (!c->props.dest_min) c->props.dest_min = calloc(1, length * c->props.dest_type); c->props.range_known |= CONNECTION_RANGE_DEST_MIN; for (i=0; iprops.dest_min, c->props.dest_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_DEST_MIN; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_DEST_MIN; } } if (!(c->props.range_known & CONNECTION_RANGE_DEST_MAX)) { args = mapper_msg_get_param(msg, AT_MAX); types = mapper_msg_get_type(msg, AT_MAX); length = mapper_msg_get_length(msg, AT_MAX); if (args && types && is_number_type(types[0])) { if (length == c->props.dest_length) { if (!c->props.dest_max) c->props.dest_max = calloc(1, length * c->props.dest_type); c->props.range_known |= CONNECTION_RANGE_DEST_MAX; for (i=0; iprops.dest_max, c->props.dest_type, args[i], types[i], i); if (result == -1) { c->props.range_known &= ~CONNECTION_RANGE_DEST_MAX; break; } else updated += result; } } else c->props.range_known &= ~CONNECTION_RANGE_DEST_MAX; } } /* Signal */ mapper_signal sig = c->parent->signal; /* If parent signal is an output it must be the "source" of this connection, * if it is an input it must be the "destination". According to the protocol * for negotiating new connections, we will only fill-in ranges for the * "source" signal.*/ if (!sig || !sig->props.is_output) return updated; if (!c->props.src_min && sig->props.minimum) { c->props.src_min = malloc(msig_vector_bytes(sig)); memcpy(c->props.src_min, sig->props.minimum, msig_vector_bytes(sig)); c->props.range_known |= CONNECTION_RANGE_SRC_MIN; updated++; } if (!c->props.src_max && sig->props.maximum) { c->props.src_max = malloc(msig_vector_bytes(sig)); memcpy(c->props.src_max, sig->props.maximum, msig_vector_bytes(sig)); c->props.range_known |= CONNECTION_RANGE_SRC_MAX; updated++; } return updated; } int mapper_connection_set_from_message(mapper_connection c, mapper_message_t *msg) { int updated = 0; /* First record any provided parameters. */ /* Destination type. */ const char *dest_type = mapper_msg_get_param_if_char(msg, AT_TYPE); if (dest_type && c->props.dest_type != dest_type[0]) { // TODO: need to reinitialize connections using this destination signal c->props.dest_type = dest_type[0]; updated++; } /* Range information. */ updated += set_range(c, msg); if (c->props.range_known == CONNECTION_RANGE_KNOWN && c->props.mode == MO_LINEAR) { mapper_connection_set_mode_linear(c); } /* Muting. */ int muting; if (!mapper_msg_get_param_if_int(msg, AT_MUTE, &muting) && c->props.muted != muting) { c->props.muted = muting; updated++; } /* Range boundary actions. */ int bound_min = mapper_msg_get_boundary_action(msg, AT_BOUND_MIN); if (bound_min >= 0 && c->props.bound_min != bound_min) { c->props.bound_min = bound_min; updated++; } int bound_max = mapper_msg_get_boundary_action(msg, AT_BOUND_MAX); if (bound_max >= 0 && c->props.bound_max != bound_max) { c->props.bound_max = bound_max; updated++; } /* Expression. */ const char *expr = mapper_msg_get_param_if_string(msg, AT_EXPRESSION); if (expr && (!c->props.expression || strcmp(c->props.expression, expr))) { int input_history_size, output_history_size; if (!replace_expression_string(c, expr, &input_history_size, &output_history_size)) { if (c->props.mode == MO_EXPRESSION) { reallocate_connection_histories(c, input_history_size, output_history_size); } } updated++; } /* Instances. */ int send_as_instance; if (!mapper_msg_get_param_if_int(msg, AT_SEND_AS_INSTANCE, &send_as_instance) && c->props.send_as_instance != send_as_instance) { c->props.send_as_instance = send_as_instance; updated++; } /* Extra properties. */ updated += mapper_msg_add_or_update_extra_params(c->props.extra, msg); /* Now set the mode type depending on the requested type and * the known properties. */ int mode = mapper_msg_get_mode(msg); if (mode >= 0 && mode != c->props.mode) updated++; switch (mode) { case -1: /* No mode type specified; if mode not yet set, see if we know the range and choose between linear or direct connection. */ if (c->props.mode == MO_UNDEFINED) { if (c->props.range_known == CONNECTION_RANGE_KNOWN) { /* We have enough information for a linear connection. */ mapper_connection_set_mode_linear(c); } else /* No range, default to direct connection. */ mapper_connection_set_mode_direct(c); } break; case MO_BYPASS: mapper_connection_set_mode_direct(c); break; case MO_LINEAR: if (c->props.range_known == CONNECTION_RANGE_KNOWN) { mapper_connection_set_mode_linear(c); } break; case MO_CALIBRATE: if (c->props.range_known & (CONNECTION_RANGE_DEST_MIN | CONNECTION_RANGE_DEST_MAX)) mapper_connection_set_mode_calibrate(c); break; case MO_EXPRESSION: { if (!c->props.expression) { if (c->props.src_length == c->props.dest_length) c->props.expression = strdup("y=x"); else { char expr[256] = ""; if (c->props.src_length > c->props.dest_length) { // truncate source if (c->props.dest_length == 1) snprintf(expr, 256, "y=x[0]"); else snprintf(expr, 256, "y=x[0:%i]", c->props.dest_length-1); } else { // truncate destination if (c->props.src_length == 1) snprintf(expr, 256, "y[0]=x"); else snprintf(expr, 256, "y[0:%i]=x", c->props.src_length); } c->props.expression = strdup(expr); } } mapper_connection_set_mode_expression(c, c->props.expression); } break; case MO_REVERSE: mapper_connection_set_mode_reverse(c); break; default: trace("unknown result from mapper_msg_get_mode()\n"); break; } return updated; } void reallocate_connection_histories(mapper_connection c, int input_history_size, int output_history_size) { mapper_signal sig = c->parent->signal; int i, j; // At least for now, exit if this is an input signal if (!sig->props.is_output) { return; } // If there is no expression, then no memory needs to be // reallocated. if (!c->expr) return; if (input_history_size < 1) input_history_size = 1; // Reallocate input histories if (input_history_size > c->parent->history_size) { size_t sample_size = msig_vector_bytes(sig); for (i=0; iprops.num_instances; i++) { mhist_realloc(&c->parent->history[i], input_history_size, sample_size, 1); } c->parent->history_size = input_history_size; } else if (input_history_size < c->parent->history_size) { // Do nothing for now... // Find maximum input length needed for connections /*mapper_connection temp = c->parent->connections; while (c) { if (c->props.mode == MO_EXPRESSION) { if (c->expr->input_history_size > input_history_size) { input_history_size = c->expr->input_history_size; } } c = c->next; }*/ } // reallocate output histories if (output_history_size > c->props.dest_history_size) { int sample_size = mapper_type_size(c->props.dest_type) * c->props.dest_length; for (i=0; iprops.num_instances; i++) { mhist_realloc(&c->history[i], output_history_size, sample_size, 0); } c->props.dest_history_size = output_history_size; } else if (output_history_size < mapper_expr_output_history_size(c->expr)) { // Do nothing for now... } // reallocate user variable histories int new_num_vars = mapper_expr_num_variables(c->expr); if (new_num_vars > c->num_expr_vars) { for (i=0; iprops.num_instances; i++) { c->expr_vars[i] = realloc(c->expr_vars[i], new_num_vars * sizeof(struct _mapper_signal_history)); // initialize new variables... for (j=c->num_expr_vars; jexpr_vars[i][j].type = 'd'; c->expr_vars[i][j].length = 0; c->expr_vars[i][j].size = 0; c->expr_vars[i][j].value = 0; c->expr_vars[i][j].timetag = 0; c->expr_vars[i][j].position = -1; } } c->num_expr_vars = new_num_vars; } else if (new_num_vars < c->num_expr_vars) { // Do nothing for now... } for (i=0; iprops.num_instances; i++) { for (j=0; jexpr, j); int vector_length = mapper_expr_variable_vector_length(c->expr, j); mhist_realloc(c->expr_vars[i]+j, history_size, vector_length * sizeof(double), 0); (c->expr_vars[i]+j)->length = vector_length; (c->expr_vars[i]+j)->size = history_size; (c->expr_vars[i]+j)->position = -1; } } } void mhist_realloc(mapper_signal_history_t *history, int history_size, int sample_size, int is_input) { if (!history || !history_size || !sample_size) return; if (history_size == history->size) return; if (!is_input || (history_size > history->size) || (history->position == 0)) { // realloc in place history->value = realloc(history->value, history_size * sample_size); history->timetag = realloc(history->timetag, history_size * sizeof(mapper_timetag_t)); if (!is_input) { // Initialize entire history to 0 memset(history->value, 0, history_size * sample_size); history->position = -1; } else if (history->position == 0) { memset(history->value + sample_size * history->size, 0, sample_size * (history_size - history->size)); } else { int new_position = history_size - history->size + history->position; memcpy(history->value + sample_size * new_position, history->value + sample_size * history->position, sample_size * (history->size - history->position)); memcpy(&history->timetag[new_position], &history->timetag[history->position], sizeof(mapper_timetag_t) * (history->size - history->position)); memset(history->value + sample_size * history->position, 0, sample_size * (history_size - history->size)); } } else { // copying into smaller array if (history->position >= history_size * 2) { // no overlap - memcpy ok int new_position = history_size - history->size + history->position; memcpy(history->value, history->value + sample_size * (new_position - history_size), sample_size * history_size); memcpy(&history->timetag, &history->timetag[history->position - history_size], sizeof(mapper_timetag_t) * history_size); history->value = realloc(history->value, history_size * sample_size); history->timetag = realloc(history->timetag, history_size * sizeof(mapper_timetag_t)); } else { // there is overlap between new and old arrays - need to allocate new memory mapper_signal_history_t temp; temp.value = malloc(sample_size * history_size); temp.timetag = malloc(sizeof(mapper_timetag_t) * history_size); if (history->position < history_size) { memcpy(temp.value, history->value, sample_size * history->position); memcpy(temp.value + sample_size * history->position, history->value + sample_size * (history->size - history_size + history->position), sample_size * (history_size - history->position)); memcpy(temp.timetag, history->timetag, sizeof(mapper_timetag_t) * history->position); memcpy(&temp.timetag[history->position], &history->timetag[history->size - history_size + history->position], sizeof(mapper_timetag_t) * (history_size - history->position)); } else { memcpy(temp.value, history->value + sample_size * (history->position - history_size), sample_size * history_size); memcpy(temp.timetag, &history->timetag[history->position - history_size], sizeof(mapper_timetag_t) * history_size); history->position = history_size - 1; } free(history->value); free(history->timetag); history->value = temp.value; history->timetag = temp.timetag; } } history->size = history_size; } libmapper/Makefile.in0000644000175000017500000007155212423630127014100 0ustar tiagotiago# 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 = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/jni/Mapper/NativeLib.java.in \ $(srcdir)/libmapper.pc.in $(dist_doc_DATA) AUTHORS COPYING \ ChangeLog NEWS README compile config.guess config.sub \ install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = jni/Mapper/NativeLib.java libmapper.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" DATA = $(dist_doc_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir 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@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 include test examples @SWIGDIR@ @JNI@ @DOXYGEN@ extra EXTRA_DIST = libtool ltmain.sh autogen.sh libmapper.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libmapper-@MAJOR_VERSION@.pc dist_doc_DATA = README COPYING ChangeLog NEWS ACLOCAL_AMFLAGS = -I m4 all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): jni/Mapper/NativeLib.java: $(top_builddir)/config.status $(top_srcdir)/jni/Mapper/NativeLib.java.in cd $(top_builddir) && $(SHELL) ./config.status $@ libmapper.pc: $(top_builddir)/config.status $(srcdir)/libmapper.pc.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 install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || 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)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(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) # 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 $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local 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-dist_docDATA install-pkgconfigDATA 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: uninstall-dist_docDATA uninstall-pkgconfigDATA .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 clean-local 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-dist_docDATA 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-pkgconfigDATA 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 uninstall-dist_docDATA uninstall-pkgconfigDATA libmapper-@MAJOR_VERSION@.pc: libmapper.pc @if ! [ -e $@ ]; then cp -v $< $@; fi clean-local: -rm -rf libmapper-@MAJOR_VERSION@.pc # 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: libmapper/config.sub0000755000175000017500000010577512423630127014023 0ustar tiagotiago#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-09-11' # 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 \ | riscv32 | riscv64 \ | 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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; 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* | -moxiebox* \ | -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: libmapper/test/0000755000175000017500000000000012423630127013000 5ustar tiagotiagolibmapper/test/testparser.c0000644000175000017500000004416512423630127015352 0ustar tiagotiago #include <../src/mapper_internal.h> #include #include #include #include #include #include #define DEST_ARRAY_LEN 6 #define MAX_VARS 3 #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; char str[256]; mapper_expr e; int result = 0; int iterations = 1000000; int token_count = 0; int src_int[] = {1, 2, 3}, dest_int[DEST_ARRAY_LEN]; float src_float[] = {1.0f, 2.0f, 3.0f}, dest_float[DEST_ARRAY_LEN]; double src_double[] = {1.0, 2.0, 3.0}, dest_double[DEST_ARRAY_LEN]; double then, now; double total_elapsed_time = 0; char typestring[3]; mapper_timetag_t tt_in = {0, 0}, tt_out = {0, 0}; // signal_history structures mapper_signal_history_t inh, outh, user_vars[MAX_VARS], *user_vars_p; /*! Internal function to get the current time. */ static double get_current_time() { struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; } typedef struct _variable { char *name; int vector_index; int vector_length; char datatype; char casttype; char history_size; char vector_length_locked; char assigned; } mapper_variable_t, *mapper_variable; struct _mapper_expr { void *tokens; void *start; int length; int vector_size; int input_history_size; int output_history_size; mapper_variable variables; int num_variables; int constant_output; }; /* TODO: multiplication by 0 addition/subtraction of 0 division by 0 */ void print_value(char *types, int length, const void *value, int position) { if (!value || !types || length < 1) return; if (length > 1) printf("["); int i, offset = position * length; for (i = 0; i < length; i++) { switch (types[i]) { case 'N': printf("NULL, "); break; case 'f': { float *pf = (float*)value; printf("%g, ", pf[i + offset]); break; } case 'i': { int *pi = (int*)value; printf("%d, ", pi[i + offset]); break; } case 'd': { double *pd = (double*)value; printf("%g, ", pd[i + offset]); break; } default: printf("\nTYPE ERROR\n"); return; } } if (length > 1) printf("\b\b]"); else printf("\b\b"); } void setup_test(char in_type, int in_size, int in_length, void *in_value, char out_type, int out_size, int out_length, void *out_value) { inh.type = in_type; inh.size = in_size; inh.length = in_length; inh.value = in_value; inh.position = 0; inh.timetag = &tt_in; outh.type = out_type; outh.size = out_size; outh.length = out_length; outh.value = out_value; outh.position = -1; outh.timetag = &tt_out; } #define EXPECT_SUCCESS 0 #define EXPECT_FAILURE 1 int parse_and_eval(int expectation) { // clear output arrays int i; for (i = 0; i < DEST_ARRAY_LEN; i++) { dest_int[i] = 0; dest_float[i] = 0.0f; dest_double[i] = 0.0; } eprintf("**********************************\n"); eprintf("Parsing string '%s'\n", str); if (!(e = mapper_expr_new_from_string(str, inh.type, outh.type, inh.length, outh.length))) { eprintf("Parser FAILED.\n"); goto fail; } inh.size = mapper_expr_input_history_size(e); outh.size = mapper_expr_output_history_size(e); if (mapper_expr_num_variables(e) > MAX_VARS) { eprintf("Maximum variables exceeded.\n"); goto fail; } // reallocate variable value histories for (i = 0; i < e->num_variables; i++) { eprintf("user_var[%d]: %p\n", i, &user_vars[i]); mhist_realloc(&user_vars[i], e->variables[i].history_size, sizeof(double), 0); } user_vars_p = user_vars; #ifdef DEBUG if (verbose) { char str[128]; snprintf(str, 128, "Parser returned %d tokens:", e->length); printexpr(str, e); } #endif token_count += e->length; eprintf("Try evaluation once...\n"); if (!mapper_expr_evaluate(e, &inh, &user_vars_p, &outh, typestring)) { eprintf("Evaluation FAILED.\n"); goto fail; } then = get_current_time(); eprintf("Calculate expression %i times... ", iterations); i = iterations-1; while (i--) { mapper_expr_evaluate(e, &inh, &user_vars_p, &outh, typestring); } now = get_current_time(); eprintf("%g seconds.\n", now-then); total_elapsed_time += now-then; if (verbose) { printf("Got: "); print_value(typestring, outh.length, outh.value, outh.position); printf(" \n"); } else printf("."); mapper_expr_free(e); return expectation != EXPECT_SUCCESS; fail: return expectation != EXPECT_FAILURE; } int run_tests() { int result = 0; /* Complex string */ snprintf(str, 256, "y=26*2/2+log10(pi)+2.*pow(2,1*(3+7*.1)*1.1+x{0}[0])*3*4+cos(2.)"); setup_test('f', 1, 1, src_float, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %g\n", 26*2/2+log10f(M_PI)+2.f *powf(2,1*(3+7*.1f)*1.1f+src_float[0])*3*4+cosf(2.0f)); /* Building vectors, conditionals */ snprintf(str, 256, "y=(x>1)?[1,2,3]:[2,4,6]"); setup_test('f', 1, 3, src_float, 'i', 1, 3, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%i, %i, %i]\n", src_float[0]>1?1:2, src_float[1]>1?2:4, src_float[2]>1?3:6); /* Conditionals with shortened syntax */ snprintf(str, 256, "y=x?:123"); setup_test('f', 1, 1, src_float, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", (int)src_float[0]?:123); /* Conditional that should be optimized */ snprintf(str, 256, "y=1?2:123"); setup_test('f', 1, 1, src_float, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: 2\n"); /* Building vectors with variables, operations inside vector-builder */ snprintf(str, 256, "y=[x*-2+1,0]"); setup_test('i', 1, 2, src_int, 'd', 1, 3, dest_double); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g, %g]\n", (double)src_int[0]*-2+1, (double)src_int[1]*-2+1, 0.0); /* Building vectors with variables, operations inside vector-builder */ snprintf(str, 256, "y=[-99.4, -x*1.1+x]"); setup_test('i', 1, 2, src_int, 'd', 1, 3, dest_double); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g, %g]\n", -99.4, (double)(-src_int[0]*1.1+src_int[0]), (double)(-src_int[1]*1.1+src_int[1])); /* Indexing vectors by range */ snprintf(str, 256, "y=x[1:2]+100"); setup_test('d', 1, 3, src_double, 'f', 1, 2, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g]\n", (float)src_double[1]+100, (float)src_double[2]+100); /* Typical linear scaling expression with vectors */ snprintf(str, 256, "y=x*[0.1,3.7,-.1112]+[2,1.3,9000]"); setup_test('f', 1, 3, src_float, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g, %g]\n", src_float[0]*0.1f+2.f, src_float[1]*3.7f+1.3f, src_float[2]*-.1112f+9000.f); /* Check type and vector length promotion of operation sequences */ snprintf(str, 256, "y=1+2*3-4*x"); setup_test('f', 1, 2, src_float, 'f', 1, 2, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g]\n", 1.f+2.f*3.f-4.f*src_float[0], 1.f+2.f*3.f-4.f*src_float[1]); /* Swizzling, more pre-computation */ snprintf(str, 256, "y=[x[2],x[0]]*0+1+12"); setup_test('f', 1, 3, src_float, 'f', 1, 2, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, %g]\n", src_float[2]*0.f+1.f+12.f, src_float[0]*0.f+1.f+12.f); /* Logical negation */ snprintf(str, 256, "y=!(x[1]*0)"); setup_test('d', 1, 3, src_double, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", (int)!(src_double[1]*0)); /* any() */ snprintf(str, 256, "y=any(x-1)"); setup_test('d', 1, 3, src_double, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", ((int)src_double[0]-1)?1:0 | ((int)src_double[1]-1)?1:0 | ((int)src_double[2]-1)?1:0); /* all() */ snprintf(str, 256, "y=x[2]*all(x-1)"); setup_test('d', 1, 3, src_double, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); int temp = ((int)src_double[0]-1)?1:0 & ((int)src_double[1]-1)?1:0 & ((int)src_double[2]-1)?1:0; eprintf("Expected: %i\n", (int)src_double[2] * temp); /* pi and e, extra spaces */ snprintf(str, 256, "y=x + pi - e"); setup_test('d', 1, 1, src_double, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %g\n", (float)(src_double[0]+M_PI-M_E)); /* bad vector notation */ snprintf(str, 256, "y=(x-2)[1]"); setup_test('i', 1, 1, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* vector index outside bounds */ snprintf(str, 256, "y=x[3]"); setup_test('i', 1, 3, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* vector length mismatch */ snprintf(str, 256, "y=x[1:2]"); setup_test('i', 1, 3, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* unnecessary vector notation */ snprintf(str, 256, "y=x+[1]"); setup_test('i', 1, 1, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", src_int[0]+1); /* invalid history index */ snprintf(str, 256, "y=x{-101}"); setup_test('i', 1, 1, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* invalid history index */ snprintf(str, 256, "y=x-y{-101}"); setup_test('i', 1, 1, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* scientific notation */ snprintf(str, 256, "y=x[1]*1.23e-20"); setup_test('i', 1, 2, src_int, 'd', 1, 1, dest_double); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %g\n", (double)src_int[1] * 1.23e-20); /* Vector assignment */ snprintf(str, 256, "y[1]=x[1]"); setup_test('d', 1, 3, src_double, 'i', 1, 3, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [NULL, %i, NULL]\n", (int)src_double[1]); /* Vector assignment */ snprintf(str, 256, "y[1:2]=[x[1],10]"); setup_test('d', 1, 3, src_double, 'i', 1, 3, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [NULL, %i, %i]\n", (int)src_double[1], 10); /* Output vector swizzling */ snprintf(str, 256, "[y[0],y[2]]=x[1:2]"); setup_test('f', 1, 3, src_float, 'd', 1, 3, dest_double); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%g, NULL, %g]\n", (double)src_float[1], (double)src_float[2]); /* Multiple expressions */ snprintf(str, 256, "y[0]=x*100-23.5; y[2]=100-x*6.7"); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* Error check: separating sub-expressions with commas */ snprintf(str, 256, "foo=1, y=y{-1}+foo"); setup_test('i', 1, 1, src_int, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* Initialize filters */ snprintf(str, 256, "y=x+y{-1}; y{-1}=100"); setup_test('i', 1, 1, src_int, 'i', 2, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", src_int[0]*iterations + 100); /* Initialize filters + vector index */ snprintf(str, 256, "y=x+y{-1}; y[1]{-1}=100"); setup_test('i', 1, 2, src_int, 'i', 2, 2, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%i, %i]\n", src_int[0]*iterations, src_int[1]*iterations + 100); /* Initialize filters + vector index */ snprintf(str, 256, "y=x+y{-1}; y{-1}=[100,101]"); setup_test('i', 1, 2, src_int, 'i', 2, 2, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%i, %i]\n", src_int[0]*iterations + 100, src_int[1]*iterations + 101); /* Initialize filters */ snprintf(str, 256, "y=x+y{-1}; y[0]{-1}=100; y[2]{-1}=200"); setup_test('i', 1, 3, src_int, 'i', 2, 3, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [%i, %i, %i]\n", src_int[0]*iterations + 100, src_int[1]*iterations, src_int[2]*iterations + 200); /* Initialize filters */ snprintf(str, 256, "y=x+y{-1}-y{-2}; y{-1}=[100,101]; y{-2}=[100,101]"); setup_test('i', 1, 2, src_int, 'i', 3, 2, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: [1, 2]\n"); /* Only initialize */ snprintf(str, 256, "y{-1}=100"); setup_test('i', 1, 3, src_int, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* Some examples of bad syntax */ snprintf(str, 256, " "); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); snprintf(str, 256, " "); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); snprintf(str, 256, "y"); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); snprintf(str, 256, "y="); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); snprintf(str, 256, "=x"); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); snprintf(str, 256, "sin(x)"); setup_test('i', 1, 1, src_int, 'f', 1, 3, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* Variable declaration */ snprintf(str, 256, "var=3.5; y=x+var"); setup_test('i', 1, 1, src_int, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %g\n", (float)src_int[0] + 3.5); /* Variable declaration */ snprintf(str, 256, "ema=ema{-1}*0.9+x*0.1; y=ema*2; ema{-1}=90"); setup_test('i', 1, 1, src_int, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: 2\n"); /* Malformed variable declaration */ snprintf(str, 256, "y=x + myvariable * 10"); setup_test('i', 1, 1, src_int, 'f', 1, 1, dest_float); result += parse_and_eval(EXPECT_FAILURE); eprintf("Expected: FAILURE\n"); /* Vector functions mean() and sum() */ snprintf(str, 256, "y=mean(x)==(sum(x)/3)"); setup_test('f', 1, 3, src_float, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", 1); /* Overloaded vector functions max() and min() */ snprintf(str, 256, "y=max(x)-min(x)"); setup_test('f', 1, 3, src_float, 'i', 1, 1, dest_int); result += parse_and_eval(EXPECT_SUCCESS); eprintf("Expected: %i\n", ((src_float[0]>src_float[1])? (src_float[0]>src_float[2]?(int)src_float[0]:(int)src_float[2]): (src_float[1]>src_float[2]?(int)src_float[1]:(int)src_float[2])) - ((src_float[0]\n"); return 1; break; case 'q': verbose = 0; break; case '-': if (++j < len && strcmp(argv[i]+j, "num_iterations")==0) if (++i < argc) iterations = atoi(argv[i]); break; default: break; } } } } result = run_tests(); eprintf("**********************************\n"); printf("Test %s ", result ? "FAILED" : "PASSED"); if (!result) printf("in %f seconds using %d tokens in total.\n", total_elapsed_time, token_count); else printf("\n"); } libmapper/test/testcpp.cpp0000644000175000017500000001475712423630127015204 0ustar tiagotiago #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #else #include #endif int received = 0; void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { printf("--> destination got %s", props->name); switch (props->type) { case 'i': { int *v = (int*)value; for (int i = 0; i < props->length; i++) { printf(" %d", v[i]); } break; } case 'f': { float *v = (float*)value; for (int i = 0; i < props->length; i++) { printf(" %f", v[i]); } } case 'd': { double *v = (double*)value; for (int i = 0; i < props->length; i++) { printf(" %f", v[i]); } } default: break; } printf("\n"); } received++; } int main(int argc, char ** argv) { int i = 0, result = 0; mapper::Device dev("mydevice"); mapper::Signal sig = dev.add_input("in1", 1, 'f', "meters", 0, 0, 0, 0); dev.remove_input(sig); dev.add_input("in2", 2, 'i', 0, 0, 0, 0, 0); dev.add_input("in3", 2, 'i', 0, 0, 0, 0, 0); dev.add_input("in4", 2, 'i', 0, 0, 0, insig_handler, 0); dev.add_output("out1", 1, 'f', "na", 0, 0); dev.remove_output("out1"); sig = dev.add_output("out2", 3, 'd', "meters", 0, 0); while (!dev.ready()) { dev.poll(100); } std::cout << "device " << dev.name() << " ready..." << std::endl; std::cout << " ordinal: " << dev.ordinal() << std::endl; std::cout << " id: " << dev.id() << std::endl; std::cout << " interface: " << dev.interface() << std::endl; const struct in_addr* a = dev.ip4(); if (a) std::cout << " host: " << inet_ntoa(*a) << std::endl; std::cout << " port: " << dev.port() << std::endl; std::cout << " num_fds: " << dev.num_fds() << std::endl; std::cout << " num_inputs: " << dev.num_inputs() << std::endl; std::cout << " num_outputs: " << dev.num_outputs() << std::endl; std::cout << " num_links_in: " << dev.num_links_in() << std::endl; std::cout << " num_links_out: " << dev.num_links_out() << std::endl; std::cout << " num_connections_in: " << dev.num_connections_in() << std::endl; std::cout << " num_connections_out: " << dev.num_connections_out() << std::endl; // access properties through the db_device dev.properties().get("name").print(); std::cout << std::endl; int value[] = {1,2,3,4,5,6}; dev.properties().set("foo", value, 6); dev.properties().get("foo").print(); std::cout << std::endl; // can also access properties like this dev.property("name").print(); std::cout << std::endl; // test std::array std::array array1 = {{"one", "two", "three"}}; dev.property("foo").set(array1); dev.property("foo").print(); std::cout << std::endl; // test std::array std::array array2 = {{"four", "five", "six"}}; dev.property("foo").set(array2); dev.property("foo").print(); std::cout << std::endl; // test plain array of const char* const char* array3[3] = {"seven", "eight", "nine"}; dev.property("foo").set(array3, 3); dev.property("foo").print(); std::cout << std::endl; // test std::vector const char *array4[3] = {"ten", "eleven", "twelve"}; std::vector vector1(array4, std::end(array4)); dev.property("foo").set(vector1); dev.property("foo").print(); std::cout << std::endl; // test std::vector const char *array5[3] = {"thirteen", "14", "15"}; std::vector vector2(array5, std::end(array5)); dev.property("foo").set(vector2); dev.property("foo").print(); std::cout << std::endl; mapper::Property p("temp", "tempstring"); dev.properties().set(p); dev.property("temp").print(); std::cout << std::endl; // access property using overloaded index operator dev.properties()["temp"].print(); std::cout << std::endl; dev.properties().remove("foo"); dev.properties().get("foo").print(); std::cout << std::endl; std::cout << "signal " << sig.full_name() << std::endl; for (int i = 0; i < dev.num_inputs(); i++) { std::cout << "input: " << dev.inputs(i).full_name() << std::endl; } mapper::Signal::Iterator iter = dev.inputs().begin(); for (; iter != dev.inputs().end(); iter++) { std::cout << "input: " << (*iter).full_name() << std::endl; } mapper::Monitor mon(SUB_DEVICE_ALL); mon.link(dev.name(), dev.name()); while (dev.num_links_in() <= 0) { dev.poll(100); } mapper::Db::Connection c; c.set_mode(MO_EXPRESSION); c.set_expression("y=x[0:1]+123"); double d[3] = {1., 2., 3.}; c.set_src_min(mapper::Property(0, d, 3)); mon.connect("/mydevice.1/out2", "/mydevice.1/in4", c); while (dev.num_connections_in() <= 0) { dev.poll(100); } std::vector v(3); while (i++ < 100) { dev.poll(10); mon.poll(); v[i%3] = i; sig.update(v); } // check db records std::cout << "db records:" << std::endl; for (auto const &device : mon.db().devices()) { std::cout << " device: "; device.get("name").print(); std::cout << std::endl; } for (auto const &signal : mon.db().inputs()) { std::cout << " input signal: "; signal.get("name").print(); std::cout << std::endl; } for (auto const &signal : mon.db().outputs()) { std::cout << " output signal: "; signal.get("name").print(); std::cout << std::endl; } for (auto const &link : mon.db().links()) { std::cout << " link: "; link.get("src_name").print(); std::cout << " -> "; link.get("dest_name").print(); std::cout << std::endl; } for (auto const &conn : mon.db().connections()) { std::cout << " connection: "; conn.get("src_name").print(); std::cout << " -> "; conn.get("dest_name").print(); std::cout << std::endl; } printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testadmin.c0000644000175000017500000000476312423630127015146 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) mapper_admin my_admin = NULL; mapper_device my_device = NULL; int verbose = 1; int test_admin() { int error = 0, wait; my_admin = mapper_admin_new(0, 0, 0); if (!my_admin) { eprintf("Error creating admin structure.\n"); return 1; } eprintf("Admin structure initialized.\n"); my_device = mdev_new("tester", 0, my_admin); if (!my_device) { eprintf("Error creating device structure.\n"); return 1; } eprintf("Device structure initialized.\n"); eprintf("Found interface %s has IP %s\n", my_admin->interface_name, inet_ntoa(my_admin->interface_ip)); while (!my_device->registered) { usleep(10000); mapper_admin_poll(my_admin); } eprintf("Using port %d.\n", my_device->props.port); eprintf("Allocated ordinal %d.\n", my_device->ordinal.value); eprintf("Delaying for 5 seconds..\n"); wait = 50; while (wait-- > 0) { usleep(50000); mapper_admin_poll(my_admin); if (!verbose) { printf("."); fflush(stdout); } } mdev_free(my_device); eprintf("Device structure freed.\n"); mapper_admin_free(my_admin); eprintf("Admin structure freed.\n"); return error; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testadmin.c: possible arguments " "-q quiet (suppress output), " "-h help\n"); return 1; break; case 'q': verbose = 0; break; default: break; } } } } result = test_admin(); if (result) { printf("Test FAILED.\n"); return 1; } printf("Test PASSED.\n"); return 0; } libmapper/test/testexpression.c0000644000175000017500000001304412423630127016245 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_router router = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; int setup_source() { source = mdev_new("testsend", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=1; sendsig = mdev_add_output(source, "/outsig", 1, 'f', 0, &mn, &mx); eprintf("Output signal /outsig registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { if (router) { eprintf("Removing router.. "); fflush(stdout); mdev_remove_router(source, router); eprintf("ok\n"); } eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("handler: Got %f\n", (*(float*)value)); } received++; } int setup_destination() { destination = mdev_new("testrecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } int setup_connection() { mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_db_connection_t props; props.mode = MO_EXPRESSION; props.expression = "y=x*10"; mapper_monitor_connect(mon, src_name, dest_name, &props, CONNECTION_MODE | CONNECTION_EXPRESSION); // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); return 0; } void wait_ready() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(500 * 1000); } } void loop() { eprintf("Polling device..\n"); int i = 0; while ((!terminate || i < 50) && !done) { mdev_poll(source, 0); eprintf("Updating signal %s to %f\n", sendsig->props.name, (i * 1.0f)); msig_update_float(sendsig, (i * 1.0f)); sent++; mdev_poll(destination, 100); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testexpression.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_ready(); if (autoconnect && setup_connection()) { eprintf("Error setting connection.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testrate.c0000644000175000017500000001614412423630127015005 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int port = 9000; int sent = 0; int received = 0; /*! Creation of a local source. */ int setup_source() { source = mdev_new("testsend", port, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=10; sendsig = mdev_add_output(source, "/outsig", 1, 'f', "Hz", &mn, &mx); // This signal will be updated at 100 Hz msig_set_rate(sendsig, 100); // Check by both methods that the property was set mapper_db_signal props = msig_properties(sendsig); eprintf("Rate for /outsig is set to: %f\n", props->rate); const float *a; char t; int l; if (mapper_db_signal_property_lookup(props, "rate", &t, (const void**)&a, &l)) { eprintf("Couldn't find `rate' property.\n"); mdev_free(source); mdev_free(destination); exit(1); } if (l!=1) { eprintf("Rate property was unexpected length %d\n", l); exit(1); } if (t=='f') eprintf("Rate for /outsig is set to: %f\n", a[0]); else { eprintf("Rate property was unexpected type `%c'\n", t); mdev_free(source); mdev_free(destination); exit(1); } if (props->rate != a[0]) { eprintf("Rate properties don't agree.\n"); mdev_free(source); mdev_free(destination); exit(1); } eprintf("Output signal /outsig registered.\n"); return 0; error: return 1; } void cleanup_source() { if (source) { if (source->routers) { eprintf("Removing router.. "); fflush(stdout); mdev_remove_router(source, source->routers); eprintf("ok\n"); } eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination %s got %i message vector\n[", props->name, count); float *v = value; for (int i = 0; i < count; i++) { for (int j = 0; j < props->length; j++) { eprintf(" %.1f ", v[i*props->length+j]); } } eprintf("]\n"); } received++; } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testrecv", port, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); // This signal is expected to be updated at 100 Hz msig_set_rate(recvsig, 100); eprintf("Input signal /insig registered.\n"); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } int setup_connections() { int i = 0; mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); i = 0; // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } mapper_monitor_free(mon); return 0; } void loop() { int i = 0; float phasor[10]; for (i=0; i<10; i++) phasor[i] = i; i = 0; while ((!terminate || i < 50) && !done) { mdev_poll(source, 0); // 10 times a second, we provide 10 samples, making a // periodically-sampled signal of 100 Hz. eprintf("Sending [%g..%g]...\n", phasor[0], phasor[9]); sent++; msig_update(sendsig, phasor, 10, MAPPER_NOW); int r = mdev_poll(destination, 100); eprintf("Destination got %d message%s.\n", r, r==1?"":"s"); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testrate.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Error initializing source.\n"); result = 1; goto done; } wait_local_devices(); if (autoconnect && setup_connections()) { eprintf("Error connecting signals.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testsignals.c0000644000175000017500000000322412423630127015505 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include mapper_device mdev = 0; mapper_signal inputs[100]; mapper_signal outputs[100]; void sig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { printf("--> destination got %s", props->name); float *v = value; for (int i = 0; i < props->length; i++) { printf(" %f", v[i]); } printf("\n"); } } int main(int argc, char ** argv) { int i, result = 0; char signame[32]; printf("Creating device... "); fflush(stdout); mdev = mdev_new("testsignals", 0, 0); if (!mdev) { result = 1; goto done; } printf("Adding signals... "); fflush(stdout); for (i = 0; i < 100; i++) { mdev_poll(mdev, 100); snprintf(signame, 32, "/s%i", i); if (!(inputs[i] = mdev_add_input(mdev, signame, 1, 'f', 0, 0, 0, sig_handler, 0))) { result = 1; goto done; } if (!(outputs[i] = mdev_add_output(mdev, signame, 1, 'f', 0, 0, 0))) { result = 1; goto done; } } printf("Removing 200 signals...\n"); for (i = 0; i < 100; i++) { mdev_remove_input(mdev, inputs[i]); mdev_remove_output(mdev, outputs[i]); mdev_poll(mdev, 100); } done: if (mdev) mdev_free(mdev); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testmonitor.c0000644000175000017500000002261012423630127015534 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif mapper_monitor mon = 0; mapper_db db = 0; int verbose = 1; int terminate = 0; int done = 0; int update = 0; const int polltime_ms = 100; const char *mode_strings[] = { "undefined", "bypass", "linear", "expression", "calibrate", "reverse" }; const char *bound_strings[] = { "none", "mute", "clamp", "fold", "wrap" }; void dbpause() { // Don't pause normally, but this is left here to be easily // enabled for debugging purposes. // sleep(1); } void printdevice(mapper_db_device dev) { printf(" %s", dev->name); int i=0; const char *key; char type; const void *val; int length; while(!mapper_db_device_property_index(dev, i++, &key, &type, &val, &length)) { die_unless(val!=0, "returned zero value\n"); // already printed this if (strcmp(key, "name")==0) continue; if (strcmp(key, "synced")==0) { // check current time mapper_timetag_t now; mapper_monitor_now(mon, &now); mapper_timetag_t *tt = (mapper_timetag_t *)val; if (tt->sec == 0) printf(", seconds_since_sync=unknown"); else printf(", seconds_since_sync=%f", mapper_timetag_difference(now, *tt)); } else if (length) { printf(", %s=", key); mapper_prop_pp(type, length, val); } } printf("\n"); } void printsignal(mapper_db_signal sig) { printf(" %s name=%s%s", sig->is_output ? "output" : "input", sig->device_name, sig->name); int i=0; const char *key; char type; const void *val; int length; while(!mapper_db_signal_property_index(sig, i++, &key, &type, &val, &length)) { die_unless(val!=0, "returned zero value\n"); // already printed these if (strcmp(key, "device_name")==0 || strcmp(key, "name")==0 || strcmp(key, "direction")==0) continue; if (length) { printf(", %s=", key); mapper_prop_pp(type, length, val); } } printf("\n"); } void printlink(mapper_db_link link) { printf(" %s -> %s", link->src_name, link->dest_name); int i=0; const char *key; char type; const void *val; int length; while(!mapper_db_link_property_index(link, i++, &key, &type, &val, &length)) { die_unless(val!=0, "returned zero value\n"); // already printed these if (strcmp(key, "src_name")==0 || strcmp(key, "dest_name")==0) continue; if (length) { printf(", %s=", key); mapper_prop_pp(type, length, val); } } printf("\n"); } void printconnection(mapper_db_connection con) { printf(" %s -> %s", con->src_name, con->dest_name); int i=0; const char *key; char type; const void *val; int length; while(!mapper_db_connection_property_index(con, i++, &key, &type, &val, &length)) { die_unless(val!=0, "returned zero value\n"); // already printed these if (strcmp(key, "src_name")==0 || strcmp(key, "dest_name")==0) continue; if (length) { printf(", %s=", key); if (strcmp(key, "mode")==0) printf("%s", mode_strings[*((int*)val)]); else if (strncmp(key, "bound", 5)==0) printf("%s", bound_strings[*((int*)val)]); else mapper_prop_pp(type, length, val); } } printf("\n"); } /*! Creation of a local dummy device. */ int setup_monitor() { mon = mapper_monitor_new(0, SUB_DEVICE_ALL); if (!mon) goto error; printf("Monitor created.\n"); db = mapper_monitor_get_db(mon); return 0; error: return 1; } void cleanup_monitor() { if (mon) { printf("\rFreeing monitor.. "); fflush(stdout); mapper_monitor_free(mon); printf("ok\n"); } } void loop() { int i = 0; while ((!terminate || i++ < 200) && !done) { mapper_monitor_poll(mon, 0); usleep(polltime_ms * 1000); if (update++ < 0) continue; update = -10; // clear screen & cursor to home printf("\e[2J\e[0;0H"); fflush(stdout); printf("Registered devices:\n"); mapper_db_device *pdev = mapper_db_get_all_devices(db); while (pdev) { printdevice(*pdev); pdev = mapper_db_device_next(pdev); } printf("------------------------------\n"); printf("Registered signals:\n"); mapper_db_signal *psig = mapper_db_get_all_inputs(db); while (psig) { printsignal(*psig); psig = mapper_db_signal_next(psig); } psig = mapper_db_get_all_outputs(db); while (psig) { printsignal(*psig); psig = mapper_db_signal_next(psig); } printf("------------------------------\n"); printf("Registered links:\n"); mapper_db_link *plink = mapper_db_get_all_links(db); while (plink) { printlink(*plink); plink = mapper_db_link_next(plink); } printf("------------------------------\n"); printf("Registered connections:\n"); mapper_db_connection *pcon = mapper_db_get_all_connections(db); while (pcon) { printconnection(*pcon); pcon = mapper_db_connection_next(pcon); } printf("------------------------------\n"); } } void on_device(mapper_db_device dev, mapper_db_action_t a, void *user) { printf("Device %s ", dev->name); switch (a) { case MDB_NEW: printf("added.\n"); break; case MDB_MODIFY: printf("modified.\n"); break; case MDB_REMOVE: printf("removed.\n"); break; case MDB_UNRESPONSIVE: printf("unresponsive.\n"); mapper_monitor_flush_db(mon, 10, 0); break; } dbpause(); update = 1; } void on_signal(mapper_db_signal sig, mapper_db_action_t a, void *user) { printf("Signal %s%s ", sig->device_name, sig->name); switch (a) { case MDB_NEW: printf("added.\n"); break; case MDB_MODIFY: printf("modified.\n"); break; case MDB_REMOVE: printf("removed.\n"); break; case MDB_UNRESPONSIVE: printf("unresponsive.\n"); break; } dbpause(); update = 1; } void on_connection(mapper_db_connection con, mapper_db_action_t a, void *user) { printf("Connection %s -> %s ", con->src_name, con->dest_name); switch (a) { case MDB_NEW: printf("added.\n"); break; case MDB_MODIFY: printf("modified.\n"); break; case MDB_REMOVE: printf("removed.\n"); break; case MDB_UNRESPONSIVE: printf("unresponsive.\n"); break; } dbpause(); update = 1; } void on_link(mapper_db_link lnk, mapper_db_action_t a, void *user) { printf("Link %s -> %s ", lnk->src_name, lnk->dest_name); switch (a) { case MDB_NEW: printf("added.\n"); break; case MDB_MODIFY: printf("modified.\n"); break; case MDB_REMOVE: printf("removed.\n"); break; case MDB_UNRESPONSIVE: printf("unresponsive.\n"); break; } dbpause(); update = 1; } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testmonitor.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_monitor()) { printf("Error initializing monitor.\n"); result = 1; goto done; } mapper_db_add_device_callback(db, on_device, 0); mapper_db_add_signal_callback(db, on_signal, 0); mapper_db_add_connection_callback(db, on_connection, 0); mapper_db_add_link_callback(db, on_link, 0); loop(); done: mapper_db_remove_device_callback(db, on_device, 0); mapper_db_remove_signal_callback(db, on_signal, 0); mapper_db_remove_connection_callback(db, on_connection, 0); mapper_db_remove_link_callback(db, on_link, 0); cleanup_monitor(); return result; } libmapper/test/testreverse.c0000644000175000017500000001461612423630127015527 0ustar tiagotiago#include "../src/mapper_internal.h" #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig; mapper_signal recvsig; int sent = 0; int received = 0; void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { int i; if (value) { if (props->type == 'f') { eprintf("--> %s got ", props->is_output ? "source" : "destination"); for (i = 0; i < props->length * count; i++) eprintf("%f ", ((float*)value)[i]); eprintf("\n"); } else if (props->type == 'i') { eprintf("--> %s got ", props->is_output ? "source" : "destination"); for (i = 0; i < props->length * count; i++) eprintf("%i ", ((int*)value)[i]); eprintf("\n"); } } else { eprintf("--> %s got ", props->is_output ? "source" : "destination"); for (i = 0; i < props->length * count; i++) eprintf("NIL "); eprintf("\n"); } received++; } /*! Creation of a local source. */ int setup_source() { source = mdev_new("testreverse-send", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn[]={0.f,0.f}, mx[]={10.f,10.f}; sendsig = mdev_add_output(source, "/outsig", 2, 'f', 0, mn, mx); msig_set_callback(sendsig, insig_handler, 0); eprintf("Output signals registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testreverse-recv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } int setup_connections() { int i = 0; mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !destination->receivers) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_db_connection_t props; props.mode = MO_REVERSE; mapper_monitor_connect(mon, src_name, dest_name, &props, CONNECTION_MODE); i = 0; // wait until connection has been established while (!done && !destination->receivers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } mapper_monitor_free(mon); return 0; } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 0; float val[] = {0, 0}; msig_update(sendsig, val, 1, MAPPER_NOW); while ((!terminate || i < 50) && !done) { msig_update_float(recvsig, ((i % 10) * 1.0f)); sent++; eprintf("\ndestination value updated to %f -->\n", (i % 10) * 1.0f); mdev_poll(destination, 0); mdev_poll(source, 100); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testreverse.c: possible arguments" "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Error initializing source.\n"); result = 1; goto done; } wait_local_devices(); if (autoconnect && setup_connections()) { eprintf("Error connecting signals.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testlinear.c0000644000175000017500000001352312423630127015322 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; int setup_source() { source = mdev_new("testsend", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=1; sendsig = mdev_add_output(source, "/outsig", 1, 'f', 0, &mn, &mx); eprintf("Output signal /outsig registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("handler: Got %f\n", (*(float*)value)); } received++; } int setup_destination() { destination = mdev_new("testrecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } int setup_connection() { float src_min = 0., src_max = 1., dest_min = -10., dest_max = 10.; mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); // Wait until link has been established while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_db_connection_t props; props.src_min = &src_min; props.src_max = &src_max; props.dest_min = &dest_min; props.dest_max = &dest_max; props.range_known = CONNECTION_RANGE_KNOWN; props.src_length = 1; props.dest_length = 1; props.src_type = 'f'; props.dest_type = 'f'; props.mode = MO_LINEAR; mapper_monitor_connect(mon, src_name, dest_name, &props, CONNECTION_RANGE_KNOWN | CONNECTION_MODE | CONNECTION_SRC_TYPE | CONNECTION_SRC_LENGTH | CONNECTION_DEST_TYPE | CONNECTION_DEST_LENGTH); // Wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); return 0; } void wait_ready() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(500 * 1000); } } void loop() { eprintf("Polling device..\n"); int i = 0; while ((!terminate || i < 50) && !done) { mdev_poll(source, 0); eprintf("Updating signal %s to %f\n", sendsig->props.name, (i * 1.0f)); msig_update_float(sendsig, (i * 1.0f)); sent++; mdev_poll(destination, 100); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int signal) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testlinear.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_ready(); if (autoconnect && setup_connection()) { eprintf("Error initializing router.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testprops.c0000644000175000017500000004014212423630127015210 0ustar tiagotiago #include #include #include "../src/mapper_internal.h" /* Test to ensure that setting and getting properties of signals and * devices is consistent. */ #define SEEN_DIR 0x0001 #define SEEN_LENGTH 0x0002 #define SEEN_NAME 0x0004 #define SEEN_TYPE 0x0008 #define SEEN_DEVNAME 0x0010 #define SEEN_UNIT 0x0020 #define SEEN_MIN 0x0040 #define SEEN_MAX 0x0080 #define SEEN_X 0x0100 #define SEEN_Y 0x0200 #define SEEN_TEST 0x0400 int verbose = 1; #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) /* Code to return a key's "seen" code, to mark whether we've seen a * value. */ int seen_code(const char *key) { struct { const char *s; int n; } seenvals[] = { { "direction", SEEN_DIR }, { "length", SEEN_LENGTH }, { "name", SEEN_NAME }, { "type", SEEN_TYPE }, { "device_name", SEEN_DEVNAME }, { "unit", SEEN_UNIT }, { "min", SEEN_MIN }, { "max", SEEN_MAX }, { "x", SEEN_X }, { "y", SEEN_Y }, { "test", SEEN_TEST }, }; int i, len = sizeof(seenvals)/sizeof(seenvals[0]); for (i=0; i #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) void timersub(struct timeval *a, struct timeval *b, struct timeval *res) { res->tv_sec = a->tv_sec - b->tv_sec; if (a->tv_usec >= b->tv_usec) res->tv_usec = a->tv_usec - b->tv_usec; else { res->tv_sec--; res->tv_usec = 999999 - b->tv_usec + a->tv_usec; } } #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; /*! Creation of a local source. */ int setup_source() { source = mdev_new("testselect-send", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=10; sendsig = mdev_add_output(source, "/outsig", 1, 'f', "Hz", &mn, &mx); eprintf("Output signal /outsig registered.\n"); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination got %s", props->name); float *v = value; for (int i = 0; i < props->length; i++) { eprintf(" %f", v[i]); } eprintf("\n"); } received++; } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testselect-recv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } int setup_connection() { int count = 0; mapper_monitor mon = mapper_monitor_new(source->admin, 0); if (!mon) goto error; char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { if (count++ > 50) goto error; mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); // wait until connection has been established while (!done && !source->routers->num_connections) { if (count++ > 50) goto error; mdev_poll(source, 10); mdev_poll(destination, 10); } eprintf("Connection established.\n"); mapper_monitor_free(mon); return 0; error: return 1; } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } /* This is where we test the use of select() to wait on multiple * devices at once. */ void select_on_both_devices(int block_ms) { int i, updated = 0; fd_set fdr; int nfds1 = mdev_num_fds(source); int nfds2 = mdev_num_fds(destination); int *fds1 = alloca(sizeof(int)*nfds1); int *fds2 = alloca(sizeof(int)*nfds2); int mfd = -1; nfds1 = mdev_get_fds(source, fds1, nfds1); nfds2 = mdev_get_fds(destination, fds2, nfds2); FD_ZERO(&fdr); for (i = 0; i < nfds1; i++) { FD_SET(fds1[i], &fdr); if (fds1[i] > mfd) mfd = fds1[i]; } for (i = 0; i < nfds2; i++) { FD_SET(fds2[i], &fdr); if (fds2[i] > mfd) mfd = fds2[i]; } struct timeval timeout = { block_ms * 0.001, (block_ms * 1000) % 1000000 }; struct timeval now, then; gettimeofday(&now, NULL); then.tv_sec = now.tv_sec + block_ms * 0.001; then.tv_usec = now.tv_usec + block_ms * 1000; if (then.tv_usec > 1000000) { then.tv_sec++; then.tv_usec %= 1000000; } while (timercmp(&now, &then, <)) { if (select(mfd+1, &fdr, 0, 0, &timeout) > 0) { for (i = 0; i < nfds1; i++) { if (FD_ISSET(fds1[i], &fdr)) mdev_service_fd(source, fds1[i]); } for (i = 0; i < nfds2; i++) { if (FD_ISSET(fds2[i], &fdr)) mdev_service_fd(destination, fds2[i]); } updated ++; } gettimeofday(&now, NULL); // not necessary in Linux since timeout is updated by select() timersub(&then, &now, &timeout); } if (!updated) { /* If nothing happened in 100 ms, we should poll the devices * anyways in case action needs to be taken. */ mdev_poll(source, 0); mdev_poll(destination, 0); } } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 0; while ((!terminate || i < 50) && !done) { msig_update_float(sendsig, ((i % 10) * 1.0f)); eprintf("\nsource value updated to %d -->\n", i % 10); i++; sent++; select_on_both_devices(100); if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testselect.c: possible arguments" "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Error initializing source.\n"); result = 1; goto done; } wait_local_devices(); if (autoconnect && setup_connection()) { eprintf("Error initializing connection.\n"); result = 1; goto done; } loop(); if (sent != received) { result = 1; eprintf("Error: sent %i messages but received %i messages.\n", sent, received); } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/Makefile.in0000644000175000017500000024675012423630127015063 0ustar tiagotiago# 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@ noinst_PROGRAMS = test$(EXEEXT) testadmin$(EXEEXT) testcpp$(EXEEXT) \ testcustomtransport$(EXEEXT) testdb$(EXEEXT) \ testexpression$(EXEEXT) testinstance$(EXEEXT) \ testlinear$(EXEEXT) testmany$(EXEEXT) testmonitor$(EXEEXT) \ testparams$(EXEEXT) testparser$(EXEEXT) testprops$(EXEEXT) \ testqueue$(EXEEXT) testquery$(EXEEXT) testrate$(EXEEXT) \ testrecv$(EXEEXT) testreverse$(EXEEXT) testselect$(EXEEXT) \ testsend$(EXEEXT) testsignals$(EXEEXT) testspeed$(EXEEXT) \ testsync$(EXEEXT) testvector$(EXEEXT) subdir = test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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 = PROGRAMS = $(noinst_PROGRAMS) am_test_OBJECTS = test-test.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) am__DEPENDENCIES_1 = @WINDOWS_DLL_FALSE@am__DEPENDENCIES_2 = $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la \ @WINDOWS_DLL_FALSE@ $(am__DEPENDENCIES_1) @WINDOWS_DLL_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/src/*.lo \ @WINDOWS_DLL_TRUE@ $(am__DEPENDENCIES_1) test_DEPENDENCIES = $(am__DEPENDENCIES_2) 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 = test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testadmin_OBJECTS = testadmin-testadmin.$(OBJEXT) testadmin_OBJECTS = $(am_testadmin_OBJECTS) testadmin_DEPENDENCIES = $(am__DEPENDENCIES_2) testadmin_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testadmin_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testcpp_OBJECTS = testcpp-testcpp.$(OBJEXT) testcpp_OBJECTS = $(am_testcpp_OBJECTS) testcpp_DEPENDENCIES = $(am__DEPENDENCIES_2) testcpp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(testcpp_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testcustomtransport_OBJECTS = \ testcustomtransport-testcustomtransport.$(OBJEXT) testcustomtransport_OBJECTS = $(am_testcustomtransport_OBJECTS) testcustomtransport_DEPENDENCIES = $(am__DEPENDENCIES_2) testcustomtransport_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(testcustomtransport_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_testdb_OBJECTS = testdb-testdb.$(OBJEXT) testdb_OBJECTS = $(am_testdb_OBJECTS) testdb_DEPENDENCIES = $(am__DEPENDENCIES_2) testdb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testdb_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testexpression_OBJECTS = testexpression-testexpression.$(OBJEXT) testexpression_OBJECTS = $(am_testexpression_OBJECTS) testexpression_DEPENDENCIES = $(am__DEPENDENCIES_2) testexpression_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(testexpression_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_testinstance_OBJECTS = testinstance-testinstance.$(OBJEXT) testinstance_OBJECTS = $(am_testinstance_OBJECTS) testinstance_DEPENDENCIES = $(am__DEPENDENCIES_2) testinstance_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testinstance_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testlinear_OBJECTS = testlinear-testlinear.$(OBJEXT) testlinear_OBJECTS = $(am_testlinear_OBJECTS) testlinear_DEPENDENCIES = $(am__DEPENDENCIES_2) testlinear_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testlinear_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testmany_OBJECTS = testmany-testmany.$(OBJEXT) testmany_OBJECTS = $(am_testmany_OBJECTS) testmany_DEPENDENCIES = $(am__DEPENDENCIES_2) testmany_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testmany_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testmonitor_OBJECTS = testmonitor-testmonitor.$(OBJEXT) testmonitor_OBJECTS = $(am_testmonitor_OBJECTS) testmonitor_DEPENDENCIES = $(am__DEPENDENCIES_2) testmonitor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testmonitor_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testparams_OBJECTS = testparams-testparams.$(OBJEXT) testparams_OBJECTS = $(am_testparams_OBJECTS) testparams_DEPENDENCIES = $(am__DEPENDENCIES_2) testparams_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testparams_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testparser_OBJECTS = testparser-testparser.$(OBJEXT) testparser_OBJECTS = $(am_testparser_OBJECTS) testparser_DEPENDENCIES = $(am__DEPENDENCIES_2) testparser_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testparser_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testprops_OBJECTS = testprops-testprops.$(OBJEXT) testprops_OBJECTS = $(am_testprops_OBJECTS) testprops_DEPENDENCIES = $(am__DEPENDENCIES_2) testprops_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testprops_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testquery_OBJECTS = testquery-testquery.$(OBJEXT) testquery_OBJECTS = $(am_testquery_OBJECTS) testquery_DEPENDENCIES = $(am__DEPENDENCIES_2) testquery_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testquery_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testqueue_OBJECTS = testqueue-testqueue.$(OBJEXT) testqueue_OBJECTS = $(am_testqueue_OBJECTS) testqueue_DEPENDENCIES = $(am__DEPENDENCIES_2) testqueue_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testqueue_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testrate_OBJECTS = testrate-testrate.$(OBJEXT) testrate_OBJECTS = $(am_testrate_OBJECTS) testrate_DEPENDENCIES = $(am__DEPENDENCIES_2) testrate_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testrate_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testrecv_OBJECTS = testrecv-testrecv.$(OBJEXT) testrecv_OBJECTS = $(am_testrecv_OBJECTS) testrecv_DEPENDENCIES = $(am__DEPENDENCIES_2) testrecv_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testrecv_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testreverse_OBJECTS = testreverse-testreverse.$(OBJEXT) testreverse_OBJECTS = $(am_testreverse_OBJECTS) testreverse_DEPENDENCIES = $(am__DEPENDENCIES_2) testreverse_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testreverse_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testselect_OBJECTS = testselect-testselect.$(OBJEXT) testselect_OBJECTS = $(am_testselect_OBJECTS) testselect_DEPENDENCIES = $(am__DEPENDENCIES_2) testselect_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testselect_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testsend_OBJECTS = testsend-testsend.$(OBJEXT) testsend_OBJECTS = $(am_testsend_OBJECTS) testsend_DEPENDENCIES = $(am__DEPENDENCIES_2) testsend_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testsend_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testsignals_OBJECTS = testsignals-testsignals.$(OBJEXT) testsignals_OBJECTS = $(am_testsignals_OBJECTS) testsignals_DEPENDENCIES = $(am__DEPENDENCIES_2) testsignals_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testsignals_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testspeed_OBJECTS = testspeed-testspeed.$(OBJEXT) testspeed_OBJECTS = $(am_testspeed_OBJECTS) testspeed_DEPENDENCIES = $(am__DEPENDENCIES_2) testspeed_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testspeed_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testsync_OBJECTS = testsync-testsync.$(OBJEXT) testsync_OBJECTS = $(am_testsync_OBJECTS) testsync_DEPENDENCIES = $(am__DEPENDENCIES_2) testsync_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testsync_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_testvector_OBJECTS = testvector-testvector.$(OBJEXT) testvector_OBJECTS = $(am_testvector_OBJECTS) testvector_DEPENDENCIES = $(am__DEPENDENCIES_2) testvector_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testvector_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 = 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 = SOURCES = $(test_SOURCES) $(testadmin_SOURCES) $(testcpp_SOURCES) \ $(testcustomtransport_SOURCES) $(testdb_SOURCES) \ $(testexpression_SOURCES) $(testinstance_SOURCES) \ $(testlinear_SOURCES) $(testmany_SOURCES) \ $(testmonitor_SOURCES) $(testparams_SOURCES) \ $(testparser_SOURCES) $(testprops_SOURCES) \ $(testquery_SOURCES) $(testqueue_SOURCES) $(testrate_SOURCES) \ $(testrecv_SOURCES) $(testreverse_SOURCES) \ $(testselect_SOURCES) $(testsend_SOURCES) \ $(testsignals_SOURCES) $(testspeed_SOURCES) \ $(testsync_SOURCES) $(testvector_SOURCES) DIST_SOURCES = $(test_SOURCES) $(testadmin_SOURCES) $(testcpp_SOURCES) \ $(testcustomtransport_SOURCES) $(testdb_SOURCES) \ $(testexpression_SOURCES) $(testinstance_SOURCES) \ $(testlinear_SOURCES) $(testmany_SOURCES) \ $(testmonitor_SOURCES) $(testparams_SOURCES) \ $(testparser_SOURCES) $(testprops_SOURCES) \ $(testquery_SOURCES) $(testqueue_SOURCES) $(testrate_SOURCES) \ $(testrecv_SOURCES) $(testreverse_SOURCES) \ $(testselect_SOURCES) $(testsend_SOURCES) \ $(testsignals_SOURCES) $(testspeed_SOURCES) \ $(testsync_SOURCES) $(testvector_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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ TEST_CFLAGS = -Wall -I$(top_srcdir)/include @liblo_CFLAGS@ TEST_CXXFLAGS = -Wall -I$(top_srcdir)/include @liblo_CFLAGS@ @WINDOWS_DLL_FALSE@TEST_LDADD = $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la $(liblo_LIBS) @WINDOWS_DLL_TRUE@TEST_LDADD = $(top_builddir)/src/*.lo $(liblo_LIBS) test_all_ordered = testparams testprops testdb testparser testadmin testmany \ testsend testrecv test testlinear testexpression testqueue \ testquery testrate testinstance testreverse testselect \ testvector testcustomtransport testspeed testsync testcpp test_CFLAGS = $(TEST_CFLAGS) test_SOURCES = test.c test_LDADD = $(TEST_LDADD) testadmin_CFLAGS = $(TEST_CFLAGS) testadmin_SOURCES = testadmin.c testadmin_LDADD = $(TEST_LDADD) testcpp_CXXFLAGS = $(TEST_CXXFLAGS) testcpp_SOURCES = testcpp.cpp testcpp_LDADD = $(TEST_LDADD) testcustomtransport_CFLAGS = $(TEST_CFLAGS) testcustomtransport_SOURCES = testcustomtransport.c testcustomtransport_LDADD = $(TEST_LDADD) testdb_CFLAGS = $(TEST_CFLAGS) testdb_SOURCES = testdb.c testdb_LDADD = $(TEST_LDADD) testexpression_CFLAGS = $(TEST_CFLAGS) testexpression_SOURCES = testexpression.c testexpression_LDADD = $(TEST_LDADD) testinstance_CFLAGS = $(TEST_CFLAGS) testinstance_SOURCES = testinstance.c testinstance_LDADD = $(TEST_LDADD) testlinear_CFLAGS = $(TEST_CFLAGS) testlinear_SOURCES = testlinear.c testlinear_LDADD = $(TEST_LDADD) testmany_CFLAGS = $(TEST_CFLAGS) testmany_SOURCES = testmany.c testmany_LDADD = $(TEST_LDADD) testmonitor_CFLAGS = $(TEST_CFLAGS) testmonitor_SOURCES = testmonitor.c testmonitor_LDADD = $(TEST_LDADD) testparams_CFLAGS = $(TEST_CFLAGS) testparams_SOURCES = testparams.c testparams_LDADD = $(TEST_LDADD) testparser_CFLAGS = $(TEST_CFLAGS) testparser_SOURCES = testparser.c testparser_LDADD = $(TEST_LDADD) testprops_CFLAGS = $(TEST_CFLAGS) testprops_SOURCES = testprops.c testprops_LDADD = $(TEST_LDADD) testqueue_CFLAGS = $(TEST_CFLAGS) testqueue_SOURCES = testqueue.c testqueue_LDADD = $(TEST_LDADD) testquery_CFLAGS = $(TEST_CFLAGS) testquery_SOURCES = testquery.c testquery_LDADD = $(TEST_LDADD) testrate_CFLAGS = $(TEST_CFLAGS) testrate_SOURCES = testrate.c testrate_LDADD = $(TEST_LDADD) testrecv_CFLAGS = $(TEST_CFLAGS) testrecv_SOURCES = testrecv.c testrecv_LDADD = $(TEST_LDADD) testreverse_CFLAGS = $(TEST_CFLAGS) testreverse_SOURCES = testreverse.c testreverse_LDADD = $(TEST_LDADD) testselect_CFLAGS = $(TEST_CFLAGS) testselect_SOURCES = testselect.c testselect_LDADD = $(TEST_LDADD) testsend_CFLAGS = $(TEST_CFLAGS) testsend_SOURCES = testsend.c testsend_LDADD = $(TEST_LDADD) testsignals_CFLAGS = $(TEST_CFLAGS) testsignals_SOURCES = testsignals.c testsignals_LDADD = $(TEST_LDADD) testspeed_CFLAGS = $(TEST_CFLAGS) testspeed_SOURCES = testspeed.c testspeed_LDADD = $(TEST_LDADD) testsync_CFLAGS = $(TEST_CFLAGS) testsync_SOURCES = testsync.c testsync_LDADD = $(TEST_LDADD) testvector_CFLAGS = $(TEST_CFLAGS) testvector_SOURCES = testvector.c testvector_LDADD = $(TEST_LDADD) all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_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 test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) @rm -f test$(EXEEXT) $(AM_V_CCLD)$(test_LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) testadmin$(EXEEXT): $(testadmin_OBJECTS) $(testadmin_DEPENDENCIES) $(EXTRA_testadmin_DEPENDENCIES) @rm -f testadmin$(EXEEXT) $(AM_V_CCLD)$(testadmin_LINK) $(testadmin_OBJECTS) $(testadmin_LDADD) $(LIBS) testcpp$(EXEEXT): $(testcpp_OBJECTS) $(testcpp_DEPENDENCIES) $(EXTRA_testcpp_DEPENDENCIES) @rm -f testcpp$(EXEEXT) $(AM_V_CXXLD)$(testcpp_LINK) $(testcpp_OBJECTS) $(testcpp_LDADD) $(LIBS) testcustomtransport$(EXEEXT): $(testcustomtransport_OBJECTS) $(testcustomtransport_DEPENDENCIES) $(EXTRA_testcustomtransport_DEPENDENCIES) @rm -f testcustomtransport$(EXEEXT) $(AM_V_CCLD)$(testcustomtransport_LINK) $(testcustomtransport_OBJECTS) $(testcustomtransport_LDADD) $(LIBS) testdb$(EXEEXT): $(testdb_OBJECTS) $(testdb_DEPENDENCIES) $(EXTRA_testdb_DEPENDENCIES) @rm -f testdb$(EXEEXT) $(AM_V_CCLD)$(testdb_LINK) $(testdb_OBJECTS) $(testdb_LDADD) $(LIBS) testexpression$(EXEEXT): $(testexpression_OBJECTS) $(testexpression_DEPENDENCIES) $(EXTRA_testexpression_DEPENDENCIES) @rm -f testexpression$(EXEEXT) $(AM_V_CCLD)$(testexpression_LINK) $(testexpression_OBJECTS) $(testexpression_LDADD) $(LIBS) testinstance$(EXEEXT): $(testinstance_OBJECTS) $(testinstance_DEPENDENCIES) $(EXTRA_testinstance_DEPENDENCIES) @rm -f testinstance$(EXEEXT) $(AM_V_CCLD)$(testinstance_LINK) $(testinstance_OBJECTS) $(testinstance_LDADD) $(LIBS) testlinear$(EXEEXT): $(testlinear_OBJECTS) $(testlinear_DEPENDENCIES) $(EXTRA_testlinear_DEPENDENCIES) @rm -f testlinear$(EXEEXT) $(AM_V_CCLD)$(testlinear_LINK) $(testlinear_OBJECTS) $(testlinear_LDADD) $(LIBS) testmany$(EXEEXT): $(testmany_OBJECTS) $(testmany_DEPENDENCIES) $(EXTRA_testmany_DEPENDENCIES) @rm -f testmany$(EXEEXT) $(AM_V_CCLD)$(testmany_LINK) $(testmany_OBJECTS) $(testmany_LDADD) $(LIBS) testmonitor$(EXEEXT): $(testmonitor_OBJECTS) $(testmonitor_DEPENDENCIES) $(EXTRA_testmonitor_DEPENDENCIES) @rm -f testmonitor$(EXEEXT) $(AM_V_CCLD)$(testmonitor_LINK) $(testmonitor_OBJECTS) $(testmonitor_LDADD) $(LIBS) testparams$(EXEEXT): $(testparams_OBJECTS) $(testparams_DEPENDENCIES) $(EXTRA_testparams_DEPENDENCIES) @rm -f testparams$(EXEEXT) $(AM_V_CCLD)$(testparams_LINK) $(testparams_OBJECTS) $(testparams_LDADD) $(LIBS) testparser$(EXEEXT): $(testparser_OBJECTS) $(testparser_DEPENDENCIES) $(EXTRA_testparser_DEPENDENCIES) @rm -f testparser$(EXEEXT) $(AM_V_CCLD)$(testparser_LINK) $(testparser_OBJECTS) $(testparser_LDADD) $(LIBS) testprops$(EXEEXT): $(testprops_OBJECTS) $(testprops_DEPENDENCIES) $(EXTRA_testprops_DEPENDENCIES) @rm -f testprops$(EXEEXT) $(AM_V_CCLD)$(testprops_LINK) $(testprops_OBJECTS) $(testprops_LDADD) $(LIBS) testquery$(EXEEXT): $(testquery_OBJECTS) $(testquery_DEPENDENCIES) $(EXTRA_testquery_DEPENDENCIES) @rm -f testquery$(EXEEXT) $(AM_V_CCLD)$(testquery_LINK) $(testquery_OBJECTS) $(testquery_LDADD) $(LIBS) testqueue$(EXEEXT): $(testqueue_OBJECTS) $(testqueue_DEPENDENCIES) $(EXTRA_testqueue_DEPENDENCIES) @rm -f testqueue$(EXEEXT) $(AM_V_CCLD)$(testqueue_LINK) $(testqueue_OBJECTS) $(testqueue_LDADD) $(LIBS) testrate$(EXEEXT): $(testrate_OBJECTS) $(testrate_DEPENDENCIES) $(EXTRA_testrate_DEPENDENCIES) @rm -f testrate$(EXEEXT) $(AM_V_CCLD)$(testrate_LINK) $(testrate_OBJECTS) $(testrate_LDADD) $(LIBS) testrecv$(EXEEXT): $(testrecv_OBJECTS) $(testrecv_DEPENDENCIES) $(EXTRA_testrecv_DEPENDENCIES) @rm -f testrecv$(EXEEXT) $(AM_V_CCLD)$(testrecv_LINK) $(testrecv_OBJECTS) $(testrecv_LDADD) $(LIBS) testreverse$(EXEEXT): $(testreverse_OBJECTS) $(testreverse_DEPENDENCIES) $(EXTRA_testreverse_DEPENDENCIES) @rm -f testreverse$(EXEEXT) $(AM_V_CCLD)$(testreverse_LINK) $(testreverse_OBJECTS) $(testreverse_LDADD) $(LIBS) testselect$(EXEEXT): $(testselect_OBJECTS) $(testselect_DEPENDENCIES) $(EXTRA_testselect_DEPENDENCIES) @rm -f testselect$(EXEEXT) $(AM_V_CCLD)$(testselect_LINK) $(testselect_OBJECTS) $(testselect_LDADD) $(LIBS) testsend$(EXEEXT): $(testsend_OBJECTS) $(testsend_DEPENDENCIES) $(EXTRA_testsend_DEPENDENCIES) @rm -f testsend$(EXEEXT) $(AM_V_CCLD)$(testsend_LINK) $(testsend_OBJECTS) $(testsend_LDADD) $(LIBS) testsignals$(EXEEXT): $(testsignals_OBJECTS) $(testsignals_DEPENDENCIES) $(EXTRA_testsignals_DEPENDENCIES) @rm -f testsignals$(EXEEXT) $(AM_V_CCLD)$(testsignals_LINK) $(testsignals_OBJECTS) $(testsignals_LDADD) $(LIBS) testspeed$(EXEEXT): $(testspeed_OBJECTS) $(testspeed_DEPENDENCIES) $(EXTRA_testspeed_DEPENDENCIES) @rm -f testspeed$(EXEEXT) $(AM_V_CCLD)$(testspeed_LINK) $(testspeed_OBJECTS) $(testspeed_LDADD) $(LIBS) testsync$(EXEEXT): $(testsync_OBJECTS) $(testsync_DEPENDENCIES) $(EXTRA_testsync_DEPENDENCIES) @rm -f testsync$(EXEEXT) $(AM_V_CCLD)$(testsync_LINK) $(testsync_OBJECTS) $(testsync_LDADD) $(LIBS) testvector$(EXEEXT): $(testvector_OBJECTS) $(testvector_DEPENDENCIES) $(EXTRA_testvector_DEPENDENCIES) @rm -f testvector$(EXEEXT) $(AM_V_CCLD)$(testvector_LINK) $(testvector_OBJECTS) $(testvector_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testadmin-testadmin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcpp-testcpp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcustomtransport-testcustomtransport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdb-testdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testexpression-testexpression.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testinstance-testinstance.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlinear-testlinear.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmany-testmany.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmonitor-testmonitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testparams-testparams.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testparser-testparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testprops-testprops.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testquery-testquery.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testqueue-testqueue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrate-testrate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrecv-testrecv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testreverse-testreverse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testselect-testselect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsend-testsend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsignals-testsignals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testspeed-testspeed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testsync-testsync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testvector-testvector.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 $@ $< test-test.o: test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.o -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test.c' object='test-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) $(test_CFLAGS) $(CFLAGS) -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c test-test.obj: test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.obj -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test.c' object='test-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) $(test_CFLAGS) $(CFLAGS) -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` testadmin-testadmin.o: testadmin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testadmin_CFLAGS) $(CFLAGS) -MT testadmin-testadmin.o -MD -MP -MF $(DEPDIR)/testadmin-testadmin.Tpo -c -o testadmin-testadmin.o `test -f 'testadmin.c' || echo '$(srcdir)/'`testadmin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testadmin-testadmin.Tpo $(DEPDIR)/testadmin-testadmin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testadmin.c' object='testadmin-testadmin.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) $(testadmin_CFLAGS) $(CFLAGS) -c -o testadmin-testadmin.o `test -f 'testadmin.c' || echo '$(srcdir)/'`testadmin.c testadmin-testadmin.obj: testadmin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testadmin_CFLAGS) $(CFLAGS) -MT testadmin-testadmin.obj -MD -MP -MF $(DEPDIR)/testadmin-testadmin.Tpo -c -o testadmin-testadmin.obj `if test -f 'testadmin.c'; then $(CYGPATH_W) 'testadmin.c'; else $(CYGPATH_W) '$(srcdir)/testadmin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testadmin-testadmin.Tpo $(DEPDIR)/testadmin-testadmin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testadmin.c' object='testadmin-testadmin.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) $(testadmin_CFLAGS) $(CFLAGS) -c -o testadmin-testadmin.obj `if test -f 'testadmin.c'; then $(CYGPATH_W) 'testadmin.c'; else $(CYGPATH_W) '$(srcdir)/testadmin.c'; fi` testcustomtransport-testcustomtransport.o: testcustomtransport.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcustomtransport_CFLAGS) $(CFLAGS) -MT testcustomtransport-testcustomtransport.o -MD -MP -MF $(DEPDIR)/testcustomtransport-testcustomtransport.Tpo -c -o testcustomtransport-testcustomtransport.o `test -f 'testcustomtransport.c' || echo '$(srcdir)/'`testcustomtransport.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testcustomtransport-testcustomtransport.Tpo $(DEPDIR)/testcustomtransport-testcustomtransport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcustomtransport.c' object='testcustomtransport-testcustomtransport.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) $(testcustomtransport_CFLAGS) $(CFLAGS) -c -o testcustomtransport-testcustomtransport.o `test -f 'testcustomtransport.c' || echo '$(srcdir)/'`testcustomtransport.c testcustomtransport-testcustomtransport.obj: testcustomtransport.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcustomtransport_CFLAGS) $(CFLAGS) -MT testcustomtransport-testcustomtransport.obj -MD -MP -MF $(DEPDIR)/testcustomtransport-testcustomtransport.Tpo -c -o testcustomtransport-testcustomtransport.obj `if test -f 'testcustomtransport.c'; then $(CYGPATH_W) 'testcustomtransport.c'; else $(CYGPATH_W) '$(srcdir)/testcustomtransport.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testcustomtransport-testcustomtransport.Tpo $(DEPDIR)/testcustomtransport-testcustomtransport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testcustomtransport.c' object='testcustomtransport-testcustomtransport.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) $(testcustomtransport_CFLAGS) $(CFLAGS) -c -o testcustomtransport-testcustomtransport.obj `if test -f 'testcustomtransport.c'; then $(CYGPATH_W) 'testcustomtransport.c'; else $(CYGPATH_W) '$(srcdir)/testcustomtransport.c'; fi` testdb-testdb.o: testdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testdb_CFLAGS) $(CFLAGS) -MT testdb-testdb.o -MD -MP -MF $(DEPDIR)/testdb-testdb.Tpo -c -o testdb-testdb.o `test -f 'testdb.c' || echo '$(srcdir)/'`testdb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdb-testdb.Tpo $(DEPDIR)/testdb-testdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdb.c' object='testdb-testdb.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) $(testdb_CFLAGS) $(CFLAGS) -c -o testdb-testdb.o `test -f 'testdb.c' || echo '$(srcdir)/'`testdb.c testdb-testdb.obj: testdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testdb_CFLAGS) $(CFLAGS) -MT testdb-testdb.obj -MD -MP -MF $(DEPDIR)/testdb-testdb.Tpo -c -o testdb-testdb.obj `if test -f 'testdb.c'; then $(CYGPATH_W) 'testdb.c'; else $(CYGPATH_W) '$(srcdir)/testdb.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testdb-testdb.Tpo $(DEPDIR)/testdb-testdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testdb.c' object='testdb-testdb.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) $(testdb_CFLAGS) $(CFLAGS) -c -o testdb-testdb.obj `if test -f 'testdb.c'; then $(CYGPATH_W) 'testdb.c'; else $(CYGPATH_W) '$(srcdir)/testdb.c'; fi` testexpression-testexpression.o: testexpression.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testexpression_CFLAGS) $(CFLAGS) -MT testexpression-testexpression.o -MD -MP -MF $(DEPDIR)/testexpression-testexpression.Tpo -c -o testexpression-testexpression.o `test -f 'testexpression.c' || echo '$(srcdir)/'`testexpression.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testexpression-testexpression.Tpo $(DEPDIR)/testexpression-testexpression.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testexpression.c' object='testexpression-testexpression.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) $(testexpression_CFLAGS) $(CFLAGS) -c -o testexpression-testexpression.o `test -f 'testexpression.c' || echo '$(srcdir)/'`testexpression.c testexpression-testexpression.obj: testexpression.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testexpression_CFLAGS) $(CFLAGS) -MT testexpression-testexpression.obj -MD -MP -MF $(DEPDIR)/testexpression-testexpression.Tpo -c -o testexpression-testexpression.obj `if test -f 'testexpression.c'; then $(CYGPATH_W) 'testexpression.c'; else $(CYGPATH_W) '$(srcdir)/testexpression.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testexpression-testexpression.Tpo $(DEPDIR)/testexpression-testexpression.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testexpression.c' object='testexpression-testexpression.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) $(testexpression_CFLAGS) $(CFLAGS) -c -o testexpression-testexpression.obj `if test -f 'testexpression.c'; then $(CYGPATH_W) 'testexpression.c'; else $(CYGPATH_W) '$(srcdir)/testexpression.c'; fi` testinstance-testinstance.o: testinstance.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testinstance_CFLAGS) $(CFLAGS) -MT testinstance-testinstance.o -MD -MP -MF $(DEPDIR)/testinstance-testinstance.Tpo -c -o testinstance-testinstance.o `test -f 'testinstance.c' || echo '$(srcdir)/'`testinstance.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testinstance-testinstance.Tpo $(DEPDIR)/testinstance-testinstance.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testinstance.c' object='testinstance-testinstance.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) $(testinstance_CFLAGS) $(CFLAGS) -c -o testinstance-testinstance.o `test -f 'testinstance.c' || echo '$(srcdir)/'`testinstance.c testinstance-testinstance.obj: testinstance.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testinstance_CFLAGS) $(CFLAGS) -MT testinstance-testinstance.obj -MD -MP -MF $(DEPDIR)/testinstance-testinstance.Tpo -c -o testinstance-testinstance.obj `if test -f 'testinstance.c'; then $(CYGPATH_W) 'testinstance.c'; else $(CYGPATH_W) '$(srcdir)/testinstance.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testinstance-testinstance.Tpo $(DEPDIR)/testinstance-testinstance.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testinstance.c' object='testinstance-testinstance.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) $(testinstance_CFLAGS) $(CFLAGS) -c -o testinstance-testinstance.obj `if test -f 'testinstance.c'; then $(CYGPATH_W) 'testinstance.c'; else $(CYGPATH_W) '$(srcdir)/testinstance.c'; fi` testlinear-testlinear.o: testlinear.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testlinear_CFLAGS) $(CFLAGS) -MT testlinear-testlinear.o -MD -MP -MF $(DEPDIR)/testlinear-testlinear.Tpo -c -o testlinear-testlinear.o `test -f 'testlinear.c' || echo '$(srcdir)/'`testlinear.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testlinear-testlinear.Tpo $(DEPDIR)/testlinear-testlinear.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinear.c' object='testlinear-testlinear.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) $(testlinear_CFLAGS) $(CFLAGS) -c -o testlinear-testlinear.o `test -f 'testlinear.c' || echo '$(srcdir)/'`testlinear.c testlinear-testlinear.obj: testlinear.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testlinear_CFLAGS) $(CFLAGS) -MT testlinear-testlinear.obj -MD -MP -MF $(DEPDIR)/testlinear-testlinear.Tpo -c -o testlinear-testlinear.obj `if test -f 'testlinear.c'; then $(CYGPATH_W) 'testlinear.c'; else $(CYGPATH_W) '$(srcdir)/testlinear.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testlinear-testlinear.Tpo $(DEPDIR)/testlinear-testlinear.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testlinear.c' object='testlinear-testlinear.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) $(testlinear_CFLAGS) $(CFLAGS) -c -o testlinear-testlinear.obj `if test -f 'testlinear.c'; then $(CYGPATH_W) 'testlinear.c'; else $(CYGPATH_W) '$(srcdir)/testlinear.c'; fi` testmany-testmany.o: testmany.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testmany_CFLAGS) $(CFLAGS) -MT testmany-testmany.o -MD -MP -MF $(DEPDIR)/testmany-testmany.Tpo -c -o testmany-testmany.o `test -f 'testmany.c' || echo '$(srcdir)/'`testmany.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testmany-testmany.Tpo $(DEPDIR)/testmany-testmany.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmany.c' object='testmany-testmany.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) $(testmany_CFLAGS) $(CFLAGS) -c -o testmany-testmany.o `test -f 'testmany.c' || echo '$(srcdir)/'`testmany.c testmany-testmany.obj: testmany.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testmany_CFLAGS) $(CFLAGS) -MT testmany-testmany.obj -MD -MP -MF $(DEPDIR)/testmany-testmany.Tpo -c -o testmany-testmany.obj `if test -f 'testmany.c'; then $(CYGPATH_W) 'testmany.c'; else $(CYGPATH_W) '$(srcdir)/testmany.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testmany-testmany.Tpo $(DEPDIR)/testmany-testmany.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmany.c' object='testmany-testmany.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) $(testmany_CFLAGS) $(CFLAGS) -c -o testmany-testmany.obj `if test -f 'testmany.c'; then $(CYGPATH_W) 'testmany.c'; else $(CYGPATH_W) '$(srcdir)/testmany.c'; fi` testmonitor-testmonitor.o: testmonitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testmonitor_CFLAGS) $(CFLAGS) -MT testmonitor-testmonitor.o -MD -MP -MF $(DEPDIR)/testmonitor-testmonitor.Tpo -c -o testmonitor-testmonitor.o `test -f 'testmonitor.c' || echo '$(srcdir)/'`testmonitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testmonitor-testmonitor.Tpo $(DEPDIR)/testmonitor-testmonitor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmonitor.c' object='testmonitor-testmonitor.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) $(testmonitor_CFLAGS) $(CFLAGS) -c -o testmonitor-testmonitor.o `test -f 'testmonitor.c' || echo '$(srcdir)/'`testmonitor.c testmonitor-testmonitor.obj: testmonitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testmonitor_CFLAGS) $(CFLAGS) -MT testmonitor-testmonitor.obj -MD -MP -MF $(DEPDIR)/testmonitor-testmonitor.Tpo -c -o testmonitor-testmonitor.obj `if test -f 'testmonitor.c'; then $(CYGPATH_W) 'testmonitor.c'; else $(CYGPATH_W) '$(srcdir)/testmonitor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testmonitor-testmonitor.Tpo $(DEPDIR)/testmonitor-testmonitor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testmonitor.c' object='testmonitor-testmonitor.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) $(testmonitor_CFLAGS) $(CFLAGS) -c -o testmonitor-testmonitor.obj `if test -f 'testmonitor.c'; then $(CYGPATH_W) 'testmonitor.c'; else $(CYGPATH_W) '$(srcdir)/testmonitor.c'; fi` testparams-testparams.o: testparams.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testparams_CFLAGS) $(CFLAGS) -MT testparams-testparams.o -MD -MP -MF $(DEPDIR)/testparams-testparams.Tpo -c -o testparams-testparams.o `test -f 'testparams.c' || echo '$(srcdir)/'`testparams.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testparams-testparams.Tpo $(DEPDIR)/testparams-testparams.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testparams.c' object='testparams-testparams.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) $(testparams_CFLAGS) $(CFLAGS) -c -o testparams-testparams.o `test -f 'testparams.c' || echo '$(srcdir)/'`testparams.c testparams-testparams.obj: testparams.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testparams_CFLAGS) $(CFLAGS) -MT testparams-testparams.obj -MD -MP -MF $(DEPDIR)/testparams-testparams.Tpo -c -o testparams-testparams.obj `if test -f 'testparams.c'; then $(CYGPATH_W) 'testparams.c'; else $(CYGPATH_W) '$(srcdir)/testparams.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testparams-testparams.Tpo $(DEPDIR)/testparams-testparams.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testparams.c' object='testparams-testparams.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) $(testparams_CFLAGS) $(CFLAGS) -c -o testparams-testparams.obj `if test -f 'testparams.c'; then $(CYGPATH_W) 'testparams.c'; else $(CYGPATH_W) '$(srcdir)/testparams.c'; fi` testparser-testparser.o: testparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testparser_CFLAGS) $(CFLAGS) -MT testparser-testparser.o -MD -MP -MF $(DEPDIR)/testparser-testparser.Tpo -c -o testparser-testparser.o `test -f 'testparser.c' || echo '$(srcdir)/'`testparser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testparser-testparser.Tpo $(DEPDIR)/testparser-testparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testparser.c' object='testparser-testparser.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) $(testparser_CFLAGS) $(CFLAGS) -c -o testparser-testparser.o `test -f 'testparser.c' || echo '$(srcdir)/'`testparser.c testparser-testparser.obj: testparser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testparser_CFLAGS) $(CFLAGS) -MT testparser-testparser.obj -MD -MP -MF $(DEPDIR)/testparser-testparser.Tpo -c -o testparser-testparser.obj `if test -f 'testparser.c'; then $(CYGPATH_W) 'testparser.c'; else $(CYGPATH_W) '$(srcdir)/testparser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testparser-testparser.Tpo $(DEPDIR)/testparser-testparser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testparser.c' object='testparser-testparser.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) $(testparser_CFLAGS) $(CFLAGS) -c -o testparser-testparser.obj `if test -f 'testparser.c'; then $(CYGPATH_W) 'testparser.c'; else $(CYGPATH_W) '$(srcdir)/testparser.c'; fi` testprops-testprops.o: testprops.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testprops_CFLAGS) $(CFLAGS) -MT testprops-testprops.o -MD -MP -MF $(DEPDIR)/testprops-testprops.Tpo -c -o testprops-testprops.o `test -f 'testprops.c' || echo '$(srcdir)/'`testprops.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testprops-testprops.Tpo $(DEPDIR)/testprops-testprops.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testprops.c' object='testprops-testprops.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) $(testprops_CFLAGS) $(CFLAGS) -c -o testprops-testprops.o `test -f 'testprops.c' || echo '$(srcdir)/'`testprops.c testprops-testprops.obj: testprops.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testprops_CFLAGS) $(CFLAGS) -MT testprops-testprops.obj -MD -MP -MF $(DEPDIR)/testprops-testprops.Tpo -c -o testprops-testprops.obj `if test -f 'testprops.c'; then $(CYGPATH_W) 'testprops.c'; else $(CYGPATH_W) '$(srcdir)/testprops.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testprops-testprops.Tpo $(DEPDIR)/testprops-testprops.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testprops.c' object='testprops-testprops.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) $(testprops_CFLAGS) $(CFLAGS) -c -o testprops-testprops.obj `if test -f 'testprops.c'; then $(CYGPATH_W) 'testprops.c'; else $(CYGPATH_W) '$(srcdir)/testprops.c'; fi` testquery-testquery.o: testquery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testquery_CFLAGS) $(CFLAGS) -MT testquery-testquery.o -MD -MP -MF $(DEPDIR)/testquery-testquery.Tpo -c -o testquery-testquery.o `test -f 'testquery.c' || echo '$(srcdir)/'`testquery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testquery-testquery.Tpo $(DEPDIR)/testquery-testquery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testquery.c' object='testquery-testquery.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) $(testquery_CFLAGS) $(CFLAGS) -c -o testquery-testquery.o `test -f 'testquery.c' || echo '$(srcdir)/'`testquery.c testquery-testquery.obj: testquery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testquery_CFLAGS) $(CFLAGS) -MT testquery-testquery.obj -MD -MP -MF $(DEPDIR)/testquery-testquery.Tpo -c -o testquery-testquery.obj `if test -f 'testquery.c'; then $(CYGPATH_W) 'testquery.c'; else $(CYGPATH_W) '$(srcdir)/testquery.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testquery-testquery.Tpo $(DEPDIR)/testquery-testquery.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testquery.c' object='testquery-testquery.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) $(testquery_CFLAGS) $(CFLAGS) -c -o testquery-testquery.obj `if test -f 'testquery.c'; then $(CYGPATH_W) 'testquery.c'; else $(CYGPATH_W) '$(srcdir)/testquery.c'; fi` testqueue-testqueue.o: testqueue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testqueue_CFLAGS) $(CFLAGS) -MT testqueue-testqueue.o -MD -MP -MF $(DEPDIR)/testqueue-testqueue.Tpo -c -o testqueue-testqueue.o `test -f 'testqueue.c' || echo '$(srcdir)/'`testqueue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testqueue-testqueue.Tpo $(DEPDIR)/testqueue-testqueue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testqueue.c' object='testqueue-testqueue.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) $(testqueue_CFLAGS) $(CFLAGS) -c -o testqueue-testqueue.o `test -f 'testqueue.c' || echo '$(srcdir)/'`testqueue.c testqueue-testqueue.obj: testqueue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testqueue_CFLAGS) $(CFLAGS) -MT testqueue-testqueue.obj -MD -MP -MF $(DEPDIR)/testqueue-testqueue.Tpo -c -o testqueue-testqueue.obj `if test -f 'testqueue.c'; then $(CYGPATH_W) 'testqueue.c'; else $(CYGPATH_W) '$(srcdir)/testqueue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testqueue-testqueue.Tpo $(DEPDIR)/testqueue-testqueue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testqueue.c' object='testqueue-testqueue.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) $(testqueue_CFLAGS) $(CFLAGS) -c -o testqueue-testqueue.obj `if test -f 'testqueue.c'; then $(CYGPATH_W) 'testqueue.c'; else $(CYGPATH_W) '$(srcdir)/testqueue.c'; fi` testrate-testrate.o: testrate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testrate_CFLAGS) $(CFLAGS) -MT testrate-testrate.o -MD -MP -MF $(DEPDIR)/testrate-testrate.Tpo -c -o testrate-testrate.o `test -f 'testrate.c' || echo '$(srcdir)/'`testrate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testrate-testrate.Tpo $(DEPDIR)/testrate-testrate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testrate.c' object='testrate-testrate.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) $(testrate_CFLAGS) $(CFLAGS) -c -o testrate-testrate.o `test -f 'testrate.c' || echo '$(srcdir)/'`testrate.c testrate-testrate.obj: testrate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testrate_CFLAGS) $(CFLAGS) -MT testrate-testrate.obj -MD -MP -MF $(DEPDIR)/testrate-testrate.Tpo -c -o testrate-testrate.obj `if test -f 'testrate.c'; then $(CYGPATH_W) 'testrate.c'; else $(CYGPATH_W) '$(srcdir)/testrate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testrate-testrate.Tpo $(DEPDIR)/testrate-testrate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testrate.c' object='testrate-testrate.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) $(testrate_CFLAGS) $(CFLAGS) -c -o testrate-testrate.obj `if test -f 'testrate.c'; then $(CYGPATH_W) 'testrate.c'; else $(CYGPATH_W) '$(srcdir)/testrate.c'; fi` testrecv-testrecv.o: testrecv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testrecv_CFLAGS) $(CFLAGS) -MT testrecv-testrecv.o -MD -MP -MF $(DEPDIR)/testrecv-testrecv.Tpo -c -o testrecv-testrecv.o `test -f 'testrecv.c' || echo '$(srcdir)/'`testrecv.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testrecv-testrecv.Tpo $(DEPDIR)/testrecv-testrecv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testrecv.c' object='testrecv-testrecv.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) $(testrecv_CFLAGS) $(CFLAGS) -c -o testrecv-testrecv.o `test -f 'testrecv.c' || echo '$(srcdir)/'`testrecv.c testrecv-testrecv.obj: testrecv.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testrecv_CFLAGS) $(CFLAGS) -MT testrecv-testrecv.obj -MD -MP -MF $(DEPDIR)/testrecv-testrecv.Tpo -c -o testrecv-testrecv.obj `if test -f 'testrecv.c'; then $(CYGPATH_W) 'testrecv.c'; else $(CYGPATH_W) '$(srcdir)/testrecv.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testrecv-testrecv.Tpo $(DEPDIR)/testrecv-testrecv.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testrecv.c' object='testrecv-testrecv.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) $(testrecv_CFLAGS) $(CFLAGS) -c -o testrecv-testrecv.obj `if test -f 'testrecv.c'; then $(CYGPATH_W) 'testrecv.c'; else $(CYGPATH_W) '$(srcdir)/testrecv.c'; fi` testreverse-testreverse.o: testreverse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testreverse_CFLAGS) $(CFLAGS) -MT testreverse-testreverse.o -MD -MP -MF $(DEPDIR)/testreverse-testreverse.Tpo -c -o testreverse-testreverse.o `test -f 'testreverse.c' || echo '$(srcdir)/'`testreverse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testreverse-testreverse.Tpo $(DEPDIR)/testreverse-testreverse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreverse.c' object='testreverse-testreverse.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) $(testreverse_CFLAGS) $(CFLAGS) -c -o testreverse-testreverse.o `test -f 'testreverse.c' || echo '$(srcdir)/'`testreverse.c testreverse-testreverse.obj: testreverse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testreverse_CFLAGS) $(CFLAGS) -MT testreverse-testreverse.obj -MD -MP -MF $(DEPDIR)/testreverse-testreverse.Tpo -c -o testreverse-testreverse.obj `if test -f 'testreverse.c'; then $(CYGPATH_W) 'testreverse.c'; else $(CYGPATH_W) '$(srcdir)/testreverse.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testreverse-testreverse.Tpo $(DEPDIR)/testreverse-testreverse.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testreverse.c' object='testreverse-testreverse.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) $(testreverse_CFLAGS) $(CFLAGS) -c -o testreverse-testreverse.obj `if test -f 'testreverse.c'; then $(CYGPATH_W) 'testreverse.c'; else $(CYGPATH_W) '$(srcdir)/testreverse.c'; fi` testselect-testselect.o: testselect.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testselect_CFLAGS) $(CFLAGS) -MT testselect-testselect.o -MD -MP -MF $(DEPDIR)/testselect-testselect.Tpo -c -o testselect-testselect.o `test -f 'testselect.c' || echo '$(srcdir)/'`testselect.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testselect-testselect.Tpo $(DEPDIR)/testselect-testselect.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testselect.c' object='testselect-testselect.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) $(testselect_CFLAGS) $(CFLAGS) -c -o testselect-testselect.o `test -f 'testselect.c' || echo '$(srcdir)/'`testselect.c testselect-testselect.obj: testselect.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testselect_CFLAGS) $(CFLAGS) -MT testselect-testselect.obj -MD -MP -MF $(DEPDIR)/testselect-testselect.Tpo -c -o testselect-testselect.obj `if test -f 'testselect.c'; then $(CYGPATH_W) 'testselect.c'; else $(CYGPATH_W) '$(srcdir)/testselect.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testselect-testselect.Tpo $(DEPDIR)/testselect-testselect.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testselect.c' object='testselect-testselect.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) $(testselect_CFLAGS) $(CFLAGS) -c -o testselect-testselect.obj `if test -f 'testselect.c'; then $(CYGPATH_W) 'testselect.c'; else $(CYGPATH_W) '$(srcdir)/testselect.c'; fi` testsend-testsend.o: testsend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsend_CFLAGS) $(CFLAGS) -MT testsend-testsend.o -MD -MP -MF $(DEPDIR)/testsend-testsend.Tpo -c -o testsend-testsend.o `test -f 'testsend.c' || echo '$(srcdir)/'`testsend.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsend-testsend.Tpo $(DEPDIR)/testsend-testsend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsend.c' object='testsend-testsend.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) $(testsend_CFLAGS) $(CFLAGS) -c -o testsend-testsend.o `test -f 'testsend.c' || echo '$(srcdir)/'`testsend.c testsend-testsend.obj: testsend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsend_CFLAGS) $(CFLAGS) -MT testsend-testsend.obj -MD -MP -MF $(DEPDIR)/testsend-testsend.Tpo -c -o testsend-testsend.obj `if test -f 'testsend.c'; then $(CYGPATH_W) 'testsend.c'; else $(CYGPATH_W) '$(srcdir)/testsend.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsend-testsend.Tpo $(DEPDIR)/testsend-testsend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsend.c' object='testsend-testsend.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) $(testsend_CFLAGS) $(CFLAGS) -c -o testsend-testsend.obj `if test -f 'testsend.c'; then $(CYGPATH_W) 'testsend.c'; else $(CYGPATH_W) '$(srcdir)/testsend.c'; fi` testsignals-testsignals.o: testsignals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsignals_CFLAGS) $(CFLAGS) -MT testsignals-testsignals.o -MD -MP -MF $(DEPDIR)/testsignals-testsignals.Tpo -c -o testsignals-testsignals.o `test -f 'testsignals.c' || echo '$(srcdir)/'`testsignals.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsignals-testsignals.Tpo $(DEPDIR)/testsignals-testsignals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsignals.c' object='testsignals-testsignals.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) $(testsignals_CFLAGS) $(CFLAGS) -c -o testsignals-testsignals.o `test -f 'testsignals.c' || echo '$(srcdir)/'`testsignals.c testsignals-testsignals.obj: testsignals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsignals_CFLAGS) $(CFLAGS) -MT testsignals-testsignals.obj -MD -MP -MF $(DEPDIR)/testsignals-testsignals.Tpo -c -o testsignals-testsignals.obj `if test -f 'testsignals.c'; then $(CYGPATH_W) 'testsignals.c'; else $(CYGPATH_W) '$(srcdir)/testsignals.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsignals-testsignals.Tpo $(DEPDIR)/testsignals-testsignals.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsignals.c' object='testsignals-testsignals.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) $(testsignals_CFLAGS) $(CFLAGS) -c -o testsignals-testsignals.obj `if test -f 'testsignals.c'; then $(CYGPATH_W) 'testsignals.c'; else $(CYGPATH_W) '$(srcdir)/testsignals.c'; fi` testspeed-testspeed.o: testspeed.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testspeed_CFLAGS) $(CFLAGS) -MT testspeed-testspeed.o -MD -MP -MF $(DEPDIR)/testspeed-testspeed.Tpo -c -o testspeed-testspeed.o `test -f 'testspeed.c' || echo '$(srcdir)/'`testspeed.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testspeed-testspeed.Tpo $(DEPDIR)/testspeed-testspeed.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testspeed.c' object='testspeed-testspeed.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) $(testspeed_CFLAGS) $(CFLAGS) -c -o testspeed-testspeed.o `test -f 'testspeed.c' || echo '$(srcdir)/'`testspeed.c testspeed-testspeed.obj: testspeed.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testspeed_CFLAGS) $(CFLAGS) -MT testspeed-testspeed.obj -MD -MP -MF $(DEPDIR)/testspeed-testspeed.Tpo -c -o testspeed-testspeed.obj `if test -f 'testspeed.c'; then $(CYGPATH_W) 'testspeed.c'; else $(CYGPATH_W) '$(srcdir)/testspeed.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testspeed-testspeed.Tpo $(DEPDIR)/testspeed-testspeed.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testspeed.c' object='testspeed-testspeed.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) $(testspeed_CFLAGS) $(CFLAGS) -c -o testspeed-testspeed.obj `if test -f 'testspeed.c'; then $(CYGPATH_W) 'testspeed.c'; else $(CYGPATH_W) '$(srcdir)/testspeed.c'; fi` testsync-testsync.o: testsync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsync_CFLAGS) $(CFLAGS) -MT testsync-testsync.o -MD -MP -MF $(DEPDIR)/testsync-testsync.Tpo -c -o testsync-testsync.o `test -f 'testsync.c' || echo '$(srcdir)/'`testsync.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsync-testsync.Tpo $(DEPDIR)/testsync-testsync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsync.c' object='testsync-testsync.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) $(testsync_CFLAGS) $(CFLAGS) -c -o testsync-testsync.o `test -f 'testsync.c' || echo '$(srcdir)/'`testsync.c testsync-testsync.obj: testsync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsync_CFLAGS) $(CFLAGS) -MT testsync-testsync.obj -MD -MP -MF $(DEPDIR)/testsync-testsync.Tpo -c -o testsync-testsync.obj `if test -f 'testsync.c'; then $(CYGPATH_W) 'testsync.c'; else $(CYGPATH_W) '$(srcdir)/testsync.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testsync-testsync.Tpo $(DEPDIR)/testsync-testsync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testsync.c' object='testsync-testsync.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) $(testsync_CFLAGS) $(CFLAGS) -c -o testsync-testsync.obj `if test -f 'testsync.c'; then $(CYGPATH_W) 'testsync.c'; else $(CYGPATH_W) '$(srcdir)/testsync.c'; fi` testvector-testvector.o: testvector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testvector_CFLAGS) $(CFLAGS) -MT testvector-testvector.o -MD -MP -MF $(DEPDIR)/testvector-testvector.Tpo -c -o testvector-testvector.o `test -f 'testvector.c' || echo '$(srcdir)/'`testvector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testvector-testvector.Tpo $(DEPDIR)/testvector-testvector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testvector.c' object='testvector-testvector.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) $(testvector_CFLAGS) $(CFLAGS) -c -o testvector-testvector.o `test -f 'testvector.c' || echo '$(srcdir)/'`testvector.c testvector-testvector.obj: testvector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testvector_CFLAGS) $(CFLAGS) -MT testvector-testvector.obj -MD -MP -MF $(DEPDIR)/testvector-testvector.Tpo -c -o testvector-testvector.obj `if test -f 'testvector.c'; then $(CYGPATH_W) 'testvector.c'; else $(CYGPATH_W) '$(srcdir)/testvector.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testvector-testvector.Tpo $(DEPDIR)/testvector-testvector.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testvector.c' object='testvector-testvector.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) $(testvector_CFLAGS) $(CFLAGS) -c -o testvector-testvector.obj `if test -f 'testvector.c'; then $(CYGPATH_W) 'testvector.c'; else $(CYGPATH_W) '$(srcdir)/testvector.c'; fi` .cpp.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 $@ $< .cpp.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) '$<'` .cpp.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 $@ $< testcpp-testcpp.o: testcpp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcpp_CXXFLAGS) $(CXXFLAGS) -MT testcpp-testcpp.o -MD -MP -MF $(DEPDIR)/testcpp-testcpp.Tpo -c -o testcpp-testcpp.o `test -f 'testcpp.cpp' || echo '$(srcdir)/'`testcpp.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testcpp-testcpp.Tpo $(DEPDIR)/testcpp-testcpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testcpp.cpp' object='testcpp-testcpp.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcpp_CXXFLAGS) $(CXXFLAGS) -c -o testcpp-testcpp.o `test -f 'testcpp.cpp' || echo '$(srcdir)/'`testcpp.cpp testcpp-testcpp.obj: testcpp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcpp_CXXFLAGS) $(CXXFLAGS) -MT testcpp-testcpp.obj -MD -MP -MF $(DEPDIR)/testcpp-testcpp.Tpo -c -o testcpp-testcpp.obj `if test -f 'testcpp.cpp'; then $(CYGPATH_W) 'testcpp.cpp'; else $(CYGPATH_W) '$(srcdir)/testcpp.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testcpp-testcpp.Tpo $(DEPDIR)/testcpp-testcpp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testcpp.cpp' object='testcpp-testcpp.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(testcpp_CXXFLAGS) $(CXXFLAGS) -c -o testcpp-testcpp.obj `if test -f 'testcpp.cpp'; then $(CYGPATH_W) 'testcpp.cpp'; else $(CYGPATH_W) '$(srcdir)/testcpp.cpp'; 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 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) 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: 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-generic clean-libtool clean-noinstPROGRAMS \ 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: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS 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 \ tags tags-am uninstall uninstall-am tests: all for i in $(test_all_ordered); do echo Running $$i; if ! ./$$i -qt; then exit 1; fi; done echo Running testmonitor and testsignals; ./testmonitor -t & ./testsignals memtest: all for i in $(noinst_PROGRAMS); do echo Running $$i; if ! LD_PRELOAD=/usr/local/lib/libmapper-0.2.dylib valgrind --leakcheck=full ./.libs/$$i -qt; then exit 1; fi; done # 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: libmapper/test/testinstance.c0000644000175000017500000002067312423630127015660 0ustar tiagotiago#include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int iterations = 100; int autoconnect = 1; int automate = 1; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; int done = 0; /*! Creation of a local source. */ int setup_source() { source = mdev_new("testInstanceSend", 0, 0); if (!source) goto error; float mn=0, mx=10; sendsig = mdev_add_poly_output(source, "/outsig", 1, 'f', 0, &mn, &mx, 10); if (!sendsig) goto error; eprintf("Output signal added with %i instances.\n", msig_num_active_instances(sendsig) + msig_num_reserved_instances(sendsig)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination %s instance %ld got %f\n", props->name, (long)instance_id, (*(float*)value)); received++; } else { eprintf("--> destination %s instance %ld got NULL\n", props->name, (long)instance_id); msig_release_instance(sig, instance_id, MAPPER_NOW); } } void more_handler(mapper_signal sig, mapper_db_signal props, int instance_id, msig_instance_event_t event, mapper_timetag_t *timetag) { if (event & IN_OVERFLOW) { eprintf("OVERFLOW!! ALLOCATING ANOTHER INSTANCE.\n"); msig_reserve_instances(sig, 1, 0, 0); } else if (event & IN_UPSTREAM_RELEASE) { eprintf("UPSTREAM RELEASE!! RELEASING LOCAL INSTANCE.\n"); msig_release_instance(sig, instance_id, MAPPER_NOW); } } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testInstanceRecv", 0, 0); if (!destination) goto error; float mn=0;//, mx=1; // Specify 0 instances since we wich to use specific ids recvsig = mdev_add_poly_input(destination, "/insig", 1, 'f', 0, &mn, 0, 0, insig_handler, 0); if (!recvsig) goto error; int i; for (i=100; i<104; i++) { msig_reserve_instances(recvsig, 1, &i, 0); } eprintf("Input signal added with %i instances.\n", msig_num_active_instances(recvsig) + msig_num_reserved_instances(recvsig)); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } void print_instance_ids(mapper_signal sig) { int i, n = msig_num_active_instances(sig); eprintf("active %s: [", sig->props.name); for (i=0; iadmin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_db_connection_t props; props.expression = "foo=1; y=y{-1}+foo"; props.mode = MO_BYPASS; mapper_monitor_connect(mon, src_name, dest_name, &props, CONNECTION_MODE | CONNECTION_EXPRESSION); // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 0, j = 0; float value = 0; while (i < iterations && !done) { // here we should create, update and destroy some instances switch (rand() % 5) { case 0: // try to destroy an instance j = rand() % 10; eprintf("--> Retiring sender instance %i\n", j); msig_release_instance(sendsig, j, MAPPER_NOW); break; default: j = rand() % 10; // try to update an instance value = (rand() % 10) * 1.0f; msig_update_instance(sendsig, j, &value, 0, MAPPER_NOW); eprintf("--> sender instance %d updated to %f\n", j, value); sent++; break; } print_instance_ids(sendsig); print_instance_ids(recvsig); eprintf("\n"); mdev_poll(destination, 100); mdev_poll(source, 0); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0, stats[6]; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testinstance.c: possible arguments " "-q quiet (suppress output), " "-h help\n"); return 1; break; case 'q': verbose = 0; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_local_devices(); if (automate) connect_signals(); eprintf("\n**********************************************\n"); eprintf("************ NO INSTANCE STEALING ************\n"); loop(); stats[0] = sent; stats[1] = received; for (i=0; i<10; i++) msig_release_instance(sendsig, i, MAPPER_NOW); sent = received = 0; msig_set_instance_allocation_mode(recvsig, IN_STEAL_OLDEST); eprintf("\n**********************************************\n"); eprintf("************ STEAL OLDEST INSTANCE ***********\n"); if (!verbose) printf("\n"); loop(); stats[2] = sent; stats[3] = received; sent = received = 0; for (i=0; i<10; i++) msig_release_instance(sendsig, i, MAPPER_NOW); sent = received = 0; msig_set_instance_event_callback(recvsig, more_handler, IN_OVERFLOW | IN_UPSTREAM_RELEASE, 0); eprintf("\n**********************************************\n"); eprintf("*********** CALLBACK -> ADD INSTANCE *********\n"); if (!verbose) printf("\n"); loop(); stats[4] = sent; stats[5] = received; eprintf("NO STEALING: sent %i updates, received %i updates (mismatch is OK).\n", stats[0], stats[1]); eprintf("STEAL OLDEST: sent %i updates, received %i updates (mismatch is OK).\n", stats[2], stats[3]); eprintf("ADD INSTANCE: sent %i updates, received %i updates.\n", stats[4], stats[5]); result = (stats[4] != stats[5]); done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testvector.c0000644000175000017500000001300112423630127015341 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; int setup_source() { source = mdev_new("testsend", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn[]={0,0,0}, mx[]={1,2,3}; sendsig = mdev_add_output(source, "/outsig", 3, 'f', 0, &mn, &mx); eprintf("Output signal /outsig registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { float *f = value; eprintf("handler: Got [%f, %f, %f]\n", f[0], f[1], f[2]); } received++; } int setup_destination() { destination = mdev_new("testrecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn[]={0,0,0}, mx[]={1,1,1}; recvsig = mdev_add_input(destination, "/insig", 3, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } int setup_connections() { int i = 0; mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); // wait until link has been established while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); // wait until connection has been established i = 0; while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } mapper_monitor_free(mon); return 0; } void wait_ready() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(500 * 1000); } } void loop() { eprintf("Polling device..\n"); int i = 0; while ((!terminate || i < 50) && !done) { mdev_poll(source, 0); float v[3]; v[0] = (float)i; v[1] = (float)i+1; v[2] = (float)i+2; eprintf("Updating signal %s to [%f, %f, %f]\n", sendsig->props.name, v[0], v[1], v[2]); msig_update(sendsig, v, 1, MAPPER_NOW); sent++; mdev_poll(destination, 100); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testvector.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_ready(); if (autoconnect && setup_connections()) { eprintf("Error connecting signals.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testrecv.c0000644000175000017500000000724212423630127015010 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; int sent = 0; int received = 0; lo_address a = NULL; void handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("handler: Got %f\n", (*(float*)value)); } received++; if (!verbose) { printf("\r Received: %4i", received); fflush(stdout); } } int test_recv() { mapper_device md = mdev_new("synth", 0, 0); if (!md) goto error; eprintf("Mapper device created.\n"); float mn=0, mx=1; mapper_signal sig = mdev_add_input(md, "/mapped1", 1, 'f', 0, &mn, &mx, handler, 0); eprintf("Input signal /mapped1 registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(md)); eprintf("Waiting for port/ordinal allocation..\n"); int i; for (i = 0; i < 10; i++) { mdev_poll(md, 500); if (mdev_ready(md)) break; usleep(500 * 1000); } if (i >= 10) { eprintf("Timed out waiting for signal name.\n"); goto error; } char port[10]; sprintf(port, "%i", md->props.port); eprintf("using port = %s\n", port); a = lo_address_new("localhost", port); if (!a) { eprintf("Error creating lo_address for test.\n"); goto error; } eprintf("Polling device..\n"); i = 0; while ((!terminate || i < 50) && !done) { lo_send(a, sig->props.name, "f", (float) i); eprintf("Updating signal %s to %f\n", sig->props.name, (float) i); sent++; mdev_poll(md, 100); i++; } if (sent != received) { eprintf("Not all sent values were received.\n"); eprintf("Sent %d values, but %d received.\n", sent, received); goto error; } if (sent == 0) { eprintf("Unable to send any values.\n"); goto error; } eprintf("Sent and received %d values.\n", sent); mdev_free(md); lo_address_free(a); return 0; error: if (md) mdev_free(md); if (a) lo_address_free(a); return 1; } void ctrlc(int signal) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testrecv.c: possible arguments" "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (test_recv()) { result = 1; goto done; } done: printf(" Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testqueue.c0000644000175000017500000001376212423630127015201 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; int done = 0; mapper_device source = 0; mapper_device destination = 0; mapper_router router = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; mapper_signal sendsig1 = 0; mapper_signal recvsig1 = 0; int port = 9000; int sent = 0; int received = 0; int setup_source() { source = mdev_new("testsend", port, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=1; sendsig = mdev_add_output(source, "/outsig", 1, 'f', 0, &mn, &mx); sendsig1= mdev_add_output(source, "/outsig1", 1, 'f', 0, &mn, &mx); eprintf("Output signal /outsig registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { if (router) { eprintf("Removing router.. "); fflush(stdout); mdev_remove_router(source, router); eprintf("ok\n"); } eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("handler: Got %f\n", (*(float*)value)); } received++; } int setup_destination() { destination = mdev_new("testrecv", port, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); recvsig1= mdev_add_input(destination, "/insig1", 1, 'f', 0, &mn, &mx, insig_handler, 0); eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } int create_connections() { mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); msig_full_name(sendsig1, src_name, 1024); msig_full_name(recvsig1, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); return 0; } void wait_ready() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(500 * 1000); } } void loop() { eprintf("Polling device..\n"); int i = 0; float j=1; while ((!terminate || i < 50) && !done) { j=i; mapper_timetag_t now; mdev_now(source, &now); mdev_start_queue(source, now); mdev_poll(source, 0); eprintf("Updating signal %s to %f\n", sendsig->props.name, j); msig_update(sendsig, &j, 0, now); msig_update(sendsig1, &j, 0, now); mdev_send_queue(sendsig->device, now); sent = sent+2; mdev_poll(destination, 100); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testqueue.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_ready(); if (autoconnect && create_connections()) { eprintf("Error creating connections.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent messages were received.\n"); eprintf("Updated value %d time%s, but received %d of them.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testparams.c0000644000175000017500000000751112423630127015333 0ustar tiagotiago #include #include #include #include "../src/types_internal.h" #include "../src/mapper_internal.h" int verbose = 1; #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int main(int argc, char **argv) { lo_arg *args[20], **a; mapper_message_t msg; int port=1234, src_length=4; float r[4] = {1.0, 2.0, -15.0, 25.0}; int i, j, result = 0; // process flags for -v verbose, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testdb.c: possible arguments " "-q quiet (suppress output), " "-h help\n"); return 1; break; case 'q': verbose = 0; break; default: break; } } } } eprintf("1: expected success\n"); args[0] = (lo_arg*)"@IP"; args[1] = (lo_arg*)"127.0.0.1"; args[2] = (lo_arg*)"@srcMin"; args[3] = (lo_arg*)&r[0]; args[4] = (lo_arg*)&r[1]; args[5] = (lo_arg*)&r[2]; args[6] = (lo_arg*)&r[3]; args[7] = (lo_arg*)"@port"; args[8] = (lo_arg*)&port; args[9] = (lo_arg*)"@srcType"; args[10] = (lo_arg*)"f"; args[11] = (lo_arg*)"@srcLength"; args[12] = (lo_arg*)&src_length; int rc = mapper_msg_parse_params(&msg, "/test", "sssffffsiscsi", 13, args); if (rc) { eprintf("1: Error parsing.\n"); result = 1; goto done; } a = mapper_msg_get_param(&msg, AT_IP); if (!a) { eprintf("1: Could not get @IP param.\n"); result = 1; goto done; } if (strcmp(&(*a)->s, "127.0.0.1")!=0) result |= 1; eprintf("1: @IP = \"%s\" %s\n", &(*a)->s, result ? "WRONG" : "(correct)"); if (result) goto done; a = mapper_msg_get_param(&msg, AT_PORT); if (!a) { eprintf("1: Could not get @port param.\n"); result = 1; goto done; } if ((*a)->i!=1234) result |= 1; eprintf("1: @port = %d %s\n", (*a)->i, result ? "WRONG" : "(correct)"); if (result) goto done; a = mapper_msg_get_param(&msg, AT_SRC_MIN); int count = mapper_msg_get_length(&msg, AT_SRC_MIN); if (!a) { eprintf("1: Could not get @src_min param.\n"); result = 1; goto done; } if (count != 4) { eprintf("1: Wrong count returned for @scr_min param.\n"); } for (i=0; if!=r[i]) result = 1; eprintf("1: @src_min[%d] = %f %s\n", i, a[i]->f, result ? "WRONG" : "(correct)"); if (result) goto done; } /*****/ eprintf("2: deliberately malformed message\n"); args[0] = (lo_arg*)"@port"; args[1] = (lo_arg*)&port; args[2] = (lo_arg*)"@IP"; rc = mapper_msg_parse_params(&msg, "/test", "sis", 3, args); if (rc) { eprintf("2: Error parsing.\n"); result = 1; goto done; } a = mapper_msg_get_param(&msg, AT_PORT); if (!a) { eprintf("2: Could not get @port param.\n"); result = 1; goto done; } a = mapper_msg_get_param(&msg, AT_IP); if (a) { eprintf("2: Error, should not have been able to retrieve @IP param.\n"); result = 1; goto done; } /*****/ done: if (!verbose) printf(".................................................."); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testcustomtransport.c0000644000175000017500000002764112423630127017345 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int autoconnect = 1; int terminate = 0; int iterations = 50; // only matters when terminate==1 int verbose = 1; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int sent = 0; int received = 0; int done = 0; // Our sending socket for a custom TCP transport // We only send on it if it's valid (i.e, != -1) int send_socket = -1; // Our receiving socket for a custom TCP transport int recv_socket = -1; // Our listening socket for accepting TCP transport connections. int listen_socket = -1; int tcp_port = 12000; void on_mdev_link(mapper_device dev, mapper_db_link link, mapper_device_local_action_t action, void *user) { eprintf("%s link for %s (%s -> %s), ", action == MDEV_LOCAL_ESTABLISHED ? "New" : action == MDEV_LOCAL_DESTROYED ? "Destroyed" : "????", mdev_name(dev), link->src_name, link->dest_name); eprintf("destination host is %s, port is %i\n", link->dest_host, link->dest_port); } void on_mdev_connection(mapper_device dev, mapper_db_link link, mapper_signal sig, mapper_db_connection connection, mapper_device_local_action_t action, void *user) { eprintf("%s connection for %s (%s:%s -> %s:%s), ", action == MDEV_LOCAL_ESTABLISHED ? "New" : action == MDEV_LOCAL_DESTROYED ? "Destroyed" : "????", mdev_name(dev), link->src_name, connection->src_name, link->dest_name, connection->dest_name); eprintf("destination host is %s, port is %i\n", link->dest_host, link->dest_port); if (action == MDEV_LOCAL_DESTROYED) { if (send_socket != -1) { close(send_socket); send_socket = -1; } } else if (send_socket != -1) { eprintf("send socket already in use, not doing anything.\n"); return; } const char *a_transport; char t; int length; if (mapper_db_connection_property_lookup(connection, "transport", &t, (const void **)&a_transport, &length) || t != 's' || length != 1) { eprintf("Couldn't find `transport' property.\n"); return; } if (strncmp(a_transport, "tcp", 3) != 0) { eprintf("Unknown transport property `%s', " "was expecting `tcp'.\n", a_transport); return; } // Find the TCP port in the connection properties const int *a_port; if (mapper_db_connection_property_lookup(connection, "tcpPort", &t, (const void **)&a_port, &length) || t != 'i' || length != 1) { eprintf("Couldn't make TCP connection, " "tcpPort property not found.\n"); return; } int port = *a_port, on = 1; send_socket = socket(AF_INET, SOCK_STREAM, 0); // Set socket to be non-blocking so that accept() is successful if (ioctl(send_socket, FIONBIO, (char *)&on) < 0) { perror("ioctl() failed on FIONBIO"); close(send_socket); exit(1); } const char *host = link->dest_host; eprintf("Connecting with TCP to `%s' on port %d.\n", host, port); struct sockaddr_in addr; memset((char *) &addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(host); addr.sin_port = htons(port); if (connect(send_socket, (struct sockaddr*)&addr, sizeof(addr))) { if (errno == EINPROGRESS) eprintf("Connecting!\n"); else { perror("connect"); close(send_socket); send_socket = -1; return; } } } /*! Creation of a local source. */ int setup_source() { source = mdev_new("testsend", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mn=0, mx=10; mdev_set_link_callback(source, on_mdev_link, 0); mdev_set_connection_callback(source, on_mdev_connection, 0); sendsig = mdev_add_output(source, "/outsig", 1, 'f', "Hz", &mn, &mx); // Add custom meta-data specifying that this signal supports a // special TCP transport. char *str = "tcp"; msig_set_property(sendsig, "transport", 's', &str, 1); eprintf("Output signal /outsig registered.\n"); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination got %s", props->name); float *v = value; for (int i = 0; i < props->length; i++) { eprintf(" %f", v[i]); } eprintf("\n"); } received++; } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testrecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn=0, mx=1; recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, &mn, &mx, insig_handler, 0); // Add custom meta-data specifying a special transport for this // signal. char *str = "tcp"; msig_set_property(recvsig, "transport", 's', &str, 1); // Add custom meta-data specifying a port to use for this signal's // custom transport. msig_set_property(recvsig, "tcpPort", 'i', &tcp_port, 1); eprintf("Input signal /insig registered.\n"); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 0; if (autoconnect) { mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (i++ < 10) { mdev_poll(source, 0); mdev_poll(destination, 0); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); mapper_monitor_free(mon); } // Set up a mini TCP server for our custom stream listen_socket = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in addr; memset((char *) &addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(tcp_port); if (bind(listen_socket, (struct sockaddr *) &addr, sizeof(addr)) < 0 ) { perror("bind"); close(listen_socket); exit(1); } eprintf("Bound to TCP port %d\n", tcp_port); listen(listen_socket, 1); while ((!terminate || received < iterations) && !done) { mdev_poll(source, 0); // Instead of // msig_update_float(sendsig, ((i % 10) * 1.0f)); // We will instead send our data on the custom TCP socket if // it is valid if (send_socket != -1) { int m = listen_socket; fd_set fdsr, fdss; FD_ZERO(&fdsr); FD_ZERO(&fdss); FD_SET(listen_socket, &fdsr); if (recv_socket >= 0) { FD_SET(recv_socket, &fdsr); if (recv_socket > m) m = recv_socket; } if (send_socket >= 0) { FD_SET(send_socket, &fdss); if (send_socket > m) m = send_socket; } struct timeval timeout = { .tv_sec = 0, .tv_usec = 0 }; if (select(m+1, &fdsr, &fdss, 0, &timeout) > 0) { if (FD_ISSET(listen_socket, &fdsr)) { recv_socket = accept(listen_socket, 0, 0); if (recv_socket < 0) perror("accept"); else eprintf("TCP connection accepted.\n"); } if (recv_socket >= 0 && FD_ISSET(recv_socket, &fdsr)) { float j; if (recv(recv_socket, &j, sizeof(float), 0) > 0) { eprintf("received value %g\n", j); received++; } else { perror("recv"); eprintf("closing receive socket.\n"); close(recv_socket); recv_socket = -1; } } if (FD_ISSET(send_socket, &fdss) && (!terminate || sent < iterations)) { float j = (i % 10) * 1.0f; if (send(send_socket, &j, sizeof(float), 0) > 0) { eprintf("source value updated to %g -->\n", j); sent++; } else { perror("send"); eprintf("closing send socket.\n"); close(send_socket); send_socket = -1; } } } } if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } mdev_poll(destination, 100); i++; } if (send_socket != -1) close(send_socket); } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testcustomtransport.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_local_devices(); loop(); if (autoconnect && received != sent) { eprintf("sent: %d, recvd: %d\n", sent, received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testspeed.c0000644000175000017500000001614612423630127015154 0ustar tiagotiago#include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #include #include #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ else \ fprintf(stdout, "."); \ fflush(stdout); \ } while(0) int verbose = 1; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig = 0; mapper_signal recvsig = 0; int numTrials = 10; int trial = 0; int numModes = 2; int mode = 0; int use_instance = 1; int iterations = 100000; int counter = 0; int received = 0; int done = 0; double times[100]; float value; void switch_modes(); void print_results(); /*! Internal function to get the current time. */ static double get_current_time() { struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; } /*! Creation of a local source. */ int setup_source() { source = mdev_new("testSpeedSend", 0, 0); if (!source) goto error; eprintf("source created.\n"); sendsig = mdev_add_output(source, "/outsig", 1, 'f', 0, 0, 0); if (!sendsig) goto error; msig_reserve_instances(sendsig, 9, 0, 0); eprintf("Output signal registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { counter = (counter+1)%10; if (++received >= iterations) switch_modes(); if (use_instance) { msig_update_instance(sendsig, counter, value, 1, MAPPER_NOW); } else msig_update(sendsig, value, 1, MAPPER_NOW); } else eprintf("--> destination %s instance %ld got NULL\n", props->name, (long)instance_id); } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testSpeedRecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); recvsig = mdev_add_input(destination, "/insig", 1, 'f', 0, 0, 0, insig_handler, 0); if (!recvsig) goto error; msig_reserve_instances(recvsig, 9, 0, 0); eprintf("Input signal registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 25); mdev_poll(destination, 25); } } void connect_signals() { mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig, src_name, 1024); msig_full_name(recvsig, dest_name, 1024); mapper_db_connection_t props; props.expression = "y=y{-1}+1"; props.mode = MO_EXPRESSION; mapper_monitor_connect(mon, src_name, dest_name, &props, CONNECTION_MODE | CONNECTION_EXPRESSION); // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); } void ctrlc(int sig) { done = 1; } void switch_modes() { int i; // possible modes: bypass/expression/calibrate, boundary actions, instances, instance-stealing eprintf("MODE %i TRIAL %i COMPLETED...\n", mode, trial); received = 0; times[mode*numTrials+trial] = get_current_time() - times[mode*numTrials+trial]; if (++trial >= numTrials) { eprintf("SWITCHING MODES...\n"); trial = 0; mode++; } if (mode >= numModes) { done = 1; return; } switch (mode) { case 0: use_instance = 1; break; case 1: use_instance = 0; for (i=1; i<10; i++) { msig_release_instance(sendsig, i, MAPPER_NOW); } break; } times[mode*numTrials+trial] = get_current_time(); } void print_results() { int i, j; printf("\n*****************************************************\n"); printf("\nRESULTS OF SPEED TEST:\n"); for (i=0; i #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig_1 = 0; mapper_signal recvsig_1 = 0; mapper_signal sendsig_2 = 0; mapper_signal recvsig_2 = 0; mapper_signal sendsig_3 = 0; mapper_signal recvsig_3 = 0; mapper_signal sendsig_4 = 0; mapper_signal recvsig_4 = 0; int sent = 0; int received = 0; int done = 0; int verbose = 1; int terminate = 0; int autoconnect = 1; /*! Creation of a local source. */ int setup_source() { source = mdev_new("testsend", 0, 0); if (!source) goto error; eprintf("source created.\n"); float mnf[]={3.2,2,0}, mxf[]={-2,13,100}; double mnd=0, mxd=10; sendsig_1 = mdev_add_output(source, "/outsig_1", 1, 'd', "Hz", &mnd, &mxd); sendsig_2 = mdev_add_output(source, "/outsig_2", 1, 'f', "mm", mnf, mxf); sendsig_3 = mdev_add_output(source, "/outsig_3", 3, 'f', 0, mnf, mxf); sendsig_4 = mdev_add_output(source, "/outsig_4", 1, 'f', 0, mnf, mxf); eprintf("Output signal /outsig registered.\n"); // Make sure we can add and remove outputs without crashing. mdev_remove_output(source, mdev_add_output(source, "/outsig_5", 1, 'f', 0, &mnf, &mxf)); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination got %s", props->name); if (props->type == 'f') { float *v = value; for (int i = 0; i < props->length; i++) { eprintf(" %f", v[i]); } } else if (props->type == 'd') { double *v = value; for (int i = 0; i < props->length; i++) { eprintf(" %f", v[i]); } } eprintf("\n"); } received++; } /*! Creation of a local destination. */ int setup_destination() { destination = mdev_new("testrecv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mnf[]={0,0,0}, mxf[]={1,1,1}; double mnd=0, mxd=1; recvsig_1 = mdev_add_input(destination, "/insig_1", 1, 'f', 0, mnf, mxf, insig_handler, 0); recvsig_2 = mdev_add_input(destination, "/insig_2", 1, 'd', 0, &mnd, &mxd, insig_handler, 0); recvsig_3 = mdev_add_input(destination, "/insig_3", 3, 'f', 0, mnf, mxf, insig_handler, 0); recvsig_4 = mdev_add_input(destination, "/insig_4", 1, 'f', 0, mnf, mxf, insig_handler, 0); eprintf("Input signal /insig registered.\n"); // Make sure we can add and remove inputs and inputs within crashing. mdev_remove_input(destination, mdev_add_input(destination, "/insig_5", 1, 'f', 0, &mnf, &mxf, 0, 0)); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 0, recvd; if (autoconnect) { mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); while (!source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); } msig_full_name(sendsig_1, src_name, 1024); msig_full_name(recvsig_1, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); msig_full_name(sendsig_2, src_name, 1024); msig_full_name(recvsig_2, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); msig_full_name(sendsig_3, src_name, 1024); msig_full_name(recvsig_3, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); msig_full_name(recvsig_4, dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); } mapper_monitor_free(mon); } i = 0; float val[3]; while ((!terminate || i < 50) && !done) { mdev_poll(source, 0); msig_update_double(sendsig_1, ((i % 10) * 1.0f)); eprintf("/outsig_1 value updated to %d -->\n", i % 10); msig_update_float(sendsig_2, ((i % 10) * 1.0f)); eprintf("/outsig_2 value updated to %d -->\n", i % 10); val[0] = val[1] = val[2] = (i % 10) * 1.0f; msig_update(sendsig_3, val, 1, MAPPER_NOW); eprintf("/outsig_3 value updated to [%f,%f,%f] -->\n", val[0], val[1], val[2]); msig_update_float(sendsig_4, ((i % 10) * 1.0f)); eprintf("/outsig_4 value updated to %d -->\n", i % 10); eprintf("Sent %i messages.\n", 4); sent += 4; recvd = mdev_poll(destination, 100); eprintf("Received %i messages.\n\n", recvd); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char ** argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("test.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_local_devices(); loop(); if (autoconnect && received != sent) { eprintf("sent: %d, recvd: %d\n", sent, received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testdb.c0000644000175000017500000005721712423630127014445 0ustar tiagotiago #include #include #include #include "../src/types_internal.h" #include "../src/mapper_internal.h" #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; void printsignal(mapper_db_signal sig) { int i; eprintf(" name=%s%s, type=%c, length=%d", sig->device_name, sig->name, sig->type, sig->length); if (sig->unit) eprintf(", unit=%s", sig->unit); if (sig->minimum) { if (sig->type == 'i') { int *vals = (int*)sig->minimum; for (i = 0; i < sig->length; i++) eprintf(", minimum=%d", vals[i]); } else if (sig->type == 'f') { float *vals = (float*)sig->minimum; for (i = 0; i < sig->length; i++) eprintf(", minimum=%g", vals[i]); } else if (sig->type == 'd') { double *vals = (double*)sig->minimum; for (i = 0; i < sig->length; i++) eprintf(", minimum=%g", vals[i]); } } if (sig->maximum) { if (sig->type == 'i') { int *vals = (int*)sig->maximum; for (i = 0; i < sig->length; i++) eprintf(", maximum=%d", vals[i]); } else if (sig->type == 'f') { float *vals = (float*)sig->maximum; for (i = 0; i < sig->length; i++) eprintf(", maximum=%g", vals[i]); } else if (sig->type == 'd') { double *vals = (double*)sig->maximum; for (i = 0; i < sig->length; i++) eprintf(", minimum=%g", vals[i]); } } eprintf("\n"); } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testdb.c: possible arguments " "-q quiet (suppress output), " "-h help\n"); return 1; break; case 'q': verbose = 0; break; default: break; } } } } lo_arg *args[20]; mapper_message_t msg; int port=1234; int one=1, two=2; float zerof=0.; mapper_db_t db_t, *db = &db_t; memset(db, 0, sizeof(db_t)); /* Test the database functions */ args[0] = (lo_arg*)"@port"; args[1] = (lo_arg*)&port; args[2] = (lo_arg*)"@IP"; args[3] = (lo_arg*)"localhost"; if (mapper_msg_parse_params(&msg, "/registered", "siss", 4, args)) { eprintf("1: Error, parsing failed.\n"); result = 1; goto done; } mapper_db_add_or_update_device_params(db, "/testdb.1", &msg, 0); mapper_db_add_or_update_device_params(db, "/testdb__.2", &msg, 0); mapper_db_add_or_update_device_params(db, "/testdb.3", &msg, 0); mapper_db_add_or_update_device_params(db, "/testdb__.4", &msg, 0); args[0] = (lo_arg*)"@direction"; args[1] = (lo_arg*)"input"; args[2] = (lo_arg*)"@type"; args[3] = (lo_arg*)"f"; args[4] = (lo_arg*)"@IP"; args[5] = (lo_arg*)"localhost"; if (mapper_msg_parse_params(&msg, "/testdb.1/signal", "sc", 2, args)) { eprintf("2: Error, parsing failed.\n"); result = 1; goto done; } mapper_db_add_or_update_signal_params(db, "/in1", "/testdb.1", &msg); mapper_db_add_or_update_signal_params(db, "/in2", "/testdb.1", &msg); mapper_db_add_or_update_signal_params(db, "/in2", "/testdb.1", &msg); args[1] = (lo_arg*)"output"; if (mapper_msg_parse_params(&msg, "/testdb.1/signal", "sc", 2, args)) { eprintf("2: Error, parsing failed.\n"); result = 1; goto done; } mapper_db_add_or_update_signal_params(db, "/out1", "/testdb.1", &msg); mapper_db_add_or_update_signal_params(db, "/out2", "/testdb.1", &msg); mapper_db_add_or_update_signal_params(db, "/out1", "/testdb__.2", &msg); args[0] = (lo_arg*)"@mode"; args[1] = (lo_arg*)"bypass"; args[2] = (lo_arg*)"@boundMin"; args[3] = (lo_arg*)"none"; if (mapper_msg_parse_params(&msg, "/connected", "ssss", 4, args)) { eprintf("4: Error, parsing failed.\n"); result = 1; goto done; } mapper_db_add_or_update_connection_params(db, "/testdb.1/out2", "/testdb__.2/in1", &msg); mapper_db_add_or_update_connection_params(db, "/testdb__.2/out1", "/testdb.1/in1", &msg); args[0] = (lo_arg*)"@mode"; args[1] = (lo_arg*)"expression"; args[2] = (lo_arg*)"@expression"; args[3] = (lo_arg*)"(x-10)*80"; args[4] = (lo_arg*)"@boundMin"; args[5] = (lo_arg*)"clamp"; args[6] = (lo_arg*)"@srcLength"; args[7] = (lo_arg*)&two; args[8] = (lo_arg*)"@srcType"; args[9] = (lo_arg*)"f"; args[10] = (lo_arg*)"@srcMin"; args[11] = (lo_arg*)&zerof; args[12] = (lo_arg*)&one; args[13] = (lo_arg*)"@srcMax"; args[14] = (lo_arg*)&one; args[15] = (lo_arg*)&two; if (mapper_msg_parse_params(&msg, "/connected", "sssssssisssfisii", 16, args)) { eprintf("5: Error, parsing failed.\n"); result = 1; goto done; } mapper_db_add_or_update_connection_params(db, "/testdb.1/out1", "/testdb__.2/in2", &msg); mapper_db_add_or_update_connection_params(db, "/testdb.1/out1", "/testdb__.2/in1", &msg); mapper_db_add_or_update_connection_params(db, "/testdb__.2/out2", "/testdb.1/in2", &msg); if (mapper_msg_parse_params(&msg, "/linked", "", 0, args)) { eprintf("6: Error, parsing failed (on no args!)\n"); result = 1; goto done; } mapper_db_add_or_update_link_params(db, "/testdb.1", "/testdb__.2", &msg); mapper_db_add_or_update_link_params(db, "/testdb__.2", "/testdb.3", &msg); mapper_db_add_or_update_link_params(db, "/testdb__.2", "/testdb.3", &msg); mapper_db_add_or_update_link_params(db, "/testdb.3", "/testdb.1", &msg); mapper_db_add_or_update_link_params(db, "/testdb__.2", "/testdb__.4", &msg); /*********/ if (verbose) { eprintf("Dump:\n"); mapper_db_dump(db); } /*********/ eprintf("\n--- Devices ---\n"); eprintf("\nWalk the whole database:\n"); mapper_db_device *pdev = mapper_db_get_all_devices(db); int count=0; if (!pdev) { eprintf("mapper_db_get_all_devices() returned 0.\n"); result = 1; goto done; } if (!*pdev) { eprintf("mapper_db_get_all_devices() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (pdev) { count ++; eprintf(" name=%s, host=%s, port=%d\n", (*pdev)->name, (*pdev)->host, (*pdev)->port); pdev = mapper_db_device_next(pdev); } if (count != 4) { eprintf("Expected 4 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind /testdb.3:\n"); mapper_db_device dev = mapper_db_get_device_by_name(db, "/testdb.3"); if (!dev) { eprintf("Not found.\n"); result = 1; goto done; } eprintf(" name=%s, host=%s, port=%d\n", dev->name, dev->host, dev->port); /*********/ eprintf("\nFind /dummy:\n"); dev = mapper_db_get_device_by_name(db, "/dummy"); if (dev) { eprintf("unexpected found /dummy: %p\n", dev); result = 1; goto done; } eprintf(" not found, good.\n"); /*********/ eprintf("\nFind matching '__':\n"); pdev = mapper_db_match_devices_by_name(db, "__"); count=0; if (!pdev) { eprintf("mapper_db_match_device_by_name() returned 0.\n"); result = 1; goto done; } if (!*pdev) { eprintf("mapper_db_match_device_by_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (pdev) { count ++; eprintf(" name=%s, host=%s, port=%d\n", (*pdev)->name, (*pdev)->host, (*pdev)->port); pdev = mapper_db_device_next(pdev); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\n--- Signals ---\n"); eprintf("\nFind all inputs for device '/testdb.1':\n"); mapper_db_signal *psig = mapper_db_get_inputs_by_device_name(db, "/testdb.1"); count=0; if (!psig) { eprintf("mapper_db_get_inputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_get_inputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind all outputs for device '/testdb.1':\n"); psig = mapper_db_get_outputs_by_device_name(db, "/testdb.1"); count=0; if (!psig) { eprintf("mapper_db_get_outputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_get_outputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind all inputs for device '/testdb__.2':\n"); psig = mapper_db_get_inputs_by_device_name(db, "/testdb__.2"); count=0; if (psig) { eprintf("mapper_db_get_inputs_by_device_name() " "incorrectly found something.\n"); printsignal(*psig); result = 1; goto done; } else eprintf(" correctly returned 0.\n"); /*********/ eprintf("\nFind all outputs for device '/testdb__.2':\n"); psig = mapper_db_get_outputs_by_device_name(db, "/testdb__.2"); count=0; if (!psig) { eprintf("mapper_db_get_outputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_get_outputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 1) { eprintf("Expected 1 record, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind matching input 'in' for device '/testdb.1':\n"); psig = mapper_db_match_inputs_by_device_name(db, "/testdb.1", "in"); count=0; if (!psig) { eprintf("mapper_db_match_inputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_match_inputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind matching output 'out' for device '/testdb.1':\n"); psig = mapper_db_match_outputs_by_device_name(db, "/testdb.1", "out"); count=0; if (!psig) { eprintf("mapper_db_match_outputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_match_outputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind matching output 'out' for device '/testdb__.2':\n"); psig = mapper_db_match_outputs_by_device_name(db, "/testdb__.2", "out"); count=0; if (!psig) { eprintf("mapper_db_match_outputs_by_device_name() returned 0.\n"); result = 1; goto done; } if (!*psig) { eprintf("mapper_db_match_outputs_by_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (psig) { count ++; printsignal(*psig); psig = mapper_db_signal_next(psig); } if (count != 1) { eprintf("Expected 1 record, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\n--- connections ---\n"); eprintf("\nFind connections with source 'out1':\n"); mapper_db_connection* pcon = mapper_db_get_connections_by_src_signal_name(db, "out1"); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_src_signal_name() returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_src_signal_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 3) { eprintf("Expected 3 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind connections for device 'testdb.1', " "source 'out1':\n"); pcon = mapper_db_get_connections_by_src_device_and_signal_names(db, "testdb.1", "/out1"); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_src_device_and_signal_names() " "returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_src_device_and_signal_names() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind connections with destination 'in2':\n"); pcon = mapper_db_get_connections_by_dest_signal_name(db, "in2"); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_dest_signal_name() returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_dest_signal_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind connections for device 'testdb__.2', " "destination 'in1':\n"); pcon = mapper_db_get_connections_by_dest_device_and_signal_names(db, "testdb__.2", "/in1"); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_dest_device_and_signal_names() " "returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_dest_device_and_signal_names() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind connections for input device 'testdb__.2', signal 'out1'," "\n and output device 'testdb.1', signal 'in1':\n"); pcon = mapper_db_get_connections_by_device_and_signal_names( db, "testdb__.2", "out1", "testdb.1", "in1"); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_device_and_signal_names() " "returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_device_and_signal_names() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 1) { eprintf("Expected 1 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind connections for input device 'testdb__.2', signals " "matching 'out'," "\n and output device 'testdb.1', all signals:\n"); pcon = mapper_db_get_connections_by_signal_queries(db, mapper_db_match_outputs_by_device_name(db, "/testdb__.2", "out"), mapper_db_get_inputs_by_device_name(db, "/testdb.1")); count=0; if (!pcon) { eprintf("mapper_db_get_connections_by_signal_queries() " "returned 0.\n"); result = 1; goto done; } if (!*pcon) { eprintf("mapper_db_get_connections_by_signal_queries() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (pcon) { count ++; eprintf(" source=%s, dest=%s\n", (*pcon)->src_name, (*pcon)->dest_name); pcon = mapper_db_connection_next(pcon); } if (count != 1) { eprintf("Expected 1 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\n--- Links ---\n"); eprintf("\nFind matching links with source '/testdb__.2':\n"); mapper_db_link* plink = mapper_db_get_links_by_src_device_name(db, "/testdb__.2"); count=0; if (!plink) { eprintf("mapper_db_get_links_by_src_device_name() returned 0.\n"); result = 1; goto done; } if (!*plink) { eprintf("mapper_db_get_links_by_src_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (plink) { count ++; eprintf(" source=%s, dest=%s\n", (*plink)->src_name, (*plink)->dest_name); plink = mapper_db_link_next(plink); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind matching links with destination '/testdb__.4':\n"); plink = mapper_db_get_links_by_dest_device_name(db, "/testdb__.4"); count=0; if (!plink) { eprintf("mapper_db_get_links_by_dest_device_name() returned 0.\n"); result = 1; goto done; } if (!*plink) { eprintf("mapper_db_get_links_by_dest_device_name() returned something " "which pointed to 0.\n"); result = 1; goto done; } while (plink) { count ++; eprintf(" source=%s, dest=%s\n", (*plink)->src_name, (*plink)->dest_name); plink = mapper_db_link_next(plink); } if (count != 1) { eprintf("Expected 1 record, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind links with source matching 'db' and " "destination matching '__':\n"); pdev = mapper_db_match_devices_by_name(db, "db"); if (!pdev) { eprintf("mapper_db_match_device_by_name() returned 0.\n"); result = 1; goto done; } mapper_db_device_t **pdev2 = mapper_db_match_devices_by_name(db, "__"); if (!pdev2) { eprintf("mapper_db_match_device_by_name() returned 0.\n"); result = 1; goto done; } plink = mapper_db_get_links_by_src_dest_devices(db, pdev, pdev2); count=0; if (!plink) { eprintf("mapper_db_get_links_by_src_dest_devices() returned 0.\n"); result = 1; goto done; } if (!*plink) { eprintf("mapper_db_get_links_by_src_dest_devices() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (plink) { count ++; eprintf(" source=%s, dest=%s\n", (*plink)->src_name, (*plink)->dest_name); plink = mapper_db_link_next(plink); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ eprintf("\nFind any links with source matching '2':\n"); pdev = mapper_db_match_devices_by_name(db, "2"); if (!pdev) { eprintf("mapper_db_match_device_by_name() returned 0.\n"); result = 1; goto done; } pdev2 = mapper_db_get_all_devices(db); if (!pdev2) { eprintf("mapper_db_get_all_devices() returned 0.\n"); result = 1; goto done; } plink = mapper_db_get_links_by_src_dest_devices(db, pdev, pdev2); count=0; if (!plink) { eprintf("mapper_db_get_links_by_src_dest_devices() returned 0.\n"); result = 1; goto done; } if (!*plink) { eprintf("mapper_db_get_links_by_src_dest_devices() " "returned something which pointed to 0.\n"); result = 1; goto done; } while (plink) { count ++; eprintf(" source=%s, dest=%s\n", (*plink)->src_name, (*plink)->dest_name); plink = mapper_db_link_next(plink); } if (count != 2) { eprintf("Expected 2 records, but counted %d.\n", count); result = 1; goto done; } /*********/ done: while (db->registered_devices) mapper_db_remove_device_by_name(db, db->registered_devices->name); if (!verbose) printf(".................................................."); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testmany.c0000644000175000017500000001066712423630127015022 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int done = 0; int num_devices = 5; mapper_device *device_list = 0; int sent = 0; int received = 0; /*! Internal function to get the current time. */ static double get_current_time() { struct timeval tv; gettimeofday(&tv, NULL); return (double) tv.tv_sec + tv.tv_usec / 1000000.0; } void insig_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t timetag) { if (value) { eprintf("handler: Got %f\n", (*(float*)value)); } received++; } int setup_devices() { char str[20]; float mn=0, mx=1; for (int i = 0; i < num_devices; i++) { device_list[i] = mdev_new("device", 0, 0); if (!device_list[i]) goto error; // give each device 10 inputs and 10 outputs for (int j = 0; j < 10; j++) { sprintf(str, "/sig%d", j); mdev_add_input(device_list[i], str, 1, 'f', 0, &mn, &mx, 0, 0); mdev_add_output(device_list[i], str, 1, 'f', 0, &mn, &mx); } } return 0; error: return 1; } void cleanup_devices() { mapper_device dest; eprintf("Freeing devices"); for (int i = 0; i < num_devices; i++) { dest = device_list[i]; if (dest) { mdev_free(dest); eprintf("."); } } eprintf("\n"); } void wait_local_devices(int *cancel) { int i, j = 0, keep_waiting = 1; while ( keep_waiting && !*cancel ) { keep_waiting = 0; for (i = 0; i < num_devices; i++) { mdev_poll(device_list[i], 50); if (!mdev_ready(device_list[i])) { keep_waiting = 1; } printf("."); fflush(stdout); if (j++ >= 50) { while (--j) printf("\b \b"); } } } eprintf("\nRegistered devices:\n"); for ( i=0; i= 0 && !done) { for (int i = 0; i < num_devices; i++) { mdev_poll(device_list[i], 0); } usleep(50 * 1000); i++; } } void ctrlc(int sig) { done = 1; } int main(int argc, char *argv[]) { double now = get_current_time(); int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': printf("testlinear.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help, " "--devices number of devices\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; case '-': if (strcmp(argv[i], "--devices")==0 && argc>i+1) { i++; num_devices = atoi(argv[i]); j = 1; } break; default: break; } } } } device_list = (mapper_device*)malloc(sizeof(mapper_device)*num_devices); signal(SIGINT, ctrlc); srand( time(NULL) ); if (setup_devices()) { eprintf("Error initializing devices.\n"); result = 1; goto done; } wait_local_devices(&done); now = get_current_time() - now; eprintf("Allocated %d devices in %f seconds.\n", num_devices, now); if (!terminate) loop(); done: cleanup_devices(); free(device_list); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testquery.c0000644000175000017500000001654212423630127015221 0ustar tiagotiago#include "../src/mapper_internal.h" #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int autoconnect = 1; mapper_device source = 0; mapper_device destination = 0; mapper_signal sendsig[4] = {0, 0, 0, 0}; mapper_signal recvsig[4] = {0, 0, 0, 0}; int sent = 0; int received = 0; int done = 0; void query_response_handler(mapper_signal sig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { int i; if (value) { eprintf("--> source got query response: %s ", props->name); for (i = 0; i < props->length * count; i++) eprintf("%i ", ((int*)value)[i]); eprintf("\n"); } else { eprintf("--> source got empty query response: %s\n", props->name); } received++; } /*! Creation of a local source. */ int setup_source() { char sig_name[20]; source = mdev_new("testquery-send", 0, 0); if (!source) goto error; eprintf("source created.\n"); int mn[]={0,0,0,0}, mx[]={10,10,10,10}; for (int i = 0; i < 4; i++) { snprintf(sig_name, 20, "%s%i", "/outsig_", i); sendsig[i] = mdev_add_output(source, sig_name, i+1, 'i', 0, mn, mx); msig_set_callback(sendsig[i], query_response_handler, 0); msig_update(sendsig[i], mn, 0, MAPPER_NOW); } eprintf("Output signals registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(source)); return 0; error: return 1; } void cleanup_source() { if (source) { if (source->routers) { eprintf("Removing router.. "); fflush(stdout); mdev_remove_router(source, source->routers); eprintf("ok\n"); } eprintf("Freeing source.. "); fflush(stdout); mdev_free(source); eprintf("ok\n"); } } void insig_handler(mapper_signal sig,mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { eprintf("--> destination got %s %f\n", props->name, (*(float*)value)); } received++; } /*! Creation of a local destination. */ int setup_destination() { char sig_name[10]; destination = mdev_new("testquery-recv", 0, 0); if (!destination) goto error; eprintf("destination created.\n"); float mn[]={0,0,0,0}, mx[]={1,1,1,1}; for (int i = 0; i < 4; i++) { snprintf(sig_name, 10, "%s%i", "/insig_", i); recvsig[i] = mdev_add_input(destination, sig_name, i+1, 'f', 0, mn, mx, insig_handler, 0); } eprintf("Input signal /insig registered.\n"); eprintf("Number of inputs: %d\n", mdev_num_inputs(destination)); return 0; error: return 1; } void cleanup_destination() { if (destination) { eprintf("Freeing destination.. "); fflush(stdout); mdev_free(destination); eprintf("ok\n"); } } void wait_local_devices() { while (!done && !(mdev_ready(source) && mdev_ready(destination))) { mdev_poll(source, 0); mdev_poll(destination, 0); usleep(50 * 1000); } } int setup_connections() { int i; mapper_monitor mon = mapper_monitor_new(source->admin, 0); char src_name[1024], dest_name[1024]; mapper_monitor_link(mon, mdev_name(source), mdev_name(destination), 0, 0); i = 0; while (!done && !source->routers) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } for (int i = 0; i < 4; i++) { msig_full_name(sendsig[i], src_name, 1024); msig_full_name(recvsig[i], dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); } // swap the last two signals to mix up signal vector lengths msig_full_name(sendsig[2], src_name, 1024); msig_full_name(recvsig[3], dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); msig_full_name(sendsig[3], src_name, 1024); msig_full_name(recvsig[2], dest_name, 1024); mapper_monitor_connect(mon, src_name, dest_name, 0, 0); i = 0; // wait until connection has been established while (!done && !source->routers->num_connections) { mdev_poll(source, 10); mdev_poll(destination, 10); if (i++ > 100) return 1; } mapper_monitor_free(mon); return 0; } void loop() { eprintf("-------------------- GO ! --------------------\n"); int i = 10, j = 0, count; float value[] = {0., 0., 0., 0.}; while ((!terminate || i < 50) && !done) { for (j = 0; j < 4; j++) value[j] = (i % 10) * 1.0f; for (j = 0; j < 4; j++) { msig_update(recvsig[j], value, 0, MAPPER_NOW); } eprintf("\ndestination values updated to %f -->\n", (i % 10) * 1.0f); for (j = 0; j < 4; j++) { sent += count = msig_query_remotes(sendsig[j], MAPPER_NOW); eprintf("Sent %i queries for sendsig[%i]\n", count, j); } mdev_poll(destination, 50); mdev_poll(source, 50); i++; if (!verbose) { printf("\r Sent: %4i, Received: %4i ", sent, received); fflush(stdout); } } } void ctrlc(int sig) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testquery.c: possible arguments " "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (setup_destination()) { eprintf("Error initializing destination.\n"); result = 1; goto done; } if (setup_source()) { eprintf("Done initializing source.\n"); result = 1; goto done; } wait_local_devices(); if (autoconnect && setup_connections()) { eprintf("Error connecting signals.\n"); result = 1; goto done; } loop(); if (sent != received) { eprintf("Not all sent queries received responses.\n"); eprintf("Queried %d time%s, but received %d responses.\n", sent, sent == 1 ? "" : "s", received); result = 1; } done: cleanup_destination(); cleanup_source(); printf("Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testsend.c0000644000175000017500000000565312423630127015006 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #define eprintf(format, ...) do { \ if (verbose) \ fprintf(stdout, format, ##__VA_ARGS__); \ } while(0) int verbose = 1; int terminate = 0; int done = 0; int test_controller() { mapper_device md = mdev_new("tester", 0, 0); if (!md) goto error; eprintf("Mapper device created.\n"); while (!mdev_ready(md)) { mdev_poll(md, 100); } float mn=0, mx=1; mapper_signal sig = mdev_add_output(md, "/testsig", 1, 'f', 0, &mn, &mx); eprintf("Output signal /testsig registered.\n"); eprintf("Number of outputs: %d\n", mdev_num_outputs(md)); const char *host = "localhost"; int admin_port = 9000, data_port = 9001; mapper_router rt = mapper_router_new(md, host, admin_port, data_port, "DESTINATION"); mdev_add_router(md, rt); eprintf("Router to %s:%d added.\n", host, data_port); mapper_router_add_connection(rt, sig, "/mapped1", 'f', 1); mapper_router_add_connection(rt, sig, "/mapped2", 'f', 1); eprintf("Polling device..\n"); int i = 0; while ((!terminate || i < 50) && !done) { mdev_poll(md, 100); eprintf("Updating signal %s to %f\n", sig->props.name, (i * 1.0f)); msig_update_float(sig, (i * 1.0f)); i++; if (!verbose) { printf("\r Sent: %4i", i); fflush(stdout); } } mdev_remove_router(md, rt); eprintf("Router removed.\n"); mdev_free(md); return 0; error: if (md) mdev_free(md); return 1; } void ctrlc(int signal) { done = 1; } int main(int argc, char **argv) { int i, j, result = 0; // process flags for -v verbose, -t terminate, -h help for (i = 1; i < argc; i++) { if (argv[i] && argv[i][0] == '-') { int len = strlen(argv[i]); for (j = 1; j < len; j++) { switch (argv[i][j]) { case 'h': eprintf("testsend.c: possible arguments" "-q quiet (suppress output), " "-t terminate automatically, " "-h help\n"); return 1; break; case 'q': verbose = 0; break; case 't': terminate = 1; break; default: break; } } } } signal(SIGINT, ctrlc); if (test_controller()) { result = 1; goto done; } done: printf(" Test %s.\n", result ? "FAILED" : "PASSED"); return result; } libmapper/test/testsync.c0000644000175000017500000000606312423630127015025 0ustar tiagotiago #include "../src/mapper_internal.h" #include #include #include #include #include #include #include #include #ifdef WIN32 #define usleep(x) Sleep(x/1000) #endif mapper_device devices[5] = {0, 0, 0, 0, 0}; lo_timetag system_time; mapper_timetag_t device_times[5]; uint32_t last_update; int ready = 0; int done = 0; /*! Creation of devices. */ int setup_devices() { int i; for (i=0; i<5; i++) { devices[i] = mdev_new("testsync", 0, 0); if (!devices[i]) goto error; } return 0; error: return 1; } void cleanup_devices() { int i; for (i=0; i<5; i++) { if (devices[i]) { printf("Freeing device %i... ", i); fflush(stdout); mdev_free(devices[i]); printf("ok\n"); } } } void loop() { int i = 0; printf("Loading devices...\n"); while (i <= 100 && !done) { for (i=0; i<5; i++) mdev_poll(devices[i], 20); lo_timetag_now(&system_time); if (system_time.sec != last_update) { last_update = system_time.sec; if (ready) { for (i=0; i<5; i++) { mdev_now(devices[i], &device_times[i]); } // calculate standard deviation double mean = 0; for (i=0; i<5; i++) { mean += mapper_timetag_get_double(device_times[i]); } mean /= 5; double difference_aggregate = 0; for (i=0; i<5; i++) { difference_aggregate += powf(mapper_timetag_get_double(device_times[i]) - mean, 2); } // print current system time and device diffs printf("%f", (double)system_time.sec + (double)system_time.frac * 0.00000000023283064365); for (i=0; i<5; i++) { printf(" | %f", mapper_timetag_difference(system_time, device_times[i])); } printf(" | %f", sqrtf(difference_aggregate / 5)); printf("\n"); } else { int count = 0; for (i=0; i<5; i++) { count += mdev_ready(devices[i]); } if (count >= 5) { printf("\nSYSTEM TIME ***** | OFFSETS *****\n"); for (i=0; i<5; i++) { // Give each device clock a random starting offset // devices[i]->admin->clock.offset = (rand() % 100) - 50; } ready = 1; } } } } } void ctrlc(int sig) { done = 1; } int main() { int result = 0; printf("skipping test!\n"); return 0; signal(SIGINT, ctrlc); if (setup_devices()) { printf("Error initializing devices.\n"); result = 1; goto done; } loop(); done: cleanup_devices(); return result; } libmapper/extra/0000755000175000017500000000000012423630127013144 5ustar tiagotiagolibmapper/extra/Makefile.in0000644000175000017500000004521112423630127015214 0ustar tiagotiago# 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 = extra DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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_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) # 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@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = osx all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extra/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign extra/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 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 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-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) 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-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 # 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: libmapper/extra/osx/0000755000175000017500000000000012423630127013755 5ustar tiagotiagolibmapper/extra/osx/portfile.txt0000644000175000017500000000175412423630127016351 0ustar tiagotiago# $Id$ PortSystem 1.0 name libmapper version 0.3 categories net audio platforms darwin license LGPL maintainers gmail.com:joseph.malloch description Distributed system for media control mapping long_description libmapper is a library for discovering and \ connecting real-time control signals homepage http://www.libmapper.org master_sites http://idmil.org/pubfiles/software/libmapper/ checksums rmd160 \ sha256 depends_lib port:liblo \ port:zlib configure.args --disable-swig \ --disable-jni \ --disable-audio \ --disable-docs variant python requires python { configure.args_append --enable-swig } variant java requires java { configure.args_append --enable-jni } variant docs requires doxygen { configure.args_append --enable-docs }libmapper/extra/osx/Makefile.in0000644000175000017500000003070412423630127016026 0ustar tiagotiago# 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 = extra/osx DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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_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 = 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) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ EXTRA_DIST = libmapper_slider_launcher.py all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign extra/osx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign extra/osx/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 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: 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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ 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: libmapper/extra/osx/Makefile.am0000644000175000017500000000005112423630127016005 0ustar tiagotiago EXTRA_DIST=libmapper_slider_launcher.py libmapper/extra/osx/libmapper_slider_launcher.py0000755000175000017500000000031612423630127021530 0ustar tiagotiago#!/usr/bin/env python import os, sys slider_example = (os.path.abspath(os.path.dirname(sys.argv[0])+"/../../..") + "/libmapper_Slider_Example.app") os.system("open -n "+slider_example) libmapper/extra/Makefile.am0000644000175000017500000000001412423630127015173 0ustar tiagotiagoSUBDIRS=osx libmapper/m4/0000755000175000017500000000000012423630127012341 5ustar tiagotiagolibmapper/m4/ltoptions.m40000644000175000017500000003007312423630127014641 0ustar tiagotiago# 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 ## --------------------------------- ## ## Macros to handle LT_INIT 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], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## 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])]) libmapper/m4/ax_pthread.m40000644000175000017500000002610112423630127014722 0ustar tiagotiago# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # 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 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, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) AC_MSG_RESULT($ax_pthread_ok) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; *-darwin*) acx_pthread_flags="-pthread $acx_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include static void routine(void* a) {a=0;} static void* start_routine(void* a) {return a;}], [pthread_t th; pthread_attr_t attr; pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_create(&th,0,start_routine,0); pthread_cleanup_pop(0); ], [ax_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($ax_pthread_ok) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl AX_PTHREAD libmapper/m4/ltversion.m40000644000175000017500000000126212423630127014631 0ustar tiagotiago# 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) ]) libmapper/m4/ltsugar.m40000644000175000017500000001042412423630127014265 0ustar tiagotiago# 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 ]) libmapper/m4/libtool.m40000644000175000017500000106011112423630127014247 0ustar tiagotiago# 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 ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # 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], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _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 ## 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... 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 ## 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... 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 ## 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... 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 libmapper/m4/lt~obsolete.m40000644000175000017500000001375612423630127015171 0ustar tiagotiago# 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])]) libmapper/m4/pkg.m40000644000175000017500000001214512423630127013367 0ustar tiagotiago# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES libmapper/aclocal.m40000644000175000017500000014672212423630127013675 0ustar tiagotiago# 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'.])]) # 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], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])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])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # 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_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-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) 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_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version is >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Python interpreter is too old])]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) # Just factor out some code duplication. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': can_use_sysconfig = 0 except ImportError: pass" dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # 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 m4_include([m4/ax_pthread.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) libmapper/swig/0000755000175000017500000000000012423630127012772 5ustar tiagotiagolibmapper/swig/testinstance.py0000755000175000017500000000371112423630127016055 0ustar tiagotiago#!/usr/bin/env python import sys, mapper, random def h(sig, id, f, timetag): try: print '--> destination instance', id, 'got', f if not f: print 'retiring destination instance', id sig.release_instance(id) except: print '--> exception' print sig, id, f def manage_instances(sig, id, flag, timetag): try: if flag == mapper.IN_OVERFLOW: print '--> OVERFLOW for sig', sig.name, 'instance', id except: print '--> exception' def print_instance_ids(): phrase = 'active /outsig: [' count = outsig.num_active_instances() for i in range(count): phrase += ' ' phrase += str(outsig.active_instance_id(i)) phrase += ' ] ' phrase += 'active /insig: [' count = insig.num_active_instances() for i in range(count): phrase += ' ' phrase += str(insig.active_instance_id(i)) phrase += ' ]' print phrase src = mapper.device("src") outsig = src.add_output("/outsig", 1, 'f', None, 0, 1000) outsig.reserve_instances(5) dest = mapper.device("dest") insig = dest.add_input("/insig", 1, 'f', None, 0, 1, h) insig.remove_instance(0) insig.reserve_instances([100, 200, 300]) insig.set_allocation_mode(mapper.IN_STEAL_OLDEST) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name), {'mode': mapper.MO_LINEAR}) monitor.poll() for i in range(100): r = random.randint(0,5) id = random.randint(0,5) if r == 0: print '--> retiring sender instance', id outsig.release_instance(id) else: print '--> sender instance', id, 'updated to', i outsig.update_instance(id, i) print_instance_ids() dest.poll(100) src.poll(0) libmapper/swig/testvector.py0000755000175000017500000000154112423630127015552 0ustar tiagotiago#!/usr/bin/env python import sys, mapper, random def h(sig, id, f, timetag): print ' handler got', sig.name, '=', f, 'at time', timetag mins = [0,0,0,0,0,0,0,0,0,0] maxs = [1,1,1,1,1,1,1,1,1,1] src = mapper.device("src") outsig = src.add_output("/outsig1", 10, 'i', None, mins, maxs) dest = mapper.device("dest") insig = dest.add_input("/insig1", 10, 'f', None, mins, maxs, h) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name), {'mode': mapper.MO_LINEAR}) monitor.poll() for i in range(100): outsig.update([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) dest.poll(100) src.poll(0) libmapper/swig/testquery.py0000755000175000017500000000160412423630127015415 0ustar tiagotiago#!/usr/bin/env python import sys, mapper def h(sig, id, f, timetag): try: print '--> received query response:', f except: print 'exception' print sig, f src = mapper.device("src") outsig = src.add_output("/outsig", 1, 'f', None, 0, 1000) outsig.set_callback(h) dest = mapper.device("dest") insig = dest.add_input("/insig", 1, 'f', None, 0, 1) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name), {'mode': mapper.MO_LINEAR}) monitor.poll() for i in range(100): print 'updating destination to', i, '-->' insig.update(i) outsig.query_remotes() src.poll(10) dest.poll(10) libmapper/swig/tkgui.py0000755000175000017500000000173012423630127014473 0ustar tiagotiago#!/usr/bin/env python import Tkinter import sys import mapper def on_gui_change(x): sig_out.update(int(x)) def on_mapper_change(sig, id, x, timetag): w.set(int(x)) dev = mapper.device("tkgui", 9000) sig_in = dev.add_input("/signal0", 1, 'i', None, 0, 100, on_mapper_change) sig_out = dev.add_output("/signal0", 1, 'i', None, 0, 100) master = Tkinter.Tk() master.title("libmapper Python GUI demo") name = Tkinter.StringVar() name.set("Waiting for device name...") name_known = False label = Tkinter.Label(master, textvariable=name) label.pack() w = Tkinter.Scale(master, from_=0, to=100, label='signal0', orient=Tkinter.HORIZONTAL, length=300, command=on_gui_change) w.pack() def do_poll(): global name_known dev.poll(20) if dev.ready() and not name_known: name.set('Device name: %s, listening on port %d'%(dev.name, dev.port)) name_known = True master.after(5, do_poll) do_poll() master.mainloop() libmapper/swig/copywhich.sh0000755000175000017500000000051412423630127015326 0ustar tiagotiago#!/bin/sh PYMACHINE="$(python -c 'import platform; print platform.machine()')" ARCHES="$(ls -d build/lib.*/$1)" # If the Python platform architecture is found, copy that one for A in $ARCHES do if file $A | grep -q $PYMACHINE; then echo $A exit 0 fi done # Otherwise, copy the first one listed. echo $ARCHES | head -n1 libmapper/swig/mapper.i0000644000175000017500000022374612423630127014446 0ustar tiagotiago%module mapper %include "typemaps.i" %typemap(in) PyObject *PyFunc { if ($input!=Py_None && !PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } $1 = $input; } %typemap(in) (int num_int, int *argv) { int i; if (!PyList_Check($input)) { PyErr_SetString(PyExc_ValueError, "Expecting a list"); return NULL; } $1 = PyList_Size($input); $2 = (int *) malloc($1*sizeof(int)); for (i = 0; i < $1; i++) { PyObject *s = PyList_GetItem($input,i); if (PyInt_Check(s)) $2[i] = (int)PyInt_AsLong(s); else if (PyFloat_Check(s)) $2[i] = (int)PyFloat_AsDouble(s); else { free($2); PyErr_SetString(PyExc_ValueError, "List items must be int or float."); return NULL; } } } %typemap(typecheck) (int num_int, int *argv) { $1 = PyList_Check($input) ? 1 : 0; } %typemap(freearg) (int num_int, int *argv) { if ($2) free($2); } %typemap(in) maybePropVal %{ propval *val = alloca(sizeof(*val)); if ($input == Py_None) $1 = 0; else { val->type = 0; check_type($input, &val->type, 1, 1); if (!val->type) { PyErr_SetString(PyExc_ValueError, "Problem determining value type."); return NULL; } if (PyList_Check($input)) val->length = PyList_Size($input); else val->length = 1; val->value = malloc(val->length * mapper_type_size(val->type)); val->free_value = 1; if (py_to_prop($input, val->value, val->type, val->length)) { free(val->value); PyErr_SetString(PyExc_ValueError, "Problem parsing property value."); return NULL; } $1 = val; } %} %typemap(out) maybePropVal { if ($1) { $result = prop_to_py($1->type, $1->length, $1->value); if ($result) free($1); } else { $result = Py_None; Py_INCREF($result); } } %typemap(freearg) maybePropVal { if ($1) { maybePropVal prop = (maybePropVal)$1; if (prop->value && prop->free_value) { free(prop->value); } } } %typemap(out) maybeInt { if ($1) { $result = Py_BuildValue("i", *$1); free($1); } else { $result = Py_None; Py_INCREF($result); } } %typemap(out) booltype { PyObject *o = $1 ? Py_True : Py_False; Py_INCREF(o); return o; } %typemap(in) mapper_db_link_with_flags_t* %{ mapper_db_link_with_flags_t *p = alloca(sizeof(*p)); $1 = 0; if (PyDict_Check($input)) { memset(p, 0, sizeof(mapper_db_link_with_flags_t)); PyObject *keys = PyDict_Keys($input); if (keys) { int i = PyList_GET_SIZE(keys), k; for (i=i-1; i>=0; --i) { PyObject *o = PyList_GetItem(keys, i); if (PyString_Check(o)) { PyObject *v = PyDict_GetItem($input, o); char *s = PyString_AsString(o); if (strcmp(s, "scope_names")==0) { if (PyString_Check(v)) { p->props.num_scopes = 1; p->flags |= LINK_NUM_SCOPES; char *scope = PyString_AsString(v); p->props.scope_names = &scope; p->flags |= LINK_SCOPE_NAMES; } } else if (strcmp(s, "src_name")==0) { if (PyString_Check(v)) p->props.src_name = PyString_AsString(v); } else if (strcmp(s, "dest_name")==0) { if (PyString_Check(v)) p->props.dest_name = PyString_AsString(v); } else if (strcmp(s, "num_scopes")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) p->props.num_scopes = k; } else if (strcmp(s, "src_host")==0) { if (PyString_Check(v)) p->props.src_host = PyString_AsString(v); } else if (strcmp(s, "src_port")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) p->props.src_port = k; } else if (strcmp(s, "dest_host")==0) { if (PyString_Check(v)) p->props.dest_host = PyString_AsString(v); } else if (strcmp(s, "dest_port")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) p->props.dest_port = k; } } } Py_DECREF(keys); $1 = p; } } else { SWIG_exception_fail(SWIG_TypeError, "argument $argnum must be 'dict'"); } %} %typemap(in) mapper_db_connection_with_flags_t* %{ mapper_db_connection_with_flags_t *p = alloca(sizeof(*p)); p->props.src_length = 0; p->props.dest_length = 0; p->props.src_type = 0; p->props.dest_type = 0; $1 = 0; if (PyDict_Check($input)) { memset(p, 0, sizeof(mapper_db_connection_with_flags_t)); PyObject *keys = PyDict_Keys($input); if (keys) { // first try to retrieve src_type, dest_type if provided int i = PyList_GET_SIZE(keys), k; for (i=i-1; i>=0; --i) { PyObject *o = PyList_GetItem(keys, i); if (PyString_Check(o)) { PyObject *v = PyDict_GetItem($input, o); char *s = PyString_AsString(o); if (strcmp(s, "src_type")==0) { if (PyString_Check(v)) p->props.src_type = PyString_AsString(v)[0]; if (p->props.dest_type) continue; } else if (strcmp(s, "dest_type")==0) { if (PyString_Check(v)) p->props.dest_type = PyString_AsString(v)[0]; if (p->props.src_type) continue; } } } i = PyList_GET_SIZE(keys); for (i=i-1; i>=0; --i) { PyObject *o = PyList_GetItem(keys, i); if (PyString_Check(o)) { PyObject *v = PyDict_GetItem($input, o); char *s = PyString_AsString(o); if (strcmp(s, "bound_max")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) { p->props.bound_max = k; p->flags |= CONNECTION_BOUND_MAX; } } else if (strcmp(s, "bound_min")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) { p->props.bound_min = k; p->flags |= CONNECTION_BOUND_MIN; } } else if (strcmp(s, "expression")==0) { if (PyString_Check(v)) { p->props.expression = PyString_AsString(v); p->flags |= CONNECTION_EXPRESSION; } } else if (strcmp(s, "mode")==0) { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) { p->props.mode = k; p->flags |= CONNECTION_MODE; } } else if (strcmp(s, "muted")==0) { k = -1; if (v == Py_True) k = 1; else if (v == Py_False) { k = 0; } else { int ecode = SWIG_AsVal_int(v, &k); if (SWIG_IsOK(ecode)) k = k!=0; else k = -1; } if (k>-1) { p->props.muted = k; p->flags |= CONNECTION_MUTED; } } else if (strcmp(s, "src_name")==0) { if (PyString_Check(v)) p->props.src_name = PyString_AsString(v); } else if (strcmp(s, "dest_name")==0) { if (PyString_Check(v)) p->props.dest_name = PyString_AsString(v); } else if (strcmp(s, "src_min")==0) { alloc_and_copy_maybe_vector(v, &p->props.src_type, &p->props.src_min, &p->props.src_length); if (p->props.src_min) { p->props.range_known |= CONNECTION_RANGE_SRC_MIN; p->flags |= CONNECTION_SRC_LENGTH; p->flags |= CONNECTION_SRC_TYPE; } } else if (strcmp(s, "src_max")==0) { alloc_and_copy_maybe_vector(v, &p->props.src_type, &p->props.src_max, &p->props.src_length); if (p->props.src_max) { p->props.range_known |= CONNECTION_RANGE_SRC_MAX; p->flags |= CONNECTION_SRC_LENGTH; p->flags |= CONNECTION_SRC_TYPE; } } else if (strcmp(s, "dest_min")==0) { alloc_and_copy_maybe_vector(v, &p->props.dest_type, &p->props.dest_min, &p->props.dest_length); if (p->props.dest_min) { p->props.range_known |= CONNECTION_RANGE_DEST_MIN; p->flags |= CONNECTION_DEST_LENGTH; p->flags |= CONNECTION_DEST_TYPE; } } else if (strcmp(s, "dest_max")==0) { alloc_and_copy_maybe_vector(v, &p->props.dest_type, &p->props.dest_max, &p->props.dest_length); if (p->props.dest_max) { p->props.range_known |= CONNECTION_RANGE_DEST_MAX; p->flags |= CONNECTION_DEST_LENGTH; p->flags |= CONNECTION_DEST_TYPE; } } p->flags |= p->props.range_known; } } Py_DECREF(keys); $1 = p; } } else { SWIG_exception_fail(SWIG_TypeError, "argument $argnum must be 'dict'"); } %} %typemap(freearg) mapper_db_connection_with_flags_t* { if ($1) { if ($1->props.range_known & CONNECTION_RANGE_SRC_MIN) free($1->props.src_min); if ($1->props.range_known & CONNECTION_RANGE_SRC_MAX) free($1->props.src_max); if ($1->props.range_known | CONNECTION_RANGE_DEST_MIN) free($1->props.dest_min); if ($1->props.range_known | CONNECTION_RANGE_DEST_MAX) free($1->props.dest_max); } } %typemap(out) mapper_db_device_t ** { if ($1) { // Return the dict and an opaque pointer. // The pointer will be hidden by a Python generator interface. PyObject *o = device_to_py(*$1); if (o!=Py_None) $result = Py_BuildValue("(Ol)", o, $1); else $result = Py_BuildValue("(OO)", Py_None, Py_None); } else { $result = Py_BuildValue("(OO)", Py_None, Py_None); } } %typemap(out) mapper_db_device { return device_to_py($1); } %typemap(out) mapper_db_signal_t ** { if ($1) { // Return the dict and an opaque pointer. // The pointer will be hidden by a Python generator interface. PyObject *o = signal_to_py(*$1); if (o!=Py_None) $result = Py_BuildValue("(Ol)", o, $1); else $result = Py_BuildValue("(OO)", Py_None, Py_None); } else { $result = Py_BuildValue("(OO)", Py_None, Py_None); } } %typemap(out) mapper_db_signal { return signal_to_py($1); } %typemap(out) mapper_db_connection_t ** { if ($1) { // Return the dict and an opaque pointer. // The pointer will be hidden by a Python generator interface. PyObject *o = connection_to_py(*$1); if (o!=Py_None) $result = Py_BuildValue("(Ol)", o, $1); else $result = Py_BuildValue("(OO)", Py_None, Py_None); } else { $result = Py_BuildValue("(OO)", Py_None, Py_None); } } %typemap(out) mapper_db_connection { return connection_to_py($1); } %typemap(out) mapper_db_link_t ** { if ($1) { // Return the dict and an opaque pointer. // The pointer will be hidden by a Python generator interface. PyObject *o = link_to_py(*$1); if (o!=Py_None) $result = Py_BuildValue("(Ol)", o, $1); else $result = Py_BuildValue("(OO)", Py_None, Py_None); } else { $result = Py_BuildValue("(OO)", Py_None, Py_None); } } %typemap(out) mapper_db_link { return link_to_py($1); } %{ #include // Note: inet_ntoa() crashes on OS X if this header isn't included! // On the other hand, doesn't compile on Windows if it is. #ifdef __APPLE__ #include #endif typedef struct _device {} device; typedef struct _signal {} signal__; typedef struct _monitor {} monitor; typedef struct _db {} db; typedef struct _admin {} admin; PyThreadState *_save; static int py_to_prop(PyObject *from, void *to, char type, int length) { // here we are assuming sufficient memory has already been allocated if (!from || !length) return 1; int i; PyObject *v = 0; if (length > 1) v = PyList_New(length); switch (type) { case 's': { // only strings are valid if (length > 1) { char **str_to = (char**)to; for (i=0; i 1) { for (i=0; i 1) { for (i=0; i 1) { for (i=0; i 1) v = PyList_New(length); switch (type) { case 's': case 'S': { if (length > 1) { char **vect = (char**)value; for (i=0; i 1) { char *vect = (char*)value; for (i=0; i 1) { int *vect = (int*)value; for (i=0; i 1) { int64_t *vect = (int64_t*)value; for (i=0; i 1) { float *vect = (float*)value; for (i=0; i 1) { double *vect = (double*)value; for (i=0; i 1) { for (i=0; itype == 'i') { int *vint = (int *)v; if (props->length > 1 || count > 1) { valuelist = PyList_New(props->length * count); for (i=0; ilength * count; i++) { PyObject *o = Py_BuildValue("i", vint[i]); PyList_SET_ITEM(valuelist, i, o); } arglist = Py_BuildValue("(OiOd)", py_msig, instance_id, valuelist, timetag); } else arglist = Py_BuildValue("(Oiid)", py_msig, instance_id, *(int*)v, timetag); } else if (props->type == 'f') { if (props->length > 1 || count > 1) { float *vfloat = (float *)v; valuelist = PyList_New(props->length * count); for (i=0; ilength * count; i++) { PyObject *o = Py_BuildValue("f", vfloat[i]); PyList_SET_ITEM(valuelist, i, o); } arglist = Py_BuildValue("(OiOd)", py_msig, instance_id, valuelist, timetag); } else arglist = Py_BuildValue("(Oifd)", py_msig, instance_id, *(float*)v, timetag); } } else { arglist = Py_BuildValue("(OiOd)", py_msig, instance_id, Py_None, timetag); } if (!arglist) { printf("[mapper] Could not build arglist (msig_handler_py).\n"); return; } PyObject **callbacks = (PyObject**)props->user_data; result = PyEval_CallObject(callbacks[0], arglist); Py_DECREF(arglist); Py_XDECREF(valuelist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a mapper_signal_instance_event * handler is called. */ static void msig_instance_event_handler_py(struct _mapper_signal *msig, mapper_db_signal props, int instance_id, msig_instance_event_t event, mapper_timetag_t *tt) { PyEval_RestoreThread(_save); PyObject *arglist=0; PyObject *result=0; PyObject *py_msig = SWIG_NewPointerObj(SWIG_as_voidptr(msig), SWIGTYPE_p__signal, 0); unsigned long long int timetag = 0; if (tt) { timetag = tt->sec; timetag = (timetag << 32) + tt->frac; } arglist = Py_BuildValue("(OiiL)", py_msig, instance_id, event, timetag); if (!arglist) { printf("[mapper] Could not build arglist (msig_instance_event_handler_py).\n"); return; } PyObject **callbacks = (PyObject**)props->user_data; result = PyEval_CallObject(callbacks[1], arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a device link handler is called. */ static void device_link_handler_py(mapper_device dev, mapper_db_link link, mapper_device_local_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("OOi", device_to_py(&dev->props), link_to_py(link), action); if (!arglist) { printf("[mapper] Could not build arglist (device_link_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a device connection handler is called. */ static void device_connection_handler_py(mapper_device dev, mapper_db_link link, mapper_signal signal, mapper_db_connection connection, mapper_device_local_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("OOOOi", device_to_py(&dev->props), link_to_py(link), signal_to_py(&signal->props), connection_to_py(connection), action); if (!arglist) { printf("[mapper] Could not build arglist (device_connection_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } typedef struct { char type; int length; void *value; int free_value; } propval, *maybePropVal; static int coerce_prop(maybePropVal val, char type) { int i; if (!val) return 1; if (val->type == type) return 0; switch (type) { case 'i': { int *to = malloc(val->length * sizeof(int)); if (val->type == 'f') { float *from = (float*)val->value; for (i=0; ilength; i++) to[i] = (int)from[i]; } else if (val->type == 'd') { double *from = (double*)val->value; for (i=0; ilength; i++) to[i] = (int)from[i]; } else { free(to); return 1; } if (val->free_value) free(val->value); val->value = to; val->free_value = 1; break; } case 'f': { float *to = malloc(val->length * sizeof(float)); if (val->type == 'i') { int *from = (int*)val->value; for (i=0; ilength; i++) to[i] = (float)from[i]; } else if (val->type == 'd') { double *from = (double*)val->value; for (i=0; ilength; i++) to[i] = (float)from[i]; } else { free(to); return 1; } if (val->free_value) free(val->value); val->value = to; val->free_value = 1; break; } case 'd': { double *to = malloc(val->length * sizeof(double)); if (val->type == 'i') { int *from = (int*)val->value; for (i=0; ilength; i++) to[i] = (double)from[i]; } else if (val->type == 'f') { float *from = (float*)val->value; for (i=0; ilength; i++) to[i] = (double)from[i]; } else { free(to); return 1; } if (val->free_value) free(val->value); val->value = to; val->free_value = 1; break; } default: return 1; break; } return 0; } typedef int* maybeInt; typedef int booltype; typedef struct { mapper_db_link_t props; int flags; } mapper_db_link_with_flags_t; typedef struct { mapper_db_connection_t props; int flags; } mapper_db_connection_with_flags_t; /* Wrapper for callback back to python when a mapper_db_device handler * is called. */ static void device_db_handler_py(mapper_db_device record, mapper_db_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("(Oi)", device_to_py(record), action); if (!arglist) { printf("[mapper] Could not build arglist (device_db_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a mapper_db_signal handler * is called. */ static void signal_db_handler_py(mapper_db_signal record, mapper_db_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("(Oi)", signal_to_py(record), action); if (!arglist) { printf("[mapper] Could not build arglist (signal_db_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a mapper_db_connection handler * is called. */ static void connection_db_handler_py(mapper_db_connection record, mapper_db_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("(Oi)", connection_to_py(record), action); if (!arglist) { printf("[mapper] Could not build arglist (connection_db_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } /* Wrapper for callback back to python when a mapper_db_link handler * is called. */ static void link_db_handler_py(mapper_db_link record, mapper_db_action_t action, void *user) { PyEval_RestoreThread(_save); PyObject *arglist = Py_BuildValue("(Oi)", link_to_py(record), action); if (!arglist) { printf("[mapper] Could not build arglist (link_db_handler_py).\n"); return; } PyObject *result = PyEval_CallObject((PyObject*)user, arglist); Py_DECREF(arglist); Py_XDECREF(result); _save = PyEval_SaveThread(); } %} typedef enum _mapper_boundary_action { BA_NONE, /*!< Value is passed through unchanged. This is the * default. */ BA_MUTE, //!< Value is muted. BA_CLAMP, //!< Value is limited to the boundary. BA_FOLD, //!< Value continues in opposite direction. BA_WRAP, /*!< Value appears as modulus offset at the opposite * boundary. */ N_MAPPER_BOUNDARY_ACTIONS } mapper_boundary_action; /*! Describes the connection mode. * @ingroup connectiondb */ typedef enum _mapper_mode_type { MO_UNDEFINED, //!< Not yet defined MO_BYPASS, //!< Direct throughput MO_LINEAR, //!< Linear scaling MO_EXPRESSION, //!< Expression MO_CALIBRATE, //!< Calibrate to source signal MO_REVERSE, //!< Update source on dest change N_MAPPER_MODE_TYPES } mapper_mode_type; /*! Describes the voice-stealing mode for instances. * @ingroup connectiondb */ typedef enum _mapper_instance_allocation_type { IN_UNDEFINED, //!< Not yet defined IN_STEAL_OLDEST, //!< Steal the oldest instance IN_STEAL_NEWEST, //!< Steal the newest instance N_MAPPER_INSTANCE_ALLOCATION_TYPES } mapper_instance_allocation_type; /*! The set of possible actions on an instance, used to register callbacks * to inform them of what is happening. */ typedef enum { IN_NEW = 0x01, //!< New instance has been created. IN_UPSTREAM_RELEASE = 0x02, //!< Instance has been released by upstream device. IN_DOWNSTREAM_RELEASE = 0x04, //!< Instance has been released by downstream device. IN_OVERFLOW = 0x08 //!< No local instances left for incoming remote instance. } msig_instance_event_t; /*! Possible monitor auto-subscribe settings. */ %constant int SUB_NONE = 0x00; %constant int SUB_DEVICE = 0x01; %constant int SUB_DEVICE_INPUTS = 0x02; %constant int SUB_DEVICE_OUTPUTS = 0x04; %constant int SUB_DEVICE_SIGNALS = 0x06; //!< SUB_DEVICE_INPUTS & SUB_DEVICE_OUTPUTS %constant int SUB_DEVICE_LINKS_IN = 0x08; %constant int SUB_DEVICE_LINKS_OUT = 0x10; %constant int SUB_DEVICE_LINKS = 0x18; //!< SUB_DEVICE_LINKS_IN & SUB_DEVICE_LINKS_OUT %constant int SUB_DEVICE_CONNECTIONS_IN = 0x20; %constant int SUB_DEVICE_CONNECTIONS_OUT = 0x40; %constant int SUB_DEVICE_CONNECTIONS = 0x60; //!< SUB_DEVICE_CONNECTIONS_IN & SUB_DEVICE_CONNECTION_OUT %constant int SUB_DEVICE_ALL = 0xFF; /*! The set of possible actions on a database record, used * to inform callbacks of what is happening to a record. */ typedef enum { MDB_MODIFY, MDB_NEW, MDB_REMOVE, MDB_UNRESPONSIVE, } mapper_db_action_t; typedef enum { MDEV_LOCAL_ESTABLISHED, MDEV_LOCAL_DESTROYED, MDEV_LOCAL_MODIFIED, } mapper_device_local_action_t; typedef struct _device {} device; typedef struct _signal {} signal; typedef struct _monitor {} monitor; typedef struct _db {} db; typedef struct _admin {} admin; %extend _device { _device(const char *name, int port=0, admin *DISOWN=0) { device *d = (device *)mdev_new(name, port, (mapper_admin) DISOWN); return d; } ~_device() { mdev_free((mapper_device)$self); } int poll(int timeout=0) { _save = PyEval_SaveThread(); int rc = mdev_poll((mapper_device)$self, timeout); PyEval_RestoreThread(_save); return rc; } int ready() { return mdev_ready((mapper_device)$self); } // Note, these functions return memory which is _not_ owned by // Python. Correspondingly, the SWIG default is to set thisown to // False, which is correct for this case. signal* add_input(const char *name, int length=1, const char type='f', const char *unit=0, maybePropVal minimum=0, maybePropVal maximum=0, PyObject *PyFunc=0) { int i; void *h = 0; PyObject **callbacks = 0; if (PyFunc) { h = msig_handler_py; callbacks = malloc(2 * sizeof(PyObject*)); callbacks[0] = PyFunc; callbacks[1] = 0; Py_INCREF(PyFunc); } void *pmn=0, *pmx=0; int pmn_coerced=0, pmx_coerced=0; if (type == 'f') { if (minimum && minimum->length == length) { if (minimum->type == 'f') pmn = minimum->value; else if (minimum->type == 'i') { float *to = (float*)malloc(length * sizeof(float)); int *from = (int*)minimum->value; for (i=0; ilength == length) { if (maximum->type == 'f') pmx = maximum->value; else if (maximum->type == 'i') { float *to = (float*)malloc(length * sizeof(float)); int *from = (int*)maximum->value; for (i=0; ilength == length) { if (minimum->type == 'i') pmn = minimum->value; else if (minimum->type == 'f') { int *to = (int*)malloc(length * sizeof(int)); float *from = (float*)minimum->value; for (i=0; ilength == length) { if (maximum->type == 'i') pmx = maximum->value; else if (maximum->type == 'f') { int *to = (int*)malloc(length * sizeof(int)); float *from = (float*)maximum->value; for (i=0; ilength == length) { if (minimum->type == 'f') pmn = minimum->value; else if (minimum->type == 'i') { float *to = (float*)malloc(length * sizeof(float)); int *from = (int*)minimum->value; for (i=0; ilength == length) { if (maximum->type == 'f') pmx = maximum->value; else if (maximum->type == 'i') { float *to = (float*)malloc(length * sizeof(float)); int *from = (int*)maximum->value; for (i=0; ilength == length) { if (minimum->type == 'i') pmn = minimum->value; else if (minimum->type == 'f') { int *to = (int*)malloc(length * sizeof(int)); float *from = (float*)minimum->value; for (i=0; ilength == length) { if (maximum->type == 'i') pmx = maximum->value; else if (maximum->type == 'f') { int *to = (int*)malloc(length * sizeof(int)); float *from = (float*)maximum->value; for (i=0; iprops.user_data) { PyObject **callbacks = msig->props.user_data; Py_XDECREF(callbacks[0]); Py_XDECREF(callbacks[1]); free(callbacks); } return mdev_remove_input((mapper_device)$self, (mapper_signal)sig); } void remove_output(signal *sig) { mapper_signal msig = (mapper_signal)sig; if (msig->props.user_data) { Py_XDECREF((PyObject*)msig->props.user_data); } return mdev_remove_output((mapper_device)$self, msig); } maybeInt get_port() { mapper_device md = (mapper_device)$self; int port = mdev_port(md); if (port) { int *pi = malloc(sizeof(int)); *pi = port; return pi; } return 0; } const char *get_name() { return mdev_name((mapper_device)$self); } const char *get_ip4() { const struct in_addr *a = mdev_ip4((mapper_device)$self); return a ? inet_ntoa(*a) : 0; } const char *get_interface() { return mdev_interface((mapper_device)$self); } unsigned int get_ordinal() { return mdev_ordinal((mapper_device)$self); } int get_num_inputs() { return mdev_num_inputs((mapper_device)$self); } int get_num_outputs() { return mdev_num_outputs((mapper_device)$self); } int get_num_links_in() { return mdev_num_links_in((mapper_device)$self); } int get_num_links_out() { return mdev_num_links_out((mapper_device)$self); } int get_num_connections_in() { return mdev_num_connections_in((mapper_device)$self); } int get_num_connections_out() { return mdev_num_connections_out((mapper_device)$self); } signal *get_input_by_name(const char *name) { return (signal *)mdev_get_input_by_name((mapper_device)$self, name, 0); } signal *get_output_by_name(const char *name) { return (signal *)mdev_get_output_by_name((mapper_device)$self, name, 0); } signal *get_input_by_index(int index) { return (signal *)mdev_get_input_by_index((mapper_device)$self, index); } signal *get_output_by_index(int index) { return (signal *)mdev_get_output_by_index((mapper_device)$self, index); } mapper_db_device get_properties() { return mdev_properties((mapper_device)$self); } void set_property(const char *key, maybePropVal val=0) { if (val) mdev_set_property((mapper_device)$self, key, val->type, val->value, val->length); else mdev_remove_property((mapper_device)$self, key); } void remove_property(const char *key) { mdev_remove_property((mapper_device)$self, key); } double now() { mapper_timetag_t tt; mdev_now((mapper_device)$self, &tt); return mapper_timetag_get_double(tt); } double start_queue(double timetag=0) { mapper_timetag_t tt = MAPPER_NOW; if (timetag) mapper_timetag_set_double(&tt, timetag); mdev_start_queue((mapper_device)$self, tt); return mapper_timetag_get_double(tt); } void send_queue(double timetag) { mapper_timetag_t tt; mapper_timetag_set_double(&tt, timetag); mdev_send_queue((mapper_device)$self, tt); } void set_link_callback(PyObject *PyFunc=0) { void *h = 0; if (PyFunc) { h = device_link_handler_py; Py_XINCREF(PyFunc); } else Py_XDECREF(((mapper_device)$self)->link_cb_userdata); mdev_set_link_callback((mapper_device)$self, h, PyFunc); } void set_connection_callback(PyObject *PyFunc=0) { void *h = 0; if (PyFunc) { Py_XINCREF(PyFunc); h = device_connection_handler_py; } else Py_XDECREF(((mapper_device)$self)->connection_cb_userdata); mdev_set_connection_callback((mapper_device)$self, h, PyFunc); } %pythoncode { port = property(get_port) name = property(get_name) ip4 = property(get_ip4) interface = property(get_interface) ordinal = property(get_ordinal) num_inputs = property(get_num_inputs) num_outputs = property(get_num_outputs) num_links_in = property(get_num_links_in) num_links_out = property(get_num_links_out) num_connections_in = property(get_num_connections_in) num_connections_out = property(get_num_connections_out) def __propgetter(self): device = self props = self.get_properties() class propsetter(dict): __getitem__ = props.__getitem__ def __setitem__(self, key, value): props[key] = value device.set_property(key, value) return propsetter(self.get_properties()) properties = property(__propgetter) def set_properties(self, props): [self.set_property(k, props[k]) for k in props] } } %extend _signal { const char *get_name() { return ((mapper_signal)$self)->props.name; } const char *get_full_name() { mapper_signal sig = (mapper_signal)$self; char s[1024]; int len = msig_full_name(sig, s, 1024); if (len) { // TODO: memory leak char *str = (char*)malloc(len+1); strncpy(str, s, len+1); return str; } return 0; } void update(maybePropVal val=0, double timetag=0) { mapper_timetag_t tt = MAPPER_NOW; if (timetag) mapper_timetag_set_double(&tt, timetag); mapper_signal sig = (mapper_signal)$self; if (!val) { msig_update(sig, 0, 1, tt); return; } else if (val->length < sig->props.length || (val->length % sig->props.length) != 0) { printf("Signal update requires multiples of %i values.\n", sig->props.length); return; } int count = val->length / sig->props.length; if (coerce_prop(val, sig->props.type)) { printf("update: type mismatch\n"); return; } msig_update(sig, val->value, count, tt); } void reserve_instances(int num=1) { msig_reserve_instances((mapper_signal)$self, num, 0, 0); } void reserve_instances(int num_int, int *argv) { msig_reserve_instances((mapper_signal)$self, num_int, argv, 0); } void update_instance(int id, maybePropVal val=0, double timetag=0) { mapper_timetag_t tt = MAPPER_NOW; if (timetag) mapper_timetag_set_double(&tt, timetag); mapper_signal sig = (mapper_signal)$self; if (!val) { msig_update(sig, 0, 1, tt); return; } else if (val->length < sig->props.length || (val->length % sig->props.length) != 0) { printf("Signal update requires multiples of %i values.\n", sig->props.length); return; } int count = val->length / sig->props.length; if (coerce_prop(val, sig->props.type)) { printf("update: type mismatch\n"); return; } msig_update_instance(sig, id, val->value, count, tt); } void release_instance(int id, double timetag=0) { mapper_timetag_t tt = MAPPER_NOW; if (timetag) mapper_timetag_set_double(&tt, timetag); msig_release_instance((mapper_signal)$self, id, tt); } void remove_instance(int id) { msig_remove_instance((mapper_signal)$self, id); } int active_instance_id(int index) { return msig_active_instance_id((mapper_signal)$self, index); } int num_active_instances() { return msig_num_active_instances((mapper_signal)$self); } int num_reserved_instances() { return msig_num_reserved_instances((mapper_signal)$self); } void set_allocation_mode(mapper_instance_allocation_type mode) { msig_set_instance_allocation_mode((mapper_signal)$self, mode); } void set_instance_event_callback(PyObject *PyFunc=0, int flags=0) { mapper_signal_instance_event_handler *h = 0; mapper_signal msig = (mapper_signal)$self; PyObject **callbacks = (PyObject**)msig->props.user_data; if (PyFunc) { h = msig_instance_event_handler_py; if (callbacks) { callbacks[1] = PyFunc; } else { callbacks = malloc(2 * sizeof(PyObject*)); callbacks[0] = 0; callbacks[1] = PyFunc; } Py_INCREF(PyFunc); } else if (callbacks) { Py_XDECREF(callbacks[1]); if (callbacks[0]) callbacks[1] = 0; else { free(callbacks); callbacks = 0; } } msig_set_instance_event_callback((mapper_signal)$self, h, flags, callbacks); } void set_callback(PyObject *PyFunc=0) { mapper_signal_update_handler *h = 0; mapper_signal msig = (mapper_signal)$self; PyObject **callbacks = (PyObject**)msig->props.user_data; if (PyFunc) { h = msig_handler_py; if (callbacks) { callbacks[0] = PyFunc; } else { callbacks = malloc(2 * sizeof(PyObject*)); callbacks[0] = PyFunc; callbacks[1] = 0; } Py_INCREF(PyFunc); } else if (callbacks) { Py_XDECREF(callbacks[0]); if (callbacks[1]) { callbacks[0] = 0; } else { free(callbacks); callbacks = 0; } } msig_set_callback((mapper_signal)$self, h, callbacks); } int query_remotes(double timetag=0) { mapper_timetag_t tt = MAPPER_NOW; if (timetag) mapper_timetag_set_double(&tt, timetag); return msig_query_remotes((mapper_signal)$self, tt); } void set_minimum(maybePropVal val=0) { mapper_signal sig = (mapper_signal)$self; if (!val) { msig_set_minimum((mapper_signal)$self, 0); return; } else if (sig->props.length != val->length) { printf("set_minimum: value length must be %i\n", sig->props.length); return; } else if (coerce_prop(val, sig->props.type)) { printf("set_minimum: value type mismatch\n"); return; } msig_set_minimum((mapper_signal)$self, val->value); } void set_maximum(maybePropVal val=0) { mapper_signal sig = (mapper_signal)$self; if (!val) { msig_set_maximum((mapper_signal)$self, 0); return; } else if (sig->props.length != val->length) { printf("set_maximum: value length must be %i\n", sig->props.length); return; } else if (coerce_prop(val, sig->props.type)) { printf("set_maximum: value type mismatch\n"); return; } msig_set_maximum((mapper_signal)$self, val->value); } maybePropVal get_minimum() { mapper_signal sig = (mapper_signal)$self; if (sig->props.minimum) { maybePropVal prop = malloc(sizeof(maybePropVal)); prop->type = sig->props.type; prop->length = sig->props.length; prop->value = sig->props.minimum; prop->free_value = 0; return prop; } return 0; } maybePropVal get_maximum() { mapper_signal sig = (mapper_signal)$self; if (sig->props.maximum) { maybePropVal prop = malloc(sizeof(maybePropVal)); prop->type = sig->props.type; prop->length = sig->props.length; prop->value = sig->props.maximum; prop->free_value = 0; return prop; } return 0; } int get_length() { return ((mapper_signal)$self)->props.length; } char get_type() { return ((mapper_signal)$self)->props.type; } booltype get_is_output() { return ((mapper_signal)$self)->props.is_output; } const char* get_device_name() { return ((mapper_signal)$self)->props.device_name; } const char* get_unit() { return ((mapper_signal)$self)->props.unit; } mapper_db_signal get_properties() { return msig_properties((mapper_signal)$self); } void set_property(const char *key, maybePropVal val=0) { if (val) msig_set_property((mapper_signal)$self, key, val->type, val->value, val->length); else msig_remove_property((mapper_signal)$self, key); } void remove_property(const char *key) { msig_remove_property((mapper_signal)$self, key); } %pythoncode { minimum = property(get_minimum, set_minimum) maximum = property(get_maximum, set_maximum) name = property(get_name) full_name = property(get_full_name) length = property(get_length) type = property(get_type) is_output = property(get_is_output) unit = property(get_unit) def __propgetter(self): signal = self props = self.get_properties() class propsetter(dict): __getitem__ = props.__getitem__ def __setitem__(self, key, value): props[key] = value signal.set_property(key, value) return propsetter(self.get_properties()) properties = property(__propgetter) def set_properties(self, props): [self.set_property(k, props[k]) for k in props] def __setattr__(self, name, value): try: {'minimum': self.set_minimum, 'maximum': self.set_maximum}[name](value) except KeyError: _swig_setattr(self, signal, name, value) } } %extend _monitor { _monitor(admin *DISOWN=0, int autosubscribe_flags=0x00) { return (monitor *)mapper_monitor_new((mapper_admin) DISOWN, autosubscribe_flags); } ~_monitor() { mapper_monitor_free((mapper_monitor)$self); } int poll(int timeout=0) { _save = PyEval_SaveThread(); int rc = mapper_monitor_poll((mapper_monitor)$self, timeout); PyEval_RestoreThread(_save); return rc; } db *get_db() { return (db *)mapper_monitor_get_db((mapper_monitor)$self); } void autosubscribe(int autosubscribe_flags) { mapper_monitor_autosubscribe((mapper_monitor)$self, autosubscribe_flags); } void subscribe(const char *name, int subscribe_flags=0, int timeout=0) { return mapper_monitor_subscribe((mapper_monitor)$self, name, subscribe_flags, timeout); } void unsubscribe(const char *name) { return mapper_monitor_unsubscribe((mapper_monitor)$self, name); } void request_devices() { mapper_monitor_request_devices((mapper_monitor)$self); } void link(const char* source_device, const char* dest_device, mapper_db_link_with_flags_t *properties=0) { if (properties) { mapper_monitor_link((mapper_monitor)$self, source_device, dest_device, &properties->props, properties->flags); } else mapper_monitor_link((mapper_monitor)$self, source_device, dest_device, 0, 0); } void unlink(const char* source_device, const char* dest_device) { mapper_monitor_unlink((mapper_monitor)$self, source_device, dest_device); } void modify_connection(const char* source_signal, const char* dest_signal, mapper_db_connection_with_flags_t *properties) { if (properties) { mapper_monitor_connection_modify((mapper_monitor)$self, source_signal, dest_signal, &properties->props, properties->flags); } } void connect(const char* source_signal, const char* dest_signal, mapper_db_connection_with_flags_t *properties=0) { if (properties) { mapper_monitor_connect((mapper_monitor)$self, source_signal, dest_signal, &properties->props, properties->flags); } else mapper_monitor_connect((mapper_monitor)$self, source_signal, dest_signal, 0, 0); } void disconnect(const char* source_signal, const char* dest_signal) { mapper_monitor_disconnect((mapper_monitor)$self, source_signal, dest_signal); } double now() { mapper_timetag_t tt; mapper_monitor_now((mapper_monitor)$self, &tt); return mapper_timetag_get_double(tt); } void flush(int timeout = ADMIN_TIMEOUT_SEC, int quiet = 1) { mapper_monitor_flush_db((mapper_monitor)$self, timeout, quiet); } %pythoncode { db = property(get_db) } } %extend _db { void add_device_callback(PyObject *PyFunc) { Py_XINCREF(PyFunc); mapper_db_add_device_callback((mapper_db)$self, device_db_handler_py, PyFunc); } void remove_device_callback(PyObject *PyFunc) { mapper_db_remove_device_callback((mapper_db)$self, device_db_handler_py, PyFunc); Py_XDECREF(PyFunc); } void add_signal_callback(PyObject *PyFunc) { Py_XINCREF(PyFunc); mapper_db_add_signal_callback((mapper_db)$self, signal_db_handler_py, PyFunc); } void remove_signal_callback(PyObject *PyFunc) { mapper_db_remove_signal_callback((mapper_db)$self, signal_db_handler_py, PyFunc); Py_XDECREF(PyFunc); } void add_connection_callback(PyObject *PyFunc) { Py_XINCREF(PyFunc); mapper_db_add_connection_callback((mapper_db)$self, connection_db_handler_py, PyFunc); } void remove_connection_callback(PyObject *PyFunc) { mapper_db_remove_connection_callback((mapper_db)$self, connection_db_handler_py, PyFunc); Py_XDECREF(PyFunc); } void add_link_callback(PyObject *PyFunc) { Py_XINCREF(PyFunc); mapper_db_add_link_callback((mapper_db)$self, link_db_handler_py, PyFunc); } void remove_link_callback(PyObject *PyFunc) { mapper_db_remove_link_callback((mapper_db)$self, link_db_handler_py, PyFunc); Py_XDECREF(PyFunc); } mapper_db_device get_device_by_name(const char *device_name) { return mapper_db_get_device_by_name((mapper_db)$self, device_name); } mapper_db_device_t **get_all_devices() { return mapper_db_get_all_devices((mapper_db)$self); } mapper_db_device_t **__match_devices_by_name(const char *device) { return mapper_db_match_devices_by_name((mapper_db)$self, device); } mapper_db_device_t **device_next(long iterator) { return mapper_db_device_next((mapper_db_device_t**)iterator); } mapper_db_signal_t **get_all_inputs() { return mapper_db_get_all_inputs((mapper_db)$self); } mapper_db_signal_t **get_all_outputs() { return mapper_db_get_all_outputs((mapper_db)$self); } mapper_db_signal_t **get_inputs_by_device_name(const char *device_name) { return mapper_db_get_inputs_by_device_name((mapper_db)$self, device_name); } mapper_db_signal_t **get_outputs_by_device_name(const char *device_name) { return mapper_db_get_outputs_by_device_name((mapper_db)$self, device_name); } mapper_db_signal get_input_by_device_and_signal_name(const char *device_name, const char *signal_name) { return mapper_db_get_input_by_device_and_signal_names((mapper_db)$self, device_name, signal_name); } mapper_db_signal get_output_by_device_and_signal_name(const char *device_name, const char *signal_name) { return mapper_db_get_output_by_device_and_signal_names((mapper_db)$self, device_name, signal_name); } mapper_db_signal_t **__match_inputs_by_device_name( const char *device_name, const char *input_pattern) { return mapper_db_match_inputs_by_device_name((mapper_db)$self, device_name, input_pattern); } mapper_db_signal_t **__match_outputs_by_device_name( const char *device_name, char const *output_pattern) { return mapper_db_match_outputs_by_device_name((mapper_db)$self, device_name, output_pattern); } mapper_db_signal_t **signal_next(long iterator) { return mapper_db_signal_next((mapper_db_signal_t**)iterator); } mapper_db_connection_t **get_all_connections() { return mapper_db_get_all_connections((mapper_db)$self); } mapper_db_connection_t **get_connections_by_device_name( const char *device_name) { return mapper_db_get_connections_by_device_name((mapper_db)$self, device_name); } mapper_db_connection_t **get_connections_by_src_signal_name( const char *src_signal) { return mapper_db_get_connections_by_src_signal_name((mapper_db)$self, src_signal); } mapper_db_connection_t **get_connections_by_src_device_and_signal_names( const char *src_device, const char *src_signal) { return mapper_db_get_connections_by_src_device_and_signal_names( (mapper_db)$self, src_device, src_signal); } mapper_db_connection_t **get_connections_by_dest_signal_name( const char *dest_signal) { return mapper_db_get_connections_by_dest_signal_name((mapper_db)$self, dest_signal); } mapper_db_connection_t **get_connections_by_dest_device_and_signal_names( const char *dest_device, const char *dest_signal) { return mapper_db_get_connections_by_dest_device_and_signal_names( (mapper_db)$self, dest_device, dest_signal); } mapper_db_connection_t **get_connections_by_device_and_signal_names( const char *src_device, const char *src_signal, const char *dest_device, const char *dest_signal) { return mapper_db_get_connections_by_device_and_signal_names( (mapper_db)$self, src_device, src_signal, dest_device, dest_signal); } mapper_db_connection get_connection_by_signal_full_names( const char *src_name, const char *dest_name) { return mapper_db_get_connection_by_signal_full_names( (mapper_db)$self, src_name, dest_name); } mapper_db_connection_t **get_connections_by_src_dest_device_names( const char *src_device_name, const char *dest_device_name) { return mapper_db_get_connections_by_src_dest_device_names( (mapper_db)$self, src_device_name, dest_device_name); } mapper_db_connection_t **connection_next(long iterator) { return mapper_db_connection_next((mapper_db_connection_t**)iterator); } mapper_db_link_t **get_all_links() { return mapper_db_get_all_links((mapper_db)$self); } mapper_db_link_t **get_links_by_device_name(const char *dev_name) { return mapper_db_get_links_by_device_name((mapper_db)$self, dev_name); } mapper_db_link_t **get_links_by_src_device_name( const char *src_device_name) { return mapper_db_get_links_by_src_device_name((mapper_db)$self, src_device_name); } mapper_db_link_t **get_links_by_dest_device_name( const char *dest_device_name) { return mapper_db_get_links_by_dest_device_name((mapper_db)$self, dest_device_name); } mapper_db_link get_link_by_src_dest_names(const char *src_device_name, const char *dest_device_name) { return mapper_db_get_link_by_src_dest_names((mapper_db)$self, src_device_name, dest_device_name); } mapper_db_link_t **link_next(long iterator) { return mapper_db_link_next((mapper_db_link_t**)iterator); } %pythoncode { def make_iterator(first, next): def it(self, *args): (d, p) = first(self, *args) while p: yield d (d, p) = next(self, p) return it all_devices = make_iterator(get_all_devices, device_next) match_devices_by_name = make_iterator(__match_devices_by_name, device_next) all_inputs = make_iterator(get_all_inputs, signal_next) all_outputs = make_iterator(get_all_outputs, signal_next) inputs_by_device_name = make_iterator(get_inputs_by_device_name, signal_next) outputs_by_device_name = make_iterator(get_outputs_by_device_name, signal_next) match_inputs_by_device_name = make_iterator( __match_inputs_by_device_name, signal_next) match_outputs_by_device_name = make_iterator( __match_outputs_by_device_name, signal_next) all_connections = make_iterator(get_all_connections, connection_next) connections_by_device_name = make_iterator(get_connections_by_device_name, connection_next) connections_by_src_signal_name = make_iterator(get_connections_by_src_signal_name, connection_next) connections_by_src_device_and_signal_names = make_iterator( get_connections_by_src_device_and_signal_names, connection_next) connections_by_dest_signal_name = make_iterator(get_connections_by_dest_signal_name, connection_next) connections_by_dest_device_and_signal_names = make_iterator( get_connections_by_dest_device_and_signal_names, connection_next) connections_by_device_and_signal_names = make_iterator( get_connections_by_device_and_signal_names, connection_next) connections_by_src_dest_device_names = make_iterator( get_connections_by_src_dest_device_names, connection_next) all_links = make_iterator(get_all_links, link_next) links_by_device_name = make_iterator(get_links_by_device_name, link_next) links_by_src_device_name = make_iterator( get_links_by_src_device_name, link_next) links_by_dest_device_name = make_iterator( get_links_by_dest_device_name, link_next) } } %extend _admin { _admin(const char *iface=0, const char *ip=0, int port=7570) { return (admin *)mapper_admin_new(iface, ip, port); } ~_admin() { mapper_admin_free((mapper_admin)$self); } const char *libversion() { return mapper_admin_libversion((mapper_admin)$self); } } libmapper/swig/test.py0000755000175000017500000000754612423630127014342 0ustar tiagotiago import sys, mapper def h(sig, id, f, timetag): try: print sig.name, f except: print 'exception' print sig, f def setup(d): sig = d.add_input("/freq", 1, 'i', "Hz", None, None, h) print 'inputs',d.num_inputs print 'minimum',sig.minimum sig.minimum = 34.0 print 'minimum',sig.minimum sig.minimum = 12 print 'minimum',sig.minimum sig.minimum = None print 'minimum',sig.minimum print 'port',d.port print 'device name',d.name print 'device port',d.port print 'device ip',d.ip4 print 'device interface',d.interface print 'device ordinal',d.ordinal print 'signal name',sig.name print 'signal full name',sig.full_name while not d.ready(): d.poll(10) print 'port',d.port print 'device name',d.name print 'device ip',d.ip4 print 'device interface',d.interface print 'device ordinal',d.ordinal print 'signal name',sig.name print 'signal full name',sig.full_name print 'signal is_output',sig.is_output print 'signal length',sig.length print 'signal type', sig.type print 'signal is_output', sig.is_output print 'signal unit', sig.unit d.set_properties({"testInt":5, "testFloat":12.7, "testString":"test", "removed1":"shouldn't see this"}) d.properties['testInt'] = 7 d.set_properties({"removed1":None, "removed2":"test"}) d.remove_property("removed2") print 'device properties', d.properties print 'signal properties:', sig.properties sig.properties['testInt'] = 3 print 'signal properties:', sig.properties d.add_input("/insig", 4, 'f', None, None, None, h) d.add_output("/outsig", 4, 'f') print 'setup done!' dev = mapper.device("test") setup(dev) def db_cb(rectype, record, action): print rectype,'callback -' print ' record:',record print ' action:',["MODIFY","NEW","REMOVE"][action] mon = mapper.monitor(autosubscribe_flags=mapper.SUB_DEVICE) mon.db.add_device_callback(lambda x,y:db_cb('device',x,y)) mon.db.add_signal_callback(lambda x,y:db_cb('signal',x,y)) mon.db.add_connection_callback(lambda x,y:db_cb('connection',x,y)) l = lambda x,y:db_cb('link',x,y) mon.db.add_link_callback(l) mon.db.remove_link_callback(l) while not dev.ready(): dev.poll(10) mon.poll() for i in range(1000): dev.poll(10) mon.poll() if i==250: for i in [('devices', mon.db.all_devices), ('inputs', mon.db.all_inputs), ('outputs', mon.db.all_outputs), ('connections', mon.db.all_connections), ('links', mon.db.all_links)]: print i[0],':' for j in i[1](): print j print 'devices matching "send":' for i in mon.db.match_devices_by_name('send'): print i print 'outputs for device "/testsend.1" matching "3":' for i in mon.db.match_outputs_by_device_name('/testsend.1', '3'): print i print 'links for device "/testsend.1":' for i in mon.db.links_by_src_device_name('/testsend.1'): print i print 'link for /testsend.1, /testrecv.1:' print mon.db.get_link_by_src_dest_names("/testsend.1", "/testrecv.1") print 'not found link:' print mon.db.get_link_by_src_dest_names("/foo", "/bar") mon.link("/test.1", "/test.1") if i==500: mon.connect("/test.1/outsig", "/test.1/insig", {'mode': mapper.MO_EXPRESSION, 'expression': 'y=x', 'src_min': [1,2,3,4], 'bound_min': mapper.BA_WRAP, 'bound_max': mapper.BA_CLAMP}) if i==750: mon.modify_connection("/test.1/outsig", "/test.1/insig", {'src_min':[10,11,12,13], 'muted':True, 'mode': mapper.MO_LINEAR}) libmapper/swig/Makefile.in0000644000175000017500000003342012423630127015041 0ustar tiagotiago# 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 = swig DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/setup.py.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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 = setup.py 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 = 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) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ _CXX = $(filter-out ccache,$(CXX)) MOSTLYCLEANFILES = _mapper.$(PYEXT) mapper.py mapper_wrap.c installed_files.log EXTRA_DIST = mapper.i tkgui.py copywhich.sh all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign swig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign swig/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 all-local 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am distclean \ distclean-generic distclean-libtool 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-exec-hook 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-hook all-local: _mapper.$(PYEXT) $(builddir)/%_wrap.c %.py: %.i $(SWIG) -I$(top_srcdir)/include -python -o $(builddir)/mapper_wrap.c \ $(srcdir)/mapper.i # Don't interfere with distutils CFLAGS _%.$(PYEXT): $(builddir)/%_wrap.c env CFLAGS="" CXX="$(_CXX)" python setup.py build_ext cp -v `./copywhich.sh $@` . clean-local: -@rm -vf mapper.py mapper_wrap.c python setup.py clean --all install-exec-hook: $(builddir)/mapper_wrap.c if test -n "$(DESTDIR)"; then\ python setup.py install --root=$(DESTDIR) --prefix=$(prefix) --record=@top_builddir@/swig/installed_files.log; \ else \ python setup.py install --prefix=$(prefix) --record=@top_builddir@/swig/installed_files.log; \ fi uninstall-hook: cat @top_builddir@/swig/installed_files.log \ | awk '{print "$(DESTDIR)"$$1}' | xargs rm -vf # 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: libmapper/swig/testcallbacks.py0000755000175000017500000000323412423630127016170 0ustar tiagotiago#!/usr/bin/env python import sys, mapper def link_h(dev, link, action): try: print '-->', dev['name'], 'added' if action == mapper.MDEV_LOCAL_ESTABLISHED else 'removed', 'link from', link['dest_name'] if dev['name'] == link['src_name'] else link['src_name'] except: print 'exception' print dev print link print action def connect_h(dev, link, sig, con, action): try: print '-->', dev['name'], 'added' if action == mapper.MDEV_LOCAL_ESTABLISHED else 'removed', 'connection from', link['dest_name']+con['dest_name'] if dev['name'] == link['src_name'] else link['src_name']+con['src_name'] except: print 'exception' print dev print link print action src = mapper.device("src") src.set_link_callback(link_h) src.set_connection_callback(connect_h) outsig = src.add_output("/outsig", 1, 'f', None, 0, 1000) dest = mapper.device("dest") dest.set_link_callback(link_h) dest.set_connection_callback(connect_h) insig = dest.add_input("/insig", 1, 'f', None, 0, 1) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name), {'mode': mapper.MO_REVERSE}) monitor.poll() for i in range(10): src.poll(10) dest.poll(10) monitor.disconnect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name)) monitor.unlink('%s' %src.name, '%s' %dest.name) for i in range(10): src.poll(10) dest.poll(10) libmapper/swig/setup.py.in0000644000175000017500000000226412423630127015115 0ustar tiagotiago#!/usr/bin/env python """ setup.py file for SWIG mapper """ from distutils.core import setup, Extension LO_LIBS = "@liblo_LIBS@" LO_LDDIRS = [x[2:] for x in LO_LIBS.split() if x[0:2]=='-L'] LO_LDLIBS = [x[2:] for x in LO_LIBS.split() if x[0:2]=='-l'] LO_CFLAGS = "@liblo_CFLAGS@" LO_INCDIRS = [x[2:] for x in LO_CFLAGS.split() if x[0:2]=='-I'] mapper_module = Extension('_mapper', sources=['mapper_wrap.c'], include_dirs=['@top_srcdir@/src', '@top_builddir@/src', '@top_srcdir@/include']+LO_INCDIRS, library_dirs=['@top_builddir@/src/.libs']+LO_LDDIRS, libraries=['mapper-0']+LO_LDLIBS, ) setup (name = 'mapper', version = '@PACKAGE_VERSION@', author = "libmapper.org", author_email = "dot_mapper@googlegroups.com", url = "http://libmapper.org", description = """A library for mapping controllers and synthesizers.""", license = "GNU LGPL version 2.1 or later", ext_modules = [mapper_module], py_modules = ["mapper"], ) libmapper/swig/testreverse.py0000755000175000017500000000154112423630127015723 0ustar tiagotiago#!/usr/bin/env python import sys, mapper def h(sig, id, f, timetag): try: print '--> source received', f except: print 'exception' print sig, f src = mapper.device("src") outsig = src.add_output("/outsig", 1, 'f', None, 0, 1000) outsig.set_callback(h) dest = mapper.device("dest") insig = dest.add_input("/insig", 1, 'f', None, 0, 1) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig.name), '%s%s' %(dest.name, insig.name), {'mode': mapper.MO_REVERSE}) monitor.poll() for i in range(100): print 'updating destination to', i, '-->' insig.update(i) src.poll(10) dest.poll(10) libmapper/swig/Makefile.am0000644000175000017500000000171112423630127015026 0ustar tiagotiago _CXX = $(filter-out ccache,$(CXX)) all-local: _mapper.$(PYEXT) $(builddir)/%_wrap.c %.py: %.i $(SWIG) -I$(top_srcdir)/include -python -o $(builddir)/mapper_wrap.c \ $(srcdir)/mapper.i # Don't interfere with distutils CFLAGS _%.$(PYEXT): $(builddir)/%_wrap.c env CFLAGS="" CXX="$(_CXX)" python setup.py build_ext cp -v `./copywhich.sh $@` . clean-local: -@rm -vf mapper.py mapper_wrap.c python setup.py clean --all MOSTLYCLEANFILES = _mapper.$(PYEXT) mapper.py mapper_wrap.c installed_files.log install-exec-hook: $(builddir)/mapper_wrap.c if test -n "$(DESTDIR)"; then\ python setup.py install --root=$(DESTDIR) --prefix=$(prefix) --record=@top_builddir@/swig/installed_files.log; \ else \ python setup.py install --prefix=$(prefix) --record=@top_builddir@/swig/installed_files.log; \ fi uninstall-hook: cat @top_builddir@/swig/installed_files.log \ | awk '{print "$(DESTDIR)"$$1}' | xargs rm -vf EXTRA_DIST = mapper.i tkgui.py copywhich.sh libmapper/swig/testqueue.py0000755000175000017500000000224012423630127015371 0ustar tiagotiago#!/usr/bin/env python import sys, mapper, random def h(sig, id, f, timetag): print ' handler got', sig.name, '=', f, 'at time', timetag src = mapper.device("src") outsig1 = src.add_output("/outsig1", 1, 'i', None, 0, 1000) outsig2 = src.add_output("/outsig2", 1, 'i', None, 0, 1000) dest = mapper.device("dest") insig1 = dest.add_input("/insig1", 1, 'f', None, 0, 1, h) insig2 = dest.add_input("/insig2", 1, 'f', None, 0, 1, h) while not src.ready() or not dest.ready(): src.poll() dest.poll(10) monitor = mapper.monitor() monitor.link('%s' %src.name, '%s' %dest.name) while not src.num_links_out: src.poll() dest.poll(10) monitor.connect('%s%s' %(src.name, outsig1.name), '%s%s' %(dest.name, insig1.name), {'mode': mapper.MO_LINEAR}) monitor.connect('%s%s' %(src.name, outsig2.name), '%s%s' %(dest.name, insig2.name), {'mode': mapper.MO_LINEAR}) monitor.poll() for i in range(10): now = src.now() print 'Updating output signals to', i, 'at time', now src.start_queue(now) outsig1.update(i) outsig2.update(i) src.send_queue(now) dest.poll(100) src.poll(0) libmapper/NEWS0000777000175000017500000000000012423630127015035 2NEWS.markdownustar tiagotiagolibmapper/include/0000755000175000017500000000000012423630127013444 5ustar tiagotiagolibmapper/include/Makefile.in0000644000175000017500000004156412423630127015523 0ustar tiagotiago# 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 = include DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(libmapper_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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_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 = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libmapperdir)" HEADERS = $(libmapper_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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ libmapperdir = $(includedir)/mapper-@MAJOR_VERSION@/mapper libmapper_HEADERS = mapper/mapper.h mapper/mapper_types.h mapper/mapper_db.h \ mapper/mapper_cpp.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libmapperHEADERS: $(libmapper_HEADERS) @$(NORMAL_INSTALL) @list='$(libmapper_HEADERS)'; test -n "$(libmapperdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libmapperdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libmapperdir)" || 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)$(libmapperdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libmapperdir)" || exit $$?; \ done uninstall-libmapperHEADERS: @$(NORMAL_UNINSTALL) @list='$(libmapper_HEADERS)'; test -n "$(libmapperdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libmapperdir)'; $(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 $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libmapperdir)"; 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-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libmapperHEADERS 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libmapperHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ 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-libmapperHEADERS \ 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-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libmapperHEADERS # 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: libmapper/include/mapper/0000755000175000017500000000000012423630127014730 5ustar tiagotiagolibmapper/include/mapper/mapper.h0000644000175000017500000021765612423630127016406 0ustar tiagotiago#ifndef __MAPPER_H__ #define __MAPPER_H__ #ifdef __cplusplus extern "C" { #endif #include #include #define MAPPER_NOW ((mapper_timetag_t){0L,1L}) /*! \mainpage libmapper This is the API documentation for libmapper, a network-based signal mapping framework. Please see the Modules section for detailed information, and be sure to consult the tutorial to get started with libmapper concepts. */ /*** Signals ***/ /*! @defgroup signals Signals @{ Signals define inputs or outputs for devices. A signal consists of a scalar or vector value of some integer or floating-point type. A mapper_signal is created by adding an input or output to a device. It can optionally be provided with some metadata such as a signal's range, unit, or other properties. Signals can be mapped between linked devices anywhere on the network by creating connections through a GUI. */ struct _mapper_signal; typedef struct _mapper_signal *mapper_signal; struct _mapper_connection; /*! The set of possible actions on an instance, used to register callbacks * to inform them of what is happening. */ typedef enum { IN_NEW = 0x01, //!< New instance has been created. IN_UPSTREAM_RELEASE = 0x02, //!< Instance has been released by upstream device. IN_DOWNSTREAM_RELEASE = 0x04, //!< Instance has been released by downstream device. IN_OVERFLOW = 0x08, //!< No local instances left for incoming remote instance. IN_ALL = 0xFF } msig_instance_event_t; /*! A signal handler function can be called whenever a signal value * changes. */ typedef void mapper_signal_update_handler(mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *tt); /*! A handler function to be called whenever a signal instance management * event occurs. */ typedef void mapper_signal_instance_event_handler(mapper_signal msig, mapper_db_signal props, int instance_id, msig_instance_event_t event, mapper_timetag_t *tt); /*! Update the value of a signal. * The signal will be routed according to external requests. * \param sig The signal to update. * \param value A pointer to a new value for this signal. If the * signal type is 'i', this should be int*; if the signal type * is 'f', this should be float*. It should be an array at * least as long as the signal's length property. * \param count The number of instances of the value that are being * updated. For non-periodic signals, this should be 0 * or 1. For periodic signals, this may indicate that a * block of values should be accepted, where the last * value is the current value. * \param timetag The time at which the value update was aquired. If * the value is MAPPER_NOW, libmapper will tag the * value update with the current time. See * mdev_start_queue() for more information on * bundling multiple signal updates with the same * timetag. */ void msig_update(mapper_signal sig, void *value, int count, mapper_timetag_t timetag); /*! Update the value of a scalar signal of type int. * This is a scalar equivalent to msig_update(), for when passing by * value is more convenient than passing a pointer. * The signal will be routed according to external requests. * \param sig The signal to update. * \param value A new scalar value for this signal. */ void msig_update_int(mapper_signal sig, int value); /*! Update the value of a scalar signal of type float. * This is a scalar equivalent to msig_update(), for when passing by * value is more convenient than passing a pointer. * The signal will be routed according to external requests. * \param sig The signal to update. * \param value A new scalar value for this signal. */ void msig_update_float(mapper_signal sig, float value); /*! Update the value of a scalar signal of type double. * This is a scalar equivalent to msig_update(), for when passing by * value is more convenient than passing a pointer. * The signal will be routed according to external requests. * \param sig The signal to update. * \param value A new scalar value for this signal. */ void msig_update_double(mapper_signal sig, double value); /*! Get a signal's value. * \param sig The signal to operate on. * \param timetag A location to receive the value's time tag. * May be 0. * \return A pointer to an array containing the value * of the signal, or 0 if the signal has no value. */ void *msig_value(mapper_signal sig, mapper_timetag_t *timetag); /*! Query the values of any signals connected via mapping connections. * \param sig A local output signal. We will be querying the remote * ends of this signal's mapping connections. * \param tt A timetag to be attached to the outgoing query. Query * responses should also be tagged with this time. * \return The number of queries sent, or -1 for error. */ int msig_query_remotes(mapper_signal sig, mapper_timetag_t tt); /**** Instances ****/ /*! Add new instances to the reserve list. Note that if instance ids are specified, * libmapper will not add multiple instances with the same id. * \param sig The signal to which the instances will be added. * \param num The number of instances to add. * \param ids Array of integer ids, one for each new instance, * or 0 for automatically-generated instance ids. * \param user_data Array of user context pointers, one for each new instance, * or 0 if not needed. * \return Number of instances added. */ int msig_reserve_instances(mapper_signal sig, int num, int *ids, void **user_data); /*! Update the value of a specific signal instance. * The signal will be routed according to external requests. * \param sig The signal to operate on. * \param instance_id The instance to update. * \param value A pointer to a new value for this signal. If the * signal type is 'i', this should be int*; if the signal type * is 'f', this should be float*. It should be an array at * least as long as the signal's length property. * \param count The number of values being updated, or 0 for * non-periodic signals. * \param timetag The time at which the value update was aquired. If NULL, * libmapper will tag the value update with the current * time. See mdev_start_queue() for more information on * bundling multiple signal updates with the same timetag. */ void msig_update_instance(mapper_signal sig, int instance_id, void *value, int count, mapper_timetag_t timetag); /*! Release a specific instance of a signal by removing it from the list * of active instances and adding it to the reserve list. * \param sig The signal to operate on. * \param instance_id The instance to suspend. * \param timetag The time at which the instance was released; if NULL, * will be tagged with the current time. * See mdev_start_queue() for more information on * bundling multiple signal updates with the same timetag. */ void msig_release_instance(mapper_signal sig, int instance_id, mapper_timetag_t timetag); /*! Remove a specific instance of a signal and free its memory. * \param sig The signal to operate on. * \param instance_id The instance to suspend. */ void msig_remove_instance(mapper_signal sig, int instance_id); /*! Get the local id of the oldest active instance. * \param sig The signal to operate on. * \param instance_id A location to receive the instance id. * \return Zero if an instance id has been found, non-zero otherwise. */ int msig_get_oldest_active_instance(mapper_signal sig, int *instance_id); /*! Get the local id of the newest active instance. * \param sig The signal to operate on. * \param instance_id A location to receive the instance id. * \return Zero if an instance id has been found, non-zero otherwise. */ int msig_get_newest_active_instance(mapper_signal sig, int *instance_id); /*! Get a signal_instance's value. * \param sig The signal to operate on. * \param instance_id The instance to operate on. * \param timetag A location to receive the value's time tag. * May be 0. * \return A pointer to an array containing the value * of the signal instance, or 0 if the signal instance * has no value. */ void *msig_instance_value(mapper_signal sig, int instance_id, mapper_timetag_t *timetag); /*! Copy group/routing data for sharing an instance abstraction * between multiple signals. * \param from The signal to copy from. * \param to The signal to copy to. * \param instance_id The instance to copy. */ void msig_match_instances(mapper_signal from, mapper_signal to, int instance_id); /*! Return the number of active instances owned by a signal. * \param sig The signal to query. * \return The number of active instances. */ int msig_num_active_instances(mapper_signal sig); /*! Return the number of reserved instances owned by a signal. * \param sig The signal to query. * \return The number of active instances. */ int msig_num_reserved_instances(mapper_signal sig); /*! Get an active signal instance's ID by its index. Intended to be * used for iterating over the active instances. * \param sig The signal to operate on. * \param index The numerical index of the ID to retrieve. Shall be * between zero and the return value of * msig_num_active_instances(). * \return The instance ID associated with the given index. */ int msig_active_instance_id(mapper_signal sig, int index); /*! Set the allocation method to be used when a previously-unseen * instance ID is received. * \param sig The signal to operate on. * \param mode Method to use for adding or reallocating active instances * if no reserved instances are available. */ void msig_set_instance_allocation_mode(mapper_signal sig, mapper_instance_allocation_type mode); /*! Get the allocation method to be used when a previously-unseen * instance ID is received. * \param sig The signal to operate on. * \return The allocation mode of the provided signal. */ mapper_instance_allocation_type msig_get_instance_allocation_mode(mapper_signal sig); /*! Set the handler to be called on signal instance management events. * \param sig The signal to operate on. * \param h A handler function for processing instance managment events. * \param flags Bitflags for indicating the types of events which should * trigger the callback. Can be a combination of IN_NEW, * IN_UPSTREAM_RELEASE, IN_DOWNSTREAM_RELEASE, and IN_OVERFLOW. * \param user_data User context pointer to be passed to handler. */ void msig_set_instance_event_callback(mapper_signal sig, mapper_signal_instance_event_handler h, int flags, void *user_data); /*! Associate a signal instance with an arbitrary pointer. * \param sig The signal to operate on. * \param instance_id The instance to operate on. * \param user_data A pointer to user data to be associated * with this instance. */ void msig_set_instance_data(mapper_signal sig, int instance_id, void *user_data); /*! Retrieve the arbitrary pointer associated with a signal instance. * \param sig The signal to operate on. * \param instance_id The instance to operate on. * \return A pointer associated with this instance. */ void *msig_get_instance_data(mapper_signal sig, int instance_id); /*! Set or unset the message handler for a signal. * \param sig The signal to operate on. * \param handler A pointer to a mapper_signal_update_handler * function for processing incoming messages. * \param user_data User context pointer to be passed to handler. */ void msig_set_callback(mapper_signal sig, mapper_signal_update_handler *handler, void *user_data); /*! Get the number of connections attatched to a specific signal. * \param sig The signal to check. * \return The number of attached connections. */ int msig_num_connections(mapper_signal sig); /**** Signal properties ****/ /*! Get the full OSC name of a signal, including device name * prefix. * \param sig The signal value to query. * \param name A string to accept the name. * \param len The length of string pointed to by name. * \return The number of characters used, or 0 if error. Note that * in some cases the name may not be available. */ int msig_full_name(mapper_signal sig, char *name, int len); /*! Set or remove the minimum of a signal. * \param sig The signal to operate on. * \param minimum Must be the same type as the signal, or 0 to remove * the minimum. */ void msig_set_minimum(mapper_signal sig, void *minimum); /*! Set or remove the maximum of a signal. * \param sig The signal to operate on. * \param maximum Must be the same type as the signal, or 0 to remove * the maximum. */ void msig_set_maximum(mapper_signal sig, void *maximum); /*! Set the rate of a signal. * \param sig The signal to operate on. * \param rate A rate for this signal in samples/second, or zero * for non-periodic signals. */ void msig_set_rate(mapper_signal sig, float rate); /*! Get a signal's property structure. * \param sig The signal to operate on. * \return A structure containing the signal's properties. */ mapper_db_signal msig_properties(mapper_signal sig); /*! Set a property of a signal. Can be used to provide arbitrary * metadata. Value pointed to will be copied. * \param sig The signal to operate on. * \param property The name of the property to add. * \param type The property datatype. * \param value An array of property values. * \param length The length of value array. */ void msig_set_property(mapper_signal sig, const char *property, char type, void *value, int length); /*! Remove a property of a signal. * \param sig The signal to operate on. * \param property The name of the property to remove. */ void msig_remove_property(mapper_signal sig, const char *property); /* @} */ /*** Devices ***/ /*! @defgroup devices Devices @{ A device is an entity on the network which has input and/or output signals. The mapper_device is the primary interface through which a program uses libmapper. A device must have a name, to which a unique ordinal is subsequently appended. It can also be given other user-specified metadata. Devices must be linked before their signals can be connected, which is accomplished by requests from an external GUI. */ /*! Allocate and initialize a mapper device. * \param name_prefix A short descriptive string to identify the device. * \param port An optional port for starting the port allocation * scheme. * \param admin A previously allocated admin to use. If 0, an * admin will be allocated for use with this device. * \return A newly allocated mapper device. Should be free * using mdev_free(). */ mapper_device mdev_new(const char *name_prefix, int port, mapper_admin admin); //! Free resources used by a mapper device. void mdev_free(mapper_device dev); /*! Add an input signal to a mapper device. Values and strings * pointed to by this call (except user_data) will be copied. * For minimum and maximum, actual type must correspond to 'type'. * If type='i', then int*; if type='f', then float*. * \param dev The device to add a signal to. * \param name The name of the signal. * \param length The length of the signal vector, or 1 for a scalar. * \param type The type fo the signal value. * \param unit The unit of the signal, or 0 for none. * \param minimum Pointer to a minimum value, or 0 for none. * \param maximum Pointer to a maximum value, or 0 for none. * \param handler Function to be called when the value of the * signal is updated. * \param user_data User context pointer to be passed to handler. */ mapper_signal mdev_add_input(mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, mapper_signal_update_handler *handler, void *user_data); /*! Add an input signal with multiple instances to a mapper device. * Values and strings pointed to by this call (except user_data) will be copied. * For minimum and maximum, actual type must correspond to 'type'. * If type='i', then int*; if type='f', then float*. * \param dev The device to add a signal to. * \param name The name of the signal. * \param length The length of the signal vector, or 1 for a scalar. * \param type The type fo the signal value. * \param unit The unit of the signal, or 0 for none. * \param minimum Pointer to a minimum value, or 0 for none. * \param maximum Pointer to a maximum value, or 0 for none. * \param num_instances Number of instances to reserve. * \param handler Function to be called when the value of the * signal is updated. * \param user_data User context pointer to be passed to handler. */ mapper_signal mdev_add_poly_input(mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances, mapper_signal_update_handler *handler, void *user_data); /*! Add an output signal to a mapper device. Values and strings * pointed to by this call (except user_data) will be copied. * For minimum and maximum, actual type must correspond to 'type'. * If type='i', then int*; if type='f', then float*. * \param dev The device to add a signal to. * \param name The name of the signal. * \param length The length of the signal vector, or 1 for a scalar. * \param type The type fo the signal value. * \param unit The unit of the signal, or 0 for none. * \param minimum Pointer to a minimum value, or 0 for none. * \param maximum Pointer to a maximum value, or 0 for none. */ mapper_signal mdev_add_output(mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum); /*! Add an output signal with multiple instances to a mapper device. * Values and strings pointed to by this call (except user_data) will be copied. * For minimum and maximum, actual type must correspond to 'type'. * If type='i', then int*; if type='f', then float*. * \param dev The device to add a signal to. * \param name The name of the signal. * \param length The length of the signal vector, or 1 for a scalar. * \param type The type fo the signal value. * \param unit The unit of the signal, or 0 for none. * \param num_instances Number of instances to reserve. * \param minimum Pointer to a minimum value, or 0 for none. * \param maximum Pointer to a maximum value, or 0 for none. */ mapper_signal mdev_add_poly_output(mapper_device dev, const char *name, int length, char type, const char *unit, void *minimum, void *maximum, int num_instances); /* Remove a device's input signal. * \param dev The device to remove a signal from. * \param sig The signal to remove. */ void mdev_remove_input(mapper_device dev, mapper_signal sig); /* Remove a device's output signal. * \param dev The device to remove a signal from. * \param sig The signal to remove. */ void mdev_remove_output(mapper_device dev, mapper_signal sig); //! Return the number of inputs. int mdev_num_inputs(mapper_device dev); //! Return the number of outputs. int mdev_num_outputs(mapper_device dev); //! Return the number of incoming links. int mdev_num_links_in(mapper_device dev); //! Return the number of outgoing links. int mdev_num_links_out(mapper_device dev); //! Return the number of incoming connections. int mdev_num_connections_in(mapper_device dev); //! Return the number of outgoing connections. int mdev_num_connections_out(mapper_device dev); /*! Get input signals. * \param dev Device to search in. * \return Pointer to the linked list of input mapper_signals, or zero * if not found. */ mapper_signal *mdev_get_inputs(mapper_device dev); /*! Get output signals. * \param dev Device to search in. * \return Pointer to the linked list of output mapper_signals, or zero * if not found. */ mapper_signal *mdev_get_outputs(mapper_device dev); /*! Get an input signal with a given name. * \param dev Device to search in. * \param name Name of input signal to search for. It may optionally * begin with a '/' character. * \param index Optional place to receive the index of the matching signal. * \return Pointer to the mapper_signal describing the signal, or zero * if not found. */ mapper_signal mdev_get_input_by_name(mapper_device dev, const char *name, int *index); /*! Get an output signal with a given name. * \param dev Device to search in. * \param name Name of output signal to search for. It may optionally * begin with a '/' character. * \param index Optional place to receive the index of the matching signal. * \return Pointer to the mapper_signal describing the signal, or zero * if not found. */ mapper_signal mdev_get_output_by_name(mapper_device dev, const char *name, int *index); /* Get an input signal with the given index. * \param dev The device to search in. * \param index Index of the signal to retrieve. * \return Pointer to the mapper_signal describing the signal, or zero * if not found. */ mapper_signal mdev_get_input_by_index(mapper_device dev, int index); /* Get an output signal with the given index. * \param dev The device to search in. * \param index Index of the signal to retrieve. * \return Pointer to the mapper_signal describing the signal, or zero * if not found. */ mapper_signal mdev_get_output_by_index(mapper_device dev, int index); /*! Get a device's property structure. * \param dev The device to operate on. * \return A structure containing the device's properties. */ mapper_db_device mdev_properties(mapper_device dev); /*! Set a property of a device. Can be used to provide arbitrary * metadata. Value pointed to will be copied. * \param dev The device to operate on. * \param property The name of the property to add. * \param type The property datatype. * \param value An array of property values. * \param length The length of value array. */ void mdev_set_property(mapper_device dev, const char *property, char type, void *value, int length); /*! Remove a property of a device. * \param dev The device to operate on. * \param property The name of the property to remove. */ void mdev_remove_property(mapper_device dev, const char *property); /*! Poll this device for new messages. * Note, if you have multiple devices, the right thing to do is call * this function for each of them with block_ms=0, and add your own * sleep if necessary. * \param dev The device to check messages for. * \param block_ms Number of milliseconds to block waiting for * messages, or 0 for non-blocking behaviour. * \return The number of handled messages. May be zero if there was * nothing to do. */ int mdev_poll(mapper_device dev, int block_ms); /*! Return the number of file descriptors needed for this device. * This can be used to allocated an appropriately-sized list for * called to mdev_get_fds. Note that the number of descriptors * needed can change throughout the life of a device, therefore this * function should be called whenever the list of file descriptors is * needed. * \param md The device to count file descriptors for. * \return The number of file descriptors needed for the indicated * device. */ int mdev_num_fds(mapper_device md); /*! Write the list of file descriptors for this device to the provided * array. Up to num file descriptors will be written. These file * descriptors can be used as input for the read array of select or * poll, for example. * \param md The device to get file descriptors for. * \param fds Memory to receive file descriptors. * \param num The number of file descriptors pointed to by fds. * \return The number of file descriptors actually written to fds. */ int mdev_get_fds(mapper_device md, int *fds, int num); /*! If an external event indicates that a file descriptor for this * device needs servicing, this function should be called. * \param md The device that needs servicing. * \param fd The file descriptor that needs servicing. */ void mdev_service_fd(mapper_device md, int fd); /*! Detect whether a device is completely initialized. * \return Non-zero if device is completely initialized, i.e., has an * allocated receiving port and unique network name. Zero * otherwise. */ int mdev_ready(mapper_device dev); /*! Return a string indicating the device's full name, if it is * registered. The returned string must not be externally modified. * \param dev The device to query. * \return String containing the device's full name, or zero if it is * not available. */ const char *mdev_name(mapper_device dev); /*! Return the unique ID allocated to this device by the mapper network. * \param dev The device to query. * \return An integer indicating the device's ID, or zero if it is * not available. */ unsigned int mdev_id(mapper_device dev); /*! Return the port used by a device to receive signals, if available. * \param dev The device to query. * \return An integer indicating the device's port, or zero if it is * not available. */ unsigned int mdev_port(mapper_device dev); /*! Return the IPv4 address used by a device to receive signals, if available. * \param dev The device to query. * \return A pointer to an in_addr struct indicating the device's IP * address, or zero if it is not available. In general this * will be the IPv4 address associated with the selected * local network interface. */ const struct in_addr *mdev_ip4(mapper_device dev); /*! Return a string indicating the name of the network interface this * device is listening on. * \param dev The device to query. * \return A string containing the name of the network interface. */ const char *mdev_interface(mapper_device dev); /*! Return an allocated ordinal which is appended to this device's * network name. In general the results of this function are not * valid unless mdev_ready() returns non-zero. * \param dev The device to query. * \return A positive ordinal unique to this device (per name). */ unsigned int mdev_ordinal(mapper_device dev); /*! Start a time-tagged mapper queue. */ void mdev_start_queue(mapper_device md, mapper_timetag_t tt); /*! Dispatch a time-tagged mapper queue. */ void mdev_send_queue(mapper_device md, mapper_timetag_t tt); /*! Get access to the device's underlying lo_server. */ lo_server mdev_get_lo_server(mapper_device md); /*! Get the device's synchronization clock offset. */ double mdev_get_clock_offset(mapper_device md); /*! The set of possible actions on a local device link or * connection. */ typedef enum { MDEV_LOCAL_ESTABLISHED, MDEV_LOCAL_MODIFIED, MDEV_LOCAL_DESTROYED, } mapper_device_local_action_t; /*! Function to call when a local device link is established or * destroyed. */ typedef void mapper_device_link_handler(mapper_device dev, mapper_db_link link, mapper_device_local_action_t action, void *user); /*! Function to call when a local device connection is established or * destroyed. */ typedef void mapper_device_connection_handler(mapper_device dev, mapper_db_link link, mapper_signal sig, mapper_db_connection connection, mapper_device_local_action_t action, void *user); /*! Set a function to be called when a local device link is * established or destroyed, indicated by the action parameter to the * provided function. */ void mdev_set_link_callback(mapper_device dev, mapper_device_link_handler *h, void *user); /*! Set a function to be called when a local device connection is * established or destroyed, indicated by the action parameter to the * provided function. Important: if a link is destroyed, this * function will not be called for all connections in the link. */ void mdev_set_connection_callback(mapper_device dev, mapper_device_connection_handler *h, void *user); /* @} */ /*** Admins ***/ /*! @defgroup admins Admins @{ Admins handle the traffic on the multicast admin bus. In general, you do not need to worry about this interface, as an admin will be created automatically when allocating a device. An admin only needs to be explicitly created if you plan to override default settings for the admin bus. */ /*! Create an admin with custom parameters. Creating an admin object * manually is only required if you wish to specify custom network * parameters. Creating a device or monitor without specifying an * admin will give you an object working on the "standard" * configuration. * \param iface If non-zero, a string identifying a preferred network * interface. This string can be enumerated e.g. using * if_nameindex(). If zero, an interface will be * selected automatically. * \param group If non-zero, specify a multicast group address to use. * Zero indicates that the standard group 224.0.1.3 should * be used. * \param port If non-zero, specify a multicast port to use. Zero * indicates that the standard port 7570 should be used. * \return A newly allocated admin. Should be freed using * mapper_admin_free() */ mapper_admin mapper_admin_new(const char *iface, const char *group, int port); /*! Free an admin created with mapper_admin_new(). */ void mapper_admin_free(mapper_admin admin); /*! Get the version of libmapper */ const char *mapper_admin_libversion(mapper_admin admin); /* @} */ /**** Device database ****/ /*! The set of possible actions on a database record, used * to inform callbacks of what is happening to a record. */ typedef enum { MDB_MODIFY, MDB_NEW, MDB_REMOVE, MDB_UNRESPONSIVE, } mapper_db_action_t; /***** Devices *****/ /*! @defgroup devicedb Device database @{ A monitor may query information about devices on the network through this interface. */ /*! A callback function prototype for when a device record is added or * updated in the database. Such a function is passed in to * mapper_db_add_device_callback(). * \param record Pointer to the device record. * \param action A value of mapper_db_action_t indicating what * is happening to the database record. * \param user The user context pointer registered with this * callback. */ typedef void mapper_db_device_handler(mapper_db_device record, mapper_db_action_t action, void *user); /*! Register a callback for when a device record is added or updated * in the database. * \param db The database to query. * \param h Callback function. * \param user A user-defined pointer to be passed to the callback * for context . */ void mapper_db_add_device_callback(mapper_db db, mapper_db_device_handler *h, void *user); /*! Remove a device record callback from the database service. * \param db The database to query. * \param h Callback function. * \param user The user context pointer that was originally specified * when adding the callback. */ void mapper_db_remove_device_callback(mapper_db db, mapper_db_device_handler *h, void *user); /*! Return the whole list of devices. * \param db The database to query. * \return A double-pointer to the first item in the list of devices, * or zero if none. Use mapper_db_device_next() to * iterate. */ mapper_db_device_t **mapper_db_get_all_devices(mapper_db db); /*! Find information for a registered device. * \param db The database to query. * \param device_name Name of the device to find in the database. * \return Information about the device, or zero if not found. */ mapper_db_device mapper_db_get_device_by_name(mapper_db db, const char *device_name); /*! Look up information for a registered device using a hash of its name. * \param db The database to query. * \param name_hash CRC-32 name hash of the device to find in the database. * \return Information about the device, or zero if not found. */ mapper_db_device mapper_db_get_device_by_name_hash(mapper_db db, uint32_t name_hash); /*! Return the list of devices with a substring in their name. * \param db The database to query. * \param device_pattern The substring to search for. * \return A double-pointer to the first item in a list of matching * devices. Use mapper_db_device_next() to iterate. */ mapper_db_device_t **mapper_db_match_devices_by_name(mapper_db db, const char *device_pattern); /*! Given a device record pointer returned from a previous * mapper_db_return_*() call, get the next item in the list. * \param s The previous device record pointer. * \return A double-pointer to the next device record in the list, or * zero if no more devices. */ mapper_db_device_t **mapper_db_device_next(mapper_db_device_t **s); /*! Given a device record pointer returned from a previous * mapper_db_get_*() call, indicate that we are done iterating. * \param s The previous device record pointer. */ void mapper_db_device_done(mapper_db_device_t **s); /*! Look up a device property by index. To iterate all properties, * call this function from index=0, increasing until it returns zero. * \param dev The device to look at. * \param index Numerical index of a device property. * \param property Address of a string pointer to receive the name of * indexed property. May be zero. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_device_property_index(mapper_db_device dev, unsigned int index, const char **property, char *type, const void **value, int *length); /*! Look up a device property by name. * \param dev The device to look at. * \param property The name of the property to retrive. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_device_property_lookup(mapper_db_device dev, const char *property, char *type, const void **value, int *length); /*! Helper for printing typed mapper_prop values. * \param type The value type. * \param length The vector length of the value. * \param value A pointer to the property value to print. */ void mapper_prop_pp(char type, int length, const void *value); /* @} */ /***** Signals *****/ /*! @defgroup signaldb Signal database @{ A monitor may query information about signals on the network through this interface. It is also used by local signals to store property information. */ /*! A callback function prototype for when a signal record is added or * updated in the database. Such a function is passed in to * mapper_db_add_signal_callback(). * \param record Pointer to the signal record. * \param action A value of mapper_db_action_t indicating what * is happening to the database record. * \param user The user context pointer registered with this * callback. */ typedef void mapper_db_signal_handler(mapper_db_signal record, mapper_db_action_t action, void *user); /*! Register a callback for when a signal record is added or updated * in the database. * \param db The database to query. * \param h Callback function. * \param user A user-defined pointer to be passed to the callback * for context . */ void mapper_db_add_signal_callback(mapper_db db, mapper_db_signal_handler *h, void *user); /*! Remove a signal record callback from the database service. * \param db The database to query. * \param h Callback function. * \param user The user context pointer that was originally specified * when adding the callback. */ void mapper_db_remove_signal_callback(mapper_db db, mapper_db_signal_handler *h, void *user); /*! Return the list of all known inputs across all devices. * \param db The database to query. * \return A double-pointer to the first item in the list of results * or zero if none. Use mapper_db_signal_next() to iterate. */ mapper_db_signal_t **mapper_db_get_all_inputs(mapper_db db); /*! Return the list of all known outputs across all devices. * \param db The database to query. * \return A double-pointer to the first item in the list of results * or zero if none. Use mapper_db_signal_next() to iterate. */ mapper_db_signal_t **mapper_db_get_all_outputs(mapper_db db); /*! Return the list of inputs for a given device. * \param db The database to query. * \param device_name Name of the device to match for outputs. Must * be exact, including the leading '/'. * \return A double-pointer to the first item in the list of input * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_signal_t **mapper_db_get_inputs_by_device_name( mapper_db db, const char *device_name); /*! Return the list of outputs for a given device. * \param db The database to query. * \param device_name Name of the device to match for outputs. Must * be exact, including the leading '/'. * \return A double-pointer to the first item in the list of output * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_signal_t **mapper_db_get_outputs_by_device_name( mapper_db db, const char *device_name); /*! Find information for a registered input signal. * \param db The database to query. * \param device_name Name of the device to find in the database. * \param signal_name Name of the input signal to find in the database. * \return Information about the signal, or zero if not found. */ mapper_db_signal mapper_db_get_input_by_device_and_signal_names( mapper_db db, const char *device_name, const char *signal_name); /*! Find information for a registered output signal. * \param db The database to query. * \param device_name Name of the device to find in the database. * \param signal_name Name of the output signal to find in the database. * \return Information about the signal, or zero if not found. */ mapper_db_signal mapper_db_get_output_by_device_and_signal_names( mapper_db db, const char *device_name, char const *signal_name); /*! Return the list of inputs for a given device. * \param db The database to query. * \param device_name Name of the device to match for inputs. * \param input_pattern A substring to search for in the device inputs. * \return A double-pointer to the first item in the list of input * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_signal_t **mapper_db_match_inputs_by_device_name( mapper_db db, const char *device_name, const char *input_pattern); /*! Return the list of outputs for a given device. * \param db The database to query. * \param device_name Name of the device to match for outputs. * \param output_pattern A substring to search for in the device outputs. * \return A double-pointer to the first item in the list of output * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_signal_t **mapper_db_match_outputs_by_device_name( mapper_db db, const char *device_name, char const *output_pattern); /*! Given a signal record pointer returned from a previous * mapper_db_get_*() call, get the next item in the list. * \param s The previous signal record pointer. * \return A double-pointer to the next signal record in the list, or * zero if no more signals. */ mapper_db_signal_t **mapper_db_signal_next(mapper_db_signal_t **s); /*! Given a signal record pointer returned from a previous * mapper_db_get_*() call, indicate that we are done iterating. * \param s The previous signal record pointer. */ void mapper_db_signal_done(mapper_db_signal_t **s); /*! Look up a signal property by index. To iterate all properties, * call this function from index=0, increasing until it returns zero. * \param sig The signal to look at. * \param index Numerical index of a signal property. * \param property Address of a string pointer to receive the name of * indexed property. May be zero. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_signal_property_index(mapper_db_signal sig, unsigned int index, const char **property, char *type, const void **value, int *length); /*! Look up a signal property by name. * \param sig The signal to look at. * \param property The name of the property to retrive. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_signal_property_lookup(mapper_db_signal sig, const char *property, char *type, const void **value, int *length); /* @} */ /***** Connections *****/ /*! @defgroup connectiondb Connections database @{ A monitor may query information about connections between signals on the network through this interface. It is also used to specify properties during connection requests. */ /*! A callback function prototype for when a connection record is * added or updated in the database. Such a function is passed in to * mapper_db_add_connection_callback(). * \param record Pointer to the connection record. * \param action A value of mapper_db_action_t indicating what * is happening to the database record. * \param user The user context pointer registered with this * callback. */ typedef void mapper_db_connection_handler(mapper_db_connection record, mapper_db_action_t action, void *user); /*! Register a callback for when a connection record is added or * updated in the database. * \param db The database to query. * \param h Callback function. * \param user A user-defined pointer to be passed to the callback * for context . */ void mapper_db_add_connection_callback(mapper_db db, mapper_db_connection_handler *h, void *user); /*! Remove a connection record callback from the database service. * \param db The database to query. * \param h Callback function. * \param user The user context pointer that was originally specified * when adding the callback. */ void mapper_db_remove_connection_callback(mapper_db db, mapper_db_connection_handler *h, void *user); /*! Return a list of all registered connections. * \param db The database to query. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_all_connections(mapper_db db); /*! Return the list of connections that touch the given device name. * \param db The database to query. * \param device_name Name of the device to find. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_device_name( mapper_db db, const char *device_name); /*! Return the list of connections for a given source signal name. * \param db The database to query. * \param src_signal Name of the source signal. * \return A double-pointer to the first item in the list of results * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_src_signal_name( mapper_db db, const char *src_signal); /*! Return the list of connections for given source device and signal names. * \param db The database to query. * \param src_device Exact name of the device to find, including the * leading '/'. * \param src_signal Exact name of the signal to find, * including the leading '/'. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_src_device_and_signal_names( mapper_db db, const char *src_device, const char *src_signal); /*! Return the list of connections for a given destination signal name. * \param db The database to query. * \param dest_signal Name of the destination signal to find. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_dest_signal_name( mapper_db db, const char *dest_signal); /*! Return the list of connections for given destination device and signal names. * \param db The database to query. * \param dest_device Exact name of the device to find, including the * leading '/'. * \param dest_signal Exact name of the signal to find, including the * leading '/'. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_dest_device_and_signal_names( mapper_db db, const char *dest_device, const char *dest_signal); /*! Return the list of connections that touch any signals in the lists * of sources and destinations provided. * \param db The database to query. * \param src_device Exact name of the device to find, including the * leading '/'. * \param src_signal Exact name of the signal to find, including the * leading '/'. * \param dest_device Exact name of the device to find, including the * leading '/'. * \param dest_signal Exact name of the signal to find, including the * leading '/'. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_device_and_signal_names( mapper_db db, const char *src_device, const char *src_signal, const char *dest_device, const char *dest_signal); /*! Return the connection that match the exact source and destination * specified by their full names ("//"). * \param db The database to query. * \param src_name Full name of source signal. * \param dest_name Full name of destination signal. * \return A pointer to a structure containing information on the * found connection, or 0 if not found. */ mapper_db_connection mapper_db_get_connection_by_signal_full_names( mapper_db db, const char *src_name, const char *dest_name); /*! Return connections that have the specified source and destination * devices. * \param db The database to query. * \param src_device_name Name of source device. * \param dest_device_name Name of destination device. * \return A double-pointer to the first item in a list of results, * or 0 if not found. */ mapper_db_connection_t **mapper_db_get_connections_by_src_dest_device_names( mapper_db db, const char *src_device_name, const char *dest_device_name); /*! Return the list of connections that touch any signals in the lists * of sources and destinations provided. * \param db The database to query. * \param src Double-pointer to the first item in a list * returned from a previous database query. * \param dest Double-pointer to the first item in a list * returned from a previous database query. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_connection_next() to * iterate. */ mapper_db_connection_t **mapper_db_get_connections_by_signal_queries( mapper_db db, mapper_db_signal_t **src, mapper_db_signal_t **dest); /*! Given a connection record pointer returned from a previous * mapper_db_get_connections*() call, get the next item in the list. * \param s The previous connection record pointer. * \return A double-pointer to the next connection record in the * list, or zero if no more connections. */ mapper_db_connection_t **mapper_db_connection_next(mapper_db_connection_t **s); /*! Given a connection record pointer returned from a previous * mapper_db_get_*() call, indicate that we are done iterating. * \param s The previous connection record pointer. */ void mapper_db_connection_done(mapper_db_connection_t **s); /*! Look up a connection property by index. To iterate all properties, * call this function from index=0, increasing until it returns zero. * \param con The connection to look at. * \param index Numerical index of a connection property. * \param property Address of a string pointer to receive the name of * indexed property. May be zero. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_connection_property_index(mapper_db_connection con, unsigned int index, const char **property, char *type, const void **value, int *length); /*! Look up a connection property by name. * \param con The connection to look at. * \param property The name of the property to retrive. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_connection_property_lookup(mapper_db_connection con, const char *property, char *type, const void **value, int *length); /* @} */ /***** Links *****/ /*! @defgroup linkdb Links database @{ A monitor may query information about links betweend devices on the network through this interface. */ /*! A callback function prototype for when a link record is added or * updated in the database. Such a function is passed in to * mapper_db_add_link_callback(). * \param record Pointer to the link record. * \param action A value of mapper_db_action_t indicating what * is happening to the database record. * \param user The user context pointer registered with this * callback. */ typedef void mapper_db_link_handler(mapper_db_link record, mapper_db_action_t action, void *user); /*! Register a callback for when a link record is added or updated * in the database. * \param db The database to query. * \param h Callback function. * \param user A user-defined pointer to be passed to the callback * for context . */ void mapper_db_add_link_callback(mapper_db db, mapper_db_link_handler *h, void *user); /*! Remove a link record callback from the database service. * \param db The database to query. * \param h Callback function. * \param user The user context pointer that was originally specified * when adding the callback. */ void mapper_db_remove_link_callback(mapper_db db, mapper_db_link_handler *h, void *user); /*! Return the whole list of links. * \param db The database to query. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_link_next() to iterate. */ mapper_db_link_t **mapper_db_get_all_links(mapper_db db); /*! Return the list of links that touch the given device name. * \param db The database to query. * \param dev_name Name of the device to find. * \return A double-pointer to the first item in the list of results, * or zero if none. Use mapper_db_link_next() to iterate. */ mapper_db_link_t **mapper_db_get_links_by_device_name( mapper_db db, const char *dev_name); /*! Return the list of links for a given source name. * \param db The database to query. * \param src_device_name Name of the source device to find. * \return A double-pointer to the first item in the list of source * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_link_t **mapper_db_get_links_by_src_device_name( mapper_db db, const char *src_device_name); /*! Return the list of links for a given destination name. * \param db The database to query. * \param dest_device_name Name of the destination device to find. * \return A double-pointer to the first item in the list of destination * signals, or zero if none. Use mapper_db_signal_next() to * iterate. */ mapper_db_link_t **mapper_db_get_links_by_dest_device_name( mapper_db db, const char *dest_device_name); /*! Return the link structure associated with the exact devices specified. * \param db The database to query. * \param src_device_name Name of the source device to find. * \param dest_device_name Name of the destination device to find. * \return A structure containing information on the link, or 0 if * not found. */ mapper_db_link mapper_db_get_link_by_src_dest_names(mapper_db db, const char *src_device_name, const char *dest_device_name); /*! Return the list of links that touch devices in both src and dest lists. * \param db The database to query. * \param src_device_list Double-pointer to the first item in a list * returned from a previous database query. * \param dest_device_list Double-pointer to the first item in a list * returned from a previous database query. * \return A double-pointer to the first item in the list of links, * or zero if none. Use mapper_db_link_next() to iterate. */ mapper_db_link_t **mapper_db_get_links_by_src_dest_devices( mapper_db db, mapper_db_device_t **src_device_list, mapper_db_device_t **dest_device_list); /*! Given a link record double-pointer returned from a previous * mapper_db_get_links*() call, get the next item in the list. * \param s The previous link record double-pointer. * \return A double-pointer to the next link record in the list, or * zero if no more links. */ mapper_db_link_t **mapper_db_link_next(mapper_db_link_t **s); /*! Given a link record double-pointer returned from a previous * mapper_db_get_*() call, indicate that we are done iterating. * \param s The previous link record double-pointer. */ void mapper_db_link_done(mapper_db_link_t **s); /*! Look up a link property by index. To iterate all properties, * call this function from index=0, increasing until it returns zero. * \param link The link to look at. * \param index Numerical index of a link property. * \param property Address of a string pointer to receive the name of * indexed property. May be zero. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_link_property_index(mapper_db_link link, unsigned int index, const char **property, char *type, const void **value, int *length); /*! Look up a link property by name. * \param link The link to look at. * \param property The name of the property to retrive. * \param type A pointer to a location to receive the type of the * property value. (Required.) * \param value A pointer to a location to receive the address of the * property's value. (Required.) * \param length A pointer to a location to receive the vector length of * the property value. (Required.) * \return Zero if found, otherwise non-zero. */ int mapper_db_link_property_lookup(mapper_db_link link, const char *property, char *type, const void **value, int *length); /* @} */ /***** Monitors *****/ /*! @defgroup monitor Monitors @{ Monitors are the primary interface through which a program may observe the network and store information about devices and signals that are present. Each monitor has a database of devices, signals, connections, and links, which can be queried. A monitor can also make link and connection requests. In general, the monitor interface is useful for building GUI applications to control the network. */ /*! Bit flags for coordinating monitor metadata subscriptions. Subsets of * device information must also include SUB_DEVICE. */ #define SUB_DEVICE 0x01 #define SUB_DEVICE_INPUTS 0x03 #define SUB_DEVICE_OUTPUTS 0x05 #define SUB_DEVICE_SIGNALS 0x07 // SUB_DEVICE_INPUTS & SUB_DEVICE_OUTPUTS #define SUB_DEVICE_LINKS_IN 0x09 #define SUB_DEVICE_LINKS_OUT 0x11 #define SUB_DEVICE_LINKS 0x19 // SUB_DEVICE_LINKS_IN & SUB_DEVICE_LINKS_OUT #define SUB_DEVICE_CONNECTIONS_IN 0x21 #define SUB_DEVICE_CONNECTIONS_OUT 0x41 #define SUB_DEVICE_CONNECTIONS 0x61 // SUB_DEVICE_CONNECTIONS_IN & SUB_DEVICE_CONNECTION_OUT #define SUB_DEVICE_ALL 0xFF /*! Create a network monitor. * \param admin A previously allocated admin to use. If 0, an * admin will be allocated for use with this monitor. * \param autosubscribe_flags Sets whether the monitor should automatically * subscribe to information about signals, links, * and connections when it encounters a * previously-unseen device. * \return The new monitor. */ mapper_monitor mapper_monitor_new(mapper_admin admin, int autosubscribe_flags); /*! Free a network monitor. */ void mapper_monitor_free(mapper_monitor mon); /*! Poll a network monitor. * \param mon The monitor to poll. * \param block_ms The number of milliseconds to block, or 0 for * non-blocking behaviour. * \return The number of handled messages. */ int mapper_monitor_poll(mapper_monitor mon, int block_ms); /*! Get the database associated with a monitor. This can be used as * long as the monitor remains alive. */ mapper_db mapper_monitor_get_db(mapper_monitor mon); /*! Set the timeout in seconds after which a monitor will declare a device * "unresponsive". Defaults to ADMIN_TIMEOUT_SEC. * \param mon The monitor to use. * \param timeout The timeout in seconds. */ void mapper_monitor_set_timeout(mapper_monitor mon, int timeout); /*! Get the timeout in seconds after which a monitor will declare a device * "unresponsive". Defaults to ADMIN_TIMEOUT_SEC. * \param mon The monitor to use. * \return The current timeout in seconds. */ int mapper_monitor_get_timeout(mapper_monitor mon); /*! Remove unresponsive devices from the database. * \param mon The monitor to use. * \param timeout_sec The number of seconds a device must have been * unresponsive before removal. * \param quiet 1 to disable callbacks during db flush, 0 otherwise. */ void mapper_monitor_flush_db(mapper_monitor mon, int timeout_sec, int quiet); /*! Request that all devices report in. */ void mapper_monitor_request_devices(mapper_monitor mon); /*! Subscribe to information about a specific device. * \param mon The monitor to use. * \param device_name The name of the device of interest. * \param subscribe_flags Bitflags setting the type of information of interest. * Can be a combination of SUB_DEVICE, SUB_DEVICE_INPUTS, * SUB_DEVICE_OUTPUTS, SUB_DEVICE_SIGNALS, * SUB_DEVICE_LINKS_IN, SUB_DEVICE_LINKS_OUT, * SUB_DEVICE_LINKS, SUB_DEVICE_CONNECTIONS_IN, * SUB_DEVICE_CONNECTIONS_OUT, SUB_DEVICE_CONNECTIONS, * or simply SUB_DEVICE_ALL for all information. * \param timeout The length in seconds for this subscription. If set * to -1, libmapper will automatically renew the * subscription until the monitor is freed or this * function is called again. */ void mapper_monitor_subscribe(mapper_monitor mon, const char *device_name, int subscribe_flags, int timeout); /*! Unsubscribe from information about a specific device. * \param mon The monitor to use. * \param device_name The name of the device of interest. */ void mapper_monitor_unsubscribe(mapper_monitor mon, const char *device_name); /*! Sets whether the monitor should automatically subscribe to * information on signals, links, and connections when it encounters * a previously-unseen device.*/ void mapper_monitor_autosubscribe(mapper_monitor mon, int autosubscribe_flags); /*! Interface to add a link between two devices. * \param mon The monitor to use for sending the message. * \param source_device Source device name. * \param dest_device Destination device name. * \param properties An optional data structure specifying the * requested properties of this link. * \param property_flags Bit flags indicating which properties in the * provided mapper_db_link_t should be * applied to the new link. See the flags * prefixed by LINK_ in mapper_db.h. */ void mapper_monitor_link(mapper_monitor mon, const char* source_device, const char* dest_device, mapper_db_link_t *properties, unsigned int property_flags); /*! Interface to remove a link between two devices. * \param mon The monitor to use for sending the message. * \param source_device Source device name. * \param dest_device Destination device name. */ void mapper_monitor_unlink(mapper_monitor mon, const char* source_device, const char* dest_device); /*! Interface to modify a connection between two signals. * \param mon The monitor to use for sending the message. * \param source_signal Source signal name. * \param dest_signal Destination signal name. * \param properties An optional data structure specifying the * requested properties of this connection. * \param property_flags Bit flags indicating which properties in the * provided mapper_db_connection_t should be * applied to the new connection. See the flags * prefixed by CONNECTION_ in mapper_db.h. */ void mapper_monitor_connection_modify(mapper_monitor mon, const char *source_signal, const char *dest_signal, mapper_db_connection_t *properties, unsigned int property_flags); /*! Interface to add a connection between two signals. * \param mon The monitor to use for sending the message. * \param source_signal Source signal name. * \param dest_signal Destination signal name. * \param properties An optional data structure specifying the * requested properties of this connection. * \param property_flags Bit flags indicating which properties in the * provided mapper_db_connection_t should be * applied to the new connection. See the flags * prefixed by CONNECTION_ in mapper_db.h. */ void mapper_monitor_connect(mapper_monitor mon, const char* source_signal, const char* dest_signal, mapper_db_connection_t *properties, unsigned int property_flags); /*! Interface to remove a connection between two signals. * \param mon The monitor to use for sending the message. * \param source_signal Source signal name. * \param dest_signal Destination signal name. */ void mapper_monitor_disconnect(mapper_monitor mon, const char* source_signal, const char* dest_signal); /* @} */ /***** Time *****/ /*! @defgroup time Time @{ libmapper primarily uses NTP timetags for communication and synchronization. */ /*! Initialize a timetag to the current mapping network time. * \param dev The device whose time we are asking for. * \param tt A previously allocated timetag to initialize. */ void mdev_now(mapper_device dev, mapper_timetag_t *tt); /*! Initialize a timetag to the current mapping network time. * \param mon The monitor whose time we are asking for. * \param tt A previously allocated timetag to initialize. */ void mapper_monitor_now(mapper_monitor mon, mapper_timetag_t *tt); /*! Return the difference in seconds between two mapper_timetags. * \param a The minuend. * \param b The subtrahend. * \return The difference a-b in seconds. */ double mapper_timetag_difference(mapper_timetag_t a, mapper_timetag_t b); /*! Add seconds to a given timetag. * \param tt A previously allocated timetag to augment. * \param addend An amount in seconds to add. */ void mapper_timetag_add_seconds(mapper_timetag_t *tt, double addend); /*! Return value of mapper_timetag as a double-precision floating point value. * \param tt The timetag to read. * \return The timetag value in seconds. */ double mapper_timetag_get_double(mapper_timetag_t tt); /*! Set value of a mapper_timetag from an integer value. * \param tt The timetag to set. * \param value Time value in seconds. */ void mapper_timetag_set_int(mapper_timetag_t *tt, int value); /*! Set value of a mapper_timetag from a floating point value. * \param tt The timetag to set. * \param value Time value in seconds. */ void mapper_timetag_set_float(mapper_timetag_t *tt, float value); /*! Set value of a mapper_timetag from a double-precision floating point value. * \param tt The timetag to set. * \param value Time value in seconds. */ void mapper_timetag_set_double(mapper_timetag_t *tt, double value); /*! Copy value of a mapper_timetag. */ void mapper_timetag_cpy(mapper_timetag_t *ttl, mapper_timetag_t ttr); /* @} */ #ifdef __cplusplus } #endif #endif // __MAPPER_H__ libmapper/include/mapper/mapper_types.h0000644000175000017500000000143212423630127017611 0ustar tiagotiago#ifndef __MAPPER_TYPES_H__ #define __MAPPER_TYPES_H__ #ifdef __cplusplus extern "C" { #endif /*! \file This file defines opaque types that are used internally in * libmapper. */ //! An internal structure defining a mapper device. typedef void *mapper_device; //! An internal structure defining a mapper network monitor. typedef void *mapper_monitor; //! An internal structure defining an object to handle the admin bus. typedef void *mapper_admin; //! An internal structure to handle network database. //! This should be retrieved by calling mapper_monitor_get_db(). typedef void *mapper_db; //! An internal data structure defining a mapper queue //! Used to handle a queue of mapper signals typedef void *mapper_queue; #ifdef __cplusplus } #endif #endif // __MAPPER_TYPES_H__ libmapper/include/mapper/mapper_db.h0000644000175000017500000002364512423630127017044 0ustar tiagotiago#ifndef __MAPPER_DB_H__ #define __MAPPER_DB_H__ #ifdef __cplusplus extern "C" { #endif /* An opaque structure to hold a string table of key-value pairs, used * to hold arbitrary signal and device parameters. */ struct _mapper_string_table; struct _mapper_monitor; /*! \file This file defines structs used to return information from * the network database. */ #include /*! A 64-bit data structure containing an NTP-compatible time tag, as * used by OSC. */ typedef lo_timetag mapper_timetag_t; /*! A record that keeps information about a device on the network. * @ingroup devicedb */ typedef struct _mapper_db_device { char *identifier; /*!< The identifier (prefix) for * this device. */ char *name; /*!< The full name for this * device, or zero. */ int ordinal; uint32_t name_hash; /*!< CRC-32 hash of full device name * in the form . */ char *host; //!< Device network host name. int port; //!< Device network port. int num_inputs; //!< Number of associated input signals. int num_outputs; //!< Number of associated output signals. int num_links_in; //!< Number of associated incoming links. int num_links_out; //!< Number of associated outgoing links. int num_connections_in; //!< Number of associated incoming connections. int num_connections_out; //!< Number of associated outgoing connections. int version; //!< Reported device state version. char *lib_version; //!< libmapper version of device. void* user_data; //!< User modifiable data. mapper_timetag_t timetag; mapper_timetag_t synced; //!< Timestamp of last sync. /*! Extra properties associated with this device. */ struct _mapper_string_table *extra; } mapper_db_device_t, *mapper_db_device; /* Bit flags to identify which fields in a mapper_db_link * structure are valid. This is only used when specifying link * properties via the mapper_monitor_link() or * mapper_monitor_link_modify() functions. */ #define LINK_NUM_SCOPES 0x01 #define LINK_SCOPE_NAMES 0x02 #define LINK_SCOPE_HASHES 0x04 /* Bit flags to identify which range extremities are known. If the bit * field is equal to RANGE_KNOWN, then all four required extremities * are known, and a linear connection can be calculated. */ #define CONNECTION_RANGE_SRC_MIN 0x01 #define CONNECTION_RANGE_SRC_MAX 0x02 #define CONNECTION_RANGE_DEST_MIN 0x04 #define CONNECTION_RANGE_DEST_MAX 0x08 #define CONNECTION_RANGE_KNOWN 0x0F /* Bit flags to identify which fields in a mapper_db_connection * structure are valid. This is only used when specifying connection * properties via the mapper_monitor_connect() or * mapper_monitor_connection_modify() functions. Should be combined with the * above range bitflags. */ #define CONNECTION_BOUND_MIN 0x0010 #define CONNECTION_BOUND_MAX 0x0020 #define CONNECTION_EXPRESSION 0x0040 #define CONNECTION_MODE 0x0080 #define CONNECTION_MUTED 0x0100 #define CONNECTION_SEND_AS_INSTANCE 0x0200 #define CONNECTION_SRC_TYPE 0x0400 #define CONNECTION_DEST_TYPE 0x0800 #define CONNECTION_SRC_LENGTH 0x1000 #define CONNECTION_DEST_LENGTH 0x2000 #define CONNECTION_ALL 0xFFFF /*! Describes what happens when the range boundaries are * exceeded. * @ingroup connectiondb */ typedef enum _mapper_boundary_action { BA_NONE, /*!< Value is passed through unchanged. This is the * default. */ BA_MUTE, //!< Value is muted. BA_CLAMP, //!< Value is limited to the boundary. BA_FOLD, //!< Value continues in opposite direction. BA_WRAP, /*!< Value appears as modulus offset at the opposite * boundary. */ N_MAPPER_BOUNDARY_ACTIONS } mapper_boundary_action; /*! Describes the connection mode. * @ingroup connectiondb */ typedef enum _mapper_mode_type { MO_UNDEFINED, //!< Not yet defined MO_BYPASS, //!< Direct throughput MO_LINEAR, //!< Linear scaling MO_EXPRESSION, //!< Expression MO_CALIBRATE, //!< Calibrate to source signal MO_REVERSE, //!< Update source on dest change N_MAPPER_MODE_TYPES } mapper_mode_type; /*! Describes the voice-stealing mode for instances. * @ingroup connectiondb */ typedef enum _mapper_instance_allocation_type { IN_UNDEFINED, //!< Not yet defined IN_STEAL_OLDEST, //!< Steal the oldest instance IN_STEAL_NEWEST, //!< Steal the newest instance N_MAPPER_INSTANCE_ALLOCATION_TYPES } mapper_instance_allocation_type; /*! A record that describes the properties of a connection mapping. * @ingroup connectiondb */ typedef struct _mapper_db_connection { int id; //!< Connection index char *src_name; //!< Source signal name (OSC path). char *dest_name; //!< Destination signal name (OSC path). char *query_name; //!< Used for sending queries/responses. char src_type; //!< Source signal type. char dest_type; //!< Destination signal type. int src_length; //!< Source signal length. int dest_length; //!< Destination signal length. int src_history_size; //!< Source history size. int dest_history_size; //!< Destination history size. mapper_boundary_action bound_max; /*!< Operation for exceeded * upper boundary. */ mapper_boundary_action bound_min; /*!< Operation for exceeded * lower boundary. */ int send_as_instance; //!< 1 to send as instance, 0 otherwise. void *src_min; //!< Array of source minima. void *src_max; //!< Array of source maxima. void *dest_min; //!< Array of destination minima. void *dest_max; //!< Array of destination maxima. int range_known; /*!< Bitfield identifying which range * extremities are known. */ char *expression; mapper_mode_type mode; /*!< Bypass, linear, calibrate, or * expression connection */ int muted; /*!< 1 to mute mapping connection, 0 * to unmute */ /*! Extra properties associated with this connection. */ struct _mapper_string_table *extra; } mapper_db_connection_t, *mapper_db_connection; /*! A structure that stores the current and historical values and timetags * of a signal. The size of the history arrays is determined by the needs * of connection expressions. * @ingroup signals */ typedef struct _mapper_signal_history { /*! The type of this signal, specified as an OSC type * character. */ char type; /*! Current position in the circular buffer. */ int position; /*! History size of the buffer. */ int size; /*! Vector length. */ int length; /*! Value of the signal for each sample of stored history. */ void *value; /*! Timetag for each sample of stored history. */ mapper_timetag_t *timetag; } mapper_signal_history_t; /*! A record that describes properties of a signal. * @ingroup signaldb */ typedef struct _mapper_db_signal { /*! Signal index */ int id; /*! Flag to indicate whether signal is source or destination */ int is_output; /*! The type of this signal, specified as an OSC type * character. */ char type; /*! Length of the signal vector, or 1 for scalars. */ int length; /*! Number of instances. */ int num_instances; /*! The name of this signal, an OSC path. Must start with '/'. */ char *name; /*! The name of the device owning this signal. An OSC path. * Must start with '/'. */ char *device_name; /*! The unit of this signal, or NULL for N/A. */ char *unit; /*! The minimum of this signal, or NULL for no minimum. */ void *minimum; /*! The maximum of this signal, or NULL for no maximum. */ void *maximum; /*! The rate of this signal, or 0 for non-periodic signals. */ float rate; /*! Extra properties associated with this signal. */ struct _mapper_string_table *extra; /*! A pointer available for associating user context. */ void *user_data; } mapper_db_signal_t, *mapper_db_signal; /*! A record that describes the properties of a link between devices. * @ingroup linkdb */ typedef struct _mapper_db_link { char *src_name; //!< Source device name (OSC path). uint32_t src_name_hash; //!< CRC-32 hash of src device name. char *dest_name; //!< Destination device name (OSC path). uint32_t dest_name_hash; //!< CRC-32 hash of dest device name. char *src_host; //!< IP Address of the source device. int src_port; //!< Network port of source device. char *dest_host; //!< IP Address of the destination device. int dest_port; //!< Network port of destination device. int num_scopes; //!< The number of instance group scopes. char **scope_names; //!< Array of instance group scopes. uint32_t *scope_hashes; //!< Array of CRC-32 scope hashes. /*! Extra properties associated with this link. */ struct _mapper_string_table *extra; } mapper_db_link_t, *mapper_db_link; typedef struct _mapper_db_batch_request { // pointer to monitor struct _mapper_monitor *monitor; // pointer to device struct _mapper_db_device *device; // current signal index int index; // total signal count int total_count; int batch_size; int direction; } mapper_db_batch_request_t, *mapper_db_batch_request; #ifdef __cplusplus } #endif #endif // __MAPPER_DB_H__ libmapper/include/mapper/mapper_cpp.h0000644000175000017500000014741712423630127017245 0ustar tiagotiago #ifndef _MAPPER_CPP_H_ #define _MAPPER_CPP_H_ #include #include #include #include #include #include #include #include #include #include #include #include //#include //#include /* TODO: * signal update handlers * instance event handlers * monitor db handlers * device link & connection handlers * LinkProps: set scopes * Link and COnnection props: set arbitrary properties */ //signal_update_handler(Signal sig, instance_id, value, count, TimeTag) //- optional: instance_id, timetag, count // //possible forms: //(Signal sig, void *value) //(Signal sig, void *value, TimeTag tt) //(Signal sig, int instance_id, void *value) //(Signal sig, int instance_id, void *value, TimeTag tt) //(Signal sig, void *value, int count) //(Signal sig, void *value, int count, TimeTag tt) //(Signal sig, int instance_id, void *value, int count) //(Signal sig, int instance_id, void *value, int count, TimeTag tt) namespace mapper { class Property; class AbstractObjectProps; class Db; // Helper classes to allow polymorphism on "const char *", // "std::string", and "int". class string_type { public: string_type(const char *s=0) { _s = s; } string_type(const std::string &s) { _s = s.c_str(); } operator const char*() const { return _s; } const char *_s; }; class Admin { public: Admin(const string_type &iface=0, const string_type &group=0, int port=0) { admin = mapper_admin_new(iface, group, port); } ~Admin() { if (admin) mapper_admin_free(admin); } operator mapper_admin() const { return admin; } std::string libversion() { return std::string(mapper_admin_libversion(admin)); } private: mapper_admin admin; }; class Timetag { public: Timetag(mapper_timetag_t tt) { timetag.sec = tt.sec; timetag.frac = tt.frac; } Timetag(int seconds) { mapper_timetag_set_int(&timetag, seconds); } Timetag(float seconds) { mapper_timetag_set_float(&timetag, seconds); } Timetag(double seconds) { mapper_timetag_set_double(&timetag, seconds); } operator mapper_timetag_t*() { return &timetag; } private: mapper_timetag_t timetag; }; class AbstractProps { protected: friend class Property; virtual void set(mapper::Property *p) = 0; public: virtual void set(mapper::Property p) = 0; virtual void remove(const string_type &name) = 0; }; class Property { public: template Property(const string_type &_name, T _value) { name = _name; _set(_value); parent = NULL; owned = 0; } template Property(const string_type &_name, T& _value, int _length) { name = _name; _set(_value, _length); parent = NULL; owned = 0; } template Property(const string_type &_name, std::vector _value) { name = _name; _set(_value); parent = NULL; owned = 0; } template Property(const string_type &_name, char _type, T& _value, int _length) { name = _name; _set(_type, _value, _length); parent = NULL; owned = 0; } ~Property() { maybe_free(); } template void set(T _value) { maybe_free(); _set(_value); if (parent) parent->set(this); } template void set(T& _value, int _length) { maybe_free(); _set(_value, _length); if (parent) parent->set(this); } template void set(std::vector _value) { maybe_free(); _set(_value); if (parent) parent->set(this); } operator const void*() const { return value; } void print() { printf("%s: ", name ?: "unknown"); mapper_prop_pp(type, length, value); } const char *name; char type; int length; const void *value; protected: friend class AbstractDeviceProps; friend class AbstractSignalProps; friend class Db; Property(const string_type &_name, char _type, const void *_value, int _length, const AbstractObjectProps *_parent) { name = _name; _set(_type, _value, _length); parent = (AbstractProps*)_parent; owned = 0; } Property() { name = 0; type = 0; length = 0; owned = 0; } private: union { double d; float f; int i; char c; }; int owned; void maybe_free() { if (owned && value) free((void*)value); owned = 0; } void _set(int _value) { i = _value; length = 1; type = 'i'; value = &i; } void _set(float _value) { f = _value; length = 1; type = 'f'; value = &f; } void _set(double _value) { d = _value; length = 1; type = 'd'; value = &d; } void _set(char _value) { c = _value; length = 1; type = 'c'; value = &c; } void _set(const string_type &_value) { value = _value; length = 1; type = 's'; } void _set(int _value[], int _length) { value = _value; length = _length; type = 'i'; } void _set(float _value[], int _length) { value = _value; length = _length; type = 'f'; } void _set(double _value[], int _length) { value = _value; length = _length; type = 'd'; } void _set(char _value[], int _length) { value = _value; length = _length; type = 'c'; } void _set(const char *_value[], int _length) { value = _value; length = _length; type = 's'; } template void _set(std::array& _value) { if (!_value.empty()) { value = _value.data(); length = N; type = 'i'; } else length = 0; } template void _set(std::array& _value) { if (!_value.empty()) { value = _value.data(); length = N; type = 'f'; } else length = 0; } template void _set(std::array& _value) { if (!_value.empty()) { value = _value.data(); length = N; type = 'd'; } else length = 0; } template void _set(std::array& _value) { if (!_value.empty()) { value = _value.data(); length = N; type = 'c'; } else length = 0; } template void _set(std::array& _value) { if (!_value.empty()) { value = _value.data(); length = N; type = 's'; } else length = 0; } template void _set(std::array& _values) { length = N; type = 's'; if (length == 1) { value = _values[0].c_str(); } else if (length > 1) { // need to copy string array char **temp = (char**)malloc(sizeof(char*) * length); for (i = 0; i < length; i++) { temp[i] = (char*)_values[i].c_str(); } value = temp; owned = 1; } } void _set(std::string _values[], int _length) { length = _length; type = 's'; if (length == 1) { value = _values[0].c_str(); } else if (length > 1) { // need to copy string array value = malloc(sizeof(char*) * length); for (i = 0; i < length; i++) { ((char**)value)[i] = (char*)_values[i].c_str(); } owned = 1; } } void _set(std::vector _value) { value = _value.data(); length = _value.size(); type = 'i'; } void _set(std::vector _value) { value = _value.data(); length = _value.size(); type = 'f'; } void _set(std::vector _value) { value = _value.data(); length = _value.size(); type = 'd'; } void _set(std::vector _value) { value = _value.data(); length = _value.size(); type = 'c'; } void _set(std::vector& _value) { value = _value.data(); length = _value.size(); type = 's'; } void _set(std::vector& _value) { length = _value.size(); type = 's'; if (length == 1) { value = _value[0].c_str(); } else if (length > 1) { // need to copy string array value = malloc(sizeof(char*) * length); for (i = 0; i < length; i++) { ((char**)value)[i] = (char*)_value[i].c_str(); } owned = 1; } } void _set(char _type, const void *_value, int _length) { type = _type; value = _value; length = _length; } AbstractProps *parent; }; class AbstractObjectProps : public AbstractProps { protected: virtual void set(mapper::Property *p) = 0; public: virtual void set(mapper::Property p) = 0; virtual Property get(const string_type &name) const = 0; Property operator [] (const string_type key) { return get(key); } template void set(const string_type &_name, T _value) { set(Property(_name, _value)); } template void set(const string_type &_name, T& _value, int _length) { set(Property(_name, _value, _length)); } template void set(const string_type &_name, std::vector _value) { set(Property(_name, _value)); } template void set(const string_type &_name, char _type, T& _value, int _length) { set(Property(_name, _type, _value, _length)); } }; class AbstractSignalProps : public AbstractObjectProps { // Reuse class for signal and database protected: friend class Property; AbstractSignalProps(mapper_signal sig) { signal = sig; props = msig_properties(signal); found = 1; } AbstractSignalProps(mapper_db_signal sig_db) { signal = 0; props = sig_db; found = sig_db ? 1 : 0; } void set(mapper::Property *p) { if (signal) msig_set_property(signal, p->name, p->type, p->type == 's' && p->length == 1 ? (void*)&p->value : (void*)p->value, p->length); } private: mapper_signal signal; mapper_db_signal props; public: int found; operator mapper_db_signal() const { return props; } using AbstractObjectProps::set; void set(mapper::Property p) { set(&p); } void remove(const string_type &name) { if (signal) msig_remove_property(signal, name); } Property get(const string_type &name) const { char type; const void *value; int length; if (!mapper_db_signal_property_lookup(props, name, &type, &value, &length)) return Property(name, type, value, length, this); else return Property(); } Property get(int index) const { const char *name; char type; const void *value; int length; if (!mapper_db_signal_property_index(props, index, &name, &type, &value, &length)) return Property(name, type, value, length, this); else return Property(); } class Iterator : public std::iterator { public: Iterator(mapper_db_signal *s) { sig = s; } ~Iterator() { mapper_db_signal_done(sig); } operator mapper_db_signal*() const { return sig; } bool operator==(const Iterator& rhs) { return (sig == rhs.sig); } bool operator!=(const Iterator& rhs) { return (sig != rhs.sig); } Iterator& operator++() { if (sig != NULL) sig = mapper_db_signal_next(sig); return (*this); } Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; } AbstractSignalProps operator*() { return AbstractSignalProps(*sig); } Iterator begin() { return Iterator(sig); } Iterator end() { return Iterator(0); } private: mapper_db_signal *sig; }; }; class Signal { public: Signal(mapper_signal sig) { signal = sig; props = msig_properties(signal); } ~Signal() { ; } operator mapper_signal() const { return signal; } // TODO: check if data type is correct in update! void update(void *value, int count) { msig_update(signal, value, count, MAPPER_NOW); } void update(void *value, int count, Timetag tt) { msig_update(signal, value, count, *tt); } void update(int value) { msig_update_int(signal, value); } void update(float value) { msig_update_float(signal, value); } void update(double value) { msig_update_double(signal, value); } void update(int *value, int count=0) { if (props->type == 'i') msig_update(signal, value, count, MAPPER_NOW); } void update(float *value, int count=0) { if (props->type == 'f') msig_update(signal, value, count, MAPPER_NOW); } void update(double *value, int count=0) { if (props->type == 'd') msig_update(signal, value, count, MAPPER_NOW); } void update(int *value, Timetag tt) { if (props->type == 'i') msig_update(signal, value, 1, *tt); } void update(float *value, Timetag tt) { if (props->type == 'f') msig_update(signal, value, 1, *tt); } void update(double *value, Timetag tt) { if (props->type == 'd') msig_update(signal, value, 1, *tt); } void update(int *value, int count, Timetag tt) { if (props->type == 'i') msig_update(signal, value, count, *tt); } void update(float *value, int count, Timetag tt) { if (props->type == 'f') msig_update(signal, value, count, *tt); } void update(double *value, int count, Timetag tt) { if (props->type == 'd') msig_update(signal, value, count, *tt); } void update(std::vector value) { msig_update(signal, &value[0], value.size() / props->length, MAPPER_NOW); } void update(std::vector value) { msig_update(signal, &value[0], value.size() / props->length, MAPPER_NOW); } void update(std::vector value) { msig_update(signal, &value[0], value.size() / props->length, MAPPER_NOW); } void update(std::vector value, Timetag tt) { msig_update(signal, &value[0], value.size() / props->length, *tt); } void update(std::vector value, Timetag tt) { msig_update(signal, &value[0], value.size() / props->length, *tt); } void update(std::vector value, Timetag tt) { msig_update(signal, &value[0], value.size() / props->length, *tt); } void update_instance(int instance_id, void *value, int count) { msig_update_instance(signal, instance_id, value, count, MAPPER_NOW); } void update_instance(int instance_id, void *value, int count, Timetag tt) { msig_update_instance(signal, instance_id, value, count, *tt); } void update_instance(int instance_id, int value) { msig_update_instance(signal, instance_id, &value, 1, MAPPER_NOW); } void update_instance(int instance_id, float value) { msig_update_instance(signal, instance_id, &value, 1, MAPPER_NOW); } void update_instance(int instance_id, double value) { msig_update_instance(signal, instance_id, &value, 1, MAPPER_NOW); } void update_instance(int instance_id, int *value, int count=0) { if (props->type == 'i') msig_update_instance(signal, instance_id, value, count, MAPPER_NOW); } void update_instance(int instance_id, float *value, int count=0) { if (props->type == 'f') msig_update_instance(signal, instance_id, value, count, MAPPER_NOW); } void update_instance(int instance_id, double *value, int count=0) { if (props->type == 'd') msig_update_instance(signal, instance_id, value, count, MAPPER_NOW); } void update_instance(int instance_id, int *value, Timetag tt) { if (props->type == 'i') msig_update_instance(signal, instance_id, value, 1, *tt); } void update_instance(int instance_id, float *value, Timetag tt) { if (props->type == 'f') msig_update_instance(signal, instance_id, value, 1, *tt); } void update_instance(int instance_id, double *value, Timetag tt) { if (props->type == 'd') msig_update_instance(signal, instance_id, value, 1, *tt); } void update_instance(int instance_id, int *value, int count, Timetag tt) { if (props->type == 'i') msig_update_instance(signal, instance_id, value, count, *tt); } void update_instance(int instance_id, float *value, int count, Timetag tt) { if (props->type == 'f') msig_update_instance(signal, instance_id, value, count, *tt); } void update_instance(int instance_id, double *value, int count, Timetag tt) { if (props->type == 'd') msig_update_instance(signal, instance_id, value, count, *tt); } void *value() const { return msig_value(signal, 0); } void *value(Timetag tt) const { return msig_value(signal, tt); } void *instance_value(int instance_id) const { return msig_instance_value(signal, instance_id, 0); } void *instance_value(int instance_id, Timetag tt) const { return msig_instance_value(signal, instance_id, tt); } int query_remotes() const { return msig_query_remotes(signal, MAPPER_NOW); } int query_remotes(Timetag tt) const { return msig_query_remotes(signal, *tt); } void reserve_instances(int num) { msig_reserve_instances(signal, num, 0, 0); } void reserve_instances(int num, int *instance_ids, void **user_data) { msig_reserve_instances(signal, num, instance_ids, user_data); } void release_instance(int instance_id) { msig_release_instance(signal, instance_id, MAPPER_NOW); } void release_instance(int instance_id, Timetag tt) { msig_release_instance(signal, instance_id, *tt); } void remove_instance(int instance_id) { msig_remove_instance(signal, instance_id); } int oldest_active_instance(int *instance_id) { return msig_get_oldest_active_instance(signal, instance_id); } int newest_active_instance(int *instance_id) { return msig_get_newest_active_instance(signal, instance_id); } int num_active_instances() const { return msig_num_active_instances(signal); } int num_reserved_instances() const { return msig_num_reserved_instances(signal); } int active_instance_id(int index) const { return msig_active_instance_id(signal, index); } void set_instance_allocation_mode(mapper_instance_allocation_type mode) { msig_set_instance_allocation_mode(signal, mode); } mapper_instance_allocation_type get_instance_allocation_mode() const { return msig_get_instance_allocation_mode(signal); } void set_instance_event_callback(mapper_signal_instance_event_handler h, int flags, void *user_data) { msig_set_instance_event_callback(signal, h, flags, user_data); } void set_instance_data(int instance_id, void *user_data) { msig_set_instance_data(signal, instance_id, user_data); } void *instance_data(int instance_id) const { return msig_get_instance_data(signal, instance_id); } void set_callback(mapper_signal_update_handler *handler, void *user_data) { msig_set_callback(signal, handler, user_data); } int num_connections() const { return msig_num_connections(signal); } std::string full_name() const { char str[64]; msig_full_name(signal, str, 64); return std::string(str); } void set_minimum(void *value) { msig_set_minimum(signal, value); } void set_maximum(void *value) { msig_set_maximum(signal, value); } void set_rate(int rate) { msig_set_rate(signal, rate); } class Props : public AbstractSignalProps { public: Props(mapper_signal s) : AbstractSignalProps(s) {} }; Props properties() const { return Props(signal); } Property property(const string_type name) { return Props(signal).get(name); } class Iterator : public std::iterator { public: Iterator(mapper_signal *s, int n) { signals = s; size = n; } ~Iterator() {} bool operator==(const Iterator& rhs) { return (signals == rhs.signals && size == rhs.size); } bool operator!=(const Iterator& rhs) { return (signals != rhs.signals || size != rhs.size); } Iterator& operator++() { size++; return (*this); } Iterator operator++(int) { Iterator tmp(*this); size++; return tmp; } Signal operator*() { return Signal(signals[size]); } Iterator begin() { return Iterator(signals, 0); } Iterator end() { return Iterator(signals, size); } private: mapper_signal *signals; int size; }; private: mapper_signal signal; mapper_db_signal props; }; class AbstractDeviceProps : public AbstractObjectProps { // Reuse same class for device and database protected: friend class Property; AbstractDeviceProps(mapper_device dev) : AbstractObjectProps() { device = dev; props = mdev_properties(device); found = 1; } AbstractDeviceProps(mapper_db_device dev_db) { device = 0; props = dev_db; found = dev_db ? 1 : 0; } void set(mapper::Property* p) { if (device) mdev_set_property(device, p->name, p->type, p->type == 's' && p->length == 1 ? (void*)&p->value : (void*)p->value, p->length); } private: mapper_device device; mapper_db_device props; public: int found; operator mapper_db_device() const { return props; } using AbstractObjectProps::set; void set(mapper::Property p) { set(&p); } void remove(const string_type &name) { if (device) mdev_remove_property(device, name); } Property get(const string_type &name) const { char type; const void *value; int length; if (!mapper_db_device_property_lookup(props, name, &type, &value, &length)) return Property(name, type, value, length, this); else return Property(); } Property get(int index) const { const char *name; char type; const void *value; int length; if (!mapper_db_device_property_index(props, index, &name, &type, &value, &length)) return Property(name, type, value, length, this); else return Property(); } class Iterator : public std::iterator { public: Iterator(mapper_db_device *d) { dev = d; } ~Iterator() { mapper_db_device_done(dev); } operator mapper_db_device*() const { return dev; } bool operator==(const Iterator& rhs) { return (dev == rhs.dev); } bool operator!=(const Iterator& rhs) { return (dev != rhs.dev); } Iterator& operator++() { if (dev != NULL) dev = mapper_db_device_next(dev); return (*this); } Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; } AbstractDeviceProps operator*() { return AbstractDeviceProps(*dev); } Iterator begin() { return Iterator(dev); } Iterator end() { return Iterator(0); } private: mapper_db_device *dev; }; }; class Device { public: Device(const string_type &name_prefix, int port, Admin admin) { device = mdev_new(name_prefix, port, admin); } Device(const string_type &name_prefix) { device = mdev_new(name_prefix, 0, 0); } ~Device() { if (device) mdev_free(device); } Signal add_input(const string_type &name, int length, char type, const string_type &unit, void *minimum, void *maximum, mapper_signal_update_handler handler, void *user_data) { return Signal(mdev_add_input(device, name, length, type, unit, minimum, maximum, handler, user_data)); } Signal add_output(const string_type &name, int length, char type, const string_type &unit, void *minimum, void *maximum) { return Signal(mdev_add_output(device, name, length, type, unit, minimum, maximum)); } void remove_input(Signal input) { if (input) mdev_remove_input(device, input); } void remove_input(const string_type &name) { if (!name) return; mapper_signal input = mdev_get_input_by_name(device, name, 0); mdev_remove_input(device, input); } void remove_output(Signal output) { if (output) mdev_remove_output(device, output); } void remove_output(const string_type &name) { if (!name) return; mapper_signal output = mdev_get_output_by_name(device, name, 0); mdev_remove_output(device, output); } int num_inputs() const { return mdev_num_inputs(device); } int num_outputs() const { return mdev_num_outputs(device); } int num_links_in() const { return mdev_num_links_in(device); } int num_links_out() const { return mdev_num_links_out(device); } int num_connections_in() const { return mdev_num_connections_in(device); } int num_connections_out() const { return mdev_num_connections_out(device); } Signal::Iterator inputs() const { return Signal::Iterator(mdev_get_inputs(device), mdev_num_inputs(device)); } Signal inputs(const string_type &name, int* index=0) const { return Signal(mdev_get_input_by_name(device, name, index)); } Signal inputs(int index) const { return Signal(mdev_get_input_by_index(device, index)); } Signal::Iterator outputs() const { return Signal::Iterator(mdev_get_outputs(device), mdev_num_outputs(device)); } Signal outputs(const string_type &name, int *index=0) const { return Signal(mdev_get_output_by_name(device, name, index)); } Signal outputs(int index) const { return Signal(mdev_get_output_by_index(device, index)); } class Props : public AbstractDeviceProps { public: Props(mapper_device d) : AbstractDeviceProps(d) {} }; Props properties() const { return Props(device); } Property property(const string_type name) { return Props(device).get(name); } int poll(int block_ms=0) const { return mdev_poll(device, block_ms); } int num_fds() const { return mdev_num_fds(device); } int fds(int *fds, int num) const { return mdev_get_fds(device, fds, num); } void service_fd(int fd) { mdev_service_fd(device, fd); } bool ready() const { return mdev_ready(device); } std::string name() const { return std::string(mdev_name(device)); } int id() const { return mdev_id(device); } int port() const { return mdev_port(device); } const struct in_addr *ip4() const { return mdev_ip4(device); } std::string interface() const { return mdev_interface(device); } int ordinal() const { return mdev_ordinal(device); } void start_queue(Timetag tt) const { mdev_start_queue(device, *tt); } void send_queue(Timetag tt) const { mdev_send_queue(device, *tt); } // lo::Server get_lo_server() // { return lo::Server(mdev_get_lo_server(device)); } void set_link_callback(mapper_device_link_handler handler, void *user_data) { mdev_set_link_callback(device, handler, user_data); } void set_connection_callback(mapper_device_connection_handler handler, void *user_data) { mdev_set_connection_callback(device, handler, user_data); } Timetag now() { mapper_timetag_t tt; mdev_now(device, &tt); return Timetag(tt); } private: mapper_device device; }; class Db { public: Db(mapper_monitor mon) { monitor = mon; db = mapper_monitor_get_db(mon); } ~Db() {} void flush() { mapper_monitor_flush_db(monitor, mapper_monitor_get_timeout(monitor), 0); } void flush(int timeout_sec, int quiet=0) { mapper_monitor_flush_db(monitor, timeout_sec, quiet); } // db_devices void add_device_callback(mapper_db_device_handler *handler, void *user_data) { mapper_db_add_device_callback(db, handler, user_data); } void remove_device_callback(mapper_db_device_handler *handler, void *user_data) { mapper_db_remove_device_callback(db, handler, user_data); } class Device : public AbstractDeviceProps { public: Device(mapper_db_device d) : AbstractDeviceProps(d) {} }; Device device(const string_type &name) const { return Device(mapper_db_get_device_by_name(db, name)); } Device device(uint32_t hash) const { return Device(mapper_db_get_device_by_name_hash(db, hash)); } Device::Iterator devices() const { return Device::Iterator(mapper_db_get_all_devices(db)); } Device::Iterator devices(const string_type &pattern) const { return Device::Iterator( mapper_db_match_devices_by_name(db, pattern)); } // db_signals void add_signal_callback(mapper_db_signal_handler *handler, void *user_data) { mapper_db_add_signal_callback(db, handler, user_data); } void remove_signal_callback(mapper_db_signal_handler *handler, void *user_data) { mapper_db_remove_signal_callback(db, handler, user_data); } class Signal : public AbstractSignalProps { public: Signal(mapper_db_signal s) : AbstractSignalProps(s) {} }; Signal input(const string_type &device_name, const string_type &signal_name) { return Signal( mapper_db_get_input_by_device_and_signal_names(db, device_name, signal_name)); } Signal output(const string_type &device_name, const string_type &signal_name) { return Signal( mapper_db_get_output_by_device_and_signal_names(db, device_name, signal_name)); } Signal::Iterator inputs() const { return Signal::Iterator(mapper_db_get_all_inputs(db)); } Signal::Iterator inputs(const string_type device_name) const { return Signal::Iterator( mapper_db_get_inputs_by_device_name(db, device_name)); } Signal::Iterator match_inputs(const string_type device_name, const string_type pattern) const { return Signal::Iterator( mapper_db_match_inputs_by_device_name(db, device_name, pattern)); } Signal::Iterator outputs() const { return Signal::Iterator(mapper_db_get_all_outputs(db)); } Signal::Iterator outputs(const string_type device_name) const { return Signal::Iterator( mapper_db_get_outputs_by_device_name(db, device_name)); } Signal::Iterator match_outputs(const string_type device_name, const string_type pattern) const { return Signal::Iterator( mapper_db_match_outputs_by_device_name(db, device_name, pattern)); } // db_links void add_link_callback(mapper_db_link_handler *handler, void *user_data) { mapper_db_add_link_callback(db, handler, user_data); } void remove_link_callback(mapper_db_link_handler *handler, void *user_data) { mapper_db_remove_link_callback(db, handler, user_data); } class Link : AbstractObjectProps { public: int found; Link(mapper_db_link link) { props = link; found = link ? 1 : 0; owned = 0; } Link() { props = (mapper_db_link)calloc(1, sizeof(mapper_db_link_t)); owned = 1; } ~Link() { if (owned && props) free(props); } operator mapper_db_link() const { return props; } void set(Property p) {} void remove(const string_type &name) {} Property get(const string_type &name) const { char type; const void *value; int length; if (!mapper_db_link_property_lookup(props, name, &type, &value, &length)) return Property(name, type, value, length); else return Property(); } Property get(int index) const { const char *name; char type; const void *value; int length; if (!mapper_db_link_property_index(props, index, &name, &type, &value, &length)) return Property(name, type, value, length); else return Property(); } class Iterator : public std::iterator { public: Iterator(mapper_db_link *l) { link = l; } ~Iterator() { mapper_db_link_done(link); } bool operator==(const Iterator& rhs) { return (link == rhs.link); } bool operator!=(const Iterator& rhs) { return (link != rhs.link); } Iterator& operator++() { if (link != NULL) link = mapper_db_link_next(link); return (*this); } Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; } Link operator*() { return Link(*link); } Iterator begin() { return Iterator(link); } Iterator end() { return Iterator(0); } private: mapper_db_link *link; }; protected: void set(Property *p) {} private: mapper_db_link props; int owned; }; Link::Iterator links() const { return Link::Iterator(mapper_db_get_all_links(db)); } Link::Iterator links(const string_type &device_name) const { return Link::Iterator( mapper_db_get_links_by_device_name(db, device_name)); } Link::Iterator links_by_src(const string_type &device_name) const { return Link::Iterator( mapper_db_get_links_by_src_device_name(db, device_name)); } Link::Iterator links_by_dest(const string_type &device_name) const { return Link::Iterator( mapper_db_get_links_by_dest_device_name(db, device_name)); } Link link(const string_type &source_device, const string_type &dest_device) { return Link( mapper_db_get_link_by_src_dest_names(db, source_device, dest_device)); } Link::Iterator links(Device::Iterator src_list, Device::Iterator dest_list) const { // TODO: check that this works! return Link::Iterator( mapper_db_get_links_by_src_dest_devices(db, (mapper_db_device*)(src_list), (mapper_db_device*)(dest_list))); } // db connections void add_connection_callback(mapper_db_connection_handler *handler, void *user_data) { mapper_db_add_connection_callback(db, handler, user_data); } void remove_connection_callback(mapper_db_connection_handler *handler, void *user_data) { mapper_db_remove_connection_callback(db, handler, user_data); } class Connection : AbstractObjectProps { public: int found; int flags; char src_type; char dest_type; int src_length; int dest_length; void *src_min; void *src_max; void *dest_min; void *dest_max; Connection(mapper_db_connection connection) { props = connection; found = connection ? 1 : 0; owned = 0; } Connection() { props = (mapper_db_connection)calloc(1, sizeof(mapper_db_connection_t)); flags = 0; owned = 1; } ~Connection() { if (owned && props) free(props); } operator mapper_db_connection() const { return props; } void set(Property p) {} void remove(const string_type &name) {} void set_mode(mapper_mode_type mode) { props->mode = mode; flags |= CONNECTION_MODE; } void set_bound_min(mapper_boundary_action bound_min) { props->bound_min = bound_min; flags |= CONNECTION_BOUND_MIN; } void set_bound_max(mapper_boundary_action bound_max) { props->bound_max = bound_max; flags |= CONNECTION_BOUND_MAX; } void set_expression(const string_type &expression) { props->expression = (char*)(const char*)expression; flags |= CONNECTION_EXPRESSION; } void set_src_min(const Property &value) { props->src_min = (void*)(const void*)value; props->src_type = value.type; props->src_length = value.length; flags |= (CONNECTION_RANGE_SRC_MIN | CONNECTION_SRC_TYPE | CONNECTION_SRC_LENGTH); } void set_src_max(Property &value) { props->src_max = (void*)(const void*)value; props->src_type = value.type; props->src_length = value.length; flags |= (CONNECTION_RANGE_SRC_MAX | CONNECTION_SRC_TYPE | CONNECTION_SRC_LENGTH); } void set_dest_min(Property &value) { props->dest_min = (void*)(const void*)value; props->dest_type = value.type; props->dest_length = value.length; flags |= (CONNECTION_RANGE_DEST_MIN | CONNECTION_DEST_TYPE | CONNECTION_DEST_LENGTH); } void set_dest_max(Property &value) { props->dest_min = (void*)(const void*)value; props->dest_type = value.type; props->dest_length = value.length; flags |= (CONNECTION_RANGE_DEST_MAX | CONNECTION_DEST_TYPE | CONNECTION_DEST_LENGTH); } Property get(const string_type &name) const { char type; const void *value; int length; if (!mapper_db_connection_property_lookup(props, name, &type, &value, &length)) return Property(name, type, value, length); else return Property(); } Property get(int index) const { const char *name; char type; const void *value; int length; if (!mapper_db_connection_property_index(props, index, &name, &type, &value, &length)) return Property(name, type, value, length); else return Property(); } class Iterator : public std::iterator { public: Iterator(mapper_db_connection *c) { con = c; } ~Iterator() { mapper_db_connection_done(con); } bool operator==(const Iterator& rhs) { return (con == rhs.con); } bool operator!=(const Iterator& rhs) { return (con != rhs.con); } Iterator& operator++() { if (con != NULL) con = mapper_db_connection_next(con); return (*this); } Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; } Connection operator*() { return Connection(*con); } Iterator begin() { return Iterator(con); } Iterator end() { return Iterator(0); } private: mapper_db_connection *con; }; protected: void set(mapper::Property *p) {} private: mapper_db_connection props; int owned; }; Connection::Iterator connections() const { return Connection::Iterator( mapper_db_get_all_connections(db)); } Connection::Iterator connections(const string_type &src_device, const string_type &src_signal, const string_type &dest_device, const string_type &dest_signal) const { return Connection::Iterator( mapper_db_get_connections_by_device_and_signal_names(db, src_device, src_signal, dest_device, dest_signal)); } Connection::Iterator connections(const string_type &device_name) const { return Connection::Iterator( mapper_db_get_connections_by_device_name(db, device_name)); } Connection::Iterator connections_by_src(const string_type &signal_name) const { return Connection::Iterator( mapper_db_get_connections_by_src_signal_name(db, signal_name)); } Connection::Iterator connections_by_src(const string_type &device_name, const string_type &signal_name) const { return Connection::Iterator( mapper_db_get_connections_by_src_device_and_signal_names(db, device_name, signal_name)); } Connection::Iterator connections_by_dest(const string_type &signal_name) const { return Connection::Iterator( mapper_db_get_connections_by_dest_signal_name(db, signal_name)); } Connection::Iterator connections_by_dest(const string_type &device_name, const string_type &signal_name) const { return Connection::Iterator( mapper_db_get_connections_by_dest_device_and_signal_names(db, device_name, signal_name)); } Connection connection_by_signals(const string_type &source_name, const string_type &dest_name) const { return Connection( mapper_db_get_connection_by_signal_full_names(db, source_name, dest_name)); } Connection::Iterator connections_by_devices(const string_type &source_name, const string_type &dest_name) const { return Connection::Iterator( mapper_db_get_connections_by_src_dest_device_names(db, source_name, dest_name)); } Connection::Iterator connections(Signal::Iterator src_list, Signal::Iterator dest_list) const { return Connection::Iterator( mapper_db_get_connections_by_signal_queries(db, (mapper_db_signal*)(src_list), (mapper_db_signal*)(dest_list))); } private: mapper_db db; mapper_monitor monitor; }; class Monitor { public: Monitor() { monitor = mapper_monitor_new(0, 0); } Monitor(Admin admin, int autosubscribe_flags=0) { monitor = mapper_monitor_new(admin, autosubscribe_flags); } Monitor(int autosubscribe_flags) { monitor = mapper_monitor_new(0, autosubscribe_flags); } ~Monitor() { if (monitor) mapper_monitor_free(monitor); } int poll(int block_ms=0) { return mapper_monitor_poll(monitor, block_ms); } Db db() const { return Db(monitor); } void request_devices() const { mapper_monitor_request_devices(monitor); } void subscribe(const string_type &device_name, int flags, int timeout) { mapper_monitor_subscribe(monitor, device_name, flags, timeout); } void unsubscribe(const string_type &device_name) { mapper_monitor_unsubscribe(monitor, device_name); } void autosubscribe(int flags) const { mapper_monitor_autosubscribe(monitor, flags); } void link(const string_type &source_device, const string_type &dest_device) { mapper_monitor_link(monitor, source_device, dest_device, 0, 0); } // void link(const string_type &source_device, const string_type &dest_device, // const LinkProps &properties) // { // mapper_monitor_link(monitor, source_device, dest_device, // mapper_db_link(properties), properties.flags); // } void unlink(const string_type &source_device, const string_type &dest_device) { mapper_monitor_unlink(monitor, source_device, dest_device); } void connect(const string_type &source_signal, const string_type &dest_signal) { mapper_monitor_connect(monitor, source_signal, dest_signal, 0, 0); } void connect(const string_type &source_signal, const string_type &dest_signal, const Db::Connection &properties) const { mapper_monitor_connect(monitor, source_signal, dest_signal, mapper_db_connection(properties), properties.flags); } void connection_modify(const string_type &source_signal, const string_type &dest_signal, Db::Connection &properties) const { mapper_monitor_connection_modify(monitor, source_signal, dest_signal, mapper_db_connection(properties), properties.flags); } void disconnect(const string_type &source_signal, const string_type &dest_signal) { mapper_monitor_disconnect(monitor, source_signal, dest_signal); } private: mapper_monitor monitor; }; }; #endif // _MAPPER_CPP_H_ libmapper/include/Makefile.am0000644000175000017500000000026412423630127015502 0ustar tiagotiago libmapperdir = $(includedir)/mapper-@MAJOR_VERSION@/mapper libmapper_HEADERS = mapper/mapper.h mapper/mapper_types.h mapper/mapper_db.h \ mapper/mapper_cpp.h libmapper/configure0000755000175000017500000236262412423630127013747 0ustar tiagotiago#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libmapper 0.3-482-gd986501. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 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" 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 and $0: dot_mapper@googlegroups.com 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='libmapper' PACKAGE_TARNAME='libmapper' PACKAGE_VERSION='0.3-482-gd986501' PACKAGE_STRING='libmapper 0.3-482-gd986501' PACKAGE_BUGREPORT='dot_mapper@googlegroups.com' PACKAGE_URL='http://libmapper.org' ac_unique_file="src/device.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_AUDIO_FALSE HAVE_AUDIO_TRUE HAVE_SWIG_FALSE HAVE_SWIG_TRUE HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE HAVE_DOXYGEN_FALSE HAVE_DOXYGEN_TRUE TESTS_FALSE TESTS_TRUE LIBLO liblo_LIBS liblo_CFLAGS PKG_CONFIG DOXYGEN RTAUDIO_LIBS RTAUDIO_CFLAGS JNI JNIPATH JAR JAVAH JAVAC PYEXT SWIGDIR pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON SWIG HAVE_LAMBDA_FALSE HAVE_LAMBDA_TRUE LIBM CXXCPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL OBJDUMP DLLTOOL AS am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config host_os host_vendor host_cpu host build_os build_vendor build_cpu build WINDOWS_DLL_FALSE WINDOWS_DLL_TRUE WINDOWS_FALSE WINDOWS_TRUE EGREP GREP CPP 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 MAJOR_VERSION SO_VERSION MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE 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_maintainer_mode enable_static enable_shared enable_dependency_tracking with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_debug enable_tests enable_docs enable_audio enable_swig enable_jni with_jdk_path with_liblo ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP PYTHON PKG_CONFIG liblo_CFLAGS liblo_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 libmapper 0.3-482-gd986501 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/libmapper] --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 libmapper 0.3-482-gd986501:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug compile with debug flags --disable-tests don't build test programs. --disable-docs don't build the documentation. --disable-audio don't build the audio examples. --disable-swig don't build the SWIG bindings. --disable-jni don't build the Java JNI bindings. 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). --with-jdk-path specify the path to the JDK --without-liblo compile without liblo, disable OSC 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 PYTHON the Python interpreter PKG_CONFIG path to pkg-config utility liblo_CFLAGS C compiler flags for liblo, overriding pkg-config liblo_LIBS linker flags for liblo, 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 . libmapper home page: . _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 libmapper configure 0.3-482-gd986501 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_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_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;} ( $as_echo "## ------------------------------------------ ## ## Report this to dot_mapper@googlegroups.com ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&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_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_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_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 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 libmapper $as_me 0.3-482-gd986501, 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 # libtool version: current:revision:age # # If the library source code has changed at all since the last update, then # increment revision (`c:r:a' becomes `c:r+1:a'). # # If any interfaces have been added, removed, or changed since the last update, # increment current, and set revision to 0. # # If any interfaces have been added since the last public release, then # increment age. # # If any interfaces have been removed since the last public release, then set # age to 0. SO_VERSION=2:0:0 ac_config_headers="$ac_config_headers src/config.h" 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='libmapper' VERSION='0.3-482-gd986501' 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # 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='\' # 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=no fi # 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 MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) { $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 # Checks for header files. 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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking 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 sys/time.h unistd.h termios.h fcntl.h errno.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 arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ZLIB_H 1 _ACEOF fi done for ac_header in winsock2.h do : ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" if test "x$ac_cv_header_winsock2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINSOCK2_H 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "inet_ptoa" "ac_cv_func_inet_ptoa" if test "x$ac_cv_func_inet_ptoa" = xyes; then : $as_echo "#define HAVE_INET_PTOA /**/" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" if test "x$ac_cv_func_getifaddrs" = xyes; then : $as_echo "#define HAVE_GETIFADDRS /**/" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -liphlpapi" >&5 $as_echo_n "checking for exit in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_exit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $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 exit (); int main () { return exit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_exit=yes else ac_cv_lib_iphlpapi_exit=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_iphlpapi_exit" >&5 $as_echo "$ac_cv_lib_iphlpapi_exit" >&6; } if test "x$ac_cv_lib_iphlpapi_exit" = xyes; then : # Need some functions not available before Windows XP CFLAGS="$CFLAGS -DWIN32 -D_WIN32_WINNT=0x501" $as_echo "#define HAVE_LIBIPHLPAPI /**/" >>confdefs.h is_windows=yes fi fi ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : $as_echo "#define HAVE_GETTIMEOFDAY /**/" >>confdefs.h else as_fn_error $? "This is not a POSIX system!" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 $as_echo_n "checking for gzread in -lz... " >&6; } if ${ac_cv_lib_z_gzread+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $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 gzread (); int main () { return gzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_gzread=yes else ac_cv_lib_z_gzread=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_z_gzread" >&5 $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else as_fn_error $? "zlib not found, see http://www.zlib.net" "$LINENO" 5 fi if test x$is_windows = xyes; then WINDOWS_TRUE= WINDOWS_FALSE='#' else WINDOWS_TRUE='#' WINDOWS_FALSE= fi if test x$is_windows = xyes && test x$enable_shared = xyes; then WINDOWS_DLL_TRUE= WINDOWS_DLL_FALSE='#' else WINDOWS_DLL_TRUE='#' WINDOWS_DLL_FALSE= 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 # pthreads # 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 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } 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_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; *-darwin*) acx_pthread_flags="-pthread $acx_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-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_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # 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_ax_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include static void routine(void* a) {a=0;} static void* start_routine(void* a) {return a;} int main () { pthread_t th; pthread_attr_t attr; pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_create(&th,0,start_routine,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" 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_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : 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 # libtool enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as" $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 AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # 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_AS="as" $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_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="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 AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi 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 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 ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump 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" # 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 { $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 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 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 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 # Set options enable_dlopen=no # 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* ## 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... 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" 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check for the math library LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 $as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmw $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 _mwvalidcheckl (); int main () { return _mwvalidcheckl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mw__mwvalidcheckl=yes else ac_cv_lib_mw__mwvalidcheckl=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_mw__mwvalidcheckl" >&5 $as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : LIBM="-lmw" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} 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 cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="$LIBM -lm" fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} 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 cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=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_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="-lm" fi ;; esac LIBS="$LIBS $LIBM" # Check for C++11 features _CXXFLAGS="$CXXFLAGS" 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 whether C++11 lambdas are supported" >&5 $as_echo_n "checking whether C++11 lambdas are supported... " >&6; } CXXFLAGS="$_CXXFLAGS -std=c++11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { [](std::function f){f();}([](){0;}); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LAMBDA=yes else CXXFLAGS="$_CXXFLAGS -std=c++0x" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { [](std::function f){f();}([](){0;}); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LAMBDA=yes else CXXFLAGS="$_CXXFLAGS -std=c++11 -stdlib=libc++" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { [](std::function f){f();}([](){0;}); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LAMBDA=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } CXXFLAGS="$_CXXFLAGS" 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 if test x$HAVE_LAMBDA = xyes; then HAVE_LAMBDA_TRUE= HAVE_LAMBDA_FALSE='#' else HAVE_LAMBDA_TRUE='#' HAVE_LAMBDA_FALSE= fi # If we can add -Qunused-arguments, add it. # This error occurs when ccache and clang are used together. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add -Qunused-arguments (C++)" >&5 $as_echo_n "checking whether to add -Qunused-arguments (C++)... " >&6; } _CXXFLAGS="$CXXFLAGS" CXXFLAGS="$_CXXFLAGS -Qunused-arguments" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; 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; } CXXFLAGS="$_CXXFLAGS" fi rm -f core conftest.err conftest.$ac_objext 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 # Check options # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=yes fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; else enable_tests=yes fi # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then : enableval=$enable_docs; else enable_docs=yes fi # Check whether --enable-audio was given. if test "${enable_audio+set}" = set; then : enableval=$enable_audio; else enable_audio=yes fi swig_enabled=yes # Check whether --enable-swig was given. if test "${enable_swig+set}" = set; then : enableval=$enable_swig; swig_enabled=$enableval fi jni_enabled=yes # Check whether --enable-jni was given. if test "${enable_jni+set}" = set; then : enableval=$enable_jni; jni_enabled=$enableval fi if test x$swig_enabled = xyes; then # Extract the first word of "swig", so it can be a program name with args. set dummy swig; 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_SWIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SWIG"; then ac_cv_prog_SWIG="$SWIG" # 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_SWIG="swig" $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 SWIG=$ac_cv_prog_SWIG if test -n "$SWIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5 $as_echo "$SWIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$SWIG = x; then swig_enabled=no swig_explain="(swig not found)" else if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.3" >&5 $as_echo_n "checking whether $PYTHON version is >= 2.3... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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; } as_fn_error $? "Python interpreter is too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.3" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.3... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.3'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; 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_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # 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_PYTHON="$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 PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then have_python="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform # Just factor out some code duplication. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[:3] == '2.7': can_use_sysconfig = 0 except ImportError: pass" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE have_python="yes" fi if test x$have_python = xyes; then SWIGDIR=swig PYEXT=$($PYTHON -c "import sys; print {'win32':'pyd','darwin':'so','linux2':'so'}[sys.platform]") else swig_enabled=no swig_explain="(python not found)" fi fi fi # Check for JNI if test x$jni_enabled = xyes; then JDKPATH= if test -d /usr/lib/jvm/java-7-openjdk-i386; then JDKPATH=/usr/lib/jvm/java-7-openjdk-i386 elif test -d /usr/lib/jvm/java-7-openjdk-amd64; then JDKPATH=/usr/lib/jvm/java-7-openjdk-amd64 elif test -d /usr/lib/jvm/java-7-openjdk-x86_64; then JDKPATH=/usr/lib/jvm/java-7-openjdk-x86_64 elif test -d /usr/lib/jvm/java-6-openjdk; then JDKPATH=/usr/lib/jvm/java-6-openjdk elif test -d /System/Library/Frameworks/JavaVM.framework/Headers; then JDKPATH=/System/Library/Frameworks/JavaVM.framework fi # Check whether --with-jdk-path was given. if test "${with_jdk_path+set}" = set; then : withval=$with_jdk_path; JDKPATH="$withval" fi if test x"$JNIPATH" = x; then if test -f "$JDKPATH"/Headers/jni.h; then JNIPATH="$JDKPATH"/Headers elif test -f "$JDKPATH"/include/jni.h; then JNIPATH="$JDKPATH"/include fi fi if test x"$JDKBINPATH" = x; then if test -f "$JDKPATH"/Commands/javac; then JDKBINPATH="$JDKPATH"/Commands elif test -f "$JDKPATH"/bin/javac; then JDKBINPATH="$JDKPATH"/bin fi fi # Extract the first word of "javac", so it can be a program name with args. set dummy javac; 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_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in "$JDKBINPATH"$PATH_SEPARATOR$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_JAVAC="$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 JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "javah", so it can be a program name with args. set dummy javah; 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_JAVAH+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAH in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAH="$JAVAH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in "$JDKBINPATH"$PATH_SEPARATOR$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_JAVAH="$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 JAVAH=$ac_cv_path_JAVAH if test -n "$JAVAH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAH" >&5 $as_echo "$JAVAH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "jar", so it can be a program name with args. set dummy jar; 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_JAR+:} false; then : $as_echo_n "(cached) " >&6 else case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in "$JDKBINPATH"$PATH_SEPARATOR$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_JAR="$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 JAR=$ac_cv_path_JAR if test -n "$JAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 $as_echo "$JAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$JAVAC = x; then jni_enabled=no jni_explain="(javac not found)" elif test x$JAVAH = x; then jni_enabled=no jni_explain="(javah not found)" elif test x$JAR = x; then jni_enabled=no jni_explain="(jar not found)" else as_ac_Header=`$as_echo "ac_cv_header_$JNIPATH/jni.h" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$JNIPATH/jni.h" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : jni_enabled=yes else jni_enabled=no; jni_explain="(jni.h not found)" fi if test x$jni_enabled = xyes; then JNI=jni fi fi fi # Check for audio libraries supported by RtAudio if test x$enable_audio = xyes; then # Try ALSA { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5 $as_echo_n "checking for snd_ctl_open in -lasound... " >&6; } if ${ac_cv_lib_asound_snd_ctl_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_ctl_open (); int main () { return snd_ctl_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_asound_snd_ctl_open=yes else ac_cv_lib_asound_snd_ctl_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_ctl_open" >&5 $as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; } if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then : RTAUDIO_CFLAGS="-D__LINUX_ALSA__ -D__LITTLE_ENDIAN__" RTAUDIO_LIBS=-lasound audio_explain="(ALSA)" fi # Look for CoreAudio (This could be more sophisticated) echo -n Checking for CoreAudio... if test -e /System/Library/Frameworks/CoreAudio.framework; then RTAUDIO_CFLAGS="-D__MACOSX_CORE__ -D__LITTLE_ENDIAN__" RTAUDIO_LIBS="-framework CoreAudio -framework CoreFoundation" audio_explain="(CoreAudio)" echo yes else echo no fi if test -z "$RTAUDIO_CFLAGS"; then enable_audio=no audio_explain="(no supported audio system found.)" fi fi # Doxygen if test x$enable_docs = xyes; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # 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_DOXYGEN="doc" $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 DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$DOXYGEN = x; then enable_docs=no docs_explain="(doxygen not found.)" fi fi # pkg-config 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 # Check for liblo # Check whether --with-liblo was given. if test "${with_liblo+set}" = set; then : withval=$with_liblo; fi if test x$with_liblo != xno; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblo" >&5 $as_echo_n "checking for liblo... " >&6; } if test -n "$PKG_CONFIG"; then if test -n "$liblo_CFLAGS"; then pkg_cv_liblo_CFLAGS="$liblo_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblo >= 0.27\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblo >= 0.27") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_liblo_CFLAGS=`$PKG_CONFIG --cflags "liblo >= 0.27" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$liblo_LIBS"; then pkg_cv_liblo_LIBS="$liblo_LIBS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblo >= 0.27\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblo >= 0.27") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_liblo_LIBS=`$PKG_CONFIG --libs "liblo >= 0.27" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then 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 liblo_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "liblo >= 0.27"` else liblo_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "liblo >= 0.27"` fi # Put the nasty error message in config.log where it belongs echo "$liblo_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (liblo >= 0.27) were not met: $liblo_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables liblo_CFLAGS and liblo_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " "$LINENO" 5 elif test $pkg_failed = untried; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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. Alternatively, you may set the environment variables liblo_CFLAGS and liblo_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else liblo_CFLAGS=$pkg_cv_liblo_CFLAGS liblo_LIBS=$pkg_cv_liblo_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : fi fi if test "x$liblo_LIBS" = x; then : with_liblo=no fi if test x$with_liblo != xno; then : $as_echo "#define HAVE_LIBLO /**/" >>confdefs.h LIBLO=liblo tmpLIBS="$LIBS" LIBS="$LIBS $liblo_LIBS" ac_fn_c_check_func "$LINENO" "lo_address_set_iface" "ac_cv_func_lo_address_set_iface" if test "x$ac_cv_func_lo_address_set_iface" = xyes; then : $as_echo "#define HAVE_LIBLO_SET_IFACE /**/" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "lo_server_new_multicast_iface" "ac_cv_func_lo_server_new_multicast_iface" if test "x$ac_cv_func_lo_server_new_multicast_iface" = xyes; then : $as_echo "#define HAVE_LIBLO_SERVER_IFACE /**/" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "lo_bundle_count" "ac_cv_func_lo_bundle_count" if test "x$ac_cv_func_lo_bundle_count" = xyes; then : $as_echo "#define HAVE_LIBLO_BUNDLE_COUNT /**/" >>confdefs.h fi LIBS="$tmpLIBS" fi # Debug mode if test x$enable_debug = xyes; then : CFLAGS="-g -O0 -Wall -Werror -DDEBUG `echo $CFLAGS | sed 's/-O2//'`" else CFLAGS="$CFLAGS -DNDEBUG" fi # Add -I. so that config.h is found correctly during VPATH builds # (see autoconf manual section 4.9) CFLAGS="-I. $CFLAGS" if test x$enable_tests = xyes; then TESTS_TRUE= TESTS_FALSE='#' else TESTS_TRUE='#' TESTS_FALSE= fi if test "x$DOXYGEN" != x; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi if test "x$have_python" = xyes; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi if test "x$swig_enabled" = xyes; then HAVE_SWIG_TRUE= HAVE_SWIG_FALSE='#' else HAVE_SWIG_TRUE='#' HAVE_SWIG_FALSE= fi if test "x$enable_audio" = xyes; then HAVE_AUDIO_TRUE= HAVE_AUDIO_FALSE='#' else HAVE_AUDIO_TRUE='#' HAVE_AUDIO_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile test/Makefile doc/Makefile doc/libmapper.doxyfile swig/Makefile swig/setup.py jni/Makefile jni/Mapper/NativeLib.java examples/Makefile examples/pwm_synth/Makefile examples/py_tk_gui/Makefile examples/py_tk_gui/setup.py extra/Makefile extra/osx/Makefile libmapper.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi { $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 -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 "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then as_fn_error $? "conditional \"WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WINDOWS_DLL_TRUE}" && test -z "${WINDOWS_DLL_FALSE}"; then as_fn_error $? "conditional \"WINDOWS_DLL\" 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 "${HAVE_LAMBDA_TRUE}" && test -z "${HAVE_LAMBDA_FALSE}"; then as_fn_error $? "conditional \"HAVE_LAMBDA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TESTS_TRUE}" && test -z "${TESTS_FALSE}"; then as_fn_error $? "conditional \"TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SWIG_TRUE}" && test -z "${HAVE_SWIG_FALSE}"; then as_fn_error $? "conditional \"HAVE_SWIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_AUDIO_TRUE}" && test -z "${HAVE_AUDIO_FALSE}"; then as_fn_error $? "conditional \"HAVE_AUDIO\" 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 libmapper $as_me 0.3-482-gd986501, 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 . libmapper home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libmapper config.status 0.3-482-gd986501 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' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $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"`' 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"`' 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 AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ 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 "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/libmapper.doxyfile") CONFIG_FILES="$CONFIG_FILES doc/libmapper.doxyfile" ;; "swig/Makefile") CONFIG_FILES="$CONFIG_FILES swig/Makefile" ;; "swig/setup.py") CONFIG_FILES="$CONFIG_FILES swig/setup.py" ;; "jni/Makefile") CONFIG_FILES="$CONFIG_FILES jni/Makefile" ;; "jni/Mapper/NativeLib.java") CONFIG_FILES="$CONFIG_FILES jni/Mapper/NativeLib.java" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "examples/pwm_synth/Makefile") CONFIG_FILES="$CONFIG_FILES examples/pwm_synth/Makefile" ;; "examples/py_tk_gui/Makefile") CONFIG_FILES="$CONFIG_FILES examples/py_tk_gui/Makefile" ;; "examples/py_tk_gui/setup.py") CONFIG_FILES="$CONFIG_FILES examples/py_tk_gui/setup.py" ;; "extra/Makefile") CONFIG_FILES="$CONFIG_FILES extra/Makefile" ;; "extra/osx/Makefile") CONFIG_FILES="$CONFIG_FILES extra/osx/Makefile" ;; "libmapper.pc") CONFIG_FILES="$CONFIG_FILES libmapper.pc" ;; *) 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 # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # 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 # 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 # 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 # Messages to user. echo echo libmapper configured: echo -------------------------------------------------- echo "building documention... " $enable_docs $docs_explain echo "building tests... " $enable_tests echo "building SWIG bindings... " $swig_enabled $swig_explain echo "building Java bindings... " $jni_enabled $jni_explain echo "building audio examples... " $enable_audio $audio_explain if test x$enable_debug = xyes; then : echo "Debug flags enabled." fi echo -------------------------------------------------- libmapper/Makefile.am0000644000175000017500000000064012423630127014055 0ustar tiagotiagoSUBDIRS = src include test examples @SWIGDIR@ @JNI@ @DOXYGEN@ extra EXTRA_DIST = libtool ltmain.sh autogen.sh libmapper.pc.in libmapper-@MAJOR_VERSION@.pc: libmapper.pc @if ! [ -e $@ ]; then cp -v $< $@; fi clean-local: -rm -rf libmapper-@MAJOR_VERSION@.pc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libmapper-@MAJOR_VERSION@.pc dist_doc_DATA = README COPYING ChangeLog NEWS ACLOCAL_AMFLAGS = -I m4 libmapper/missing0000755000175000017500000001533012423630127013422 0ustar tiagotiago#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook '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: libmapper/depcomp0000755000175000017500000005601612423630127013406 0ustar tiagotiago#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook '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: libmapper/jni/0000755000175000017500000000000012423630127012601 5ustar tiagotiagolibmapper/jni/testspeed.java0000644000175000017500000000414612423630127015451 0ustar tiagotiago import Mapper.*; import Mapper.Device.*; import java.util.Arrays; class testspeed { public static boolean updated = true; public static void main(String [] args) { final Device dev = new Device("javatest"); final Monitor mon = new Monitor(Mapper.Monitor.SUB_DEVICE_ALL); // This is how to ensure the device is freed when the program // exits, even on SIGINT. The Device must be declared "final". Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { dev.free(); mon.free(); } }); InputListener h = new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { testspeed.updated = true; } }; Mapper.Device.Signal in = dev.addInput("insig", 1, 'f', "Hz", null, null, h); Signal out = dev.addOutput("outsig", 1, 'i', "Hz", null, null); System.out.println("Waiting for ready..."); while (!dev.ready()) { dev.poll(100); } System.out.println("Device is ready."); mon.link(dev.name(), dev.name(), null); while (dev.numLinksIn() <= 0) { dev.poll(100); } Mapper.Db.Connection c = new Mapper.Db.Connection(); mon.connect(dev.name()+out.name(), dev.name()+in.name(), null); while ((dev.numConnectionsIn()) <= 0) { dev.poll(100); } mon.free(); double then = dev.now().getDouble(); int i = 0; while (i < 10000) { if (testspeed.updated) { out.update(i); i++; testspeed.updated = false; } dev.poll(1); } double elapsed = dev.now().getDouble() - then; System.out.println("Sent "+i+" messages in "+elapsed+" seconds."); dev.free(); } } libmapper/jni/test.java0000644000175000017500000002534212423630127014431 0ustar tiagotiago import Mapper.*; import Mapper.Device.*; import java.util.Arrays; import java.util.Iterator; class test { public static void main(String [] args) { final Device dev = new Device("javatest"); final Monitor mon = new Monitor(Mapper.Monitor.SUB_DEVICE_ALL); // This is how to ensure the device is freed when the program // exits, even on SIGINT. The Device must be declared "final". Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { dev.free(); mon.free(); } }); mon.Db.addDeviceCallback(new Mapper.Db.DeviceListener() { public void onEvent(Mapper.Db.Device d, int event) { System.out.println("db onEvent() for device "+d.name()); }}); mon.Db.addSignalCallback(new Mapper.Db.SignalListener() { public void onEvent(Mapper.Db.Signal s, int event) { System.out.println("db onEvent() for signal "+s.name()); }}); mon.Db.addLinkCallback(new Mapper.Db.LinkListener() { public void onEvent(Mapper.Db.Link l, int event) { System.out.println("db onEvent() for link " +l.srcName()+" -> "+l.destName()); }}); mon.Db.addConnectionCallback(new Mapper.Db.ConnectionListener() { public void onEvent(Mapper.Db.Connection c, int event) { System.out.println("db onEvent() for connection " +c.srcName+" -> "+c.destName+" @expr " +c.expression); }}); Mapper.Device.Signal inp1 = dev.addInput("insig1", 1, 'f', "Hz", new PropertyValue('f', 2.0), null, new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { System.out.println(" >> in onInput() for "+sig.name()+": " +Arrays.toString(v)); }}); System.out.println("Input signal name: "+inp1.name()); Signal out1 = dev.addOutput("outsig1", 1, 'i', "Hz", new PropertyValue('i', 0.0), new PropertyValue('i', 1.0)); Signal out2 = dev.addOutput("outsig2", 1, 'f', "Hz", new PropertyValue(0.0f), new PropertyValue(1.0f)); System.out.println("Output signal index: "+out1.index()); System.out.println("Zeroeth output signal name: "+dev.getOutput(0).name()); dev.setProperty("width", new PropertyValue(256)); dev.setProperty("height", new PropertyValue(12.5)); dev.setProperty("depth", new PropertyValue("67")); dev.setProperty("deletethis", new PropertyValue("should not see me")); dev.removeProperty("deletethis"); out1.setProperty("width", new PropertyValue(new int[] {10, 11, 12})); out1.setProperty("height", new PropertyValue(6.25)); out1.setProperty("depth", new PropertyValue(new String[]{"one","two"})); out1.setProperty("deletethis", new PropertyValue("or me")); out1.removeProperty("deletethis"); out1.setMinimum(new PropertyValue(12)); System.out.println("Signal properties:"); System.out.println(" Name of out1: " + out1.properties().name()); System.out.println(" Looking up `height': " + out1.properties().property("height")); System.out.println(" Looking up `width': " + out1.properties().property("width")); System.out.println(" Looking up `depth': " + out1.properties().property("depth")); System.out.println(" Looking up `deletethis': " + out1.properties().property("deletethis") + " (should be null)"); System.out.println(" Looking up minimum: " + out1.properties().minimum()); System.out.println(" Looking up maximum: " + out1.properties().maximum()); System.out.println("Waiting for ready..."); while (!dev.ready()) { dev.poll(100); } System.out.println("Device is ready."); System.out.println("Device name: "+dev.name()); System.out.println("Device port: "+dev.port()); System.out.println("Device ordinal: "+dev.ordinal()); System.out.println("Device interface: "+dev.iface()); System.out.println("Device ip4: "+dev.ip4()); mon.link(dev.name(), dev.name(), null); while (dev.numLinksIn() <= 0) { dev.poll(100); } Mapper.Db.Connection c = new Mapper.Db.Connection(); c.mode = Mapper.Db.Connection.MO_EXPRESSION; c.expression = "y=x*100"; c.srcMin = new PropertyValue(15); c.srcMax = new PropertyValue(-15); c.destMax = new PropertyValue(1000); c.destMin = new PropertyValue(-2000); mon.connect(dev.name()+out1.name(), dev.name()+inp1.name(), c); while ((dev.numConnectionsIn()) <= 0) { dev.poll(100); } int i = 0; double [] ar = new double [] {0}; TimeTag tt = new TimeTag(0,0); // Signal should report no value before the first update. if (out1.value(ar, tt)) System.out.println("Signal has value: " + ar[0]); else System.out.println("Signal has no value."); // Just to test vector-valued signal and timetag support, out1.update(new int []{i}, TimeTag.NOW); // Test instances out1.setInstanceEventCallback(new InstanceEventListener() { public void onEvent(Mapper.Device.Signal sig, int instanceId, int event, TimeTag tt) { System.out.println("Instance " + instanceId + " event " + event); } }, InstanceEventListener.IN_ALL); System.out.println(inp1.name() + " allocation mode: " + inp1.instanceAllocationMode()); inp1.setInstanceAllocationMode(Device.Signal.IN_STEAL_NEWEST); System.out.println(inp1.name() + " allocation mode: " + inp1.instanceAllocationMode()); out1.reserveInstances(new int[]{10, 11, 12}); out1.updateInstance(10, new int[]{-8}); out1.instanceValue(10, new int[]{0}); out1.releaseInstance(10); out2.reserveInstances(3); out2.updateInstance(1, new float[]{21.9f}); out2.instanceValue(1, new float[]{0}); out2.updateInstance(1, new double[]{48.12}); out2.instanceValue(1, new double[]{0}); out2.releaseInstance(1); inp1.reserveInstances(3, new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { System.out.println("in onInput() for " +sig.name()+" instance " +instanceId+": " +Arrays.toString(v)); }}); System.out.println(inp1.name() + " instance 1 cb is " + inp1.getInstanceCallback(1)); inp1.setInstanceCallback(1, new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { System.out.println("in onInput() for " +sig.name()+" instance 1: " +Arrays.toString(v)); }}); System.out.println(inp1.name() + " instance 1 cb is " + inp1.getInstanceCallback(1)); inp1.setInstanceCallback(1, null); System.out.println(inp1.name() + " instance 1 cb is " + inp1.getInstanceCallback(1)); while (i <= 100) { System.out.print("Updated value to: " + i); out1.update(i); // Note, we are testing an implicit cast from int to float // here because we are passing a double[] into // out1.value(). if (out1.value(ar, tt)) System.out.print(" Signal has value: " + ar[0]); else System.out.print(" Signal has no value."); if (i == 50) { Mapper.Db.Connection mod = new Mapper.Db.Connection(); mod.expression = "y=x*-100"; System.out.println("Should be connecting "+dev.name()+out1.name()+" -> "+dev.name()+inp1.name()); mon.modifyConnection(dev.name()+out1.name(), dev.name()+inp1.name(), mod); } dev.poll(50); mon.poll(50); i++; } // check monitor.db records System.out.println("Db records:"); Iterator devs = mon.Db.devices().iterator(); while (devs.hasNext()) { System.out.println(" device: " + devs.next().name()); } // another iterator style Mapper.Db.SignalCollection ins = mon.Db.inputs(); for (Mapper.Db.Signal s : ins) { System.out.println(" signal: " + s.name()); } Mapper.Db.LinkCollection links = mon.Db.links(); for (Mapper.Db.Link l : links) { System.out.println(" link: "+ l.srcName() + " -> " + l.destName()); } Mapper.Db.ConnectionCollection cons = mon.Db.connections(); for (Mapper.Db.Connection cc : cons) { System.out.println(" connection: "+ cc.srcName + " -> " + cc.destName); } System.out.println(); System.out.println("Number of connections from " + out1.name() + ": " + out1.numConnections()); System.out.println(inp1.name() + " oldest instance is " + inp1.oldestActiveInstance()); System.out.println(inp1.name() + " newest instance is " + inp1.newestActiveInstance()); dev.free(); } } libmapper/jni/TestInstances/0000755000175000017500000000000012423630127015370 5ustar tiagotiagolibmapper/jni/TestInstances/TestInstances.pde0000644000175000017500000001006612423630127020654 0ustar tiagotiago /** * libmapper instances example * Adapted from Processing.org Mouse Functions example. */ import Mapper.*; Circle bover = null; boolean locked = false; Circle circles[] = new Circle[5]; int bs = 15; int count = 0; Mapper.Device dev = new Mapper.Device("TestInstances"); Mapper.Device.Signal sig_x_in = null; Mapper.Device.Signal sig_y_in = null; Mapper.Device.Signal sig_x_out = null; Mapper.Device.Signal sig_y_out = null; void setup() { size(300, 300); colorMode(HSB, 256, 256, 256); ellipseMode(CENTER); textAlign(CENTER, CENTER); frameRate(10); /* Note: null for the InputListener, since we are specifying * this later per-instance. */ sig_x_in = dev.addInput("x", 1, 'i', "pixels", new PropertyValue(0), new PropertyValue(width), null); sig_y_in = dev.addInput("y", 1, 'i', "pixels", new PropertyValue(0), new PropertyValue(height), null); sig_x_out = dev.addOutput("x", 1, 'i', "pixels", new PropertyValue(0), new PropertyValue(width)); sig_y_out = dev.addOutput("y", 1, 'i', "pixels", new PropertyValue(0), new PropertyValue(height)); Mapper.InstanceEventListener evin = new Mapper.InstanceEventListener() { public void onEvent(Mapper.Device.Signal sig, int instanceId, int event, TimeTag tt) { sig_x_in.setInstanceCallback(instanceId, circles[instanceId-1].lx); sig_y_in.setInstanceCallback(instanceId, circles[instanceId-1].ly); }; }; sig_x_in.setInstanceEventCallback(evin, Mapper.InstanceEventListener.IN_ALL); sig_x_in.reserveInstances(circles.length); sig_y_in.reserveInstances(circles.length); sig_x_out.reserveInstances(circles.length); sig_y_out.reserveInstances(circles.length); for (int i=0; i < circles.length; i++) { circles[i] = new Circle(Math.random()*(width-bs*2)+bs, Math.random()*(height-bs*2)+bs, Math.random()*256); } while (!dev.ready()) dev.poll(100); frame.setTitle(dev.name()); } void stop() { dev.free(); } void draw() { dev.poll(0); background(0); Circle sel = null; for (Circle c : circles) { if (c.testMouse() && sel == null) sel = c; c.display(); } bover = sel; } void mousePressed() { if(bover!=null) { locked = true; bover.pressed(); } else { locked = false; } } void mouseDragged() { if(locked) { bover.dragged(); } } void mouseReleased() { locked = false; } class Circle { float bx; float by; float bdifx = 0.0; float bdify = 0.0; float hue; int id = 0; Mapper.InputListener lx, ly; Circle(double _bx, double _by, double _hue) { bx = (float)_bx; by = (float)_by; hue = (float)_hue; id = ++count; /* Add listeners for our instance */ lx = new Mapper.InputListener() { void onInput(Mapper.Device.Signal sig, int instanceId, int[] v, TimeTag tt) { if (v!=null) bx = v[0]; }}; ly = new Mapper.InputListener() { void onInput(Mapper.Device.Signal sig, int instanceId, int[] v, TimeTag tt) { if (v!=null) by = v[0]; }}; } boolean testMouse() { // Test if the cursor is over the circle float dx = mouseX - bx; float dy = mouseY - by; if (Math.sqrt(dx*dx+dy*dy) < bs) { bover = this; if(locked) { stroke(hue, 256, 153); fill(hue, 256, 256); } else { stroke(hue, 0, 256); fill(hue, 256, 153); } return true; } stroke(hue, 256, 153); fill(hue, 256, 256); return false; } void pressed() { fill(hue, 256, 153); bdifx = mouseX-bx; bdify = mouseY-by; } void dragged() { bx = mouseX-bdifx; by = mouseY-bdify; } void display() { ellipse(bx, by, bs*2, bs*2); fill(0, 0, 256); text(""+id, bx, by); sig_x_out.updateInstance(id, (int)bx); sig_y_out.updateInstance(id, (int)by); } } libmapper/jni/testreverse.java0000644000175000017500000000505212423630127016021 0ustar tiagotiago import Mapper.*; import Mapper.Device.*; import java.util.Arrays; class testreverse { public static void main(String [] args) { final Device dev = new Device("javatestreverse"); final Monitor mon = new Monitor(); // This is how to ensure the device is freed when the program // exits, even on SIGINT. The Device must be declared "final". Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { dev.free(); mon.free(); } }); Mapper.Device.Signal inp1 = dev.addInput("insig1", 1, 'f', "Hz", null, null, new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { System.out.println("in onInput(): "+Arrays.toString(v)); }}); Signal out1 = dev.addOutput("outsig1", 1, 'i', "Hz", null, null); out1.setCallback( new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, int[] v, TimeTag tt) { System.out.println(" >> in onInput(): "+Arrays.toString(v)); }}); System.out.println("Waiting for ready..."); while (!dev.ready()) { dev.poll(100); } System.out.println("Device is ready."); System.out.println("Device name: "+dev.name()); System.out.println("Device port: "+dev.port()); System.out.println("Device ordinal: "+dev.ordinal()); System.out.println("Device interface: "+dev.iface()); System.out.println("Device ip4: "+dev.ip4()); mon.link(dev.name(), dev.name(), null); while (dev.numLinksIn() <= 0) { dev.poll(100); } Mapper.Db.Connection c = new Mapper.Db.Connection(); c.mode = Mapper.Db.Connection.MO_REVERSE; mon.connect(dev.name()+out1.name(), dev.name()+inp1.name(), c); while ((dev.numConnectionsIn()) <= 0) { dev.poll(100); } int i = 100; while (i >= 0) { System.out.println("\nUpdating input to ["+i+"]"); inp1.update(new int[] {i}); dev.poll(100); --i; } dev.free(); } } libmapper/jni/mapperjni.c0000644000175000017500000032252412423630127014742 0ustar tiagotiago #include #include #include #include #include #include "Mapper_Device.h" #include "Mapper_Device_Signal.h" #include "Mapper_Db_Signal.h" #define jlong_ptr(a) ((jlong)(uintptr_t)(a)) #define ptr_jlong(a) ((void *)(uintptr_t)(a)) JNIEnv *genv=0; int bailing=0; typedef struct { jobject listener; jobject signal; jobject db_signal; jobject instanceHandler; } msig_jni_context_t, *msig_jni_context; /**** Helpers ****/ static void throwIllegalArgumentTruncate(JNIEnv *env, mapper_signal sig) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (newExcCls) { char msg[1024]; snprintf(msg, 1024, "Signal %s has integer type, floating-" "point value would truncate.", msig_properties(sig)->name); (*env)->ThrowNew(env, newExcCls, msg); } } static void throwIllegalArgumentLength(JNIEnv *env, mapper_signal sig, int al) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (newExcCls) { char msg[1024]; mapper_db_signal p = msig_properties(sig); snprintf(msg, 1024, "Signal %s length is %d, but array argument has length %d.", p->name, p->length, al); (*env)->ThrowNew(env, newExcCls, msg); } } static void throwIllegalArgumentSignal(JNIEnv *env) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (newExcCls) { (*env)->ThrowNew(env, newExcCls, "Signal object is not associated with " "a mapper_signal."); } } static void throwIllegalArgument(JNIEnv *env, const char *message) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); if (newExcCls) { (*env)->ThrowNew(env, newExcCls, message); } } static void throwOutOfMemory(JNIEnv *env) { jclass newExcCls = (*env)->FindClass(env, "java/lang/OutOfMemoryException"); if (newExcCls) { char msg[] = "Out of memory"; (*env)->ThrowNew(env, newExcCls, msg); } } static mapper_device get_device_from_jobject(JNIEnv *env, jobject obj) { // TODO check device here jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "_device", "J"); if (val) { jlong s = (*env)->GetLongField(env, obj, val); return (mapper_device)ptr_jlong(s); } } return 0; } static mapper_signal get_signal_from_jobject(JNIEnv *env, jobject obj) { // TODO check device here jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "_signal", "J"); if (val) { jlong s = (*env)->GetLongField(env, obj, val); return (mapper_signal)ptr_jlong(s); } } throwIllegalArgumentSignal(env); return 0; } static mapper_db get_db_from_jobject(JNIEnv *env, jobject obj) { // TODO check device here jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "_db", "J"); if (val) { jlong s = (*env)->GetLongField(env, obj, val); return (mapper_db)ptr_jlong(s); } } throwIllegalArgument(env, "Couldn't retrieve db pointer."); return 0; } static mapper_timetag_t *get_timetag_from_jobject(JNIEnv *env, jobject obj, mapper_timetag_t *tt) { if (!obj) return 0; jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID sec = (*env)->GetFieldID(env, cls, "sec", "J"); jfieldID frac = (*env)->GetFieldID(env, cls, "frac", "J"); if (sec && frac) { tt->sec = (*env)->GetLongField(env, obj, sec); tt->frac = (*env)->GetLongField(env, obj, frac); return tt; } } return 0; } static jobject get_jobject_from_timetag(JNIEnv *env, mapper_timetag_t *tt) { jobject objtt = 0; if (tt) { jclass cls = (*env)->FindClass(env, "Mapper/TimeTag"); if (cls) { jmethodID cons = (*env)->GetMethodID(env, cls, "", "(JJ)V"); if (cons) { objtt = (*env)->NewObject(env, cls, cons, tt->sec, tt->frac); } else { printf("Error looking up TimeTag constructor.\n"); exit(1); } } } return objtt; } static mapper_db_device* get_db_device_ptr_from_jobject(JNIEnv *env, jobject obj) { jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "_devprops_p", "J"); if (val) { jlong s = (*env)->GetLongField(env, obj, val); return (mapper_db_device*)ptr_jlong(s); } } throwIllegalArgument(env, "Couldn't retrieve mapper_db_device* ptr."); return 0; } static mapper_db_signal* get_db_signal_ptr_from_jobject(JNIEnv *env, jobject obj) { jclass cls = (*env)->GetObjectClass(env, obj); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "_sigprops_p", "J"); if (val) { jlong s = (*env)->GetLongField(env, obj, val); return (mapper_db_signal*)ptr_jlong(s); } } throwIllegalArgument(env, "Couldn't retrieve mapper_db_signal* ptr."); return 0; } static jobject build_PropertyValue(JNIEnv *env, const char type, const void *value, const int length) { if (length <= 0) return 0; jmethodID methodID; jclass cls = (*env)->FindClass(env, "Mapper/PropertyValue"); switch (type) { case 'i': { if (length == 1) { methodID = (*env)->GetMethodID(env, cls, "", "(CI)V"); if (methodID) return (*env)->NewObject(env, cls, methodID, type, *((int *)value)); } else { methodID = (*env)->GetMethodID(env, cls, "", "(C[I)V"); if (methodID) { jintArray arr = (*env)->NewIntArray(env, length); (*env)->SetIntArrayRegion(env, arr, 0, length, value); return (*env)->NewObject(env, cls, methodID, type, arr); } } break; } case 'f': { if (length == 1) { methodID = (*env)->GetMethodID(env, cls, "", "(CF)V"); if (methodID) return (*env)->NewObject(env, cls, methodID, type, *((float *)value)); } else { methodID = (*env)->GetMethodID(env, cls, "", "(C[F)V"); if (methodID) { jfloatArray arr = (*env)->NewFloatArray(env, length); (*env)->SetFloatArrayRegion(env, arr, 0, length, value); return (*env)->NewObject(env, cls, methodID, type, arr); } } break; } case 'd': { if (length == 1) { methodID = (*env)->GetMethodID(env, cls, "", "(CD)V"); if (methodID) return (*env)->NewObject(env, cls, methodID, type, *((double *)value)); } else { methodID = (*env)->GetMethodID(env, cls, "", "(C[D)V"); if (methodID) { jdoubleArray arr = (*env)->NewDoubleArray(env, length); (*env)->SetDoubleArrayRegion(env, arr, 0, length, value); return (*env)->NewObject(env, cls, methodID, type, arr); } } break; } case 's': { if (length == 1) { methodID = (*env)->GetMethodID(env, cls, "", "(CLjava/lang/String;)V"); if (methodID) { jobject s = (*env)->NewStringUTF(env, (char *)value); if (s) return (*env)->NewObject(env, cls, methodID, type, s); } } else { methodID = (*env)->GetMethodID(env, cls, "", "(C[Ljava/lang/String;)V"); if (methodID) { jobjectArray arr = (*env)->NewObjectArray(env, length, (*env)->FindClass(env, "java/lang/String"), (*env)->NewStringUTF(env, "")); int i; char **strings = (char**)value; for (i = 0; i < length; i++) { (*env)->SetObjectArrayElement(env, arr, i, (*env)->NewStringUTF(env, strings[i])); } return (*env)->NewObject(env, cls, methodID, type, arr); } } break; } default: break; } return 0; } static int get_PropertyValue_elements(JNIEnv *env, jobject jprop, void **value, char *type) { jclass cls = (*env)->GetObjectClass(env, jprop); if (!cls) return 0; jfieldID typeid = (*env)->GetFieldID(env, cls, "type", "C"); jfieldID lengthid = (*env)->GetFieldID(env, cls, "length", "I"); if (!typeid || !lengthid) return 0; *type = (*env)->GetCharField(env, jprop, typeid); int length = (*env)->GetIntField(env, jprop, lengthid); if (!length) return 0; jfieldID valf = 0; jobject o = 0; switch (*type) { case 'i': valf = (*env)->GetFieldID(env, cls, "_i", "[I"); o = (*env)->GetObjectField(env, jprop, valf); *value = (*env)->GetIntArrayElements(env, o, NULL); break; case 'f': valf = (*env)->GetFieldID(env, cls, "_f", "[F"); o = (*env)->GetObjectField(env, jprop, valf); *value = (*env)->GetFloatArrayElements(env, o, NULL); break; case 'd': valf = (*env)->GetFieldID(env, cls, "_d", "[D"); o = (*env)->GetObjectField(env, jprop, valf); *value = (*env)->GetDoubleArrayElements(env, o, NULL); break; case 's': case 'S': { valf = (*env)->GetFieldID(env, cls, "_s", "[Ljava/lang/String;"); o = (*env)->GetObjectField(env, jprop, valf); // need to unpack string array and rebuild jstring jstrings[length]; const char **cstrings = malloc(sizeof(char*) * length); int i; for (i = 0; i < length; i++) { jstrings[i] = (jstring) (*env)->GetObjectArrayElement(env, o, i); cstrings[i] = (*env)->GetStringUTFChars(env, jstrings[i], 0); } *value = cstrings; break; } default: return 0; } return length; } static void release_PropertyValue_elements(JNIEnv *env, jobject jprop, void *value) { jclass cls = (*env)->GetObjectClass(env, jprop); if (!cls) return; jfieldID typeid = (*env)->GetFieldID(env, cls, "type", "C"); jfieldID lengthid = (*env)->GetFieldID(env, cls, "length", "I"); if (!typeid || !lengthid) return; char type = (*env)->GetCharField(env, jprop, typeid); int length = (*env)->GetIntField(env, jprop, lengthid); if (!length) return; jfieldID valf = 0; jobject o = 0; switch (type) { case 'i': valf = (*env)->GetFieldID(env, cls, "_i", "[I"); o = (*env)->GetObjectField(env, jprop, valf); (*env)->ReleaseIntArrayElements(env, o, value, JNI_ABORT); break; case 'f': valf = (*env)->GetFieldID(env, cls, "_f", "[F"); o = (*env)->GetObjectField(env, jprop, valf); (*env)->ReleaseFloatArrayElements(env, o, value, JNI_ABORT); break; case 'd': valf = (*env)->GetFieldID(env, cls, "_d", "[D"); o = (*env)->GetObjectField(env, jprop, valf); (*env)->ReleaseDoubleArrayElements(env, o, value, JNI_ABORT); break; case 's': case 'S': { valf = (*env)->GetFieldID(env, cls, "_s", "[Ljava/lang/String;"); o = (*env)->GetObjectField(env, jprop, valf); jstring jstr; const char **cstrings = (const char**)value; int i; for (i = 0; i < length; i++) { jstr = (jstring) (*env)->GetObjectArrayElement(env, o, i); (*env)->ReleaseStringUTFChars(env, jstr, cstrings[i]); } free(cstrings); break; } } } /**** Mapper.Device ****/ JNIEXPORT jlong JNICALL Java_Mapper_Device_mdev_1new (JNIEnv *env, jobject obj, jstring name, jint port) { const char *cname = (*env)->GetStringUTFChars(env, name, 0); mapper_device dev = mdev_new(cname, port, 0); (*env)->ReleaseStringUTFChars(env, name, cname); return jlong_ptr(dev); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1free (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); /* Free all references to Java objects. */ int i, n = mdev_num_inputs(dev), m = mdev_num_outputs(dev); for (i=0; iuser_data; if (ctx->listener) (*env)->DeleteGlobalRef(env, ctx->listener); if (ctx->signal) (*env)->DeleteGlobalRef(env, ctx->signal); if (ctx->db_signal) (*env)->DeleteGlobalRef(env, ctx->db_signal); if (ctx->instanceHandler) (*env)->DeleteGlobalRef(env, ctx->instanceHandler); free(ctx); props->user_data = 0; } mdev_free(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1poll (JNIEnv *env, jobject obj, jlong d, jint timeout) { genv = env; bailing = 0; mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_poll(dev, timeout); } static void java_msig_input_cb(mapper_signal sig, mapper_db_signal props, int instance_id, void *v, int count, mapper_timetag_t *tt) { if (bailing) return; jobject vobj = 0; if (props->type == 'f' && v) { jfloatArray varr = (*genv)->NewFloatArray(genv, props->length); if (varr) (*genv)->SetFloatArrayRegion(genv, varr, 0, props->length, v); vobj = (jobject) varr; } else if (props->type == 'i' && v) { jintArray varr = (*genv)->NewIntArray(genv, props->length); if (varr) (*genv)->SetIntArrayRegion(genv, varr, 0, props->length, v); vobj = (jobject) varr; } else if (props->type == 'd' && v) { jdoubleArray varr = (*genv)->NewDoubleArray(genv, props->length); if (varr) (*genv)->SetDoubleArrayRegion(genv, varr, 0, props->length, v); vobj = (jobject) varr; } if (!vobj && v) { char msg[1024]; snprintf(msg, 1024, "Unknown signal type for %s in callback handler (%c,%d).", props->name, props->type, props->length); jclass newExcCls = (*genv)->FindClass(genv, "java/lang/IllegalArgumentException"); if (newExcCls) (*genv)->ThrowNew(genv, newExcCls, msg); bailing = 1; return; } jobject objtt = get_jobject_from_timetag(genv, tt); msig_jni_context ctx = (msig_jni_context)props->user_data; jobject input_cb = ctx->listener; if (instance_id != 0) input_cb = (jobject)msig_get_instance_data(sig, instance_id); if (input_cb && ctx->signal) { jclass cls = (*genv)->GetObjectClass(genv, input_cb); if (cls) { jmethodID mid=0; if (props->type=='i') mid = (*genv)->GetMethodID(genv, cls, "onInput", "(LMapper/Device$Signal;" "I[I" "LMapper/TimeTag;)V"); else if (props->type=='f') mid = (*genv)->GetMethodID(genv, cls, "onInput", "(LMapper/Device$Signal;" "I[F" "LMapper/TimeTag;)V"); else if (props->type=='d') mid = (*genv)->GetMethodID(genv, cls, "onInput", "(LMapper/Device$Signal;" "I[D" "LMapper/TimeTag;)V"); if (mid) { (*genv)->CallVoidMethod(genv, input_cb, mid, ctx->signal, instance_id, vobj, objtt); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onInput method.\n"); exit(1); } } } if (vobj) (*genv)->DeleteLocalRef(genv, vobj); if (objtt) (*genv)->DeleteLocalRef(genv, objtt); } static void java_msig_instance_event_cb(mapper_signal sig, mapper_db_signal props, int instance_id, msig_instance_event_t event, mapper_timetag_t *tt) { if (bailing) return; jobject objtt = get_jobject_from_timetag(genv, tt); msig_jni_context ctx = (msig_jni_context)props->user_data; if (ctx->instanceHandler && ctx->signal) { jclass cls = (*genv)->GetObjectClass(genv, ctx->instanceHandler); if (cls) { jmethodID mid=0; mid = (*genv)->GetMethodID(genv, cls, "onEvent", "(LMapper/Device$Signal;II" "LMapper/TimeTag;)V"); if (mid) { (*genv)->CallVoidMethod(genv, ctx->instanceHandler, mid, ctx->signal, instance_id, event, objtt); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onEvent method.\n"); exit(1); } } } if (objtt) (*genv)->DeleteLocalRef(genv, objtt); } static jobject create_signal_object(JNIEnv *env, jobject devobj, msig_jni_context ctx, jobject listener, mapper_signal s) { jobject sigobj = 0, sigdbobj = 0; // Create a wrapper class for this signal jclass cls = (*env)->FindClass(env, "Mapper/Device$Signal"); if (cls) { jmethodID mid = (*env)->GetMethodID(env, cls, "", "(LMapper/Device;JLMapper/Device;)V"); sigobj = (*env)->NewObject(env, cls, mid, devobj, jlong_ptr(s), devobj); } if (sigobj) { mapper_db_signal props = msig_properties(s); props->user_data = ctx; ctx->listener = listener ? (*env)->NewGlobalRef(env, listener) : 0; ctx->signal = (*env)->NewGlobalRef(env, sigobj); ctx->db_signal = (*env)->NewGlobalRef(env, sigdbobj); // Create a wrapper class for this signal's properties cls = (*env)->FindClass(env, "Mapper/Db/Signal"); if (cls) { jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); sigdbobj = (*env)->NewObject(env, cls, mid, jlong_ptr(msig_properties(s))); } } if (sigdbobj) { mapper_db_signal props = msig_properties(s); props->user_data = ctx; ctx->listener = (*env)->NewGlobalRef(env, listener); ctx->signal = (*env)->NewGlobalRef(env, sigobj); ctx->db_signal = (*env)->NewGlobalRef(env, sigdbobj); } else { printf("Error creating signal wrapper class.\n"); exit(1); } return sigobj; } JNIEXPORT jobject JNICALL Java_Mapper_Device_addInput (JNIEnv *env, jobject obj, jstring name, jint length, jchar type, jstring unit, jobject minimum, jobject maximum, jobject listener) { if (!name || (length<=0) || (type!='f' && type!='i' && type!='d')) return 0; mapper_device dev = get_device_from_jobject(env, obj); const char *cname = (*env)->GetStringUTFChars(env, name, 0); const char *cunit = 0; if (unit) cunit = (*env)->GetStringUTFChars(env, unit, 0); msig_jni_context ctx = (msig_jni_context)calloc(1, sizeof(msig_jni_context_t)); if (!ctx) { throwOutOfMemory(env); return 0; } mapper_signal s = mdev_add_input(dev, cname, length, type, cunit, 0, 0, java_msig_input_cb, ctx); (*env)->ReleaseStringUTFChars(env, name, cname); if (unit) (*env)->ReleaseStringUTFChars(env, unit, cunit); if (minimum) { jstring minstring = (*env)->NewStringUTF(env, "min"); Java_Mapper_Device_00024Signal_msig_1set_1property(env, obj, (jlong)s, minstring, minimum); } if (maximum) { jstring maxstring = (*env)->NewStringUTF(env, "max"); Java_Mapper_Device_00024Signal_msig_1set_1property(env, obj, (jlong)s, maxstring, maximum); } return create_signal_object(env, obj, ctx, listener, s); } JNIEXPORT jobject JNICALL Java_Mapper_Device_addOutput (JNIEnv *env, jobject obj, jstring name, jint length, jchar type, jstring unit, jobject minimum, jobject maximum) { if (!name || (length<=0) || (type!='f' && type!='i' && type!='d')) return 0; mapper_device dev = get_device_from_jobject(env, obj); const char *cname = (*env)->GetStringUTFChars(env, name, 0); const char *cunit = 0; if (unit) cunit = (*env)->GetStringUTFChars(env, unit, 0); msig_jni_context ctx = (msig_jni_context)calloc(1, sizeof(msig_jni_context_t)); if (!ctx) { throwOutOfMemory(env); return 0; } mapper_signal s = mdev_add_output(dev, cname, length, type, cunit, 0, 0); (*env)->ReleaseStringUTFChars(env, name, cname); if (unit) (*env)->ReleaseStringUTFChars(env, unit, cunit); if (minimum) { jstring minstring = (*env)->NewStringUTF(env, "min"); Java_Mapper_Device_00024Signal_msig_1set_1property(env, obj, (jlong)s, minstring, minimum); } if (maximum) { jstring maxstring = (*env)->NewStringUTF(env, "max"); Java_Mapper_Device_00024Signal_msig_1set_1property(env, obj, (jlong)s, maxstring, maximum); } return create_signal_object(env, obj, ctx, 0, s); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1remove_1input (JNIEnv *env, jobject obj, jlong d, jlong s) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_signal sig = (mapper_signal)ptr_jlong(s); mdev_remove_input(dev, sig); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1remove_1output (JNIEnv *env, jobject obj, jlong d, jlong s) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_signal sig = (mapper_signal)ptr_jlong(s); mdev_remove_output(dev, sig); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1inputs (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_inputs(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1outputs (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_outputs(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1links_1in (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_links_in(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1links_1out (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_links_out(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1connections_1in (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_connections_in(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1num_1connections_1out (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_num_connections_out(dev); } JNIEXPORT jlong JNICALL Java_Mapper_Device_mdev_1get_1input_1by_1name (JNIEnv *env, jobject obj, jlong d, jstring name, jobject index) { int i; mapper_device dev = (mapper_device)ptr_jlong(d); const char *cname = (*env)->GetStringUTFChars(env, name, 0); mapper_signal sig = mdev_get_input_by_name(dev, cname, &i); (*env)->ReleaseStringUTFChars(env, name, cname); if (sig && index) { jclass cls = (*env)->GetObjectClass(env, index); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "value", "I"); if (val) (*env)->SetIntField(env, index, val, i); } } return jlong_ptr(sig); } JNIEXPORT jlong JNICALL Java_Mapper_Device_mdev_1get_1output_1by_1name (JNIEnv *env, jobject obj, jlong d, jstring name, jobject index) { int i; mapper_device dev = (mapper_device)ptr_jlong(d); const char *cname = (*env)->GetStringUTFChars(env, name, 0); mapper_signal sig = mdev_get_output_by_name(dev, cname, &i); (*env)->ReleaseStringUTFChars(env, name, cname); if (sig && index) { jclass cls = (*env)->GetObjectClass(env, index); if (cls) { jfieldID val = (*env)->GetFieldID(env, cls, "value", "I"); if (val) (*env)->SetIntField(env, index, val, i); } } return jlong_ptr(sig); } JNIEXPORT jlong JNICALL Java_Mapper_Device_mdev_1get_1input_1by_1index (JNIEnv *env, jobject obj, jlong d, jint index) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_signal sig = mdev_get_input_by_index(dev, index); return jlong_ptr(sig); } JNIEXPORT jlong JNICALL Java_Mapper_Device_mdev_1get_1output_1by_1index (JNIEnv *env, jobject obj, jlong d, jint index) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_signal sig = mdev_get_output_by_index(dev, index); return jlong_ptr(sig); } JNIEXPORT jobject JNICALL Java_Mapper_Device_properties (JNIEnv *env, jobject obj) { mapper_device dev = get_device_from_jobject(env, obj); if (!dev) return 0; // Create a wrapper class for this device's properties mapper_db_device props = mdev_properties(dev); jclass cls = (*env)->FindClass(env, "Mapper/Db/Device"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject devdbobj = (*env)->NewObject(env, cls, mid, jlong_ptr(props)); return devdbobj; } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1set_1property (JNIEnv *env, jobject obj, jlong d, jstring key, jobject value) { mapper_device dev = (mapper_device)ptr_jlong(d); const char *ckey = (*env)->GetStringUTFChars(env, key, 0); jclass cls = (*env)->GetObjectClass(env, value); if (cls) { jfieldID typeid = (*env)->GetFieldID(env, cls, "type", "C"); jfieldID lengthid = (*env)->GetFieldID(env, cls, "length", "I"); if (typeid && lengthid) { char type; int length = 1; void *propval = 0; jfieldID valf = 0; jobject o; type = (*env)->GetCharField(env, value, typeid); length = (*env)->GetIntField(env, value, lengthid); switch (type) { case 'i': valf = (*env)->GetFieldID(env, cls, "_i", "[I"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetIntArrayElements(env, o, NULL); mdev_set_property(dev, ckey, type, propval, length); (*env)->ReleaseIntArrayElements(env, o, propval, JNI_ABORT); break; case 'f': valf = (*env)->GetFieldID(env, cls, "_f", "[F"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetFloatArrayElements(env, o, NULL); mdev_set_property(dev, ckey, type, propval, length); (*env)->ReleaseFloatArrayElements(env, o, propval, JNI_ABORT); break; case 'd': valf = (*env)->GetFieldID(env, cls, "_d", "[D"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetDoubleArrayElements(env, o, NULL); mdev_set_property(dev, ckey, type, propval, length); (*env)->ReleaseDoubleArrayElements(env, o, propval, JNI_ABORT); break; case 's': case 'S': valf = (*env)->GetFieldID(env, cls, "_s", "[Ljava/lang/String;"); o = (*env)->GetObjectField(env, value, valf); // need to unpack string array and rebuild jstring jstrings[length]; const char *cstrings[length]; int i; for (i = 0; i < length; i++) { jstrings[i] = (jstring) (*env)->GetObjectArrayElement(env, o, i); cstrings[i] = (*env)->GetStringUTFChars(env, jstrings[i], 0); } if (length == 1) mdev_set_property(dev, ckey, type, (void*)&cstrings[0], 1); else mdev_set_property(dev, ckey, type, (void*)&cstrings, length); for (i = 0; i < length; i++) (*env)->ReleaseStringUTFChars(env, jstrings[i], cstrings[i]); break; } } } (*env)->ReleaseStringUTFChars(env, key, ckey); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1remove_1property (JNIEnv *env, jobject obj, jlong d, jstring key) { mapper_device dev = (mapper_device)ptr_jlong(d); const char *ckey = (*env)->GetStringUTFChars(env, key, 0); mdev_remove_property(dev, ckey); (*env)->ReleaseStringUTFChars(env, key, ckey); } JNIEXPORT jboolean JNICALL Java_Mapper_Device_mdev_1ready (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_ready(dev); } JNIEXPORT jstring JNICALL Java_Mapper_Device_mdev_1name (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); const char *n = mdev_name(dev); if (n) return (*env)->NewStringUTF(env, n); return 0; } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1port (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_port(dev); } JNIEXPORT jstring JNICALL Java_Mapper_Device_mdev_1ip4 (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); const struct in_addr* a = mdev_ip4(dev); if (a) return (*env)->NewStringUTF(env, inet_ntoa(*a)); return 0; } JNIEXPORT jstring JNICALL Java_Mapper_Device_mdev_1interface (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); const char *iface = mdev_interface(dev); if (iface) return (*env)->NewStringUTF(env, iface); return 0; } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1ordinal (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_ordinal(dev); } JNIEXPORT jint JNICALL Java_Mapper_Device_mdev_1id (JNIEnv *env, jobject obj, jlong d) { mapper_device dev = (mapper_device)ptr_jlong(d); return mdev_id(dev); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1start_1queue (JNIEnv *env, jobject obj, jlong d, jobject objtt) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_timetag_t tt, *ptt=0; ptt = get_timetag_from_jobject(env, objtt, &tt); if (ptt) mdev_start_queue(dev, *ptt); } JNIEXPORT void JNICALL Java_Mapper_Device_mdev_1send_1queue (JNIEnv *env, jobject obj, jlong d, jobject objtt) { mapper_device dev = (mapper_device)ptr_jlong(d); mapper_timetag_t tt, *ptt=0; ptt = get_timetag_from_jobject(env, objtt, &tt); if (ptt) mdev_send_queue(dev, *ptt); } JNIEXPORT jobject JNICALL Java_Mapper_Device_mdev_1now (JNIEnv *env, jobject obj, jlong p) { mapper_device dev = (mapper_device)ptr_jlong(p); mapper_timetag_t tt; mdev_now(dev, &tt); jobject o = get_jobject_from_timetag(genv, &tt); return o; } /**** Mapper.Device.Signal ****/ JNIEXPORT jstring JNICALL Java_Mapper_Device_00024Signal_msig_1full_1name (JNIEnv *env, jobject obj, jlong s) { mapper_signal sig=(mapper_signal)ptr_jlong(s); char str[1024]; if (sig) { msig_full_name(sig, str, 1024); return (*env)->NewStringUTF(env, str); } else return 0; } JNIEXPORT jstring JNICALL Java_Mapper_Device_00024Signal_msig_1name (JNIEnv *env, jobject obj, jlong s) { mapper_signal sig=(mapper_signal)ptr_jlong(s); if (sig) { mapper_db_signal p = msig_properties(sig); return (*env)->NewStringUTF(env, p->name); } else return 0; } JNIEXPORT jboolean JNICALL Java_Mapper_Device_00024Signal_msig_1is_1output (JNIEnv *env, jobject obj, jlong s) { mapper_signal sig=(mapper_signal)ptr_jlong(s); if (sig) { mapper_db_signal p = msig_properties(sig); return p->is_output; } return 0; } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_msig_1set_1rate (JNIEnv *env, jobject obj, jlong s, jdouble rate) { mapper_signal sig=(mapper_signal)ptr_jlong(s); if (sig) msig_set_rate(sig, (float)rate); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_queryRemotes (JNIEnv *env, jobject obj, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; if (objtt) { mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); return msig_query_remotes(sig, ptt ? *ptt : MAPPER_NOW); } else return msig_query_remotes(sig, MAPPER_NOW); } JNIEXPORT jobject JNICALL Java_Mapper_Device_00024Signal_properties (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; mapper_db_signal props = msig_properties(sig); msig_jni_context ctx = (msig_jni_context)props->user_data; return ctx->db_signal; } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_msig_1set_1property (JNIEnv *env, jobject obj, jlong s, jstring key, jobject value) { mapper_signal sig = (mapper_signal)ptr_jlong(s); const char *ckey = (*env)->GetStringUTFChars(env, key, 0); jclass cls = (*env)->GetObjectClass(env, value); if (cls) { jfieldID typeid = (*env)->GetFieldID(env, cls, "type", "C"); jfieldID lengthid = (*env)->GetFieldID(env, cls, "length", "I"); if (typeid && lengthid) { char type; int length; void *propval = 0; jfieldID valf = 0; jobject o; type = (*env)->GetCharField(env, value, typeid); length = (*env)->GetIntField(env, value, lengthid); switch (type) { case 'i': valf = (*env)->GetFieldID(env, cls, "_i", "[I"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetIntArrayElements(env, o, NULL); msig_set_property(sig, ckey, type, propval, length); (*env)->ReleaseIntArrayElements(env, o, propval, JNI_ABORT); break; case 'f': valf = (*env)->GetFieldID(env, cls, "_f", "[F"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetFloatArrayElements(env, o, NULL); msig_set_property(sig, ckey, type, propval, length); (*env)->ReleaseFloatArrayElements(env, o, propval, JNI_ABORT); break; case 'd': valf = (*env)->GetFieldID(env, cls, "_d", "[D"); o = (*env)->GetObjectField(env, value, valf); propval = (*env)->GetDoubleArrayElements(env, o, NULL); msig_set_property(sig, ckey, type, propval, length); (*env)->ReleaseDoubleArrayElements(env, o, propval, JNI_ABORT); break; case 's': case 'S': valf = (*env)->GetFieldID(env, cls, "_s", "[Ljava/lang/String;"); o = (*env)->GetObjectField(env, value, valf); jstring jstrings[length]; const char *cstrings[length]; int i; for (i = 0; i < length; i++) { jstrings[i] = (jstring) (*env)->GetObjectArrayElement(env, o, i); cstrings[i] = (*env)->GetStringUTFChars(env, jstrings[i], 0); } if (length == 1) msig_set_property(sig, ckey, type, (void*)&cstrings[0], 1); else msig_set_property(sig, ckey, type, (void*)&cstrings, length); for (i = 0; i < length; i++) (*env)->ReleaseStringUTFChars(env, jstrings[i], cstrings[i]); break; } } } (*env)->ReleaseStringUTFChars(env, key, ckey); } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_msig_1remove_1property (JNIEnv *env, jobject obj, jlong s, jstring key) { mapper_signal sig = (mapper_signal)ptr_jlong(s); const char *ckey = (*env)->GetStringUTFChars(env, key, 0); msig_remove_property(sig, ckey); (*env)->ReleaseStringUTFChars(env, key, ckey); } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__IILMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jint value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); if (props->length != 1) { throwIllegalArgumentLength(env, sig, 1); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); if (props->type == 'i') msig_update_instance(sig, id, &value, 1, ptt ? *ptt : MAPPER_NOW); else if (props->type == 'f') { float v = (float)value; msig_update_instance(sig, id, &v, 1, ptt ? *ptt : MAPPER_NOW); } else if (props->type == 'd') { double v = (double)value; msig_update_instance(sig, id, &v, 1, ptt ? *ptt : MAPPER_NOW); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__IFLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jfloat value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); if (props->length != 1) { throwIllegalArgumentLength(env, sig, 1); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); if (props->type == 'i') throwIllegalArgumentTruncate(env, sig); else if (props->type == 'f') { msig_update_instance(sig, id, &value, 1, ptt ? *ptt : MAPPER_NOW); } else if (props->type == 'd') { double v = (double)value; msig_update_instance(sig, id, &v, 1, ptt ? *ptt : MAPPER_NOW); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__IDLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jdouble value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); if (props->length != 1) { throwIllegalArgumentLength(env, sig, 1); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); if (props->type == 'i') throwIllegalArgumentTruncate(env, sig); else if (props->type == 'f') { float v = (float)value; msig_update_instance(sig, id, &v, 1, ptt ? *ptt : MAPPER_NOW); } else if (props->type == 'd') { msig_update_instance(sig, id, &value, 1, ptt ? *ptt : MAPPER_NOW); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__I_3ILMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jintArray value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); int length = (*env)->GetArrayLength(env, value); if (length != props->length) { throwIllegalArgumentLength(env, sig, length); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); jint *array = (*env)->GetIntArrayElements(env, value, 0); if (array) { if (props->type == 'i') { msig_update(sig, array, 0, MAPPER_NOW); } else if (props->type == 'f') { float *arraycopy = malloc(sizeof(float)*length); int i; for (i=0; itype == 'd') { double *arraycopy = malloc(sizeof(double)*length); int i; for (i=0; iReleaseIntArrayElements(env, value, array, JNI_ABORT); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__I_3FLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jfloatArray value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); int length = (*env)->GetArrayLength(env, value); if (length != props->length) { throwIllegalArgumentLength(env, sig, length); return; } if (props->type == 'i') { throwIllegalArgumentTruncate(env, sig); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); jfloat *array = (*env)->GetFloatArrayElements(env, value, 0); if (array) { if (props->type == 'f') { msig_update_instance(sig, id, array, 0, ptt ? *ptt : MAPPER_NOW); } else { double *arraycopy = malloc(sizeof(double)*length); int i; for (i=0; iReleaseFloatArrayElements(env, value, array, JNI_ABORT); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_updateInstance__I_3DLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jdoubleArray value, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); int length = (*env)->GetArrayLength(env, value); if (length != props->length) { throwIllegalArgumentLength(env, sig, length); return; } if (props->type == 'i') { throwIllegalArgumentTruncate(env, sig); return; } mapper_timetag_t tt, *ptt; ptt = get_timetag_from_jobject(env, objtt, &tt); jdouble *array = (*env)->GetDoubleArrayElements(env, value, 0); if (array) { if (props->type == 'd') { msig_update_instance(sig, id, array, 0, ptt ? *ptt : MAPPER_NOW); } else if (props->type == 'f') { float *arraycopy = malloc(sizeof(float)*length); int i; for (i=0; iReleaseDoubleArrayElements(env, value, array, JNI_ABORT); } } JNIEXPORT jboolean JNICALL Java_Mapper_Device_00024Signal_instanceValue__I_3ILMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jintArray ar, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return JNI_FALSE; mapper_db_signal props = msig_properties(sig); mapper_timetag_t tt; int length = (*env)->GetArrayLength(env, ar); if (length < props->length) { throwIllegalArgumentLength(env, sig, length); return JNI_FALSE; } if (props->type != 'i') { throwIllegalArgumentTruncate(env, sig); return JNI_FALSE; } int *value = msig_instance_value(sig, id, &tt); if (!value) return JNI_FALSE; jint *array = (*env)->GetIntArrayElements(env, ar, 0); if (array) { int i; for (i=0; i < props->length; i++) array[i] = (jint)value[i]; (*env)->ReleaseIntArrayElements(env, ar, array, 0); } if (objtt) { jclass cls = (*env)->GetObjectClass(env, objtt); if (cls) { jfieldID sec = (*env)->GetFieldID(env, cls, "sec", "J"); jfieldID frac = (*env)->GetFieldID(env, cls, "frac", "J"); if (sec && frac) { (*env)->SetLongField(env, objtt, sec, tt.sec); (*env)->SetLongField(env, objtt, frac, tt.frac); } } } return JNI_TRUE; } JNIEXPORT jboolean JNICALL Java_Mapper_Device_00024Signal_instanceValue__I_3FLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jfloatArray ar, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return JNI_FALSE; mapper_db_signal props = msig_properties(sig); mapper_timetag_t tt; int length = (*env)->GetArrayLength(env, ar); if (length < props->length) { throwIllegalArgumentLength(env, sig, length); return JNI_FALSE; } jfloat *array = (*env)->GetFloatArrayElements(env, ar, 0); if (array) { int i; switch (props->type) { case 'i': { int *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseFloatArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jfloat)value[i]; } break; case 'f': { float *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseFloatArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jfloat)value[i]; } break; case 'd': { double *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseFloatArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jfloat)value[i]; } break; } (*env)->ReleaseFloatArrayElements(env, ar, array, 0); } if (objtt) { jclass cls = (*env)->GetObjectClass(env, objtt); if (cls) { jfieldID sec = (*env)->GetFieldID(env, cls, "sec", "J"); jfieldID frac = (*env)->GetFieldID(env, cls, "frac", "J"); if (sec && frac) { (*env)->SetLongField(env, objtt, sec, tt.sec); (*env)->SetLongField(env, objtt, frac, tt.frac); } } } return JNI_TRUE; } JNIEXPORT jboolean JNICALL Java_Mapper_Device_00024Signal_instanceValue__I_3DLMapper_TimeTag_2 (JNIEnv *env, jobject obj, jint id, jdoubleArray ar, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return JNI_FALSE; mapper_db_signal props = msig_properties(sig); mapper_timetag_t tt; int length = (*env)->GetArrayLength(env, ar); if (length < props->length) { throwIllegalArgumentLength(env, sig, length); return JNI_FALSE; } jdouble *array = (*env)->GetDoubleArrayElements(env, ar, 0); if (array) { int i; switch (props->type) { case 'i': { int *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseDoubleArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jdouble)value[i]; } break; case 'f': { float *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseDoubleArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jdouble)value[i]; } break; case 'd': { double *value = msig_instance_value(sig, id, &tt); if (!value) { (*env)->ReleaseDoubleArrayElements(env, ar, array, JNI_ABORT); return JNI_FALSE; } for (i=0; i < props->length; i++) array[i] = (jdouble)value[i]; } break; } (*env)->ReleaseDoubleArrayElements(env, ar, array, 0); } if (objtt) { jclass cls = (*env)->GetObjectClass(env, objtt); if (cls) { jfieldID sec = (*env)->GetFieldID(env, cls, "sec", "J"); jfieldID frac = (*env)->GetFieldID(env, cls, "frac", "J"); if (sec && frac) { (*env)->SetLongField(env, objtt, sec, tt.sec); (*env)->SetLongField(env, objtt, frac, tt.frac); } } } return JNI_TRUE; } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_setInstanceEventCallback (JNIEnv *env, jobject obj, jobject handler, jint flags) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); msig_jni_context ctx = (msig_jni_context)props->user_data; if (ctx->instanceHandler) (*env)->DeleteGlobalRef(env, ctx->instanceHandler); if (handler) { ctx->instanceHandler = (*env)->NewGlobalRef(env, handler); msig_set_instance_event_callback(sig, java_msig_instance_event_cb, flags, ctx); } else { ctx->instanceHandler = 0; msig_set_instance_event_callback(sig, 0, flags, 0); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_setCallback (JNIEnv *env, jobject obj, jobject handler) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_db_signal props = msig_properties(sig); msig_jni_context ctx = (msig_jni_context)props->user_data; if (ctx->listener) (*env)->DeleteGlobalRef(env, ctx->listener); if (handler) { ctx->listener = (*env)->NewGlobalRef(env, handler); msig_set_callback(sig, java_msig_input_cb, ctx); } else { ctx->listener = 0; msig_set_callback(sig, 0, 0); } } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_setInstanceCallback (JNIEnv *env, jobject obj, jint instance_id, jobject data) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; jobject prev = (jobject)msig_get_instance_data(sig, instance_id); if (prev) (*env)->DeleteGlobalRef(env, prev); // Note that msig_set_instance_data() can trigger the instance // event callback, so we need to use the global to pass the // environment to the handler. genv = env; bailing = 0; msig_set_instance_data(sig, instance_id, data ? (*env)->NewGlobalRef(env, data) : 0); } JNIEXPORT jobject JNICALL Java_Mapper_Device_00024Signal_getInstanceCallback (JNIEnv *env, jobject obj, jint instance_id) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return (jobject)msig_get_instance_data(sig, instance_id); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_reserveInstances (JNIEnv *env, jobject obj, jintArray ids, jint num, jobject cb) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; int i, reserved = 0; jobject ref = cb ? (*env)->NewGlobalRef(env, cb) : 0; if (ids) { int length = (*env)->GetArrayLength(env, ids); jint *array = (*env)->GetIntArrayElements(env, ids, 0); for (i = 0; i < length; i++) { int id = (int)array[i]; reserved += msig_reserve_instances(sig, 1, &id, ref ? (void **)&ref : 0); } (*env)->ReleaseIntArrayElements(env, ids, array, JNI_ABORT); return reserved; } else { for (i = 0; i < num; i++) { reserved += msig_reserve_instances(sig, 1, 0, (void **)&ref); } return reserved; } return 0; } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_releaseInstance (JNIEnv *env, jobject obj, jint instance_id, jobject objtt) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; mapper_timetag_t tt, *ptt=0; ptt = get_timetag_from_jobject(env, objtt, &tt); msig_release_instance(sig, instance_id, ptt ? *ptt : MAPPER_NOW); } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_removeInstance (JNIEnv *env, jobject obj, jint instance_id) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; msig_remove_instance(sig, instance_id); } JNIEXPORT jobject JNICALL Java_Mapper_Device_00024Signal_oldestActiveInstance (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; int i, r = msig_get_oldest_active_instance(sig, &i); jobject iobj = 0; if (r == 0) { jclass cls = (*env)->FindClass(env, "java/lang/Integer"); if (cls) { jmethodID cons = (*env)->GetMethodID(env, cls, "", "(I)V"); if (cons) { iobj = (*env)->NewObject(env, cls, cons, i); return iobj; } } } return 0; } JNIEXPORT jobject JNICALL Java_Mapper_Device_00024Signal_newestActiveInstance (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; int i, r = msig_get_newest_active_instance(sig, &i); jobject iobj = 0; if (r == 0) { jclass cls = (*env)->FindClass(env, "java/lang/Integer"); if (cls) { jmethodID cons = (*env)->GetMethodID(env, cls, "", "(I)V"); if (cons) { iobj = (*env)->NewObject(env, cls, cons, i); return iobj; } } } return 0; } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_match_1instances (JNIEnv *env, jobject obj, jobject from, jobject to, jint instance_id) { mapper_signal sigfrom = get_signal_from_jobject(env, from); mapper_signal sigto = get_signal_from_jobject(env, to); if (!sigto || !sigfrom) return; msig_match_instances(sigfrom, sigto, instance_id); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_numActiveInstances (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return msig_num_active_instances(sig); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_numReservedInstances (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return msig_num_reserved_instances(sig); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_activeInstanceId (JNIEnv *env, jobject obj, jint index) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return msig_active_instance_id(sig, index); } JNIEXPORT void JNICALL Java_Mapper_Device_00024Signal_setInstanceAllocationMode (JNIEnv *env, jobject obj, jint mode) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return; msig_set_instance_allocation_mode(sig, mode); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_instanceAllocationMode (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return msig_get_instance_allocation_mode(sig); } JNIEXPORT jint JNICALL Java_Mapper_Device_00024Signal_numConnections (JNIEnv *env, jobject obj) { mapper_signal sig = get_signal_from_jobject(env, obj); if (!sig) return 0; return msig_num_connections(sig); } /**** Mapper.Monitor ****/ JNIEXPORT jlong JNICALL Java_Mapper_Monitor_mmon_1new (JNIEnv *env, jobject obj, jint autosubscribe_flags) { mapper_monitor mon = mapper_monitor_new(0, autosubscribe_flags); return jlong_ptr(mon); } JNIEXPORT jlong JNICALL Java_Mapper_Monitor_mmon_1get_1db (JNIEnv *env, jobject obj, jlong p) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); mapper_db db = mapper_monitor_get_db(mon); return jlong_ptr(db); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1free (JNIEnv *env, jobject obj, jlong p) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); mapper_monitor_free(mon); } JNIEXPORT jint JNICALL Java_Mapper_Monitor_mmon_1poll (JNIEnv *env, jobject obj, jlong d, jint timeout) { genv = env; bailing = 0; mapper_monitor mon = (mapper_monitor)ptr_jlong(d); return mapper_monitor_poll(mon, timeout); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1subscribe (JNIEnv *env, jobject obj, jlong p, jstring name, jint flags, jint timeout) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *cname = (*env)->GetStringUTFChars(env, name, 0); mapper_monitor_subscribe(mon, cname, flags, timeout); (*env)->ReleaseStringUTFChars(env, name, cname); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1unsubscribe (JNIEnv *env, jobject obj, jlong p, jstring name) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *cname = (*env)->GetStringUTFChars(env, name, 0); mapper_monitor_unsubscribe(mon, cname); (*env)->ReleaseStringUTFChars(env, name, cname); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1link (JNIEnv *env, jobject obj, jlong p, jstring src_name, jstring dest_name, jobject link_props) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *csrc_name = (*env)->GetStringUTFChars(env, src_name, 0); const char *cdest_name = (*env)->GetStringUTFChars(env, dest_name, 0); // TODO: process props! mapper_monitor_link(mon, csrc_name, cdest_name, 0, 0); (*env)->ReleaseStringUTFChars(env, src_name, csrc_name); (*env)->ReleaseStringUTFChars(env, dest_name, cdest_name); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1unlink (JNIEnv *env, jobject obj, jlong p, jstring src_name, jstring dest_name) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *csrc_name = (*env)->GetStringUTFChars(env, src_name, 0); const char *cdest_name = (*env)->GetStringUTFChars(env, dest_name, 0); mapper_monitor_unlink(mon, csrc_name, cdest_name); (*env)->ReleaseStringUTFChars(env, src_name, csrc_name); (*env)->ReleaseStringUTFChars(env, dest_name, cdest_name); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1connect_1or_1mod (JNIEnv *env, jobject obj, jlong p, jstring src_name, jstring dest_name, jobject jprops, jint modify) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *csrc_name = (*env)->GetStringUTFChars(env, src_name, 0); const char *cdest_name = (*env)->GetStringUTFChars(env, dest_name, 0); // process props // don't bother letting user define signal types or lengths (will be overwritten) mapper_db_connection_t cprops; jstring expr_jstr = 0; int src_length = 0, dest_length = 0; char src_type = 0, dest_type = 0; jobject src_min_field = NULL, src_max_field = NULL; jobject dest_min_field = NULL, dest_max_field = NULL; // TODO: "extra" props int props_flags = 0; if (jprops) { jclass cls = (*env)->GetObjectClass(env, jprops); if (cls) { // mode jfieldID fid = (*env)->GetFieldID(env, cls, "mode", "I"); if (fid) { cprops.mode = (*env)->GetIntField(env, jprops, fid); if ((int)cprops.mode >= 0) props_flags |= CONNECTION_MODE; } // expression fid = (*env)->GetFieldID(env, cls, "expression", "Ljava/lang/String;"); if (fid) { expr_jstr = (*env)->GetObjectField(env, jprops, fid); if (expr_jstr) { cprops.expression = (char*)(*env)->GetStringUTFChars(env, expr_jstr, 0); props_flags |= CONNECTION_EXPRESSION; } } // bound_min fid = (*env)->GetFieldID(env, cls, "boundMin", "I"); if (fid) { cprops.bound_min = (*env)->GetIntField(env, jprops, fid); if ((int)cprops.bound_min >= 0) props_flags |= CONNECTION_BOUND_MIN; } // bound_max fid = (*env)->GetFieldID(env, cls, "boundMax", "I"); if (fid) { cprops.bound_max = (*env)->GetIntField(env, jprops, fid); if ((int)cprops.bound_max >= 0) props_flags |= CONNECTION_BOUND_MAX; } // src_min fid = (*env)->GetFieldID(env, cls, "srcMin", "LMapper/PropertyValue;"); if (fid) { src_min_field = (*env)->GetObjectField(env, jprops, fid); if (src_min_field) { src_length = get_PropertyValue_elements(env, src_min_field, &cprops.src_min, &src_type); if (src_length) { cprops.src_length = src_length; cprops.src_type = src_type; props_flags |= (CONNECTION_RANGE_SRC_MIN | CONNECTION_SRC_LENGTH | CONNECTION_SRC_TYPE); } } } // src_max fid = (*env)->GetFieldID(env, cls, "srcMax", "LMapper/PropertyValue;"); if (fid) { src_max_field = (*env)->GetObjectField(env, jprops, fid); if (src_max_field) { char type; int length = get_PropertyValue_elements(env, src_max_field, &cprops.src_max, &type); if (length) { // check if length and type match, abort or cast otherwise if (src_length && length != src_length) printf("differing lengths for src!\n"); else if (src_type && type != src_type) printf("differing types for src!\n"); else { cprops.src_length = length; cprops.src_type = type; props_flags |= (CONNECTION_RANGE_SRC_MAX | CONNECTION_SRC_LENGTH | CONNECTION_SRC_TYPE); } } } } // dest_min fid = (*env)->GetFieldID(env, cls, "destMin", "LMapper/PropertyValue;"); if (fid) { dest_min_field = (*env)->GetObjectField(env, jprops, fid); if (dest_min_field) { dest_length = get_PropertyValue_elements(env, dest_min_field, &cprops.dest_min, &dest_type); if (dest_length) { cprops.dest_length = dest_length; cprops.dest_type = dest_type; props_flags |= (CONNECTION_RANGE_DEST_MIN | CONNECTION_DEST_LENGTH | CONNECTION_DEST_TYPE); } } } // dest_max fid = (*env)->GetFieldID(env, cls, "destMax", "LMapper/PropertyValue;"); if (fid) { dest_max_field = (*env)->GetObjectField(env, jprops, fid); if (dest_max_field) { char type; int length = get_PropertyValue_elements(env, dest_max_field, &cprops.dest_max, &type); if (length) { if (dest_length && length != dest_length) printf("differing lengths for dest!\n"); else if (dest_type && type != dest_type) printf("differing types for dest!\n"); else { // check if length and type match, abort or cast otherwise cprops.dest_length = length; cprops.dest_type = type; props_flags |= (CONNECTION_RANGE_DEST_MAX | CONNECTION_DEST_LENGTH | CONNECTION_DEST_TYPE); } } } } } } if (modify) mapper_monitor_connection_modify(mon, csrc_name, cdest_name, &cprops, props_flags); else mapper_monitor_connect(mon, csrc_name, cdest_name, &cprops, props_flags); (*env)->ReleaseStringUTFChars(env, src_name, csrc_name); (*env)->ReleaseStringUTFChars(env, dest_name, cdest_name); if (expr_jstr) (*env)->ReleaseStringUTFChars(env, expr_jstr, cprops.expression); if (src_min_field) release_PropertyValue_elements(env, src_min_field, cprops.src_min); if (src_max_field) release_PropertyValue_elements(env, src_max_field, cprops.src_max); if (dest_min_field) release_PropertyValue_elements(env, dest_min_field, cprops.dest_min); if (dest_max_field) release_PropertyValue_elements(env, dest_max_field, cprops.dest_max); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1disconnect (JNIEnv *env, jobject obj, jlong p, jstring src_name, jstring dest_name) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); const char *csrc_name = (*env)->GetStringUTFChars(env, src_name, 0); const char *cdest_name = (*env)->GetStringUTFChars(env, dest_name, 0); mapper_monitor_disconnect(mon, csrc_name, cdest_name); (*env)->ReleaseStringUTFChars(env, src_name, csrc_name); (*env)->ReleaseStringUTFChars(env, dest_name, cdest_name); } JNIEXPORT void JNICALL Java_Mapper_Monitor_mmon_1autosubscribe (JNIEnv *env, jobject obj, jlong p, jint flags) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); mapper_monitor_autosubscribe(mon, flags); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_mmon_1now (JNIEnv *env, jobject obj, jlong p) { mapper_monitor mon = (mapper_monitor)ptr_jlong(p); mapper_timetag_t tt; mapper_monitor_now(mon, &tt); jobject o = get_jobject_from_timetag(genv, &tt); return o; } /**** Mapper.Monitor.Db ****/ static void java_db_device_cb(mapper_db_device record, mapper_db_action_t action, void *user_data) { if (bailing || !user_data) return; // Create a wrapper class for the device properties jclass cls = (*genv)->FindClass(genv, "Mapper/Db/Device"); if (!cls) return; jmethodID mid = (*genv)->GetMethodID(genv, cls, "", "(J)V"); jobject devdbobj = (*genv)->NewObject(genv, cls, mid, jlong_ptr(record)); jobject obj = (jobject)user_data; cls = (*genv)->GetObjectClass(genv, user_data); if (cls) { mid = (*genv)->GetMethodID(genv, cls, "onEvent", "(LMapper/Db/Device;I)V"); if (mid) { (*genv)->CallVoidMethod(genv, obj, mid, devdbobj, action); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onEvent method.\n"); } } } static void java_db_signal_cb(mapper_db_signal record, mapper_db_action_t action, void *user_data) { if (bailing || !user_data) return; // Create a wrapper class for the signal properties jclass cls = (*genv)->FindClass(genv, "Mapper/Db/Signal"); if (!cls) return; jmethodID mid = (*genv)->GetMethodID(genv, cls, "", "(J)V"); jobject sigdbobj = (*genv)->NewObject(genv, cls, mid, jlong_ptr(record)); jobject obj = (jobject)user_data; cls = (*genv)->GetObjectClass(genv, user_data); if (cls) { mid = (*genv)->GetMethodID(genv, cls, "onEvent", "(LMapper/Db/Signal;I)V"); if (mid) { (*genv)->CallVoidMethod(genv, obj, mid, sigdbobj, action); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onEvent method.\n"); } } } static void java_db_link_cb(mapper_db_link record, mapper_db_action_t action, void *user_data) { if (bailing || !user_data) return; // Create a wrapper class for the link properties jclass cls = (*genv)->FindClass(genv, "Mapper/Db/Link"); if (!cls) return; jmethodID mid = (*genv)->GetMethodID(genv, cls, "", "(J)V"); jobject linkdbobj = (*genv)->NewObject(genv, cls, mid, jlong_ptr(record)); jobject obj = (jobject)user_data; cls = (*genv)->GetObjectClass(genv, user_data); if (cls) { mid = (*genv)->GetMethodID(genv, cls, "onEvent", "(LMapper/Db/Link;I)V"); if (mid) { (*genv)->CallVoidMethod(genv, obj, mid, linkdbobj, action); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onEvent method.\n"); } } } static void java_db_connection_cb(mapper_db_connection record, mapper_db_action_t action, void *user_data) { if (bailing || !user_data) return; // Create a wrapper class for the connection properties jclass cls = (*genv)->FindClass(genv, "Mapper/Db/Connection"); if (!cls) return; jmethodID mid = (*genv)->GetMethodID(genv, cls, "", "(J)V"); jobject condbobj = (*genv)->NewObject(genv, cls, mid, jlong_ptr(record)); jobject obj = (jobject)user_data; cls = (*genv)->GetObjectClass(genv, user_data); if (cls) { mid = (*genv)->GetMethodID(genv, cls, "onEvent", "(LMapper/Db/Connection;I)V"); if (mid) { (*genv)->CallVoidMethod(genv, obj, mid, condbobj, action); if ((*genv)->ExceptionOccurred(genv)) bailing = 1; } else { printf("Did not successfully look up onEvent method.\n"); } } } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1add_1device_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { // TODO: check listener hasn't already been added mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; jobject o = (*env)->NewGlobalRef(env, listener); mapper_db_add_device_callback(db, java_db_device_cb, o); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1remove_1device_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; mapper_db_remove_device_callback(db, java_db_device_cb, listener); (*env)->DeleteGlobalRef(env, listener); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1add_1signal_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { // TODO: check listener hasn't already been added mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; jobject o = (*env)->NewGlobalRef(env, listener); mapper_db_add_signal_callback(db, java_db_signal_cb, o); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1remove_1signal_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; mapper_db_remove_signal_callback(db, java_db_signal_cb, ptr_jlong(listener)); (*env)->DeleteGlobalRef(env, listener); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1add_1link_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { // TODO: check listener hasn't already been added mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; jobject o = (*env)->NewGlobalRef(env, listener); mapper_db_add_link_callback(db, java_db_link_cb, o); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1remove_1link_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; mapper_db_remove_link_callback(db, java_db_link_cb, ptr_jlong(listener)); (*env)->DeleteGlobalRef(env, listener); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1add_1connection_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { // TODO: check listener hasn't already been added mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; jobject o = (*env)->NewGlobalRef(env, listener); mapper_db_add_connection_callback(db, java_db_connection_cb, o); } JNIEXPORT void JNICALL Java_Mapper_Monitor_00024Db_mdb_1remove_1connection_1callback (JNIEnv *env, jobject obj, jlong p, jobject listener) { mapper_db db = (mapper_db)ptr_jlong(p); if (!db || !listener) return; mapper_db_remove_connection_callback(db, java_db_connection_cb, ptr_jlong(listener)); (*env)->DeleteGlobalRef(env, listener); } /**** Mapper.Db.Device ****/ JNIEXPORT jstring JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return (*env)->NewStringUTF(env, props->name); } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1ordinal (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->ordinal; } JNIEXPORT jstring JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1host (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return (*env)->NewStringUTF(env, props->host); } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1port (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->port; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1inputs (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_inputs; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1outputs (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_outputs; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1links_1in (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_links_in; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1links_1out (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_links_out; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1connections_1in (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_connections_in; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1num_1connections_1out (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->num_connections_out; } JNIEXPORT jint JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1version (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); return props->version; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Device_mdb_1device_1get_1synced (JNIEnv *env, jobject obj, jlong p) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); jobject o = get_jobject_from_timetag(genv, &props->synced); return o; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Device_mdb_1device_1property_1lookup (JNIEnv *env, jobject obj, jlong p, jstring property) { mapper_db_device props = (mapper_db_device)ptr_jlong(p); const char *cprop = (*env)->GetStringUTFChars(env, property, 0); char type; int length; const void *value; jobject o = 0; if (!mapper_db_device_property_lookup(props, cprop, &type, &value, &length)) o = build_PropertyValue(env, type, value, length); (*env)->ReleaseStringUTFChars(env, property, cprop); return o; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_devices (JNIEnv *env, jobject obj) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; mapper_db_device *devs = mapper_db_get_all_devices(db); if (!devs) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/DeviceCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(devs)); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_get_1device (JNIEnv *env, jobject obj, jstring s) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *name = (*env)->GetStringUTFChars(env, s, 0); mapper_db_device dev = mapper_db_get_device_by_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); if (!dev) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/Device"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(dev)); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_match_1devices (JNIEnv *env, jobject obj, jstring s) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *pattern = (*env)->GetStringUTFChars(env, s, 0); mapper_db_device *devs = mapper_db_match_devices_by_name(db, pattern); (*env)->ReleaseStringUTFChars(env, s, pattern); if (!devs) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/DeviceCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(devs)); } /**** Mapper.Db.Device.Iterator ****/ JNIEXPORT jlong JNICALL Java_Mapper_Db_DeviceIterator_mdb_1deref (JNIEnv *env, jobject obj, jlong p) { void **ptr = (void**)ptr_jlong(p); return jlong_ptr(*ptr); } JNIEXPORT jlong JNICALL Java_Mapper_Db_DeviceIterator_mdb_1device_1next (JNIEnv *env, jobject obj, jlong p) { mapper_db_device_t **devs = (mapper_db_device_t**)ptr_jlong(p); return jlong_ptr(mapper_db_device_next(devs)); } JNIEXPORT void JNICALL Java_Mapper_Db_DeviceIterator_mdb_1device_1done (JNIEnv *env, jobject obj, jlong p) { mapper_db_device_t **devs = (mapper_db_device_t**)ptr_jlong(p); if (devs) mapper_db_device_done(devs); } /**** Mapper.Db.Signal ****/ JNIEXPORT jstring JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return (*env)->NewStringUTF(env, props->name); } JNIEXPORT jstring JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1device_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return (*env)->NewStringUTF(env, props->device_name); } JNIEXPORT jboolean JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1is_1output (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return props->is_output!=0; } JNIEXPORT jchar JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1type (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return props->type; } JNIEXPORT jint JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1length (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return props->length; } JNIEXPORT jstring JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1unit (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return (*env)->NewStringUTF(env, props->unit); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1minimum (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); if (!props->minimum) return 0; return build_PropertyValue(env, props->type, props->minimum, props->length); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1maximum (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); if (!props->maximum) return 0; return build_PropertyValue(env, props->type, props->maximum, props->length); } JNIEXPORT jdouble JNICALL Java_Mapper_Db_Signal_mdb_1signal_1get_1rate (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); return (jdouble)props->rate; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Signal_mdb_1signal_1property_1lookup (JNIEnv *env, jobject obj, jlong p, jstring property) { mapper_db_signal props = (mapper_db_signal)ptr_jlong(p); const char *cprop = (*env)->GetStringUTFChars(env, property, 0); char type; int length; const void *value; jobject o = 0; if (!mapper_db_signal_property_lookup(props, cprop, &type, &value, &length)) o = build_PropertyValue(env, type, value, length); (*env)->ReleaseStringUTFChars(env, property, cprop); return o; } JNIEXPORT jlong JNICALL Java_Mapper_Monitor_00024Db_mdb_1inputs (JNIEnv *env, jobject obj, jlong p, jstring s) { mapper_db db = (mapper_db)ptr_jlong(p); mapper_db_signal *sigs; if (s) { const char *name = (*env)->GetStringUTFChars(env, s, 0); sigs = mapper_db_get_inputs_by_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); } else { sigs = mapper_db_get_all_inputs(db); } return jlong_ptr(sigs); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_getInput (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); const char *sig_name = (*env)->GetStringUTFChars(env, s2, 0); mapper_db_signal sig = mapper_db_get_input_by_device_and_signal_names(db, dev_name, sig_name); (*env)->ReleaseStringUTFChars(env, s1, dev_name); (*env)->ReleaseStringUTFChars(env, s2, sig_name); if (!sig) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/Signal"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(sig)); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_matchInputs (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); const char *sig_pattern = (*env)->GetStringUTFChars(env, s2, 0); mapper_db_signal *sigs = mapper_db_match_inputs_by_device_name(db, dev_name, sig_pattern); (*env)->ReleaseStringUTFChars(env, s1, dev_name); (*env)->ReleaseStringUTFChars(env, s2, sig_pattern); if (!sigs) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/SignalCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(sigs)); } JNIEXPORT jlong JNICALL Java_Mapper_Monitor_00024Db_mdb_1outputs (JNIEnv *env, jobject obj, jlong p, jstring s) { mapper_db db = (mapper_db)ptr_jlong(p); mapper_db_signal *sigs; if (s) { const char *name = (*env)->GetStringUTFChars(env, s, 0); sigs = mapper_db_get_outputs_by_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); } else { sigs = mapper_db_get_all_outputs(db); } return jlong_ptr(sigs); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_getOutput (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); const char *sig_name = (*env)->GetStringUTFChars(env, s2, 0); mapper_db_signal sig = mapper_db_get_output_by_device_and_signal_names(db, dev_name, sig_name); (*env)->ReleaseStringUTFChars(env, s1, dev_name); (*env)->ReleaseStringUTFChars(env, s2, sig_name); if (!sig) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/Signal"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(sig)); } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_matchOutputs (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); const char *sig_pattern = (*env)->GetStringUTFChars(env, s2, 0); mapper_db_signal *sigs = mapper_db_match_outputs_by_device_name(db, dev_name, sig_pattern); (*env)->ReleaseStringUTFChars(env, s1, dev_name); (*env)->ReleaseStringUTFChars(env, s2, sig_pattern); if (!sigs) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/SignalCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); return (*env)->NewObject(env, cls, mid, jlong_ptr(sigs)); } /**** Mapper.Db.Signal.Iterator ****/ JNIEXPORT jlong JNICALL Java_Mapper_Db_SignalIterator_mdb_1deref (JNIEnv *env, jobject obj, jlong p) { void **ptr = (void**)ptr_jlong(p); return jlong_ptr(*ptr); } JNIEXPORT jlong JNICALL Java_Mapper_Db_SignalIterator_mdb_1signal_1next (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal_t **sigs = (mapper_db_signal_t**)ptr_jlong(p); return jlong_ptr(mapper_db_signal_next(sigs)); } JNIEXPORT void JNICALL Java_Mapper_Db_SignalIterator_mdb_1signal_1done (JNIEnv *env, jobject obj, jlong p) { mapper_db_signal_t **sigs = (mapper_db_signal_t**)ptr_jlong(p); if (sigs) mapper_db_signal_done(sigs); } /**** Mapper.Db.Link ****/ JNIEXPORT jstring JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1src_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return (*env)->NewStringUTF(env, props->src_name); } JNIEXPORT jstring JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1dest_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return (*env)->NewStringUTF(env, props->dest_name); } JNIEXPORT jstring JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1src_1host (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return (*env)->NewStringUTF(env, props->src_host); } JNIEXPORT jint JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1src_1port (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return props->src_port; } JNIEXPORT jstring JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1dest_1host (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return (*env)->NewStringUTF(env, props->dest_host); } JNIEXPORT jint JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1dest_1port (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return props->dest_port; } JNIEXPORT jint JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1num_1scopes (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); return props->num_scopes; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Link_mdb_1link_1get_1scope_1names (JNIEnv *env, jobject obj, jlong p) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); if (!props->num_scopes) return 0; return build_PropertyValue(env, 's', props->scope_names, props->num_scopes); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Link_mapper_1db_1link_1property_1lookup (JNIEnv *env, jobject obj, jlong p, jstring property) { mapper_db_link props = (mapper_db_link)ptr_jlong(p); const char *cprop = (*env)->GetStringUTFChars(env, property, 0); char type; int length; const void *value; jobject o = 0; if (!mapper_db_link_property_lookup(props, cprop, &type, &value, &length)) o = build_PropertyValue(env, type, value, length); (*env)->ReleaseStringUTFChars(env, property, cprop); return o; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_getLink (JNIEnv *env, jobject obj, jstring s1, jstring s2) { jobject linkobj = 0; mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *src_name = (*env)->GetStringUTFChars(env, s1, 0); const char *dest_name = (*env)->GetStringUTFChars(env, s2, 0); mapper_db_link link = mapper_db_get_link_by_src_dest_names(db, src_name, dest_name); if (link) {; jclass cls = (*env)->FindClass(env, "Mapper/Db/Link"); if (cls) { jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); linkobj = (*env)->NewObject(env, cls, mid, jlong_ptr(link)); } } (*env)->ReleaseStringUTFChars(env, s1, src_name); (*env)->ReleaseStringUTFChars(env, s2, dest_name); return linkobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_mdb_1links (JNIEnv *env, jobject obj, jlong p, jstring s) { mapper_db_link *links; mapper_db db = (mapper_db)ptr_jlong(p); if (!db) return 0; if (s) { const char *name = (*env)->GetStringUTFChars(env, s, 0); links = mapper_db_get_links_by_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); } else { links = mapper_db_get_all_links(db); } if (!links) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/LinkCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject linksobj = (*env)->NewObject(env, cls, mid, jlong_ptr(links)); return linksobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_links (JNIEnv *env, jobject obj, jobject srcobj, jobject destobj) { mapper_db_link *links; mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; // retrieve mapper_db_device* ptrs from DeviceCollection objects mapper_db_device *src = get_db_device_ptr_from_jobject(env, srcobj); mapper_db_device *dest = get_db_device_ptr_from_jobject(env, destobj); if (!src || !dest) return 0; links = mapper_db_get_links_by_src_dest_devices(db, src, dest); if (!links) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/LinkCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject linksobj = (*env)->NewObject(env, cls, mid, jlong_ptr(links)); return linksobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_linksBySrc (JNIEnv *env, jobject obj, jstring s) { mapper_db_link *links; mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *name = (*env)->GetStringUTFChars(env, s, 0); links = mapper_db_get_links_by_src_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); if (!links) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/LinkCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject linksobj = (*env)->NewObject(env, cls, mid, jlong_ptr(links)); return linksobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_linksByDest (JNIEnv *env, jobject obj, jstring s) { mapper_db_link *links; mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; const char *name = (*env)->GetStringUTFChars(env, s, 0); links = mapper_db_get_links_by_dest_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); if (!links) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/LinkCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject linksobj = (*env)->NewObject(env, cls, mid, jlong_ptr(links)); return linksobj; } /**** Mapper.Db.Link.Iterator ****/ JNIEXPORT jlong JNICALL Java_Mapper_Db_LinkIterator_mdb_1deref (JNIEnv *env, jobject obj, jlong p) { void **ptr = (void**)ptr_jlong(p); return jlong_ptr(*ptr); } JNIEXPORT jlong JNICALL Java_Mapper_Db_LinkIterator_mdb_1link_1next (JNIEnv *env, jobject obj, jlong p) { mapper_db_link_t **links = (mapper_db_link_t**)ptr_jlong(p); return jlong_ptr(mapper_db_link_next(links)); } JNIEXPORT void JNICALL Java_Mapper_Db_LinkIterator_mdb_1link_1done (JNIEnv *env, jobject obj, jlong p) { mapper_db_link_t **links = (mapper_db_link_t**)ptr_jlong(p); if (links) mapper_db_link_done(links); } /**** Mapper.Db.Connection ****/ JNIEXPORT jstring JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1src_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return (*env)->NewStringUTF(env, props->src_name); } JNIEXPORT jstring JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1dest_1name (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return (*env)->NewStringUTF(env, props->dest_name); } JNIEXPORT jchar JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1src_1type (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->src_type; } JNIEXPORT jchar JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1dest_1type (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->dest_type; } JNIEXPORT jint JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1src_1length (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->src_length; } JNIEXPORT jint JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1dest_1length (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->dest_length; } JNIEXPORT jint JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1bound_1min (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->bound_min; } JNIEXPORT jint JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1bound_1max (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->bound_max; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1src_1min (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); if (!props->src_min) return 0; return build_PropertyValue(env, props->src_type, props->src_min, props->src_length); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1src_1max (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); if (!props->src_max) return 0; return build_PropertyValue(env, props->src_type, props->src_max, props->src_length); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1dest_1min (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); if (!props->dest_min) return 0; return build_PropertyValue(env, props->dest_type, props->dest_min, props->dest_length); } JNIEXPORT jobject JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1dest_1max (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); if (!props->dest_max) return 0; return build_PropertyValue(env, props->dest_type, props->dest_max, props->dest_length); } JNIEXPORT jint JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1mode (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); return props->mode; } JNIEXPORT jstring JNICALL Java_Mapper_Db_Connection_mdb_1connection_1get_1expression (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); if (props->expression) return (*env)->NewStringUTF(env, props->expression); return 0; } JNIEXPORT jobject JNICALL Java_Mapper_Db_Connection_mapper_1db_1connection_1property_1lookup (JNIEnv *env, jobject obj, jlong p, jstring property) { mapper_db_connection props = (mapper_db_connection)ptr_jlong(p); const char *cprop = (*env)->GetStringUTFChars(env, property, 0); char type; int length; const void *value; jobject o = 0; if (!mapper_db_connection_property_lookup(props, cprop, &type, &value, &length)) o = build_PropertyValue(env, type, value, length); (*env)->ReleaseStringUTFChars(env, property, cprop); return o; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_mdb_1connections (JNIEnv *env, jobject obj, jlong p, jstring s) { mapper_db_connection *cons; mapper_db db = (mapper_db)ptr_jlong(p); if (!db) return 0; if (s) { const char *name = (*env)->GetStringUTFChars(env, s, 0); cons = mapper_db_get_connections_by_device_name(db, name); (*env)->ReleaseStringUTFChars(env, s, name); } else { cons = mapper_db_get_all_connections(db); } if (!cons) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/ConnectionCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject consobj = (*env)->NewObject(env, cls, mid, jlong_ptr(cons)); return consobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_connections (JNIEnv *env, jobject obj, jobject srcobj, jobject destobj) { mapper_db_connection *cons; mapper_db db = get_db_from_jobject(env, obj); if (!db) return 0; // retrieve mapper_db_signal* ptrs from SignalCollection objects mapper_db_signal *src = get_db_signal_ptr_from_jobject(env, srcobj); mapper_db_signal *dest = get_db_signal_ptr_from_jobject(env, destobj); if (!src || !dest) return 0; cons = mapper_db_get_connections_by_signal_queries(db, src, dest); if (!cons) return 0; jclass cls = (*env)->FindClass(env, "Mapper/Db/ConnectionCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject consobj = (*env)->NewObject(env, cls, mid, jlong_ptr(cons)); return consobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_mdb_1connections_1by_1src (JNIEnv *env, jobject obj, jlong p, jstring s1, jstring s2) { mapper_db_connection *cons; mapper_db db = get_db_from_jobject(env, obj); if (!db || !s2) return 0; const char *sig_name = (*env)->GetStringUTFChars(env, s2, 0); if (s1) { const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); cons = mapper_db_get_connections_by_src_device_and_signal_names(db, dev_name, sig_name); (*env)->ReleaseStringUTFChars(env, s1, dev_name); } else { cons = mapper_db_get_connections_by_src_signal_name(db, sig_name); } (*env)->ReleaseStringUTFChars(env, s2, sig_name); jclass cls = (*env)->FindClass(env, "Mapper/Db/ConnectionCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject consobj = (*env)->NewObject(env, cls, mid, jlong_ptr(cons)); return consobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_mdb_1connections_1by_1dest (JNIEnv *env, jobject obj, jlong p, jstring s1, jstring s2) { mapper_db_connection *cons; mapper_db db = get_db_from_jobject(env, obj); if (!db || !s2) return 0; const char *sig_name = (*env)->GetStringUTFChars(env, s2, 0); if (s1) { const char *dev_name = (*env)->GetStringUTFChars(env, s1, 0); cons = mapper_db_get_connections_by_dest_device_and_signal_names(db, dev_name, sig_name); (*env)->ReleaseStringUTFChars(env, s1, dev_name); } else { cons = mapper_db_get_connections_by_dest_signal_name(db, sig_name); } (*env)->ReleaseStringUTFChars(env, s2, sig_name); jclass cls = (*env)->FindClass(env, "Mapper/Db/ConnectionCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject consobj = (*env)->NewObject(env, cls, mid, jlong_ptr(cons)); return consobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_connectionBySignals (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db_connection con; mapper_db db = get_db_from_jobject(env, obj); if (!db || !s1 || !s2) return 0; const char *src_name = (*env)->GetStringUTFChars(env, s1, 0); const char *dest_name = (*env)->GetStringUTFChars(env, s2, 0); con = mapper_db_get_connection_by_signal_full_names(db, src_name, dest_name); (*env)->ReleaseStringUTFChars(env, s1, src_name); (*env)->ReleaseStringUTFChars(env, s2, dest_name); jclass cls = (*env)->FindClass(env, "Mapper/Db/Connection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject conobj = (*env)->NewObject(env, cls, mid, jlong_ptr(con)); return conobj; } JNIEXPORT jobject JNICALL Java_Mapper_Monitor_00024Db_connectionsByDevices (JNIEnv *env, jobject obj, jstring s1, jstring s2) { mapper_db_connection *cons; mapper_db db = get_db_from_jobject(env, obj); if (!db || !s1 || !s2) return 0; const char *src_name = (*env)->GetStringUTFChars(env, s1, 0); const char *dest_name = (*env)->GetStringUTFChars(env, s2, 0); cons = mapper_db_get_connections_by_src_dest_device_names(db, src_name, dest_name); (*env)->ReleaseStringUTFChars(env, s1, src_name); (*env)->ReleaseStringUTFChars(env, s2, dest_name); jclass cls = (*env)->FindClass(env, "Mapper/Db/ConnectionCollection"); if (!cls) return 0; jmethodID mid = (*env)->GetMethodID(env, cls, "", "(J)V"); jobject consobj = (*env)->NewObject(env, cls, mid, jlong_ptr(cons)); return consobj; } /**** Mapper.Db.Connection.Iterator ****/ JNIEXPORT jlong JNICALL Java_Mapper_Db_ConnectionIterator_mdb_1deref (JNIEnv *env, jobject obj, jlong p) { void **ptr = (void**)ptr_jlong(p); return jlong_ptr(*ptr); } JNIEXPORT jlong JNICALL Java_Mapper_Db_ConnectionIterator_mdb_1connection_1next (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection_t **connections = (mapper_db_connection_t**)ptr_jlong(p); return jlong_ptr(mapper_db_connection_next(connections)); } JNIEXPORT void JNICALL Java_Mapper_Db_ConnectionIterator_mdb_1connection_1done (JNIEnv *env, jobject obj, jlong p) { mapper_db_connection_t **connections = (mapper_db_connection_t**)ptr_jlong(p); if (connections) mapper_db_connection_done(connections); } libmapper/jni/Makefile.in0000644000175000017500000005713612423630127014662 0ustar tiagotiago# 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 = jni DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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__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)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libmapperjni_@MAJOR_VERSION@_la_DEPENDENCIES = \ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la \ $(am__DEPENDENCIES_1) am_libmapperjni_@MAJOR_VERSION@_la_OBJECTS = \ libmapperjni_@MAJOR_VERSION@_la-mapperjni.lo libmapperjni_@MAJOR_VERSION@_la_OBJECTS = \ $(am_libmapperjni_@MAJOR_VERSION@_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 = libmapperjni_@MAJOR_VERSION@_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libmapperjni_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) \ $(libmapperjni_@MAJOR_VERSION@_la_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 = $(libmapperjni_@MAJOR_VERSION@_la_SOURCES) DIST_SOURCES = $(libmapperjni_@MAJOR_VERSION@_la_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) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ lib_LTLIBRARIES = libmapperjni-@MAJOR_VERSION@.la libmapperjni_@MAJOR_VERSION@_la_CFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) -I@JNIPATH@ libmapperjni_@MAJOR_VERSION@_la_SOURCES = mapperjni.c libmapperjni_@MAJOR_VERSION@_la_LDFLAGS = -export-dynamic -version-info @SO_VERSION@ libmapperjni_@MAJOR_VERSION@_la_LIBADD = \ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la $(liblo_LIBS) JHEADERS = Mapper_Device.h Mapper_Device_Signal.h Mapper_Db_Signal.h \ Mapper_Db_Device.h Mapper_Db_Link.h Mapper_Db_Connection.h \ Mapper_Monitor.h Mapper_Monitor_Db.h Mapper_Db_DeviceIterator.h \ Mapper_Db_SignalIterator.h Mapper_Db_LinkIterator.h \ Mapper_Db_ConnectionIterator.h JFLAGS = -source 1.5 -target 1.5 JCLASSES = Mapper/NativeLib.class Mapper/Device.class \ Mapper/PropertyValue.class Mapper/TimeTag.class \ Mapper/InputListener.class Mapper/InstanceEventListener.class \ Mapper/Monitor.class Mapper/Db/Device.class \ Mapper/Db/Signal.class Mapper/Db/Link.class \ Mapper/Db/Connection.class Mapper/Db/DeviceListener.class \ Mapper/Db/SignalListener.class Mapper/Db/LinkListener.class \ Mapper/Db/ConnectionListener.class \ Mapper/Db/DeviceCollection.class Mapper/Db/DeviceIterator.class \ Mapper/Db/SignalCollection.class Mapper/Db/SignalIterator.class \ Mapper/Db/LinkCollection.class Mapper/Db/LinkIterator.class \ Mapper/Db/ConnectionCollection.class \ Mapper/Db/ConnectionIterator.class JCLASSESINTERNAL = Mapper/Device$$Signal.class Mapper/Device$$1.class \ Mapper/PropertyValue$$PropertyException.class JJAVA = $(JCLASSES:%.class=%.java) BUILT_SOURCES = $(JHEADERS) test.class testquery.class testreverse.class \ testspeed.class libmapper-@MAJOR_VERSION@.jar MOSTLYCLEANFILES = $(BUILT_SOURCES) $(JCLASSES) $(subst $$,\$$,$(JCLASSESINTERNAL)) \ $(subst $$,\$$,test$$1.class test$$2.class test$$3.class testquery$$1.class \ testquery$$2.class testquery$$3.class testreverse$$1.class testreverse$$2.class \ testreverse$$3.class testspeed$$1.class testspeed$$2.class testspeed$$3.class) EXTRA_DIST = $(JJAVA) test.java testquery.java testreverse.java testspeed.java \ $(JHEADERS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign jni/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign jni/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-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}; \ } libmapperjni-@MAJOR_VERSION@.la: $(libmapperjni_@MAJOR_VERSION@_la_OBJECTS) $(libmapperjni_@MAJOR_VERSION@_la_DEPENDENCIES) $(EXTRA_libmapperjni_@MAJOR_VERSION@_la_DEPENDENCIES) $(AM_V_CCLD)$(libmapperjni_@MAJOR_VERSION@_la_LINK) -rpath $(libdir) $(libmapperjni_@MAJOR_VERSION@_la_OBJECTS) $(libmapperjni_@MAJOR_VERSION@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmapperjni_@MAJOR_VERSION@_la-mapperjni.Plo@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 $@ $< libmapperjni_@MAJOR_VERSION@_la-mapperjni.lo: mapperjni.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapperjni_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -MT libmapperjni_@MAJOR_VERSION@_la-mapperjni.lo -MD -MP -MF $(DEPDIR)/libmapperjni_@MAJOR_VERSION@_la-mapperjni.Tpo -c -o libmapperjni_@MAJOR_VERSION@_la-mapperjni.lo `test -f 'mapperjni.c' || echo '$(srcdir)/'`mapperjni.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmapperjni_@MAJOR_VERSION@_la-mapperjni.Tpo $(DEPDIR)/libmapperjni_@MAJOR_VERSION@_la-mapperjni.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mapperjni.c' object='libmapperjni_@MAJOR_VERSION@_la-mapperjni.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmapperjni_@MAJOR_VERSION@_la_CFLAGS) $(CFLAGS) -c -o libmapperjni_@MAJOR_VERSION@_la-mapperjni.lo `test -f 'mapperjni.c' || echo '$(srcdir)/'`mapperjni.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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 "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: 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 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-libLTLIBRARIES 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: uninstall-libLTLIBRARIES .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags-am \ distclean distclean-compile distclean-generic \ distclean-libtool 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-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 \ tags-am uninstall uninstall-am uninstall-libLTLIBRARIES Mapper_%.h: Mapper/%.class $(JAVAH) $(subst /,.,$(<:%.class=%)) if [ -f $@ ]; then touch $@; fi Mapper_Db_%.h: Mapper/Db/%.class $(JAVAH) $(subst /,.,$(<:%.class=%)) if [ -f $@ ]; then touch $@; fi Mapper/%.class: Mapper/%.java $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< test.class: test.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testquery.class: testquery.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testreverse.class: testreverse.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testspeed.class: testspeed.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< libmapper-@MAJOR_VERSION@.jar: $(JCLASSES) $(JCLASSESINTERNAL) $(JAR) cvf $@ $(subst $$,\$$,$^) if mkdir -v TestInstances/code; then \ cd TestInstances/code/; \ ln -v -s ../../.libs/*.so .; \ ln -v -s ../../$@; \ fi # For processing test sketch # 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: libmapper/jni/Makefile.am0000644000175000017500000000660412423630127014643 0ustar tiagotiago lib_LTLIBRARIES = libmapperjni-@MAJOR_VERSION@.la libmapperjni_@MAJOR_VERSION@_la_CFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) -I@JNIPATH@ libmapperjni_@MAJOR_VERSION@_la_SOURCES = mapperjni.c libmapperjni_@MAJOR_VERSION@_la_LDFLAGS = -export-dynamic -version-info @SO_VERSION@ libmapperjni_@MAJOR_VERSION@_la_LIBADD = \ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la $(liblo_LIBS) JHEADERS = Mapper_Device.h Mapper_Device_Signal.h Mapper_Db_Signal.h \ Mapper_Db_Device.h Mapper_Db_Link.h Mapper_Db_Connection.h \ Mapper_Monitor.h Mapper_Monitor_Db.h Mapper_Db_DeviceIterator.h \ Mapper_Db_SignalIterator.h Mapper_Db_LinkIterator.h \ Mapper_Db_ConnectionIterator.h JFLAGS = -source 1.5 -target 1.5 JCLASSES = Mapper/NativeLib.class Mapper/Device.class \ Mapper/PropertyValue.class Mapper/TimeTag.class \ Mapper/InputListener.class Mapper/InstanceEventListener.class \ Mapper/Monitor.class Mapper/Db/Device.class \ Mapper/Db/Signal.class Mapper/Db/Link.class \ Mapper/Db/Connection.class Mapper/Db/DeviceListener.class \ Mapper/Db/SignalListener.class Mapper/Db/LinkListener.class \ Mapper/Db/ConnectionListener.class \ Mapper/Db/DeviceCollection.class Mapper/Db/DeviceIterator.class \ Mapper/Db/SignalCollection.class Mapper/Db/SignalIterator.class \ Mapper/Db/LinkCollection.class Mapper/Db/LinkIterator.class \ Mapper/Db/ConnectionCollection.class \ Mapper/Db/ConnectionIterator.class JCLASSESINTERNAL = Mapper/Device$$Signal.class Mapper/Device$$1.class \ Mapper/PropertyValue$$PropertyException.class JJAVA = $(JCLASSES:%.class=%.java) BUILT_SOURCES = $(JHEADERS) test.class testquery.class testreverse.class \ testspeed.class libmapper-@MAJOR_VERSION@.jar MOSTLYCLEANFILES = $(BUILT_SOURCES) $(JCLASSES) $(subst $$,\$$,$(JCLASSESINTERNAL)) \ $(subst $$,\$$,test$$1.class test$$2.class test$$3.class testquery$$1.class \ testquery$$2.class testquery$$3.class testreverse$$1.class testreverse$$2.class \ testreverse$$3.class testspeed$$1.class testspeed$$2.class testspeed$$3.class) Mapper_%.h: Mapper/%.class $(JAVAH) $(subst /,.,$(<:%.class=%)) if [ -f $@ ]; then touch $@; fi Mapper_Db_%.h: Mapper/Db/%.class $(JAVAH) $(subst /,.,$(<:%.class=%)) if [ -f $@ ]; then touch $@; fi Mapper/%.class: Mapper/%.java $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< test.class: test.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testquery.class: testquery.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testreverse.class: testreverse.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< testspeed.class: testspeed.java $(JCLASSES) $(JAVAC) $(JFLAGS) -sourcepath @top_srcdir@/jni -d . $< libmapper-@MAJOR_VERSION@.jar: $(JCLASSES) $(JCLASSESINTERNAL) $(JAR) cvf $@ $(subst $$,\$$,$^) if mkdir -v TestInstances/code; then \ cd TestInstances/code/; \ ln -v -s ../../.libs/*.so .; \ ln -v -s ../../$@; \ fi # For processing test sketch EXTRA_DIST = $(JJAVA) test.java testquery.java testreverse.java testspeed.java \ $(JHEADERS) libmapper/jni/Mapper/0000755000175000017500000000000012423630127014025 5ustar tiagotiagolibmapper/jni/Mapper/PropertyValue.java0000644000175000017500000002666112423630127017524 0ustar tiagotiago package Mapper; import java.util.Arrays; /* Contains a value representable by supported types, which correspond * with OSC types. */ public class PropertyValue { public PropertyValue() { length=0; type = 0; } public PropertyValue(int i) { setValue('i', i); } public PropertyValue(float f) { setValue('f', f); } public PropertyValue(double d) { setValue('d', d); } public PropertyValue(String s) { setValue('s', s); } public PropertyValue(int[] i) { setValue('i', i); } public PropertyValue(float[] f) { setValue('f', f); } public PropertyValue(double[] d) { setValue('d', d); } public PropertyValue(String[] s) { setValue('s', s); } public PropertyValue(char _type, int i) { setValue(_type, i); } public PropertyValue(char _type, float f) { setValue(_type, f); } public PropertyValue(char _type, double d) { setValue(_type, d); } public PropertyValue(char _type, String s) { setValue(_type, s); } public PropertyValue(char _type, int[] i) { setValue(_type, i); } public PropertyValue(char _type, float[] f) { setValue(_type, f); } public PropertyValue(char _type, double[] d) { setValue(_type, d); } public PropertyValue(char _type, String[] s) { setValue(_type, s); } // TODO handle entire set of OSC types public class PropertyException extends RuntimeException { public PropertyException() { super("Property does not contain requested type."); } public PropertyException(String msg) { super(msg); } } public Object value() { switch (type) { case 'i': { if (length == 1) return new Integer(_i[0]); else if (length > 1) { int[] v = _i.clone(); return v; } } case 'f': { if (length == 1) return new Float(_f[0]); else if (length > 1) { float[] v = _f.clone(); return v; } } case 'd': { if (length == 1) return new Double(_d[0]); else if (length > 1) { double[] v = _d.clone(); return v; } } case 's': { if (length == 1) return _s[0]; else if (length > 1) { String[] v = _s.clone(); return v; } } case 'S': { if (length == 1) return _s[0]; else if (length > 1) { String[] v = _s.clone(); return v; } } } return null; } public int intValue() { if (type == 'i') return _i[0]; throw new PropertyException(); } public float floatValue() { if (type == 'f') return _f[0]; else if (type == 'i') return _i[0]; throw new PropertyException(); } public double doubleValue() { if (type == 'd') return _d[0]; else if (type == 'f') return _f[0]; else if (type == 'i') return _i[0]; throw new PropertyException(); } public String stringValue() { if (type == 's' || type == 'S') return _s[0]; throw new PropertyException(); } public void setValue(char _type, int i) { switch (_type) { case 'i': _i = new int[1]; _i[0] = i; break; case 'f': _f = new float[1]; _f[0] = i; break; case 'd': _d = new double[1]; _d[0] = i; break; case 's': _s = new String[1]; _s[0] = String.valueOf(i); break; case 'S': _s = new String[1]; _s[0] = String.valueOf(i); break; default: throw new PropertyException("Cannot cast int to requested type."); } type = _type; length = 1; } public void setValue(char _type, float f) { switch (_type) { case 'i': _i = new int[1]; _i[1] = (int)f; break; case 'f': _f = new float[1]; _f[0] = f; break; case 'd': _d = new double[1]; _d[0] = f; break; case 's': _s = new String[1]; _s[0] = String.valueOf(f); break; case 'S': _s = new String[1]; _s[0] = String.valueOf(f); break; default: throw new PropertyException("Cannot cast float to requested type."); } type = _type; length = 1; } public void setValue(char _type, double d) { switch (_type) { case 'i': _i = new int[1]; _i[0] = (int)d; break; case 'f': _f = new float[1]; _f[0] = (float)d; break; case 'd': _d = new double[1]; _d[0] = d; break; case 's': _s = new String[1]; _s[0] = String.valueOf(d); break; case 'S': _s = new String[1]; _s[0] = String.valueOf(d); break; default: throw new PropertyException("Cannot cast double to requested type."); } type = _type; length = 1; } public void setValue(char _type, String s) { switch (_type) { case 'i': _i = new int[1]; _i[0] = Integer.parseInt(s); break; case 'f': _f = new float[1]; _f[0] = Float.parseFloat(s); break; case 'd': _d = new double[1]; _d[0] = Double.parseDouble(s); break; case 's': _s = new String[1]; _s[0] = s; break; case 'S': _s = new String[1]; _s[0] = s; break; default: throw new PropertyException("Cannot cast String to requested type."); } type = _type; length = 1; } public void setValue(char _type, int[] i) { switch (_type) { case 'i': _i = i.clone(); break; case 'f': _f = new float[i.length]; for (int n = 0; n < i.length; n++) _f[n] = i[n]; break; case 'd': _d = new double[i.length]; for (int n = 0; n < i.length; n++) _d[n] = i[n]; break; case 's': _s = new String[i.length]; for (int n = 0; n < i.length; n++) _s[n] = String.valueOf(i[n]); break; case 'S': _s = new String[i.length]; for (int n = 0; n < i.length; n++) _s[n] = String.valueOf(i[n]); break; default: throw new PropertyException("Cannot cast int to requested type."); } type = _type; length = i.length; } public void setValue(char _type, float[] f) { switch (_type) { case 'i': _i = new int[f.length]; for (int n = 0; n < f.length; n++) _i[n] = (int)f[n]; break; case 'f': _f = f.clone(); break; case 'd': _d = new double[f.length]; for (int n = 0; n < f.length; n++) _d[n] = f[n]; break; case 's': _s = new String[f.length]; for (int n = 0; n < f.length; n++) _s[n] = String.valueOf(f[n]); break; case 'S': _s = new String[f.length]; for (int n = 0; n < f.length; n++) _s[n] = String.valueOf(f[n]); break; default: throw new PropertyException("Cannot cast float to requested type."); } type = _type; length = f.length; } public void setValue(char _type, double[] d) { switch (_type) { case 'i': _i = new int[d.length]; for (int n = 0; n < d.length; n++) _i[n] = (int)d[n]; break; case 'f': _f = new float[d.length]; for (int n = 0; n < d.length; n++) _f[n] = (float)d[n]; break; case 'd': _d = d.clone(); break; case 's': _s = new String[d.length]; for (int n = 0; n < d.length; n++) _s[n] = String.valueOf(d[n]); break; case 'S': _s = new String[d.length]; for (int n = 0; n < d.length; n++) _s[n] = String.valueOf(d[n]); break; default: throw new PropertyException("Cannot cast double to requested type."); } type = _type; length = d.length; } public void setValue(char _type, String[] s) { switch (_type) { case 'i': _i = new int[s.length]; for (int n = 0; n < s.length; n++) _i[n] = Integer.parseInt(s[n]); break; case 'f': _f = new float[s.length]; for (int n = 0; n < s.length; n++) _f[n] = Float.parseFloat(s[n]); break; case 'd': _d = new double[s.length]; for (int n = 0; n < s.length; n++) _d[n] = Double.parseDouble(s[n]); break; case 's': _s = s.clone(); case 'S': _s = s.clone(); break; default: throw new PropertyException("Cannot cast String to requested type."); } type = _type; length = s.length; } public String toString() { String s; switch (type) { case 'i': s = Arrays.toString(_i); break; case 'f': s = Arrays.toString(_f); break; case 'd': s = Arrays.toString(_d); break; case 's': s = Arrays.toString(_s); break; case 'S': s = Arrays.toString(_s); break; default: s = null; } return ""; } public char type; public int length; private int[] _i; private float[] _f; private double[] _d; private String[] _s; } libmapper/jni/Mapper/Db/0000755000175000017500000000000012423630127014352 5ustar tiagotiagolibmapper/jni/Mapper/Db/Connection.java0000644000175000017500000000737312423630127017326 0ustar tiagotiago package Mapper.Db; import Mapper.PropertyValue; public class Connection { /*! Describes what happens when the range boundaries are exceeded. */ public static final int BA_NONE = 0; public static final int BA_MUTE = 1; public static final int BA_CLAMP = 2; public static final int BA_FOLD = 3; public static final int BA_WRAP = 4; /*! Describes the connection mode. */ public static final int MO_UNDEFINED = 0; public static final int MO_BYPASS = 1; public static final int MO_LINEAR = 2; public static final int MO_EXPRESSION = 3; public static final int MO_CALIBRATE = 4; public static final int MO_REVERSE = 5; /*! Describes the voice-stealing mode for instances. */ public static final int IN_UNDEFINED = 0; public static final int IN_STEAL_OLDEST = 1; public static final int IN_STEAL_NEWEST = 2; public Connection(long conprops) { _conprops = conprops; srcName = mdb_connection_get_src_name(_conprops); destName = mdb_connection_get_dest_name(_conprops); srcType = mdb_connection_get_src_type(_conprops); destType = mdb_connection_get_dest_type(_conprops); srcLength = mdb_connection_get_src_length(_conprops); destLength = mdb_connection_get_dest_length(_conprops); boundMin = mdb_connection_get_bound_min(_conprops); boundMax = mdb_connection_get_bound_max(_conprops); srcMin = mdb_connection_get_src_min(_conprops); srcMax = mdb_connection_get_src_max(_conprops); destMin = mdb_connection_get_dest_min(_conprops); destMax = mdb_connection_get_dest_max(_conprops); mode = mdb_connection_get_mode(_conprops); expression = mdb_connection_get_expression(_conprops); } public Connection(String _srcName, String _destName) { srcName = _srcName; destName = _destName; srcType = 0; destType = 0; srcLength = -1; destLength = -1; boundMin = -1; boundMax = -1; srcMin = null; srcMax = null; destMin = null; destMax = null; mode = -1; expression = null; } public Connection() { this(null, null); } public String srcName; private native String mdb_connection_get_src_name(long p); public String destName; private native String mdb_connection_get_dest_name(long p); public char srcType; private native char mdb_connection_get_src_type(long p); public char destType; private native char mdb_connection_get_dest_type(long p); public int srcLength; private native int mdb_connection_get_src_length(long p); public int destLength; private native int mdb_connection_get_dest_length(long p); public int boundMin; private native int mdb_connection_get_bound_min(long p); public int boundMax; private native int mdb_connection_get_bound_max(long p); public PropertyValue srcMin; private native PropertyValue mdb_connection_get_src_min(long p); public PropertyValue srcMax; private native PropertyValue mdb_connection_get_src_max(long p); public PropertyValue destMin; private native PropertyValue mdb_connection_get_dest_min(long p); public PropertyValue destMax; private native PropertyValue mdb_connection_get_dest_max(long p); public int mode; private native int mdb_connection_get_mode(long p); public String expression; private native String mdb_connection_get_expression(long p); public PropertyValue property(String property) { return mapper_db_connection_property_lookup(_conprops, property); } private native PropertyValue mapper_db_connection_property_lookup( long p, String property); private long _conprops; } libmapper/jni/Mapper/Db/DeviceListener.java0000644000175000017500000000021612423630127020121 0ustar tiagotiago package Mapper.Db; public class DeviceListener { public void onEvent(Mapper.Db.Device record, int action) {}; } libmapper/jni/Mapper/Db/DeviceCollection.java0000644000175000017500000000054612423630127020435 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class DeviceCollection implements Iterable { public DeviceCollection(long devprops_p) { _devprops_p = devprops_p; } @Override public Iterator iterator() { return new DeviceIterator(_devprops_p); } private long _devprops_p; } libmapper/jni/Mapper/Db/Signal.java0000644000175000017500000000420612423630127016434 0ustar tiagotiago package Mapper.Db; import Mapper.PropertyValue; public class Signal { public Signal(long sigprops) { _sigprops = sigprops; _name = mdb_signal_get_name(_sigprops); _device_name = mdb_signal_get_device_name(_sigprops); _is_output = mdb_signal_get_is_output(_sigprops); _type = mdb_signal_get_type(_sigprops); _length = mdb_signal_get_length(_sigprops); _unit = mdb_signal_get_unit(_sigprops); _minimum = mdb_signal_get_minimum(_sigprops); _maximum = mdb_signal_get_maximum(_sigprops); _rate = mdb_signal_get_rate(_sigprops); } private String _name; public String name() { return _name; } private native String mdb_signal_get_name(long p); private String _device_name; public String deviceName() { return _device_name; } private native String mdb_signal_get_device_name(long p); boolean _is_output; public boolean isOutput() { return _is_output; } private native boolean mdb_signal_get_is_output(long p); char _type; public char type() { return _type; } private native char mdb_signal_get_type(long p); int _length; public int length() { return _length; } private native int mdb_signal_get_length(long p); private String _unit; public String unit() { return _unit; } private native String mdb_signal_get_unit(long p); PropertyValue _minimum; public PropertyValue minimum() { _minimum = mdb_signal_get_minimum(_sigprops); return _minimum; } private native PropertyValue mdb_signal_get_minimum(long p); PropertyValue _maximum; public PropertyValue maximum() { _maximum = mdb_signal_get_maximum(_sigprops); return _maximum; } private native PropertyValue mdb_signal_get_maximum(long p); double _rate; public double rate() { return _rate; } private native double mdb_signal_get_rate(long p); public PropertyValue property(String property) { return mdb_signal_property_lookup(_sigprops, property); } private native PropertyValue mdb_signal_property_lookup( long p, String property); private long _sigprops; } libmapper/jni/Mapper/Db/LinkIterator.java0000644000175000017500000000153412423630127017627 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class LinkIterator implements Iterator { public LinkIterator(long linkprops_p) { _linkprops_p = linkprops_p; } protected void finalize() { mdb_link_done(_linkprops_p); } private native void mdb_link_done(long ptr); @Override public Mapper.Db.Link next() { if (_linkprops_p != 0) { long temp = mdb_deref(_linkprops_p); _linkprops_p = mdb_link_next(_linkprops_p); return new Mapper.Db.Link(temp); } else return null; } private native long mdb_deref(long ptr); private native long mdb_link_next(long ptr); @Override public boolean hasNext() { return _linkprops_p != 0; } @Override public void remove() {} private long _linkprops_p; } libmapper/jni/Mapper/Db/SignalListener.java0000644000175000017500000000021612423630127020137 0ustar tiagotiago package Mapper.Db; public class SignalListener { public void onEvent(Mapper.Db.Signal record, int action) {}; } libmapper/jni/Mapper/Db/SignalCollection.java0000644000175000017500000000054612423630127020453 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class SignalCollection implements Iterable { public SignalCollection(long sigprops_p) { _sigprops_p = sigprops_p; } @Override public Iterator iterator() { return new SignalIterator(_sigprops_p); } private long _sigprops_p; } libmapper/jni/Mapper/Db/LinkListener.java0000644000175000017500000000021212423630127017613 0ustar tiagotiago package Mapper.Db; public class LinkListener { public void onEvent(Mapper.Db.Link record, int action) {}; } libmapper/jni/Mapper/Db/DeviceIterator.java0000644000175000017500000000154412423630127020132 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class DeviceIterator implements Iterator { public DeviceIterator(long devprops_p) { _devprops_p = devprops_p; } protected void finalize() { mdb_device_done(_devprops_p); } private native void mdb_device_done(long ptr); @Override public Mapper.Db.Device next() { if (_devprops_p != 0) { long temp = mdb_deref(_devprops_p); _devprops_p = mdb_device_next(_devprops_p); return new Mapper.Db.Device(temp); } else return null; } private native long mdb_deref(long ptr); private native long mdb_device_next(long ptr); @Override public boolean hasNext() { return _devprops_p != 0; } @Override public void remove() {} private long _devprops_p; } libmapper/jni/Mapper/Db/LinkCollection.java0000644000175000017500000000054112423630127020126 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class LinkCollection implements Iterable { public LinkCollection(long linkprops_p) { _linkprops_p = linkprops_p; } @Override public Iterator iterator() { return new LinkIterator(_linkprops_p); } private long _linkprops_p; } libmapper/jni/Mapper/Db/ConnectionIterator.java0000644000175000017500000000161012423630127021024 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class ConnectionIterator implements Iterator { public ConnectionIterator(long conprops_p) { _conprops_p = conprops_p; } protected void finalize() { mdb_connection_done(_conprops_p); } private native void mdb_connection_done(long ptr); @Override public Mapper.Db.Connection next() { if (_conprops_p != 0) { long temp = mdb_deref(_conprops_p); _conprops_p = mdb_connection_next(_conprops_p); return new Mapper.Db.Connection(temp); } else return null; } private native long mdb_deref(long ptr); private native long mdb_connection_next(long ptr); @Override public boolean hasNext() { return _conprops_p != 0; } @Override public void remove() {} private long _conprops_p; } libmapper/jni/Mapper/Db/SignalIterator.java0000644000175000017500000000154412423630127020150 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class SignalIterator implements Iterator { public SignalIterator(long sigprops_p) { _sigprops_p = sigprops_p; } protected void finalize() { mdb_signal_done(_sigprops_p); } private native void mdb_signal_done(long ptr); @Override public Mapper.Db.Signal next() { if (_sigprops_p != 0) { long temp = mdb_deref(_sigprops_p); _sigprops_p = mdb_signal_next(_sigprops_p); return new Mapper.Db.Signal(temp); } else return null; } private native long mdb_deref(long ptr); private native long mdb_signal_next(long ptr); @Override public boolean hasNext() { return _sigprops_p != 0; } @Override public void remove() {} private long _sigprops_p; } libmapper/jni/Mapper/Db/ConnectionListener.java0000644000175000017500000000022612423630127021022 0ustar tiagotiago package Mapper.Db; public class ConnectionListener { public void onEvent(Mapper.Db.Connection record, int action) {}; } libmapper/jni/Mapper/Db/Device.java0000644000175000017500000000514112423630127016415 0ustar tiagotiago package Mapper.Db; import Mapper.PropertyValue; import Mapper.TimeTag; public class Device { public Device(long devprops) { _devprops = devprops; _name = mdb_device_get_name(_devprops); _ordinal = mdb_device_get_ordinal(_devprops); _host = mdb_device_get_host(_devprops); _port = mdb_device_get_port(_devprops); _n_inputs = mdb_device_get_num_inputs(_devprops); _n_outputs = mdb_device_get_num_outputs(_devprops); _n_links_in = mdb_device_get_num_links_in(_devprops); _n_links_out = mdb_device_get_num_links_out(_devprops); _n_connections_in = mdb_device_get_num_connections_in(_devprops); _n_connections_out = mdb_device_get_num_connections_out(_devprops); _version = mdb_device_get_version(_devprops); } private String _name; public String name() { return _name; } private native String mdb_device_get_name(long p); int _ordinal; public int ordinal() { return _ordinal; } private native int mdb_device_get_ordinal(long p); private String _host; public String host() { return _host; } private native String mdb_device_get_host(long p); int _port; public int port() { return _port; } private native int mdb_device_get_port(long p); int _n_inputs; public int numInputs() { return _n_inputs; } private native int mdb_device_get_num_inputs(long p); int _n_outputs; public int munOutputs() { return _n_outputs; } private native int mdb_device_get_num_outputs(long p); int _n_links_in; public int numLinksIn() { return _n_links_in; } private native int mdb_device_get_num_links_in(long p); int _n_links_out; public int numLinksOut() { return _n_links_out; } private native int mdb_device_get_num_links_out(long p); int _n_connections_in; public int numConnectionsIn() { return _n_connections_in; } private native int mdb_device_get_num_connections_in(long p); int _n_connections_out; public int numConnectionsOut() { return _n_connections_out; } private native int mdb_device_get_num_connections_out(long p); int _version; public int version() { return _version; } private native int mdb_device_get_version(long p); public TimeTag synced() { return mdb_device_get_synced(_devprops); } private native TimeTag mdb_device_get_synced(long p); public PropertyValue property(String property) { return mdb_device_property_lookup(_devprops, property); } private native PropertyValue mdb_device_property_lookup( long p, String property); private long _devprops; } libmapper/jni/Mapper/Db/Link.java0000644000175000017500000000376112423630127016121 0ustar tiagotiago package Mapper.Db; import Mapper.PropertyValue; public class Link { public Link(long linkprops) { _linkprops = linkprops; _src_name = mdb_link_get_src_name(_linkprops); _dest_name = mdb_link_get_dest_name(_linkprops); _src_host = mdb_link_get_src_host(_linkprops); _src_port = mdb_link_get_src_port(_linkprops); _dest_host = mdb_link_get_dest_host(_linkprops); _dest_port = mdb_link_get_dest_port(_linkprops); _num_scopes = mdb_link_get_num_scopes(_linkprops); _scope_names = mdb_link_get_scope_names(_linkprops); } private String _src_name; public String srcName() { return _src_name; } private native String mdb_link_get_src_name(long p); private String _dest_name; public String destName() { return _dest_name; } private native String mdb_link_get_dest_name(long p); private String _src_host; public String srcHost() { return _src_host; } private native String mdb_link_get_src_host(long p); int _src_port; public int srcPort() { return _src_port; } private native int mdb_link_get_src_port(long p); private String _dest_host; public String destHost() { return _dest_host; } private native String mdb_link_get_dest_host(long p); int _dest_port; public int destPort() { return _dest_port; } private native int mdb_link_get_dest_port(long p); int _num_scopes; public int numScopes() { return _num_scopes; } private native int mdb_link_get_num_scopes(long p); PropertyValue _scope_names; public PropertyValue scopeNames() { _scope_names = mdb_link_get_scope_names(_linkprops); return _scope_names; } private native PropertyValue mdb_link_get_scope_names(long p); public PropertyValue property(String property) { return mapper_db_link_property_lookup(_linkprops, property); } private native PropertyValue mapper_db_link_property_lookup( long p, String property); private long _linkprops; } libmapper/jni/Mapper/Db/ConnectionCollection.java0000644000175000017500000000057212423630127021334 0ustar tiagotiago package Mapper.Db; import java.util.Iterator; public class ConnectionCollection implements Iterable { public ConnectionCollection(long conprops_p) { _conprops_p = conprops_p; } @Override public Iterator iterator() { return new ConnectionIterator(_conprops_p); } private long _conprops_p; } libmapper/jni/Mapper/NativeLib.java.in0000644000175000017500000000016012423630127017147 0ustar tiagotiago package Mapper; public class NativeLib { public static final String name = "mapperjni-@MAJOR_VERSION@"; } libmapper/jni/Mapper/InputListener.java0000644000175000017500000000103712423630127017476 0ustar tiagotiago package Mapper; public class InputListener { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) {}; public void onInput(Mapper.Device.Signal sig, int instanceId, int[] v, TimeTag tt) {}; public void onInput(Mapper.Device.Signal sig, int instanceId, double[] v, TimeTag tt) {}; } libmapper/jni/Mapper/Monitor.java0000644000175000017500000003001712423630127016320 0ustar tiagotiago package Mapper; import Mapper.NativeLib; import Mapper.PropertyValue; import Mapper.TimeTag; import Mapper.Db.*; public class Monitor { /*! Bit flags for coordinating monitor metadata subscriptions. */ public static final int SUB_NONE = 0x00; public static final int SUB_DEVICE = 0x01; public static final int SUB_DEVICE_INPUTS = 0x03; public static final int SUB_DEVICE_OUTPUTS = 0x05; public static final int SUB_DEVICE_SIGNALS = 0x07; public static final int SUB_DEVICE_LINKS = 0x09; public static final int SUB_DEVICE_CONNECTIONS_IN = 0x21; public static final int SUB_DEVICE_CONNECTIONS_OUT = 0x41; public static final int SUB_DEVICE_CONNECTIONS = 0x61; public static final int SUB_DEVICE_ALL = 0xFF; public Monitor(int autosubscribeFlags) { _monitor = mmon_new(autosubscribeFlags); Db = this.new Db(mmon_get_db(_monitor)); } public Monitor() { _monitor = mmon_new(0); Db = this.new Db(mmon_get_db(_monitor)); } public void free() { if (_monitor!=0) mmon_free(_monitor); _monitor = 0; } public int poll(int timeout) { return mmon_poll(_monitor, timeout); } public class Db { /*! The set of possible actions on a db entity. */ public static final int MODIFIED = 0; public static final int NEW = 1; public static final int REMOVED = 2; private Db(long d) { _db = d; _device_cb = null; _signal_cb = null; _link_cb = null; _connection_cb = null; } private void checkMonitor() { if (_monitor._monitor == 0) throw new NullPointerException( "Db object associated with invalid Monitor"); } public boolean valid() { return _monitor._monitor != 0; } // Callbacks public void addDeviceCallback(Mapper.Db.DeviceListener handler) { if (handler != _device_cb) mdb_remove_device_callback(_db, _device_cb); mdb_add_device_callback(_db, handler); _device_cb = handler; } private native void mdb_add_device_callback(long db, Mapper.Db.DeviceListener handler); public void removeDeviceCallback(Mapper.Db.DeviceListener handler) { mdb_remove_device_callback(_db, handler); } private native void mdb_remove_device_callback(long db, Mapper.Db.DeviceListener handler); public void addSignalCallback(Mapper.Db.SignalListener handler) { if (handler != _signal_cb) mdb_remove_signal_callback(_db, _signal_cb); mdb_add_signal_callback(_db, handler); _signal_cb = handler; } private native void mdb_add_signal_callback(long db, Mapper.Db.SignalListener handler); public void removeSignalCallback(Mapper.Db.SignalListener handler) { mdb_remove_signal_callback(_db, handler); } private native void mdb_remove_signal_callback(long db, Mapper.Db.SignalListener handler); public void addLinkCallback(Mapper.Db.LinkListener handler) { if (handler != _link_cb) mdb_remove_link_callback(_db, _link_cb); mdb_add_link_callback(_db, handler); _link_cb = handler; } private native void mdb_add_link_callback(long _p, Mapper.Db.LinkListener handler); public void removeLinkCallback(Mapper.Db.LinkListener handler) { mdb_remove_link_callback(_db, handler); } private native void mdb_remove_link_callback(long db, Mapper.Db.LinkListener handler); public void addConnectionCallback(Mapper.Db.ConnectionListener handler) { if (handler != _connection_cb) mdb_remove_connection_callback(_db, _connection_cb); mdb_add_connection_callback(_db, handler); _connection_cb = handler; } private native void mdb_add_connection_callback(long db, Mapper.Db.ConnectionListener handler); public void removeConnectionCallback(Mapper.Db.ConnectionListener handler) { mdb_remove_connection_callback(_db, handler); } private native void mdb_remove_connection_callback(long db, Mapper.Db.ConnectionListener handler); // Db.Device public native Mapper.Db.DeviceCollection devices(); public native Mapper.Db.Device get_device(String deviceName); public native Mapper.Db.DeviceCollection match_devices(String pattern); // Db.Input public native Mapper.Db.Signal getInput(String deviceName, String signalName); private native long mdb_inputs(long db, String deviceName); public Mapper.Db.SignalCollection inputs() { long _s = mdb_inputs(_db, null); return (_s == 0) ? null : new Mapper.Db.SignalCollection(_s); } public Mapper.Db.SignalCollection inputs(String deviceName) { long _s = mdb_inputs(_db, deviceName); return (_s == 0) ? null : new Mapper.Db.SignalCollection(_s); } public native Mapper.Db.SignalCollection matchInputs(String deviceName, String signalPattern); // Db.Output public native Mapper.Db.Signal getOutput(String deviceName, String signalName); private native long mdb_outputs(long db, String deviceName); public Mapper.Db.SignalCollection outputs() { long _s = mdb_outputs(_db, null); return (_s == 0) ? null : new Mapper.Db.SignalCollection(_s); } public Mapper.Db.SignalCollection outputs(String deviceName) { long _s = mdb_outputs(_db, deviceName); return (_s == 0) ? null : new Mapper.Db.SignalCollection(_s); } public native Mapper.Db.SignalCollection matchOutputs(String deviceName, String signalPattern); // Db.Link public native Mapper.Db.Link getLink(String srcName, String destName); private native Mapper.Db.LinkCollection mdb_links(long db, String deviceName); public Mapper.Db.LinkCollection links(String deviceName) { return mdb_links(_db, deviceName); } public Mapper.Db.LinkCollection links() { return mdb_links(_db, null); } public native Mapper.Db.LinkCollection links(Mapper.Db.DeviceCollection src, Mapper.Db.DeviceCollection dest); public native Mapper.Db.LinkCollection linksBySrc(String deviceName); public native Mapper.Db.LinkCollection linksByDest(String deviceName); // Db.Connection private native Mapper.Db.ConnectionCollection mdb_connections( long db, String deviceName); public Mapper.Db.ConnectionCollection connections(String deviceName) { return mdb_connections(_db, deviceName); } public Mapper.Db.ConnectionCollection connections() { return mdb_connections(_db, null); } public native Mapper.Db.ConnectionCollection connections( Mapper.Db.SignalCollection src, Mapper.Db.SignalCollection dest); private native Mapper.Db.ConnectionCollection mdb_connections_by_src( long db, String deviceName, String signalName); public Mapper.Db.ConnectionCollection connectionsBySrc(String signalName) { return mdb_connections_by_src(_db, null, signalName); } public Mapper.Db.ConnectionCollection connectionsBySrc(String deviceName, String signalName) { return mdb_connections_by_src(_db, deviceName, signalName); } private native Mapper.Db.ConnectionCollection mdb_connections_by_dest( long db, String deviceName, String signalName); public Mapper.Db.ConnectionCollection connectionsByDest(String signalName) { return mdb_connections_by_dest(_db, null, signalName); } public Mapper.Db.ConnectionCollection connectionsByDest(String deviceName, String signalName) { return mdb_connections_by_dest(_db, deviceName, signalName); } public native Mapper.Db.Connection connectionBySignals(String srcName, String destName); public native Mapper.Db.ConnectionCollection connectionsByDevices( String srcDevice, String destDevice); private long _db; private Monitor _monitor; // TODO: enable multiple listeners private Mapper.Db.DeviceListener _device_cb; private Mapper.Db.SignalListener _signal_cb; private Mapper.Db.LinkListener _link_cb; private Mapper.Db.ConnectionListener _connection_cb; }; public void subscribe(String deviceName, int subscribeFlags, int timeout) { mmon_subscribe(_monitor, deviceName, subscribeFlags, timeout); } public void unsubscribe(String deviceName) { mmon_unsubscribe(_monitor, deviceName); } public void link(String sourceDevice, String destDevice, Mapper.Db.Link props) { mmon_link(_monitor, sourceDevice, destDevice, props); } public void unlink(String sourceDevice, String destDevice) { mmon_unlink(_monitor, sourceDevice, destDevice); } public void connect(String sourceSignal, String destSignal, Mapper.Db.Connection props) { mmon_connect_or_mod(_monitor, sourceSignal, destSignal, props, 0); } public void disconnect(String sourceSignal, String destSignal) { mmon_disconnect(_monitor, sourceSignal, destSignal); } public void modifyConnection(String sourceSignal, String destSignal, Mapper.Db.Connection props) { mmon_connect_or_mod(_monitor, sourceSignal, destSignal, props, 1); } public void autosubscribe(int autosubscribeFlags) { mmon_autosubscribe(_monitor, autosubscribeFlags); } public TimeTag now() { return mmon_now(_monitor); } // Note: this is _not_ guaranteed to run, the user should still // call free() explicitly when the monitor is no longer needed. protected void finalize() throws Throwable { try { free(); } finally { super.finalize(); } } private native long mmon_new(int autosubscribe_flags); private native long mmon_get_db(long db); private native void mmon_free(long db); private native int mmon_poll(long db, int timeout); private native void mmon_subscribe(long db, String device_name, int subscribe_flags, int timeout); private native void mmon_unsubscribe(long db, String device_name); private native void mmon_link(long db, String source_device, String dest_device, Mapper.Db.Link props); private native void mmon_unlink(long db, String source_device, String dest_device); private native void mmon_connect_or_mod(long db, String source_signal, String dest_signal, Mapper.Db.Connection props, int modify); private native void mmon_disconnect(long db, String source_signal, String dest_signal); private native void mmon_autosubscribe(long db, int autosubscribe_flags); private native TimeTag mmon_now(long db); private long _monitor; public Mapper.Monitor.Db Db; public boolean valid() { return _monitor != 0; } static { System.loadLibrary(NativeLib.name); } } libmapper/jni/Mapper/LinkListener.java0000644000175000017500000000064312423630127017276 0ustar tiagotiago package Mapper; public class LinkListener { /*! The set of possible actions on a local device link or connection. */ public static final int MDEV_LOCAL_ESTABLISHED = 0; public static final int MDEV_LOCAL_MODIFIED = 1; public static final int MDEV_LOCAL_DESTROYED = 2; public void onLink(Mapper.Device dev, Mapper.Db.Link link, int action) {}; } libmapper/jni/Mapper/InstanceEventListener.java0000644000175000017500000000120012423630127021135 0ustar tiagotiago package Mapper; public class InstanceEventListener { /*! The set of possible actions on an instance, used to * register callbacks to inform them of what is happening. */ public static final int IN_NEW = 0x01; public static final int IN_UPSTREAM_RELEASE = 0x02; public static final int IN_DOWNSTREAM_RELEASE = 0x04; public static final int IN_OVERFLOW = 0x08; public static final int IN_ALL = 0xFF; public void onEvent(Mapper.Device.Signal sig, int instanceId, int event, TimeTag tt) {}; } libmapper/jni/Mapper/TimeTag.java0000644000175000017500000000115712423630127016226 0ustar tiagotiago package Mapper; public class TimeTag { public long sec; public long frac; public static final TimeTag NOW = new TimeTag(0, 1); private static double multiplier = (double)1.0/((double)((long)1<<32)); public TimeTag(long _sec, long _frac) { sec = _sec; frac = _frac; } public TimeTag(Double secondsSinceEpoch) { sec = (long)Math.floor(secondsSinceEpoch); secondsSinceEpoch -= sec; frac = (long)(secondsSinceEpoch*(double)((long)1<<32)); } public double getDouble() { return (double)sec + (double)frac * multiplier; } } libmapper/jni/Mapper/Device.java0000644000175000017500000003471412423630127016100 0ustar tiagotiago package Mapper; import Mapper.NativeLib; import Mapper.PropertyValue; import Mapper.Db.*; public class Device { /*! The set of possible actions on a local device link or * connection. */ public static final int MDEV_LOCAL_ESTABLISHED = 0; public static final int MDEV_LOCAL_MODIFIED = 1; public static final int MDEV_LOCAL_DESTROYED = 2; public Device(String name) { _device = mdev_new(name, 0); } public Device(String name, int port) { _device = mdev_new(name, port); } public void free() { if (_device!=0) mdev_free(_device); _device = 0; } public int poll(int timeout) { return mdev_poll(_device, timeout); } public int poll() { return mdev_poll(_device, 0); } public class Signal { /*! Describes the voice-stealing mode for instances. * Arguments to set_instance_allocation_mode(). */ public static final int IN_UNDEFINED = 0; public static final int IN_STEAL_OLDEST = 1; public static final int IN_STEAL_NEWEST = 2; private Signal(long s, Device d) { _signal = s; _device = d; } public String name() { checkDevice(); return msig_name(_signal); } public String fullName() { checkDevice(); return msig_full_name(_signal); } public boolean isOutput() { checkDevice(); return msig_is_output(_signal); } public void setMinimum(PropertyValue p) { checkDevice(); msig_set_property(_signal, new String("min"), p); } public void setMaximum(PropertyValue p) { checkDevice(); msig_set_property(_signal, new String("max"), p); } public void setRate(double rate) { checkDevice(); msig_set_rate(_signal, rate); } public void setProperty(String property, PropertyValue p) { checkDevice(); msig_set_property(_signal, property, p); } public void removeProperty(String property) { checkDevice(); msig_remove_property(_signal, property); } private native String msig_full_name(long sig); private native String msig_name(long sig); private native boolean msig_is_output(long sig); private native void msig_set_rate(long sig, double rate); public native Mapper.Db.Signal properties(); private native void msig_set_property(long sig, String property, PropertyValue p); private native void msig_remove_property(long sig, String property); public native void setInstanceEventCallback( InstanceEventListener handler, int flags); public native void setCallback(InputListener handler); public native void setInstanceCallback(int instanceId, InputListener cb); public native InputListener getInstanceCallback(int instanceId); public native int reserveInstances(int[] ids, int num, InputListener cb); public int reserveInstances(int num) { return reserveInstances(null, num, null); } public int reserveInstances(int[] ids) { return reserveInstances(ids, 0, null); } public int reserveInstances(int num, InputListener cb) { return reserveInstances(null, num, cb); } public int reserveInstances(int[] ids, InputListener cb) { return reserveInstances(ids, 0, cb); } public native void releaseInstance(int instanceId, TimeTag tt); public void releaseInstance(int instanceId) { releaseInstance(instanceId, null); } public native void removeInstance(int num); public native Integer oldestActiveInstance(); public native Integer newestActiveInstance(); public native void matchInstances(Signal from, Signal to, int instanceId); public native int numActiveInstances(); public native int numReservedInstances(); public native int activeInstanceId(int index); public native void setInstanceAllocationMode(int mode); public native int instanceAllocationMode(); public native int numConnections(); public native void updateInstance(int instanceId, int value, TimeTag tt); public native void updateInstance(int instanceId, float value, TimeTag tt); public native void updateInstance(int instanceId, double value, TimeTag tt); public native void updateInstance(int instanceId, int[] value, TimeTag tt); public native void updateInstance(int instanceId, float[] value, TimeTag tt); public native void updateInstance(int instanceId, double[] value, TimeTag tt); public void updateInstance(int instanceId, int value) { updateInstance(instanceId, value, null); } public void updateInstance(int instanceId, float value) { updateInstance(instanceId, value, null); } public void updateInstance(int instanceId, double value) { updateInstance(instanceId, value, null); } public void updateInstance(int instanceId, int[] value) { updateInstance(instanceId, value, null); } public void updateInstance(int instanceId, float[] value) { updateInstance(instanceId, value, null); } public void updateInstance(int instanceId, double[] value) { updateInstance(instanceId, value, null); } public void update(int value) { updateInstance(0, value, null); } public void update(float value) { updateInstance(0, value, null); } public void update(double value) { updateInstance(0, value, null); } public void update(int[] value) { updateInstance(0, value, null); } public void update(float[] value) { updateInstance(0, value, null); } public void update(double[] value) { updateInstance(0, value, null); } public void update(int value, TimeTag tt) { updateInstance(0, value, tt); } public void update(float value, TimeTag tt) { updateInstance(0, value, tt); } public void update(double value, TimeTag tt) { updateInstance(0, value, tt); } public void update(int[] value, TimeTag tt) { updateInstance(0, value, tt); } public void update(float[] value, TimeTag tt) { updateInstance(0, value, tt); } public void update(double[] value, TimeTag tt) { updateInstance(0, value, tt); } public native boolean instanceValue(int instanceId, int[] value, TimeTag tt); public native boolean instanceValue(int instanceId, float[] value, TimeTag tt); public native boolean instanceValue(int instanceId, double[] value, TimeTag tt); public boolean instanceValue(int instanceId, int[] value) { return instanceValue(instanceId, value, null); } public boolean instanceValue(int instanceId, float[] value) { return instanceValue(instanceId, value, null); } public boolean instanceValue(int instanceId, double[] value) { return instanceValue(instanceId, value, null); } public boolean value(int[] value, TimeTag tt) { return instanceValue(0, value, tt); } public boolean value(float[] value, TimeTag tt) { return instanceValue(0, value, tt); } public boolean value(double[] value, TimeTag tt) { return instanceValue(0, value, tt); } public boolean value(int[] value) { return instanceValue(0, value, null); } public boolean value(float[] value) { return instanceValue(0, value, null); } public boolean value(double[] value) { return instanceValue(0, value, null); } public native int queryRemotes(TimeTag tt); public int queryRemotes() { return queryRemotes(null); }; public int index() { checkDevice(); if (_index==null) { _index = new Integer(-1); long msig = 0; if (isOutput()) msig = mdev_get_output_by_name(_device._device, msig_name(_signal), _index); else msig = mdev_get_input_by_name(_device._device, msig_name(_signal), _index); if (msig==0) _index = null; } return _index; } private void checkDevice() { if (_device._device == 0) throw new NullPointerException( "Signal object associated with invalid Device"); } public boolean valid() { return _device._device != 0; } private long _signal; private Device _device; private Integer _index; }; public void removeInput(Signal sig) { mdev_remove_input(_device, sig._signal); } public void removeOutput(Signal sig) { mdev_remove_output(_device, sig._signal); } public int numInputs() { return mdev_num_inputs(_device); } public int numOutputs() { return mdev_num_outputs(_device); } public int numLinksIn() { return mdev_num_links_in(_device); } public int numLinksOut() { return mdev_num_links_out(_device); } public int numConnectionsIn() { return mdev_num_connections_in(_device); } public int numConnectionsOut() { return mdev_num_connections_out(_device); } public Signal getInput(String name) { long msig = mdev_get_input_by_name(_device, name, null); return msig==0 ? null : new Signal(msig, this); } public Signal getOutput(String name) { long msig = mdev_get_output_by_name(_device, name, null); return msig==0 ? null : new Signal(msig, this); } public Signal getInput(int index) { long msig = mdev_get_input_by_index(_device, index); return msig==0 ? null : new Signal(msig, this); } public Signal getOutput(int index) { long msig = mdev_get_output_by_index(_device, index); return msig==0 ? null : new Signal(msig, this); } public void setProperty(String property, PropertyValue p) { mdev_set_property(_device, property, p); } public void removeProperty(String property) { mdev_remove_property(_device, property); } public boolean ready() { return mdev_ready(_device); } public String name() { return mdev_name(_device); } public int port() { return mdev_port(_device); } public String ip4() { return mdev_ip4(_device); } public String iface() { return mdev_interface(_device); } public int ordinal() { return mdev_ordinal(_device); } public int id() { return mdev_id(_device); } public void startQueue(TimeTag tt) { mdev_start_queue(_device, tt); } public void sendQueue(TimeTag tt) { mdev_send_queue(_device, tt); } public TimeTag now() { return mdev_now(_device); } // Note: this is _not_ guaranteed to run, the user should still // call free() explicitly when the device is no longer needed. protected void finalize() throws Throwable { try { free(); } finally { super.finalize(); } } private native long mdev_new(String name, int port); private native void mdev_free(long _d); private native int mdev_poll(long _d, int timeout); private native void mdev_remove_input(long _d, long _sig); private native void mdev_remove_output(long _d, long _sig); private native int mdev_num_inputs(long _d); private native int mdev_num_outputs(long _d); private native int mdev_num_links_in(long _d); private native int mdev_num_links_out(long _d); private native int mdev_num_connections_in(long _d); private native int mdev_num_connections_out(long _d); private native long mdev_get_input_by_name(long _d, String name, Integer index); private native long mdev_get_output_by_name(long _d, String name, Integer index); private native long mdev_get_input_by_index(long _d, int index); private native long mdev_get_output_by_index(long _d, int index); public native Mapper.Db.Device properties(); private native void mdev_set_property(long _d, String property, PropertyValue p); private native void mdev_remove_property(long _d, String property); private native boolean mdev_ready(long _d); private native String mdev_name(long _d); private native int mdev_port(long _d); private native String mdev_ip4(long _d); private native String mdev_interface(long _d); private native int mdev_ordinal(long _d); private native int mdev_id(long _d); private native void mdev_start_queue(long _d, TimeTag tt); private native void mdev_send_queue(long _d, TimeTag tt); private native TimeTag mdev_now(long _d); public native Signal addInput(String name, int length, char type, String unit, PropertyValue minimum, PropertyValue maximum, InputListener handler); public native Signal addOutput(String name, int length, char type, String unit, PropertyValue minimum, PropertyValue maximum); private long _device; public boolean valid() { return _device != 0; } static { System.loadLibrary(NativeLib.name); } } libmapper/jni/testquery.java0000644000175000017500000000500012423630127015504 0ustar tiagotiago import Mapper.*; import Mapper.Device.*; import java.util.Arrays; class testquery { public static void main(String [] args) { final Device dev = new Device("javatestquery"); final Monitor mon = new Monitor(); // This is how to ensure the device is freed when the program // exits, even on SIGINT. The Device must be declared "final". Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { dev.free(); mon.free(); } }); Mapper.Device.Signal inp1 = dev.addInput("insig1", 1, 'f', "Hz", null, null, new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, float[] v, TimeTag tt) { System.out.println("in onInput(): "+Arrays.toString(v)); }}); Signal out1 = dev.addOutput("outsig1", 1, 'i', "Hz", null, null); out1.setCallback( new InputListener() { public void onInput(Mapper.Device.Signal sig, int instanceId, int[] v, TimeTag tt) { System.out.println(" >> in onQueryResponse(): "+Arrays.toString(v)); }}); System.out.println("Waiting for ready..."); while (!dev.ready()) { dev.poll(100); } System.out.println("Device is ready."); System.out.println("Device name: "+dev.name()); System.out.println("Device port: "+dev.port()); System.out.println("Device ordinal: "+dev.ordinal()); System.out.println("Device interface: "+dev.iface()); System.out.println("Device ip4: "+dev.ip4()); mon.link(dev.name(), dev.name(), null); while (dev.numLinksIn() <= 0) { dev.poll(100); } mon.connect(dev.name()+out1.name(), dev.name()+inp1.name(), null); while ((dev.numConnectionsIn()) <= 0) { dev.poll(100); } int i = 100; while (i >= 0) { inp1.update(new float[] {i}); System.out.println("\nUpdating input value to [" + i + "]"); System.out.println(" Querying..."); out1.queryRemotes(); dev.poll(100); --i; } dev.free(); } } libmapper/compile0000755000175000017500000001624512423630127013407 0ustar tiagotiago#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 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_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 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: libmapper/README.markdown0000644000175000017500000002561012423630127014526 0ustar tiagotiago libmapper ========= This library is a system for representing input and output signals on a network and allowing arbitrary "mappings" to be dynamically created between them. A "mapping", or "connection" associated with relational properties, consists of an [Open Sound Control](http://opensoundcontrol.org/) stream being established between a source and a destination signal – the source is translated to the destination's expected format, with some mathematical expression used to condition the transmitted values as desired. This can be used for example to connect a set of sensors to a synthesizer's input parameters. To get started quickly with libmapper, be sure to read the tutorials, found in the "doc" folder in this distribution. History of the mapper project ----------------------------- This project began life as a tool for helping composers and performers to more easily play with custom-built musical instruments, such that a program that reads data from the instrument (e.g. from an [Arduino](http://www.arduino.cc/) embedded microcontroller) can be connected to the inputs of a sound synthesizer. The first version of this software was written entirely in Cycling 74's [Max/MSP](http://www.cycling74.com/), but in order to make it more universally useful and cross-platform, we decided to re-implement the protocol in C; hence, libmapper. We were already using [Open Sound Control](http://opensoundcontrol.org/) for this purpose, but needed a way to dynamically change the mappings – not only to modify the destinations of OSC messages, but also to change scaling, or to introduce derivatives, integration, frequency filtering, smoothing, etc. Eventually this grew into the use of a multicast bus to publish signal metadata and to administrate peer-to-peer connections between machines on a local subnet, with the ability to specify arbitrary mathematical expressions that can be used to perform signal conditioning. It has been designed with the idea of decentralization in mind. We specifically wanted to avoid keeping a "master" node which is responsible for arbitrating connections or republishing data, and we also wanted to avoid needing to keep a central database of serial numbers or other unique identifiers for devices produced in the lab. Instead, common communication is performed on a multicast UDP port, which all nodes listen on, and this is used to implement a collision-handling protocol that can assign a unique ID to each device that appears. Actual signal data is sent directly from a sender device to the receiver's IP and UDP port. Advantages of libmapper ----------------------- This library is, on one level, our response to the widely acknowledged lack of a "query" protocol for Open Sound Control. We are aware for example of [current work on using the ZeroConf protocol for publishing OSC services](http://sourceforge.net/projects/osctools/), and various efforts to standardize a certain set of OSC address conventions. However, libmapper covers considerably more ground than simply the ability to publish namespaces, and handles a direct need that we experience in our daily work. We evaluated the use of ZeroConf early on in this work, but we eventually decided that sending OSC messages over multicast was just as easy and required the integration of fewer dependencies. With the addition of being able to control message routing and to dynamically specify signal conditioning equations, we feel this work represents a significant enough effort that it is worth making available to the general public. It can also be seen as an open source alternative to some commercial products such as Camille Troillard's [Osculator](http://www.osculator.net/) and STEIM's [Junxion](http://www.steim.org/steim/junxion_v4.html), albeit certainly more "barebones" for the moment. In addition to passing signal data through mapping connections, libmapper provides the ability to query or stream the state of the inputs on a destination device. This permits the use of intermediate devices that use supervised machine learning techniques to "learn" mappings automatically. A major difference in libmapper's approach to handling devices is the idea that each "driver" can be a separate process, on the same or different machines in the network. By creating a C library with a basic interface and by providing SWIG and Java bindings, we hope to enable a very wide variety of programming language bindings.^[At this time, the SWIG bindings only work for Python.] Another advantage of a C library is portability: we have demonstrated libmapper working on a Gumstix device, an ethernet-enabled ARM-based microcomputer running Linux that can be easily embedded directly into an instrument. We also provide "external" Max/MSP and [PureData](http://puredata.info) objects, to help integrate libmapper support into programs created in these popular dataflow languages. Known limitations ----------------- The "devices and signals" metaphor encapsulated by libmapper is of course not the be-all and end-all of mapping. We assume homogeneous vectors of floating-point or integer numbers, while in reality more complex structured data might be useful to transmit. Particularly if libmapper is to be used for visual art, transmission of matrixes or even image formats might be interesting, although there is no standard way to represent this in Open Sound Control other than as a binary "blob". It's possible that in this case a protocol such as HTTP that supports MIME type headers is simply a more appropriate choice. That aside, mapping techniques based on table-lookup or other data-oriented processes don't fit directly into the "connection" paradigm used here. Of course, many of these techniques can easily be implemented as "intermediate" devices that sit between a sender and receiver. Another category of mappings that can currently only be solved this way include many-to-one mappings – libmapper currently has no special handling of multiple devices sending to one receiver, and the values are simply interleaved, whereas what is intended is probably some combining function such as addition, multiplication, or thresholding. We are working towards solving this latter issue by using receiver-side routers which can handle expressions containing multiple input variables (See future plans below). Many-to-one mapping functionality was not an immediate priority, since we feel that in practise it is actually quite rare to have a case where such a combining function should be arbitrarily modifiable by a user. In the real world, dependencies between signals often have a semantic significance which would be better handled internally to the sender or the receiver rather than in the mapper layer. One impact of peer-to-peer messaging is that it may suffer from redundancy. In general it may be more efficient to send all data once to a central node, and then out once more to nodes that request it, at the expense of weighing down the bandwidth of that particular central node. In libmapper's case, if 50 nodes subscribe to a particular signal, it will be repeated that many times by the originating node. Dealing with centralized-vs-decentralized efficiency issues by automatically optimizing decisions on how messages are distributed and where routing takes place is not impossible, but represents non-trivial work--for example, in libmapper the concept of a "router" is actually an independent node that a device sends messages to, which then translates and rebroadcasts; it just happens that the router is embedded in the sender because that was the most efficient place to have it in our scenario. Optimizing of message-passing efficiency/network topology is not a near-term goal, but in the meantime it is entirely possible to use libmapper to explicitly create a centralized network if desired; this will simply imply more overhead in managing connections. Future plans ------------ We chose to use Open Sound Control for this because of its compatibility with a wide variety of audio and media software. It is a practical way to transmit arbitrary data in a well-defined binary format. In practice, since the actual connections are peer-to-peer, they could technically be implemented using a variety of protocols. High-frequency data for example might be better transmitted using the [JACK Audio Connection Kit](http://jackaudio.org) or something similar. In addition, on embedded devices, it might make sense to "transmit" data between sensors and synthesizers through shared memory, while still allowing the use of the libmapper admin protocol and GUIs to dynamically experiment with mapping. In the syntax for mathematical expressions, we include a method for indexing previous values to allow basic filter construction. This is done by index, but we also implemented a syntax for accessing previous state according to time in seconds. This feature is not yet useable, but in the future interpolation will be performed to allow referencing of time-accurate values. The explicit use of timing information may also be useful for certain mapping scenarios, such as "debouncing" signal updates or adding adaptive delays. We are gradually working towards such functionality, developing a syntax for referring to timing data when configuring connection properties and implementing a lighweight synchronization scheme between linked devices that will permit jitter mitigation and correct handling of delays when devices are running on separate computers. As mentioned above, the ability to design many-to-one mapping connections will also be explored in future development of libmapper. Getting libmapper ----------------- The latest version of libmapper source code and binaries can be downloaded from the libmapper website at: or from the libmapper page on the IDMIL website, Building and using libmapper ---------------------------- Please see the separate documentation for building libmapper, tutorials on using its API in C, C++, Python, Java, MaxMSP and Pure Data, and doxygen-generated API documentation, in the "doc" directory. License ------- This software was written in the Input Devices and Music Interaction Laboratory at McGill University in Montreal, and is copyright those found in the AUTHORS file. It is licensed under the GNU Lesser Public General License version 2.1 or later. Please see COPYING for details. In accordance with the LGPL, you are allowed to use it in commercial products provided it remains dynamically linked, such that libmapper always remains free to modify. If you'd like to use it in an outstanding context, please contact the AUTHORS to seek an agreement. Dependencies of libmapper are: * [liblo](http://liblo.sourceforge.net), LGPL Optional dependencies for the Python bindings: * [SWIG](http://www.swig.org), GPL3, LGPL-compatible for generated code * [Python](http://www.python.org), Python license, LGPL-compatible Used only in the examples: * [RtAudio](http://www.music.mcgill.ca/~gary/rtaudio), MIT license, LGPL-compatible libmapper/examples/0000755000175000017500000000000012423630127013637 5ustar tiagotiagolibmapper/examples/pwm_example.cpp0000644000175000017500000000344412423630127016666 0ustar tiagotiago #include #include #include #include #include "pwm_synth/pwm.h" int done = 0; void ctrlc(int) { done = 1; } void handler_freq(mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { float *pfreq = (float*)value; set_freq(*pfreq); } } void handler_gain(mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { float *pgain = (float*)value; set_gain(*pgain); } else set_gain(0); } void handler_duty(mapper_signal msig, mapper_db_signal props, int instance_id, void *value, int count, mapper_timetag_t *timetag) { if (value) { float *pduty = (float*)value; set_duty(*pduty); } } int main() { signal(SIGINT, ctrlc); mapper_device dev = mdev_new("pwm", 9000, 0); float min0 = 0; float max1 = 1; float max1000 = 1000; mdev_add_input(dev, "/freq", 1, 'f', "Hz", &min0, &max1000, handler_freq, 0); mdev_add_input(dev, "/gain", 1, 'f', "Hz", &min0, &max1, handler_gain, 0); mdev_add_input(dev, "/duty", 1, 'f', "Hz", &min0, &max1, handler_duty, 0); run_synth(); set_duty(0.1); set_freq(110.0); set_gain(0.1); printf("Press Ctrl-C to quit.\n"); while (!done) mdev_poll(dev, 10); mdev_free(dev); set_freq(0); sleep(1); stop_synth(); } libmapper/examples/Makefile.in0000644000175000017500000006541012423630127015712 0ustar tiagotiago# 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@ @HAVE_AUDIO_TRUE@@HAVE_SWIG_TRUE@am__append_1 = py_tk_gui @HAVE_AUDIO_TRUE@bin_PROGRAMS = pwm_example$(EXEEXT) subdir = examples DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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)" PROGRAMS = $(bin_PROGRAMS) am__pwm_example_SOURCES_DIST = pwm_example.cpp @HAVE_AUDIO_TRUE@am_pwm_example_OBJECTS = \ @HAVE_AUDIO_TRUE@ pwm_example-pwm_example.$(OBJEXT) pwm_example_OBJECTS = $(am_pwm_example_OBJECTS) am__DEPENDENCIES_1 = @HAVE_AUDIO_TRUE@pwm_example_DEPENDENCIES = pwm_synth/libpwm.la \ @HAVE_AUDIO_TRUE@ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la \ @HAVE_AUDIO_TRUE@ $(am__DEPENDENCIES_1) 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 = pwm_example_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(pwm_example_CXXFLAGS) \ $(CXXFLAGS) $(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 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 = SOURCES = $(pwm_example_SOURCES) DIST_SOURCES = $(am__pwm_example_SOURCES_DIST) 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) # 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 = pwm_synth py_tk_gui 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@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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 = pwm_synth $(am__append_1) @HAVE_AUDIO_TRUE@pwm_example_CXXFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) @HAVE_AUDIO_TRUE@pwm_example_SOURCES = pwm_example.cpp @HAVE_AUDIO_TRUE@pwm_example_LDADD = pwm_synth/libpwm.la \ @HAVE_AUDIO_TRUE@ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la \ @HAVE_AUDIO_TRUE@ @RTAUDIO_LIBS@ $(liblo_LIBS) all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || 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 pwm_example$(EXEEXT): $(pwm_example_OBJECTS) $(pwm_example_DEPENDENCIES) $(EXTRA_pwm_example_DEPENDENCIES) @rm -f pwm_example$(EXEEXT) $(AM_V_CXXLD)$(pwm_example_LINK) $(pwm_example_OBJECTS) $(pwm_example_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwm_example-pwm_example.Po@am__quote@ .cpp.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 $@ $< .cpp.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) '$<'` .cpp.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 $@ $< pwm_example-pwm_example.o: pwm_example.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pwm_example_CXXFLAGS) $(CXXFLAGS) -MT pwm_example-pwm_example.o -MD -MP -MF $(DEPDIR)/pwm_example-pwm_example.Tpo -c -o pwm_example-pwm_example.o `test -f 'pwm_example.cpp' || echo '$(srcdir)/'`pwm_example.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwm_example-pwm_example.Tpo $(DEPDIR)/pwm_example-pwm_example.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pwm_example.cpp' object='pwm_example-pwm_example.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(pwm_example_CXXFLAGS) $(CXXFLAGS) -c -o pwm_example-pwm_example.o `test -f 'pwm_example.cpp' || echo '$(srcdir)/'`pwm_example.cpp pwm_example-pwm_example.obj: pwm_example.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pwm_example_CXXFLAGS) $(CXXFLAGS) -MT pwm_example-pwm_example.obj -MD -MP -MF $(DEPDIR)/pwm_example-pwm_example.Tpo -c -o pwm_example-pwm_example.obj `if test -f 'pwm_example.cpp'; then $(CYGPATH_W) 'pwm_example.cpp'; else $(CYGPATH_W) '$(srcdir)/pwm_example.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pwm_example-pwm_example.Tpo $(DEPDIR)/pwm_example-pwm_example.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pwm_example.cpp' object='pwm_example-pwm_example.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(pwm_example_CXXFLAGS) $(CXXFLAGS) -c -o pwm_example-pwm_example.obj `if test -f 'pwm_example.cpp'; then $(CYGPATH_W) 'pwm_example.cpp'; else $(CYGPATH_W) '$(srcdir)/pwm_example.cpp'; fi` 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 $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ 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-binPROGRAMS 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) 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-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS # 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: libmapper/examples/pyo_example.py0000644000175000017500000000134412423630127016535 0ustar tiagotiago#!/usr/bin/env python from pyo import * import mapper import math s = Server().boot() s.start() duty = SigTo(value=0.5, time=0.5, init=0.5, add=-0.5) freq = SigTo(value=200, time=0.5, init=200) amp = SigTo(value=0.5, time=0.5, init=0.0) p = Phasor(freq=freq, add=Clip(duty, min=-0.5, max=0.5)) sig = DCBlock(Sig(value=Round(p), mul=[amp, amp])).out() try: dev = mapper.device("pyo_pwm_example", 9000) dev.add_input("/frequency", 1, 'f', "Hz", 0, 1000, lambda s,i,n,t: freq.setValue(n)) dev.add_input("/amplitude", 1, 'f', "normalized", 0, 1, lambda s,i,n,t: amp.setValue(n)) dev.add_input("/duty", 1, 'f', "normalized", 0, 1, lambda s,i,n,t: duty.setValue(n)) while True: dev.poll(5) finally: s.stop()libmapper/examples/pwm_synth/0000755000175000017500000000000012423630127015667 5ustar tiagotiagolibmapper/examples/pwm_synth/RtAudio-readme.txt0000644000175000017500000000671412423630127021242 0ustar tiagotiagoRtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems. By Gary P. Scavone, 2001-2013. This distribution of RtAudio contains the following: doc: RtAudio documentation (see doc/html/index.html) tests: example RtAudio programs include: header and source files necessary for ASIO, DS & OSS compilation tests/Windows: Visual C++ .net test program workspace and projects OVERVIEW: RtAudio is a set of C++ classes that provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X, SGI, and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives: - object-oriented C++ design - simple, common API across all supported platforms - only one source and two header files for easy inclusion in programming projects - allow simultaneous multi-api support - support dynamic connection of devices - provide extensive audio device parameter control - allow audio device capability probing - automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the \ref apinotes section for information specific to each of the supported audio APIs. FURTHER READING: For complete documentation on RtAudio, see the doc directory of the distribution or surf to http://www.music.mcgill.ca/~gary/rtaudio/. LEGAL AND ETHICAL: The RtAudio license is similar to the MIT License. RtAudio: a set of realtime audio i/o C++ classes Copyright (c) 2001-2013 Gary P. Scavone 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. Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. libmapper/examples/pwm_synth/pwm.cpp0000644000175000017500000001054012423630127017176 0ustar tiagotiago// crtsine.cpp STK tutorial program #include "RtAudio.h" #include #include #include #include struct _synth { int count; // number of samples since period int state; // state of the duty cycle (0,1) float value; // current value (0..1) float target; // target value (0..1) float rate; // how fast to converge on target (0..1)) float duty; // duty cycle per period (0..1) float t_duty; // target duty cycle per period (0..1) float freq; // frequency in Hz float t_freq; // target frequency in Hz float srate; // sample rate in Hz float gain; // volume control (0..1) float t_gain; // target gain (0..1) } synth; // This tick() function handles sample computation only. It will be // called automatically when the system needs a new buffer of audio // samples. int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *dataPointer ) { float *samples = (float *) outputBuffer; for ( unsigned int i=0; i limit_count) { synth.count = 0; synth.target = 1.0 - synth.target; synth.state = 1 - synth.state; } // this creates a bit of a strange waveform but it is // something like a pulse-- we're trying to round the corners // a bit if (fabs(synth.value-synth.target) > 0.5) synth.value = (synth.target*synth.rate + synth.value*(1.0-synth.rate)); else synth.value = (synth.target*(1.0-synth.rate) + synth.value*(synth.rate)); *samples++ = (synth.value - 0.5) * synth.gain; synth.count += 1; } return 0; } RtAudio *dac=0; int run_synth() { if (dac) return 0; dac = new RtAudio(); synth.count = 0; synth.state = 0; synth.value = 0; synth.target = 0; synth.rate = 0.2; synth.duty = 0.1; synth.t_duty = 0.1; synth.freq = 0.0; synth.t_freq = 110; synth.srate = 0; synth.gain = 0; // REMEMBER TO SET THE GAIN AFTER STARTING SYNTH synth.t_gain = 0; // Figure out how many bytes in an float and setup the RtAudio stream. RtAudio::StreamParameters parameters; parameters.deviceId = dac->getDefaultOutputDevice(); parameters.nChannels = 1; RtAudio::StreamOptions options; options.flags = RTAUDIO_MINIMIZE_LATENCY; options.numberOfBuffers = 4; options.streamName = "pwm"; options.priority = RTAUDIO_SCHEDULE_REALTIME; RtAudioFormat format = RTAUDIO_FLOAT32; unsigned int bufferFrames = 2048; try { dac->openStream( ¶meters, NULL, format, 48000, &bufferFrames, &tick, &options ); synth.srate = 48000.0; } catch ( RtError &error ) { try { dac->openStream( ¶meters, NULL, format, 44100, &bufferFrames, &tick, &options ); synth.srate = 44100.0; } catch ( RtError &error ) { error.printMessage(); goto cleanup; } } try { dac->startStream(); } catch ( RtError &error ) { error.printMessage(); goto cleanup; } return 1; cleanup: delete dac; dac = 0; return 0; } void stop_synth() { if (!dac) return; // Shut down the output stream. try { dac->closeStream(); } catch ( RtError &error ) { error.printMessage(); } delete dac; dac = 0; } void set_rate(float rate) { if (rate >= 0 && rate <= 1.0) synth.rate = rate; } void set_duty(float duty) { if (duty >= 0 && duty <= 1.0) synth.t_duty = duty; } void set_freq(float freq) { if (freq >= 0 && freq <= 20000.0) synth.t_freq = freq; } void set_gain(float gain) { if (gain >= 0 && gain <= 1.0) synth.t_gain = gain; } libmapper/examples/pwm_synth/RtAudio.cpp0000644000175000017500000112510012423630127017742 0ustar tiagotiago/************************************************************************/ /*! \class RtAudio \brief Realtime audio i/o C++ classes. RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems. RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/ RtAudio: realtime audio i/o C++ classes Copyright (c) 2001-2013 Gary P. Scavone 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. Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /************************************************************************/ // RtAudio: Version 4.0.12 #include "RtAudio.h" #include #include #include #include // Static variable definitions. const unsigned int RtApi::MAX_SAMPLE_RATES = 14; const unsigned int RtApi::SAMPLE_RATES[] = { 4000, 5512, 8000, 9600, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000 }; #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) #define MUTEX_INITIALIZE(A) InitializeCriticalSection(A) #define MUTEX_DESTROY(A) DeleteCriticalSection(A) #define MUTEX_LOCK(A) EnterCriticalSection(A) #define MUTEX_UNLOCK(A) LeaveCriticalSection(A) #elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) // pthread API #define MUTEX_INITIALIZE(A) pthread_mutex_init(A, NULL) #define MUTEX_DESTROY(A) pthread_mutex_destroy(A) #define MUTEX_LOCK(A) pthread_mutex_lock(A) #define MUTEX_UNLOCK(A) pthread_mutex_unlock(A) #else #define MUTEX_INITIALIZE(A) abs(*A) // dummy definitions #define MUTEX_DESTROY(A) abs(*A) // dummy definitions #endif // *************************************************** // // // RtAudio definitions. // // *************************************************** // void RtAudio :: getCompiledApi( std::vector &apis ) throw() { apis.clear(); // The order here will control the order of RtAudio's API search in // the constructor. #if defined(__UNIX_JACK__) apis.push_back( UNIX_JACK ); #endif #if defined(__LINUX_ALSA__) apis.push_back( LINUX_ALSA ); #endif #if defined(__LINUX_PULSE__) apis.push_back( LINUX_PULSE ); #endif #if defined(__LINUX_OSS__) apis.push_back( LINUX_OSS ); #endif #if defined(__WINDOWS_ASIO__) apis.push_back( WINDOWS_ASIO ); #endif #if defined(__WINDOWS_DS__) apis.push_back( WINDOWS_DS ); #endif #if defined(__MACOSX_CORE__) apis.push_back( MACOSX_CORE ); #endif #if defined(__RTAUDIO_DUMMY__) apis.push_back( RTAUDIO_DUMMY ); #endif } void RtAudio :: openRtApi( RtAudio::Api api ) { if ( rtapi_ ) delete rtapi_; rtapi_ = 0; #if defined(__UNIX_JACK__) if ( api == UNIX_JACK ) rtapi_ = new RtApiJack(); #endif #if defined(__LINUX_ALSA__) if ( api == LINUX_ALSA ) rtapi_ = new RtApiAlsa(); #endif #if defined(__LINUX_PULSE__) if ( api == LINUX_PULSE ) rtapi_ = new RtApiPulse(); #endif #if defined(__LINUX_OSS__) if ( api == LINUX_OSS ) rtapi_ = new RtApiOss(); #endif #if defined(__WINDOWS_ASIO__) if ( api == WINDOWS_ASIO ) rtapi_ = new RtApiAsio(); #endif #if defined(__WINDOWS_DS__) if ( api == WINDOWS_DS ) rtapi_ = new RtApiDs(); #endif #if defined(__MACOSX_CORE__) if ( api == MACOSX_CORE ) rtapi_ = new RtApiCore(); #endif #if defined(__RTAUDIO_DUMMY__) if ( api == RTAUDIO_DUMMY ) rtapi_ = new RtApiDummy(); #endif } RtAudio :: RtAudio( RtAudio::Api api ) throw() { rtapi_ = 0; if ( api != UNSPECIFIED ) { // Attempt to open the specified API. openRtApi( api ); if ( rtapi_ ) return; // No compiled support for specified API value. Issue a debug // warning and continue as if no API was specified. std::cerr << "\nRtAudio: no compiled support for specified API argument!\n" << std::endl; } // Iterate through the compiled APIs and return as soon as we find // one with at least one device or we reach the end of the list. std::vector< RtAudio::Api > apis; getCompiledApi( apis ); for ( unsigned int i=0; igetDeviceCount() ) break; } if ( rtapi_ ) return; // It should not be possible to get here because the preprocessor // definition __RTAUDIO_DUMMY__ is automatically defined if no // API-specific definitions are passed to the compiler. But just in // case something weird happens, we'll print out an error message. std::cerr << "\nRtAudio: no compiled API support found ... critical error!!\n\n"; } RtAudio :: ~RtAudio() throw() { delete rtapi_; } void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData, RtAudio::StreamOptions *options, RtAudioErrorCallback errorCallback ) { return rtapi_->openStream( outputParameters, inputParameters, format, sampleRate, bufferFrames, callback, userData, options, errorCallback ); } // *************************************************** // // // Public RtApi definitions (see end of file for // private or protected utility functions). // // *************************************************** // RtApi :: RtApi() { stream_.state = STREAM_CLOSED; stream_.mode = UNINITIALIZED; stream_.apiHandle = 0; stream_.userBuffer[0] = 0; stream_.userBuffer[1] = 0; MUTEX_INITIALIZE( &stream_.mutex ); showWarnings_ = true; } RtApi :: ~RtApi() { MUTEX_DESTROY( &stream_.mutex ); } void RtApi :: openStream( RtAudio::StreamParameters *oParams, RtAudio::StreamParameters *iParams, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData, RtAudio::StreamOptions *options, RtAudioErrorCallback errorCallback ) { if ( stream_.state != STREAM_CLOSED ) { errorText_ = "RtApi::openStream: a stream is already open!"; error( RtError::INVALID_USE ); return; } if ( oParams && oParams->nChannels < 1 ) { errorText_ = "RtApi::openStream: a non-NULL output StreamParameters structure cannot have an nChannels value less than one."; error( RtError::INVALID_USE ); return; } if ( iParams && iParams->nChannels < 1 ) { errorText_ = "RtApi::openStream: a non-NULL input StreamParameters structure cannot have an nChannels value less than one."; error( RtError::INVALID_USE ); return; } if ( oParams == NULL && iParams == NULL ) { errorText_ = "RtApi::openStream: input and output StreamParameters structures are both NULL!"; error( RtError::INVALID_USE ); return; } if ( formatBytes(format) == 0 ) { errorText_ = "RtApi::openStream: 'format' parameter value is undefined."; error( RtError::INVALID_USE ); return; } unsigned int nDevices = getDeviceCount(); unsigned int oChannels = 0; if ( oParams ) { oChannels = oParams->nChannels; if ( oParams->deviceId >= nDevices ) { errorText_ = "RtApi::openStream: output device parameter value is invalid."; error( RtError::INVALID_USE ); return; } } unsigned int iChannels = 0; if ( iParams ) { iChannels = iParams->nChannels; if ( iParams->deviceId >= nDevices ) { errorText_ = "RtApi::openStream: input device parameter value is invalid."; error( RtError::INVALID_USE ); return; } } clearStreamInfo(); bool result; if ( oChannels > 0 ) { result = probeDeviceOpen( oParams->deviceId, OUTPUT, oChannels, oParams->firstChannel, sampleRate, format, bufferFrames, options ); if ( result == false ) { error( RtError::SYSTEM_ERROR ); return; } } if ( iChannels > 0 ) { result = probeDeviceOpen( iParams->deviceId, INPUT, iChannels, iParams->firstChannel, sampleRate, format, bufferFrames, options ); if ( result == false ) { if ( oChannels > 0 ) closeStream(); error( RtError::SYSTEM_ERROR ); return; } } stream_.callbackInfo.callback = (void *) callback; stream_.callbackInfo.userData = userData; stream_.callbackInfo.errorCallback = (void *) errorCallback; if ( options ) options->numberOfBuffers = stream_.nBuffers; stream_.state = STREAM_STOPPED; } unsigned int RtApi :: getDefaultInputDevice( void ) { // Should be implemented in subclasses if possible. return 0; } unsigned int RtApi :: getDefaultOutputDevice( void ) { // Should be implemented in subclasses if possible. return 0; } void RtApi :: closeStream( void ) { // MUST be implemented in subclasses! return; } bool RtApi :: probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/, unsigned int /*firstChannel*/, unsigned int /*sampleRate*/, RtAudioFormat /*format*/, unsigned int * /*bufferSize*/, RtAudio::StreamOptions * /*options*/ ) { // MUST be implemented in subclasses! return FAILURE; } void RtApi :: tickStreamTime( void ) { // Subclasses that do not provide their own implementation of // getStreamTime should call this function once per buffer I/O to // provide basic stream time support. stream_.streamTime += ( stream_.bufferSize * 1.0 / stream_.sampleRate ); #if defined( HAVE_GETTIMEOFDAY ) gettimeofday( &stream_.lastTickTimestamp, NULL ); #endif } long RtApi :: getStreamLatency( void ) { verifyStream(); long totalLatency = 0; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) totalLatency = stream_.latency[0]; if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) totalLatency += stream_.latency[1]; return totalLatency; } double RtApi :: getStreamTime( void ) { verifyStream(); #if defined( HAVE_GETTIMEOFDAY ) // Return a very accurate estimate of the stream time by // adding in the elapsed time since the last tick. struct timeval then; struct timeval now; if ( stream_.state != STREAM_RUNNING || stream_.streamTime == 0.0 ) return stream_.streamTime; gettimeofday( &now, NULL ); then = stream_.lastTickTimestamp; return stream_.streamTime + ((now.tv_sec + 0.000001 * now.tv_usec) - (then.tv_sec + 0.000001 * then.tv_usec)); #else return stream_.streamTime; #endif } unsigned int RtApi :: getStreamSampleRate( void ) { verifyStream(); return stream_.sampleRate; } // *************************************************** // // // OS/API-specific methods. // // *************************************************** // #if defined(__MACOSX_CORE__) // The OS X CoreAudio API is designed to use a separate callback // procedure for each of its audio devices. A single RtAudio duplex // stream using two different devices is supported here, though it // cannot be guaranteed to always behave correctly because we cannot // synchronize these two callbacks. // // A property listener is installed for over/underrun information. // However, no functionality is currently provided to allow property // listeners to trigger user handlers because it is unclear what could // be done if a critical stream parameter (buffer size, sample rate, // device disconnect) notification arrived. The listeners entail // quite a bit of extra code and most likely, a user program wouldn't // be prepared for the result anyway. However, we do provide a flag // to the client callback function to inform of an over/underrun. // A structure to hold various information related to the CoreAudio API // implementation. struct CoreHandle { AudioDeviceID id[2]; // device ids #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) AudioDeviceIOProcID procId[2]; #endif UInt32 iStream[2]; // device stream index (or first if using multiple) UInt32 nStreams[2]; // number of streams to use bool xrun[2]; char *deviceBuffer; pthread_cond_t condition; int drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. CoreHandle() :deviceBuffer(0), drainCounter(0), internalDrain(false) { nStreams[0] = 1; nStreams[1] = 1; id[0] = 0; id[1] = 0; xrun[0] = false; xrun[1] = false; } }; RtApiCore:: RtApiCore() { #if defined( AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER ) // This is a largely undocumented but absolutely necessary // requirement starting with OS-X 10.6. If not called, queries and // updates to various audio device properties are not handled // correctly. CFRunLoopRef theRunLoop = NULL; AudioObjectPropertyAddress property = { kAudioHardwarePropertyRunLoop, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectSetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop); if ( result != noErr ) { errorText_ = "RtApiCore::RtApiCore: error setting run loop property!"; error( RtError::WARNING ); } #endif } RtApiCore :: ~RtApiCore() { // The subclass destructor gets called before the base class // destructor, so close an existing stream before deallocating // apiDeviceId memory. if ( stream_.state != STREAM_CLOSED ) closeStream(); } unsigned int RtApiCore :: getDeviceCount( void ) { // Find out how many audio devices there are, if any. UInt32 dataSize; AudioObjectPropertyAddress propertyAddress = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize ); if ( result != noErr ) { errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!"; error( RtError::WARNING ); return 0; } return dataSize / sizeof( AudioDeviceID ); } unsigned int RtApiCore :: getDefaultInputDevice( void ) { unsigned int nDevices = getDeviceCount(); if ( nDevices <= 1 ) return 0; AudioDeviceID id; UInt32 dataSize = sizeof( AudioDeviceID ); AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id ); if ( result != noErr ) { errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device."; error( RtError::WARNING ); return 0; } dataSize *= nDevices; AudioDeviceID deviceList[ nDevices ]; property.mSelector = kAudioHardwarePropertyDevices; result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList ); if ( result != noErr ) { errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device IDs."; error( RtError::WARNING ); return 0; } for ( unsigned int i=0; i= nDevices ) { errorText_ = "RtApiCore::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } AudioDeviceID deviceList[ nDevices ]; UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices; AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList ); if ( result != noErr ) { errorText_ = "RtApiCore::getDeviceInfo: OS-X system error getting device IDs."; error( RtError::WARNING ); return info; } AudioDeviceID id = deviceList[ device ]; // Get the device name. info.name.erase(); CFStringRef cfname; dataSize = sizeof( CFStringRef ); property.mSelector = kAudioObjectPropertyManufacturer; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &cfname ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device manufacturer."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } //const char *mname = CFStringGetCStringPtr( cfname, CFStringGetSystemEncoding() ); int length = CFStringGetLength(cfname); char *mname = (char *)malloc(length * 3 + 1); CFStringGetCString(cfname, mname, length * 3 + 1, CFStringGetSystemEncoding()); info.name.append( (const char *)mname, strlen(mname) ); info.name.append( ": " ); CFRelease( cfname ); free(mname); property.mSelector = kAudioObjectPropertyName; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &cfname ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device name."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } //const char *name = CFStringGetCStringPtr( cfname, CFStringGetSystemEncoding() ); length = CFStringGetLength(cfname); char *name = (char *)malloc(length * 3 + 1); CFStringGetCString(cfname, name, length * 3 + 1, CFStringGetSystemEncoding()); info.name.append( (const char *)name, strlen(name) ); CFRelease( cfname ); free(name); // Get the output stream "configuration". AudioBufferList *bufferList = nil; property.mSelector = kAudioDevicePropertyStreamConfiguration; property.mScope = kAudioDevicePropertyScopeOutput; // property.mElement = kAudioObjectPropertyElementWildcard; dataSize = 0; result = AudioObjectGetPropertyDataSize( id, &property, 0, NULL, &dataSize ); if ( result != noErr || dataSize == 0 ) { errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration info for device (" << device << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Allocate the AudioBufferList. bufferList = (AudioBufferList *) malloc( dataSize ); if ( bufferList == NULL ) { errorText_ = "RtApiCore::getDeviceInfo: memory error allocating output AudioBufferList."; error( RtError::WARNING ); return info; } result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, bufferList ); if ( result != noErr || dataSize == 0 ) { free( bufferList ); errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration for device (" << device << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Get output channel information. unsigned int i, nStreams = bufferList->mNumberBuffers; for ( i=0; imBuffers[i].mNumberChannels; free( bufferList ); // Get the input stream "configuration". property.mScope = kAudioDevicePropertyScopeInput; result = AudioObjectGetPropertyDataSize( id, &property, 0, NULL, &dataSize ); if ( result != noErr || dataSize == 0 ) { errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration info for device (" << device << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Allocate the AudioBufferList. bufferList = (AudioBufferList *) malloc( dataSize ); if ( bufferList == NULL ) { errorText_ = "RtApiCore::getDeviceInfo: memory error allocating input AudioBufferList."; error( RtError::WARNING ); return info; } result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, bufferList ); if (result != noErr || dataSize == 0) { free( bufferList ); errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration for device (" << device << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Get input channel information. nStreams = bufferList->mNumberBuffers; for ( i=0; imBuffers[i].mNumberChannels; free( bufferList ); // If device opens for both playback and capture, we determine the channels. if ( info.outputChannels > 0 && info.inputChannels > 0 ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; // Probe the device sample rates. bool isInput = false; if ( info.outputChannels == 0 ) isInput = true; // Determine the supported sample rates. property.mSelector = kAudioDevicePropertyAvailableNominalSampleRates; if ( isInput == false ) property.mScope = kAudioDevicePropertyScopeOutput; result = AudioObjectGetPropertyDataSize( id, &property, 0, NULL, &dataSize ); if ( result != kAudioHardwareNoError || dataSize == 0 ) { errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rate info."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } UInt32 nRanges = dataSize / sizeof( AudioValueRange ); AudioValueRange rangeList[ nRanges ]; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &rangeList ); if ( result != kAudioHardwareNoError ) { errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rates."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } Float64 minimumRate = 100000000.0, maximumRate = 0.0; for ( UInt32 i=0; i maximumRate ) maximumRate = rangeList[i].mMaximum; } info.sampleRates.clear(); for ( unsigned int k=0; k= (unsigned int) minimumRate && SAMPLE_RATES[k] <= (unsigned int) maximumRate ) info.sampleRates.push_back( SAMPLE_RATES[k] ); } if ( info.sampleRates.size() == 0 ) { errorStream_ << "RtApiCore::probeDeviceInfo: No supported sample rates found for device (" << device << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // CoreAudio always uses 32-bit floating point data for PCM streams. // Thus, any other "physical" formats supported by the device are of // no interest to the client. info.nativeFormats = RTAUDIO_FLOAT32; if ( info.outputChannels > 0 ) if ( getDefaultOutputDevice() == device ) info.isDefaultOutput = true; if ( info.inputChannels > 0 ) if ( getDefaultInputDevice() == device ) info.isDefaultInput = true; info.probed = true; return info; } static OSStatus callbackHandler( AudioDeviceID inDevice, const AudioTimeStamp* /*inNow*/, const AudioBufferList* inInputData, const AudioTimeStamp* /*inInputTime*/, AudioBufferList* outOutputData, const AudioTimeStamp* /*inOutputTime*/, void* infoPointer ) { CallbackInfo *info = (CallbackInfo *) infoPointer; RtApiCore *object = (RtApiCore *) info->object; if ( object->callbackEvent( inDevice, inInputData, outOutputData ) == false ) return kAudioHardwareUnspecifiedError; else return kAudioHardwareNoError; } static OSStatus xrunListener( AudioObjectID /*inDevice*/, UInt32 nAddresses, const AudioObjectPropertyAddress properties[], void* handlePointer ) { CoreHandle *handle = (CoreHandle *) handlePointer; for ( UInt32 i=0; ixrun[1] = true; else handle->xrun[0] = true; } } return kAudioHardwareNoError; } static OSStatus rateListener( AudioObjectID inDevice, UInt32 /*nAddresses*/, const AudioObjectPropertyAddress /*properties*/[], void* ratePointer ) { Float64 *rate = (Float64 *) ratePointer; UInt32 dataSize = sizeof( Float64 ); AudioObjectPropertyAddress property = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; AudioObjectGetPropertyData( inDevice, &property, 0, NULL, &dataSize, rate ); return kAudioHardwareNoError; } bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ) { // Get device ID unsigned int nDevices = getDeviceCount(); if ( nDevices == 0 ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiCore::probeDeviceOpen: no devices found!"; return FAILURE; } if ( device >= nDevices ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiCore::probeDeviceOpen: device ID is invalid!"; return FAILURE; } AudioDeviceID deviceList[ nDevices ]; UInt32 dataSize = sizeof( AudioDeviceID ) * nDevices; AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList ); if ( result != noErr ) { errorText_ = "RtApiCore::probeDeviceOpen: OS-X system error getting device IDs."; return FAILURE; } AudioDeviceID id = deviceList[ device ]; // Setup for stream mode. bool isInput = false; if ( mode == INPUT ) { isInput = true; property.mScope = kAudioDevicePropertyScopeInput; } else property.mScope = kAudioDevicePropertyScopeOutput; // Get the stream "configuration". AudioBufferList *bufferList = nil; dataSize = 0; property.mSelector = kAudioDevicePropertyStreamConfiguration; result = AudioObjectGetPropertyDataSize( id, &property, 0, NULL, &dataSize ); if ( result != noErr || dataSize == 0 ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting stream configuration info for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Allocate the AudioBufferList. bufferList = (AudioBufferList *) malloc( dataSize ); if ( bufferList == NULL ) { errorText_ = "RtApiCore::probeDeviceOpen: memory error allocating AudioBufferList."; return FAILURE; } result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, bufferList ); if (result != noErr || dataSize == 0) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting stream configuration for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Search for one or more streams that contain the desired number of // channels. CoreAudio devices can have an arbitrary number of // streams and each stream can have an arbitrary number of channels. // For each stream, a single buffer of interleaved samples is // provided. RtAudio prefers the use of one stream of interleaved // data or multiple consecutive single-channel streams. However, we // now support multiple consecutive multi-channel streams of // interleaved data as well. UInt32 iStream, offsetCounter = firstChannel; UInt32 nStreams = bufferList->mNumberBuffers; bool monoMode = false; bool foundStream = false; // First check that the device supports the requested number of // channels. UInt32 deviceChannels = 0; for ( iStream=0; iStreammBuffers[iStream].mNumberChannels; if ( deviceChannels < ( channels + firstChannel ) ) { free( bufferList ); errorStream_ << "RtApiCore::probeDeviceOpen: the device (" << device << ") does not support the requested channel count."; errorText_ = errorStream_.str(); return FAILURE; } // Look for a single stream meeting our needs. UInt32 firstStream, streamCount = 1, streamChannels = 0, channelOffset = 0; for ( iStream=0; iStreammBuffers[iStream].mNumberChannels; if ( streamChannels >= channels + offsetCounter ) { firstStream = iStream; channelOffset = offsetCounter; foundStream = true; break; } if ( streamChannels > offsetCounter ) break; offsetCounter -= streamChannels; } // If we didn't find a single stream above, then we should be able // to meet the channel specification with multiple streams. if ( foundStream == false ) { monoMode = true; offsetCounter = firstChannel; for ( iStream=0; iStreammBuffers[iStream].mNumberChannels; if ( streamChannels > offsetCounter ) break; offsetCounter -= streamChannels; } firstStream = iStream; channelOffset = offsetCounter; Int32 channelCounter = channels + offsetCounter - streamChannels; if ( streamChannels > 1 ) monoMode = false; while ( channelCounter > 0 ) { streamChannels = bufferList->mBuffers[++iStream].mNumberChannels; if ( streamChannels > 1 ) monoMode = false; channelCounter -= streamChannels; streamCount++; } } free( bufferList ); // Determine the buffer size. AudioValueRange bufferRange; dataSize = sizeof( AudioValueRange ); property.mSelector = kAudioDevicePropertyBufferFrameSizeRange; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &bufferRange ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting buffer size range for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } if ( bufferRange.mMinimum > *bufferSize ) *bufferSize = (unsigned long) bufferRange.mMinimum; else if ( bufferRange.mMaximum < *bufferSize ) *bufferSize = (unsigned long) bufferRange.mMaximum; if ( options && options->flags & RTAUDIO_MINIMIZE_LATENCY ) *bufferSize = (unsigned long) bufferRange.mMinimum; // Set the buffer size. For multiple streams, I'm assuming we only // need to make this setting for the master channel. UInt32 theSize = (UInt32) *bufferSize; dataSize = sizeof( UInt32 ); property.mSelector = kAudioDevicePropertyBufferFrameSize; result = AudioObjectSetPropertyData( id, &property, 0, NULL, dataSize, &theSize ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting the buffer size for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } // If attempting to setup a duplex stream, the bufferSize parameter // MUST be the same in both directions! *bufferSize = theSize; if ( stream_.mode == OUTPUT && mode == INPUT && *bufferSize != stream_.bufferSize ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error setting buffer size for duplex stream on device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.bufferSize = *bufferSize; stream_.nBuffers = 1; // Try to set "hog" mode ... it's not clear to me this is working. if ( options && options->flags & RTAUDIO_HOG_DEVICE ) { pid_t hog_pid; dataSize = sizeof( hog_pid ); property.mSelector = kAudioDevicePropertyHogMode; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &hog_pid ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting 'hog' state!"; errorText_ = errorStream_.str(); return FAILURE; } if ( hog_pid != getpid() ) { hog_pid = getpid(); result = AudioObjectSetPropertyData( id, &property, 0, NULL, dataSize, &hog_pid ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting 'hog' state!"; errorText_ = errorStream_.str(); return FAILURE; } } } // Check and if necessary, change the sample rate for the device. Float64 nominalRate; dataSize = sizeof( Float64 ); property.mSelector = kAudioDevicePropertyNominalSampleRate; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &nominalRate ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting current sample rate."; errorText_ = errorStream_.str(); return FAILURE; } // Only change the sample rate if off by more than 1 Hz. if ( fabs( nominalRate - (double)sampleRate ) > 1.0 ) { // Set a property listener for the sample rate change Float64 reportedRate = 0.0; AudioObjectPropertyAddress tmp = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; result = AudioObjectAddPropertyListener( id, &tmp, rateListener, (void *) &reportedRate ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting sample rate property listener for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } nominalRate = (Float64) sampleRate; result = AudioObjectSetPropertyData( id, &property, 0, NULL, dataSize, &nominalRate ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting sample rate for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Now wait until the reported nominal rate is what we just set. UInt32 microCounter = 0; while ( reportedRate != nominalRate ) { microCounter += 5000; if ( microCounter > 5000000 ) break; usleep( 5000 ); } // Remove the property listener. AudioObjectRemovePropertyListener( id, &tmp, rateListener, (void *) &reportedRate ); if ( microCounter > 5000000 ) { errorStream_ << "RtApiCore::probeDeviceOpen: timeout waiting for sample rate update for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } } // Now set the stream format for all streams. Also, check the // physical format of the device and change that if necessary. AudioStreamBasicDescription description; dataSize = sizeof( AudioStreamBasicDescription ); property.mSelector = kAudioStreamPropertyVirtualFormat; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &description ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting stream format for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Set the sample rate and data format id. However, only make the // change if the sample rate is not within 1.0 of the desired // rate and the format is not linear pcm. bool updateFormat = false; if ( fabs( description.mSampleRate - (Float64)sampleRate ) > 1.0 ) { description.mSampleRate = (Float64) sampleRate; updateFormat = true; } if ( description.mFormatID != kAudioFormatLinearPCM ) { description.mFormatID = kAudioFormatLinearPCM; updateFormat = true; } if ( updateFormat ) { result = AudioObjectSetPropertyData( id, &property, 0, NULL, dataSize, &description ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") setting sample rate or data format for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } } // Now check the physical format. property.mSelector = kAudioStreamPropertyPhysicalFormat; result = AudioObjectGetPropertyData( id, &property, 0, NULL, &dataSize, &description ); if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting stream physical format for device (" << device << ")."; errorText_ = errorStream_.str(); return FAILURE; } //std::cout << "Current physical stream format:" << std::endl; //std::cout << " mBitsPerChan = " << description.mBitsPerChannel << std::endl; //std::cout << " aligned high = " << (description.mFormatFlags & kAudioFormatFlagIsAlignedHigh) << ", isPacked = " << (description.mFormatFlags & kAudioFormatFlagIsPacked) << std::endl; //std::cout << " bytesPerFrame = " << description.mBytesPerFrame << std::endl; //std::cout << " sample rate = " << description.mSampleRate << std::endl; if ( description.mFormatID != kAudioFormatLinearPCM || description.mBitsPerChannel < 16 ) { description.mFormatID = kAudioFormatLinearPCM; //description.mSampleRate = (Float64) sampleRate; AudioStreamBasicDescription testDescription = description; UInt32 formatFlags; // We'll try higher bit rates first and then work our way down. std::vector< std::pair > physicalFormats; formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsFloat) & ~kLinearPCMFormatFlagIsSignedInteger; physicalFormats.push_back( std::pair( 32, formatFlags ) ); formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat; physicalFormats.push_back( std::pair( 32, formatFlags ) ); physicalFormats.push_back( std::pair( 24, formatFlags ) ); // 24-bit packed formatFlags &= ~( kAudioFormatFlagIsPacked | kAudioFormatFlagIsAlignedHigh ); physicalFormats.push_back( std::pair( 24.2, formatFlags ) ); // 24-bit in 4 bytes, aligned low formatFlags |= kAudioFormatFlagIsAlignedHigh; physicalFormats.push_back( std::pair( 24.4, formatFlags ) ); // 24-bit in 4 bytes, aligned high formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat; physicalFormats.push_back( std::pair( 16, formatFlags ) ); physicalFormats.push_back( std::pair( 8, formatFlags ) ); bool setPhysicalFormat = false; for( unsigned int i=0; iflags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; else stream_.userInterleaved = true; stream_.deviceInterleaved[mode] = true; if ( monoMode == true ) stream_.deviceInterleaved[mode] = false; // Set flags for buffer conversion. stream_.doConvertBuffer[mode] = false; if ( stream_.userFormat != stream_.deviceFormat[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.nUserChannels[mode] < stream_.nDeviceChannels[mode] ) stream_.doConvertBuffer[mode] = true; if ( streamCount == 1 ) { if ( stream_.nUserChannels[mode] > 1 && stream_.userInterleaved != stream_.deviceInterleaved[mode] ) stream_.doConvertBuffer[mode] = true; } else if ( monoMode && stream_.userInterleaved ) stream_.doConvertBuffer[mode] = true; // Allocate our CoreHandle structure for the stream. CoreHandle *handle = 0; if ( stream_.apiHandle == 0 ) { try { handle = new CoreHandle; } catch ( std::bad_alloc& ) { errorText_ = "RtApiCore::probeDeviceOpen: error allocating CoreHandle memory."; goto error; } if ( pthread_cond_init( &handle->condition, NULL ) ) { errorText_ = "RtApiCore::probeDeviceOpen: error initializing pthread condition variable."; goto error; } stream_.apiHandle = (void *) handle; } else handle = (CoreHandle *) stream_.apiHandle; handle->iStream[mode] = firstStream; handle->nStreams[mode] = streamCount; handle->id[mode] = id; // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); // stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); stream_.userBuffer[mode] = (char *) malloc( bufferBytes * sizeof(char) ); memset( stream_.userBuffer[mode], 0, bufferBytes * sizeof(char) ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiCore::probeDeviceOpen: error allocating user buffer memory."; goto error; } // If possible, we will make use of the CoreAudio stream buffers as // "device buffers". However, we can't do this if using multiple // streams. if ( stream_.doConvertBuffer[mode] && handle->nStreams[mode] > 1 ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiCore::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } stream_.sampleRate = sampleRate; stream_.device[mode] = device; stream_.state = STREAM_STOPPED; stream_.callbackInfo.object = (void *) this; // Setup the buffer conversion information structure. if ( stream_.doConvertBuffer[mode] ) { if ( streamCount > 1 ) setConvertInfo( mode, 0 ); else setConvertInfo( mode, channelOffset ); } if ( mode == INPUT && stream_.mode == OUTPUT && stream_.device[0] == device ) // Only one callback procedure per device. stream_.mode = DUPLEX; else { #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) result = AudioDeviceCreateIOProcID( id, callbackHandler, (void *) &stream_.callbackInfo, &handle->procId[mode] ); #else // deprecated in favor of AudioDeviceCreateIOProcID() result = AudioDeviceAddIOProc( id, callbackHandler, (void *) &stream_.callbackInfo ); #endif if ( result != noErr ) { errorStream_ << "RtApiCore::probeDeviceOpen: system error setting callback for device (" << device << ")."; errorText_ = errorStream_.str(); goto error; } if ( stream_.mode == OUTPUT && mode == INPUT ) stream_.mode = DUPLEX; else stream_.mode = mode; } // Setup the device property listener for over/underload. property.mSelector = kAudioDeviceProcessorOverload; result = AudioObjectAddPropertyListener( id, &property, xrunListener, (void *) handle ); return SUCCESS; error: if ( handle ) { pthread_cond_destroy( &handle->condition ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.state = STREAM_CLOSED; return FAILURE; } void RtApiCore :: closeStream( void ) { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiCore::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } CoreHandle *handle = (CoreHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( stream_.state == STREAM_RUNNING ) AudioDeviceStop( handle->id[0], callbackHandler ); #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) AudioDeviceDestroyIOProcID( handle->id[0], handle->procId[0] ); #else // deprecated in favor of AudioDeviceDestroyIOProcID() AudioDeviceRemoveIOProc( handle->id[0], callbackHandler ); #endif } if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && stream_.device[0] != stream_.device[1] ) ) { if ( stream_.state == STREAM_RUNNING ) AudioDeviceStop( handle->id[1], callbackHandler ); #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) AudioDeviceDestroyIOProcID( handle->id[1], handle->procId[1] ); #else // deprecated in favor of AudioDeviceDestroyIOProcID() AudioDeviceRemoveIOProc( handle->id[1], callbackHandler ); #endif } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } // Destroy pthread condition variable. pthread_cond_destroy( &handle->condition ); delete handle; stream_.apiHandle = 0; stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } void RtApiCore :: startStream( void ) { verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiCore::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } OSStatus result = noErr; CoreHandle *handle = (CoreHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { result = AudioDeviceStart( handle->id[0], callbackHandler ); if ( result != noErr ) { errorStream_ << "RtApiCore::startStream: system error (" << getErrorCode( result ) << ") starting callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } } if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && stream_.device[0] != stream_.device[1] ) ) { result = AudioDeviceStart( handle->id[1], callbackHandler ); if ( result != noErr ) { errorStream_ << "RtApiCore::startStream: system error starting input callback procedure on device (" << stream_.device[1] << ")."; errorText_ = errorStream_.str(); goto unlock; } } handle->drainCounter = 0; handle->internalDrain = false; stream_.state = STREAM_RUNNING; unlock: if ( result == noErr ) return; error( RtError::SYSTEM_ERROR ); } void RtApiCore :: stopStream( void ) { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiCore::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } OSStatus result = noErr; CoreHandle *handle = (CoreHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( handle->drainCounter == 0 ) { handle->drainCounter = 2; pthread_cond_wait( &handle->condition, &stream_.mutex ); // block until signaled } result = AudioDeviceStop( handle->id[0], callbackHandler ); if ( result != noErr ) { errorStream_ << "RtApiCore::stopStream: system error (" << getErrorCode( result ) << ") stopping callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } } if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && stream_.device[0] != stream_.device[1] ) ) { result = AudioDeviceStop( handle->id[1], callbackHandler ); if ( result != noErr ) { errorStream_ << "RtApiCore::stopStream: system error (" << getErrorCode( result ) << ") stopping input callback procedure on device (" << stream_.device[1] << ")."; errorText_ = errorStream_.str(); goto unlock; } } stream_.state = STREAM_STOPPED; unlock: if ( result == noErr ) return; error( RtError::SYSTEM_ERROR ); } void RtApiCore :: abortStream( void ) { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiCore::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } CoreHandle *handle = (CoreHandle *) stream_.apiHandle; handle->drainCounter = 2; stopStream(); } // This function will be called by a spawned thread when the user // callback function signals that the stream should be stopped or // aborted. It is better to handle it this way because the // callbackEvent() function probably should return before the AudioDeviceStop() // function is called. static void *coreStopStream( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiCore *object = (RtApiCore *) info->object; object->stopStream(); pthread_exit( NULL ); } bool RtApiCore :: callbackEvent( AudioDeviceID deviceId, const AudioBufferList *inBufferList, const AudioBufferList *outBufferList ) { if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS; if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return FAILURE; } CallbackInfo *info = (CallbackInfo *) &stream_.callbackInfo; CoreHandle *handle = (CoreHandle *) stream_.apiHandle; // Check if we were draining the stream and signal is finished. if ( handle->drainCounter > 3 ) { ThreadHandle threadId; stream_.state = STREAM_STOPPING; if ( handle->internalDrain == true ) pthread_create( &threadId, NULL, coreStopStream, info ); else // external call to stopStream() pthread_cond_signal( &handle->condition ); return SUCCESS; } AudioDeviceID outputDevice = handle->id[0]; // Invoke user callback to get fresh output data UNLESS we are // draining stream or duplex mode AND the input/output devices are // different AND this function is called for the input device. if ( handle->drainCounter == 0 && ( stream_.mode != DUPLEX || deviceId == outputDevice ) ) { RtAudioCallback callback = (RtAudioCallback) info->callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && handle->xrun[0] == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; handle->xrun[0] = false; } if ( stream_.mode != OUTPUT && handle->xrun[1] == true ) { status |= RTAUDIO_INPUT_OVERFLOW; handle->xrun[1] = false; } int cbReturnValue = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, info->userData ); if ( cbReturnValue == 2 ) { stream_.state = STREAM_STOPPING; handle->drainCounter = 2; abortStream(); return SUCCESS; } else if ( cbReturnValue == 1 ) { handle->drainCounter = 1; handle->internalDrain = true; } } if ( stream_.mode == OUTPUT || ( stream_.mode == DUPLEX && deviceId == outputDevice ) ) { if ( handle->drainCounter > 1 ) { // write zeros to the output stream if ( handle->nStreams[0] == 1 ) { memset( outBufferList->mBuffers[handle->iStream[0]].mData, 0, outBufferList->mBuffers[handle->iStream[0]].mDataByteSize ); } else { // fill multiple streams with zeros for ( unsigned int i=0; inStreams[0]; i++ ) { memset( outBufferList->mBuffers[handle->iStream[0]+i].mData, 0, outBufferList->mBuffers[handle->iStream[0]+i].mDataByteSize ); } } } else if ( handle->nStreams[0] == 1 ) { if ( stream_.doConvertBuffer[0] ) { // convert directly to CoreAudio stream buffer convertBuffer( (char *) outBufferList->mBuffers[handle->iStream[0]].mData, stream_.userBuffer[0], stream_.convertInfo[0] ); } else { // copy from user buffer memcpy( outBufferList->mBuffers[handle->iStream[0]].mData, stream_.userBuffer[0], outBufferList->mBuffers[handle->iStream[0]].mDataByteSize ); } } else { // fill multiple streams Float32 *inBuffer = (Float32 *) stream_.userBuffer[0]; if ( stream_.doConvertBuffer[0] ) { convertBuffer( stream_.deviceBuffer, stream_.userBuffer[0], stream_.convertInfo[0] ); inBuffer = (Float32 *) stream_.deviceBuffer; } if ( stream_.deviceInterleaved[0] == false ) { // mono mode UInt32 bufferBytes = outBufferList->mBuffers[handle->iStream[0]].mDataByteSize; for ( unsigned int i=0; imBuffers[handle->iStream[0]+i].mData, (void *)&inBuffer[i*stream_.bufferSize], bufferBytes ); } } else { // fill multiple multi-channel streams with interleaved data UInt32 streamChannels, channelsLeft, inJump, outJump, inOffset; Float32 *out, *in; bool inInterleaved = ( stream_.userInterleaved ) ? true : false; UInt32 inChannels = stream_.nUserChannels[0]; if ( stream_.doConvertBuffer[0] ) { inInterleaved = true; // device buffer will always be interleaved for nStreams > 1 and not mono mode inChannels = stream_.nDeviceChannels[0]; } if ( inInterleaved ) inOffset = 1; else inOffset = stream_.bufferSize; channelsLeft = inChannels; for ( unsigned int i=0; inStreams[0]; i++ ) { in = inBuffer; out = (Float32 *) outBufferList->mBuffers[handle->iStream[0]+i].mData; streamChannels = outBufferList->mBuffers[handle->iStream[0]+i].mNumberChannels; outJump = 0; // Account for possible channel offset in first stream if ( i == 0 && stream_.channelOffset[0] > 0 ) { streamChannels -= stream_.channelOffset[0]; outJump = stream_.channelOffset[0]; out += outJump; } // Account for possible unfilled channels at end of the last stream if ( streamChannels > channelsLeft ) { outJump = streamChannels - channelsLeft; streamChannels = channelsLeft; } // Determine input buffer offsets and skips if ( inInterleaved ) { inJump = inChannels; in += inChannels - channelsLeft; } else { inJump = 1; in += (inChannels - channelsLeft) * inOffset; } for ( unsigned int i=0; idrainCounter ) { handle->drainCounter++; goto unlock; } } AudioDeviceID inputDevice; inputDevice = handle->id[1]; if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && deviceId == inputDevice ) ) { if ( handle->nStreams[1] == 1 ) { if ( stream_.doConvertBuffer[1] ) { // convert directly from CoreAudio stream buffer convertBuffer( stream_.userBuffer[1], (char *) inBufferList->mBuffers[handle->iStream[1]].mData, stream_.convertInfo[1] ); } else { // copy to user buffer memcpy( stream_.userBuffer[1], inBufferList->mBuffers[handle->iStream[1]].mData, inBufferList->mBuffers[handle->iStream[1]].mDataByteSize ); } } else { // read from multiple streams Float32 *outBuffer = (Float32 *) stream_.userBuffer[1]; if ( stream_.doConvertBuffer[1] ) outBuffer = (Float32 *) stream_.deviceBuffer; if ( stream_.deviceInterleaved[1] == false ) { // mono mode UInt32 bufferBytes = inBufferList->mBuffers[handle->iStream[1]].mDataByteSize; for ( unsigned int i=0; imBuffers[handle->iStream[1]+i].mData, bufferBytes ); } } else { // read from multiple multi-channel streams UInt32 streamChannels, channelsLeft, inJump, outJump, outOffset; Float32 *out, *in; bool outInterleaved = ( stream_.userInterleaved ) ? true : false; UInt32 outChannels = stream_.nUserChannels[1]; if ( stream_.doConvertBuffer[1] ) { outInterleaved = true; // device buffer will always be interleaved for nStreams > 1 and not mono mode outChannels = stream_.nDeviceChannels[1]; } if ( outInterleaved ) outOffset = 1; else outOffset = stream_.bufferSize; channelsLeft = outChannels; for ( unsigned int i=0; inStreams[1]; i++ ) { out = outBuffer; in = (Float32 *) inBufferList->mBuffers[handle->iStream[1]+i].mData; streamChannels = inBufferList->mBuffers[handle->iStream[1]+i].mNumberChannels; inJump = 0; // Account for possible channel offset in first stream if ( i == 0 && stream_.channelOffset[1] > 0 ) { streamChannels -= stream_.channelOffset[1]; inJump = stream_.channelOffset[1]; in += inJump; } // Account for possible unread channels at end of the last stream if ( streamChannels > channelsLeft ) { inJump = streamChannels - channelsLeft; streamChannels = channelsLeft; } // Determine output buffer offsets and skips if ( outInterleaved ) { outJump = outChannels; out += outChannels - channelsLeft; } else { outJump = 1; out += (outChannels - channelsLeft) * outOffset; } for ( unsigned int i=0; i #include #include // A structure to hold various information related to the Jack API // implementation. struct JackHandle { jack_client_t *client; jack_port_t **ports[2]; std::string deviceName[2]; bool xrun[2]; pthread_cond_t condition; int drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. JackHandle() :client(0), drainCounter(0), internalDrain(false) { ports[0] = 0; ports[1] = 0; xrun[0] = false; xrun[1] = false; } }; static void jackSilentError( const char * ) {}; RtApiJack :: RtApiJack() { // Nothing to do here. #if !defined(__RTAUDIO_DEBUG__) // Turn off Jack's internal error reporting. jack_set_error_function( &jackSilentError ); #endif } RtApiJack :: ~RtApiJack() { if ( stream_.state != STREAM_CLOSED ) closeStream(); } unsigned int RtApiJack :: getDeviceCount( void ) { // See if we can become a jack client. jack_options_t options = (jack_options_t) ( JackNoStartServer ); //JackNullOption; jack_status_t *status = NULL; jack_client_t *client = jack_client_open( "RtApiJackCount", options, status ); if ( client == 0 ) return 0; const char **ports; std::string port, previousPort; unsigned int nChannels = 0, nDevices = 0; ports = jack_get_ports( client, NULL, NULL, 0 ); if ( ports ) { // Parse the port names up to the first colon (:). size_t iColon = 0; do { port = (char *) ports[ nChannels ]; iColon = port.find(":"); if ( iColon != std::string::npos ) { port = port.substr( 0, iColon + 1 ); if ( port != previousPort ) { nDevices++; previousPort = port; } } } while ( ports[++nChannels] ); free( ports ); } jack_client_close( client ); return nDevices; } RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; info.probed = false; jack_options_t options = (jack_options_t) ( JackNoStartServer ); //JackNullOption jack_status_t *status = NULL; jack_client_t *client = jack_client_open( "RtApiJackInfo", options, status ); if ( client == 0 ) { errorText_ = "RtApiJack::getDeviceInfo: Jack server not found or connection error!"; error( RtError::WARNING ); return info; } const char **ports; std::string port, previousPort; unsigned int nPorts = 0, nDevices = 0; ports = jack_get_ports( client, NULL, NULL, 0 ); if ( ports ) { // Parse the port names up to the first colon (:). size_t iColon = 0; do { port = (char *) ports[ nPorts ]; iColon = port.find(":"); if ( iColon != std::string::npos ) { port = port.substr( 0, iColon ); if ( port != previousPort ) { if ( nDevices == device ) info.name = port; nDevices++; previousPort = port; } } } while ( ports[++nPorts] ); free( ports ); } if ( device >= nDevices ) { jack_client_close( client ); errorText_ = "RtApiJack::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } // Get the current jack server sample rate. info.sampleRates.clear(); info.sampleRates.push_back( jack_get_sample_rate( client ) ); // Count the available ports containing the client name as device // channels. Jack "input ports" equal RtAudio output channels. unsigned int nChannels = 0; ports = jack_get_ports( client, info.name.c_str(), NULL, JackPortIsInput ); if ( ports ) { while ( ports[ nChannels ] ) nChannels++; free( ports ); info.outputChannels = nChannels; } // Jack "output ports" equal RtAudio input channels. nChannels = 0; ports = jack_get_ports( client, info.name.c_str(), NULL, JackPortIsOutput ); if ( ports ) { while ( ports[ nChannels ] ) nChannels++; free( ports ); info.inputChannels = nChannels; } if ( info.outputChannels == 0 && info.inputChannels == 0 ) { jack_client_close(client); errorText_ = "RtApiJack::getDeviceInfo: error determining Jack input/output channels!"; error( RtError::WARNING ); return info; } // If device opens for both playback and capture, we determine the channels. if ( info.outputChannels > 0 && info.inputChannels > 0 ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; // Jack always uses 32-bit floats. info.nativeFormats = RTAUDIO_FLOAT32; // Jack doesn't provide default devices so we'll use the first available one. if ( device == 0 && info.outputChannels > 0 ) info.isDefaultOutput = true; if ( device == 0 && info.inputChannels > 0 ) info.isDefaultInput = true; jack_client_close(client); info.probed = true; return info; } static int jackCallbackHandler( jack_nframes_t nframes, void *infoPointer ) { CallbackInfo *info = (CallbackInfo *) infoPointer; RtApiJack *object = (RtApiJack *) info->object; if ( object->callbackEvent( (unsigned long) nframes ) == false ) return 1; return 0; } // This function will be called by a spawned thread when the Jack // server signals that it is shutting down. It is necessary to handle // it this way because the jackShutdown() function must return before // the jack_deactivate() function (in closeStream()) will return. static void *jackCloseStream( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiJack *object = (RtApiJack *) info->object; object->closeStream(); pthread_exit( NULL ); } static void jackShutdown( void *infoPointer ) { CallbackInfo *info = (CallbackInfo *) infoPointer; RtApiJack *object = (RtApiJack *) info->object; // Check current stream state. If stopped, then we'll assume this // was called as a result of a call to RtApiJack::stopStream (the // deactivation of a client handle causes this function to be called). // If not, we'll assume the Jack server is shutting down or some // other problem occurred and we should close the stream. if ( object->isStreamRunning() == false ) return; ThreadHandle threadId; pthread_create( &threadId, NULL, jackCloseStream, info ); std::cerr << "\nRtApiJack: the Jack server is shutting down this client ... stream stopped and closed!!\n" << std::endl; } static int jackXrun( void *infoPointer ) { JackHandle *handle = (JackHandle *) infoPointer; if ( handle->ports[0] ) handle->xrun[0] = true; if ( handle->ports[1] ) handle->xrun[1] = true; return 0; } bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ) { JackHandle *handle = (JackHandle *) stream_.apiHandle; // Look for jack server and try to become a client (only do once per stream). jack_client_t *client = 0; if ( mode == OUTPUT || ( mode == INPUT && stream_.mode != OUTPUT ) ) { jack_options_t jackoptions = (jack_options_t) ( JackNoStartServer ); //JackNullOption; jack_status_t *status = NULL; if ( options && !options->streamName.empty() ) client = jack_client_open( options->streamName.c_str(), jackoptions, status ); else client = jack_client_open( "RtApiJack", jackoptions, status ); if ( client == 0 ) { errorText_ = "RtApiJack::probeDeviceOpen: Jack server not found or connection error!"; error( RtError::WARNING ); return FAILURE; } } else { // The handle must have been created on an earlier pass. client = handle->client; } const char **ports; std::string port, previousPort, deviceName; unsigned int nPorts = 0, nDevices = 0; ports = jack_get_ports( client, NULL, NULL, 0 ); if ( ports ) { // Parse the port names up to the first colon (:). size_t iColon = 0; do { port = (char *) ports[ nPorts ]; iColon = port.find(":"); if ( iColon != std::string::npos ) { port = port.substr( 0, iColon ); if ( port != previousPort ) { if ( nDevices == device ) deviceName = port; nDevices++; previousPort = port; } } } while ( ports[++nPorts] ); free( ports ); } if ( device >= nDevices ) { errorText_ = "RtApiJack::probeDeviceOpen: device ID is invalid!"; return FAILURE; } // Count the available ports containing the client name as device // channels. Jack "input ports" equal RtAudio output channels. unsigned int nChannels = 0; unsigned long flag = JackPortIsInput; if ( mode == INPUT ) flag = JackPortIsOutput; ports = jack_get_ports( client, deviceName.c_str(), NULL, flag ); if ( ports ) { while ( ports[ nChannels ] ) nChannels++; free( ports ); } // Compare the jack ports for specified client to the requested number of channels. if ( nChannels < (channels + firstChannel) ) { errorStream_ << "RtApiJack::probeDeviceOpen: requested number of channels (" << channels << ") + offset (" << firstChannel << ") not found for specified device (" << device << ":" << deviceName << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Check the jack server sample rate. unsigned int jackRate = jack_get_sample_rate( client ); if ( sampleRate != jackRate ) { jack_client_close( client ); errorStream_ << "RtApiJack::probeDeviceOpen: the requested sample rate (" << sampleRate << ") is different than the JACK server rate (" << jackRate << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.sampleRate = jackRate; // Get the latency of the JACK port. ports = jack_get_ports( client, deviceName.c_str(), NULL, flag ); if ( ports[ firstChannel ] ) { // Added by Ge Wang jack_latency_callback_mode_t cbmode = (mode == INPUT ? JackCaptureLatency : JackPlaybackLatency); // the range (usually the min and max are equal) jack_latency_range_t latrange; latrange.min = latrange.max = 0; // get the latency range jack_port_get_latency_range( jack_port_by_name( client, ports[firstChannel] ), cbmode, &latrange ); // be optimistic, use the min! stream_.latency[mode] = latrange.min; //stream_.latency[mode] = jack_port_get_latency( jack_port_by_name( client, ports[ firstChannel ] ) ); } free( ports ); // The jack server always uses 32-bit floating-point data. stream_.deviceFormat[mode] = RTAUDIO_FLOAT32; stream_.userFormat = format; if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; else stream_.userInterleaved = true; // Jack always uses non-interleaved buffers. stream_.deviceInterleaved[mode] = false; // Jack always provides host byte-ordered data. stream_.doByteSwap[mode] = false; // Get the buffer size. The buffer size and number of buffers // (periods) is set when the jack server is started. stream_.bufferSize = (int) jack_get_buffer_size( client ); *bufferSize = stream_.bufferSize; stream_.nDeviceChannels[mode] = channels; stream_.nUserChannels[mode] = channels; // Set flags for buffer conversion. stream_.doConvertBuffer[mode] = false; if ( stream_.userFormat != stream_.deviceFormat[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.userInterleaved != stream_.deviceInterleaved[mode] && stream_.nUserChannels[mode] > 1 ) stream_.doConvertBuffer[mode] = true; // Allocate our JackHandle structure for the stream. if ( handle == 0 ) { try { handle = new JackHandle; } catch ( std::bad_alloc& ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating JackHandle memory."; goto error; } if ( pthread_cond_init(&handle->condition, NULL) ) { errorText_ = "RtApiJack::probeDeviceOpen: error initializing pthread condition variable."; goto error; } stream_.apiHandle = (void *) handle; handle->client = client; } handle->deviceName[mode] = deviceName; // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating user buffer memory."; goto error; } if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; if ( mode == OUTPUT ) bufferBytes = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); else { // mode == INPUT bufferBytes = stream_.nDeviceChannels[1] * formatBytes( stream_.deviceFormat[1] ); if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes(stream_.deviceFormat[0]); if ( bufferBytes < bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } // Allocate memory for the Jack ports (channels) identifiers. handle->ports[mode] = (jack_port_t **) malloc ( sizeof (jack_port_t *) * channels ); if ( handle->ports[mode] == NULL ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating port memory."; goto error; } stream_.device[mode] = device; stream_.channelOffset[mode] = firstChannel; stream_.state = STREAM_STOPPED; stream_.callbackInfo.object = (void *) this; if ( stream_.mode == OUTPUT && mode == INPUT ) // We had already set up the stream for output. stream_.mode = DUPLEX; else { stream_.mode = mode; jack_set_process_callback( handle->client, jackCallbackHandler, (void *) &stream_.callbackInfo ); jack_set_xrun_callback( handle->client, jackXrun, (void *) &handle ); jack_on_shutdown( handle->client, jackShutdown, (void *) &stream_.callbackInfo ); } // Register our ports. char label[64]; if ( mode == OUTPUT ) { for ( unsigned int i=0; iports[0][i] = jack_port_register( handle->client, (const char *)label, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ); } } else { for ( unsigned int i=0; iports[1][i] = jack_port_register( handle->client, (const char *)label, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0 ); } } // Setup the buffer conversion information structure. We don't use // buffers to do channel offsets, so we override that parameter // here. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, 0 ); return SUCCESS; error: if ( handle ) { pthread_cond_destroy( &handle->condition ); jack_client_close( handle->client ); if ( handle->ports[0] ) free( handle->ports[0] ); if ( handle->ports[1] ) free( handle->ports[1] ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } return FAILURE; } void RtApiJack :: closeStream( void ) { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiJack::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } JackHandle *handle = (JackHandle *) stream_.apiHandle; if ( handle ) { if ( stream_.state == STREAM_RUNNING ) jack_deactivate( handle->client ); jack_client_close( handle->client ); } if ( handle ) { if ( handle->ports[0] ) free( handle->ports[0] ); if ( handle->ports[1] ) free( handle->ports[1] ); pthread_cond_destroy( &handle->condition ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } void RtApiJack :: startStream( void ) { verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiJack::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } JackHandle *handle = (JackHandle *) stream_.apiHandle; int result = jack_activate( handle->client ); if ( result ) { errorText_ = "RtApiJack::startStream(): unable to activate JACK client!"; goto unlock; } const char **ports; // Get the list of available ports. if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { result = 1; ports = jack_get_ports( handle->client, handle->deviceName[0].c_str(), NULL, JackPortIsInput); if ( ports == NULL) { errorText_ = "RtApiJack::startStream(): error determining available JACK input ports!"; goto unlock; } // Now make the port connections. Since RtAudio wasn't designed to // allow the user to select particular channels of a device, we'll // just open the first "nChannels" ports with offset. for ( unsigned int i=0; iclient, jack_port_name( handle->ports[0][i] ), ports[ stream_.channelOffset[0] + i ] ); if ( result ) { free( ports ); errorText_ = "RtApiJack::startStream(): error connecting output ports!"; goto unlock; } } free(ports); } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { result = 1; ports = jack_get_ports( handle->client, handle->deviceName[1].c_str(), NULL, JackPortIsOutput ); if ( ports == NULL) { errorText_ = "RtApiJack::startStream(): error determining available JACK output ports!"; goto unlock; } // Now make the port connections. See note above. for ( unsigned int i=0; iclient, ports[ stream_.channelOffset[1] + i ], jack_port_name( handle->ports[1][i] ) ); if ( result ) { free( ports ); errorText_ = "RtApiJack::startStream(): error connecting input ports!"; goto unlock; } } free(ports); } handle->drainCounter = 0; handle->internalDrain = false; stream_.state = STREAM_RUNNING; unlock: if ( result == 0 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiJack :: stopStream( void ) { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiJack::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } JackHandle *handle = (JackHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( handle->drainCounter == 0 ) { handle->drainCounter = 2; pthread_cond_wait( &handle->condition, &stream_.mutex ); // block until signaled } } jack_deactivate( handle->client ); stream_.state = STREAM_STOPPED; } void RtApiJack :: abortStream( void ) { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiJack::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } JackHandle *handle = (JackHandle *) stream_.apiHandle; handle->drainCounter = 2; stopStream(); } // This function will be called by a spawned thread when the user // callback function signals that the stream should be stopped or // aborted. It is necessary to handle it this way because the // callbackEvent() function must return before the jack_deactivate() // function will return. static void *jackStopStream( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiJack *object = (RtApiJack *) info->object; object->stopStream(); pthread_exit( NULL ); } bool RtApiJack :: callbackEvent( unsigned long nframes ) { if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS; if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return FAILURE; } if ( stream_.bufferSize != nframes ) { errorText_ = "RtApiCore::callbackEvent(): the JACK buffer size has changed ... cannot process!"; error( RtError::WARNING ); return FAILURE; } CallbackInfo *info = (CallbackInfo *) &stream_.callbackInfo; JackHandle *handle = (JackHandle *) stream_.apiHandle; // Check if we were draining the stream and signal is finished. if ( handle->drainCounter > 3 ) { ThreadHandle threadId; stream_.state = STREAM_STOPPING; if ( handle->internalDrain == true ) pthread_create( &threadId, NULL, jackStopStream, info ); else pthread_cond_signal( &handle->condition ); return SUCCESS; } // Invoke user callback first, to get fresh output data. if ( handle->drainCounter == 0 ) { RtAudioCallback callback = (RtAudioCallback) info->callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && handle->xrun[0] == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; handle->xrun[0] = false; } if ( stream_.mode != OUTPUT && handle->xrun[1] == true ) { status |= RTAUDIO_INPUT_OVERFLOW; handle->xrun[1] = false; } int cbReturnValue = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, info->userData ); if ( cbReturnValue == 2 ) { stream_.state = STREAM_STOPPING; handle->drainCounter = 2; ThreadHandle id; pthread_create( &id, NULL, jackStopStream, info ); return SUCCESS; } else if ( cbReturnValue == 1 ) { handle->drainCounter = 1; handle->internalDrain = true; } } jack_default_audio_sample_t *jackbuffer; unsigned long bufferBytes = nframes * sizeof( jack_default_audio_sample_t ); if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( handle->drainCounter > 1 ) { // write zeros to the output stream for ( unsigned int i=0; iports[0][i], (jack_nframes_t) nframes ); memset( jackbuffer, 0, bufferBytes ); } } else if ( stream_.doConvertBuffer[0] ) { convertBuffer( stream_.deviceBuffer, stream_.userBuffer[0], stream_.convertInfo[0] ); for ( unsigned int i=0; iports[0][i], (jack_nframes_t) nframes ); memcpy( jackbuffer, &stream_.deviceBuffer[i*bufferBytes], bufferBytes ); } } else { // no buffer conversion for ( unsigned int i=0; iports[0][i], (jack_nframes_t) nframes ); memcpy( jackbuffer, &stream_.userBuffer[0][i*bufferBytes], bufferBytes ); } } if ( handle->drainCounter ) { handle->drainCounter++; goto unlock; } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { if ( stream_.doConvertBuffer[1] ) { for ( unsigned int i=0; iports[1][i], (jack_nframes_t) nframes ); memcpy( &stream_.deviceBuffer[i*bufferBytes], jackbuffer, bufferBytes ); } convertBuffer( stream_.userBuffer[1], stream_.deviceBuffer, stream_.convertInfo[1] ); } else { // no buffer conversion for ( unsigned int i=0; iports[1][i], (jack_nframes_t) nframes ); memcpy( &stream_.userBuffer[1][i*bufferBytes], jackbuffer, bufferBytes ); } } } unlock: RtApi::tickStreamTime(); return SUCCESS; } //******************** End of __UNIX_JACK__ *********************// #endif #if defined(__WINDOWS_ASIO__) // ASIO API on Windows // The ASIO API is designed around a callback scheme, so this // implementation is similar to that used for OS-X CoreAudio and Linux // Jack. The primary constraint with ASIO is that it only allows // access to a single driver at a time. Thus, it is not possible to // have more than one simultaneous RtAudio stream. // // This implementation also requires a number of external ASIO files // and a few global variables. The ASIO callback scheme does not // allow for the passing of user data, so we must create a global // pointer to our callbackInfo structure. // // On unix systems, we make use of a pthread condition variable. // Since there is no equivalent in Windows, I hacked something based // on information found in // http://www.cs.wustl.edu/~schmidt/win32-cv-1.html. #include "asiosys.h" #include "asio.h" #include "iasiothiscallresolver.h" #include "asiodrivers.h" #include static AsioDrivers drivers; static ASIOCallbacks asioCallbacks; static ASIODriverInfo driverInfo; static CallbackInfo *asioCallbackInfo; static bool asioXRun; struct AsioHandle { int drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. ASIOBufferInfo *bufferInfos; HANDLE condition; AsioHandle() :drainCounter(0), internalDrain(false), bufferInfos(0) {} }; // Function declarations (definitions at end of section) static const char* getAsioErrorString( ASIOError result ); static void sampleRateChanged( ASIOSampleRate sRate ); static long asioMessages( long selector, long value, void* message, double* opt ); RtApiAsio :: RtApiAsio() { // ASIO cannot run on a multi-threaded appartment. You can call // CoInitialize beforehand, but it must be for appartment threading // (in which case, CoInitilialize will return S_FALSE here). coInitialized_ = false; HRESULT hr = CoInitialize( NULL ); if ( FAILED(hr) ) { errorText_ = "RtApiAsio::ASIO requires a single-threaded appartment. Call CoInitializeEx(0,COINIT_APARTMENTTHREADED)"; error( RtError::WARNING ); } coInitialized_ = true; drivers.removeCurrentDriver(); driverInfo.asioVersion = 2; // See note in DirectSound implementation about GetDesktopWindow(). driverInfo.sysRef = GetForegroundWindow(); } RtApiAsio :: ~RtApiAsio() { if ( stream_.state != STREAM_CLOSED ) closeStream(); if ( coInitialized_ ) CoUninitialize(); } unsigned int RtApiAsio :: getDeviceCount( void ) { return (unsigned int) drivers.asioGetNumDev(); } RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; info.probed = false; // Get device ID unsigned int nDevices = getDeviceCount(); if ( nDevices == 0 ) { errorText_ = "RtApiAsio::getDeviceInfo: no devices found!"; error( RtError::INVALID_USE ); return info; } if ( device >= nDevices ) { errorText_ = "RtApiAsio::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } // If a stream is already open, we cannot probe other devices. Thus, use the saved results. if ( stream_.state != STREAM_CLOSED ) { if ( device >= devices_.size() ) { errorText_ = "RtApiAsio::getDeviceInfo: device ID was not present before stream was opened."; error( RtError::WARNING ); return info; } return devices_[ device ]; } char driverName[32]; ASIOError result = drivers.asioGetDriverName( (int) device, driverName, 32 ); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::getDeviceInfo: unable to get driver name (" << getAsioErrorString( result ) << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } info.name = driverName; if ( !drivers.loadDriver( driverName ) ) { errorStream_ << "RtApiAsio::getDeviceInfo: unable to load driver (" << driverName << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } result = ASIOInit( &driverInfo ); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") initializing driver (" << driverName << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Determine the device channel information. long inputChannels, outputChannels; result = ASIOGetChannels( &inputChannels, &outputChannels ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") getting channel count (" << driverName << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } info.outputChannels = outputChannels; info.inputChannels = inputChannels; if ( info.outputChannels > 0 && info.inputChannels > 0 ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; // Determine the supported sample rates. info.sampleRates.clear(); for ( unsigned int i=0; i 0 ) if ( getDefaultOutputDevice() == device ) info.isDefaultOutput = true; if ( info.inputChannels > 0 ) if ( getDefaultInputDevice() == device ) info.isDefaultInput = true; info.probed = true; drivers.removeCurrentDriver(); return info; } static void bufferSwitch( long index, ASIOBool processNow ) { RtApiAsio *object = (RtApiAsio *) asioCallbackInfo->object; object->callbackEvent( index ); } void RtApiAsio :: saveDeviceInfo( void ) { devices_.clear(); unsigned int nDevices = getDeviceCount(); devices_.resize( nDevices ); for ( unsigned int i=0; isaveDeviceInfo(); if ( !drivers.loadDriver( driverName ) ) { errorStream_ << "RtApiAsio::probeDeviceOpen: unable to load driver (" << driverName << ")."; errorText_ = errorStream_.str(); return FAILURE; } result = ASIOInit( &driverInfo ); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::probeDeviceOpen: error (" << getAsioErrorString( result ) << ") initializing driver (" << driverName << ")."; errorText_ = errorStream_.str(); return FAILURE; } } // Check the device channel count. long inputChannels, outputChannels; result = ASIOGetChannels( &inputChannels, &outputChannels ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: error (" << getAsioErrorString( result ) << ") getting channel count (" << driverName << ")."; errorText_ = errorStream_.str(); return FAILURE; } if ( ( mode == OUTPUT && (channels+firstChannel) > (unsigned int) outputChannels) || ( mode == INPUT && (channels+firstChannel) > (unsigned int) inputChannels) ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") does not support requested channel count (" << channels << ") + offset (" << firstChannel << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.nDeviceChannels[mode] = channels; stream_.nUserChannels[mode] = channels; stream_.channelOffset[mode] = firstChannel; // Verify the sample rate is supported. result = ASIOCanSampleRate( (ASIOSampleRate) sampleRate ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") does not support requested sample rate (" << sampleRate << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Get the current sample rate ASIOSampleRate currentRate; result = ASIOGetSampleRate( ¤tRate ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error getting sample rate."; errorText_ = errorStream_.str(); return FAILURE; } // Set the sample rate only if necessary if ( currentRate != sampleRate ) { result = ASIOSetSampleRate( (ASIOSampleRate) sampleRate ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error setting sample rate (" << sampleRate << ")."; errorText_ = errorStream_.str(); return FAILURE; } } // Determine the driver data type. ASIOChannelInfo channelInfo; channelInfo.channel = 0; if ( mode == OUTPUT ) channelInfo.isInput = false; else channelInfo.isInput = true; result = ASIOGetChannelInfo( &channelInfo ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") getting data format."; errorText_ = errorStream_.str(); return FAILURE; } // Assuming WINDOWS host is always little-endian. stream_.doByteSwap[mode] = false; stream_.userFormat = format; stream_.deviceFormat[mode] = 0; if ( channelInfo.type == ASIOSTInt16MSB || channelInfo.type == ASIOSTInt16LSB ) { stream_.deviceFormat[mode] = RTAUDIO_SINT16; if ( channelInfo.type == ASIOSTInt16MSB ) stream_.doByteSwap[mode] = true; } else if ( channelInfo.type == ASIOSTInt32MSB || channelInfo.type == ASIOSTInt32LSB ) { stream_.deviceFormat[mode] = RTAUDIO_SINT32; if ( channelInfo.type == ASIOSTInt32MSB ) stream_.doByteSwap[mode] = true; } else if ( channelInfo.type == ASIOSTFloat32MSB || channelInfo.type == ASIOSTFloat32LSB ) { stream_.deviceFormat[mode] = RTAUDIO_FLOAT32; if ( channelInfo.type == ASIOSTFloat32MSB ) stream_.doByteSwap[mode] = true; } else if ( channelInfo.type == ASIOSTFloat64MSB || channelInfo.type == ASIOSTFloat64LSB ) { stream_.deviceFormat[mode] = RTAUDIO_FLOAT64; if ( channelInfo.type == ASIOSTFloat64MSB ) stream_.doByteSwap[mode] = true; } else if ( channelInfo.type == ASIOSTInt24MSB || channelInfo.type == ASIOSTInt24LSB ) { stream_.deviceFormat[mode] = RTAUDIO_SINT24; if ( channelInfo.type == ASIOSTInt24MSB ) stream_.doByteSwap[mode] = true; } if ( stream_.deviceFormat[mode] == 0 ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") data format not supported by RtAudio."; errorText_ = errorStream_.str(); return FAILURE; } // Set the buffer size. For a duplex stream, this will end up // setting the buffer size based on the input constraints, which // should be ok. long minSize, maxSize, preferSize, granularity; result = ASIOGetBufferSize( &minSize, &maxSize, &preferSize, &granularity ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") getting buffer size."; errorText_ = errorStream_.str(); return FAILURE; } if ( *bufferSize < (unsigned int) minSize ) *bufferSize = (unsigned int) minSize; else if ( *bufferSize > (unsigned int) maxSize ) *bufferSize = (unsigned int) maxSize; else if ( granularity == -1 ) { // Make sure bufferSize is a power of two. int log2_of_min_size = 0; int log2_of_max_size = 0; for ( unsigned int i = 0; i < sizeof(long) * 8; i++ ) { if ( minSize & ((long)1 << i) ) log2_of_min_size = i; if ( maxSize & ((long)1 << i) ) log2_of_max_size = i; } long min_delta = std::abs( (long)*bufferSize - ((long)1 << log2_of_min_size) ); int min_delta_num = log2_of_min_size; for (int i = log2_of_min_size + 1; i <= log2_of_max_size; i++) { long current_delta = std::abs( (long)*bufferSize - ((long)1 << i) ); if (current_delta < min_delta) { min_delta = current_delta; min_delta_num = i; } } *bufferSize = ( (unsigned int)1 << min_delta_num ); if ( *bufferSize < (unsigned int) minSize ) *bufferSize = (unsigned int) minSize; else if ( *bufferSize > (unsigned int) maxSize ) *bufferSize = (unsigned int) maxSize; } else if ( granularity != 0 ) { // Set to an even multiple of granularity, rounding up. *bufferSize = (*bufferSize + granularity-1) / granularity * granularity; } if ( mode == INPUT && stream_.mode == OUTPUT && stream_.bufferSize != *bufferSize ) { drivers.removeCurrentDriver(); errorText_ = "RtApiAsio::probeDeviceOpen: input/output buffersize discrepancy!"; return FAILURE; } stream_.bufferSize = *bufferSize; stream_.nBuffers = 2; if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; else stream_.userInterleaved = true; // ASIO always uses non-interleaved buffers. stream_.deviceInterleaved[mode] = false; // Allocate, if necessary, our AsioHandle structure for the stream. AsioHandle *handle = (AsioHandle *) stream_.apiHandle; if ( handle == 0 ) { try { handle = new AsioHandle; } catch ( std::bad_alloc& ) { //if ( handle == NULL ) { drivers.removeCurrentDriver(); errorText_ = "RtApiAsio::probeDeviceOpen: error allocating AsioHandle memory."; return FAILURE; } handle->bufferInfos = 0; // Create a manual-reset event. handle->condition = CreateEvent( NULL, // no security TRUE, // manual-reset FALSE, // non-signaled initially NULL ); // unnamed stream_.apiHandle = (void *) handle; } // Create the ASIO internal buffers. Since RtAudio sets up input // and output separately, we'll have to dispose of previously // created output buffers for a duplex stream. long inputLatency, outputLatency; if ( mode == INPUT && stream_.mode == OUTPUT ) { ASIODisposeBuffers(); if ( handle->bufferInfos ) free( handle->bufferInfos ); } // Allocate, initialize, and save the bufferInfos in our stream callbackInfo structure. bool buffersAllocated = false; unsigned int i, nChannels = stream_.nDeviceChannels[0] + stream_.nDeviceChannels[1]; handle->bufferInfos = (ASIOBufferInfo *) malloc( nChannels * sizeof(ASIOBufferInfo) ); if ( handle->bufferInfos == NULL ) { errorStream_ << "RtApiAsio::probeDeviceOpen: error allocating bufferInfo memory for driver (" << driverName << ")."; errorText_ = errorStream_.str(); goto error; } ASIOBufferInfo *infos; infos = handle->bufferInfos; for ( i=0; iisInput = ASIOFalse; infos->channelNum = i + stream_.channelOffset[0]; infos->buffers[0] = infos->buffers[1] = 0; } for ( i=0; iisInput = ASIOTrue; infos->channelNum = i + stream_.channelOffset[1]; infos->buffers[0] = infos->buffers[1] = 0; } // Set up the ASIO callback structure and create the ASIO data buffers. asioCallbacks.bufferSwitch = &bufferSwitch; asioCallbacks.sampleRateDidChange = &sampleRateChanged; asioCallbacks.asioMessage = &asioMessages; asioCallbacks.bufferSwitchTimeInfo = NULL; result = ASIOCreateBuffers( handle->bufferInfos, nChannels, stream_.bufferSize, &asioCallbacks ); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") creating buffers."; errorText_ = errorStream_.str(); goto error; } buffersAllocated = true; // Set flags for buffer conversion. stream_.doConvertBuffer[mode] = false; if ( stream_.userFormat != stream_.deviceFormat[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.userInterleaved != stream_.deviceInterleaved[mode] && stream_.nUserChannels[mode] > 1 ) stream_.doConvertBuffer[mode] = true; // Allocate necessary internal buffers unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiAsio::probeDeviceOpen: error allocating user buffer memory."; goto error; } if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiAsio::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } stream_.sampleRate = sampleRate; stream_.device[mode] = device; stream_.state = STREAM_STOPPED; asioCallbackInfo = &stream_.callbackInfo; stream_.callbackInfo.object = (void *) this; if ( stream_.mode == OUTPUT && mode == INPUT ) // We had already set up an output stream. stream_.mode = DUPLEX; else stream_.mode = mode; // Determine device latencies result = ASIOGetLatencies( &inputLatency, &outputLatency ); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") getting latency."; errorText_ = errorStream_.str(); error( RtError::WARNING); // warn but don't fail } else { stream_.latency[0] = outputLatency; stream_.latency[1] = inputLatency; } // Setup the buffer conversion information structure. We don't use // buffers to do channel offsets, so we override that parameter // here. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, 0 ); return SUCCESS; error: if ( buffersAllocated ) ASIODisposeBuffers(); drivers.removeCurrentDriver(); if ( handle ) { CloseHandle( handle->condition ); if ( handle->bufferInfos ) free( handle->bufferInfos ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } return FAILURE; } void RtApiAsio :: closeStream() { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiAsio::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } if ( stream_.state == STREAM_RUNNING ) { stream_.state = STREAM_STOPPED; ASIOStop(); } ASIODisposeBuffers(); drivers.removeCurrentDriver(); AsioHandle *handle = (AsioHandle *) stream_.apiHandle; if ( handle ) { CloseHandle( handle->condition ); if ( handle->bufferInfos ) free( handle->bufferInfos ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } bool stopThreadCalled = false; void RtApiAsio :: startStream() { verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiAsio::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } AsioHandle *handle = (AsioHandle *) stream_.apiHandle; ASIOError result = ASIOStart(); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::startStream: error (" << getAsioErrorString( result ) << ") starting device."; errorText_ = errorStream_.str(); goto unlock; } handle->drainCounter = 0; handle->internalDrain = false; ResetEvent( handle->condition ); stream_.state = STREAM_RUNNING; asioXRun = false; unlock: stopThreadCalled = false; if ( result == ASE_OK ) return; error( RtError::SYSTEM_ERROR ); } void RtApiAsio :: stopStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiAsio::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } AsioHandle *handle = (AsioHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( handle->drainCounter == 0 ) { handle->drainCounter = 2; WaitForSingleObject( handle->condition, INFINITE ); // block until signaled } } stream_.state = STREAM_STOPPED; ASIOError result = ASIOStop(); if ( result != ASE_OK ) { errorStream_ << "RtApiAsio::stopStream: error (" << getAsioErrorString( result ) << ") stopping device."; errorText_ = errorStream_.str(); } if ( result == ASE_OK ) return; error( RtError::SYSTEM_ERROR ); } void RtApiAsio :: abortStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiAsio::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } // The following lines were commented-out because some behavior was // noted where the device buffers need to be zeroed to avoid // continuing sound, even when the device buffers are completely // disposed. So now, calling abort is the same as calling stop. // AsioHandle *handle = (AsioHandle *) stream_.apiHandle; // handle->drainCounter = 2; stopStream(); } // This function will be called by a spawned thread when the user // callback function signals that the stream should be stopped or // aborted. It is necessary to handle it this way because the // callbackEvent() function must return before the ASIOStop() // function will return. static unsigned __stdcall asioStopStream( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiAsio *object = (RtApiAsio *) info->object; object->stopStream(); _endthreadex( 0 ); return 0; } bool RtApiAsio :: callbackEvent( long bufferIndex ) { if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS; if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiAsio::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return FAILURE; } CallbackInfo *info = (CallbackInfo *) &stream_.callbackInfo; AsioHandle *handle = (AsioHandle *) stream_.apiHandle; // Check if we were draining the stream and signal if finished. if ( handle->drainCounter > 3 ) { stream_.state = STREAM_STOPPING; if ( handle->internalDrain == false ) SetEvent( handle->condition ); else { // spawn a thread to stop the stream unsigned threadId; stream_.callbackInfo.thread = _beginthreadex( NULL, 0, &asioStopStream, &stream_.callbackInfo, 0, &threadId ); } return SUCCESS; } // Invoke user callback to get fresh output data UNLESS we are // draining stream. if ( handle->drainCounter == 0 ) { RtAudioCallback callback = (RtAudioCallback) info->callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && asioXRun == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; asioXRun = false; } if ( stream_.mode != OUTPUT && asioXRun == true ) { status |= RTAUDIO_INPUT_OVERFLOW; asioXRun = false; } int cbReturnValue = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, info->userData ); if ( cbReturnValue == 2 ) { stream_.state = STREAM_STOPPING; handle->drainCounter = 2; unsigned threadId; stream_.callbackInfo.thread = _beginthreadex( NULL, 0, &asioStopStream, &stream_.callbackInfo, 0, &threadId ); return SUCCESS; } else if ( cbReturnValue == 1 ) { handle->drainCounter = 1; handle->internalDrain = true; } } unsigned int nChannels, bufferBytes, i, j; nChannels = stream_.nDeviceChannels[0] + stream_.nDeviceChannels[1]; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { bufferBytes = stream_.bufferSize * formatBytes( stream_.deviceFormat[0] ); if ( handle->drainCounter > 1 ) { // write zeros to the output stream for ( i=0, j=0; ibufferInfos[i].isInput != ASIOTrue ) memset( handle->bufferInfos[i].buffers[bufferIndex], 0, bufferBytes ); } } else if ( stream_.doConvertBuffer[0] ) { convertBuffer( stream_.deviceBuffer, stream_.userBuffer[0], stream_.convertInfo[0] ); if ( stream_.doByteSwap[0] ) byteSwapBuffer( stream_.deviceBuffer, stream_.bufferSize * stream_.nDeviceChannels[0], stream_.deviceFormat[0] ); for ( i=0, j=0; ibufferInfos[i].isInput != ASIOTrue ) memcpy( handle->bufferInfos[i].buffers[bufferIndex], &stream_.deviceBuffer[j++*bufferBytes], bufferBytes ); } } else { if ( stream_.doByteSwap[0] ) byteSwapBuffer( stream_.userBuffer[0], stream_.bufferSize * stream_.nUserChannels[0], stream_.userFormat ); for ( i=0, j=0; ibufferInfos[i].isInput != ASIOTrue ) memcpy( handle->bufferInfos[i].buffers[bufferIndex], &stream_.userBuffer[0][bufferBytes*j++], bufferBytes ); } } if ( handle->drainCounter ) { handle->drainCounter++; goto unlock; } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { bufferBytes = stream_.bufferSize * formatBytes(stream_.deviceFormat[1]); if (stream_.doConvertBuffer[1]) { // Always interleave ASIO input data. for ( i=0, j=0; ibufferInfos[i].isInput == ASIOTrue ) memcpy( &stream_.deviceBuffer[j++*bufferBytes], handle->bufferInfos[i].buffers[bufferIndex], bufferBytes ); } if ( stream_.doByteSwap[1] ) byteSwapBuffer( stream_.deviceBuffer, stream_.bufferSize * stream_.nDeviceChannels[1], stream_.deviceFormat[1] ); convertBuffer( stream_.userBuffer[1], stream_.deviceBuffer, stream_.convertInfo[1] ); } else { for ( i=0, j=0; ibufferInfos[i].isInput == ASIOTrue ) { memcpy( &stream_.userBuffer[1][bufferBytes*j++], handle->bufferInfos[i].buffers[bufferIndex], bufferBytes ); } } if ( stream_.doByteSwap[1] ) byteSwapBuffer( stream_.userBuffer[1], stream_.bufferSize * stream_.nUserChannels[1], stream_.userFormat ); } } unlock: // The following call was suggested by Malte Clasen. While the API // documentation indicates it should not be required, some device // drivers apparently do not function correctly without it. ASIOOutputReady(); RtApi::tickStreamTime(); return SUCCESS; } static void sampleRateChanged( ASIOSampleRate sRate ) { // The ASIO documentation says that this usually only happens during // external sync. Audio processing is not stopped by the driver, // actual sample rate might not have even changed, maybe only the // sample rate status of an AES/EBU or S/PDIF digital input at the // audio device. RtApi *object = (RtApi *) asioCallbackInfo->object; try { object->stopStream(); } catch ( RtError &exception ) { std::cerr << "\nRtApiAsio: sampleRateChanged() error (" << exception.getMessage() << ")!\n" << std::endl; return; } std::cerr << "\nRtApiAsio: driver reports sample rate changed to " << sRate << " ... stream stopped!!!\n" << std::endl; } static long asioMessages( long selector, long value, void* message, double* opt ) { long ret = 0; switch( selector ) { case kAsioSelectorSupported: if ( value == kAsioResetRequest || value == kAsioEngineVersion || value == kAsioResyncRequest || value == kAsioLatenciesChanged // The following three were added for ASIO 2.0, you don't // necessarily have to support them. || value == kAsioSupportsTimeInfo || value == kAsioSupportsTimeCode || value == kAsioSupportsInputMonitor) ret = 1L; break; case kAsioResetRequest: // Defer the task and perform the reset of the driver during the // next "safe" situation. You cannot reset the driver right now, // as this code is called from the driver. Reset the driver is // done by completely destruct is. I.e. ASIOStop(), // ASIODisposeBuffers(), Destruction Afterwards you initialize the // driver again. std::cerr << "\nRtApiAsio: driver reset requested!!!" << std::endl; ret = 1L; break; case kAsioResyncRequest: // This informs the application that the driver encountered some // non-fatal data loss. It is used for synchronization purposes // of different media. Added mainly to work around the Win16Mutex // problems in Windows 95/98 with the Windows Multimedia system, // which could lose data because the Mutex was held too long by // another thread. However a driver can issue it in other // situations, too. // std::cerr << "\nRtApiAsio: driver resync requested!!!" << std::endl; asioXRun = true; ret = 1L; break; case kAsioLatenciesChanged: // This will inform the host application that the drivers were // latencies changed. Beware, it this does not mean that the // buffer sizes have changed! You might need to update internal // delay data. std::cerr << "\nRtApiAsio: driver latency may have changed!!!" << std::endl; ret = 1L; break; case kAsioEngineVersion: // Return the supported ASIO version of the host application. If // a host application does not implement this selector, ASIO 1.0 // is assumed by the driver. ret = 2L; break; case kAsioSupportsTimeInfo: // Informs the driver whether the // asioCallbacks.bufferSwitchTimeInfo() callback is supported. // For compatibility with ASIO 1.0 drivers the host application // should always support the "old" bufferSwitch method, too. ret = 0; break; case kAsioSupportsTimeCode: // Informs the driver whether application is interested in time // code info. If an application does not need to know about time // code, the driver has less work to do. ret = 0; break; } return ret; } static const char* getAsioErrorString( ASIOError result ) { struct Messages { ASIOError value; const char*message; }; static const Messages m[] = { { ASE_NotPresent, "Hardware input or output is not present or available." }, { ASE_HWMalfunction, "Hardware is malfunctioning." }, { ASE_InvalidParameter, "Invalid input parameter." }, { ASE_InvalidMode, "Invalid mode." }, { ASE_SPNotAdvancing, "Sample position not advancing." }, { ASE_NoClock, "Sample clock or rate cannot be determined or is not present." }, { ASE_NoMemory, "Not enough memory to complete the request." } }; for ( unsigned int i = 0; i < sizeof(m)/sizeof(m[0]); ++i ) if ( m[i].value == result ) return m[i].message; return "Unknown error."; } //******************** End of __WINDOWS_ASIO__ *********************// #endif #if defined(__WINDOWS_DS__) // Windows DirectSound API // Modified by Robin Davies, October 2005 // - Improvements to DirectX pointer chasing. // - Bug fix for non-power-of-two Asio granularity used by Edirol PCR-A30. // - Auto-call CoInitialize for DSOUND and ASIO platforms. // Various revisions for RtAudio 4.0 by Gary Scavone, April 2007 // Changed device query structure for RtAudio 4.0.7, January 2010 #include #include #include #if defined(__MINGW32__) // missing from latest mingw winapi #define WAVE_FORMAT_96M08 0x00010000 /* 96 kHz, Mono, 8-bit */ #define WAVE_FORMAT_96S08 0x00020000 /* 96 kHz, Stereo, 8-bit */ #define WAVE_FORMAT_96M16 0x00040000 /* 96 kHz, Mono, 16-bit */ #define WAVE_FORMAT_96S16 0x00080000 /* 96 kHz, Stereo, 16-bit */ #endif #define MINIMUM_DEVICE_BUFFER_SIZE 32768 #ifdef _MSC_VER // if Microsoft Visual C++ #pragma comment( lib, "winmm.lib" ) // then, auto-link winmm.lib. Otherwise, it has to be added manually. #endif static inline DWORD dsPointerBetween( DWORD pointer, DWORD laterPointer, DWORD earlierPointer, DWORD bufferSize ) { if ( pointer > bufferSize ) pointer -= bufferSize; if ( laterPointer < earlierPointer ) laterPointer += bufferSize; if ( pointer < earlierPointer ) pointer += bufferSize; return pointer >= earlierPointer && pointer < laterPointer; } // A structure to hold various information related to the DirectSound // API implementation. struct DsHandle { unsigned int drainCounter; // Tracks callback counts when draining bool internalDrain; // Indicates if stop is initiated from callback or not. void *id[2]; void *buffer[2]; bool xrun[2]; UINT bufferPointer[2]; DWORD dsBufferSize[2]; DWORD dsPointerLeadTime[2]; // the number of bytes ahead of the safe pointer to lead by. HANDLE condition; DsHandle() :drainCounter(0), internalDrain(false) { id[0] = 0; id[1] = 0; buffer[0] = 0; buffer[1] = 0; xrun[0] = false; xrun[1] = false; bufferPointer[0] = 0; bufferPointer[1] = 0; } }; // Declarations for utility functions, callbacks, and structures // specific to the DirectSound implementation. static BOOL CALLBACK deviceQueryCallback( LPGUID lpguid, LPCTSTR description, LPCTSTR module, LPVOID lpContext ); static const char* getErrorString( int code ); static unsigned __stdcall callbackHandler( void *ptr ); struct DsDevice { LPGUID id[2]; bool validId[2]; bool found; std::string name; DsDevice() : found(false) { validId[0] = false; validId[1] = false; } }; struct DsProbeData { bool isInput; std::vector* dsDevices; }; RtApiDs :: RtApiDs() { // Dsound will run both-threaded. If CoInitialize fails, then just // accept whatever the mainline chose for a threading model. coInitialized_ = false; HRESULT hr = CoInitialize( NULL ); if ( !FAILED( hr ) ) coInitialized_ = true; } RtApiDs :: ~RtApiDs() { if ( coInitialized_ ) CoUninitialize(); // balanced call. if ( stream_.state != STREAM_CLOSED ) closeStream(); } // The DirectSound default output is always the first device. unsigned int RtApiDs :: getDefaultOutputDevice( void ) { return 0; } // The DirectSound default input is always the first input device, // which is the first capture device enumerated. unsigned int RtApiDs :: getDefaultInputDevice( void ) { return 0; } unsigned int RtApiDs :: getDeviceCount( void ) { // Set query flag for previously found devices to false, so that we // can check for any devices that have disappeared. for ( unsigned int i=0; i indices; for ( unsigned int i=0; i= dsDevices.size() ) { errorText_ = "RtApiDs::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } HRESULT result; if ( dsDevices[ device ].validId[0] == false ) goto probeInput; LPDIRECTSOUND output; DSCAPS outCaps; result = DirectSoundCreate( dsDevices[ device ].id[0], &output, NULL ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening output device (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto probeInput; } outCaps.dwSize = sizeof( outCaps ); result = output->GetCaps( &outCaps ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting capabilities!"; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto probeInput; } // Get output channel information. info.outputChannels = ( outCaps.dwFlags & DSCAPS_PRIMARYSTEREO ) ? 2 : 1; // Get sample rate information. info.sampleRates.clear(); for ( unsigned int k=0; k= (unsigned int) outCaps.dwMinSecondarySampleRate && SAMPLE_RATES[k] <= (unsigned int) outCaps.dwMaxSecondarySampleRate ) info.sampleRates.push_back( SAMPLE_RATES[k] ); } // Get format information. if ( outCaps.dwFlags & DSCAPS_PRIMARY16BIT ) info.nativeFormats |= RTAUDIO_SINT16; if ( outCaps.dwFlags & DSCAPS_PRIMARY8BIT ) info.nativeFormats |= RTAUDIO_SINT8; output->Release(); if ( getDefaultOutputDevice() == device ) info.isDefaultOutput = true; if ( dsDevices[ device ].validId[1] == false ) { info.name = dsDevices[ device ].name; info.probed = true; return info; } probeInput: LPDIRECTSOUNDCAPTURE input; result = DirectSoundCaptureCreate( dsDevices[ device ].id[1], &input, NULL ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening input device (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } DSCCAPS inCaps; inCaps.dwSize = sizeof( inCaps ); result = input->GetCaps( &inCaps ); if ( FAILED( result ) ) { input->Release(); errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting object capabilities (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Get input channel information. info.inputChannels = inCaps.dwChannels; // Get sample rate and format information. std::vector rates; if ( inCaps.dwChannels >= 2 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1S16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_2S16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_4S16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_96S16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_1S08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_2S08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_4S08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_96S08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( info.nativeFormats & RTAUDIO_SINT16 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1S16 ) rates.push_back( 11025 ); if ( inCaps.dwFormats & WAVE_FORMAT_2S16 ) rates.push_back( 22050 ); if ( inCaps.dwFormats & WAVE_FORMAT_4S16 ) rates.push_back( 44100 ); if ( inCaps.dwFormats & WAVE_FORMAT_96S16 ) rates.push_back( 96000 ); } else if ( info.nativeFormats & RTAUDIO_SINT8 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1S08 ) rates.push_back( 11025 ); if ( inCaps.dwFormats & WAVE_FORMAT_2S08 ) rates.push_back( 22050 ); if ( inCaps.dwFormats & WAVE_FORMAT_4S08 ) rates.push_back( 44100 ); if ( inCaps.dwFormats & WAVE_FORMAT_96S08 ) rates.push_back( 96000 ); } } else if ( inCaps.dwChannels == 1 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1M16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_2M16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_4M16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_96M16 ) info.nativeFormats |= RTAUDIO_SINT16; if ( inCaps.dwFormats & WAVE_FORMAT_1M08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_2M08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_4M08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( inCaps.dwFormats & WAVE_FORMAT_96M08 ) info.nativeFormats |= RTAUDIO_SINT8; if ( info.nativeFormats & RTAUDIO_SINT16 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1M16 ) rates.push_back( 11025 ); if ( inCaps.dwFormats & WAVE_FORMAT_2M16 ) rates.push_back( 22050 ); if ( inCaps.dwFormats & WAVE_FORMAT_4M16 ) rates.push_back( 44100 ); if ( inCaps.dwFormats & WAVE_FORMAT_96M16 ) rates.push_back( 96000 ); } else if ( info.nativeFormats & RTAUDIO_SINT8 ) { if ( inCaps.dwFormats & WAVE_FORMAT_1M08 ) rates.push_back( 11025 ); if ( inCaps.dwFormats & WAVE_FORMAT_2M08 ) rates.push_back( 22050 ); if ( inCaps.dwFormats & WAVE_FORMAT_4M08 ) rates.push_back( 44100 ); if ( inCaps.dwFormats & WAVE_FORMAT_96M08 ) rates.push_back( 96000 ); } } else info.inputChannels = 0; // technically, this would be an error input->Release(); if ( info.inputChannels == 0 ) return info; // Copy the supported rates to the info structure but avoid duplication. bool found; for ( unsigned int i=0; i 0 && info.inputChannels > 0 ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; if ( device == 0 ) info.isDefaultInput = true; // Copy name and return. info.name = dsDevices[ device ].name; info.probed = true; return info; } bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ) { if ( channels + firstChannel > 2 ) { errorText_ = "RtApiDs::probeDeviceOpen: DirectSound does not support more than 2 channels per device."; return FAILURE; } unsigned int nDevices = dsDevices.size(); if ( nDevices == 0 ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiDs::probeDeviceOpen: no devices found!"; return FAILURE; } if ( device >= nDevices ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiDs::probeDeviceOpen: device ID is invalid!"; return FAILURE; } if ( mode == OUTPUT ) { if ( dsDevices[ device ].validId[0] == false ) { errorStream_ << "RtApiDs::probeDeviceOpen: device (" << device << ") does not support output!"; errorText_ = errorStream_.str(); return FAILURE; } } else { // mode == INPUT if ( dsDevices[ device ].validId[1] == false ) { errorStream_ << "RtApiDs::probeDeviceOpen: device (" << device << ") does not support input!"; errorText_ = errorStream_.str(); return FAILURE; } } // According to a note in PortAudio, using GetDesktopWindow() // instead of GetForegroundWindow() is supposed to avoid problems // that occur when the application's window is not the foreground // window. Also, if the application window closes before the // DirectSound buffer, DirectSound can crash. In the past, I had // problems when using GetDesktopWindow() but it seems fine now // (January 2010). I'll leave it commented here. // HWND hWnd = GetForegroundWindow(); HWND hWnd = GetDesktopWindow(); // Check the numberOfBuffers parameter and limit the lowest value to // two. This is a judgement call and a value of two is probably too // low for capture, but it should work for playback. int nBuffers = 0; if ( options ) nBuffers = options->numberOfBuffers; if ( options && options->flags & RTAUDIO_MINIMIZE_LATENCY ) nBuffers = 2; if ( nBuffers < 2 ) nBuffers = 3; // Check the lower range of the user-specified buffer size and set // (arbitrarily) to a lower bound of 32. if ( *bufferSize < 32 ) *bufferSize = 32; // Create the wave format structure. The data format setting will // be determined later. WAVEFORMATEX waveFormat; ZeroMemory( &waveFormat, sizeof(WAVEFORMATEX) ); waveFormat.wFormatTag = WAVE_FORMAT_PCM; waveFormat.nChannels = channels + firstChannel; waveFormat.nSamplesPerSec = (unsigned long) sampleRate; // Determine the device buffer size. By default, we'll use the value // defined above (32K), but we will grow it to make allowances for // very large software buffer sizes. DWORD dsBufferSize = MINIMUM_DEVICE_BUFFER_SIZE; DWORD dsPointerLeadTime = 0; void *ohandle = 0, *bhandle = 0; HRESULT result; if ( mode == OUTPUT ) { LPDIRECTSOUND output; result = DirectSoundCreate( dsDevices[ device ].id[0], &output, NULL ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") opening output device (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } DSCAPS outCaps; outCaps.dwSize = sizeof( outCaps ); result = output->GetCaps( &outCaps ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") getting capabilities (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Check channel information. if ( channels + firstChannel == 2 && !( outCaps.dwFlags & DSCAPS_PRIMARYSTEREO ) ) { errorStream_ << "RtApiDs::getDeviceInfo: the output device (" << dsDevices[ device ].name << ") does not support stereo playback."; errorText_ = errorStream_.str(); return FAILURE; } // Check format information. Use 16-bit format unless not // supported or user requests 8-bit. if ( outCaps.dwFlags & DSCAPS_PRIMARY16BIT && !( format == RTAUDIO_SINT8 && outCaps.dwFlags & DSCAPS_PRIMARY8BIT ) ) { waveFormat.wBitsPerSample = 16; stream_.deviceFormat[mode] = RTAUDIO_SINT16; } else { waveFormat.wBitsPerSample = 8; stream_.deviceFormat[mode] = RTAUDIO_SINT8; } stream_.userFormat = format; // Update wave format structure and buffer information. waveFormat.nBlockAlign = waveFormat.nChannels * waveFormat.wBitsPerSample / 8; waveFormat.nAvgBytesPerSec = waveFormat.nSamplesPerSec * waveFormat.nBlockAlign; dsPointerLeadTime = nBuffers * (*bufferSize) * (waveFormat.wBitsPerSample / 8) * channels; // If the user wants an even bigger buffer, increase the device buffer size accordingly. while ( dsPointerLeadTime * 2U > dsBufferSize ) dsBufferSize *= 2; // Set cooperative level to DSSCL_EXCLUSIVE ... sound stops when window focus changes. // result = output->SetCooperativeLevel( hWnd, DSSCL_EXCLUSIVE ); // Set cooperative level to DSSCL_PRIORITY ... sound remains when window focus changes. result = output->SetCooperativeLevel( hWnd, DSSCL_PRIORITY ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") setting cooperative level (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Even though we will write to the secondary buffer, we need to // access the primary buffer to set the correct output format // (since the default is 8-bit, 22 kHz!). Setup the DS primary // buffer description. DSBUFFERDESC bufferDescription; ZeroMemory( &bufferDescription, sizeof( DSBUFFERDESC ) ); bufferDescription.dwSize = sizeof( DSBUFFERDESC ); bufferDescription.dwFlags = DSBCAPS_PRIMARYBUFFER; // Obtain the primary buffer LPDIRECTSOUNDBUFFER buffer; result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") accessing primary buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Set the primary DS buffer sound format. result = buffer->SetFormat( &waveFormat ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") setting primary buffer format (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Setup the secondary DS buffer description. ZeroMemory( &bufferDescription, sizeof( DSBUFFERDESC ) ); bufferDescription.dwSize = sizeof( DSBUFFERDESC ); bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCHARDWARE ); // Force hardware mixing bufferDescription.dwBufferBytes = dsBufferSize; bufferDescription.lpwfxFormat = &waveFormat; // Try to create the secondary DS buffer. If that doesn't work, // try to use software mixing. Otherwise, there's a problem. result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL ); if ( FAILED( result ) ) { bufferDescription.dwFlags = ( DSBCAPS_STICKYFOCUS | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE ); // Force software mixing result = output->CreateSoundBuffer( &bufferDescription, &buffer, NULL ); if ( FAILED( result ) ) { output->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") creating secondary buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } } // Get the buffer size ... might be different from what we specified. DSBCAPS dsbcaps; dsbcaps.dwSize = sizeof( DSBCAPS ); result = buffer->GetCaps( &dsbcaps ); if ( FAILED( result ) ) { output->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") getting buffer settings (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } dsBufferSize = dsbcaps.dwBufferBytes; // Lock the DS buffer LPVOID audioPtr; DWORD dataLen; result = buffer->Lock( 0, dsBufferSize, &audioPtr, &dataLen, NULL, NULL, 0 ); if ( FAILED( result ) ) { output->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") locking buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Zero the DS buffer ZeroMemory( audioPtr, dataLen ); // Unlock the DS buffer result = buffer->Unlock( audioPtr, dataLen, NULL, 0 ); if ( FAILED( result ) ) { output->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") unlocking buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } ohandle = (void *) output; bhandle = (void *) buffer; } if ( mode == INPUT ) { LPDIRECTSOUNDCAPTURE input; result = DirectSoundCaptureCreate( dsDevices[ device ].id[1], &input, NULL ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") opening input device (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } DSCCAPS inCaps; inCaps.dwSize = sizeof( inCaps ); result = input->GetCaps( &inCaps ); if ( FAILED( result ) ) { input->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") getting input capabilities (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Check channel information. if ( inCaps.dwChannels < channels + firstChannel ) { errorText_ = "RtApiDs::getDeviceInfo: the input device does not support requested input channels."; return FAILURE; } // Check format information. Use 16-bit format unless user // requests 8-bit. DWORD deviceFormats; if ( channels + firstChannel == 2 ) { deviceFormats = WAVE_FORMAT_1S08 | WAVE_FORMAT_2S08 | WAVE_FORMAT_4S08 | WAVE_FORMAT_96S08; if ( format == RTAUDIO_SINT8 && inCaps.dwFormats & deviceFormats ) { waveFormat.wBitsPerSample = 8; stream_.deviceFormat[mode] = RTAUDIO_SINT8; } else { // assume 16-bit is supported waveFormat.wBitsPerSample = 16; stream_.deviceFormat[mode] = RTAUDIO_SINT16; } } else { // channel == 1 deviceFormats = WAVE_FORMAT_1M08 | WAVE_FORMAT_2M08 | WAVE_FORMAT_4M08 | WAVE_FORMAT_96M08; if ( format == RTAUDIO_SINT8 && inCaps.dwFormats & deviceFormats ) { waveFormat.wBitsPerSample = 8; stream_.deviceFormat[mode] = RTAUDIO_SINT8; } else { // assume 16-bit is supported waveFormat.wBitsPerSample = 16; stream_.deviceFormat[mode] = RTAUDIO_SINT16; } } stream_.userFormat = format; // Update wave format structure and buffer information. waveFormat.nBlockAlign = waveFormat.nChannels * waveFormat.wBitsPerSample / 8; waveFormat.nAvgBytesPerSec = waveFormat.nSamplesPerSec * waveFormat.nBlockAlign; dsPointerLeadTime = nBuffers * (*bufferSize) * (waveFormat.wBitsPerSample / 8) * channels; // If the user wants an even bigger buffer, increase the device buffer size accordingly. while ( dsPointerLeadTime * 2U > dsBufferSize ) dsBufferSize *= 2; // Setup the secondary DS buffer description. DSCBUFFERDESC bufferDescription; ZeroMemory( &bufferDescription, sizeof( DSCBUFFERDESC ) ); bufferDescription.dwSize = sizeof( DSCBUFFERDESC ); bufferDescription.dwFlags = 0; bufferDescription.dwReserved = 0; bufferDescription.dwBufferBytes = dsBufferSize; bufferDescription.lpwfxFormat = &waveFormat; // Create the capture buffer. LPDIRECTSOUNDCAPTUREBUFFER buffer; result = input->CreateCaptureBuffer( &bufferDescription, &buffer, NULL ); if ( FAILED( result ) ) { input->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") creating input buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Get the buffer size ... might be different from what we specified. DSCBCAPS dscbcaps; dscbcaps.dwSize = sizeof( DSCBCAPS ); result = buffer->GetCaps( &dscbcaps ); if ( FAILED( result ) ) { input->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") getting buffer settings (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } dsBufferSize = dscbcaps.dwBufferBytes; // NOTE: We could have a problem here if this is a duplex stream // and the play and capture hardware buffer sizes are different // (I'm actually not sure if that is a problem or not). // Currently, we are not verifying that. // Lock the capture buffer LPVOID audioPtr; DWORD dataLen; result = buffer->Lock( 0, dsBufferSize, &audioPtr, &dataLen, NULL, NULL, 0 ); if ( FAILED( result ) ) { input->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") locking input buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } // Zero the buffer ZeroMemory( audioPtr, dataLen ); // Unlock the buffer result = buffer->Unlock( audioPtr, dataLen, NULL, 0 ); if ( FAILED( result ) ) { input->Release(); buffer->Release(); errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") unlocking input buffer (" << dsDevices[ device ].name << ")!"; errorText_ = errorStream_.str(); return FAILURE; } ohandle = (void *) input; bhandle = (void *) buffer; } // Set various stream parameters DsHandle *handle = 0; stream_.nDeviceChannels[mode] = channels + firstChannel; stream_.nUserChannels[mode] = channels; stream_.bufferSize = *bufferSize; stream_.channelOffset[mode] = firstChannel; stream_.deviceInterleaved[mode] = true; if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; else stream_.userInterleaved = true; // Set flag for buffer conversion stream_.doConvertBuffer[mode] = false; if (stream_.nUserChannels[mode] != stream_.nDeviceChannels[mode]) stream_.doConvertBuffer[mode] = true; if (stream_.userFormat != stream_.deviceFormat[mode]) stream_.doConvertBuffer[mode] = true; if ( stream_.userInterleaved != stream_.deviceInterleaved[mode] && stream_.nUserChannels[mode] > 1 ) stream_.doConvertBuffer[mode] = true; // Allocate necessary internal buffers long bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiDs::probeDeviceOpen: error allocating user buffer memory."; goto error; } if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= (long) bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiDs::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } // Allocate our DsHandle structures for the stream. if ( stream_.apiHandle == 0 ) { try { handle = new DsHandle; } catch ( std::bad_alloc& ) { errorText_ = "RtApiDs::probeDeviceOpen: error allocating AsioHandle memory."; goto error; } // Create a manual-reset event. handle->condition = CreateEvent( NULL, // no security TRUE, // manual-reset FALSE, // non-signaled initially NULL ); // unnamed stream_.apiHandle = (void *) handle; } else handle = (DsHandle *) stream_.apiHandle; handle->id[mode] = ohandle; handle->buffer[mode] = bhandle; handle->dsBufferSize[mode] = dsBufferSize; handle->dsPointerLeadTime[mode] = dsPointerLeadTime; stream_.device[mode] = device; stream_.state = STREAM_STOPPED; if ( stream_.mode == OUTPUT && mode == INPUT ) // We had already set up an output stream. stream_.mode = DUPLEX; else stream_.mode = mode; stream_.nBuffers = nBuffers; stream_.sampleRate = sampleRate; // Setup the buffer conversion information structure. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, firstChannel ); // Setup the callback thread. if ( stream_.callbackInfo.isRunning == false ) { unsigned threadId; stream_.callbackInfo.isRunning = true; stream_.callbackInfo.object = (void *) this; stream_.callbackInfo.thread = _beginthreadex( NULL, 0, &callbackHandler, &stream_.callbackInfo, 0, &threadId ); if ( stream_.callbackInfo.thread == 0 ) { errorText_ = "RtApiDs::probeDeviceOpen: error creating callback thread!"; goto error; } // Boost DS thread priority SetThreadPriority( (HANDLE) stream_.callbackInfo.thread, THREAD_PRIORITY_HIGHEST ); } return SUCCESS; error: if ( handle ) { if ( handle->buffer[0] ) { // the object pointer can be NULL and valid LPDIRECTSOUND object = (LPDIRECTSOUND) handle->id[0]; LPDIRECTSOUNDBUFFER buffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; if ( buffer ) buffer->Release(); object->Release(); } if ( handle->buffer[1] ) { LPDIRECTSOUNDCAPTURE object = (LPDIRECTSOUNDCAPTURE) handle->id[1]; LPDIRECTSOUNDCAPTUREBUFFER buffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; if ( buffer ) buffer->Release(); object->Release(); } CloseHandle( handle->condition ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.state = STREAM_CLOSED; return FAILURE; } void RtApiDs :: closeStream() { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiDs::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } // Stop the callback thread. stream_.callbackInfo.isRunning = false; WaitForSingleObject( (HANDLE) stream_.callbackInfo.thread, INFINITE ); CloseHandle( (HANDLE) stream_.callbackInfo.thread ); DsHandle *handle = (DsHandle *) stream_.apiHandle; if ( handle ) { if ( handle->buffer[0] ) { // the object pointer can be NULL and valid LPDIRECTSOUND object = (LPDIRECTSOUND) handle->id[0]; LPDIRECTSOUNDBUFFER buffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; if ( buffer ) { buffer->Stop(); buffer->Release(); } object->Release(); } if ( handle->buffer[1] ) { LPDIRECTSOUNDCAPTURE object = (LPDIRECTSOUNDCAPTURE) handle->id[1]; LPDIRECTSOUNDCAPTUREBUFFER buffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; if ( buffer ) { buffer->Stop(); buffer->Release(); } object->Release(); } CloseHandle( handle->condition ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } void RtApiDs :: startStream() { verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiDs::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } DsHandle *handle = (DsHandle *) stream_.apiHandle; // Increase scheduler frequency on lesser windows (a side-effect of // increasing timer accuracy). On greater windows (Win2K or later), // this is already in effect. timeBeginPeriod( 1 ); buffersRolling = false; duplexPrerollBytes = 0; if ( stream_.mode == DUPLEX ) { // 0.5 seconds of silence in DUPLEX mode while the devices spin up and synchronize. duplexPrerollBytes = (int) ( 0.5 * stream_.sampleRate * formatBytes( stream_.deviceFormat[1] ) * stream_.nDeviceChannels[1] ); } HRESULT result = 0; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { LPDIRECTSOUNDBUFFER buffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; result = buffer->Play( 0, 0, DSBPLAY_LOOPING ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::startStream: error (" << getErrorString( result ) << ") starting output buffer!"; errorText_ = errorStream_.str(); goto unlock; } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { LPDIRECTSOUNDCAPTUREBUFFER buffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; result = buffer->Start( DSCBSTART_LOOPING ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::startStream: error (" << getErrorString( result ) << ") starting input buffer!"; errorText_ = errorStream_.str(); goto unlock; } } handle->drainCounter = 0; handle->internalDrain = false; ResetEvent( handle->condition ); stream_.state = STREAM_RUNNING; unlock: if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR ); } void RtApiDs :: stopStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiDs::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } HRESULT result = 0; LPVOID audioPtr; DWORD dataLen; DsHandle *handle = (DsHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( handle->drainCounter == 0 ) { handle->drainCounter = 2; WaitForSingleObject( handle->condition, INFINITE ); // block until signaled } stream_.state = STREAM_STOPPED; // Stop the buffer and clear memory LPDIRECTSOUNDBUFFER buffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; result = buffer->Stop(); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") stopping output buffer!"; errorText_ = errorStream_.str(); goto unlock; } // Lock the buffer and clear it so that if we start to play again, // we won't have old data playing. result = buffer->Lock( 0, handle->dsBufferSize[0], &audioPtr, &dataLen, NULL, NULL, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") locking output buffer!"; errorText_ = errorStream_.str(); goto unlock; } // Zero the DS buffer ZeroMemory( audioPtr, dataLen ); // Unlock the DS buffer result = buffer->Unlock( audioPtr, dataLen, NULL, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") unlocking output buffer!"; errorText_ = errorStream_.str(); goto unlock; } // If we start playing again, we must begin at beginning of buffer. handle->bufferPointer[0] = 0; } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { LPDIRECTSOUNDCAPTUREBUFFER buffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; audioPtr = NULL; dataLen = 0; stream_.state = STREAM_STOPPED; result = buffer->Stop(); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") stopping input buffer!"; errorText_ = errorStream_.str(); goto unlock; } // Lock the buffer and clear it so that if we start to play again, // we won't have old data playing. result = buffer->Lock( 0, handle->dsBufferSize[1], &audioPtr, &dataLen, NULL, NULL, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") locking input buffer!"; errorText_ = errorStream_.str(); goto unlock; } // Zero the DS buffer ZeroMemory( audioPtr, dataLen ); // Unlock the DS buffer result = buffer->Unlock( audioPtr, dataLen, NULL, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::stopStream: error (" << getErrorString( result ) << ") unlocking input buffer!"; errorText_ = errorStream_.str(); goto unlock; } // If we start recording again, we must begin at beginning of buffer. handle->bufferPointer[1] = 0; } unlock: timeEndPeriod( 1 ); // revert to normal scheduler frequency on lesser windows. if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR ); } void RtApiDs :: abortStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiDs::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } DsHandle *handle = (DsHandle *) stream_.apiHandle; handle->drainCounter = 2; stopStream(); } void RtApiDs :: callbackEvent() { if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) { Sleep( 50 ); // sleep 50 milliseconds return; } if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiDs::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return; } CallbackInfo *info = (CallbackInfo *) &stream_.callbackInfo; DsHandle *handle = (DsHandle *) stream_.apiHandle; // Check if we were draining the stream and signal is finished. if ( handle->drainCounter > stream_.nBuffers + 2 ) { stream_.state = STREAM_STOPPING; if ( handle->internalDrain == false ) SetEvent( handle->condition ); else stopStream(); return; } // Invoke user callback to get fresh output data UNLESS we are // draining stream. if ( handle->drainCounter == 0 ) { RtAudioCallback callback = (RtAudioCallback) info->callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && handle->xrun[0] == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; handle->xrun[0] = false; } if ( stream_.mode != OUTPUT && handle->xrun[1] == true ) { status |= RTAUDIO_INPUT_OVERFLOW; handle->xrun[1] = false; } int cbReturnValue = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, info->userData ); if ( cbReturnValue == 2 ) { stream_.state = STREAM_STOPPING; handle->drainCounter = 2; abortStream(); return; } else if ( cbReturnValue == 1 ) { handle->drainCounter = 1; handle->internalDrain = true; } } HRESULT result; DWORD currentWritePointer, safeWritePointer; DWORD currentReadPointer, safeReadPointer; UINT nextWritePointer; LPVOID buffer1 = NULL; LPVOID buffer2 = NULL; DWORD bufferSize1 = 0; DWORD bufferSize2 = 0; char *buffer; long bufferBytes; if ( buffersRolling == false ) { if ( stream_.mode == DUPLEX ) { //assert( handle->dsBufferSize[0] == handle->dsBufferSize[1] ); // It takes a while for the devices to get rolling. As a result, // there's no guarantee that the capture and write device pointers // will move in lockstep. Wait here for both devices to start // rolling, and then set our buffer pointers accordingly. // e.g. Crystal Drivers: the capture buffer starts up 5700 to 9600 // bytes later than the write buffer. // Stub: a serious risk of having a pre-emptive scheduling round // take place between the two GetCurrentPosition calls... but I'm // really not sure how to solve the problem. Temporarily boost to // Realtime priority, maybe; but I'm not sure what priority the // DirectSound service threads run at. We *should* be roughly // within a ms or so of correct. LPDIRECTSOUNDBUFFER dsWriteBuffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; LPDIRECTSOUNDCAPTUREBUFFER dsCaptureBuffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; DWORD startSafeWritePointer, startSafeReadPointer; result = dsWriteBuffer->GetCurrentPosition( NULL, &startSafeWritePointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } result = dsCaptureBuffer->GetCurrentPosition( NULL, &startSafeReadPointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } while ( true ) { result = dsWriteBuffer->GetCurrentPosition( NULL, &safeWritePointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } result = dsCaptureBuffer->GetCurrentPosition( NULL, &safeReadPointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } if ( safeWritePointer != startSafeWritePointer && safeReadPointer != startSafeReadPointer ) break; Sleep( 1 ); } //assert( handle->dsBufferSize[0] == handle->dsBufferSize[1] ); handle->bufferPointer[0] = safeWritePointer + handle->dsPointerLeadTime[0]; if ( handle->bufferPointer[0] >= handle->dsBufferSize[0] ) handle->bufferPointer[0] -= handle->dsBufferSize[0]; handle->bufferPointer[1] = safeReadPointer; } else if ( stream_.mode == OUTPUT ) { // Set the proper nextWritePosition after initial startup. LPDIRECTSOUNDBUFFER dsWriteBuffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; result = dsWriteBuffer->GetCurrentPosition( ¤tWritePointer, &safeWritePointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } handle->bufferPointer[0] = safeWritePointer + handle->dsPointerLeadTime[0]; if ( handle->bufferPointer[0] >= handle->dsBufferSize[0] ) handle->bufferPointer[0] -= handle->dsBufferSize[0]; } buffersRolling = true; } if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { LPDIRECTSOUNDBUFFER dsBuffer = (LPDIRECTSOUNDBUFFER) handle->buffer[0]; if ( handle->drainCounter > 1 ) { // write zeros to the output stream bufferBytes = stream_.bufferSize * stream_.nUserChannels[0]; bufferBytes *= formatBytes( stream_.userFormat ); memset( stream_.userBuffer[0], 0, bufferBytes ); } // Setup parameters and do buffer conversion if necessary. if ( stream_.doConvertBuffer[0] ) { buffer = stream_.deviceBuffer; convertBuffer( buffer, stream_.userBuffer[0], stream_.convertInfo[0] ); bufferBytes = stream_.bufferSize * stream_.nDeviceChannels[0]; bufferBytes *= formatBytes( stream_.deviceFormat[0] ); } else { buffer = stream_.userBuffer[0]; bufferBytes = stream_.bufferSize * stream_.nUserChannels[0]; bufferBytes *= formatBytes( stream_.userFormat ); } // No byte swapping necessary in DirectSound implementation. // Ahhh ... windoze. 16-bit data is signed but 8-bit data is // unsigned. So, we need to convert our signed 8-bit data here to // unsigned. if ( stream_.deviceFormat[0] == RTAUDIO_SINT8 ) for ( int i=0; idsBufferSize[0]; nextWritePointer = handle->bufferPointer[0]; DWORD endWrite, leadPointer; while ( true ) { // Find out where the read and "safe write" pointers are. result = dsBuffer->GetCurrentPosition( ¤tWritePointer, &safeWritePointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } // We will copy our output buffer into the region between // safeWritePointer and leadPointer. If leadPointer is not // beyond the next endWrite position, wait until it is. leadPointer = safeWritePointer + handle->dsPointerLeadTime[0]; //std::cout << "safeWritePointer = " << safeWritePointer << ", leadPointer = " << leadPointer << ", nextWritePointer = " << nextWritePointer << std::endl; if ( leadPointer > dsBufferSize ) leadPointer -= dsBufferSize; if ( leadPointer < nextWritePointer ) leadPointer += dsBufferSize; // unwrap offset endWrite = nextWritePointer + bufferBytes; // Check whether the entire write region is behind the play pointer. if ( leadPointer >= endWrite ) break; // If we are here, then we must wait until the leadPointer advances // beyond the end of our next write region. We use the // Sleep() function to suspend operation until that happens. double millis = ( endWrite - leadPointer ) * 1000.0; millis /= ( formatBytes( stream_.deviceFormat[0]) * stream_.nDeviceChannels[0] * stream_.sampleRate); if ( millis < 1.0 ) millis = 1.0; Sleep( (DWORD) millis ); } if ( dsPointerBetween( nextWritePointer, safeWritePointer, currentWritePointer, dsBufferSize ) || dsPointerBetween( endWrite, safeWritePointer, currentWritePointer, dsBufferSize ) ) { // We've strayed into the forbidden zone ... resync the read pointer. handle->xrun[0] = true; nextWritePointer = safeWritePointer + handle->dsPointerLeadTime[0] - bufferBytes; if ( nextWritePointer >= dsBufferSize ) nextWritePointer -= dsBufferSize; handle->bufferPointer[0] = nextWritePointer; endWrite = nextWritePointer + bufferBytes; } // Lock free space in the buffer result = dsBuffer->Lock( nextWritePointer, bufferBytes, &buffer1, &bufferSize1, &buffer2, &bufferSize2, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking buffer during playback!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } // Copy our buffer into the DS buffer CopyMemory( buffer1, buffer, bufferSize1 ); if ( buffer2 != NULL ) CopyMemory( buffer2, buffer+bufferSize1, bufferSize2 ); // Update our buffer offset and unlock sound buffer dsBuffer->Unlock( buffer1, bufferSize1, buffer2, bufferSize2 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking buffer during playback!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } nextWritePointer = ( nextWritePointer + bufferSize1 + bufferSize2 ) % dsBufferSize; handle->bufferPointer[0] = nextWritePointer; if ( handle->drainCounter ) { handle->drainCounter++; goto unlock; } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { // Setup parameters. if ( stream_.doConvertBuffer[1] ) { buffer = stream_.deviceBuffer; bufferBytes = stream_.bufferSize * stream_.nDeviceChannels[1]; bufferBytes *= formatBytes( stream_.deviceFormat[1] ); } else { buffer = stream_.userBuffer[1]; bufferBytes = stream_.bufferSize * stream_.nUserChannels[1]; bufferBytes *= formatBytes( stream_.userFormat ); } LPDIRECTSOUNDCAPTUREBUFFER dsBuffer = (LPDIRECTSOUNDCAPTUREBUFFER) handle->buffer[1]; long nextReadPointer = handle->bufferPointer[1]; DWORD dsBufferSize = handle->dsBufferSize[1]; // Find out where the write and "safe read" pointers are. result = dsBuffer->GetCurrentPosition( ¤tReadPointer, &safeReadPointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } if ( safeReadPointer < (DWORD)nextReadPointer ) safeReadPointer += dsBufferSize; // unwrap offset DWORD endRead = nextReadPointer + bufferBytes; // Handling depends on whether we are INPUT or DUPLEX. // If we're in INPUT mode then waiting is a good thing. If we're in DUPLEX mode, // then a wait here will drag the write pointers into the forbidden zone. // // In DUPLEX mode, rather than wait, we will back off the read pointer until // it's in a safe position. This causes dropouts, but it seems to be the only // practical way to sync up the read and write pointers reliably, given the // the very complex relationship between phase and increment of the read and write // pointers. // // In order to minimize audible dropouts in DUPLEX mode, we will // provide a pre-roll period of 0.5 seconds in which we return // zeros from the read buffer while the pointers sync up. if ( stream_.mode == DUPLEX ) { if ( safeReadPointer < endRead ) { if ( duplexPrerollBytes <= 0 ) { // Pre-roll time over. Be more agressive. int adjustment = endRead-safeReadPointer; handle->xrun[1] = true; // Two cases: // - large adjustments: we've probably run out of CPU cycles, so just resync exactly, // and perform fine adjustments later. // - small adjustments: back off by twice as much. if ( adjustment >= 2*bufferBytes ) nextReadPointer = safeReadPointer-2*bufferBytes; else nextReadPointer = safeReadPointer-bufferBytes-adjustment; if ( nextReadPointer < 0 ) nextReadPointer += dsBufferSize; } else { // In pre=roll time. Just do it. nextReadPointer = safeReadPointer - bufferBytes; while ( nextReadPointer < 0 ) nextReadPointer += dsBufferSize; } endRead = nextReadPointer + bufferBytes; } } else { // mode == INPUT while ( safeReadPointer < endRead && stream_.callbackInfo.isRunning ) { // See comments for playback. double millis = (endRead - safeReadPointer) * 1000.0; millis /= ( formatBytes(stream_.deviceFormat[1]) * stream_.nDeviceChannels[1] * stream_.sampleRate); if ( millis < 1.0 ) millis = 1.0; Sleep( (DWORD) millis ); // Wake up and find out where we are now. result = dsBuffer->GetCurrentPosition( ¤tReadPointer, &safeReadPointer ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } if ( safeReadPointer < (DWORD)nextReadPointer ) safeReadPointer += dsBufferSize; // unwrap offset } } // Lock free space in the buffer result = dsBuffer->Lock( nextReadPointer, bufferBytes, &buffer1, &bufferSize1, &buffer2, &bufferSize2, 0 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking capture buffer!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } if ( duplexPrerollBytes <= 0 ) { // Copy our buffer into the DS buffer CopyMemory( buffer, buffer1, bufferSize1 ); if ( buffer2 != NULL ) CopyMemory( buffer+bufferSize1, buffer2, bufferSize2 ); } else { memset( buffer, 0, bufferSize1 ); if ( buffer2 != NULL ) memset( buffer + bufferSize1, 0, bufferSize2 ); duplexPrerollBytes -= bufferSize1 + bufferSize2; } // Update our buffer offset and unlock sound buffer nextReadPointer = ( nextReadPointer + bufferSize1 + bufferSize2 ) % dsBufferSize; dsBuffer->Unlock( buffer1, bufferSize1, buffer2, bufferSize2 ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking capture buffer!"; errorText_ = errorStream_.str(); error( RtError::SYSTEM_ERROR ); return; } handle->bufferPointer[1] = nextReadPointer; // No byte swapping necessary in DirectSound implementation. // If necessary, convert 8-bit data from unsigned to signed. if ( stream_.deviceFormat[1] == RTAUDIO_SINT8 ) for ( int j=0; jobject; bool* isRunning = &info->isRunning; while ( *isRunning == true ) { object->callbackEvent(); } _endthreadex( 0 ); return 0; } #include "tchar.h" static std::string convertTChar( LPCTSTR name ) { #if defined( UNICODE ) || defined( _UNICODE ) int length = WideCharToMultiByte(CP_UTF8, 0, name, -1, NULL, 0, NULL, NULL); std::string s( length-1, '\0' ); WideCharToMultiByte(CP_UTF8, 0, name, -1, &s[0], length, NULL, NULL); #else std::string s( name ); #endif return s; } static BOOL CALLBACK deviceQueryCallback( LPGUID lpguid, LPCTSTR description, LPCTSTR module, LPVOID lpContext ) { struct DsProbeData& probeInfo = *(struct DsProbeData*) lpContext; std::vector& dsDevices = *probeInfo.dsDevices; HRESULT hr; bool validDevice = false; if ( probeInfo.isInput == true ) { DSCCAPS caps; LPDIRECTSOUNDCAPTURE object; hr = DirectSoundCaptureCreate( lpguid, &object, NULL ); if ( hr != DS_OK ) return TRUE; caps.dwSize = sizeof(caps); hr = object->GetCaps( &caps ); if ( hr == DS_OK ) { if ( caps.dwChannels > 0 && caps.dwFormats > 0 ) validDevice = true; } object->Release(); } else { DSCAPS caps; LPDIRECTSOUND object; hr = DirectSoundCreate( lpguid, &object, NULL ); if ( hr != DS_OK ) return TRUE; caps.dwSize = sizeof(caps); hr = object->GetCaps( &caps ); if ( hr == DS_OK ) { if ( caps.dwFlags & DSCAPS_PRIMARYMONO || caps.dwFlags & DSCAPS_PRIMARYSTEREO ) validDevice = true; } object->Release(); } // If good device, then save its name and guid. std::string name = convertTChar( description ); //if ( name == "Primary Sound Driver" || name == "Primary Sound Capture Driver" ) if ( lpguid == NULL ) name = "Default Device"; if ( validDevice ) { for ( unsigned int i=0; i #include // A structure to hold various information related to the ALSA API // implementation. struct AlsaHandle { snd_pcm_t *handles[2]; bool synchronized; bool xrun[2]; pthread_cond_t runnable_cv; bool runnable; AlsaHandle() :synchronized(false), runnable(false) { xrun[0] = false; xrun[1] = false; } }; static void *alsaCallbackHandler( void * ptr ); RtApiAlsa :: RtApiAlsa() { // Nothing to do here. } RtApiAlsa :: ~RtApiAlsa() { if ( stream_.state != STREAM_CLOSED ) closeStream(); } unsigned int RtApiAlsa :: getDeviceCount( void ) { unsigned nDevices = 0; int result, subdevice, card; char name[64]; snd_ctl_t *handle; // Count cards and devices card = -1; snd_card_next( &card ); while ( card >= 0 ) { sprintf( name, "hw:%d", card ); result = snd_ctl_open( &handle, name, 0 ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceCount: control open, card = " << card << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto nextcard; } subdevice = -1; while( 1 ) { result = snd_ctl_pcm_next_device( handle, &subdevice ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceCount: control next device, card = " << card << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); break; } if ( subdevice < 0 ) break; nDevices++; } nextcard: snd_ctl_close( handle ); snd_card_next( &card ); } result = snd_ctl_open( &handle, "default", 0 ); if (result == 0) { nDevices++; snd_ctl_close( handle ); } return nDevices; } RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; info.probed = false; unsigned nDevices = 0; int result, subdevice, card; char name[64]; snd_ctl_t *chandle; // Count cards and devices card = -1; snd_card_next( &card ); while ( card >= 0 ) { sprintf( name, "hw:%d", card ); result = snd_ctl_open( &chandle, name, SND_CTL_NONBLOCK ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceInfo: control open, card = " << card << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto nextcard; } subdevice = -1; while( 1 ) { result = snd_ctl_pcm_next_device( chandle, &subdevice ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceInfo: control next device, card = " << card << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); break; } if ( subdevice < 0 ) break; if ( nDevices == device ) { sprintf( name, "hw:%d,%d", card, subdevice ); goto foundDevice; } nDevices++; } nextcard: snd_ctl_close( chandle ); snd_card_next( &card ); } result = snd_ctl_open( &chandle, "default", SND_CTL_NONBLOCK ); if ( result == 0 ) { if ( nDevices == device ) { strcpy( name, "default" ); goto foundDevice; } nDevices++; } if ( nDevices == 0 ) { errorText_ = "RtApiAlsa::getDeviceInfo: no devices found!"; error( RtError::INVALID_USE ); return info; } if ( device >= nDevices ) { errorText_ = "RtApiAlsa::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } foundDevice: // If a stream is already open, we cannot probe the stream devices. // Thus, use the saved results. if ( stream_.state != STREAM_CLOSED && ( stream_.device[0] == device || stream_.device[1] == device ) ) { snd_ctl_close( chandle ); if ( device >= devices_.size() ) { errorText_ = "RtApiAlsa::getDeviceInfo: device ID was not present before stream was opened."; error( RtError::WARNING ); return info; } return devices_[ device ]; } int openMode = SND_PCM_ASYNC; snd_pcm_stream_t stream; snd_pcm_info_t *pcminfo; snd_pcm_info_alloca( &pcminfo ); snd_pcm_t *phandle; snd_pcm_hw_params_t *params; snd_pcm_hw_params_alloca( ¶ms ); // First try for playback unless default device (which has subdev -1) stream = SND_PCM_STREAM_PLAYBACK; snd_pcm_info_set_stream( pcminfo, stream ); if ( subdevice != -1 ) { snd_pcm_info_set_device( pcminfo, subdevice ); snd_pcm_info_set_subdevice( pcminfo, 0 ); result = snd_ctl_pcm_info( chandle, pcminfo ); if ( result < 0 ) { // Device probably doesn't support playback. goto captureProbe; } } result = snd_pcm_open( &phandle, name, stream, openMode | SND_PCM_NONBLOCK ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto captureProbe; } // The device is open ... fill the parameter structure. result = snd_pcm_hw_params_any( phandle, params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto captureProbe; } // Get output channel information. unsigned int value; result = snd_pcm_hw_params_get_channels_max( params, &value ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") output channels, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); goto captureProbe; } info.outputChannels = value; snd_pcm_close( phandle ); captureProbe: stream = SND_PCM_STREAM_CAPTURE; snd_pcm_info_set_stream( pcminfo, stream ); // Now try for capture unless default device (with subdev = -1) if ( subdevice != -1 ) { result = snd_ctl_pcm_info( chandle, pcminfo ); snd_ctl_close( chandle ); if ( result < 0 ) { // Device probably doesn't support capture. if ( info.outputChannels == 0 ) return info; goto probeParameters; } } result = snd_pcm_open( &phandle, name, stream, openMode | SND_PCM_NONBLOCK); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); if ( info.outputChannels == 0 ) return info; goto probeParameters; } // The device is open ... fill the parameter structure. result = snd_pcm_hw_params_any( phandle, params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); if ( info.outputChannels == 0 ) return info; goto probeParameters; } result = snd_pcm_hw_params_get_channels_max( params, &value ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") input channels, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); if ( info.outputChannels == 0 ) return info; goto probeParameters; } info.inputChannels = value; snd_pcm_close( phandle ); // If device opens for both playback and capture, we determine the channels. if ( info.outputChannels > 0 && info.inputChannels > 0 ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; // ALSA doesn't provide default devices so we'll use the first available one. if ( device == 0 && info.outputChannels > 0 ) info.isDefaultOutput = true; if ( device == 0 && info.inputChannels > 0 ) info.isDefaultInput = true; probeParameters: // At this point, we just need to figure out the supported data // formats and sample rates. We'll proceed by opening the device in // the direction with the maximum number of channels, or playback if // they are equal. This might limit our sample rate options, but so // be it. if ( info.outputChannels >= info.inputChannels ) stream = SND_PCM_STREAM_PLAYBACK; else stream = SND_PCM_STREAM_CAPTURE; snd_pcm_info_set_stream( pcminfo, stream ); result = snd_pcm_open( &phandle, name, stream, openMode | SND_PCM_NONBLOCK); if ( result < 0 ) { errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // The device is open ... fill the parameter structure. result = snd_pcm_hw_params_any( phandle, params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Test our discrete set of sample rate values. info.sampleRates.clear(); for ( unsigned int i=0; i= 0 ) sprintf( name, "hw:%s,%d", cardname, subdevice ); info.name = name; // That's all ... close the device and return snd_pcm_close( phandle ); info.probed = true; return info; } void RtApiAlsa :: saveDeviceInfo( void ) { devices_.clear(); unsigned int nDevices = getDeviceCount(); devices_.resize( nDevices ); for ( unsigned int i=0; iflags & RTAUDIO_ALSA_USE_DEFAULT ) snprintf(name, sizeof(name), "%s", "default"); else { // Count cards and devices card = -1; snd_card_next( &card ); while ( card >= 0 ) { sprintf( name, "hw:%d", card ); result = snd_ctl_open( &chandle, name, SND_CTL_NONBLOCK ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::probeDeviceOpen: control open, card = " << card << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } subdevice = -1; while( 1 ) { result = snd_ctl_pcm_next_device( chandle, &subdevice ); if ( result < 0 ) break; if ( subdevice < 0 ) break; if ( nDevices == device ) { sprintf( name, "hw:%d,%d", card, subdevice ); snd_ctl_close( chandle ); goto foundDevice; } nDevices++; } snd_ctl_close( chandle ); snd_card_next( &card ); } result = snd_ctl_open( &chandle, "default", SND_CTL_NONBLOCK ); if ( result == 0 ) { if ( nDevices == device ) { strcpy( name, "default" ); goto foundDevice; } nDevices++; } if ( nDevices == 0 ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiAlsa::probeDeviceOpen: no devices found!"; return FAILURE; } if ( device >= nDevices ) { // This should not happen because a check is made before this function is called. errorText_ = "RtApiAlsa::probeDeviceOpen: device ID is invalid!"; return FAILURE; } } foundDevice: // The getDeviceInfo() function will not work for a device that is // already open. Thus, we'll probe the system before opening a // stream and save the results for use by getDeviceInfo(). if ( mode == OUTPUT || ( mode == INPUT && stream_.mode != OUTPUT ) ) // only do once this->saveDeviceInfo(); snd_pcm_stream_t stream; if ( mode == OUTPUT ) stream = SND_PCM_STREAM_PLAYBACK; else stream = SND_PCM_STREAM_CAPTURE; snd_pcm_t *phandle; int openMode = SND_PCM_ASYNC; result = snd_pcm_open( &phandle, name, stream, openMode ); if ( result < 0 ) { if ( mode == OUTPUT ) errorStream_ << "RtApiAlsa::probeDeviceOpen: pcm device (" << name << ") won't open for output."; else errorStream_ << "RtApiAlsa::probeDeviceOpen: pcm device (" << name << ") won't open for input."; errorText_ = errorStream_.str(); return FAILURE; } // Fill the parameter structure. snd_pcm_hw_params_t *hw_params; snd_pcm_hw_params_alloca( &hw_params ); result = snd_pcm_hw_params_any( phandle, hw_params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error getting pcm device (" << name << ") parameters, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } #if defined(__RTAUDIO_DEBUG__) fprintf( stderr, "\nRtApiAlsa: dump hardware params just after device open:\n\n" ); snd_pcm_hw_params_dump( hw_params, out ); #endif // Set access ... check user preference. if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) { stream_.userInterleaved = false; result = snd_pcm_hw_params_set_access( phandle, hw_params, SND_PCM_ACCESS_RW_NONINTERLEAVED ); if ( result < 0 ) { result = snd_pcm_hw_params_set_access( phandle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED ); stream_.deviceInterleaved[mode] = true; } else stream_.deviceInterleaved[mode] = false; } else { stream_.userInterleaved = true; result = snd_pcm_hw_params_set_access( phandle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED ); if ( result < 0 ) { result = snd_pcm_hw_params_set_access( phandle, hw_params, SND_PCM_ACCESS_RW_NONINTERLEAVED ); stream_.deviceInterleaved[mode] = false; } else stream_.deviceInterleaved[mode] = true; } if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting pcm device (" << name << ") access, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } // Determine how to set the device format. stream_.userFormat = format; snd_pcm_format_t deviceFormat = SND_PCM_FORMAT_UNKNOWN; if ( format == RTAUDIO_SINT8 ) deviceFormat = SND_PCM_FORMAT_S8; else if ( format == RTAUDIO_SINT16 ) deviceFormat = SND_PCM_FORMAT_S16; else if ( format == RTAUDIO_SINT24 ) deviceFormat = SND_PCM_FORMAT_S24; else if ( format == RTAUDIO_SINT32 ) deviceFormat = SND_PCM_FORMAT_S32; else if ( format == RTAUDIO_FLOAT32 ) deviceFormat = SND_PCM_FORMAT_FLOAT; else if ( format == RTAUDIO_FLOAT64 ) deviceFormat = SND_PCM_FORMAT_FLOAT64; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat) == 0) { stream_.deviceFormat[mode] = format; goto setFormat; } // The user requested format is not natively supported by the device. deviceFormat = SND_PCM_FORMAT_FLOAT64; if ( snd_pcm_hw_params_test_format( phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_FLOAT64; goto setFormat; } deviceFormat = SND_PCM_FORMAT_FLOAT; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_FLOAT32; goto setFormat; } deviceFormat = SND_PCM_FORMAT_S32; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_SINT32; goto setFormat; } deviceFormat = SND_PCM_FORMAT_S24; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_SINT24; goto setFormat; } deviceFormat = SND_PCM_FORMAT_S16; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_SINT16; goto setFormat; } deviceFormat = SND_PCM_FORMAT_S8; if ( snd_pcm_hw_params_test_format(phandle, hw_params, deviceFormat ) == 0 ) { stream_.deviceFormat[mode] = RTAUDIO_SINT8; goto setFormat; } // If we get here, no supported format was found. snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: pcm device " << device << " data format not supported by RtAudio."; errorText_ = errorStream_.str(); return FAILURE; setFormat: result = snd_pcm_hw_params_set_format( phandle, hw_params, deviceFormat ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting pcm device (" << name << ") data format, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } // Determine whether byte-swaping is necessary. stream_.doByteSwap[mode] = false; if ( deviceFormat != SND_PCM_FORMAT_S8 ) { result = snd_pcm_format_cpu_endian( deviceFormat ); if ( result == 0 ) stream_.doByteSwap[mode] = true; else if (result < 0) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error getting pcm device (" << name << ") endian-ness, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } } // Set the sample rate. result = snd_pcm_hw_params_set_rate_near( phandle, hw_params, (unsigned int*) &sampleRate, 0 ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting sample rate on device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } // Determine the number of channels for this device. We support a possible // minimum device channel number > than the value requested by the user. stream_.nUserChannels[mode] = channels; unsigned int value; result = snd_pcm_hw_params_get_channels_max( hw_params, &value ); unsigned int deviceChannels = value; if ( result < 0 || deviceChannels < channels + firstChannel ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: requested channel parameters not supported by device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } result = snd_pcm_hw_params_get_channels_min( hw_params, &value ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error getting minimum channels for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } deviceChannels = value; if ( deviceChannels < channels + firstChannel ) deviceChannels = channels + firstChannel; stream_.nDeviceChannels[mode] = deviceChannels; // Set the device channels. result = snd_pcm_hw_params_set_channels( phandle, hw_params, deviceChannels ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting channels for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } // Set the buffer (or period) size. int dir = 0; snd_pcm_uframes_t periodSize = *bufferSize; result = snd_pcm_hw_params_set_period_size_near( phandle, hw_params, &periodSize, &dir ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting period size for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } *bufferSize = periodSize; // Set the buffer number, which in ALSA is referred to as the "period". unsigned int periods = 0; if ( options && options->flags & RTAUDIO_MINIMIZE_LATENCY ) periods = 2; if ( options && options->numberOfBuffers > 0 ) periods = options->numberOfBuffers; if ( periods < 2 ) periods = 4; // a fairly safe default value result = snd_pcm_hw_params_set_periods_near( phandle, hw_params, &periods, &dir ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error setting periods for device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } // If attempting to setup a duplex stream, the bufferSize parameter // MUST be the same in both directions! if ( stream_.mode == OUTPUT && mode == INPUT && *bufferSize != stream_.bufferSize ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: system error setting buffer size for duplex stream on device (" << name << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.bufferSize = *bufferSize; // Install the hardware configuration result = snd_pcm_hw_params( phandle, hw_params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error installing hardware configuration on device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } #if defined(__RTAUDIO_DEBUG__) fprintf(stderr, "\nRtApiAlsa: dump hardware params after installation:\n\n"); snd_pcm_hw_params_dump( hw_params, out ); #endif // Set the software configuration to fill buffers with zeros and prevent device stopping on xruns. snd_pcm_sw_params_t *sw_params = NULL; snd_pcm_sw_params_alloca( &sw_params ); snd_pcm_sw_params_current( phandle, sw_params ); snd_pcm_sw_params_set_start_threshold( phandle, sw_params, *bufferSize ); snd_pcm_sw_params_set_stop_threshold( phandle, sw_params, ULONG_MAX ); snd_pcm_sw_params_set_silence_threshold( phandle, sw_params, 0 ); // The following two settings were suggested by Theo Veenker //snd_pcm_sw_params_set_avail_min( phandle, sw_params, *bufferSize ); //snd_pcm_sw_params_set_xfer_align( phandle, sw_params, 1 ); // here are two options for a fix //snd_pcm_sw_params_set_silence_size( phandle, sw_params, ULONG_MAX ); snd_pcm_uframes_t val; snd_pcm_sw_params_get_boundary( sw_params, &val ); snd_pcm_sw_params_set_silence_size( phandle, sw_params, val ); result = snd_pcm_sw_params( phandle, sw_params ); if ( result < 0 ) { snd_pcm_close( phandle ); errorStream_ << "RtApiAlsa::probeDeviceOpen: error installing software configuration on device (" << name << "), " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); return FAILURE; } #if defined(__RTAUDIO_DEBUG__) fprintf(stderr, "\nRtApiAlsa: dump software params after installation:\n\n"); snd_pcm_sw_params_dump( sw_params, out ); #endif // Set flags for buffer conversion stream_.doConvertBuffer[mode] = false; if ( stream_.userFormat != stream_.deviceFormat[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.nUserChannels[mode] < stream_.nDeviceChannels[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.userInterleaved != stream_.deviceInterleaved[mode] && stream_.nUserChannels[mode] > 1 ) stream_.doConvertBuffer[mode] = true; // Allocate the ApiHandle if necessary and then save. AlsaHandle *apiInfo = 0; if ( stream_.apiHandle == 0 ) { try { apiInfo = (AlsaHandle *) new AlsaHandle; } catch ( std::bad_alloc& ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error allocating AlsaHandle memory."; goto error; } if ( pthread_cond_init( &apiInfo->runnable_cv, NULL ) ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error initializing pthread condition variable."; goto error; } stream_.apiHandle = (void *) apiInfo; apiInfo->handles[0] = 0; apiInfo->handles[1] = 0; } else { apiInfo = (AlsaHandle *) stream_.apiHandle; } apiInfo->handles[mode] = phandle; phandle = 0; // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error allocating user buffer memory."; goto error; } if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } stream_.sampleRate = sampleRate; stream_.nBuffers = periods; stream_.device[mode] = device; stream_.state = STREAM_STOPPED; // Setup the buffer conversion information structure. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, firstChannel ); // Setup thread if necessary. if ( stream_.mode == OUTPUT && mode == INPUT ) { // We had already set up an output stream. stream_.mode = DUPLEX; // Link the streams if possible. apiInfo->synchronized = false; if ( snd_pcm_link( apiInfo->handles[0], apiInfo->handles[1] ) == 0 ) apiInfo->synchronized = true; else { errorText_ = "RtApiAlsa::probeDeviceOpen: unable to synchronize input and output devices."; error( RtError::WARNING ); } } else { stream_.mode = mode; // Setup callback thread. stream_.callbackInfo.object = (void *) this; // Set the thread attributes for joinable and realtime scheduling // priority (optional). The higher priority will only take affect // if the program is run as root or suid. Note, under Linux // processes with CAP_SYS_NICE privilege, a user can change // scheduling policy and priority (thus need not be root). See // POSIX "capabilities". pthread_attr_t attr; pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); #ifdef SCHED_RR // Undefined with some OSes (eg: NetBSD 1.6.x with GNU Pthread) if ( options && options->flags & RTAUDIO_SCHEDULE_REALTIME ) { // We previously attempted to increase the audio callback priority // to SCHED_RR here via the attributes. However, while no errors // were reported in doing so, it did not work. So, now this is // done in the alsaCallbackHandler function. stream_.callbackInfo.doRealtime = true; int priority = options->priority; int min = sched_get_priority_min( SCHED_RR ); int max = sched_get_priority_max( SCHED_RR ); if ( priority < min ) priority = min; else if ( priority > max ) priority = max; stream_.callbackInfo.priority = priority; } #endif stream_.callbackInfo.isRunning = true; result = pthread_create( &stream_.callbackInfo.thread, &attr, alsaCallbackHandler, &stream_.callbackInfo ); pthread_attr_destroy( &attr ); if ( result ) { stream_.callbackInfo.isRunning = false; errorText_ = "RtApiAlsa::error creating callback thread!"; goto error; } } return SUCCESS; error: if ( apiInfo ) { pthread_cond_destroy( &apiInfo->runnable_cv ); if ( apiInfo->handles[0] ) snd_pcm_close( apiInfo->handles[0] ); if ( apiInfo->handles[1] ) snd_pcm_close( apiInfo->handles[1] ); delete apiInfo; stream_.apiHandle = 0; } if ( phandle) snd_pcm_close( phandle ); for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.state = STREAM_CLOSED; return FAILURE; } void RtApiAlsa :: closeStream() { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiAlsa::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle; stream_.callbackInfo.isRunning = false; MUTEX_LOCK( &stream_.mutex ); if ( stream_.state == STREAM_STOPPED ) { apiInfo->runnable = true; pthread_cond_signal( &apiInfo->runnable_cv ); } MUTEX_UNLOCK( &stream_.mutex ); pthread_join( stream_.callbackInfo.thread, NULL ); if ( stream_.state == STREAM_RUNNING ) { stream_.state = STREAM_STOPPED; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) snd_pcm_drop( apiInfo->handles[0] ); if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) snd_pcm_drop( apiInfo->handles[1] ); } if ( apiInfo ) { pthread_cond_destroy( &apiInfo->runnable_cv ); if ( apiInfo->handles[0] ) snd_pcm_close( apiInfo->handles[0] ); if ( apiInfo->handles[1] ) snd_pcm_close( apiInfo->handles[1] ); delete apiInfo; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } void RtApiAlsa :: startStream() { // This method calls snd_pcm_prepare if the device isn't already in that state. verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiAlsa::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } MUTEX_LOCK( &stream_.mutex ); int result = 0; snd_pcm_state_t state; AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle; snd_pcm_t **handle = (snd_pcm_t **) apiInfo->handles; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { state = snd_pcm_state( handle[0] ); if ( state != SND_PCM_STATE_PREPARED ) { result = snd_pcm_prepare( handle[0] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::startStream: error preparing output pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } } if ( ( stream_.mode == INPUT || stream_.mode == DUPLEX ) && !apiInfo->synchronized ) { state = snd_pcm_state( handle[1] ); if ( state != SND_PCM_STATE_PREPARED ) { result = snd_pcm_prepare( handle[1] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::startStream: error preparing input pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } } stream_.state = STREAM_RUNNING; unlock: apiInfo->runnable = true; pthread_cond_signal( &apiInfo->runnable_cv ); MUTEX_UNLOCK( &stream_.mutex ); if ( result >= 0 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiAlsa :: stopStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiAlsa::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } stream_.state = STREAM_STOPPED; MUTEX_LOCK( &stream_.mutex ); int result = 0; AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle; snd_pcm_t **handle = (snd_pcm_t **) apiInfo->handles; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( apiInfo->synchronized ) result = snd_pcm_drop( handle[0] ); else result = snd_pcm_drain( handle[0] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::stopStream: error draining output pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } if ( ( stream_.mode == INPUT || stream_.mode == DUPLEX ) && !apiInfo->synchronized ) { result = snd_pcm_drop( handle[1] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::stopStream: error stopping input pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } unlock: MUTEX_UNLOCK( &stream_.mutex ); if ( result >= 0 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiAlsa :: abortStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiAlsa::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } stream_.state = STREAM_STOPPED; MUTEX_LOCK( &stream_.mutex ); int result = 0; AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle; snd_pcm_t **handle = (snd_pcm_t **) apiInfo->handles; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { result = snd_pcm_drop( handle[0] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::abortStream: error aborting output pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } if ( ( stream_.mode == INPUT || stream_.mode == DUPLEX ) && !apiInfo->synchronized ) { result = snd_pcm_drop( handle[1] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::abortStream: error aborting input pcm device, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); goto unlock; } } unlock: MUTEX_UNLOCK( &stream_.mutex ); if ( result >= 0 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiAlsa :: callbackEvent() { AlsaHandle *apiInfo = (AlsaHandle *) stream_.apiHandle; if ( stream_.state == STREAM_STOPPED ) { MUTEX_LOCK( &stream_.mutex ); while ( !apiInfo->runnable ) pthread_cond_wait( &apiInfo->runnable_cv, &stream_.mutex ); if ( stream_.state != STREAM_RUNNING ) { MUTEX_UNLOCK( &stream_.mutex ); return; } MUTEX_UNLOCK( &stream_.mutex ); } if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiAlsa::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return; } int doStopStream = 0; RtAudioCallback callback = (RtAudioCallback) stream_.callbackInfo.callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && apiInfo->xrun[0] == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; apiInfo->xrun[0] = false; } if ( stream_.mode != OUTPUT && apiInfo->xrun[1] == true ) { status |= RTAUDIO_INPUT_OVERFLOW; apiInfo->xrun[1] = false; } doStopStream = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, stream_.callbackInfo.userData ); if ( doStopStream == 2 ) { abortStream(); return; } MUTEX_LOCK( &stream_.mutex ); // The state might change while waiting on a mutex. if ( stream_.state == STREAM_STOPPED ) goto unlock; int result; char *buffer; int channels; snd_pcm_t **handle; snd_pcm_sframes_t frames; RtAudioFormat format; handle = (snd_pcm_t **) apiInfo->handles; if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { // Setup parameters. if ( stream_.doConvertBuffer[1] ) { buffer = stream_.deviceBuffer; channels = stream_.nDeviceChannels[1]; format = stream_.deviceFormat[1]; } else { buffer = stream_.userBuffer[1]; channels = stream_.nUserChannels[1]; format = stream_.userFormat; } // Read samples from device in interleaved/non-interleaved format. if ( stream_.deviceInterleaved[1] ) result = snd_pcm_readi( handle[1], buffer, stream_.bufferSize ); else { void *bufs[channels]; size_t offset = stream_.bufferSize * formatBytes( format ); for ( int i=0; ixrun[1] = true; result = snd_pcm_prepare( handle[1] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::callbackEvent: error preparing device after overrun, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } } else { errorStream_ << "RtApiAlsa::callbackEvent: error, current state is " << snd_pcm_state_name( state ) << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } } else { errorStream_ << "RtApiAlsa::callbackEvent: audio read error, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } error( RtError::WARNING ); goto tryOutput; } // Do byte swapping if necessary. if ( stream_.doByteSwap[1] ) byteSwapBuffer( buffer, stream_.bufferSize * channels, format ); // Do buffer conversion if necessary. if ( stream_.doConvertBuffer[1] ) convertBuffer( stream_.userBuffer[1], stream_.deviceBuffer, stream_.convertInfo[1] ); // Check stream latency result = snd_pcm_delay( handle[1], &frames ); if ( result == 0 && frames > 0 ) stream_.latency[1] = frames; } tryOutput: if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { // Setup parameters and do buffer conversion if necessary. if ( stream_.doConvertBuffer[0] ) { buffer = stream_.deviceBuffer; convertBuffer( buffer, stream_.userBuffer[0], stream_.convertInfo[0] ); channels = stream_.nDeviceChannels[0]; format = stream_.deviceFormat[0]; } else { buffer = stream_.userBuffer[0]; channels = stream_.nUserChannels[0]; format = stream_.userFormat; } // Do byte swapping if necessary. if ( stream_.doByteSwap[0] ) byteSwapBuffer(buffer, stream_.bufferSize * channels, format); // Write samples to device in interleaved/non-interleaved format. if ( stream_.deviceInterleaved[0] ) result = snd_pcm_writei( handle[0], buffer, stream_.bufferSize ); else { void *bufs[channels]; size_t offset = stream_.bufferSize * formatBytes( format ); for ( int i=0; ixrun[0] = true; result = snd_pcm_prepare( handle[0] ); if ( result < 0 ) { errorStream_ << "RtApiAlsa::callbackEvent: error preparing device after underrun, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } } else { errorStream_ << "RtApiAlsa::callbackEvent: error, current state is " << snd_pcm_state_name( state ) << ", " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } } else { errorStream_ << "RtApiAlsa::callbackEvent: audio write error, " << snd_strerror( result ) << "."; errorText_ = errorStream_.str(); } error( RtError::WARNING ); goto unlock; } // Check stream latency result = snd_pcm_delay( handle[0], &frames ); if ( result == 0 && frames > 0 ) stream_.latency[0] = frames; } unlock: MUTEX_UNLOCK( &stream_.mutex ); RtApi::tickStreamTime(); if ( doStopStream == 1 ) this->stopStream(); } static void *alsaCallbackHandler( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiAlsa *object = (RtApiAlsa *) info->object; bool *isRunning = &info->isRunning; #ifdef SCHED_RR // Undefined with some OSes (eg: NetBSD 1.6.x with GNU Pthread) if ( &info->doRealtime ) { pthread_t tID = pthread_self(); // ID of this thread sched_param prio = { info->priority }; // scheduling priority of thread pthread_setschedparam( tID, SCHED_RR, &prio ); } #endif while ( *isRunning == true ) { pthread_testcancel(); object->callbackEvent(); } pthread_exit( NULL ); } //******************** End of __LINUX_ALSA__ *********************// #endif #if defined(__LINUX_PULSE__) // Code written by Peter Meerwald, pmeerw@pmeerw.net // and Tristan Matthews. #include #include #include static const unsigned int SUPPORTED_SAMPLERATES[] = { 8000, 16000, 22050, 32000, 44100, 48000, 96000, 0}; struct rtaudio_pa_format_mapping_t { RtAudioFormat rtaudio_format; pa_sample_format_t pa_format; }; static const rtaudio_pa_format_mapping_t supported_sampleformats[] = { {RTAUDIO_SINT16, PA_SAMPLE_S16LE}, {RTAUDIO_SINT32, PA_SAMPLE_S32LE}, {RTAUDIO_FLOAT32, PA_SAMPLE_FLOAT32LE}, {0, PA_SAMPLE_INVALID}}; struct PulseAudioHandle { pa_simple *s_play; pa_simple *s_rec; pthread_t thread; pthread_cond_t runnable_cv; bool runnable; PulseAudioHandle() : s_play(0), s_rec(0), runnable(false) { } }; RtApiPulse::~RtApiPulse() { if ( stream_.state != STREAM_CLOSED ) closeStream(); } unsigned int RtApiPulse::getDeviceCount( void ) { return 1; } RtAudio::DeviceInfo RtApiPulse::getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; info.probed = true; info.name = "PulseAudio"; info.outputChannels = 2; info.inputChannels = 2; info.duplexChannels = 2; info.isDefaultOutput = true; info.isDefaultInput = true; for ( const unsigned int *sr = SUPPORTED_SAMPLERATES; *sr; ++sr ) info.sampleRates.push_back( *sr ); info.nativeFormats = RTAUDIO_SINT16 | RTAUDIO_SINT32 | RTAUDIO_FLOAT32; return info; } static void *pulseaudio_callback( void * user ) { CallbackInfo *cbi = static_cast( user ); RtApiPulse *context = static_cast( cbi->object ); volatile bool *isRunning = &cbi->isRunning; while ( *isRunning ) { pthread_testcancel(); context->callbackEvent(); } pthread_exit( NULL ); } void RtApiPulse::closeStream( void ) { PulseAudioHandle *pah = static_cast( stream_.apiHandle ); stream_.callbackInfo.isRunning = false; if ( pah ) { MUTEX_LOCK( &stream_.mutex ); if ( stream_.state == STREAM_STOPPED ) { pah->runnable = true; pthread_cond_signal( &pah->runnable_cv ); } MUTEX_UNLOCK( &stream_.mutex ); pthread_join( pah->thread, 0 ); if ( pah->s_play ) { pa_simple_flush( pah->s_play, NULL ); pa_simple_free( pah->s_play ); } if ( pah->s_rec ) pa_simple_free( pah->s_rec ); pthread_cond_destroy( &pah->runnable_cv ); delete pah; stream_.apiHandle = 0; } if ( stream_.userBuffer[0] ) { free( stream_.userBuffer[0] ); stream_.userBuffer[0] = 0; } if ( stream_.userBuffer[1] ) { free( stream_.userBuffer[1] ); stream_.userBuffer[1] = 0; } stream_.state = STREAM_CLOSED; stream_.mode = UNINITIALIZED; } void RtApiPulse::callbackEvent( void ) { PulseAudioHandle *pah = static_cast( stream_.apiHandle ); if ( stream_.state == STREAM_STOPPED ) { MUTEX_LOCK( &stream_.mutex ); while ( !pah->runnable ) pthread_cond_wait( &pah->runnable_cv, &stream_.mutex ); if ( stream_.state != STREAM_RUNNING ) { MUTEX_UNLOCK( &stream_.mutex ); return; } MUTEX_UNLOCK( &stream_.mutex ); } if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiPulse::callbackEvent(): the stream is closed ... " "this shouldn't happen!"; error( RtError::WARNING ); return; } RtAudioCallback callback = (RtAudioCallback) stream_.callbackInfo.callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; int doStopStream = callback( stream_.userBuffer[OUTPUT], stream_.userBuffer[INPUT], stream_.bufferSize, streamTime, status, stream_.callbackInfo.userData ); if ( doStopStream == 2 ) { abortStream(); return; } MUTEX_LOCK( &stream_.mutex ); void *pulse_in = stream_.doConvertBuffer[INPUT] ? stream_.deviceBuffer : stream_.userBuffer[INPUT]; void *pulse_out = stream_.doConvertBuffer[OUTPUT] ? stream_.deviceBuffer : stream_.userBuffer[OUTPUT]; if ( stream_.state != STREAM_RUNNING ) goto unlock; int pa_error; size_t bytes; if (stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { if ( stream_.doConvertBuffer[OUTPUT] ) { convertBuffer( stream_.deviceBuffer, stream_.userBuffer[OUTPUT], stream_.convertInfo[OUTPUT] ); bytes = stream_.nDeviceChannels[OUTPUT] * stream_.bufferSize * formatBytes( stream_.deviceFormat[OUTPUT] ); } else bytes = stream_.nUserChannels[OUTPUT] * stream_.bufferSize * formatBytes( stream_.userFormat ); if ( pa_simple_write( pah->s_play, pulse_out, bytes, &pa_error ) < 0 ) { errorStream_ << "RtApiPulse::callbackEvent: audio write error, " << pa_strerror( pa_error ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX) { if ( stream_.doConvertBuffer[INPUT] ) bytes = stream_.nDeviceChannels[INPUT] * stream_.bufferSize * formatBytes( stream_.deviceFormat[INPUT] ); else bytes = stream_.nUserChannels[INPUT] * stream_.bufferSize * formatBytes( stream_.userFormat ); if ( pa_simple_read( pah->s_rec, pulse_in, bytes, &pa_error ) < 0 ) { errorStream_ << "RtApiPulse::callbackEvent: audio read error, " << pa_strerror( pa_error ) << "."; errorText_ = errorStream_.str(); error( RtError::WARNING ); } if ( stream_.doConvertBuffer[INPUT] ) { convertBuffer( stream_.userBuffer[INPUT], stream_.deviceBuffer, stream_.convertInfo[INPUT] ); } } unlock: MUTEX_UNLOCK( &stream_.mutex ); RtApi::tickStreamTime(); if ( doStopStream == 1 ) stopStream(); } void RtApiPulse::startStream( void ) { PulseAudioHandle *pah = static_cast( stream_.apiHandle ); if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiPulse::startStream(): the stream is not open!"; error( RtError::INVALID_USE ); return; } if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiPulse::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } MUTEX_LOCK( &stream_.mutex ); stream_.state = STREAM_RUNNING; pah->runnable = true; pthread_cond_signal( &pah->runnable_cv ); MUTEX_UNLOCK( &stream_.mutex ); } void RtApiPulse::stopStream( void ) { PulseAudioHandle *pah = static_cast( stream_.apiHandle ); if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiPulse::stopStream(): the stream is not open!"; error( RtError::INVALID_USE ); return; } if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiPulse::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } stream_.state = STREAM_STOPPED; MUTEX_LOCK( &stream_.mutex ); if ( pah && pah->s_play ) { int pa_error; if ( pa_simple_drain( pah->s_play, &pa_error ) < 0 ) { errorStream_ << "RtApiPulse::stopStream: error draining output device, " << pa_strerror( pa_error ) << "."; errorText_ = errorStream_.str(); MUTEX_UNLOCK( &stream_.mutex ); error( RtError::SYSTEM_ERROR ); return; } } stream_.state = STREAM_STOPPED; MUTEX_UNLOCK( &stream_.mutex ); } void RtApiPulse::abortStream( void ) { PulseAudioHandle *pah = static_cast( stream_.apiHandle ); if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiPulse::abortStream(): the stream is not open!"; error( RtError::INVALID_USE ); return; } if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiPulse::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } stream_.state = STREAM_STOPPED; MUTEX_LOCK( &stream_.mutex ); if ( pah && pah->s_play ) { int pa_error; if ( pa_simple_flush( pah->s_play, &pa_error ) < 0 ) { errorStream_ << "RtApiPulse::abortStream: error flushing output device, " << pa_strerror( pa_error ) << "."; errorText_ = errorStream_.str(); MUTEX_UNLOCK( &stream_.mutex ); error( RtError::SYSTEM_ERROR ); return; } } stream_.state = STREAM_STOPPED; MUTEX_UNLOCK( &stream_.mutex ); } bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ) { PulseAudioHandle *pah = 0; unsigned long bufferBytes = 0; pa_sample_spec ss; if ( device != 0 ) return false; if ( mode != INPUT && mode != OUTPUT ) return false; if ( channels != 1 && channels != 2 ) { errorText_ = "RtApiPulse::probeDeviceOpen: unsupported number of channels."; return false; } ss.channels = channels; if ( firstChannel != 0 ) return false; bool sr_found = false; for ( const unsigned int *sr = SUPPORTED_SAMPLERATES; *sr; ++sr ) { if ( sampleRate == *sr ) { sr_found = true; stream_.sampleRate = sampleRate; ss.rate = sampleRate; break; } } if ( !sr_found ) { errorText_ = "RtApiPulse::probeDeviceOpen: unsupported sample rate."; return false; } bool sf_found = 0; for ( const rtaudio_pa_format_mapping_t *sf = supported_sampleformats; sf->rtaudio_format && sf->pa_format != PA_SAMPLE_INVALID; ++sf ) { if ( format == sf->rtaudio_format ) { sf_found = true; stream_.userFormat = sf->rtaudio_format; ss.format = sf->pa_format; break; } } if ( !sf_found ) { errorText_ = "RtApiPulse::probeDeviceOpen: unsupported sample format."; return false; } // Set interleaving parameters. if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; else stream_.userInterleaved = true; stream_.deviceInterleaved[mode] = true; stream_.nBuffers = 1; stream_.doByteSwap[mode] = false; stream_.doConvertBuffer[mode] = channels > 1 && !stream_.userInterleaved; stream_.deviceFormat[mode] = stream_.userFormat; stream_.nUserChannels[mode] = channels; stream_.nDeviceChannels[mode] = channels + firstChannel; stream_.channelOffset[mode] = 0; // Allocate necessary internal buffers. bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiPulse::probeDeviceOpen: error allocating user buffer memory."; goto error; } stream_.bufferSize = *bufferSize; if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiPulse::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } stream_.device[mode] = device; // Setup the buffer conversion information structure. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, firstChannel ); if ( !stream_.apiHandle ) { PulseAudioHandle *pah = new PulseAudioHandle; if ( !pah ) { errorText_ = "RtApiPulse::probeDeviceOpen: error allocating memory for handle."; goto error; } stream_.apiHandle = pah; if ( pthread_cond_init( &pah->runnable_cv, NULL ) != 0 ) { errorText_ = "RtApiPulse::probeDeviceOpen: error creating condition variable."; goto error; } } pah = static_cast( stream_.apiHandle ); int error; switch ( mode ) { case INPUT: pah->s_rec = pa_simple_new( NULL, "RtAudio", PA_STREAM_RECORD, NULL, "Record", &ss, NULL, NULL, &error ); if ( !pah->s_rec ) { errorText_ = "RtApiPulse::probeDeviceOpen: error connecting input to PulseAudio server."; goto error; } break; case OUTPUT: pah->s_play = pa_simple_new( NULL, "RtAudio", PA_STREAM_PLAYBACK, NULL, "Playback", &ss, NULL, NULL, &error ); if ( !pah->s_play ) { errorText_ = "RtApiPulse::probeDeviceOpen: error connecting output to PulseAudio server."; goto error; } break; default: goto error; } if ( stream_.mode == UNINITIALIZED ) stream_.mode = mode; else if ( stream_.mode == mode ) goto error; else stream_.mode = DUPLEX; if ( !stream_.callbackInfo.isRunning ) { stream_.callbackInfo.object = this; stream_.callbackInfo.isRunning = true; if ( pthread_create( &pah->thread, NULL, pulseaudio_callback, (void *)&stream_.callbackInfo) != 0 ) { errorText_ = "RtApiPulse::probeDeviceOpen: error creating thread."; goto error; } } stream_.state = STREAM_STOPPED; return true; error: if ( pah && stream_.callbackInfo.isRunning ) { pthread_cond_destroy( &pah->runnable_cv ); delete pah; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } return FAILURE; } //******************** End of __LINUX_PULSE__ *********************// #endif #if defined(__LINUX_OSS__) #include #include #include #include #include "soundcard.h" #include #include static void *ossCallbackHandler(void * ptr); // A structure to hold various information related to the OSS API // implementation. struct OssHandle { int id[2]; // device ids bool xrun[2]; bool triggered; pthread_cond_t runnable; OssHandle() :triggered(false) { id[0] = 0; id[1] = 0; xrun[0] = false; xrun[1] = false; } }; RtApiOss :: RtApiOss() { // Nothing to do here. } RtApiOss :: ~RtApiOss() { if ( stream_.state != STREAM_CLOSED ) closeStream(); } unsigned int RtApiOss :: getDeviceCount( void ) { int mixerfd = open( "/dev/mixer", O_RDWR, 0 ); if ( mixerfd == -1 ) { errorText_ = "RtApiOss::getDeviceCount: error opening '/dev/mixer'."; error( RtError::WARNING ); return 0; } oss_sysinfo sysinfo; if ( ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ) == -1 ) { close( mixerfd ); errorText_ = "RtApiOss::getDeviceCount: error getting sysinfo, OSS version >= 4.0 is required."; error( RtError::WARNING ); return 0; } close( mixerfd ); return sysinfo.numaudios; } RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; info.probed = false; int mixerfd = open( "/dev/mixer", O_RDWR, 0 ); if ( mixerfd == -1 ) { errorText_ = "RtApiOss::getDeviceInfo: error opening '/dev/mixer'."; error( RtError::WARNING ); return info; } oss_sysinfo sysinfo; int result = ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ); if ( result == -1 ) { close( mixerfd ); errorText_ = "RtApiOss::getDeviceInfo: error getting sysinfo, OSS version >= 4.0 is required."; error( RtError::WARNING ); return info; } unsigned nDevices = sysinfo.numaudios; if ( nDevices == 0 ) { close( mixerfd ); errorText_ = "RtApiOss::getDeviceInfo: no devices found!"; error( RtError::INVALID_USE ); return info; } if ( device >= nDevices ) { close( mixerfd ); errorText_ = "RtApiOss::getDeviceInfo: device ID is invalid!"; error( RtError::INVALID_USE ); return info; } oss_audioinfo ainfo; ainfo.dev = device; result = ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo ); close( mixerfd ); if ( result == -1 ) { errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Probe channels if ( ainfo.caps & PCM_CAP_OUTPUT ) info.outputChannels = ainfo.max_channels; if ( ainfo.caps & PCM_CAP_INPUT ) info.inputChannels = ainfo.max_channels; if ( ainfo.caps & PCM_CAP_DUPLEX ) { if ( info.outputChannels > 0 && info.inputChannels > 0 && ainfo.caps & PCM_CAP_DUPLEX ) info.duplexChannels = (info.outputChannels > info.inputChannels) ? info.inputChannels : info.outputChannels; } // Probe data formats ... do for input unsigned long mask = ainfo.iformats; if ( mask & AFMT_S16_LE || mask & AFMT_S16_BE ) info.nativeFormats |= RTAUDIO_SINT16; if ( mask & AFMT_S8 ) info.nativeFormats |= RTAUDIO_SINT8; if ( mask & AFMT_S32_LE || mask & AFMT_S32_BE ) info.nativeFormats |= RTAUDIO_SINT32; if ( mask & AFMT_FLOAT ) info.nativeFormats |= RTAUDIO_FLOAT32; if ( mask & AFMT_S24_LE || mask & AFMT_S24_BE ) info.nativeFormats |= RTAUDIO_SINT24; // Check that we have at least one supported format if ( info.nativeFormats == 0 ) { errorStream_ << "RtApiOss::getDeviceInfo: device (" << ainfo.name << ") data format not supported by RtAudio."; errorText_ = errorStream_.str(); error( RtError::WARNING ); return info; } // Probe the supported sample rates. info.sampleRates.clear(); if ( ainfo.nrates ) { for ( unsigned int i=0; i= (int) SAMPLE_RATES[k] ) info.sampleRates.push_back( SAMPLE_RATES[k] ); } } if ( info.sampleRates.size() == 0 ) { errorStream_ << "RtApiOss::getDeviceInfo: no supported sample rates found for device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); error( RtError::WARNING ); } else { info.probed = true; info.name = ainfo.name; } return info; } bool RtApiOss :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ) { int mixerfd = open( "/dev/mixer", O_RDWR, 0 ); if ( mixerfd == -1 ) { errorText_ = "RtApiOss::probeDeviceOpen: error opening '/dev/mixer'."; return FAILURE; } oss_sysinfo sysinfo; int result = ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ); if ( result == -1 ) { close( mixerfd ); errorText_ = "RtApiOss::probeDeviceOpen: error getting sysinfo, OSS version >= 4.0 is required."; return FAILURE; } unsigned nDevices = sysinfo.numaudios; if ( nDevices == 0 ) { // This should not happen because a check is made before this function is called. close( mixerfd ); errorText_ = "RtApiOss::probeDeviceOpen: no devices found!"; return FAILURE; } if ( device >= nDevices ) { // This should not happen because a check is made before this function is called. close( mixerfd ); errorText_ = "RtApiOss::probeDeviceOpen: device ID is invalid!"; return FAILURE; } oss_audioinfo ainfo; ainfo.dev = device; result = ioctl( mixerfd, SNDCTL_AUDIOINFO, &ainfo ); close( mixerfd ); if ( result == -1 ) { errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info."; errorText_ = errorStream_.str(); return FAILURE; } // Check if device supports input or output if ( ( mode == OUTPUT && !( ainfo.caps & PCM_CAP_OUTPUT ) ) || ( mode == INPUT && !( ainfo.caps & PCM_CAP_INPUT ) ) ) { if ( mode == OUTPUT ) errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support output."; else errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support input."; errorText_ = errorStream_.str(); return FAILURE; } int flags = 0; OssHandle *handle = (OssHandle *) stream_.apiHandle; if ( mode == OUTPUT ) flags |= O_WRONLY; else { // mode == INPUT if (stream_.mode == OUTPUT && stream_.device[0] == device) { // We just set the same device for playback ... close and reopen for duplex (OSS only). close( handle->id[0] ); handle->id[0] = 0; if ( !( ainfo.caps & PCM_CAP_DUPLEX ) ) { errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support duplex mode."; errorText_ = errorStream_.str(); return FAILURE; } // Check that the number previously set channels is the same. if ( stream_.nUserChannels[0] != channels ) { errorStream_ << "RtApiOss::probeDeviceOpen: input/output channels must be equal for OSS duplex device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } flags |= O_RDWR; } else flags |= O_RDONLY; } // Set exclusive access if specified. if ( options && options->flags & RTAUDIO_HOG_DEVICE ) flags |= O_EXCL; // Try to open the device. int fd; fd = open( ainfo.devnode, flags, 0 ); if ( fd == -1 ) { if ( errno == EBUSY ) errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") is busy."; else errorStream_ << "RtApiOss::probeDeviceOpen: error opening device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } // For duplex operation, specifically set this mode (this doesn't seem to work). /* if ( flags | O_RDWR ) { result = ioctl( fd, SNDCTL_DSP_SETDUPLEX, NULL ); if ( result == -1) { errorStream_ << "RtApiOss::probeDeviceOpen: error setting duplex mode for device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } } */ // Check the device channel support. stream_.nUserChannels[mode] = channels; if ( ainfo.max_channels < (int)(channels + firstChannel) ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: the device (" << ainfo.name << ") does not support requested channel parameters."; errorText_ = errorStream_.str(); return FAILURE; } // Set the number of channels. int deviceChannels = channels + firstChannel; result = ioctl( fd, SNDCTL_DSP_CHANNELS, &deviceChannels ); if ( result == -1 || deviceChannels < (int)(channels + firstChannel) ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: error setting channel parameters on device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.nDeviceChannels[mode] = deviceChannels; // Get the data format mask int mask; result = ioctl( fd, SNDCTL_DSP_GETFMTS, &mask ); if ( result == -1 ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: error getting device (" << ainfo.name << ") data formats."; errorText_ = errorStream_.str(); return FAILURE; } // Determine how to set the device format. stream_.userFormat = format; int deviceFormat = -1; stream_.doByteSwap[mode] = false; if ( format == RTAUDIO_SINT8 ) { if ( mask & AFMT_S8 ) { deviceFormat = AFMT_S8; stream_.deviceFormat[mode] = RTAUDIO_SINT8; } } else if ( format == RTAUDIO_SINT16 ) { if ( mask & AFMT_S16_NE ) { deviceFormat = AFMT_S16_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT16; } else if ( mask & AFMT_S16_OE ) { deviceFormat = AFMT_S16_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT16; stream_.doByteSwap[mode] = true; } } else if ( format == RTAUDIO_SINT24 ) { if ( mask & AFMT_S24_NE ) { deviceFormat = AFMT_S24_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT24; } else if ( mask & AFMT_S24_OE ) { deviceFormat = AFMT_S24_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT24; stream_.doByteSwap[mode] = true; } } else if ( format == RTAUDIO_SINT32 ) { if ( mask & AFMT_S32_NE ) { deviceFormat = AFMT_S32_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT32; } else if ( mask & AFMT_S32_OE ) { deviceFormat = AFMT_S32_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT32; stream_.doByteSwap[mode] = true; } } if ( deviceFormat == -1 ) { // The user requested format is not natively supported by the device. if ( mask & AFMT_S16_NE ) { deviceFormat = AFMT_S16_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT16; } else if ( mask & AFMT_S32_NE ) { deviceFormat = AFMT_S32_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT32; } else if ( mask & AFMT_S24_NE ) { deviceFormat = AFMT_S24_NE; stream_.deviceFormat[mode] = RTAUDIO_SINT24; } else if ( mask & AFMT_S16_OE ) { deviceFormat = AFMT_S16_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT16; stream_.doByteSwap[mode] = true; } else if ( mask & AFMT_S32_OE ) { deviceFormat = AFMT_S32_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT32; stream_.doByteSwap[mode] = true; } else if ( mask & AFMT_S24_OE ) { deviceFormat = AFMT_S24_OE; stream_.deviceFormat[mode] = RTAUDIO_SINT24; stream_.doByteSwap[mode] = true; } else if ( mask & AFMT_S8) { deviceFormat = AFMT_S8; stream_.deviceFormat[mode] = RTAUDIO_SINT8; } } if ( stream_.deviceFormat[mode] == 0 ) { // This really shouldn't happen ... close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") data format not supported by RtAudio."; errorText_ = errorStream_.str(); return FAILURE; } // Set the data format. int temp = deviceFormat; result = ioctl( fd, SNDCTL_DSP_SETFMT, &deviceFormat ); if ( result == -1 || deviceFormat != temp ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: error setting data format on device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Attempt to set the buffer size. According to OSS, the minimum // number of buffers is two. The supposed minimum buffer size is 16 // bytes, so that will be our lower bound. The argument to this // call is in the form 0xMMMMSSSS (hex), where the buffer size (in // bytes) is given as 2^SSSS and the number of buffers as 2^MMMM. // We'll check the actual value used near the end of the setup // procedure. int ossBufferBytes = *bufferSize * formatBytes( stream_.deviceFormat[mode] ) * deviceChannels; if ( ossBufferBytes < 16 ) ossBufferBytes = 16; int buffers = 0; if ( options ) buffers = options->numberOfBuffers; if ( options && options->flags & RTAUDIO_MINIMIZE_LATENCY ) buffers = 2; if ( buffers < 2 ) buffers = 3; temp = ((int) buffers << 16) + (int)( log10( (double)ossBufferBytes ) / log10( 2.0 ) ); result = ioctl( fd, SNDCTL_DSP_SETFRAGMENT, &temp ); if ( result == -1 ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: error setting buffer size on device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.nBuffers = buffers; // Save buffer size (in sample frames). *bufferSize = ossBufferBytes / ( formatBytes(stream_.deviceFormat[mode]) * deviceChannels ); stream_.bufferSize = *bufferSize; // Set the sample rate. int srate = sampleRate; result = ioctl( fd, SNDCTL_DSP_SPEED, &srate ); if ( result == -1 ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: error setting sample rate (" << sampleRate << ") on device (" << ainfo.name << ")."; errorText_ = errorStream_.str(); return FAILURE; } // Verify the sample rate setup worked. if ( abs( srate - sampleRate ) > 100 ) { close( fd ); errorStream_ << "RtApiOss::probeDeviceOpen: device (" << ainfo.name << ") does not support sample rate (" << sampleRate << ")."; errorText_ = errorStream_.str(); return FAILURE; } stream_.sampleRate = sampleRate; if ( mode == INPUT && stream_.mode == OUTPUT && stream_.device[0] == device) { // We're doing duplex setup here. stream_.deviceFormat[0] = stream_.deviceFormat[1]; stream_.nDeviceChannels[0] = deviceChannels; } // Set interleaving parameters. stream_.userInterleaved = true; stream_.deviceInterleaved[mode] = true; if ( options && options->flags & RTAUDIO_NONINTERLEAVED ) stream_.userInterleaved = false; // Set flags for buffer conversion stream_.doConvertBuffer[mode] = false; if ( stream_.userFormat != stream_.deviceFormat[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.nUserChannels[mode] < stream_.nDeviceChannels[mode] ) stream_.doConvertBuffer[mode] = true; if ( stream_.userInterleaved != stream_.deviceInterleaved[mode] && stream_.nUserChannels[mode] > 1 ) stream_.doConvertBuffer[mode] = true; // Allocate the stream handles if necessary and then save. if ( stream_.apiHandle == 0 ) { try { handle = new OssHandle; } catch ( std::bad_alloc& ) { errorText_ = "RtApiOss::probeDeviceOpen: error allocating OssHandle memory."; goto error; } if ( pthread_cond_init( &handle->runnable, NULL ) ) { errorText_ = "RtApiOss::probeDeviceOpen: error initializing pthread condition variable."; goto error; } stream_.apiHandle = (void *) handle; } else { handle = (OssHandle *) stream_.apiHandle; } handle->id[mode] = fd; // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiOss::probeDeviceOpen: error allocating user buffer memory."; goto error; } if ( stream_.doConvertBuffer[mode] ) { bool makeBuffer = true; bufferBytes = stream_.nDeviceChannels[mode] * formatBytes( stream_.deviceFormat[mode] ); if ( mode == INPUT ) { if ( stream_.mode == OUTPUT && stream_.deviceBuffer ) { unsigned long bytesOut = stream_.nDeviceChannels[0] * formatBytes( stream_.deviceFormat[0] ); if ( bufferBytes <= bytesOut ) makeBuffer = false; } } if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiOss::probeDeviceOpen: error allocating device buffer memory."; goto error; } } } stream_.device[mode] = device; stream_.state = STREAM_STOPPED; // Setup the buffer conversion information structure. if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, firstChannel ); // Setup thread if necessary. if ( stream_.mode == OUTPUT && mode == INPUT ) { // We had already set up an output stream. stream_.mode = DUPLEX; if ( stream_.device[0] == device ) handle->id[0] = fd; } else { stream_.mode = mode; // Setup callback thread. stream_.callbackInfo.object = (void *) this; // Set the thread attributes for joinable and realtime scheduling // priority. The higher priority will only take affect if the // program is run as root or suid. pthread_attr_t attr; pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); #ifdef SCHED_RR // Undefined with some OSes (eg: NetBSD 1.6.x with GNU Pthread) if ( options && options->flags & RTAUDIO_SCHEDULE_REALTIME ) { struct sched_param param; int priority = options->priority; int min = sched_get_priority_min( SCHED_RR ); int max = sched_get_priority_max( SCHED_RR ); if ( priority < min ) priority = min; else if ( priority > max ) priority = max; param.sched_priority = priority; pthread_attr_setschedparam( &attr, ¶m ); pthread_attr_setschedpolicy( &attr, SCHED_RR ); } else pthread_attr_setschedpolicy( &attr, SCHED_OTHER ); #else pthread_attr_setschedpolicy( &attr, SCHED_OTHER ); #endif stream_.callbackInfo.isRunning = true; result = pthread_create( &stream_.callbackInfo.thread, &attr, ossCallbackHandler, &stream_.callbackInfo ); pthread_attr_destroy( &attr ); if ( result ) { stream_.callbackInfo.isRunning = false; errorText_ = "RtApiOss::error creating callback thread!"; goto error; } } return SUCCESS; error: if ( handle ) { pthread_cond_destroy( &handle->runnable ); if ( handle->id[0] ) close( handle->id[0] ); if ( handle->id[1] ) close( handle->id[1] ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } return FAILURE; } void RtApiOss :: closeStream() { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiOss::closeStream(): no open stream to close!"; error( RtError::WARNING ); return; } OssHandle *handle = (OssHandle *) stream_.apiHandle; stream_.callbackInfo.isRunning = false; MUTEX_LOCK( &stream_.mutex ); if ( stream_.state == STREAM_STOPPED ) pthread_cond_signal( &handle->runnable ); MUTEX_UNLOCK( &stream_.mutex ); pthread_join( stream_.callbackInfo.thread, NULL ); if ( stream_.state == STREAM_RUNNING ) { if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 ); else ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 ); stream_.state = STREAM_STOPPED; } if ( handle ) { pthread_cond_destroy( &handle->runnable ); if ( handle->id[0] ) close( handle->id[0] ); if ( handle->id[1] ) close( handle->id[1] ); delete handle; stream_.apiHandle = 0; } for ( int i=0; i<2; i++ ) { if ( stream_.userBuffer[i] ) { free( stream_.userBuffer[i] ); stream_.userBuffer[i] = 0; } } if ( stream_.deviceBuffer ) { free( stream_.deviceBuffer ); stream_.deviceBuffer = 0; } stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; } void RtApiOss :: startStream() { verifyStream(); if ( stream_.state == STREAM_RUNNING ) { errorText_ = "RtApiOss::startStream(): the stream is already running!"; error( RtError::WARNING ); return; } MUTEX_LOCK( &stream_.mutex ); stream_.state = STREAM_RUNNING; // No need to do anything else here ... OSS automatically starts // when fed samples. MUTEX_UNLOCK( &stream_.mutex ); OssHandle *handle = (OssHandle *) stream_.apiHandle; pthread_cond_signal( &handle->runnable ); } void RtApiOss :: stopStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiOss::stopStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } MUTEX_LOCK( &stream_.mutex ); // The state might change while waiting on a mutex. if ( stream_.state == STREAM_STOPPED ) { MUTEX_UNLOCK( &stream_.mutex ); return; } int result = 0; OssHandle *handle = (OssHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { // Flush the output with zeros a few times. char *buffer; int samples; RtAudioFormat format; if ( stream_.doConvertBuffer[0] ) { buffer = stream_.deviceBuffer; samples = stream_.bufferSize * stream_.nDeviceChannels[0]; format = stream_.deviceFormat[0]; } else { buffer = stream_.userBuffer[0]; samples = stream_.bufferSize * stream_.nUserChannels[0]; format = stream_.userFormat; } memset( buffer, 0, samples * formatBytes(format) ); for ( unsigned int i=0; iid[0], buffer, samples * formatBytes(format) ); if ( result == -1 ) { errorText_ = "RtApiOss::stopStream: audio write error."; error( RtError::WARNING ); } } result = ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 ); if ( result == -1 ) { errorStream_ << "RtApiOss::stopStream: system error stopping callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } handle->triggered = false; } if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && handle->id[0] != handle->id[1] ) ) { result = ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 ); if ( result == -1 ) { errorStream_ << "RtApiOss::stopStream: system error stopping input callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } } unlock: stream_.state = STREAM_STOPPED; MUTEX_UNLOCK( &stream_.mutex ); if ( result != -1 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiOss :: abortStream() { verifyStream(); if ( stream_.state == STREAM_STOPPED ) { errorText_ = "RtApiOss::abortStream(): the stream is already stopped!"; error( RtError::WARNING ); return; } MUTEX_LOCK( &stream_.mutex ); // The state might change while waiting on a mutex. if ( stream_.state == STREAM_STOPPED ) { MUTEX_UNLOCK( &stream_.mutex ); return; } int result = 0; OssHandle *handle = (OssHandle *) stream_.apiHandle; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { result = ioctl( handle->id[0], SNDCTL_DSP_HALT, 0 ); if ( result == -1 ) { errorStream_ << "RtApiOss::abortStream: system error stopping callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } handle->triggered = false; } if ( stream_.mode == INPUT || ( stream_.mode == DUPLEX && handle->id[0] != handle->id[1] ) ) { result = ioctl( handle->id[1], SNDCTL_DSP_HALT, 0 ); if ( result == -1 ) { errorStream_ << "RtApiOss::abortStream: system error stopping input callback procedure on device (" << stream_.device[0] << ")."; errorText_ = errorStream_.str(); goto unlock; } } unlock: stream_.state = STREAM_STOPPED; MUTEX_UNLOCK( &stream_.mutex ); if ( result != -1 ) return; error( RtError::SYSTEM_ERROR ); } void RtApiOss :: callbackEvent() { OssHandle *handle = (OssHandle *) stream_.apiHandle; if ( stream_.state == STREAM_STOPPED ) { MUTEX_LOCK( &stream_.mutex ); pthread_cond_wait( &handle->runnable, &stream_.mutex ); if ( stream_.state != STREAM_RUNNING ) { MUTEX_UNLOCK( &stream_.mutex ); return; } MUTEX_UNLOCK( &stream_.mutex ); } if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApiOss::callbackEvent(): the stream is closed ... this shouldn't happen!"; error( RtError::WARNING ); return; } // Invoke user callback to get fresh output data. int doStopStream = 0; RtAudioCallback callback = (RtAudioCallback) stream_.callbackInfo.callback; double streamTime = getStreamTime(); RtAudioStreamStatus status = 0; if ( stream_.mode != INPUT && handle->xrun[0] == true ) { status |= RTAUDIO_OUTPUT_UNDERFLOW; handle->xrun[0] = false; } if ( stream_.mode != OUTPUT && handle->xrun[1] == true ) { status |= RTAUDIO_INPUT_OVERFLOW; handle->xrun[1] = false; } doStopStream = callback( stream_.userBuffer[0], stream_.userBuffer[1], stream_.bufferSize, streamTime, status, stream_.callbackInfo.userData ); if ( doStopStream == 2 ) { this->abortStream(); return; } MUTEX_LOCK( &stream_.mutex ); // The state might change while waiting on a mutex. if ( stream_.state == STREAM_STOPPED ) goto unlock; int result; char *buffer; int samples; RtAudioFormat format; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { // Setup parameters and do buffer conversion if necessary. if ( stream_.doConvertBuffer[0] ) { buffer = stream_.deviceBuffer; convertBuffer( buffer, stream_.userBuffer[0], stream_.convertInfo[0] ); samples = stream_.bufferSize * stream_.nDeviceChannels[0]; format = stream_.deviceFormat[0]; } else { buffer = stream_.userBuffer[0]; samples = stream_.bufferSize * stream_.nUserChannels[0]; format = stream_.userFormat; } // Do byte swapping if necessary. if ( stream_.doByteSwap[0] ) byteSwapBuffer( buffer, samples, format ); if ( stream_.mode == DUPLEX && handle->triggered == false ) { int trig = 0; ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig ); result = write( handle->id[0], buffer, samples * formatBytes(format) ); trig = PCM_ENABLE_INPUT|PCM_ENABLE_OUTPUT; ioctl( handle->id[0], SNDCTL_DSP_SETTRIGGER, &trig ); handle->triggered = true; } else // Write samples to device. result = write( handle->id[0], buffer, samples * formatBytes(format) ); if ( result == -1 ) { // We'll assume this is an underrun, though there isn't a // specific means for determining that. handle->xrun[0] = true; errorText_ = "RtApiOss::callbackEvent: audio write error."; error( RtError::WARNING ); // Continue on to input section. } } if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) { // Setup parameters. if ( stream_.doConvertBuffer[1] ) { buffer = stream_.deviceBuffer; samples = stream_.bufferSize * stream_.nDeviceChannels[1]; format = stream_.deviceFormat[1]; } else { buffer = stream_.userBuffer[1]; samples = stream_.bufferSize * stream_.nUserChannels[1]; format = stream_.userFormat; } // Read samples from device. result = read( handle->id[1], buffer, samples * formatBytes(format) ); if ( result == -1 ) { // We'll assume this is an overrun, though there isn't a // specific means for determining that. handle->xrun[1] = true; errorText_ = "RtApiOss::callbackEvent: audio read error."; error( RtError::WARNING ); goto unlock; } // Do byte swapping if necessary. if ( stream_.doByteSwap[1] ) byteSwapBuffer( buffer, samples, format ); // Do buffer conversion if necessary. if ( stream_.doConvertBuffer[1] ) convertBuffer( stream_.userBuffer[1], stream_.deviceBuffer, stream_.convertInfo[1] ); } unlock: MUTEX_UNLOCK( &stream_.mutex ); RtApi::tickStreamTime(); if ( doStopStream == 1 ) this->stopStream(); } static void *ossCallbackHandler( void *ptr ) { CallbackInfo *info = (CallbackInfo *) ptr; RtApiOss *object = (RtApiOss *) info->object; bool *isRunning = &info->isRunning; while ( *isRunning == true ) { pthread_testcancel(); object->callbackEvent(); } pthread_exit( NULL ); } //******************** End of __LINUX_OSS__ *********************// #endif // *************************************************** // // // Protected common (OS-independent) RtAudio methods. // // *************************************************** // // This method can be modified to control the behavior of error // message printing. void RtApi :: error( RtError::Type type ) { errorStream_.str(""); // clear the ostringstream RtAudioErrorCallback errorCallback = (RtAudioErrorCallback) stream_.callbackInfo.errorCallback; if ( errorCallback ) { // abortStream() can generate new error messages. Ignore them. Just keep original one. static bool firstErrorOccured = false; if ( firstErrorOccured ) return; firstErrorOccured = true; const std::string errorMessage = errorText_; if ( type != RtError::WARNING && stream_.state != STREAM_STOPPED) { stream_.callbackInfo.isRunning = false; // exit from the thread abortStream(); } errorCallback( type, errorMessage ); firstErrorOccured = false; return; } if ( type == RtError::WARNING && showWarnings_ == true ) std::cerr << '\n' << errorText_ << "\n\n"; else if ( type != RtError::WARNING ) throw( RtError( errorText_, type ) ); } void RtApi :: verifyStream() { if ( stream_.state == STREAM_CLOSED ) { errorText_ = "RtApi:: a stream is not open!"; error( RtError::INVALID_USE ); } } void RtApi :: clearStreamInfo() { stream_.mode = UNINITIALIZED; stream_.state = STREAM_CLOSED; stream_.sampleRate = 0; stream_.bufferSize = 0; stream_.nBuffers = 0; stream_.userFormat = 0; stream_.userInterleaved = true; stream_.streamTime = 0.0; stream_.apiHandle = 0; stream_.deviceBuffer = 0; stream_.callbackInfo.callback = 0; stream_.callbackInfo.userData = 0; stream_.callbackInfo.isRunning = false; stream_.callbackInfo.errorCallback = 0; for ( int i=0; i<2; i++ ) { stream_.device[i] = 11111; stream_.doConvertBuffer[i] = false; stream_.deviceInterleaved[i] = true; stream_.doByteSwap[i] = false; stream_.nUserChannels[i] = 0; stream_.nDeviceChannels[i] = 0; stream_.channelOffset[i] = 0; stream_.deviceFormat[i] = 0; stream_.latency[i] = 0; stream_.userBuffer[i] = 0; stream_.convertInfo[i].channels = 0; stream_.convertInfo[i].inJump = 0; stream_.convertInfo[i].outJump = 0; stream_.convertInfo[i].inFormat = 0; stream_.convertInfo[i].outFormat = 0; stream_.convertInfo[i].inOffset.clear(); stream_.convertInfo[i].outOffset.clear(); } } unsigned int RtApi :: formatBytes( RtAudioFormat format ) { if ( format == RTAUDIO_SINT16 ) return 2; else if ( format == RTAUDIO_SINT32 || format == RTAUDIO_FLOAT32 ) return 4; else if ( format == RTAUDIO_FLOAT64 ) return 8; else if ( format == RTAUDIO_SINT24 ) return 3; else if ( format == RTAUDIO_SINT8 ) return 1; errorText_ = "RtApi::formatBytes: undefined format."; error( RtError::WARNING ); return 0; } void RtApi :: setConvertInfo( StreamMode mode, unsigned int firstChannel ) { if ( mode == INPUT ) { // convert device to user buffer stream_.convertInfo[mode].inJump = stream_.nDeviceChannels[1]; stream_.convertInfo[mode].outJump = stream_.nUserChannels[1]; stream_.convertInfo[mode].inFormat = stream_.deviceFormat[1]; stream_.convertInfo[mode].outFormat = stream_.userFormat; } else { // convert user to device buffer stream_.convertInfo[mode].inJump = stream_.nUserChannels[0]; stream_.convertInfo[mode].outJump = stream_.nDeviceChannels[0]; stream_.convertInfo[mode].inFormat = stream_.userFormat; stream_.convertInfo[mode].outFormat = stream_.deviceFormat[0]; } if ( stream_.convertInfo[mode].inJump < stream_.convertInfo[mode].outJump ) stream_.convertInfo[mode].channels = stream_.convertInfo[mode].inJump; else stream_.convertInfo[mode].channels = stream_.convertInfo[mode].outJump; // Set up the interleave/deinterleave offsets. if ( stream_.deviceInterleaved[mode] != stream_.userInterleaved ) { if ( ( mode == OUTPUT && stream_.deviceInterleaved[mode] ) || ( mode == INPUT && stream_.userInterleaved ) ) { for ( int k=0; k 0 ) { if ( stream_.deviceInterleaved[mode] ) { if ( mode == OUTPUT ) { for ( int k=0; k> 8); //out[info.outOffset[j]] >>= 8; } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_FLOAT32) { Float32 *in = (Float32 *)inBuffer; for (unsigned int i=0; i> 8); } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_SINT32) { Int32 *in = (Int32 *)inBuffer; for (unsigned int i=0; i> 16) & 0x0000ffff); } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_FLOAT32) { Float32 *in = (Float32 *)inBuffer; for (unsigned int i=0; i> 8) & 0x00ff); } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_SINT24) { Int24 *in = (Int24 *)inBuffer; for (unsigned int i=0; i> 16); } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_SINT32) { Int32 *in = (Int32 *)inBuffer; for (unsigned int i=0; i> 24) & 0x000000ff); } in += info.inJump; out += info.outJump; } } else if (info.inFormat == RTAUDIO_FLOAT32) { Float32 *in = (Float32 *)inBuffer; for (unsigned int i=0; i>8) | (x<<8); } //static inline uint32_t bswap_32(uint32_t x) { return (bswap_16(x&0xffff)<<16) | (bswap_16(x>>16)); } //static inline uint64_t bswap_64(uint64_t x) { return (((unsigned long long)bswap_32(x&0xffffffffull))<<32) | (bswap_32(x>>32)); } void RtApi :: byteSwapBuffer( char *buffer, unsigned int samples, RtAudioFormat format ) { register char val; register char *ptr; ptr = buffer; if ( format == RTAUDIO_SINT16 ) { for ( unsigned int i=0; i #include #include "RtError.h" // RtAudio version static const std::string VERSION( "4.0.12" ); /*! \typedef typedef unsigned long RtAudioFormat; \brief RtAudio data format type. Support for signed integers and floats. Audio data fed to/from an RtAudio stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions. - \e RTAUDIO_SINT8: 8-bit signed integer. - \e RTAUDIO_SINT16: 16-bit signed integer. - \e RTAUDIO_SINT24: 24-bit signed integer. - \e RTAUDIO_SINT32: 32-bit signed integer. - \e RTAUDIO_FLOAT32: Normalized between plus/minus 1.0. - \e RTAUDIO_FLOAT64: Normalized between plus/minus 1.0. */ typedef unsigned long RtAudioFormat; static const RtAudioFormat RTAUDIO_SINT8 = 0x1; // 8-bit signed integer. static const RtAudioFormat RTAUDIO_SINT16 = 0x2; // 16-bit signed integer. static const RtAudioFormat RTAUDIO_SINT24 = 0x4; // 24-bit signed integer. static const RtAudioFormat RTAUDIO_SINT32 = 0x8; // 32-bit signed integer. static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; // Normalized between plus/minus 1.0. static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/minus 1.0. /*! \typedef typedef unsigned long RtAudioStreamFlags; \brief RtAudio stream option flags. The following flags can be OR'ed together to allow a client to make changes to the default stream behavior: - \e RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved). - \e RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency. - \e RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use. - \e RTAUDIO_ALSA_USE_DEFAULT: Use the "default" PCM device (ALSA only). By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with \c nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index \c nFrames (assuming the \c buffer pointer was recast to the correct data type for the stream). Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance. If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs. If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to open the "default" PCM device when using the ALSA API. Note that this will override any specified input or output device id. */ typedef unsigned int RtAudioStreamFlags; static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1; // Use non-interleaved buffers (default = interleaved). static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2; // Attempt to set stream parameters for lowest possible latency. static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4; // Attempt grab device and prevent use by others. static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread. static const RtAudioStreamFlags RTAUDIO_ALSA_USE_DEFAULT = 0x10; // Use the "default" PCM device (ALSA only). /*! \typedef typedef unsigned long RtAudioStreamStatus; \brief RtAudio stream status (over- or underflow) flags. Notification of a stream over- or underflow is indicated by a non-zero stream \c status argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input: - \e RTAUDIO_INPUT_OVERFLOW: Input data was discarded because of an overflow condition at the driver. - \e RTAUDIO_OUTPUT_UNDERFLOW: The output buffer ran low, likely producing a break in the output sound. */ typedef unsigned int RtAudioStreamStatus; static const RtAudioStreamStatus RTAUDIO_INPUT_OVERFLOW = 0x1; // Input data was discarded because of an overflow condition at the driver. static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2; // The output buffer ran low, likely causing a gap in the output sound. //! RtAudio callback function prototype. /*! All RtAudio clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked. \param outputBuffer For output (or duplex) streams, the client should write \c nFrames of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL. \param inputBuffer For input (or duplex) streams, this buffer will hold \c nFrames of input audio sample frames. This argument should be recast to the datatype specified when the stream was opened. For output-only streams, this argument will be NULL. \param nFrames The number of sample frames of input or output data in the buffers. The actual buffer size in bytes is dependent on the data type and number of channels in use. \param streamTime The number of seconds that have elapsed since the stream was started. \param status If non-zero, this argument indicates a data overflow or underflow condition for the stream. The particular condition can be determined by comparison with the RtAudioStreamStatus flags. \param userData A pointer to optional data provided by the client when opening the stream (default = NULL). To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two. */ typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData ); //! RtAudio error callback function prototype. /*! \param type Type of error. \param errorText Error description. */ typedef void (*RtAudioErrorCallback)( RtError::Type type, const std::string &errorText ); // **************************************************************** // // // RtAudio class declaration. // // RtAudio is a "controller" used to select an available audio i/o // interface. It presents a common API for the user to call but all // functionality is implemented by the class RtApi and its // subclasses. RtAudio creates an instance of an RtApi subclass // based on the user's API choice. If no choice is made, RtAudio // attempts to make a "logical" API selection. // // **************************************************************** // class RtApi; class RtAudio { public: //! Audio API specifier arguments. enum Api { UNSPECIFIED, /*!< Search for a working compiled API. */ LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */ LINUX_PULSE, /*!< The Linux PulseAudio API. */ LINUX_OSS, /*!< The Linux Open Sound System API. */ UNIX_JACK, /*!< The Jack Low-Latency Audio Server API. */ MACOSX_CORE, /*!< Macintosh OS-X Core Audio API. */ WINDOWS_ASIO, /*!< The Steinberg Audio Stream I/O API. */ WINDOWS_DS, /*!< The Microsoft Direct Sound API. */ RTAUDIO_DUMMY /*!< A compilable but non-functional API. */ }; //! The public device information structure for returning queried values. struct DeviceInfo { bool probed; /*!< true if the device capabilities were successfully probed. */ std::string name; /*!< Character string device identifier. */ unsigned int outputChannels; /*!< Maximum output channels supported by device. */ unsigned int inputChannels; /*!< Maximum input channels supported by device. */ unsigned int duplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */ bool isDefaultOutput; /*!< true if this is the default output device. */ bool isDefaultInput; /*!< true if this is the default input device. */ std::vector sampleRates; /*!< Supported sample rates (queried from list of standard rates). */ RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */ // Default constructor. DeviceInfo() :probed(false), outputChannels(0), inputChannels(0), duplexChannels(0), isDefaultOutput(false), isDefaultInput(false), nativeFormats(0) {} }; //! The structure for specifying input or ouput stream parameters. struct StreamParameters { unsigned int deviceId; /*!< Device index (0 to getDeviceCount() - 1). */ unsigned int nChannels; /*!< Number of channels. */ unsigned int firstChannel; /*!< First channel index on device (default = 0). */ // Default constructor. StreamParameters() : deviceId(0), nChannels(0), firstChannel(0) {} }; //! The structure for specifying stream options. /*! The following flags can be OR'ed together to allow a client to make changes to the default stream behavior: - \e RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved). - \e RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency. - \e RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use. - \e RTAUDIO_SCHEDULE_REALTIME: Attempt to select realtime scheduling for callback thread. - \e RTAUDIO_ALSA_USE_DEFAULT: Use the "default" PCM device (ALSA only). By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with \c nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index \c nFrames (assuming the \c buffer pointer was recast to the correct data type for the stream). Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance. If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs. If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. The \c priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME flag is set. It defines the thread's realtime priority. If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to open the "default" PCM device when using the ALSA API. Note that this will override any specified input or output device id. The \c numberOfBuffers parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the RtAudio::openStream() function by the value actually used by the system. The \c streamName parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of RtAudio with Jack, each instance must have a unique client name. */ struct StreamOptions { RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE, RTAUDIO_ALSA_USE_DEFAULT). */ unsigned int numberOfBuffers; /*!< Number of stream buffers. */ std::string streamName; /*!< A stream name (currently used only in Jack). */ int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */ // Default constructor. StreamOptions() : flags(0), numberOfBuffers(0), priority(0) {} }; //! A static function to determine the current RtAudio version. static std::string getVersion( void ) { return VERSION; } //! A static function to determine the available compiled audio APIs. /*! The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems. */ static void getCompiledApi( std::vector &apis ) throw(); //! The class constructor. /*! The constructor performs minor initialization tasks. No exceptions can be thrown. If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems). */ RtAudio( RtAudio::Api api=UNSPECIFIED ) throw(); //! The destructor. /*! If a stream is running or open, it will be stopped and closed automatically. */ ~RtAudio() throw(); //! Returns the audio API specifier for the current instance of RtAudio. RtAudio::Api getCurrentApi( void ) throw(); //! A public function that queries for the number of audio devices available. /*! This function performs a system query of available devices each time it is called, thus supporting devices connected \e after instantiation. If a system error occurs during processing, a warning will be issued. */ unsigned int getDeviceCount( void ) throw(); //! Return an RtAudio::DeviceInfo structure for a specified device number. /*! Any device integer between 0 and getDeviceCount() - 1 is valid. If an invalid argument is provided, an RtError (type = INVALID_USE) will be thrown. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the corresponding "isDefault" member will have a value of "true". */ RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); //! A function that returns the index of the default output device. /*! If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. */ unsigned int getDefaultOutputDevice( void ) throw(); //! A function that returns the index of the default input device. /*! If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. */ unsigned int getDefaultInputDevice( void ) throw(); //! A public function for opening a stream with the specified parameters. /*! An RtError (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An RtError (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified. \param outputParameters Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1. \param inputParameters Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1. \param format An RtAudioFormat specifying the desired sample data format. \param sampleRate The desired sample rate (sample frames per second). \param *bufferFrames A pointer to a value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. \param callback A client-defined function that will be invoked when input data is available and/or output data is needed. \param userData An optional pointer to data that can be accessed from within the callback function. \param options An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-specific median value is chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent. \param errorCallback A client-defined function that will be invoked when an error has occured. */ void openStream( RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData = NULL, RtAudio::StreamOptions *options = NULL, RtAudioErrorCallback errorCallback = NULL ); //! A function that closes a stream and frees any associated stream memory. /*! If a stream is not open, this function issues a warning and returns (no exception is thrown). */ void closeStream( void ) throw(); //! A function that starts a stream. /*! An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running. */ void startStream( void ); //! Stop a stream, allowing any samples remaining in the output queue to be played. /*! An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. */ void stopStream( void ); //! Stop a stream, discarding any samples remaining in the input/output queue. /*! An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. */ void abortStream( void ); //! Returns true if a stream is open and false if not. bool isStreamOpen( void ) const throw(); //! Returns true if the stream is running and false if it is stopped or not open. bool isStreamRunning( void ) const throw(); //! Returns the number of elapsed seconds since the stream was started. /*! If a stream is not open, an RtError (type = INVALID_USE) will be thrown. */ double getStreamTime( void ); //! Returns the internal stream latency in sample frames. /*! The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an RtError (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero. */ long getStreamLatency( void ); //! Returns actual sample rate in use by the stream. /*! On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an RtError (type = INVALID_USE) will be thrown. */ unsigned int getStreamSampleRate( void ); //! Specify whether warning messages should be printed to stderr. void showWarnings( bool value = true ) throw(); protected: void openRtApi( RtAudio::Api api ); RtApi *rtapi_; }; // Operating system dependent thread functionality. #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__) #include #include typedef unsigned long ThreadHandle; typedef CRITICAL_SECTION StreamMutex; #elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__) // Using pthread library for various flavors of unix. #include typedef pthread_t ThreadHandle; typedef pthread_mutex_t StreamMutex; #else // Setup for "dummy" behavior #define __RTAUDIO_DUMMY__ typedef int ThreadHandle; typedef int StreamMutex; #endif // This global structure type is used to pass callback information // between the private RtAudio stream structure and global callback // handling functions. struct CallbackInfo { void *object; // Used as a "this" pointer. ThreadHandle thread; void *callback; void *userData; void *errorCallback; void *apiInfo; // void pointer for API specific callback information bool isRunning; bool doRealtime; int priority; // Default constructor. CallbackInfo() :object(0), callback(0), userData(0), errorCallback(0), apiInfo(0), isRunning(false), doRealtime(false) {} }; // **************************************************************** // // // RtApi class declaration. // // Subclasses of RtApi contain all API- and OS-specific code necessary // to fully implement the RtAudio API. // // Note that RtApi is an abstract base class and cannot be // explicitly instantiated. The class RtAudio will create an // instance of an RtApi subclass (RtApiOss, RtApiAlsa, // RtApiJack, RtApiCore, RtApiDs, or RtApiAsio). // // **************************************************************** // #pragma pack(push, 1) class S24 { protected: unsigned char c3[3]; public: S24() {} S24& operator = ( const int& i ) { c3[0] = (i & 0x000000ff); c3[1] = (i & 0x0000ff00) >> 8; c3[2] = (i & 0x00ff0000) >> 16; return *this; } S24( const S24& v ) { *this = v; } S24( const double& d ) { *this = (int) d; } S24( const float& f ) { *this = (int) f; } S24( const signed short& s ) { *this = (int) s; } S24( const char& c ) { *this = (int) c; } int asInt() { int i = c3[0] | (c3[1] << 8) | (c3[2] << 16); if (i & 0x800000) i |= ~0xffffff; return i; } }; #pragma pack(pop) #if defined( HAVE_GETTIMEOFDAY ) #include #endif #include class RtApi { public: RtApi(); virtual ~RtApi(); virtual RtAudio::Api getCurrentApi( void ) = 0; virtual unsigned int getDeviceCount( void ) = 0; virtual RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) = 0; virtual unsigned int getDefaultInputDevice( void ); virtual unsigned int getDefaultOutputDevice( void ); void openStream( RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData, RtAudio::StreamOptions *options, RtAudioErrorCallback errorCallback ); virtual void closeStream( void ); virtual void startStream( void ) = 0; virtual void stopStream( void ) = 0; virtual void abortStream( void ) = 0; long getStreamLatency( void ); unsigned int getStreamSampleRate( void ); virtual double getStreamTime( void ); bool isStreamOpen( void ) const { return stream_.state != STREAM_CLOSED; } bool isStreamRunning( void ) const { return stream_.state == STREAM_RUNNING; } void showWarnings( bool value ) { showWarnings_ = value; } protected: static const unsigned int MAX_SAMPLE_RATES; static const unsigned int SAMPLE_RATES[]; enum { FAILURE, SUCCESS }; enum StreamState { STREAM_STOPPED, STREAM_STOPPING, STREAM_RUNNING, STREAM_CLOSED = -50 }; enum StreamMode { OUTPUT, INPUT, DUPLEX, UNINITIALIZED = -75 }; // A protected structure used for buffer conversion. struct ConvertInfo { int channels; int inJump, outJump; RtAudioFormat inFormat, outFormat; std::vector inOffset; std::vector outOffset; }; // A protected structure for audio streams. struct RtApiStream { unsigned int device[2]; // Playback and record, respectively. void *apiHandle; // void pointer for API specific stream handle information StreamMode mode; // OUTPUT, INPUT, or DUPLEX. StreamState state; // STOPPED, RUNNING, or CLOSED char *userBuffer[2]; // Playback and record, respectively. char *deviceBuffer; bool doConvertBuffer[2]; // Playback and record, respectively. bool userInterleaved; bool deviceInterleaved[2]; // Playback and record, respectively. bool doByteSwap[2]; // Playback and record, respectively. unsigned int sampleRate; unsigned int bufferSize; unsigned int nBuffers; unsigned int nUserChannels[2]; // Playback and record, respectively. unsigned int nDeviceChannels[2]; // Playback and record channels, respectively. unsigned int channelOffset[2]; // Playback and record, respectively. unsigned long latency[2]; // Playback and record, respectively. RtAudioFormat userFormat; RtAudioFormat deviceFormat[2]; // Playback and record, respectively. StreamMutex mutex; CallbackInfo callbackInfo; ConvertInfo convertInfo[2]; double streamTime; // Number of elapsed seconds since the stream started. #if defined(HAVE_GETTIMEOFDAY) struct timeval lastTickTimestamp; #endif RtApiStream() :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; } }; typedef S24 Int24; typedef signed short Int16; typedef signed int Int32; typedef float Float32; typedef double Float64; std::ostringstream errorStream_; std::string errorText_; bool showWarnings_; RtApiStream stream_; /*! Protected, api-specific method that attempts to open a device with the given parameters. This function MUST be implemented by all subclasses. If an error is encountered during the probe, a "warning" message is reported and FAILURE is returned. A successful probe is indicated by a return value of SUCCESS. */ virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); //! A protected function used to increment the stream time. void tickStreamTime( void ); //! Protected common method to clear an RtApiStream structure. void clearStreamInfo(); /*! Protected common method that throws an RtError (type = INVALID_USE) if a stream is not open. */ void verifyStream( void ); //! Protected common error method to allow global control over error handling. void error( RtError::Type type ); /*! Protected method used to perform format, channel number, and/or interleaving conversions between the user and device buffers. */ void convertBuffer( char *outBuffer, char *inBuffer, ConvertInfo &info ); //! Protected common method used to perform byte-swapping on buffers. void byteSwapBuffer( char *buffer, unsigned int samples, RtAudioFormat format ); //! Protected common method that returns the number of bytes for a given format. unsigned int formatBytes( RtAudioFormat format ); //! Protected common method that sets up the parameters for buffer conversion. void setConvertInfo( StreamMode mode, unsigned int firstChannel ); }; // **************************************************************** // // // Inline RtAudio definitions. // // **************************************************************** // inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); } inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); } inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); } inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); } inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); } inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); } inline void RtAudio :: stopStream( void ) { return rtapi_->stopStream(); } inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); } inline bool RtAudio :: isStreamOpen( void ) const throw() { return rtapi_->isStreamOpen(); } inline bool RtAudio :: isStreamRunning( void ) const throw() { return rtapi_->isStreamRunning(); } inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); } inline unsigned int RtAudio :: getStreamSampleRate( void ) { return rtapi_->getStreamSampleRate(); } inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); } inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); } // RtApi Subclass prototypes. #if defined(__MACOSX_CORE__) #include class RtApiCore: public RtApi { public: RtApiCore(); ~RtApiCore(); RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); unsigned int getDefaultOutputDevice( void ); unsigned int getDefaultInputDevice( void ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); long getStreamLatency( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! bool callbackEvent( AudioDeviceID deviceId, const AudioBufferList *inBufferList, const AudioBufferList *outBufferList ); private: bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); static const char* getErrorCode( OSStatus code ); }; #endif #if defined(__UNIX_JACK__) class RtApiJack: public RtApi { public: RtApiJack(); ~RtApiJack(); RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); long getStreamLatency( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! bool callbackEvent( unsigned long nframes ); private: bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__WINDOWS_ASIO__) class RtApiAsio: public RtApi { public: RtApiAsio(); ~RtApiAsio(); RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); long getStreamLatency( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! bool callbackEvent( long bufferIndex ); private: std::vector devices_; void saveDeviceInfo( void ); bool coInitialized_; bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__WINDOWS_DS__) class RtApiDs: public RtApi { public: RtApiDs(); ~RtApiDs(); RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; } unsigned int getDeviceCount( void ); unsigned int getDefaultOutputDevice( void ); unsigned int getDefaultInputDevice( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); long getStreamLatency( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! void callbackEvent( void ); private: bool coInitialized_; bool buffersRolling; long duplexPrerollBytes; std::vector dsDevices; bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__LINUX_ALSA__) class RtApiAlsa: public RtApi { public: RtApiAlsa(); ~RtApiAlsa(); RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! void callbackEvent( void ); private: std::vector devices_; void saveDeviceInfo( void ); bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__LINUX_PULSE__) class RtApiPulse: public RtApi { public: ~RtApiPulse(); RtAudio::Api getCurrentApi() { return RtAudio::LINUX_PULSE; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! void callbackEvent( void ); private: std::vector devices_; void saveDeviceInfo( void ); bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__LINUX_OSS__) class RtApiOss: public RtApi { public: RtApiOss(); ~RtApiOss(); RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; } unsigned int getDeviceCount( void ); RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); void closeStream( void ); void startStream( void ); void stopStream( void ); void abortStream( void ); // This function is intended for internal use only. It must be // public because it is called by the internal callback handler, // which is not a member of RtAudio. External use of this function // will most likely produce highly undesireable results! void callbackEvent( void ); private: bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, RtAudioFormat format, unsigned int *bufferSize, RtAudio::StreamOptions *options ); }; #endif #if defined(__RTAUDIO_DUMMY__) class RtApiDummy: public RtApi { public: RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtError::WARNING ); } RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; } unsigned int getDeviceCount( void ) { return 0; } RtAudio::DeviceInfo getDeviceInfo( unsigned int /*device*/ ) { RtAudio::DeviceInfo info; return info; } void closeStream( void ) {} void startStream( void ) {} void stopStream( void ) {} void abortStream( void ) {} private: bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/, unsigned int /*firstChannel*/, unsigned int /*sampleRate*/, RtAudioFormat /*format*/, unsigned int * /*bufferSize*/, RtAudio::StreamOptions * /*options*/ ) { return false; } }; #endif #endif // Indentation settings for Vim and Emacs // // Local Variables: // c-basic-offset: 2 // indent-tabs-mode: nil // End: // // vim: et sts=2 sw=2 libmapper/examples/pwm_synth/Makefile.in0000644000175000017500000005111212423630127017734 0ustar tiagotiago# 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 = examples/pwm_synth DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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 = LTLIBRARIES = $(noinst_LTLIBRARIES) libpwm_la_LIBADD = am__libpwm_la_SOURCES_DIST = pwm.cpp RtAudio.cpp @HAVE_AUDIO_TRUE@am_libpwm_la_OBJECTS = libpwm_la-pwm.lo \ @HAVE_AUDIO_TRUE@ libpwm_la-RtAudio.lo libpwm_la_OBJECTS = $(am_libpwm_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 = libpwm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libpwm_la_CXXFLAGS) \ $(CXXFLAGS) $(libpwm_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_AUDIO_TRUE@am_libpwm_la_rpath = 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 = SOURCES = $(libpwm_la_SOURCES) DIST_SOURCES = $(am__libpwm_la_SOURCES_DIST) 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ @HAVE_AUDIO_TRUE@noinst_LTLIBRARIES = libpwm.la @HAVE_AUDIO_TRUE@libpwm_la_CXXFLAGS = -Wall @RTAUDIO_CFLAGS@ @HAVE_AUDIO_TRUE@libpwm_la_SOURCES = pwm.cpp RtAudio.cpp @HAVE_AUDIO_TRUE@libpwm_la_LDFLAGS = -export-dynamic -version-info @SO_VERSION@ @HAVE_AUDIO_TRUE@EXTRA_DIST = pwm.h RtAudio.h RtError.h RtAudio-readme.txt README.md all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/pwm_synth/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/pwm_synth/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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}; \ } libpwm.la: $(libpwm_la_OBJECTS) $(libpwm_la_DEPENDENCIES) $(EXTRA_libpwm_la_DEPENDENCIES) $(AM_V_CXXLD)$(libpwm_la_LINK) $(am_libpwm_la_rpath) $(libpwm_la_OBJECTS) $(libpwm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpwm_la-RtAudio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpwm_la-pwm.Plo@am__quote@ .cpp.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 $@ $< .cpp.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) '$<'` .cpp.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 $@ $< libpwm_la-pwm.lo: pwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpwm_la_CXXFLAGS) $(CXXFLAGS) -MT libpwm_la-pwm.lo -MD -MP -MF $(DEPDIR)/libpwm_la-pwm.Tpo -c -o libpwm_la-pwm.lo `test -f 'pwm.cpp' || echo '$(srcdir)/'`pwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpwm_la-pwm.Tpo $(DEPDIR)/libpwm_la-pwm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='pwm.cpp' object='libpwm_la-pwm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpwm_la_CXXFLAGS) $(CXXFLAGS) -c -o libpwm_la-pwm.lo `test -f 'pwm.cpp' || echo '$(srcdir)/'`pwm.cpp libpwm_la-RtAudio.lo: RtAudio.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpwm_la_CXXFLAGS) $(CXXFLAGS) -MT libpwm_la-RtAudio.lo -MD -MP -MF $(DEPDIR)/libpwm_la-RtAudio.Tpo -c -o libpwm_la-RtAudio.lo `test -f 'RtAudio.cpp' || echo '$(srcdir)/'`RtAudio.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libpwm_la-RtAudio.Tpo $(DEPDIR)/libpwm_la-RtAudio.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RtAudio.cpp' object='libpwm_la-RtAudio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpwm_la_CXXFLAGS) $(CXXFLAGS) -c -o libpwm_la-RtAudio.lo `test -f 'RtAudio.cpp' || echo '$(srcdir)/'`RtAudio.cpp 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 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 $(LTLIBRARIES) 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: 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-generic clean-libtool clean-noinstLTLIBRARIES \ 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: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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 \ 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: libmapper/examples/pwm_synth/README.md0000644000175000017500000000113612423630127017147 0ustar tiagotiago # pwm_synth README In order to include an audio example, the libmapper source code release embeds the excellent RtAudio C++ library for cross-platform audio support. The license for RtAudio can be found in the file `RtAudio-readme.txt`. Note that RtAudio is not installed with libmapper, but is included only for example purposes. Since it does not affect the installed binaries, we expect that the inclusion of the RtAudio source in our tarball will not cause concern to packagers. However, if there are any such concerns raised, please don't hesitate to contact the libmapper developers about them. libmapper/examples/pwm_synth/Makefile.am0000644000175000017500000000041312423630127017721 0ustar tiagotiago if HAVE_AUDIO noinst_LTLIBRARIES = libpwm.la libpwm_la_CXXFLAGS = -Wall @RTAUDIO_CFLAGS@ libpwm_la_SOURCES = pwm.cpp RtAudio.cpp libpwm_la_LDFLAGS = -export-dynamic -version-info @SO_VERSION@ EXTRA_DIST = pwm.h RtAudio.h RtError.h RtAudio-readme.txt README.md endif libmapper/examples/pwm_synth/RtError.h0000644000175000017500000000413012423630127017435 0ustar tiagotiago/************************************************************************/ /*! \class RtError \brief Exception handling class for RtAudio & RtMidi. The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. See the RtAudio and RtMidi documentation to know which methods can throw an RtError. */ /************************************************************************/ #ifndef RTERROR_H #define RTERROR_H #include #include #include class RtError : public std::exception { public: //! Defined RtError types. enum Type { WARNING, /*!< A non-critical error. */ DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */ UNSPECIFIED, /*!< The default, unspecified error type. */ NO_DEVICES_FOUND, /*!< No devices found on system. */ INVALID_DEVICE, /*!< An invalid device ID was specified. */ MEMORY_ERROR, /*!< An error occured during memory allocation. */ INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */ INVALID_USE, /*!< The function was called incorrectly. */ DRIVER_ERROR, /*!< A system driver error occured. */ SYSTEM_ERROR, /*!< A system error occured. */ THREAD_ERROR /*!< A thread error occured. */ }; //! The constructor. RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {} //! The destructor. virtual ~RtError( void ) throw() {} //! Prints thrown error message to stderr. virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } //! Returns the thrown error message type. virtual const Type& getType(void) const throw() { return type_; } //! Returns the thrown error message string. virtual const std::string& getMessage(void) const throw() { return message_; } //! Returns the thrown error message as a c-style string. virtual const char* what( void ) const throw() { return message_.c_str(); } protected: std::string message_; Type type_; }; #endif libmapper/examples/Makefile.am0000644000175000017500000000055112423630127015674 0ustar tiagotiago SUBDIRS = pwm_synth if HAVE_SWIG if HAVE_AUDIO SUBDIRS += py_tk_gui endif endif if HAVE_AUDIO bin_PROGRAMS = pwm_example pwm_example_CXXFLAGS = -Wall -I$(top_srcdir)/include $(liblo_CFLAGS) pwm_example_SOURCES = pwm_example.cpp pwm_example_LDADD = pwm_synth/libpwm.la \ $(top_builddir)/src/libmapper-@MAJOR_VERSION@.la \ @RTAUDIO_LIBS@ $(liblo_LIBS) endif libmapper/examples/py_tk_gui/0000755000175000017500000000000012423630127015631 5ustar tiagotiagolibmapper/examples/py_tk_gui/Makefile.in0000644000175000017500000003226312423630127017704 0ustar tiagotiago# 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 = examples/py_tk_gui DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/setup.py.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(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 = setup.py 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 = 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) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAR = @JAR@ JAVAC = @JAVAC@ JAVAH = @JAVAH@ JNI = @JNI@ JNIPATH = @JNIPATH@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLO = @LIBLO@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ 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@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ PYEXT = @PYEXT@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RTAUDIO_CFLAGS = @RTAUDIO_CFLAGS@ RTAUDIO_LIBS = @RTAUDIO_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ SWIG = @SWIG@ SWIGDIR = @SWIGDIR@ 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@ ax_pthread_config = @ax_pthread_config@ 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@ liblo_CFLAGS = @liblo_CFLAGS@ liblo_LIBS = @liblo_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ 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@ _CXX = $(filter-out ccache,$(CXX)) EXTRA_DIST = pwm.i tk_pwm.py all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/py_tk_gui/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign examples/py_tk_gui/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: 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 all-local 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: 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-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic 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 -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am distclean \ distclean-generic distclean-libtool 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-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am all-local: _pwm.$(PYEXT) $(top_builddir)/examples/pwm_synth/libpwm.la $(builddir)/%_wrap.cxx $(buildir)/%.py: %.i $(SWIG) -I$(top_srcdir)/examples/pwm_synth -I$(top_srcdir)/include -c++ \ -python -o $(builddir)/pwm_wrap.cxx $(srcdir)/pwm.i # Don't interfere with distutils CFLAGS _%.$(PYEXT): $(builddir)/%_wrap.cxx pwd cd $(builddir) && env CFLAGS="" CXX="$(_CXX)" python setup.py build_ext -@mv -v build/lib.*/$@ . -@rm -rf build clean-local: -@rm -vf _pwm.$(PYEXT) pwm.py pwm_wrap.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libmapper/examples/py_tk_gui/setup.py.in0000644000175000017500000000130512423630127017747 0ustar tiagotiago#!/usr/bin/env python """ setup.py file for SWIG pwm """ from distutils.core import setup, Extension top = '..' pwm_module = Extension('_pwm', sources=['pwm_wrap.cxx'], include_dirs=['@top_srcdir@/examples/pwm_synth'], library_dirs=['@top_builddir@/examples/pwm_synth/.libs'], libraries=['pwm'], extra_link_args='@RTAUDIO_LIBS@'.split(), ) setup (name = 'pwm', version = '@VERSION@', author = "IDMIL", description = """Simple PWM audio synth example for libmapper""", ext_modules = [pwm_module], py_modules = ["pwm"], ) libmapper/examples/py_tk_gui/pwm.i0000644000175000017500000000006412423630127016606 0ustar tiagotiago%module pwm %{ #include "pwm.h" %} %include "pwm.h" libmapper/examples/py_tk_gui/tk_pwm.py0000755000175000017500000000437512423630127017520 0ustar tiagotiago#!/usr/bin/env python import pwm import time import Tkinter import sys, os try: import mapper except: try: # Try the "swig" directory, relative to the location of this # program, which is where it should be if the module has been # compiled but not installed. sys.path.append( os.path.join(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0])), '../../swig')) import mapper except: print 'Error importing libmapper module.' sys.exit(1) def main(): if pwm.run_synth()==0: print "Error running synth." return try: window = Tkinter.Tk() window.title("libmapper PWM synth demo") name = [False, Tkinter.StringVar()] name[1].set("Waiting for device name...") label = Tkinter.Label(window, textvariable=name[1]) label.pack() gain = Tkinter.Scale(window, from_=0, to=100, label='gain', orient=Tkinter.HORIZONTAL, length=300, command=lambda n: pwm.set_gain(float(n)/100.0)) gain.pack() freq = Tkinter.Scale(window, from_=0, to=1000, label='freq', orient=Tkinter.HORIZONTAL, length=300, command=lambda n: pwm.set_freq(float(n))) freq.pack() duty = Tkinter.Scale(window, from_=0, to=100, label='duty', orient=Tkinter.HORIZONTAL, length=300, command=lambda n: pwm.set_duty(float(n)/100.0)) duty.pack() dev = mapper.device("tk_pwm", 9000) dev.add_input("/gain", 1, 'f', None, 0, 100, lambda s,i,n,t: gain.set(n)) dev.add_input("/freq", 1, 'f', "Hz", 0, 1000, lambda s,i,n,t: freq.set(n)) dev.add_input("/duty", 1, 'f', None, 0, 100, lambda s,i,n,t: duty.set(n)) def do_poll(): dev.poll(0) if not name[0] and dev.ready(): name[0] = True name[1].set('Device name: %s, listening on port %d' %(dev.name, dev.port)) window.after(5, do_poll) do_poll() window.mainloop() finally: pwm.stop_synth() main() libmapper/examples/py_tk_gui/Makefile.am0000644000175000017500000000106512423630127017667 0ustar tiagotiago _CXX = $(filter-out ccache,$(CXX)) all-local: _pwm.$(PYEXT) $(top_builddir)/examples/pwm_synth/libpwm.la $(builddir)/%_wrap.cxx $(buildir)/%.py: %.i $(SWIG) -I$(top_srcdir)/examples/pwm_synth -I$(top_srcdir)/include -c++ \ -python -o $(builddir)/pwm_wrap.cxx $(srcdir)/pwm.i # Don't interfere with distutils CFLAGS _%.$(PYEXT): $(builddir)/%_wrap.cxx pwd cd $(builddir) && env CFLAGS="" CXX="$(_CXX)" python setup.py build_ext -@mv -v build/lib.*/$@ . -@rm -rf build clean-local: -@rm -vf _pwm.$(PYEXT) pwm.py pwm_wrap.c EXTRA_DIST = pwm.i tk_pwm.py libmapper/examples/pyside_gui_label_example.py0000644000175000017500000000355412423630127021233 0ustar tiagotiago#!/usr/bin/env python import sys from PySide.QtCore import * from PySide.QtGui import * import mapper def h(dev, link, sig, con, action): id = con['src_name'] id = int(id[7]) if action == mapper.MDEV_LOCAL_ESTABLISHED: gui.labels[id].setText(link['dest_name']+con['dest_name']) else: gui.labels[id].setText('slider%i' %id) dev = mapper.device("pysideGUI") dev.set_connection_callback(h) sigs = [] for i in range(3): sigs.append(dev.add_output('/slider%i' %i, 1, 'f', None, 0, 1)) class gui(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.setGeometry(300, 300, 300, 300) self.setFixedSize(300, 300) self.setWindowTitle('libmapper device gui example') blurb = QLabel('These sliders will be dynamically labeled with the name of destination signals to which they are connected.', self) blurb.setGeometry(5, 0, 290, 50) blurb.setWordWrap(True) self.labels = [] self.sliders = [] for i in range(3): self.sliders.append(QSlider(Qt.Orientation.Horizontal, self)) self.sliders[i].setRange(0, 100) self.sliders[i].setGeometry(5, 100+i*75, 290, 20) self.labels.append(QLabel('slider%i' %i, self)) self.labels[i].setGeometry(5, 75+i*75, 290, 15) self.sliders[0].valueChanged.connect(lambda x: sigs[0].update(x*0.01)) self.sliders[1].valueChanged.connect(lambda x: sigs[1].update(x*0.01)) self.sliders[2].valueChanged.connect(lambda x: sigs[2].update(x*0.01)) self.timer = QBasicTimer() self.timer.start(500, self) def timerEvent(self, event): if event.timerId() == self.timer.timerId(): dev.poll() else: QtGui.QFrame.timerEvent(self, event) app = QApplication(sys.argv) gui = gui() gui.show() sys.exit(app.exec_()) libmapper/build_darwin_binaries.sh0000755000175000017500000002307312423630127016704 0ustar tiagotiago#!/bin/sh # This script compiles universal binaries of the libmapper library # and builds app bundles for the examples and a framework. ARCHES="i386 x86_64" SDK="/Developer/SDKs/MacOSX10.5.sdk" SDKC="--sysroot=$SDK" SDKLD="-lgcc_s.1" # Build darwin binaries for libmapper # First argument must be the path to a libmapper source tarball. LIBMAPPER_TAR="$1" LIBLO_TAR="$2" LIBMAPPER_VERSION=$(echo $LIBMAPPER_TAR|sed 's,.*libmapper-\(.*\).tar.gz,\1,') LIBMAPPER_MAJOR=$(echo $LIBMAPPER_VERSION|sed 's,\([0-9]\)\(\.[0-9]*\)*,\1,') LIBLO_VERSION=$(echo $LIBLO_TAR|sed 's,.*liblo-\(.*\).tar.gz,\1,') LIBLO_MAJOR=$(echo $LIBLO_VERSION|sed 's,\([0-9]\)\(\.[0-9]*\)*,\1,') if [ -z "$LIBMAPPER_TAR" ] || [ -z "$LIBLO_TAR" ]; then echo Usage: $0 '' '' exit fi # Get absolute paths LIBMAPPER_TAR="$PWD/$LIBMAPPER_TAR" LIBLO_TAR="$PWD/$LIBLO_TAR" mkdir -v binaries cd binaries function make_arch() { ARCH=$1 mkdir -v $ARCH cd $ARCH tar -xzf "$LIBLO_TAR" cd $(basename "$LIBLO_TAR" .tar.gz) if ./configure CFLAGS="-arch $ARCH $SDKC" CXXFLAGS="-arch $ARCH $SDKC $SDKCXX" LDFLAGS="-arch $ARCH $SDKC $SDKLD" --prefix=`pwd`/../install --enable-static --enable-dynamic && make && make install; then cd .. else echo Build error in arch $ARCH exit 1 fi tar -xzf "$LIBMAPPER_TAR" cd $(basename "$LIBMAPPER_TAR" .tar.gz) PREFIX=`pwd`/../install if env PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig ./configure --enable-debug CFLAGS="-arch $ARCH $SDKC -I$PREFIX/include" CXXFLAGS="-arch $ARCH $SDKC $SDKCXX -I$PREFIX/include" LDFLAGS="-arch $ARCH $SDKC $SDKLD -L$PREFIX/lib -Wl,-rpath,@loader_path/Frameworks -llo" --prefix=$PREFIX --enable-static --enable-dynamic; then install_name_tool \ -id @rpath/lo.framework/Versions/$LIBLO_MAJOR/lo \ ../install/lib/liblo.dylib || exit 1 install_name_tool \ -id @rpath/lo.framework/Versions/$LIBLO_MAJOR/lo \ ../install/lib/liblo.7.dylib || exit 1 if make && make install; then cd .. else echo Build error in arch $ARCH exit 1 fi else echo Build error in arch $ARCH exit 1 fi install_name_tool \ -id @rpath/mapper.framework/Versions/$LIBMAPPER_MAJOR/mapper \ install/lib/libmapper-$LIBMAPPER_MAJOR.dylib || exit 1 install_name_tool \ -id @rpath/mapper.framework/Versions/$LIBMAPPER_MAJOR/mapper \ install/lib/libmapper-$LIBMAPPER_VERSION.dylib || exit 1 cd .. } function rebuild_python_extentions() { ARCH=$1 cd $ARCH PREFIX=`pwd`/install cd libmapper-$LIBMAPPER_VERSION/swig make mapper_wrap.c gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch $ARCH -pipe -I../src -I../include -I$PREFIX/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c mapper_wrap.c -o mapper_wrap.o gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch $ARCH $SDKC $SDKLD mapper_wrap.o $PREFIX/lib/liblo.a $PREFIX/lib/libmapper-0.a -lpthread -o _mapper.so cd ../examples/py_tk_gui make pwm_wrap.cxx gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch $ARCH -pipe -I../../src -I../../include -I../pwm_synth -I$PREFIX/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c pwm_wrap.cxx -o pwm_wrap.o gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch $ARCH $SDKC $SDKLD pwm_wrap.o ../pwm_synth/.libs/libpwm.a -lpthread -o _pwm.so -framework CoreAudio -framework CoreFoundation cd ../../../.. } function use_lipo() { mkdir -v all mkdir -v all/lib for i in i386/install/lib/*.{dylib,a}; do ARCHFILES="" for a in $ARCHES; do ARCHFILES="$ARCHFILES -arch $a $a/install/lib/$(basename $i)" done lipo -create -output all/lib/$(basename $i) $ARCHFILES done mkdir -v all/python for i in libmapper-0.2/examples/py_tk_gui/_pwm.so libmapper-0.2/swig/_mapper.so; do ARCHFILES="" for a in $ARCHES; do ARCHFILES="$ARCHFILES -arch $a $a/$i" done lipo -create -output all/python/$(basename $i) $ARCHFILES done } function info_plist() { FILENAME=$1 NAME=$2 EXECNAME=$3 cat >$FILENAME < CFBundleDevelopmentRegion English CFBundleDisplayName $NAME CFBundleExecutable $EXECNAME CFBundleIdentifier org.idmil.$NAME CFBundleInfoDictionaryVersion 6.0 CFBundleName $NAME CFBundleIconFile libmapper_doc.icns CFBundlePackageType APPL CFBundleShortVersionString $LIBMAPPER_VERSION CFBundleVersion 273 LSMinimumSystemVersion 10.5 EOF } function make_bundles() { mkdir -v bundles APP=bundles/libmapper_PWM_Example.app mkdir -v $APP mkdir -v $APP/Contents mkdir -v $APP/Contents/MacOS mkdir -v $APP/Contents/Resources cp -v all/python/_mapper.so $APP/Contents/MacOS/ cp -v all/python/_pwm.so $APP/Contents/MacOS/ cp -v i386/libmapper-$LIBMAPPER_VERSION/swig/mapper.py $APP/Contents/MacOS/ cp -v i386/libmapper-$LIBMAPPER_VERSION/examples/py_tk_gui/pwm.py $APP/Contents/MacOS/ cp -v i386/libmapper-$LIBMAPPER_VERSION/examples/py_tk_gui/tk_pwm.py $APP/Contents/MacOS/ echo 'APPL????' >$APP/Contents/PkgInfo info_plist $APP/Contents/Info.plist libmapper_PWM_Example tk_pwm.py cp -v ../icons/libmapper_doc.icns $APP/Contents/Resources/ APP=bundles/libmapper_Slider_Example.app mkdir -v $APP mkdir -v $APP/Contents mkdir -v $APP/Contents/MacOS mkdir -v $APP/Contents/Resources cp -v all/python/_mapper.so $APP/Contents/MacOS/ cp -v i386/libmapper-$LIBMAPPER_VERSION/swig/mapper.py $APP/Contents/MacOS/ cp -v i386/libmapper-$LIBMAPPER_VERSION/swig/tkgui.py $APP/Contents/MacOS/ echo 'APPL????' >$APP/Contents/PkgInfo info_plist $APP/Contents/Info.plist libmapper_Slider_Example tkgui.py cp -v ../icons/libmapper_doc.icns $APP/Contents/Resources/ APP=bundles/libmapper_Slider_Launcher.app mkdir -v $APP mkdir -v $APP/Contents mkdir -v $APP/Contents/MacOS mkdir -v $APP/Contents/Resources cp -v i386/libmapper-$LIBMAPPER_VERSION/extra/osx/libmapper_slider_launcher.py $APP/Contents/MacOS/ echo 'APPL????' >$APP/Contents/PkgInfo info_plist $APP/Contents/Info.plist libmapper_Slider_Launcher libmapper_slider_launcher.py cp -v ../icons/libmapper_doc.icns $APP/Contents/Resources/ FRAMEWORK=bundles/mapper.framework mkdir -v $FRAMEWORK mkdir -v $FRAMEWORK/Contents mkdir -v $FRAMEWORK/Versions mkdir -v $FRAMEWORK/Versions/$LIBMAPPER_MAJOR cp -v all/lib/libmapper-$LIBMAPPER_VERSION.dylib \ $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/mapper chmod 664 $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/mapper mkdir -v $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/Headers cp -rv i386/install/include/mapper-$LIBMAPPER_MAJOR/mapper/* \ $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/Headers/ find $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/Headers -type f \ -exec chmod 664 {} \; ln -s Versions/$LIBMAPPER_MAJOR/mapper $FRAMEWORK/mapper ln -s Versions/$LIBMAPPER_MAJOR/Headers $FRAMEWORK/Headers ln -s $LIBMAPPER_MAJOR $FRAMEWORK/Versions/Current cat >$FRAMEWORK/Contents/Info.plist < CFBundlePackageType FMWK CFBundleShortVersionString 4.7 CFBundleGetInfoString CFBundleSignature ???? CFBundleExecutable mapper EOF # Subframework for liblo mkdir $FRAMEWORK/Versions/$LIBMAPPER_MAJOR/Frameworks ln -s Versions/$LIBMAPPER_MAJOR/Frameworks $FRAMEWORK/Frameworks FRAMEWORK=$FRAMEWORK/Versions/0/Frameworks/lo.framework mkdir -v $FRAMEWORK mkdir -v $FRAMEWORK/Contents mkdir -v $FRAMEWORK/Versions mkdir -v $FRAMEWORK/Versions/$LIBLO_MAJOR cp -v all/lib/liblo.dylib $FRAMEWORK/Versions/$LIBLO_MAJOR/lo chmod 664 $FRAMEWORK/Versions/$LIBLO_MAJOR/lo mkdir -v $FRAMEWORK/Versions/$LIBLO_MAJOR/Headers cp -rv i386/install/include/lo/* \ $FRAMEWORK/Versions/$LIBLO_MAJOR/Headers/ find $FRAMEWORK/Versions/$LIBLO_MAJOR/Headers -type f -exec chmod 664 {} \; ln -s Versions/$LIBLO_MAJOR/lo $FRAMEWORK/lo ln -s Versions/$LIBLO_MAJOR/Headers $FRAMEWORK/Headers ln -s $LIBLO_MAJOR $FRAMEWORK/Versions/Current cat >$FRAMEWORK/Contents/Info.plist < CFBundlePackageType FMWK CFBundleShortVersionString 4.7 CFBundleGetInfoString CFBundleSignature ???? CFBundleExecutable lo EOF } for i in $ARCHES; do make_arch $i; done for i in $ARCHES; do rebuild_python_extentions $i; done use_lipo make_bundles echo Done.