Togl2.0/0000755000175500010010000000000011003223663010741 5ustar gregcNoneTogl2.0/aclocal.m40000664000175500010010000000166210715006711012612 0ustar gregcNone# # Include the TEA standard macro set # builtin(include,tclconfig/tcl.m4) # # Add here whatever m4 macros you want to define for your package # #------------------------------------------------------------------------ # TOGL_ENABLE_STUBS -- # # Specifiy if stubs should be used. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-stubs # #------------------------------------------------------------------------ AC_DEFUN(TOGL_ENABLE_STUBS, [ AC_MSG_CHECKING([whether to link with stubs library]) AC_ARG_ENABLE(stubs, [ --enable-stubs build and link with stub libraries (--enable-stubs)], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_stubs+set}" = set; then enableval="$enable_stubs" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([stubs]) USE_STUBS=1 else AC_MSG_RESULT([no stubs]) USE_STUBS=0 fi ]) Togl2.0/ben.rgb0000664000175500010010000014144710534514446012230 0ustar gregcNoneno nameXj} 0!#;$&G')T*,U-/]02a35b68\9;V<>f?AwCDF GIJLMOPRSU VXY[\u]_Y`b>ce"fh i{jlPmo"pqsLtv wXxy{%|^}~%477*&2/.& o}Tf5Ob#Y7ymBjB]>'rD l3FkN‘Sg{$ "6#%>&(K)+S,.U/1]24]57^8:W;=c>@lACEFH IKLNOQRTUWXZ[x\^b_aEbd&eghikbln1oqresuvvwyzQ{|} Famz|{zt>[sWLH ]+y\;{J X=mGX: l%rc¨_p !1"$;%'H(*U+-U.0Z13]46]79[:<^=?k@BDEGHJKMNPQSTVWYZ[]m^`Rac0dfghjnkmBnpq|rt5uvx6ytz{})~Zq/GMJqHfBm6eB+a4M!h5({ |}}|{|w}~~{{y||}xyx{yzw}z}{z{vxsxwpvrmslljhia\ZVZTTOP^J\XS[N3H<B7?^@>XG=A=9>?7:8=;GBICHIIO?9C<9C=ABH@DDHBMF@DIAAKE@FC9?0,0(!~~{~}~}}z}}||u}xvxtzx{ursvpkehfcbcbY\XSWOXXVZTLTK3<9@7B\C;VG:CEAAFDIFJEPMPLHLKOJJKMFHLIKLMPSMQNNJEJFDPIBGE<C:-5,!~~}}{|{|}|z|~z|y{yuwurmqlifeg_]\]\UUTVMZSRXL:@5>6VXLQXC=A>BCPFMPIHGMLOGH[VLBOJOZOJROIRUHNNLG@>KDMHGK?>>616'&e2!C!v2eC!2e2vCe!2eTe!!eܘ!eeCeee2eeeTeeTeTeeTe2e2e2!22CeCeeeeT!e2C22!!v22C!22ev2!22T2!!2e!2ܘ2C22e2T2eT22T2Te2˘2!2!2Ce2C2e222T!2C22!!v22C!22v2!22T2!!22!22Cee2ee2T2e2eT22T2eeT22!22C2e22C2e222eT!222Ce2!!2e!C22!!222!e2eee!eee2e2Ce2eeCeeTee!eCeTeeee!2e!!T2!veeeee4e2!!22!C2!!22e2!22e1!2ˇ2C2eC22T22!2e2ee2C22T2e2e2!22e!!T2!ve22222e22!!22!C2!!2e2!2e!242C2eC22T22!ee2eeCe2T2e22!222!!T2!ve22e2e222e2ee2TC!2!2e2!!2!2!eˇ22!ee2e!ee2eeeeeeeCee˘e2eܘeeTv2!!!eeCeeeee˘e2e˝T!2!22!!!!e22!22e22!22e22222C22e2222e2e2Tv2!!!2ee2C22e222e2T!!e2!!!!eˇ2!22e22!224e222e22e222e2C2eee2ee2e22Tv!!!2e2C2222ee22ee2e!e!C!22T!!!!Cee2e!ܘee!evee2eeCee2eeeCTeeeeeeeTe!ee!!!CveTeeeee!e!eee22!ee!!22T!!!!C222!eܘ22!2v2C222CeT22ee2T22!ee!!v2T2e22!ee22!e2e!e!!2T!!!!C2422!22!2v2ܘC222e22CT22e22e2e2eT224!e4e!!veT2ee2e2e2!e22!2e2e2e222!!!e!!!!CC˿e2!eeC22TeTee2eܘe2eeܘeeܘCeTeTeeeee2e2C!Teܘeeeee2ee22e2!!!2!!!!C22!22e˩C222T22e2e2e22C2T2T2ee2e22222!T22ee2e2e2!!!2!!!!C˿22!22C222T222e2e22ee2eCe2eT2T2eee22e2e222!T2e2ee22ee22e2!!ee2!2!22!!2!C˿T!e!!e2eCeeeT2TeTeeTe˘eeeeeeܘ2eCT2!e2!eeeeTeeeˁ!!2e2!!22!!2!CT!2!!eܘ22C2222T2Tee22T22e222e22CT2!22!22eT2ee2!!ee2!!2!!2!C˿T!2!!e224C2222Te22Te2e222e2Te22ee22ee2e22e22CT2!e2!2e22e2e22T2422e!2eC!!!!ee!eTe22eee!ee2e2Te2eeeTeeeeeveeeeeeeee!e2e2eeCeeeeܘeee2ˁ!22C!!!!e2!2T22!2e2T2e2T2e2e2ev2222e22!22ee22C22e22e2!2eC!!!e2!2T2e2!22T2e22eT2e2ee2e22v2e2e22e222!22e2eCe2ee2eee22ee2e!!2!v22!C!!˘2Ce2eCe!eeeeCeeTeTeCeTeTe2Ceev!e2eeTeeˁ!!!ve2!Ce!!e22C2!222e22eC2T2Te22eC2ee2Tee2eT2e2eC2ev!22T2e2!!!ve2!Ce!!e22C2!222e242C2T2Te2eeCee˘ee2Te2T22eC2ev!22e2e2e2Te22e2C!!eee!2!!!!ee2˘2e!eeTee!eeTee2eeC!eeTee˘TTeeeTeeeve2e2!eeeee!!2e2!2!!e22ee22!2T22!22T2222C!22T2e2222eeT22T2ee2Te222v22e22!2e22e2!!2ee!!!e2e22!42T22!2eT22C!222eTee224e2e2TeeT2e22eTe222v2222!2e2e2e˘2e2e222e!2ve!22vܘe!2e!˘e!eeTeeCeeeeeCeeeTeeeee!TeeC2C2eeCeeeCˁ!2v2!!!!!!2vܘ2!22!e2!2Te2C22e2ee22C22222e2Te2e2e2e2!Te22Ce22ee2e2eC222C˂!2v2!!!!!!22vܘ2!22!˘2!24Te2C222e2e2C22242eeeT2ee2ee22e222!Tee2C22e22e2e22eeCe222eCeee!C!CeT!2!22vC2e2eܘe2e!ee2evCeeCeeeeeCeeTeee2!e!eeee˘eee˘2!!eT!!2vܘC222ܘ2!2e222vC2C22e2e2e22eeC2T222e2!e2!2ˇ2e2e222!!T!!vC2422ܘ2!2e2vC24Ce22ee222eC22eT2e2224e2!2!22e22˘2e2e2e2e2!2!!e!!!C!C!!Tee2e!2ee2eCeeeeeܘeeTܘee˘e2eeCeܘeTeeeCe2!!!2e!!C!!!T˿2!eܘ2eC2e2e22ee222e2e22T22e2e2e2e2T2ee2eC22ˁ2!!!2!!C!!!T2!2C2ee2e22e22e2ee22eee2e2eTeee2eee224eeܘ22eTˇ2eee2eeCe2e22!e!e2!!2Ce2e2eCe2eee2eeCeeeTeeeCܘTeTeee2T!eeeTee22!2!22!!C2ܘC222˩2e2C22˩2T2e2eeC22e2T22eeT22e222eT!22e2eT222!2!22!!C2C222C222e2Te22e2eeC2eeeT2eeeT22222eT!˘22e22e2T22ee!C!C2ee!v2!!e2!eTee2eTeCe!eeC2eeeeeeeee˘TTeeTve2e2eeee2!!22e!v2!22!2T222T2C2!2e2C22e2e2e222e2ee2e2T2T2e2eev22222e!!2ee!v2!22!2T2422T2C2!22C22e2e2e22e2e2e2e2e2eeTeTe22e2v2e222e2e2eev2!!2!e!!2!2C2e22e2eee2e2eeCeCTTeTee˘eeCTeܘe!!eeeeeTeev2!!22e!e!!!22e22e2ܘ2CCTT22eeT2e2e22Ceee2T22e2!!e22122T22v2!!22!e!!!22e2e22ܘ2C4CTT2eeTe22e22eeCeTee22eܘ2!!42ee2ee22T22ee!!T22v!2e2!eee2eeve2eeCe2eeeeeTeTeTC˘eܘTeee˘e!eTeܘee˘eeTeTee!!22ve!2ee2!2ˇ2222v222eC222e22e22eT22eeT22TeCe2e2ee2T22˘2e222!2T22e22T2Teee!!22v!2e!22e2v2eC2242e22eT2e2eTe2TeC2eeeTe22e2eee2!2T24ee422e2T22eT2e˩e!!e2e2e2!!2!!e2e2ee2e2TeeCeCeeTܘCTTeܘeTee2!eCee!e˩2!!22ee2!!!!2e2T22C2Ce222T22C2ee2T222Te2ee22T22e2e!2eC22!2e˩2!!2ee2!!!!2e2Te2C2C2e22eTeeCe2T2eeTe2ee2ee22e2T2242e!2Ce2e2!2ܘ2e!e2e2!2eT!!22eܘ2e2eeeeeTTTTeeeeeeeeeee2!e22!2!2eT!!2˿2e2e222e22T2eeT2T2T2e2ee2e2e2ee222e2e2!e22!22e!2T!!222ܘ2ee2422ee2e2e2TeeeT2TeTeee22ee2e22e2e22˘24ee2ee22e!e2!C2e!ee!2e2e2ee2eCeCeTeee˘eCܘee˘ee˘eeeeeTee!2˿22!22!2e!22222eC2CTe2e2ee22Cee2eee2e2e2e22222T22e2!222!22!2e!2e22eC2C4Te22eee2eCeee22eee2ee2e222422eT222e22!ee2e!2!C!2!Te!eTTee2eeC2eeܘeeeee˘TܘCܘeeeeeeeܘeeeeeC2Ce2e2!2!!!T2!2TT222e˿2C22ܘ2e2ee2e2e2Tee2Ceee2e2ee2e22e22222ee2ee2CeCe2e24!2!!!T2!2TT22C2ܘ2eee2e2eeeeTeeeCeeeee2eee22e2ee2222e2ee2e22C2C2222!e2!2C!2!!eTeCeeCeeeܘTeTTeeeTeeeeeTeee˘22!2!C!!!2T2Ce22C2e2e22T22e2T2e2eeeT2e2e2T2e22e22Tee22!22!2C!!!eT2C2e2C22e22e2ee2eeeT2eeeT2eeeeTee22e2e2eeT222ee2e2ee2T222eeee!2Cee2!eeCeeCTeCeeeeeeTTܘ˘eTeeCeeeeeeTe222!2e2222!22eC22C2T2C22e22e22Teee2eeT22eee2eee22Te2e2C22e2222Tee2e2222!2e222!22Ce2CT2C222e22ee2TeeTeeee2eTe222C2eee2ee222eTee2e!e!T2e2!!CC!2eevܘeܘeTeeeeeeeeeeܘee˘eeT˘!2!2e2!!C!222v2e2T22ee2e2eee22ee2ee2e2e22ee22ee22e22e2T2e2!2!222!!C!222ve2e2T22e22e2ee2eeeee2eee2eeee2ee2e2e22e22e2eeTee2eeeee!!2T2C2!2!C2eeeTeeeeT˘eeTeee˘eeܘeeTeT2eܘ!!2T22!2!222ee2eT2222Teee2e2e2ee2e2Te22e2e22e22ee22T22T2e˘˩24eܘ!!2T22!2!222e2e2e22eT2e2e2e2Teeee2eeeeTee22ee2eee22ee2ee2eTeeTe2e2˩!eCee!e!eCeeTeܘeeee˘ee˘eeTܘeeeC22!2eܘ2!!Ce2e2Te2e22e2e2e22e2e2e2ee22eee2e2222e2T2e2e2222e22eC˘2˩!2ܘ2!4!4C2e2eeܘ2e2eTee2e2e22eeeee2ee2eee22e2eeT2ee2e22ee2eCee!ev2!eCT2!!C2CCeTeeeTeeeTeܘTC˘C˘eeTeT˘2!2v2!2CT2!!2C2eT22e2T222e2ee2Tee2eee2T2ee22Ce2Ce2eee22eTe2222T222!2v2!2CT2!!2C2T22ee22e2eT2e22e2eeeTee2TeeeCeeCe2ee2eeTe2eeeTeee2!eC22C2˩22!!2!2eeܘCeeeeܘTeeeTTeeeT˘˘2!2Ce22˩2!!2!22e2C222ee22T22e2e2e22e2e2e2e2e2ee2eeT22ee2Te22ee22T2!2C222˩2!!2!22eeC2e22e22e2e22ee2eeTeeee2ee22eee2e2eTeeeTe2ee2eTe2e2ee2e!22˘e2!eeTee˘eeeeeeT˘TܘeeTeeee2!22˘2!22e2T222ee2Teee2Te2e2eee2e22ee2e2e2e22eT2e2e222e22e2˂2e2!22e22!42ee22e2T2ee22eee2e2e2TeeeeTeee2eeeeeeT2e2e22e2e2Ce2CC2e!CeeT!C2eCeeeTeTeeTeeeT˘Tee˘ܘTTeeT˘˘C2C22!22˘T!2C22e22T2T2T2ee2Te2e2e2T2e2ee2e2ee22e2ee2T2T2e22e2T2eC42C22!2eT!4C2eee22eeT2e2T2e2eT22eeee2eTeeeTeee22eeeeeTeT2e2eeTeeee2C2e!e!eܩe!22!eeeCeܘeeCeeT˘eeTeeeT˘12C2!2!2eܩ2!22!22ˇ2Cee2e22Cee22Teee2eee2ee22ee2e2ee2222T222e2T2e22C22!2!2ܩ2!22!2e2e2Ce2e2eee2e22eeCe2eTeeeee2eܘeeee2T22ee2T2ee2e2ee2!!e2e˿v22CeCeeeeeTܘeeCeeT˘e˘e2eeTܘeeܘTT˘˘222!!2v22C22eee2ee22T22C22ee2ee22Teee2eee22e2ee2e22T2ee22T2T2242!!2˿v222C222e22e2e2eT2e22C2e2eeeeeeTeee2eeee2eeT2e22TeTe!e!eCe!e2e2v˩e2!eTeT˘CCCeTeeee!e˘ee˘eve!2!eC2!222v22!2T2T2e2C2Cee2C22T222eee2e2ee22eee22ee2e2e2!2e22˘22ee22e˘ve!2!eC2!2v˩22!2T2T2eeC2Ce2C2eT2e2eeeeee2eee2!2e2ee2e2e2eeevee2e!e!e2ee2e˘eeTCCeCeTTe˘ܘT˘˘ˇeCeTveC2422e22!2!222e2TC2C2e2Ce2ee2TT22eee2ee2eee2ee2T2e22eeee2ee2Ce222eTveC2e224e22!2!22e22e22TCeCeeeCeeee22TT2eeeeeeeTeeeee˘e2eeC2e2eTvCeTe!v22!ee2!e˿T2evTTeܘTTTeTeܘTܘeTTe22eeT2!ev2!22!2T2vTT22T22TT2eeT2ʘ2T2eee2eee22eee2ee22eee2eee2e2eee2ee22eTe22eT2!ev22!242!e˿T2vTTee2eT2eTT2e2T2ee2TeeeeeeeeܘeeTe2ee2e22e2˘eeeTܘTTC˘eeee˘ee2e22e2ee2e2TeT2T222Cee22e2e2e2e2ee2eee2e2e2ee2e2˘222ee22e22e22e2˘2e2eee22eTeTeT2eeCee2e22e˘eeeeee˘e2e2eee222e!Cee2e2eC˩eCeTTTTT˘TTeeܘ˘eeeeT˿Te2!eC2222C2C22T2T2Te2T2Te2T2eT2ee22eeeee2eeee2ee2e2ee2ee2e2e2T2e2eeTe2!Ce22424C˩2C22TeT2TeeT2Te2TeeTee2eeeeeeee2e2e2˘eTe˿eT22v˘veCe2eveeTTTTeT˘eeC˘˘˘eܿee2v2ve2C2v2T2T2eeT2T2eT2e2e2ee2Ceee2e2e2eee2eeee2eee2eeee2eee2ee22ܿee22eee2v2v2C2v2eeTeTe2eeTeTeeTe2eee2eeeeCeeeeeeeeeeeeeeܿe22vTeee2e2eeCeTܘTTeTeT˘˘˘ee2vT22222C22T2T2Te2e2Te2e22eeeT2eeee2e2e2eee2ee2eee2ܘee2eee2vTe2eC2eTeTeTee2e2eeTeee2eTeeeeeeeee2eeeeee2eeeeܘeC2e2veܘeeCeTܘe˘T˘˘˘˘˘ܘ˘Te22ee2ܘ2C2ve2e2e2e2Ce2ee2e2Te2e2e2Teeee2eee2eeee2ee2e2e2eee2ܘT2e2eee2ee2ܘ2C2ve2e2eee2eeeC2eeTe2Teeeeeee˘e˘eܘeeTe2CTT2Te2eTeTC˘eT˘˘˘˘˘˘evCTT˘2eT2ee2T2eeee2T2e22Ceee2e2ee2e2T22eeee2eee2ee2eee2eeܘ2e2eevCTT2T2eeTe2eTee2eCe22e2ee2eeTeeeeeee˘eeeeee2v2eeܘT2eeC2eeeeeT˘CTeTCܘ˘˘˂eve2eeTܘ22˩2C2e2ee2T2ee2Ce2T22eeee22T2e2eeee2Ce2ee2eee2eeeeeee2ee22eev2eT222C22ee2eeeeTeeeeCeeTe2eeeTeeeeCeeeeeeeeܘeeev22eeTˇe2ee2˘TTTܘT˘T˘e˘˘˘˘˘˘e2T222e2e2T2Te˘e2eT2T22ee2e2e2Te22eee2eee2eee2eeee2ee2e2e2eee2Tˇ22e2eeT2Teee2TeTe2eeeTeee˘eeeeeeeeeeeeee2eee2eCe2eeTT˘TTܘTe˘˘ˆ˿ee22e22C˿2T2T2e2T22e2Te22T2eeee2eee22eee2eee2eee2eeee2ee2e2ee2eeee2e2e22224C2eTeTeeeTeeeeTeeeTeeeeeeeeeee2eee˿e222Cee!eܘe2e˘TTeT˘ܘ˘˘˘˘˘˛˘˿TTeeeC22!2e22T2eee2eTe2e22e2e2222e2eeeTeeeeee2e2eeeܘeee2TeTeeC2e!2eܘ22eeTeeTee2e2eeeTeeeeeeeee˘ܘeeeeTeT22e2eCeeeeTܘTTTTeˊ˘˘˘˘˘˃ܘ˘eee222C2222TeT2T2eT22eee2Tee2e2eee2ee22eeeee2eeee2eeee2ee22eeeeeee2ee222C2ee2TeTeTeeTee2eT2e2ee˘eܘeeeeee˘eee222eee!eeeeeܘCC˘˘˘˘˘ˇˋ˘Teev22!e2e2ܘ22e2C2ee2ee2e2ee22Cee2e2eeeee2eee2e2eeeeܘee2e2e2Tev22!e2e2e2eܘeCeeeeeCeeeܘeeeeeeeeܘ˘ܘe2T22vee2eTeCeCeܘe˘ee˘˘˘˘˘˘ܘ˘˘eeee2T2C2C2ee2ee2e2ee22ee2e2e2eee2eee2eeeee2eeee2ee2eeeeeee2e2eee2T2C2C2e22eee2eeeeeeeeeeeeeeeeeeeee2ee2eee!e2e˩ee˘eeT˘eTˆ˘˘eeee22!222ܘ2e2ee2Teee2ee2e2ee2ee2Teeeee2eeee2eeee2eeee22e2ee22!2˩22e2e2ܘee2eeeTeeeeeeeeeTeeeeeeee2e2e2e2ee!e!eeT˘ܘ˘˘˘ˋ˘˅eee22!2!2e2Tܘe22eeee2e2ee2eee2ee2eeee2eeeeeee2ee2e2eeeeee2e2ee22!2!2e2eTe2eeeee2˘eeeeeeee˘ee2ee2Te!e2eveeC˘˘˘˘˘˘˘˘eCeveT2!22v˘22eCe2ee2eee2eee2e2ee2eee2eeeeeeee2eeeee22e22C2veT2!224v2e2eeeeCeeeeeeeee˘eܘeeeeeeeeeee2eC22veee!eTeeevvC˘T˩ˇ˘˘˘˘˘˘˘˘eevvee2!2T222vvCe2e2ee2Tee2ee2eeeeeee2eee2ee2eeeee2e2e22evve2!2T22e2e22vvCeeeTeeeeeeeܘeeeeܘee˘ee˘ee2eevv2eeeCTeeeCe˘˘ˑ˘˘˘˘˕˘ܘeeee22T22e2C2ee2eee2e2ee2eeee2eeeee2eeeeeee2ee2eeeee22ee22eee22T2e2C22e22eeeeܘeeeeeeeeeeeܘeeeee2T22Teeeee˘Tˇ˘˘˘ː˘˘˘˘CeeT22T22e2e22eeTe2eee2ee2ee2e2eee2eeeeeeee2ee2eeeeee2C2eeT22T22e22ee22eT2eeeeܘee˘eeeeeeeeeeeeC2e22eTC˘˂˘˘˘˘˘˘˘ˁeee2e2TC2ee2e2ee2ee2e2e2eeeee2eeeeee2eeeee˘2eeee2e2TCeeeeeeeeee˘ee˘eeeeeeeeeeeee2ee!eTe˘˘˘˘˘˘˘˃˂evev1!2T22e2e2eee2ee2e2eeee2eee2eeeee2evev!2T2ee2eeeeeeeeeeeܘee˘ee˘eee˘ee2v22ve2e!TeeC˘˘˘˘˘˘˘˘e22!T22eCeee2eee2e2ee22ee2eee22e2eee2e2eee2eee2ee2e˘ee2e22!T22eCeeeee˘eee˘eeeeeeee˘eee2e2e!2TeeT˘˘˘˘˃˘˘˘ˁ˘Cee2!2T222Tee2ee2eee2eeeeee2eeeee2eee22eˇeee2Ce2!2T2e222Teeeeeeeeeeeܘeeeeeee2eeeܘeeCe22ee2eCeTe˩ܘ˘ܘ˘˘˘˘˘˂˒˘Tve222C22T22ܘe2ee2e2eeeeee2eeee2eeee22eeeeeTevee24C22eeTee˩eeeܘeܘeeeeeeeeeeeeT2v22ee!!eee˘˘˘˘ˉ˘˂˂ˊ˘ee2e!!2e22ee2eee2eeeee2eee2eee2ee22ee2eeee2eeee!!2eeee2˘eeeeeeܘeeeeeeeeeeeeee2e22e22e!eee˘˘˘˘˘˘˘˘ˇve2e2!22ee22ee2ee2eeeee2e2e2eeee2eee22eeeee˘vee222!22ee2eeeeeeeeeeeeeeeeeeee2eeܘeeeev2evee2!eee˘˘˘˘˘ˈ˘˂˃ˈee2ve2!22eeeeee2e2eeeee22eeeee2eeeeeee2v242!22eeeeeeeeeee˘eeeeeee˘ee2TT2e2e˘˘˘ee˘˄˘˘˘ˇܘeTTe2˿2eee22eeee2eee2ee2ee2e2ee2ee22eeeeeeeeeTTe2eeeeeeeeeeee2eeeܘee˘eee2eeeeeeee2ee܇e2eeTT˘˔˘˘˘˃ˇ˘ܘev2܇2T2Te2ee2ee2eeeee2e2eeeeee2eee22eeeeeeeve2܇222TeTeeeeeeeeeeeeee˘ee22v2e2eeTeT܇˘˘˘ܘ˘˘˘˘ˍ˘e ee2T2eeTeee2eee2ee܇eee2eee2ee2eeeee2eeee22eeee 22T2e2Teee܇eeeeeeeeܘeeܘeeeeeܘe2eeee2e eee2eeTee˘e˘˘˘˘˘˘˘ˋ˘˘e e2T2eee2ee2e2ee2ee2e22ee22e2ee2eeee2ee˘ee e22eTe2e2eee˘eee˘eeeeeeee˘eeeeeee2 e2eeeܘe˘ܘ˘˘˘e˘˘˘˘ˊ˘˘ 2e22222eeeee22eȘe2e˘e22ee2ee2eeee2eeeeeee 2e22ee22eeeeeeeܘeee2eeeeeeeeee2 eeCvTe˘˘˘˘˘˘e˘ܘee˘˘ e2CvT2e22eeee2eeeeee2ee2eȘe2e222eeee22eeee ee2CvTe2ee2eeeeeeeeeeee2e˘2ee2ee˘eeܘeeee TTe˘eT˘˘˘eCeCeee˘ˁ˘TT22eT2ee2e2eee2eee2e2C2e2eeCe22e2ee2e2eee2eeeeeeTT2e2eTeeeeeeeܘeeCe˘eCe2e2eeeeeeeCTe˘ܘ˘˘˘eC˘ee˘˘ˏ˘eC˘T222eeee2eee2e2e2e2eȘe2ee2Cee2eee2eeeeeeeeCT22eeeeeeeeeeeee2ee2eeCe2e2eeeܘeeeeee2ee˘T˘˘˘˘˘˘e˘eeTe˔˘˘ܘe22eTeeeeeee2e22Șe2T2ee2eeeeeܘe2eT2eeeeeeeeee2 e22eeT2eeeeeeeeeeeeCve˘ee˘˘ˁ˄eeC2e2eeee2eee2v2eȘe2ee2e2eeeeee˩e22Ceeeeeeeeev22˘eee2ee22eeeeeeee˩2eve˘˘˘˘˘˘˘ܩe˄˘v2e2eeee2eeeee22ܩ2eȘȘe˿ee22eee22eeee2ev2e2eeeܘeeeeeeee2ܩ2eeeeee2e˘eܘee2eeeeT˘˘˘˘˘TC˘˿e˘˘˘˘e22eTeeee2eee2TCe2ȘȘȘȘe222eeeeܘ222eTeeeeeeeeeTCeeeeˆܘ2e˘eeee2ee˘˘˘˘ee˘˘˘˘ܘ22e2eeeee2e2eeȘeeeee2eˇeeܘe2eeeeeeeeeeeeeeܘeeeeeeee˘˿Tˇ˘˘˂ˁ˘˘ee22eeee2eeeee22TeȘȘeeeee2eeee˘222eeeeeeee2Teeeeeeeeeeeܘee˘˘˘˘e˄˘ˆˋ˘˘ee22eee2eˇee2ee˿e22ee˘Ș222eee˘ee22eeeeˇeeeeee2eeeeeeeeee˘eeeeeeev˘˘˘˘ܘ˘Te ˅e˘ˇee2veeeee2e˘T2˘˘ȘȘee22e2eeeee22veeeeeT22eeeeeeeee2e˘ee˘eeee˘˘˘˘˘˘e evܩeeeeeee22eeȘȘȄe22ve22eeeܩeeeeeeee˘eeeee2eeeeee eeee2e2veeeeܩ ˘˘˘˘˘˘˘˘Ce˘˃ ܘeeeeeeeCeeȘȘȘȘȘȘ˘e22ee2e2eee2e˘eeeeeeeeeCeeee eee2e2e2eeܘe ˘T˘˘˘˘ee eTeeeeeeee2eeȘe2e222eee22 eTeeeeeeeeee2eeeeeeeeeee2e2eܘee e˘˘˘˘e ˘eeˇe! eeeeeee2e22Ș˘ee2e22e2e! 2e2eeeeeee2eeeeeeeee22e22ee2eܘ ˘eˆ˘eeT" ee2eee2eeeee2ee2222eeeee22e2Te2e" eeeeeeee˘2eee2eeeeee2eeTe2" e܇˘˘˘˘˩ee˂eee# ee܇e2eeeee2e22eee2222e2e# ˘e2e2e܇eee222eeeee2e2ee22eܘ#˘˘ˆe˘˘˘e˘e˿˘%˘ee2eeee2eee2ee2ee22eeeeȂe2e22˘%ܘe2e2eeeee˄e2eee2eeee2e22e2eee$˘˘˩˘˩˘˘˘ܘeeee˘eeT%ˋ˩˘˩˘eeeeee2e2ee2ee22eee2eȎee222Te%eeeee2eeeeeeeܘ22e2ee22e2e2ee22e2˘eTee2%˩˘˿˘Teˁe˘eC˩e&˩˘˘˘˘˘˘e˃eee2e2Te22eee21eeȘ˘22Ce&ee2e˃eeeeeTe2e22e2e2e2e22eeee22Ce2e%˩eT2TeveeTe˘˘˘˘eeT˄eˇeeee&˩˘eTeTeveeTeeeeeee2e2e2Teee2eee2ee˘e22&e2T2T2eev22T2e˘eee2ee2T22e2eeee2ee22e2&˩2eCev˩˿Teˇe˘e2eee'˩˩ee2eCevee˘˿ܘeee22eT2eeȘȘee22ee22'ee2C22v22eeeeܘeeT2e22eeee22eee22e'˩˩˩v TeeːT˘e˘ee'˩˩˩ve2Te22eeeTee eee212eee2'eeev˘ ˊܘ2eeTee2e22T2eee222e22e22e'˘˩˘ˎ˩˩˩˩˂eeܘee˄eˆ˂e˘T˘e'ˈ˘˔˩˩˩˩˘˘e22e22ee22eeeee221ee˘2T'eeeܘܘe˘e22ee2ee2ee2eeeee22e22Te2e2'˩˩˘܄˘eeeeˊeˎ˘Ceeee'˩˩˩܄e2e2eee2eeeeeeCe22eeee'ee܄˂ee22ee2ee2e2 e2C2e22e2e'&eeˇee˄eˁ˘eee˄ee'!e2222eeee2e2eeee'ˁ ˁ ˃ˉ22e2e2 eee2ee22e2e22e'˩˩˂ˈ˘Ceeˑee˘ee&˩˩ˍe2C22eee2eeee2e'eܘ˘ܘܘܘe2C2e2eeee 2e2e2&˘˩˘˘˄ e˘ee˘eee&ˁˉ˘22e22eeeeee2e&ee˘2e2e2e2eee 2ee&ˋ˩ ee˘ee˃eee&ˆ˩ 2e12eeee˘e2ee&˃ˁˁˁ˃222e2e2 e2e22e&˘˩ˁ ˆeeeee&ˁˁ ˇ2e22eeeee2ee&e˘˘e2eee 2e2ee%˿˃˘2˂ܘeeˁ˃eve%˿˃˘2˘e2ee2e2eee2e22ee˘eee21ev%e22ee˘22e2e2ee2e2v2e%˅˩˘˥e˘˂˘eeCee%˃˩ˬܘe2eeee22eee2eeeee2C%eeܘܘܘܘܘ˘˘ܘܘ˂e2e2ee2eeee22e2C22e%˃˩ˇe˘ee2eeee$˅˘˩˩ˇee2ee22eȘ22eeeee22e$eeeeee222e2e˘e2e2e22e2e$ˁˈC!!ˁ#eee˂ ˘e22e"ˁˆC!"e2e2eeee22e"eeCeeˉ2e22e˄ee22e22e222222ee!ˉev ˞e˅˙˘e2!eeeeee ˩˩ev ˎee2eeee2eeeeee22!e 22ev2e ܘܘ˘˘ܘˎ2ee22e˘e2e2e22e2!22e2ee ˄eve˩ˆeee˃e˃eeCeeevee˩ˆe2e2eee2eeeee1Ceev2e2eeee˘2ee2e2e2C22e222eˁ˃C˂"eee 2eeeeeˁ˃C!"ee2eeeeeȘe21e eCeܘ 2ee2e2eeeee22e 2eˈ2!v˄eˁ˄˘eeeeeˏe!!vee1eeeeeeȊee22 e2vee222ee2e ee2e˘e22e2eˋ˩veCee"e˃˘˂˘ee˘eeˋ˩veCee!e2e2eeeeeȆee1eܘ2v2C22e˂2e2eee22e˘e22ˉ2!!v%e˘eeeveˊe!!!v$e2eee eeee˘e2ev˘2!!ve 2e2ee2e2e2e2ee˘e2e2v2e˅˘Cv$e˃ eeˋ˘ee˅˘C!v#2e2eeeeȇee2eeeCve 2e2e22ee˘ee2e222eˆ˩e!2vˁ!ee˘ ˘eev˩e!2v˂ eeȘeȄ˘e2v˘ܘe2!veܘ2eee2ee2ee˂e˘ee22eee2v2ˇee!!e%ee eeveeeˌe!!e#e2eeȘe˘e ȁeȅȘvee2!!ee!2ee22eee22e e22˘e2v2eˉve!!e%e e˘eveˋve!!e˘#2eeȅȘeȁ22vv2!2˘ 2eee2eeeeee2˘e2v22ee˘e!!!v˂!e˘eeeeee˘e!v˂!eeȆ2eeeܘܘܘee2!!!ve˘e2eeee22eeee2eee22ee2e2eeˇv!2!2e$e ˘e!ee2eevˇv!2!2e˂ ȘeeȘeee2!2e2evev!!22˘e2eeeee2eeee2ee22!2ee2v22eˉee!!e%e  ˘e!e!eeeeˌe!e Ș2e˘ȘȂe ˘ee1!!eȘe!eeܘe2!ee˘e22eeeee2e22 e22!22!2e˃T!e˃eˇC!C!ee˄T2!e˅e˘eeȁeeeeeCee!!e˘eeT!2e2eee2ee2 e22C2e2!2e˩T2!22e#˘˓e!e2Cee˩T2!22e˘ee˘eee2eeec2!!2e2Cܘ˘eT2!2ee2eee2e22e2e22e22e2e22!2e2C222e˂eT"eˇ!!T˓ee!2!e2ee˂e!Teeeeeeee!!Te2eee22!2!2e2!ee˘e2T˘e22eeee2ee22e2e!!Te22e2!22e˩e!!e%˘˂ˆe2!!eee!2C2e˩e!!e ȘeeeȘee2!!2e2e2!22ܘ2!!2eee2e2ee2e2ee222!!22!22ee˃e2e˄e˃˘˄e22eee2eeee˂e2e˃Ȅ˘2eeeȁee222e2e212eeܘee222eee2 e222eee2222e˘v!e%2ee˘eeee2!2ee˘v!!e˂Ȅe2ee22˘eeȘe2ee21221e22!ee˘˘ܘev!2˘e2e2˘22ee 22222!2e22eˉv!T%C2eˋeC!e˘˘ee2e2ee!22eeˊv!T ȏC22ee2eC!eeȅee2212.e121!2eevTeeC22e2eC!ee22ee2222!2e2eˈve2TeeˁeeeT2!22e2ee 2eeeeˈveeTee˘˂Ș2e1T2!22eȘee2e2c2 2eee˘eev22T22eee ˃ ee22T2!22e2˘e222e22 2e˘e!e"˘2!!ee2e ˇ˘ee! !Ce˘!eˁe2!e212122122eeȘeeee21! !Ceeܘܘܘe2!2˘e22!2222ee˘ee2e2e2e2! !C2e˂vT"e!!ee2eˆ2!!4ee˂vT e2!!122e2e2eȂee2c2!!eeevTee2!2e2ee22!222˩v2!22e ˂e!!ee2!e 22 eeve˩v2!22e˘˃1!!12!1eȄȘe2 !2evev!22eܘ!!2222!2eee2e2 22v2e˃eC2e˃2222e˘C!!2eeˉC2e2e˂22221221212eȁee2!!2e2C2ee˘e2222222ee2!222eˇe2!e!2!2ee˘eC2 2eeeˋe!2e e!2ceȘ˘ee1C2 2ee22e2!222ee˅˄ee22C 222e˘e!!!T˄ܘe2!2ee˘C22ee˂e!T˘˃ܘ22!!22e Ȃee22 eeee2!!!Teeeܘ e2!2e˃eee22eeˍveTeev˘˩˂T!!e˘e2!!eeeeˈveTeev˩T!!!1e2eȂȂe22!eeev2T22vee˂eT!!2ee2!2222ˇe!!CT2!!ee˘e!!2eeˌe!!!CT2!!12ceee1!!2eeܘe2!!CeT!!22ee22!2e˃eC˩˄e2!!2e˃e! !eev˃e!C˄e2!!!2ee ˘e2 !eveeCeܘ22!2eˋ˘e2 !22v2˅ee2e˘˩˂v!e˘e!2e˂e˩˘ˁv!2ceee Șe21! 2eeܘe2eev22e2e2ee˘ee2!22eˇe!!!C˄22ee˘ee!2!eeeˏe!!!C2!!2eeee21!!2!eee!!!Ceܘ2e˘ee2!!222eˇe!!2 2!ee ee22!2!eeˎe2˘2!!12eeeȃe2!2!!eeee22e˘!2ee2e2222eˋeC2C2e˩˃C!2e˘e2!!!!22eeˈC2Cee˃C!22_eeeȁȗee1!!!!!!22e˘e2CC22eeC!222e2ee2!!!!!2222e˂e2e˘!!!!2e˘e2!2!!!4eˇe2e22e!!22ee22!2!!e˘e2e˘!!2ee˄ee2!!2e˃vC!Te ˘eC!2!!22Tv˃vC˃T2!2eeȁȜee2!2!2!2Tv˘evCe˂T2e2eee2!!Tv2eˍe22!2T˘˩˃22˘ ee!2!!2!!!!2eveˁˇe22!2T˩˂e!22e˘e21!2!!2!!!!2eve2!Te˘e2eee22!!!!2v2eˊeC2eTe˄C!!!e˘ 222!!!!CeeˈCeeTe˘˄C!!!12e˂ȉe22!!!!!Ce˘eeC22T2eeܘC!!2eeee22!!!C2˃e!C#!2˘ ˘2!!!!!!2ee˄e!C˘2e˘e22!!!2eee2!Cee˘2eee2!!!!22e˃e!2˂2!2!e˘ˇe2!!! !2Ce˃e22!!2!2e˂ee2! !!2Cee22ee!!2ee22! 2C22˄v2e˩!!!2˘ee2!!2!2!2ev˃ve˩˘e!!!2ee2!!2!!2!!2eveev2eee!!2e2!!2v2ˇe!!!C˂"22!ee˅ee2!!!!!2eˁˎe!!!C!22!!!1eceeee22!!!!!22e˘2!!!Ceeܘ2!!!22e2e2!!!!2eˈe!2˂"e!!ee!2!!!!22C4eˏe!2˘"e!!!2e21!2!!22Cee˘˘ee22ee˂2!!! 2!!2C2eeˈe2CeCe˩˩2!!2!22e22!!!!!22eev˿ˈeeCeCe˩˘2!2!2212e2!!!!!!!!22eev˿ee2CC2eee2!!222!!!!22ve˂e!2C˂#C!2!!2!!!!!!!!!!2e˂e!2C˘!C!2!!2!!!!!!!!!!!22eeee2!2Ce˘C!!!2!!!!!!2ˉe!!2%e!!!!2!!!!!!!!!!2ee ˈe!!2˂#2!!!!2!!!!!!!2ee ee!2ee˂2!!!!!!!!2e˃e2e˘ˁ 22!!!!!!!!!!!2!!22ev ˄˘e2˘˂22!!!!!!!!2!22ev e2222eeܘ2!!!!!!22v ˊeC2C2e˂$e!!!!!!2!2!2!Cee!ˈeCeCee˘"e!!!!!2!2!!2!Cee!e2C2C22eee!e!!!C22ee!˂e!2˂'e2!!!!!2!!22e#˃e2˂'22!!!!2!!!!!!22ee#˘e22ee#2!!!!!!2e#ˁˊv2˃$܇Ce2!!2!!2!!2Cev$˘ˇv!!2e˘˃$܇C2!2!2!!!!2!2Cev$ev2ee#܇C2!!!2Cve$˂eTe(22!2!22ee&˂eTe˘˘'22!!!!!2!22ee&ee2T2e&2!!!!22&ˉe!2.ܘ!!!2!!!C2ee)ˉ˘e!!2ˁ,ܘ!!!2!C2e)ee˘)ܘ!!!!!!C22ee)˿˃e!˃,ܘe22!!2e*˃e!˘,ܘe2!!!2ee*ܘe2!ee+ee2!!!2e*˅e2Te˘/ee!222-˅eeTe˘˘˘.˘e1!222e-ee22T22 e-ee2!22-˃e2!2˘˂41˄e2!2˘4˘e1e!22ee˘1ܘe1˅e!n˅e!˃ke2!ejˁ˂e2ev˘jˁ2ev˘ˁiee22v2ei˃e2C˩˂l˃e2eC˘iܘe22CeeeiTogl2.0/configure0000775000175500010010000130314411002045766012665 0ustar gregcNone#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for Togl 2.0. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Togl' PACKAGE_TARNAME='togl' PACKAGE_VERSION='2.0' PACKAGE_STRING='Togl 2.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB GREP EGREP MATH_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES AUTOSTEREOD TOGL_WINDOWINGSYSTEM LIBGLU TEA_WINDOWINGSYSTEM TCL_TOP_DIR_NATIVE TCL_GENERIC_DIR_NATIVE TCL_UNIX_DIR_NATIVE TCL_WIN_DIR_NATIVE TCL_BMAP_DIR_NATIVE TCL_TOOL_DIR_NATIVE TCL_PLATFORM_DIR_NATIVE TCL_INCLUDES TK_TOP_DIR_NATIVE TK_UNIX_DIR_NATIVE TK_WIN_DIR_NATIVE TK_GENERIC_DIR_NATIVE TK_XLIB_DIR_NATIVE TK_PLATFORM_DIR_NATIVE TK_INCLUDES XMKMF TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS LD_LIBRARY_PATH_VAR SHLIB_SUFFIX CFLAGS_DEFAULT LDFLAGS_DEFAULT TCL_DBGX MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG WISH_PROG LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP AUTOSTEREOD XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Togl 2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/togl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Togl 2.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-stubs build and link with stub libraries (--enable-stubs) --enable-threads build with threads --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (default: off) --enable-64bit-vis enable 64bit Sparc VIS support (default: off) --disable-rpath disable rpath support (default: on) --enable-wince enable Win/CE support (where applicable) --enable-load allow dynamic loading and "load" command (default: on) --enable-symbols build with debugging symbols (default: off) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-autostereo directory with autostereo source (for SGI) --with-autostereod path to autostereod daemon (for SGI) --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor AUTOSTEREOD Path to autostereod for SGI IRIX computers XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Togl configure 2.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Togl $as_me 2.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.6" { echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6; } if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.6" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.6" != "${TEA_VERSION}" ; then { echo "$as_me:$LINENO: result: warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.6\", have \"${TEA_VERSION}\"" >&6; } else { echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6; } fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then { echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... ac_aux_dir= for ac_dir in tclconfig "$srcdir"/tclconfig; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&5 echo "$as_me: error: cannot find install-sh or install.sh in tclconfig \"$srcdir\"/tclconfig" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl was given. if test "${with_tcl+set}" = set; then withval=$with_tcl; with_tclconfig=${withval} fi { echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6; } if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} { echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi fi { echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then { echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else { echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" # TEA specific: #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk was given. if test "${with_tk+set}" = set; then withval=$with_tk; with_tkconfig=${withval} fi { echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6; } if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" { echo "$as_me:$LINENO: WARNING: Can't find Tk configuration definitions" >&5 echo "$as_me: WARNING: Can't find Tk configuration definitions" >&2;} exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} { echo "$as_me:$LINENO: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}found ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi fi { echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6; } if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then { echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6; } . "${TK_BIN_DIR}/tkConfig.sh" else { echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; } fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd ${TK_BIN_DIR}; pwd`" \ "`cd ${TK_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" # TEA specific: Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # TEA specific: #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then { echo "$as_me:$LINENO: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5 echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;} exec_prefix=${TCL_EXEC_PREFIX} else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then { echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6; } if test "${tcl_cv_cc_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_cc_pipe=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_pipe=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi { echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 echo "${ECHO_T}$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6; } if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* 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 sin (); /* 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_sin || defined __stub___sin choke me #endif int main () { return sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6; } if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi { echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6; } if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6; } if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6; } if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6; } if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then { echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6; } fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* 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 connect (); /* 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_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then { echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6; } if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* 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 setsockopt (); /* 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_setsockopt || defined __stub___setsockopt choke me #endif int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6; } if test $ac_cv_func_setsockopt = yes; then : else { echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setsockopt (); int main () { return setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6; } if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" { echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6; } if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* 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 accept (); /* 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_accept || defined __stub___accept choke me #endif int main () { return accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6; } if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* 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 gethostbyname (); /* 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_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = yes; then : else { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # TEA specific: Don't perform the eval of the libraries here because # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' { echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6; } if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $tcl_cv_dirent_h" >&5 echo "${ECHO_T}$tcl_cv_dirent_h" >&6; } if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi # TEA specific: if test "${ac_cv_header_errno_h+set}" = set; then { echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; } if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6; } if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6; } fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then { echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6; } if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6; } if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6; } fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then { echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6; } if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6; } if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6; } fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then { echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; } if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6; } if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6; } fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then { echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6; } fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then { echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6; } if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6; } if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6; } fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6; } if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6; } fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- { echo "$as_me:$LINENO: checking whether to link with stubs library" >&5 echo $ECHO_N "checking whether to link with stubs library... $ECHO_C" >&6; } # Check whether --enable-stubs was given. if test "${enable_stubs+set}" = set; then enableval=$enable_stubs; tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_stubs+set}" = set; then enableval="$enable_stubs" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then { echo "$as_me:$LINENO: result: stubs" >&5 echo "${ECHO_T}stubs" >&6; } USE_STUBS=1 else { echo "$as_me:$LINENO: result: no stubs" >&5 echo "${ECHO_T}no stubs" >&6; } USE_STUBS=0 fi vars="togl.c toglProcAddr.c toglStubInit.c" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH # To add more dirs here (like 'src'), you have to update VPATH # in Makefile.in as well if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done # togl_ws.h is added in Makefile.in because it is generated vars="togl.h toglDecls.h" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done PKG_CFLAGS="$PKG_CFLAGS " if test "${USE_STUBS}" = "1" ; then vars="toglStubLib.c" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done fi vars="" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_togl 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" if test "$GCC" != "yes" ; then vars="StereoI/StereoI.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done fi #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="so_locations" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- # find autostereo header, lib, and daemon # Check whether --with-autostereo was given. if test "${with_autostereo+set}" = set; then withval=$with_autostereo; with_autostereo=${withval} fi # Check whether --with-autostereod was given. if test "${with_autostereod+set}" = set; then withval=$with_autostereod; with_autostereod=${withval} fi { echo "$as_me:$LINENO: checking for autostereo directory" >&5 echo $ECHO_N "checking for autostereo directory... $ECHO_C" >&6; } if test x"${with_autostereo}" != x ; then if test -f "${with_autostereo}/lib/autostereo.h" ; then with_autostereo=`(cd ${with_autostereo}; pwd)` vars="-I${with_autostereo}/lib" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="-L${with_autostereo}/lib -lautostereo" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done cat >>confdefs.h <<_ACEOF #define HAVE_AUTOSTEREO 1 _ACEOF else { { echo "$as_me:$LINENO: error: ${with_autostereo} directory doesn't contain lib/autostereo.h" >&5 echo "$as_me: error: ${with_autostereo} directory doesn't contain lib/autostereo.h" >&2;} { (exit 1); exit 1; }; } fi fi # Extract the first word of "autostereod", so it can be a program name with args. set dummy autostereod; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_AUTOSTEREOD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AUTOSTEREOD in [\\/]* | ?:[\\/]*) ac_cv_path_AUTOSTEREOD="$AUTOSTEREOD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="`eval \"echo $sbindir\"`:$PATH:/sbin:/usr/sbin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AUTOSTEREOD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi AUTOSTEREOD=$ac_cv_path_AUTOSTEREOD if test -n "$AUTOSTEREOD"; then { echo "$as_me:$LINENO: result: $AUTOSTEREOD" >&5 echo "${ECHO_T}$AUTOSTEREOD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Choose OpenGL platform case "${TEA_WINDOWINGSYSTEM}" in aqua) TOGL_WINDOWINGSYSTEM=TOGL_AGL vars="-framework AGL -framework OpenGL -framework ApplicationServices" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done # libGLU is implicit in OpenGL framework LIBGLU= ;; x11) TOGL_WINDOWINGSYSTEM=TOGL_X11 vars="-lGL -lXmu" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done LIBGLU=-lGLU ;; win32) TOGL_WINDOWINGSYSTEM=TOGL_WGL vars="opengl32.lib user32.lib gdi32.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done if test "$GCC" = "yes" ; then LIBGLU=-lglu32 else # assume Microsoft compiler LIBGLU=glu32.lib PKG_CFLAGS="$PKG_CFLAGS -TP" fi ;; *) { { echo "$as_me:$LINENO: error: Unsupported windowing system: ${TEA_WINDOWINGSYSTEM}" >&5 echo "$as_me: error: Unsupported windowing system: ${TEA_WINDOWINGSYSTEM}" >&2;} { (exit 1); exit 1; }; } ;; esac # find Tcl, Tk, and X11 headers #TEA_PUBLIC_TCL_HEADERS { echo "$as_me:$LINENO: checking for Tcl private include files" >&5 echo $ECHO_N "checking for Tcl private include files... $ECHO_C" >&6; } TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi ;; esac else if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then { { echo "$as_me:$LINENO: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&5 echo "$as_me: error: Cannot find private header tclInt.h in ${TCL_SRC_DIR}" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&5 echo "${ECHO_T}Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" >&6; } #TEA_PUBLIC_TK_HEADERS { echo "$as_me:$LINENO: checking for Tk private include files" >&5 echo $ECHO_N "checking for Tk private include files... $ECHO_C" >&6; } TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} else TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" # Detect and add ttk subdir if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" fi if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi ;; esac else if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then { { echo "$as_me:$LINENO: error: Cannot find private header tkInt.h in ${TK_SRC_DIR}" >&5 echo "$as_me: error: Cannot find private header tkInt.h in ${TK_SRC_DIR}" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" >&5 echo "${ECHO_T}Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" >&6; } if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 not_really_there="yes" fi rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then { echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6; } found_xincludes="no" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then found_xincludes="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 found_xincludes="no" fi rm -f conftest.err conftest.$ac_ext if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then { echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6; } XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test found_xincludes = "no"; then { echo "$as_me:$LINENO: result: couldn't find any!" >&5 echo "${ECHO_T}couldn't find any!" >&6; } fi if test "$no_x" = yes; then { echo "$as_me:$LINENO: checking for X11 libraries" >&5 echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6; } XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then { echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6; } XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then { echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6; } if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XCreateWindow (); int main () { return XCreateWindow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xwindow_XCreateWindow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xwindow_XCreateWindow=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6; } if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then { echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 echo "${ECHO_T}could not find any! Using -lX11." >&6; } XLIBSW=-lX11 fi # TEA specific: if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi fi #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "`uname -s`" = "SunOS" ; then cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] { echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __pthread_mutex_init (); int main () { return __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6; } if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6; } if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6; } if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5 echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output { echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6; } if test "${TCL_THREADS}" = 1; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF { echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; tcl_ok=$enableval else tcl_ok=yes fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then { echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6; } SHARED_BUILD=1 else { echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6; } SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0.a: Enable 64 bit support? { echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6; } # Check whether --enable-64bit was given. if test "${enable_64bit+set}" = set; then enableval=$enable_64bit; do64bit=$enableval else do64bit=no fi { echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? { echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6; } # Check whether --enable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no fi { echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6; } # Force 64bit on with VIS if test "$do64bitVIS" = "yes"; then do64bit=yes fi # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. { echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6; } if test "${tcl_cv_cc_visibility_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {} int main () { f(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_cc_visibility_hidden=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_visibility_hidden=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6; } if test $tcl_cv_cc_visibility_hidden = yes; then cat >>confdefs.h <<\_ACEOF #define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) _ACEOF fi # Step 0.d: Disable -rpath support? { echo "$as_me:$LINENO: checking if rpath support is requested" >&5 echo $ECHO_N "checking if rpath support is requested... $ECHO_C" >&6; } # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; doRpath=$enableval else doRpath=yes fi { echo "$as_me:$LINENO: result: $doRpath" >&5 echo "${ECHO_T}$doRpath" >&6; } # TEA specific: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = windows; then { echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6; } # Check whether --enable-wince was given. if test "${enable_wince+set}" = set; then enableval=$enable_wince; doWince=$enableval else doWince=no fi { echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6; } fi # Step 1: set the variable "system" to hold the name and version number # for the system. { echo "$as_me:$LINENO: checking system version" >&5 echo $ECHO_N "checking system version... $ECHO_C" >&6; } if test "${tcl_cv_sys_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi fi { echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 echo "${ECHO_T}$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Require ranlib early so we can override it in special cases below. # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = yes; then # TEA specific: CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="ar" echo "$as_me:$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 { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in # TEA specific: windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else { echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6; } do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib was given. if test "${with_celib+set}" = set; then withval=$with_celib; with_celibconfig=${withval} fi { echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6; } if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` { echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6; } fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac { echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6; } fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = yes -a "`uname -v`" -gt 3; then if test "$GCC" = yes; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = ia64; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = yes; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4; then case " $LIBOBJS " in *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. { echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gettimeofday (); int main () { return gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6; } if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- { echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6; } if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bind_inet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bind_inet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6; } if test $ac_cv_lib_bind_inet_ntoa = yes; then LIBS="$LIBS -lbind -lsocket" fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF # TEA specific: Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library if test "`uname -m`" = ia64; then SHLIB_SUFFIX=".so" # Use newer C++ library for C++ extensions #if test "$GCC" != "yes" ; then # CPPFLAGS="-AA" #fi else SHLIB_SUFFIX=".sl" fi { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes"; then if test "$GCC" = yes; then case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then if test "$GCC" = yes; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "`uname -m`" = "alpha"; then CFLAGS="$CFLAGS -mieee" fi if test $do64bit = yes; then { echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6; } if test "${tcl_cv_cc_m64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_cc_m64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_m64=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 echo "${ECHO_T}$tcl_cv_cc_m64" >&6; } if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi fi # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared' DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" if test "`uname -m`" = "alpha"; then CFLAGS="$CFLAGS -mieee" fi ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-1.*|FreeBSD-[1-2].*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi { echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6; } if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6; } if test $tcl_cv_ld_elf = yes; then SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' { echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6; } if test "${tcl_cv_ld_elf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then tcl_cv_ld_elf=yes else tcl_cv_ld_elf=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5 echo "${ECHO_T}$tcl_cv_ld_elf" >&6; } if test $tcl_cv_ld_elf = yes; then LDFLAGS=-Wl,-export-dynamic else LDFLAGS="" fi # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*|FreeBSD-*) # FreeBSD 3.* and greater have ELF. # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "${TCL_THREADS}" = "1"; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes; then case `arch` in ppc) { echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6; } if test "${tcl_cv_cc_arch_ppc64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_cc_arch_ppc64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_ppc64=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6; } if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes fi ;; i386) { echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6; } if test "${tcl_cv_cc_arch_x86_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_cc_arch_x86_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_cc_arch_x86_64=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi { echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6; } if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes fi ;; *) { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then fat_32_64=yes fi fi # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' { echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6; } if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6; } if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then LDFLAGS="$LDFLAGS -prebind" fi LDFLAGS="$LDFLAGS -headerpad_max_install_names" { echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6; } if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6; } if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi if test "$tcl_cv_cc_visibility_hidden" != yes; then cat >>confdefs.h <<\_ACEOF #define MODULE_SCOPE __private_extern__ _ACEOF fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then if test "${TEA_WINDOWINGSYSTEM}" = x11; then { echo "$as_me:$LINENO: checking for 64-bit X11" >&5 echo $ECHO_N "checking for 64-bit X11... $ECHO_C" >&6; } if test "${tcl_cv_lib_x11_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_lib_x11_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_lib_x11_64=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi { echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6; } fi # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. if test "${TEA_WINDOWINGSYSTEM}" = aqua -o "$tcl_cv_lib_x11_64" = no; then { echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi fi ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -nostdlib -r' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = 1; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = 1; then SHLIB_LD="${CC} -shared" else SHLIB_LD="${CC} -non_shared" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi if test "$GCC" = yes; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = 1; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = yes; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = yes; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} else SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = yes; then arch=`isainfo` if test "$arch" = "sparcv9 sparc"; then if test "$GCC" = yes; then if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" fi else do64bit_ok=yes if test "$do64bitVIS" = yes; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi else if test "$arch" = "amd64 i386"; then if test "$GCC" = yes; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = yes; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" fi else case $system in SunOS-5.[1-9][0-9]*) SHLIB_LD='${CC} -G -z text ${LDFLAGS}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. { echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6; } if test "${tcl_cv_ld_Bexport+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then tcl_cv_ld_Bexport=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_Bexport=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi { echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6; } if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" = yes -a "$do64bit_ok" = no; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load was given. if test "${enable_load+set}" = set; then enableval=$enable_load; tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = no; then DL_OBJS="" fi if test "x$DL_OBJS" != x; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else { echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi if test "$SHARED_LIB_SUFFIX" = ""; then # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = ""; then # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary { echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6; } tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no 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 if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no 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 if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "${tcl_cv_flag__largefile_source64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__largefile_source64=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include int main () { char *p = (char *)open64; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_flag__largefile_source64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile_source64=no 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 if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE_SOURCE64 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } else { echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6; } fi { echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6; } if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF { echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6; } elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* { echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6; } else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF { echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations { echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6; } if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6; } if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 echo "${ECHO_T}$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi for ac_func in open64 lseek64 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* 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_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6; } if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # should be part of TEA_CONFIG_CFLAGS, but more visible modification here #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6; } # Check whether --enable-symbols was given. if test "${enable_symbols+set}" = set; then enableval=$enable_symbols; tcl_ok=$enableval else tcl_ok=no fi DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then { echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6; } fi fi # TEA specific: if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then { echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6; } else { echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6; } fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- if test "${USE_STUBS}" = "1" ; then cat >>confdefs.h <<\_ACEOF #define USE_TCL_STUBS 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define USE_TK_STUBS 1 _ACEOF fi #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi if test "${USE_STUBS}" = "0" ; then SHLIB_LD_LIBS=`echo "$SHLIB_LD_LIBS" | sed -e 's!stub!!g'` fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- { echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6; } if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi { echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6; } { echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6; } if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TK_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`/" break fi done WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" fi { echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 echo "${ECHO_T}${WISH_PROG}" >&6; } #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl togl_ws.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Togl $as_me 2.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ Togl config.status 2.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl") CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "togl_ws.h") CONFIG_FILES="$CONFIG_FILES togl_ws.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CYGPATH!$CYGPATH$ac_delim EXEEXT!$EXEEXT$ac_delim PKG_LIB_FILE!$PKG_LIB_FILE$ac_delim PKG_STUB_LIB_FILE!$PKG_STUB_LIB_FILE$ac_delim PKG_STUB_SOURCES!$PKG_STUB_SOURCES$ac_delim PKG_STUB_OBJECTS!$PKG_STUB_OBJECTS$ac_delim PKG_TCL_SOURCES!$PKG_TCL_SOURCES$ac_delim PKG_HEADERS!$PKG_HEADERS$ac_delim PKG_INCLUDES!$PKG_INCLUDES$ac_delim PKG_LIBS!$PKG_LIBS$ac_delim PKG_CFLAGS!$PKG_CFLAGS$ac_delim TCL_VERSION!$TCL_VERSION$ac_delim TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim TCL_SRC_DIR!$TCL_SRC_DIR$ac_delim TCL_LIB_FILE!$TCL_LIB_FILE$ac_delim TCL_LIB_FLAG!$TCL_LIB_FLAG$ac_delim TCL_LIB_SPEC!$TCL_LIB_SPEC$ac_delim TCL_STUB_LIB_FILE!$TCL_STUB_LIB_FILE$ac_delim TCL_STUB_LIB_FLAG!$TCL_STUB_LIB_FLAG$ac_delim TCL_STUB_LIB_SPEC!$TCL_STUB_LIB_SPEC$ac_delim TCL_LIBS!$TCL_LIBS$ac_delim TCL_DEFS!$TCL_DEFS$ac_delim TCL_EXTRA_CFLAGS!$TCL_EXTRA_CFLAGS$ac_delim TCL_LD_FLAGS!$TCL_LD_FLAGS$ac_delim TCL_SHLIB_LD_LIBS!$TCL_SHLIB_LD_LIBS$ac_delim TK_VERSION!$TK_VERSION$ac_delim TK_BIN_DIR!$TK_BIN_DIR$ac_delim TK_SRC_DIR!$TK_SRC_DIR$ac_delim TK_LIB_FILE!$TK_LIB_FILE$ac_delim TK_LIB_FLAG!$TK_LIB_FLAG$ac_delim TK_LIB_SPEC!$TK_LIB_SPEC$ac_delim TK_STUB_LIB_FILE!$TK_STUB_LIB_FILE$ac_delim TK_STUB_LIB_FLAG!$TK_STUB_LIB_FLAG$ac_delim TK_STUB_LIB_SPEC!$TK_STUB_LIB_SPEC$ac_delim TK_LIBS!$TK_LIBS$ac_delim TK_XINCLUDES!$TK_XINCLUDES$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim SET_MAKE!$SET_MAKE$ac_delim RANLIB!$RANLIB$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim MATH_LIBS!$MATH_LIBS$ac_delim PKG_SOURCES!$PKG_SOURCES$ac_delim PKG_OBJECTS!$PKG_OBJECTS$ac_delim CLEANFILES!$CLEANFILES$ac_delim AUTOSTEREOD!$AUTOSTEREOD$ac_delim TOGL_WINDOWINGSYSTEM!$TOGL_WINDOWINGSYSTEM$ac_delim LIBGLU!$LIBGLU$ac_delim TEA_WINDOWINGSYSTEM!$TEA_WINDOWINGSYSTEM$ac_delim TCL_TOP_DIR_NATIVE!$TCL_TOP_DIR_NATIVE$ac_delim TCL_GENERIC_DIR_NATIVE!$TCL_GENERIC_DIR_NATIVE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF TCL_UNIX_DIR_NATIVE!$TCL_UNIX_DIR_NATIVE$ac_delim TCL_WIN_DIR_NATIVE!$TCL_WIN_DIR_NATIVE$ac_delim TCL_BMAP_DIR_NATIVE!$TCL_BMAP_DIR_NATIVE$ac_delim TCL_TOOL_DIR_NATIVE!$TCL_TOOL_DIR_NATIVE$ac_delim TCL_PLATFORM_DIR_NATIVE!$TCL_PLATFORM_DIR_NATIVE$ac_delim TCL_INCLUDES!$TCL_INCLUDES$ac_delim TK_TOP_DIR_NATIVE!$TK_TOP_DIR_NATIVE$ac_delim TK_UNIX_DIR_NATIVE!$TK_UNIX_DIR_NATIVE$ac_delim TK_WIN_DIR_NATIVE!$TK_WIN_DIR_NATIVE$ac_delim TK_GENERIC_DIR_NATIVE!$TK_GENERIC_DIR_NATIVE$ac_delim TK_XLIB_DIR_NATIVE!$TK_XLIB_DIR_NATIVE$ac_delim TK_PLATFORM_DIR_NATIVE!$TK_PLATFORM_DIR_NATIVE$ac_delim TK_INCLUDES!$TK_INCLUDES$ac_delim XMKMF!$XMKMF$ac_delim TCL_THREADS!$TCL_THREADS$ac_delim SHARED_BUILD!$SHARED_BUILD$ac_delim AR!$AR$ac_delim CELIB_DIR!$CELIB_DIR$ac_delim LIBOBJS!$LIBOBJS$ac_delim DL_LIBS!$DL_LIBS$ac_delim CFLAGS_DEBUG!$CFLAGS_DEBUG$ac_delim CFLAGS_OPTIMIZE!$CFLAGS_OPTIMIZE$ac_delim CFLAGS_WARNING!$CFLAGS_WARNING$ac_delim STLIB_LD!$STLIB_LD$ac_delim SHLIB_LD!$SHLIB_LD$ac_delim SHLIB_LD_LIBS!$SHLIB_LD_LIBS$ac_delim SHLIB_CFLAGS!$SHLIB_CFLAGS$ac_delim LD_LIBRARY_PATH_VAR!$LD_LIBRARY_PATH_VAR$ac_delim SHLIB_SUFFIX!$SHLIB_SUFFIX$ac_delim CFLAGS_DEFAULT!$CFLAGS_DEFAULT$ac_delim LDFLAGS_DEFAULT!$LDFLAGS_DEFAULT$ac_delim TCL_DBGX!$TCL_DBGX$ac_delim MAKE_LIB!$MAKE_LIB$ac_delim MAKE_SHARED_LIB!$MAKE_SHARED_LIB$ac_delim MAKE_STATIC_LIB!$MAKE_STATIC_LIB$ac_delim MAKE_STUB_LIB!$MAKE_STUB_LIB$ac_delim RANLIB_STUB!$RANLIB_STUB$ac_delim TCLSH_PROG!$TCLSH_PROG$ac_delim WISH_PROG!$WISH_PROG$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 40; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi Togl2.0/configure.in0000775000175500010010000002305110663455073013275 0ustar gregcNone#!/bin/bash -norc dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # # RCS: @(#) $Id: configure.in,v 1.12 2007/08/03 16:48:47 gregcouch Exp $ #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([Togl], [2.0]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.6]) AC_CONFIG_AUX_DIR(tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TOGL_ENABLE_STUBS TEA_ADD_SOURCES([togl.c toglProcAddr.c toglStubInit.c]) # togl_ws.h is added in Makefile.in because it is generated TEA_ADD_HEADERS([togl.h toglDecls.h]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) if test "${USE_STUBS}" = "1" ; then TEA_ADD_STUB_SOURCES([toglStubLib.c]) fi TEA_ADD_TCL_SOURCES([]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_togl, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" if test "$GCC" != "yes" ; then TEA_ADD_LIBS([StereoI/StereoI.lib]) fi #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="so_locations" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- # find autostereo header, lib, and daemon AC_ARG_WITH([autostereo], [AS_HELP_STRING([--with-autostereo], [directory with autostereo source (for SGI)])], [with_autostereo=${withval}]) AC_ARG_WITH([autostereod], [AS_HELP_STRING([--with-autostereod], [path to autostereod daemon (for SGI)])], [with_autostereod=${withval}]) AC_ARG_VAR([AUTOSTEREOD], [Path to autostereod for SGI IRIX computers]) AC_MSG_CHECKING([for autostereo directory]) if test x"${with_autostereo}" != x ; then if test -f "${with_autostereo}/lib/autostereo.h" ; then with_autostereo=`(cd ${with_autostereo}; pwd)` TEA_ADD_INCLUDES([-I${with_autostereo}/lib]) TEA_ADD_LIBS([-L${with_autostereo}/lib -lautostereo]) AC_DEFINE_UNQUOTED(HAVE_AUTOSTEREO, 1, [Define this if you have the autostereo header]) else AC_MSG_ERROR([${with_autostereo} directory doesn't contain lib/autostereo.h]) fi fi AC_PATH_PROG([AUTOSTEREOD], [autostereod], [], [`eval \"echo $sbindir\"`:$PATH:/sbin:/usr/sbin]) # Choose OpenGL platform case "${TEA_WINDOWINGSYSTEM}" in aqua) AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_AGL) TEA_ADD_LIBS([-framework AGL -framework OpenGL -framework ApplicationServices]) # libGLU is implicit in OpenGL framework LIBGLU= ;; x11) AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_X11) TEA_ADD_LIBS([-lGL -lXmu]) LIBGLU=-lGLU ;; win32) AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_WGL) TEA_ADD_LIBS([opengl32.lib user32.lib gdi32.lib]) if test "$GCC" = "yes" ; then LIBGLU=-lglu32 else # assume Microsoft compiler LIBGLU=glu32.lib TEA_ADD_CFLAGS([-TP]) fi ;; *) AC_MSG_ERROR([Unsupported windowing system: ${TEA_WINDOWINGSYSTEM}]) ;; esac AC_SUBST(LIBGLU) AC_SUBST(TEA_WINDOWINGSYSTEM) # find Tcl, Tk, and X11 headers #TEA_PUBLIC_TCL_HEADERS TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS TEA_PRIVATE_TK_HEADERS TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS # should be part of TEA_CONFIG_CFLAGS, but more visible modification here AC_SUBST(SHLIB_SUFFIX) #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- if test "${USE_STUBS}" = "1" ; then AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) fi #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB if test "${USE_STUBS}" = "0" ; then SHLIB_LD_LIBS=`echo "$SHLIB_LD_LIBS" | sed -e 's!stub!!g'` fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH TEA_PROG_WISH #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl togl_ws.h]) Togl2.0/doc/0000755000175500010010000000000011003223663011506 5ustar gregcNoneTogl2.0/doc/capi.html0000644000175500010010000004471311003214760013317 0ustar gregcNone Togl C API

Togl C API

Contents


Compling and linking C Togl Functions

All Togl functions are found in the Togl header file.

#include "togl.h"

For portability, you should include the togl.h header before any other OpenGL headers so it will compile on Microsoft Windows.

Before calling any Togl functions, you need to initialize it. Regardless if you're using stubs (by defining USE_TOGL_STUBS) or not, the following code will properly initialize togl:

if (Tcl_InitStubs(interp, "8.1", 0) == NULL
|| Togl_InitStubs(interp, "2.0", 0) == NULL) {
    /* fail */
}

If you are using a prebuilt binary distribution, you should be sure to define USE_TOGL_STUBS beforehand.

See the source for the demo programs in the Togl source distribution for working examples.

Linking

If you are using a prebuilt binary, be sure to link against the stub library. On Microsoft Windows, link against Toglstub20.lib opengl32.lib user32.lib gdi32.lib, on Apple Mac OS X, link against -lToglstub2.0 -framework OpenGL, on other platforms, link against -lToglstub2.0 -lGLU -lGL -lm.

If building your own Togl package, you can use the stubs interface or link in the Tcl and Tk libraries as well. If using the stubs interface, link as shown above. Otherwise: on Microsoft Windows, link against Togl20.lib tk84.lib tcl84.lib opengl32.lib user32.lib gdi32.lib, on Apple Mac OS X, link against -lTogl2.0 -framework Tk -framework Tcl -framework OpenGL, on other platforms, link against -lTogl2.0 -ltk8.4 -ltcl8.4 -lGLU -lGL -lm.

Setup and Initialization Functions

int Togl_Init(Tcl_Interp *interp)
Initializes the Togl module. This is typically called from the Tk_Main() function or other Tcl package initialization function that is directly linked to the Togl (shared) library. It is also indirectly called via Tcl's package require Togl command.
const char *Togl_InitStubs(Tcl_Interp *interp, const char *version, int exact)
Loads the Togl package into the given interpreter and initializes it. version should be "2.0" or higher. This is typically called from C/C++ code that accesses Togl's C API and has installed Togl into the standard TCL hierarchy. See the Tcl InitStubs(3) or the Tk TkInitStubs(3) manual pages for more information.

Drawing-related Commands

void Togl_PostRedisplay(Togl *togl)
Signals that the widget should be redrawn. When Tk is next idle, the displaycommand callback will be invoked.
void Togl_SwapBuffers(const Togl *togl)
Swaps the front and back color buffers for a double-buffered widget. glFlush() is executed if the window is single-buffered. So this call works for both single- and double-buffered contexts. This is typically called in the displaycommand callback function.
void Togl_MakeCurrent(const Togl *togl)
Sets the current rendering context to the given widget. This is done automatically before any Togl callback functions is called. So the call is only needed if you have multiple widgets with separate OpenGL contexts. If the argument is NULL, then the rendering context is cleared and subsequent OpenGL commands will fail.
Bool Togl_SwapInterval(const Togl *togl, int interval)
Returns 1 (true) if sucessful. Attempts to change the maximum refresh rate by setting the minimum number of cycles between successive swap buffers. For benchmarking purposes, you should set the swap interval to 0.

Query Functions

char *Togl_Ident(const Togl *togl)
Returns a pointer to the identification string associated with a Togl widget or NULL if there's no identifier string.
int Togl_Width(const Togl *togl)
Returns the width of the given Togl widget. Typically called in the reshapecommand callback function.
int Togl_Height(const Togl *togl)
Returns the height of the given Togl widget. Typically called in the reshapecommand callback function.
Tcl_Interp *Togl_Interp(const Togl *togl)
Returns the Tcl interpreter associated with the given Togl widget.
Tk_Window Togl_TkWin(const Togl *togl)
Returns the Tk window associated with the given Togl widget.
Togl_FuncPtr Togl_GetProcAddr(const char *funcname)
Platform-independent way to get OpenGL function pointers from a function name. Note that in Windows (WGL) versions that "the extension function addresses are unique for each pixel format. All rendering contexts of a given pixel format share the same extension function addresses." And on *nix (GLX/X11) platforms, "the function pointers returned are context independent" (Linux ABI documentation). The Mac OS X (AGL) platform acts like a *nix platform.
int Togl_ContextTag(const Togl *t)
Returns an integer that represents the context tag. All Togl widgets with the same context tag share display lists.
Bool Togl_UpdatePending(const Togl *t)
Returns 1 (true) if the window should be redrawn. See Togl_PostRedisplay.

Color Index Mode Functions

These functions are only used for color index mode.

unsigned long Togl_AllocColor(Togl *togl, float red, float green, float blue)
Allocate a color from a read-only colormap. Given a color specified by red, green, and blue return a colormap index (aka pixel value) whose entry most closely matches the red, green, blue color. Red, green, and blue are values in [0,1]. This function is only used in color index mode when the -privatecmap option is false.
void Togl_FreeColor(Togl *togl, unsigned long index)
Free a color in a read-only colormap. Index is a value which was returned by the Togl_AllocColor() function. This function is only used in color index mode when the -privatecmap option is false.
void Togl_SetColor(Togl *togl, int index, float red, float green, float blue)
Load the colormap entry specified by index with the given red, green and blue values. Red, green, and blue are values in [0,1]. This function is only used in color index mode when the -privatecmap option is true.

Font Functions

These functions provide an interface to the simple bitmap font capabilities that every OpenGL implementation provides. Better font support is found in other C APIs, e.g., QuesoGLC or FTGL.

GLuint Togl_LoadBitmapFont(Togl *togl, const char *fontname)
Load the named font as a set of glBitmap display lists. fontname may be any of the font description styles accepted by the Tk font command. For maximum portability, one of the standard Tk fonts, Courier, Times, and Helvetica, should be used. Unicode fonts are treated as if they have only have an 8-bit index (so poorly). After Togl_LoadBitmapFont() has been called, returning fontbase, you can render a string s with:
glListBase(fontbase);
glCallLists(strlen(s), GL_BYTE, s);
Zero is returned if this function fails.
int Togl_UnloadBitmapFont(Togl *togl, Tcl_Obj *toglfont)
Destroys the bitmap display lists created by by Togl_LoadBitmapFont().
int Togl_WriteChars(const Togl *togl, const Tcl_Obj *toglfont, const char *str, int len)
int Togl_WriteObj(const Togl *togl, const Tcl_Obj *toglfont, Tcl_Obj *obj)
Tcl_Obj interface to Tcl_WriteChars.

Client Data Functions

void Togl_SetClientData(Togl *togl, ClientData clientData)
clientData is a pointer to an arbitrary user data structure. Each Togl struct has such a pointer. This function sets the Togl widget's client data pointer.
ClientData Togl_GetClientData(const Togl *togl)
clientData is a pointer to an arbitrary user data structure. Each Togl struct has such a pointer. This function returns the Togl widget's client data pointer.

Overlay Functions

These functions are modelled after GLUT's overlay sub-API.

void Togl_UseLayer(Togl *togl, int layer)
Select the layer into which subsequent OpenGL rendering will be directed. layer may be either TOGL_OVERLAY or TOGL_NORMAL.
void Togl_ShowOverlay(Togl *togl)
Display the overlay planes, if any.
void Togl_HideOverlay(Togl *togl)
Hide the overlay planes, if any.
void Togl_PostOverlayRedisplay(Togl *togl)
Signal that the overlay planes should be redraw. When Tk is next idle, the overlaydisplaycommand callback will be invoked.
int Togl_ExistsOverlay(Togl *togl)
Returns 1 if overlay planes exist, 0 otherwise.
int Togl_GetOverlayTransparentValue(const Togl *togl)
Returns the color index of the overlay's transparent pixel value.
int Togl_IsMappedOverlay(const Togl *togl)
Returns 1 if the overlay planes are currently displayed, 0 otherwise.
unsigned long Togl_AllocColorOverlay(const Togl *togl, float red, float green, float blue)
Allocate a color in the overlay planes. Red, green, and blue are values in [0,1]. Return the color index or -1 if the allocation fails.
void Togl_FreeColorOverlay(const Togl *togl, unsigned long index)
Free a color which was allocated with Togl_AllocColorOverlay().

Stereo Functions

Togl abstracts part of the stereo drawing process to seamlessly support quad-buffered stereo as well as various alternative stereo formats.

void Togl_DrawBuffer(Togl *togl, GLenum mode)
Switch to OpenGL draw buffer. Should be one of GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT_LEFT, or GL_FRONT_RIGHT. It is not possible to draw in the left and right buffers at the same time in the alternate stereo modes.
void Togl_Clear(const Togl *togl, GLbitfield mask)
Replacement for OpenGL's glClear that takes into account the alternate stereo mode.
void Togl_Frustum(const Togl *togl, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far)
eyeOffset is the distance from the center line and is negative for the left eye and positive for right eye. eyeDist and eyeOffset need to be in the same units as your model space. In physical space, eyeDist might be 30 inches from the screen and eyeDist would be +/- 1.25 inch (for a total interocular distance of 2.5 inches). So you need to convert those values.
void Togl_Ortho(const Togl *togl, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far)
eyeOffset is the distance from the center line and is negative for the left eye and positive for right eye. eyeDist and eyeOffset need to be in the same units as your model space. In physical space, eyeDist might be 30 inches from the screen and eyeDist would be +/- 1.25 inch (for a total interocular distance of 2.5 inches). So you need to convert those values.
int Togl_NumEyes(const Togl *togl)

Stereo Example

This code works for quad-buffered stereo, as well as the other stereo modes.

if (Togl_NumEyes(togl) == 1) {
    Togl_DrawBuffer(togl, GL_BACK);
    Togl_Clear(togl);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    Togl_Frustum(togl, left, right, bottom, top, near, far);
    glMatrixMode(GL_MODELVIEW);
    draw image
} else {
    Togl_DrawBuffer(togl, GL_BACK_LEFT);
    Togl_Clear(togl);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    Togl_Frustum(togl, left, right, bottom, top, near, far);
    glMatrixMode(GL_MODELVIEW);
    draw left-eye image
    Togl_DrawBuffer(togl, GL_BACK_RIGHT);
    Togl_Clear(togl);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    Togl_Frustum(togl, left, right, bottom, top, near, far);
    glMatrixMode(GL_MODELVIEW);
    draw right-eye image
}
Togl_SwapBuffers(togl);

Image Functions

int Togl_TakePhoto(Togl *togl, Tk_PhotoHandle photo)
Take a photo image of the current Togl window and place it in the given photo object. If the window is partially obscured, either by other windows or by the edges of the display, the results are undefined in the obscured region.

Conversion Functions

These functions aid the programmer when writing Togl callback functions.

int Togl_GetToglFromObj(Tcl_Interp *interp, Tcl_Obj *obj, Togl **toglPtr)
Attempt to return a Togl structure "toglPtr" from the Tcl object "obj".
int Togl_GetToglFromName(Tcl_Interp *interp, const char *cmdName, Togl **toglPtr)
Attempt to return a Togl structure "toglPtr" from the Tcl command name "cmdName".

Hosted by SourceForge.net Logo Togl2.0/doc/download.html0000644000175500010010000002634111003214776014216 0ustar gregcNone Downloading and Installing Togl

Downloading and Installing Togl

Contents


Prerequisites

You should have Tcl and Tk installed on your computer. Togl works with Tcl/Tk version 8.1 and up (all recent testing has been with version 8.4). The Mac OS X version requires version 8.4 (note: versions 8.4.12 and 8.4.13 have a bug when unmapping Togl widgets).

You must also have OpenGL or Mesa (a free alternative to OpenGL with the same API) installed on your computer.

And one should be familiar with Tcl, Tk, OpenGL, and C programming to use Togl effectively.

Downloading Togl

Togl can be downloaded from SourceForge Files page.

Several prebuilt binary distributions are available as well as a source distribution.

Installing Togl

Installing prebuild binaries

Prebuilt binaries provide a Togl2.0 directory, the togl.h, togl_ws.h and toglDecls.h include files, and the togl stub library (libToglstub2.0.a or Toglstub20.lib, etc). The Togl2.0 directory needs to copied into one of the directories on Tcl's package path (type puts $auto_path in the Tcl interpreter to see the list of directories). If you have C code that needs to access Togl's subroutines directly, place the include file in the same place as Tcl's include file and the stub library in the same place as Tcl's stub library.

Installing from source

Togl uses the Tcl Extension Architecture to be able to build on the same platforms Tcl can be built on. In addition to the Togl source, you will need to have the Tcl and Tk source distributions because not all installations have the needed Tcl and Tk internal header files.

How you link with Togl depends on how you're planning to use it. There are basically three ways of using Togl with your application:

  • Install the Togl shared library and pkgIndex.tcl file (using make install) and link to the Togl stubs library with your executable or shared library. In this case you must call Togl_InitStubs() (and probably Tcl_InitStubs() — Tk_InitStubs is only needed if you call Tk functions). This is the way the included Togl examples are built.
  • Link to the Togl shared library or "compile in" the Togl object files with your executable or shared library. In this case you must call Togl_Init() from your C code to initialize Togl.
  • Install the Togl shared library and pkgIndex.tcl file (using make install) and then load it using Tcl commands or Tcl_PkgRequire(). Then use Tcl commands to create and manipulate the Togl widget.
Since Togl is compiled into a shared library using the Tcl/Tk stubs-interface, the same binary can be used with any version of Tck/Tk from 8.1 and up. See README.stubs for more info.

Specific platform notes follow:

Unix/X11 usage

Unix/X systems only need the public Tcl/Tk include files. Just configure, make, and optionally make install.

Windows 95/NT/2000/XP usage

Windows platforms need tkWinInt.h and other internal Tk header files. So you need a Tcl/Tk source distribution in addition to the Togl distribution (or copy over the various include files).

Here's the minimal way to build Togl with Tcl/Tk using the gcc that is distributed as part of the cygwin tools (Microsoft's compilers work too):

VER=8.4.12
SRCDIR=`pwd`

cd $SRCDIR/tcl$VER/win
env 'CC=gcc -mno-cygwin' ./configure --enable-threads
make libtclstub84.a

cd $SRCDIR/tk$VER/win
env 'CC=gcc -mno-cygwin' ./configure --enable-threads
make libtkstub84.a

cd $SRCDIR/Togl2.0
env 'CC=gcc -mno-cygwin' ./configure --with-tcl=../tcl$VER/win --with-tk=../tk$VER/win

make
The resulting Togl20.dll and pkgIndex.tcl should be installed into your Tcl installation just like any other package.

If you change all of the above make's to make install instead, then the Togl package is installed correctly.

Mac OS X usage

These special instructions are for building the Aqua version of Togl. Mac OS X needs tkMacOSXInt.h and other internal Tk header files. Unfortunately, the Tcl and Tk frameworks that Apple distributes are missing the internal headers. So you need a Tcl/Tk source distribution in addition to the Togl distribution (or copy over the various include files). You would probably want a newer version of Tcl and Tk anyway because each minor revision of 8.4 has many Aqua bug fixes.

Here's one way to build Tcl, Tk, and Togl on Mac OS X (assuming they are all in the same directory) to install in your home directory:

VER=8.4.12

mkdir -p ~/bin
make -C tcl$VER/macosx install PREFIX="${HOME}" INSTALL_PATH="${HOME}/Library/Frameworks"
make -C tk$VER/macosx install PREFIX="${HOME}" INSTALL_PATH="${HOME}/Library/Frameworks" APPLICATION_INSTALL_PATH="${HOME}/Applications"

cd Togl2.0
./configure --prefix="${HOME}"
make install

Version History

Version 1.0 — March, 1996

  • Initial version

Version 1.1 (never officially released)

  • Added Togl_LoadBitmapFont function
  • Fixed a few bugs

Version 1.2 — November, 1996

  • added swapbuffers and makecurrent Tcl commands
  • more bug fixes
  • upgraded to suport Tcl 7.6 and Tk 4.2
  • added stereo and overlay plane support
  • added Togl_Get/SetClientData() functions
  • added Togl_DestroyFunc()

Version 1.3 — May 2, 1997

  • fixed a bug in Togl_Configure()
  • fixed a compilation problem in using Tcl_PkgProvide() with Tcl < 7.4
  • new overlay functions: Togl_ExistsOverlay, Togl_GetOverlayTransparentValue, Togl_IsMappedOverlay, Togl_AllocColorOverlay, Togl_FreeColorOverlay
  • added X11 functions: Togl_Display, Togl_Screen, Togl_ScreenNumber, Togl_Colormap
  • added Togl_DumpToEpsFile function
  • fixed a C++ compilation problem
  • more robust overlay code
  • added timers (Togl_TimerFunc) from Peter Dern and Elmar Gerwalin

Version 1.4 — September 17, 1997

  • ported to Windows NT (Robert Casto)
  • updated for Tcl/Tk 8.0
  • added many config flags (-redsize, -depthsize, etc) (Matthias Ott)
  • added Togl_Set*Func() functions to reassign callback functions (Matthias Ott)
  • added Togl_ResetDefaultCallbacks() and Togl_ClientData() functions (Greg Couch)

Version 1.5 — September 18, 1998

  • fixed a few Unix and Windows compilation bugs
  • added Ben Evan's SGI stereo functions
  • multiple expose events now reduced to one redraw
  • destroying Togl widgets caused problems, patched by Adrian J. Chung
  • added Togl_TkWin() function
  • updated for Tcl/Tk 8.0p2
  • added gears demo from Philip Quaife
  • added -sharelist and -sharecontext config flags
  • fixed a few overlay update bugs
  • added -indirect config flag

Version 1.6 — May 7, 2003

  • added Togl_SetTimerFunc function
  • updated for Tcl/Tk 8.0.5 and 8.1
  • context sharing added for Windows
  • Macintosh support (by Paul Thiessen)
  • Tcl/Tk stubs support — see README.tcl (by Jonas Beskow)

Version 1.7 — Jan 2006

  • added Mac OS X support
  • enabled asking for quad-buffered stereo pixel formats on all platforms (use -oldstereo on SGIs for splitscreen stereo — C API changed too)
  • configuring the cursor is no longer slow
  • added -pixelformat config flag
  • added setgrid support (unfortunately many window managers can't cope with 1x1 pixel grid)
  • only free context when last reference is gone
  • switched to TEA-based configure (instead of editting make files)

Version 2.0 — Apr 2008

  • stubified C API
  • replaced EPS support with TK photo image support
  • simplified C API by requiring callback command options
  • Added command arguments for create, destroy, etc. callbacks, so there is a -createcommand option to the togl command (etc.). (and removed Togl_*Func from the C API)
  • added togl instance commands that call C API — see documentation
  • use Tcl objects internally
  • use Tcl object interface for callbacks
  • vertical sync control
  • fix thread safety in anticipation that OpenGL drivers may someday be thread safe
  • added simple stereo rendering interface
  • revised font C API
  • updated font support for Tk 8.4 on all platforms
  • updated documentation
  • prebuilt binaries

Future plans

Patches for the following are especially welcome:
  • multisampling support (can be worked-around by passing in a pixelformat)
  • pbuffers
  • Tk 8.5 fonts
  • EGL support
  • RGB overlays
  • Tcl access to colormap manipulation
  • more Aqua support

Hosted by SourceForge.net Logo Togl2.0/doc/faq.html0000644000175500010010000000706711003215005013144 0ustar gregcNone Togl Frequently Asked Questions

Togl Frequently Asked Questions

Contents

Frequently Asked Questions (and Problems)


If you have something to add to this section please let us know.

Bad Match X errors on Sun systems
There is(was?) a bug in Sun's XmuLookupStandardColormap X library function. If you compile togl.c with the SOLARIS_BUG symbol defined (-DSOLARIS_BUG) this function call will be omitted.

Is stereo rendering supported?
Several different stereo modes are supported.

Is fullscreen stereo rendering supported?
Before Tk 8.5, Tk does not support true fullscreen windows. Consequenly the full-screen stereo, that gaming graphics cards support (ATI Radeon, NVidia GeForce), won't be added until sometime after Tk 8.5 is available. Fullscreen stereo on workstation graphics cards (ATI FireGL, NVidia Quadro, Matrix Parhelia, 3Dlabs Wildcat) does work.

How do I get the Microsoft Windows device context?
First call Togl_MakeCurrent to make sure you have the right OpenGL context and device context set, then call wglGetCurrentDC.

How do I use Togl from Python?
The Togl source distribution comes with a Togl.py file that provides a Tkinter-style Togl widget. And for Togl callbacks that are C functions, there is a toglpy.h file that provides a function that converts a Python object into its corresponding Togl widget:
Togl *getToglFromWidget(PyObject *widget)

Is Togl compatible with Tile and Tk 8.5?
Yes, Togl works as is (except for the bitmap font support for X11 and Aqua). From Joe English:
Complex "owner-draw" widgets like tkZinc, or the text and canvas widgets, really don't benefit much from themability, so there's no reason to rewrite them. (http://wiki.tcl.tk/13373)

Hosted by SourceForge.net Logo Togl2.0/doc/header.js0000644000175500010010000000135211003214657013300 0ustar gregcNonefunction displayHeader(pageTitle) { document.write("

" + pageTitle + "

"); } function NavigationBar() { document.write(""); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write("
IndexIntroDownload/InstallUsing ToglTcl APIC APIFAQ
"); document.write("
"); } Togl2.0/doc/index.html0000644000175500010010000001160611003215013013475 0ustar gregcNone Togl, a Tk OpenGL widget

Togl — a Tk OpenGL widget

Copyright © 1996-2008 Brian Paul, Ben Bederson, and Greg Couch

Index


Introduction

Togl is a Tk widget for OpenGL rendering. Togl was originally based on OGLTK, written by Benjamin Bederson at the University of New Mexico. Togl's main features are:
  • unifies Microsoft Windows, X11 (Linux/IRIX/...), and Mac OS X Aqua support
  • support for requesting stencil, accumulation, alpha buffers, etc.
  • multiple OpenGL drawing windows
  • simple stereo rendering support
  • simple, portable font support
  • color-index mode support including color allocation functions
  • overlay plane support
  • OpenGL extension testing from Tcl
  • Tcl Extension Architecture (TEA) 3 compliant

Togl does almost no OpenGL drawing itself, instead it manages OpenGL drawing by calling various Tcl commands (a.k.a., callback functions). Those commands can be C functions that call OpenGL (in)directly or another Tcl package (e.g., Tcl3D).

Togl is copyrighted by Brian Paul (brian_e_paulATyahooDOTcom), Benjamin Bederson (bedersonATcsDOTumdDOTedu), and Greg Couch (gregcouchATusersDOTsourceforgeDOTnet). See the LICENSE file for details.

The Togl project and home page are hosted by SourceForge.

Mailing list

See the Togl project at SourceForge for mailing list information.

Reporting Bugs

There is a bug database on the Togl Project Page. You may also discuss bugs on the mailing list.

It may be worth upgrading your graphics driver and retesting before reporting a bug, as, historically, many Togl "bugs" have been fixed by a graphics driver upgrade, especially on Microsoft Windows.

When reporting bugs please provide as much information as possible. Such as the version of Togl, which operating system (e,g., Windows XP, Red Hat Linux, Mac OS X, etc.), the version of the operating system, and the version of the graphics driver. Also, it's very helpful to us if you can provide an example program which demonstrates the problem.

Contributors

Several people have contributed new features to Togl. Among them are:

  • Ramon Ramsan — overlay plane support
  • Miguel A. De Riera Pasenau — more overlay functions, X11 functions and EPS output
  • Peter Dern and Elmar Gerwalin — Togl_TimerFunc and related code
  • Robert Casto — Windows NT port
  • Geza Groma — Windows 95/NT patches
  • Ben Evans — SGI stereo support
  • Paul Thiessen — Macintosh support
  • Jonas Beskow — Tcl/Tk stubs support
  • Paul Kienzle — TEA debugging and patches
  • Greg Couch — version 1.7, 2.0
Many others have contributed bug fixes. Thanks for your contributions!

Last edited on 16 April 2008 by Greg Couch.
Hosted by SourceForge.net Logo Togl2.0/doc/README.txt0000644000175500010010000000021710466273561013222 0ustar gregcNoneThis directory contains the documentation of Togl, the Tk OpenGL widget. The documentation also doubles as the contents of the Togl home page. Togl2.0/doc/stereo.html0000644000175500010010000001323411003215020013664 0ustar gregcNone Togl Stereo Modes

Togl Stereo Modes

Contents


There are lots of stereo modes in Togl because there are many ways to draw stereo with different tradeoffs. All of the stereo modes are choosen with the -stereo configuration option. All of the non-native stereo techniques are software-only and can be changed at anytime.

When using a non-native stereo mode, the OpenGL glDrawBuffer, glClear, glFrustum, and glOrtho calls should be replaced with the Togl Tcl or C versions for seemless stereo rendering.

The various stereo modes are:

none or ""
Turn off stereo.
native
Use native OpenGL hardware accelerated stereo (single- or double-buffered for both the left and the right eyes). Each eye is drawn at full window resolution which gives the best stereo image. This mode requires support from the graphics driver and is typically only supported on workstation-class graphics cards, e.g., NVidia Quadro, ATI FireGL, Matrix Parhelia, 3DLabs Wildcat graphics cards and SGI workstations. The video refresh rate is changed automatically by the windowing system except on SGI workstations. Developers for SGI workstations can either switch the video manually with /usr/gfx/setmon or /usr/bin/X11/xsetmon, or use the autostereo package.

Currently, there is a limitation that a togl widget can not be reconfigured in or out of the native stereo mode. And if/when it is supported, some graphics drivers might not allow it.

anaglyph
Draw the left eye in the red part of the color buffer and the right eye in the blue and green parts. Designed to be viewed with inexpensive red-blue or red-cyan glasses. Works best with gray scale and non-saturated color images.
cross-eye
Draw right eye image on the left half of screen, and draw left eye image on the right half of screen. So each eye is drawn at less than half of the window resolution.
wall-eye
Draw left eye image on the left half of the screen, and draw right eye image on the right half of the screen. So each eye is drawn at less than half of the window resolution.
dti
Designed for DTI displays. If you look at the window unassisted, you'll see horizonally squished images with the left eye image on the left, and right eye image on the right. So each eye is drawn at half of the window resolution.
left eye
Only draw left eye view at full resolution.
right eye
Only draw right eye view at full resolution.
sgioldstyle
Support older-style SGI stereo where you lose half of the vertical resolution. This uses the SGIStereo X extension, that is only available on SGI workstations, to tell the X server to duplicate non-stereo windows into both eyes. This option only works when the monitor has been changed to the one of the str_top, str_bot, or str_rect video output modes.

Hosted by SourceForge.net Logo Togl2.0/doc/tclapi.html0000644000175500010010000004707011003215026013652 0ustar gregcNone Togl Tcl API

Togl Tcl API

Contents


Togl Tcl command

The togl command creates a new Tk widget, a Tcl command, whose name is pathName. This command may be used to invoke various operations on the widget.

togl pathName [options]
If no options are given, a 400 by 400 pixel RGB window is created. This command may be used to invoke various operations on the widget.

Togl widget commands

The following commands are possible for an existing togl widget:

Configuration commands

pathName cget -option
Return current value of given configuration option.
pathName configure
pathName configure -option
If no option is given, then return information about all configuration options. Otherwise, return configuration information for given option. All configuration information consists of five values: the configuration option name, the option database name, the option database class, the default value, and the current value.
pathName configure -option value
Reconfigure a Togl widget. option may be any one of the options listed below.
pathName contexttag
Returns an integer that represents the context tag. All Togl widgets with the same context tag share display lists.

Extensions command

pathName extensions
Returns a list of OpenGL extensions available. For example:
if {[lsearch [pathName extensions] GL_EXT_bgra] != -1]} {
    ....
}
would check if the GL_EXT_bgra extension were supported.

Rendering commands

pathName postredisplay
Cause the displaycommand callback to be called the next time the event loop is idle.
pathName render
Causes the displaycommand callback to be called for pathName.
pathName swapbuffers
Causes front/back buffers to be swapped if in double buffer mode. And flushs the OpenGL command buffer if in single buffer mode. (So this is appropriate to call after every frame is drawn.)
pathName makecurrent
Make the widget specified by pathName and its OpenGL context the current ones. This is implicitly called before any callback command is invoked.

Image commands

pathName takephoto imagename
Copy the contents of the togl window into the given Tk photo image. Transparency values are copied and should be fully opaque for windows without alpha bitplanes.

Font commands

These functions provide an interface to the simple bitmap font capabilities that every OpenGL implementation provides. Better font support is found in other packages, e.g., Tcl3D or with different C APIs.

pathName loadbitmapfont font
font can be any of font descriptions listed in the Tk font command. It returns a togl font object.
pathName unloadbitmapfont toglfont
Releases the OpenGL resources needed by the toglfont.
pathName write toglfont [-pos xyzw] [-color rgba] string
Write the given string in the given toglfont, optionally at a particular position, xyzw and color, rgba. xyzw is either a 2, 3, or 4 element list of numbers. rgba is either a 3 or 4 element list of numbers.

Overlay Commands

pathName uselayer layer
This is a variation on the makecurrent command that makes the overlay OpenGL context current if layer is 2 and makes the normal OpenGL context current if layer is 1.
pathName showoverlay
Turn on drawing in the overlay planes.
pathName hideoverlay
Turn off drawing in the overlay planes.
pathName postredisplayoverlay
Cause the overlay OpenGL context to be redrawn the next time the Tcl event loop is idle.
pathName renderoverlay
Causes the overlaydisplaycommand callback to be called for pathName.
pathName existsoverlay
Return true if togl widget has overlay planes.
pathName ismappedoverlay
Return true if overlay planes are shown.
pathName getoverlaytransparentvalue
Return overlay plane's transparent pixel value.

OpenGL (Stereo) Commands

These commands exist to support stereo rendering. Just replace select OpenGL calls with the Togl versions and stereo rendering will magically work. And don't forget to update the stereo options.
pathName drawbuffer mode
Replaces calls to glDrawBuffer. The mode is an integer.
pathName clear mask
Replaces calls to glClear. The mask is an integer.
pathName frustum left right bottom top near far
Replaces calls to glFrustum.
pathName ortho left right bottom top near far
Replaces calls to glOrtho.
pathName numeyes
Returns numbers of eyes — basically, 2 for stereo views and 1 for all others, except some stereo views only need one eye from OpenGL.

Togl configuration options

Togl's configuration options can be separated into several categories: geometry, pixel format, and other. The pixel format related options can only be set at widget creation time. The other options can be changed dynamically by the pathName configure command (see above).

Drawing callbacks

Option Default Comments
-createcommand {} Can be abbreviated -create.
-displaycommand {} Can be abbreviated -display.
-reshapecommand {} Can be abbreviated -reshape.
-destroycommand {} Can be abbreviated -destroy.
-overlaydisplaycommand {} Can be abbreviated -overlaydisplay.

Geometry Options

Option Default Comments
-width 400 Set width of widget in pixels. It may have any of the forms accepted by Tk_GetPixels.
-height 400 Set height of widget in pixels. It may have any of the forms accepted by Tk_GetPixels(3).
-setgrid 0 Turn on gridded geometry management for togl widget's toplevel window and specify the geometry of the grid. See the manual pages for Tk's wm(n) and Tk_SetGrid(3) for more information. Unlike the text widget, the same value is used for both width and height increments.

Timer Options

Option Default Comments
-time 1 Specifies the interval, in milliseconds, for calling the timer callback function which was registered with -timercommand.
-timercommand {} Can be abbreviated -timer.

Stereo Options

Option Default Comments
-eyeseparation 2.0 Set the distance between the eyes in viewing coordinates.
-convergence 30.0 Set the distance to the screen from the eye in viewing coordinates (the distance at which the eyes converge).
You'd think these values would be given in physical units, but there's no single right way to convert to viewing coordinates from physical units. So if you're willing to use Tk's idea of the horizontal size of a window in millimeters (not always correct), you could convert the average eye separation of 63 mm to your viewing coordinates, and use that value as the eye separation.

Miscellaneous Options

Option Default Comments
-cursor "" Set the cursor in the widget window.
-swapinterval 1 Set the minimum swap interval measure in video frame periods. The default is 1 for for non-tearing artifacts when swapping buffers. Use a value of 0 when benchmarking frame rates.
-ident "" A user identification string. This is used match widgets for the -sharecontext and the -sharelist options (see below). This is also useful in your callback functions to determine which Togl widget is the caller.

Pixel Format Options

The following options can only be given when the togl widget is created — that is, unlike other options, the togl widget can not be reconfigured with different values for the following options after it is created.
Option Default Comments
-rgba true If true, use RGB(A) mode, otherwise use Color Index mode.
-redsize 1 Minimum number of bits in red component.
-greensize 1 Minimum number of bits in green component.
-bluesize 1 Minimum number of bits in blue component.
-alpha 1 If true and -rgba is true, request an alpha channel.
-alphasize 1 Minimum number of bits in alpha component.
 
-double false If true, request a double-buffered window, otherwise request a single-buffered window.
 
-depth false If true, request a depth buffer.
-depthsize 1 Minimum number of bits in depth buffer.
 
-accum false If true, request an accumulation buffer.
-accumredsize 1 Minimum number of bits in accumulation buffer red component.
-accumgreensize 1 Minimum number of bits in accumulation buffer green component.
-accumbluesize 1 Minimum number of bits in accumulation buffer blue component.
-accumalphasize 1 Minimum number of bits in accumulation buffer alpha component.
 
-stencil false If true, request a stencil buffer.
-stencilsize 1 Minimum number of bits in stencil component.
 
-auxbuffers 0 Desired number of auxiliary buffers.
 
-privatecmap false Only applicable in color index mode. If false, use a shared read-only colormap. If true, use a private read/write colormap.
 
-overlay false If true, request overlay planes.
 
-stereo mode See the stereo information for details about the various modes. Stereo parameters are changed with the stereo options.

When using a non-native stereo mode, the OpenGL glDrawBuffer, glClear, glFrustum, and glOrtho calls must be replaced with the Togl Tcl or C versions.

 
-indirect false If present, request an indirect rendering context. A direct rendering context is normally requested. Only significant on Unix/X11.
-sharelist "" Name of an existing Togl widget with which to share display lists. If it is not possible to share contexts between the two togl widgets (depends on the graphics driver and the particular formats), it fails.
-sharecontext "" Name of an existing Togl widget with which to share the OpenGL context. Note: all other pixel format options are ignored.
-pixelformat 0 Set the pixel format to the (platform-dependent) given value. This is a backdoor into choosing a particular pixel format that was determined by other means.

Hosted by SourceForge.net Logo Togl2.0/doc/upgrading.html0000644000175500010010000000742711003215033014356 0ustar gregcNone Upgrading to Version 2

Upgrading to Version 2

Contents


Internally, Togl version 2 isn't very different from version 1, and much of the C interface is the same. The main difference is that the focus of the Togl API has changed from being a C API to being a Tcl API. Which means that the full power of Togl is accessible from Tcl (the few exceptions are considered bugs).

Widget callback changes

The biggest change is how the various callback are initialized. In version 1, the C API Togl_Set*Func functions had to be used to setup the callback functions before creating the Togl widget. And once the callbacks were set for a particular Togl widget, they could not be changed. If more than once Togl widget was needed, the callback functions would need to be reset before each widget creation. In version 2, the callbacks are configuration arguments to the widget and can be updated like any other standard widget configuration option. See the Tcl API for details.

Widget subcommand changes

Version 1 also allowed new subcommands to be added to the togl widget command via the C API. This was dropped for a variety of reasons: there is no exact Tcl equivalent, there is no standard object-oriented technique currently in the Tcl core (8.4.13), it is unclear how to make the API thread safe, and the internal Tcl C API doesn't support dynamicly changing sets of subcommands. That said, this functionality might come back, especially when TIP #257 is implemented. Instead, in version 2, create a Tcl function that takes the Togl widget as an argument. Functions written in C can get the underlying Togl structure handle with either the Togl_GetToglFromObj or the Togl_GetToglFromName function, as appropriate. This means that there are no special Togl commands, only Tcl commands. See the C API for details.

Stereo changes

The stereo support has been totally revamped. Some form of stereo is available all of the time.

Font changes

Tcl support for writing strings has been added.

The font C API has been revised so that Togl_LoadBitmapFont returns a font object instead an integer (likewise for Togl_UnloadBitmapFont). So instead of calling glListBase and glCallLists directly, use Togl_WriteObj or Togl_WriteChars.

The TOGL_BITMAP_* constants remain for limited backwards source compatibility and are deprecated. The acceptable font names are now the same as Tk_GetFont and the Tk font command on all platforms.


Hosted by SourceForge.net Logo Togl2.0/doc/using.html0000644000175500010010000001142311003215040013510 0ustar gregcNone Using the Togl Widget

Using the Togl Widget

Contents


Using Togl With Your Application

First, double check that you have all of the prerequisites and that you have compiled and installed Togl.

Then, Togl acts like any other extension package — to load it, you use the Tcl package command:

package require Togl 2.0
After that, you can create a Togl widget just like any other Tk widget.

Examples

There are six working examples:

double.tcl — compares single vs double buffering with two Togl widgets
texture.tcl — lets you play with texture mapping options
index.tcl — example of using color index mode
overlay.tcl — example of using overlay planes (requires overlay hardware)
stereo.tcl — stereo example
gears.tcl — spinning gears example

Each example consists of two files: a Tcl script for the user interface, and a Tcl C package that does the OpenGL drawing. To compile the examples, type make examples in the Togl source directory. The C packages are compiled into shared libraries that are loaded into the Tcl interpreter as Tcl/Tk-extensions. The examples are started by running the corrsponding Tcl script: just type ./double.tcl (or ./texture.tcl etc.) or run under one of the Tcl interpreters, i.e., tclsh or wish. For example:

tclsh84 double.tcl.

Other examples that use Tcl for OpenGL drawing can be found in the Tcl3D demos.

Togl callbacks

All of the examples have similar structure. First they create the user interface with one or more Togl widgets. Each Togl widget is configured with the desired pixel format and several callback commands (not all are needed):
-createcommand Called when Togl widget is mapped — when it is safe to initialize the OpenGL context.
-reshapecommand Called when the Togl widget is resized — when the OpenGL context's viewport needs to be changed.
-displaycommand Called when the contents of the Togl widget needs to be redrawn. Redraws are normally delayed to be when the Tcl event loop is idle (see the togl widget's postredisplay command), or as the result of an explict call to the togl's widgets render command.
-destroycommand Called when the Togl widget is destroyed. While OpenGL frees display lists and other resources, sometimes there's some associated state that is no longer needed.
-timercommand Called every n milliseconds as given by the -time option.
-overlaydisplaycommand Called when the overlay planes needs to be redrawn. The overlay planes are created and reshaped at the same time as the main OpenGL context.
Typically, only -createcommand, -reshapecommand and -displaycommand are used.


Hosted by SourceForge.net Logo Togl2.0/double.c0000644000175500010010000001714511002045766012374 0ustar gregcNone/* $Id: double.c,v 1.19 2008/04/17 00:13:42 gregcouch Exp $ */ /* * Togl - a Tk OpenGL widget * Copyright (C) 1996-1997 Brian Paul and Ben Bederson * Copyright (C) 2006-2007 Greg Couch * See the LICENSE file for copyright details. */ #define USE_TOGL_STUBS #include "togl.h" #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT static Tcl_Obj *toglFont; static double xAngle = 0, yAngle = 0, zAngle = 0; static GLdouble CornerX, CornerY, CornerZ; /* where to print strings */ /* * Togl widget create callback. This is called by Tcl/Tk when the widget has * been realized. Here's where one may do some one-time context setup or * initializations. */ static int create_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } toglFont = Togl_LoadBitmapFont(togl, "Helvetica"); if (!toglFont) { Tcl_AppendResult(interp, "create_cb: ", "Couldn't load font!\n", NULL); return TCL_ERROR; } return TCL_OK; } /* * Togl widget reshape callback. This is called by Tcl/Tk when the widget * has been resized. Typically, we call glViewport and perhaps setup the * projection matrix. */ static int reshape_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int width; int height; double aspect; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); aspect = (double) width / (double) height; glViewport(0, 0, width, height); /* Set up projection transform */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-aspect, aspect, -1, 1, 1, 10); CornerX = -aspect; CornerY = -1; CornerZ = -1.1; /* Change back to model view transform for rendering */ glMatrixMode(GL_MODELVIEW); return TCL_OK; } static void print_string(Togl *togl, const char *s) { Togl_WriteChars(togl, toglFont, s, 0); } /* * Togl widget display callback. This is called by Tcl/Tk when the widget's * contents have to be redrawn. Typically, we clear the color and depth * buffers, render our objects, then swap the front/back color buffers. */ static int display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static GLuint cubeList = 0; const char *ident; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) return TCL_ERROR; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); /* Reset modelview matrix to the identity * matrix */ glTranslatef(0, 0, -3); /* Move the camera back three units */ glRotated(xAngle, 1, 0, 0); /* Rotate by X, Y, and Z angles */ glRotated(yAngle, 0, 1, 0); glRotated(zAngle, 0, 0, 1); glEnable(GL_DEPTH_TEST); if (!cubeList) { cubeList = glGenLists(1); glNewList(cubeList, GL_COMPILE); /* Front face */ glBegin(GL_QUADS); glColor3f(0, 0.7f, 0.1f); /* Green */ glVertex3f(-1, 1, 1); glVertex3f(1, 1, 1); glVertex3f(1, -1, 1); glVertex3f(-1, -1, 1); /* Back face */ glColor3f(0.9f, 1, 0); /* Yellow */ glVertex3f(-1, 1, -1); glVertex3f(1, 1, -1); glVertex3f(1, -1, -1); glVertex3f(-1, -1, -1); /* Top side face */ glColor3f(0.2f, 0.2f, 1); /* Blue */ glVertex3f(-1, 1, 1); glVertex3f(1, 1, 1); glVertex3f(1, 1, -1); glVertex3f(-1, 1, -1); /* Bottom side face */ glColor3f(0.7f, 0, 0.1f); /* Red */ glVertex3f(-1, -1, 1); glVertex3f(1, -1, 1); glVertex3f(1, -1, -1); glVertex3f(-1, -1, -1); glEnd(); glEndList(); } glCallList(cubeList); glDisable(GL_DEPTH_TEST); glLoadIdentity(); glColor3f(1, 1, 1); glRasterPos3d(CornerX, CornerY, CornerZ); ident = Togl_Ident(togl); if (strcmp(ident, "Single") == 0) { print_string(togl, "Single buffered"); } else { print_string(togl, "Double buffered"); } Togl_SwapBuffers(togl); return TCL_OK; } static int setXrot_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &xAngle) != TCL_OK) { return TCL_ERROR; } /* printf( "before %f ", xAngle ); */ if (xAngle < 0) { xAngle += 360; } else if (xAngle > 360) { xAngle -= 360; } /* printf( "after %f \n", xAngle ); */ Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } static int setYrot_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &yAngle) != TCL_OK) { return TCL_ERROR; } if (yAngle < 0) { yAngle += 360; } else if (yAngle > 360) { yAngle -= 360; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } static int getXrot_cb(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { Tcl_SetObjResult(interp, Tcl_NewDoubleObj(xAngle)); return TCL_OK; } static int getYrot_cb(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { Tcl_SetObjResult(interp, Tcl_NewDoubleObj(yAngle)); return TCL_OK; } /* * Called by Tcl to let me initialize the modules (Togl) I will need. */ EXTERN int Double_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "create_cb", create_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "display_cb", display_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape_cb", reshape_cb, NULL, NULL); /* * Make a new Togl widget command so the Tcl code can set a C variable. */ Tcl_CreateObjCommand(interp, "setXrot", setXrot_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "setYrot", setYrot_cb, NULL, NULL); /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ Tcl_CreateCommand(interp, "getXrot", getXrot_cb, NULL, NULL); Tcl_CreateCommand(interp, "getYrot", getYrot_cb, NULL, NULL); return TCL_OK; } Togl2.0/double.tcl0000664000175500010010000000533310663455073012742 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # $Id: double.tcl,v 1.8 2007/08/03 16:48:48 gregcouch Exp $ # Togl - a Tk OpenGL widget # Copyright (C) 1996 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # An Tk/OpenGL widget demo with two windows, one single buffered and the # other double buffered. package provide double 1.0 # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/double[info sharedlibextension] # create ::double namespace namespace eval ::double { } proc double::setup {} { wm title . "Single vs Double Buffering" frame .f1 # create first Togl widget togl .f1.o1 -width 200 -height 200 -rgba true -double false -depth true -ident Single -create create_cb -display display_cb -reshape reshape_cb # create second Togl widget, share display lists with first widget togl .f1.o2 -width 200 -height 200 -rgba true -double true -depth true -ident Double -sharelist Single -create create_cb -display display_cb -reshape reshape_cb scale .sx -label {X Axis} -from 0 -to 360 -command {::double::setAngle x} -orient horizontal scale .sy -label {Y Axis} -from 0 -to 360 -command {::double::setAngle y} -orient horizontal button .btn -text Quit -command exit bind .f1.o1 { ::double::motion_event [lindex [%W config -width] 4] \ [lindex [%W config -height] 4] \ %x %y } bind .f1.o2 { ::double::motion_event [lindex [%W config -width] 4] \ [lindex [%W config -height] 4] \ %x %y } pack .f1.o1 .f1.o2 -side left -padx 3 -pady 3 -fill both -expand t pack .f1 -fill both -expand t pack .sx -fill x pack .sy -fill x pack .btn -fill x } # This is called when mouse button 1 is pressed and moved in either of # the OpenGL windows. proc double::motion_event { width height x y } { setXrot .f1.o1 [expr 360.0 * $y / $height] setXrot .f1.o2 [expr 360.0 * $y / $height] setYrot .f1.o1 [expr 360.0 * ($width - $x) / $width] setYrot .f1.o2 [expr 360.0 * ($width - $x) / $width] # .sx set [expr 360.0 * $y / $height] # .sy set [expr 360.0 * ($width - $x) / $width] .sx set [getXrot] .sy set [getYrot] } # This is called when a slider is changed. proc double::setAngle {axis value} { global xAngle yAngle zAngle switch -exact $axis { x {setXrot .f1.o1 $value setXrot .f1.o2 $value} y {setYrot .f1.o1 $value setYrot .f1.o2 $value} } } # Execution starts here! if { [info script] == $argv0 } { ::double::setup } Togl2.0/gears.c0000644000175500010010000003117210711023730012210 0ustar gregcNone/* gears.c */ /* * 3-D gear wheels. This program is in the public domain. * * Brian Paul * * * Modified to work under Togl as a widget for TK 1997 * * Philip Quaife * */ #define USE_TOGL_STUBS #include "togl.h" #include #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #ifndef M_PI # define M_PI 3.14159265 #endif #define FM_PI ((float) M_PI) #ifdef _MSC_VER __inline float sinf(double a) { return (float) sin(a); } __inline float cosf(double a) { return (float) cos(a); } __inline float sqrtf(double a) { return (float) sqrt(a); } # define sin sinf # define cos cosf # define sqrt sqrtf #endif struct WHIRLYGIZMO { int Gear1, Gear2, Gear3; double Rotx, Roty, Rotz; double Angle; int Height, Width; }; typedef struct WHIRLYGIZMO WHIRLYGIZMO; /* * Draw a gear wheel. You'll probably want to call this function when * building a display list since we do a lot of trig here. * * Input: inner_radius - radius of hole at center * outer_radius - radius at center of teeth * width - width of gear * teeth - number of teeth * tooth_depth - depth of tooth */ static void gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GLint teeth, GLfloat tooth_depth) { GLint i; GLfloat r0, r1, r2; GLfloat angle, da; GLfloat u, v, len; r0 = inner_radius; r1 = outer_radius - tooth_depth / 2; r2 = outer_radius + tooth_depth / 2; da = 2 * FM_PI / teeth / 4; glShadeModel(GL_FLAT); glNormal3f(0, 0, 1); /* draw front face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2 * FM_PI / teeth; glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5f); glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5f); glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5f); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5f); } glEnd(); /* draw front sides of teeth */ glBegin(GL_QUADS); da = 2 * FM_PI / teeth / 4; for (i = 0; i < teeth; i++) { angle = i * 2 * FM_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5f); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5f); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5f); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5f); } glEnd(); glNormal3f(0, 0, -1); /* draw back face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2 * FM_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5f); glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5f); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5f); glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5f); } glEnd(); /* draw back sides of teeth */ glBegin(GL_QUADS); da = 2 * FM_PI / teeth / 4; for (i = 0; i < teeth; i++) { angle = i * 2 * FM_PI / teeth; glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5f); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5f); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5f); glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5f); } glEnd(); /* draw outward faces of teeth */ glBegin(GL_QUAD_STRIP); for (i = 0; i < teeth; i++) { angle = i * 2 * FM_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5f); glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5f); u = r2 * cos(angle + da) - r1 * cos(angle); v = r2 * sin(angle + da) - r1 * sin(angle); len = sqrt(u * u + v * v); u /= len; v /= len; glNormal3f(v, -u, 0); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5f); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5f); glNormal3f(cos(angle), sin(angle), 0); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5f); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5f); u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); glNormal3f(v, -u, 0); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5f); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5f); glNormal3f(cos(angle), sin(angle), 0); } glVertex3f(r1 /* * cos(0) */, /* r1 * sin(0) */ 0, width * 0.5f); glVertex3f(r1 /* * cos(0) */, /* r1 * sin(0) */ 0, -width * 0.5f); glEnd(); glShadeModel(GL_SMOOTH); /* draw inside radius cylinder */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2 * FM_PI / teeth; glNormal3f(-cos(angle), -sin(angle), 0); glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5f); glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5f); } glEnd(); } /* * static GLfloat view_rotx=20, view_roty=30, view_rotz=0; static GLint * gear1, gear2, gear3; static GLfloat angle = 0; */ static GLuint limit; static GLuint count = 1; static GLubyte polycolor[4] = { 255, 255, 255, 255 }; static int draw(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Wg = (WHIRLYGIZMO *) Togl_GetClientData(togl); glDisable(GL_TEXTURE_2D); glPushMatrix(); glRotatef((float) Wg->Rotx, 1, 0, 0); glRotatef((float) Wg->Roty, 0, 1, 0); glRotatef((float) Wg->Rotz, 0, 0, 1); glPushMatrix(); glTranslatef(-3, -2, 0); glRotatef((float) Wg->Angle, 0, 0, 1); glEnable(GL_DEPTH_TEST); glCallList(Wg->Gear1); glEnable(GL_DEPTH_TEST); glPopMatrix(); glPushMatrix(); glTranslatef(3.1f, -2, 0); glRotatef(-2 * (float) Wg->Angle - 9, 0, 0, 1); glCallList(Wg->Gear2); glPopMatrix(); glPushMatrix(); glTranslatef(-3.1f, 4.2f, 0); glRotatef(-2 * (float) Wg->Angle - 25, 0, 0, 1); glCallList(Wg->Gear3); glPopMatrix(); glPopMatrix(); Togl_SwapBuffers(togl); return TCL_OK; } static int zap(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } Wg = (WHIRLYGIZMO *) Togl_GetClientData(togl); free(Wg); return TCL_OK; } static int idle(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } Wg = (WHIRLYGIZMO *) Togl_GetClientData(togl); Wg->Angle += 2; Togl_PostRedisplay(togl); return TCL_OK; } /* change view angle, exit upon ESC */ /* * static GLenum key(int k, GLenum mask) { switch (k) { case TK_UP: view_rotx * += 5; return GL_TRUE; case TK_DOWN: view_rotx -= 5; return GL_TRUE; case * TK_LEFT: view_roty += 5; return GL_TRUE; case TK_RIGHT: view_roty -= 5; * return GL_TRUE; case TK_z: view_rotz += 5; return GL_TRUE; case TK_Z: * view_rotz -= 5; return GL_TRUE; } return GL_FALSE; } */ /* new window size or exposure */ static int reshape(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int width, height; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); glViewport(0, 0, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (width > height) { GLfloat w = (GLfloat) width / (GLfloat) height; glFrustum(-w, w, -1, 1, 5, 60); } else { GLfloat h = (GLfloat) height / (GLfloat) width; glFrustum(-1, 1, -h, h, 5, 60); } glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -40); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); return TCL_OK; } static int init(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; static GLfloat red[4] = { 0.8f, 0.1f, 0, 1 }; static GLfloat green[4] = { 0, 0.8f, 0.2f, 1 }; static GLfloat blue[4] = { 0.2f, 0.2f, 1, 1 }; static GLfloat pos[4] = { 5, 5, 10, 0 }; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } glLightfv(GL_LIGHT0, GL_POSITION, pos); glEnable(GL_CULL_FACE); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); /* make the gears */ Wg = (WHIRLYGIZMO *) malloc(sizeof (WHIRLYGIZMO)); if (!Wg) { Tcl_SetResult(Togl_Interp(togl), "\"Cannot allocate client data for widget\"", TCL_STATIC); } Wg->Gear1 = glGenLists(1); glNewList(Wg->Gear1, GL_COMPILE); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); gear(1, 4, 1, 20, 0.7f); glEndList(); Wg->Gear2 = glGenLists(1); glNewList(Wg->Gear2, GL_COMPILE); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); gear(0.5f, 2, 2, 10, 0.7f); glEndList(); Wg->Gear3 = glGenLists(1); glNewList(Wg->Gear3, GL_COMPILE); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); gear(1.3f, 2, 0.5f, 10, 0.7f); glEndList(); glEnable(GL_NORMALIZE); Wg->Height = Togl_Height(togl); Wg->Width = Togl_Width(togl); Wg->Angle = 0; Wg->Rotx = 0; Wg->Roty = 0; Wg->Rotz = 0; Togl_SetClientData(togl, (ClientData) Wg); return TCL_OK; } static int position(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; char Result[100]; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } Wg = (WHIRLYGIZMO *) Togl_GetClientData(togl); /* Let result string equal value */ sprintf(Result, "%g %g", Wg->Roty, Wg->Rotx); Tcl_SetResult(interp, Result, TCL_VOLATILE); return TCL_OK; } static int rotate(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { WHIRLYGIZMO *Wg; Togl *togl; if (objc != 4) { Tcl_WrongNumArgs(interp, 1, objv, "pathName yrot xrot"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } Wg = (WHIRLYGIZMO *) Togl_GetClientData(togl); if (Tcl_GetDoubleFromObj(interp, objv[2], &Wg->Roty) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[3], &Wg->Rotx) != TCL_OK) { return TCL_ERROR; } Togl_PostRedisplay(togl); return TCL_OK; } EXTERN int Gears_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "init", init, NULL, NULL); Tcl_CreateObjCommand(interp, "zap", zap, NULL, NULL); Tcl_CreateObjCommand(interp, "draw", draw, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape", reshape, NULL, NULL); Tcl_CreateObjCommand(interp, "idle", idle, NULL, NULL); Tcl_CreateObjCommand(interp, "rotate", rotate, NULL, NULL); Tcl_CreateObjCommand(interp, "position", position, NULL, NULL); return TCL_OK; } Togl2.0/gears.tcl0000664000175500010010000000456410663455073012576 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # Togl - a Tk OpenGL widget # Copyright (C) 1996-1997 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # # Test Togl using GL Gears Demo # # Copyright (C) 1997 Philip Quaife # package provide gears 1.0 # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/gears[info sharedlibextension] # create ::gears namespace namespace eval ::gears { } proc ::gears::setup {} { global startx starty xangle0 yangle0 xangle yangle RotCnt global vTime set RotCnt 1 set xangle 0.0 set yangle 0.0 set vTime 100 wm title . "Rotating Gear Widget Test" label .t -text "Click and drag to rotate image" pack .t -side top -padx 2 -pady 10 frame .f pack .f -side top button .f.n1 -text " Add " -command ::gears::AutoRot button .f.r1 -text "Remove" -command ::gears::DelRot button .f.b1 -text " Quit " -command exit entry .f.t -width 4 -textvariable vTime pack .f.n1 .f.t .f.r1 .f.b1 -side left -anchor w -padx 5 newRot .w0 10 } proc ::gears::AutoRot {} { global RotCnt vTime newRot .w$RotCnt $vTime set RotCnt [expr $RotCnt + 1] } proc ::gears::DelRot {} { global RotCnt vTime if { $RotCnt != 0 } { set RotCnt [expr $RotCnt - 1] destroy .w$RotCnt } } proc ::gears::newRot {win {tick 100} } { togl $win -width 200 -height 200 -rgba true -double true -depth true -privatecmap false -time $tick -create init -destroy zap -display draw -reshape reshape -timer idle bind $win {::gears::RotStart %x %y %W} bind $win {::gears::RotMove %x %y %W} pack $win -expand true -fill both } proc ::gears::RotStart {x y W} { global startx starty xangle0 yangle0 xangle yangle set startx $x set starty $y set vPos [position $W] set xangle0 [lindex $vPos 0] set yangle0 [lindex $vPos 1] } proc ::gears::RotMove {x y W} { global startx starty xangle0 yangle0 xangle yangle set xangle [expr $xangle0 + ($x - $startx)] set yangle [expr $yangle0 + ($y - $starty)] rotate $W $xangle $yangle } if { [info script] == $argv0 } { ::gears::setup } Togl2.0/image.c0000644000175500010010000001420410663455073012205 0ustar gregcNone/* * SGI rgb file reader borrowed from gltk library */ #include "togl.h" /* added by GG to include windows.h */ #include #include #include #include "image.h" #ifndef SEEK_SET # define SEEK_SET 0 #endif static void tkQuit(void) { exit(0); } /******************************************************************************/ typedef struct _rawImageRec { unsigned short imagic; unsigned short type; unsigned short dim; unsigned short sizeX, sizeY, sizeZ; unsigned long min, max; unsigned long wasteBytes; char name[80]; unsigned long colorMap; FILE *file; unsigned char *tmp, *tmpR, *tmpG, *tmpB, *tmpA; unsigned long rleEnd; GLuint *rowStart; GLint *rowSize; } rawImageRec; /******************************************************************************/ static void ConvertShort(unsigned short *array, long length) { unsigned long b1, b2; unsigned char *ptr; ptr = (unsigned char *) array; while (length--) { b1 = *ptr++; b2 = *ptr++; *array++ = (unsigned short) ((b1 << 8) | b2); } } static void ConvertLong(GLuint *array, long length) { unsigned long b1, b2, b3, b4; unsigned char *ptr; ptr = (unsigned char *) array; while (length--) { b1 = *ptr++; b2 = *ptr++; b3 = *ptr++; b4 = *ptr++; *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4); } } static rawImageRec * RawImageOpen(const char *fileName) { union { int testWord; char testByte[4]; } endianTest; rawImageRec *raw; GLenum swapFlag; int x; endianTest.testWord = 1; if (endianTest.testByte[0] == 1) { swapFlag = GL_TRUE; } else { swapFlag = GL_FALSE; } raw = (rawImageRec *) malloc(sizeof (rawImageRec)); if (raw == NULL) { fprintf(stderr, "Out of memory!\n"); tkQuit(); } if ((raw->file = fopen(fileName, "rb")) == NULL) { perror(fileName); tkQuit(); } fread(raw, 1, 12, raw->file); if (swapFlag) { ConvertShort(&raw->imagic, 6); } raw->tmp = (unsigned char *) malloc(raw->sizeX * 256); raw->tmpR = (unsigned char *) malloc(raw->sizeX * 256); raw->tmpG = (unsigned char *) malloc(raw->sizeX * 256); raw->tmpB = (unsigned char *) malloc(raw->sizeX * 256); raw->tmpA = (unsigned char *) malloc(raw->sizeX * 256); if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL || raw->tmpB == NULL || raw->tmpA == NULL) { fprintf(stderr, "Out of memory!\n"); tkQuit(); } if ((raw->type & 0xFF00) == 0x0100) { x = raw->sizeY * raw->sizeZ * sizeof (GLuint); raw->rowStart = (GLuint *) malloc(x); raw->rowSize = (GLint *) malloc(x); if (raw->rowStart == NULL || raw->rowSize == NULL) { fprintf(stderr, "Out of memory!\n"); tkQuit(); } raw->rleEnd = 512 + (2 * x); fseek(raw->file, 512, SEEK_SET); fread(raw->rowStart, 1, x, raw->file); fread(raw->rowSize, 1, x, raw->file); if (swapFlag) { ConvertLong(raw->rowStart, x / sizeof (GLuint)); ConvertLong((GLuint *) raw->rowSize, x / sizeof (GLint)); } } return raw; } static void RawImageClose(rawImageRec * raw) { fclose(raw->file); free(raw->tmp); free(raw->tmpR); free(raw->tmpG); free(raw->tmpB); free(raw->tmpA); free(raw); } static void RawImageGetRow(rawImageRec * raw, unsigned char *buf, int y, int z) { unsigned char *iPtr, *oPtr, pixel; int count; if ((raw->type & 0xFF00) == 0x0100) { fseek(raw->file, raw->rowStart[y + z * raw->sizeY], SEEK_SET); fread(raw->tmp, 1, (unsigned int) raw->rowSize[y + z * raw->sizeY], raw->file); iPtr = raw->tmp; oPtr = buf; while (1) { pixel = *iPtr++; count = (int) (pixel & 0x7F); if (!count) { return; } if (pixel & 0x80) { while (count--) { *oPtr++ = *iPtr++; } } else { pixel = *iPtr++; while (count--) { *oPtr++ = pixel; } } } } else { fseek(raw->file, 512 + (y * raw->sizeX) + (z * raw->sizeX * raw->sizeY), SEEK_SET); fread(buf, 1, raw->sizeX, raw->file); } } static void RawImageGetData(rawImageRec * raw, TK_RGBImageRec * final) { unsigned char *ptr; int i, j; final->data = (unsigned char *) malloc((raw->sizeX + 1) * (raw->sizeY + 1) * 4); if (final->data == NULL) { fprintf(stderr, "Out of memory!\n"); tkQuit(); } ptr = final->data; for (i = 0; i < (int) (raw->sizeY); i++) { RawImageGetRow(raw, raw->tmpR, i, 0); RawImageGetRow(raw, raw->tmpG, i, 1); RawImageGetRow(raw, raw->tmpB, i, 2); if (raw->sizeZ == 4) { /* 4 components */ RawImageGetRow(raw, raw->tmpA, i, 3); for (j = 0; j < (int) (raw->sizeX); j++) { *ptr++ = *(raw->tmpR + j); *ptr++ = *(raw->tmpG + j); *ptr++ = *(raw->tmpB + j); *ptr++ = *(raw->tmpA + j); } } else { /* 3 components */ for (j = 0; j < (int) (raw->sizeX); j++) { *ptr++ = *(raw->tmpR + j); *ptr++ = *(raw->tmpG + j); *ptr++ = *(raw->tmpB + j); } } } } TK_RGBImageRec * tkRGBImageLoad(const char *fileName) { rawImageRec *raw; TK_RGBImageRec *final; raw = RawImageOpen(fileName); final = (TK_RGBImageRec *) malloc(sizeof (TK_RGBImageRec)); if (final == NULL) { fprintf(stderr, "Out of memory!\n"); tkQuit(); } final->sizeX = raw->sizeX; final->sizeY = raw->sizeY; final->sizeZ = raw->sizeZ; RawImageGetData(raw, final); RawImageClose(raw); return final; } /******************************************************************************/ Togl2.0/image.h0000644000175500010010000000034510640314333012177 0ustar gregcNone/* image.h */ #ifndef IMAGE_H # define IMAGE_H typedef struct _TK_RGBImageRec { int sizeX, sizeY, sizeZ; unsigned char *data; } TK_RGBImageRec; extern TK_RGBImageRec *tkRGBImageLoad(const char *fileName); #endif Togl2.0/index.c0000644000175500010010000001252510663455073012236 0ustar gregcNone/* $Id: index.c,v 1.13 2007/08/03 16:48:50 gregcouch Exp $ */ /* * Togl - a Tk OpenGL widget * Copyright (C) 1996-1997 Brian Paul and Ben Bederson * Copyright (C) 2006-2007 Greg Couch * See the LICENSE file for copyright details. */ /* * An example Togl program using color-index mode. */ #define USE_TOGL_STUBS #include "togl.h" #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /* Our color indexes: */ static unsigned long black, red, green, blue; /* Rotation angle */ static float Angle = 0; /* * Togl widget create callback. This is called by Tcl/Tk when the widget has * been realized. Here's where one may do some one-time context setup or * initializations. */ static int create_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } /* allocate color indexes */ black = Togl_AllocColor(togl, 0, 0, 0); red = Togl_AllocColor(togl, 1, 0, 0); green = Togl_AllocColor(togl, 0, 1, 0); blue = Togl_AllocColor(togl, 0, 0, 1); /* If we were using a private read/write colormap we'd setup our color * table with something like this: */ /* * black = 1; Togl_SetColor( togl, black, 0, 0, 0 ); red = 2; * Togl_SetColor( togl, red, 1, 0, 0 ); green = 3; Togl_SetColor( * togl, green, 0, 1, 0 ); blue = 4; Togl_SetColor( togl, blue, 0, * 0, 1 ); */ glShadeModel(GL_FLAT); glDisable(GL_DITHER); return TCL_OK; } /* * Togl widget reshape callback. This is called by Tcl/Tk when the widget * has been resized. Typically, we call glViewport and perhaps setup the * projection matrix. */ static int reshape_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int width; int height; float aspect; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); aspect = (float) width / (float) height; glViewport(0, 0, width, height); /* Set up projection transform */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-aspect, aspect, -1, 1, -1, 1); /* Change back to model view transform for rendering */ glMatrixMode(GL_MODELVIEW); return TCL_OK; } /* * Togl widget display callback. This is called by Tcl/Tk when the widget's * contents have to be redrawn. Typically, we clear the color and depth * buffers, render our objects, then swap the front/back color buffers. */ static int display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } glClearIndex((float) black); glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glTranslatef(0.3f, -0.3f, 0); glRotatef(Angle, 0, 0, 1); glIndexi(red); glBegin(GL_TRIANGLES); glVertex2f(-0.5f, -0.3f); glVertex2f(0.5f, -0.3f); glVertex2f(0, 0.6f); glEnd(); glPopMatrix(); glPushMatrix(); glRotatef(Angle, 0, 0, 1); glIndexi(green); glBegin(GL_TRIANGLES); glVertex2f(-0.5f, -0.3f); glVertex2f(0.5f, -0.3f); glVertex2f(0, 0.6f); glEnd(); glPopMatrix(); glPushMatrix(); glTranslatef(-0.3f, 0.3f, 0); glRotatef(Angle, 0, 0, 1); glIndexi(blue); glBegin(GL_TRIANGLES); glVertex2f(-0.5f, -0.3f); glVertex2f(0.5f, -0.3f); glVertex2f(0, 0.6f); glEnd(); glPopMatrix(); glFlush(); Togl_SwapBuffers(togl); return TCL_OK; } static int timer_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } Angle += 5.0; Togl_PostRedisplay(togl); return TCL_OK; } EXTERN int Index_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "::index::create_cb", create_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "::index::display_cb", display_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "::index::reshape_cb", reshape_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "::index::timer_cb", timer_cb, NULL, NULL); /* * Make a new Togl widget command so the Tcl code can set a C variable. */ /* NONE */ /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ return TCL_OK; } Togl2.0/index.tcl0000664000175500010010000000253710663455073012602 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # $Id: index.tcl,v 1.8 2007/08/03 16:48:50 gregcouch Exp $ # Togl - a Tk OpenGL widget # Copyright (C) 1996 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # A Tk/OpenGL widget demo using color-index mode. package provide index 1.0 # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/index[info sharedlibextension] # create ::index namespace namespace eval ::index { } proc ::index::setup {} { wm title . "Color index demo" togl .win -width 200 -height 200 -rgba false -double true -privatecmap false -time 10 -timer ::index::timer_cb -create ::index::create_cb -reshape ::index::reshape_cb -display ::index::display_cb button .photo -text "Take Photo" -command ::index::take_photo button .btn -text Quit -command exit pack .win -expand true -fill both pack .photo -expand true -fill both pack .btn -expand true -fill both } proc ::index::take_photo {} { image create photo img .win takephoto img img write image.ppm -format ppm } # Execution starts here! if { [info script] == $argv0 } { ::index::setup } Togl2.0/LICENSE0000664000175500010010000000276510534514766012001 0ustar gregcNoneThis software is copyrighted by Brian Paul (brian@mesa3d.org), Benjamin Bederson (bederson@cs.umd.edu), and Greg Couch (gregcouch@users.sourceforge.net). The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. Togl2.0/Makefile.in0000664000175500010010000004762611003223175013025 0ustar gregcNone# Makefile.in -- # # This file is a Makefile for Sample TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile. # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: Makefile.in,v 1.21 2008/04/21 23:42:53 gregcouch Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ MATH_LIBS = @MATH_LIBS@ LIBGLU = @LIBGLU@ EXAMPLE_SRCS = double.c gears.c index.c overlay.c stereo.c texture.c EXAMPLE_OBJS = $(EXAMPLE_SRCS:.c=.$(OBJEXT)) EXAMPLE_SHLIBS = $(EXAMPLE_SRCS:.c=$(SHLIB_SUFFIX)) #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ togl_ws.h #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ pkglib_BINARIES = $(PKG_LIB_FILE) lib_BINARIES = $(PKG_STUB_LIB_FILE) BINARIES = $(pkglib_BINARIES) $(lib_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PKG_DIR) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_WARNING = @CFLAGS_WARNING@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # Not used, but retained for reference of what libs Tcl required #TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" # TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) WISH_PROG = @WISH_PROG@ WISH = $(TCLSH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ -DAUTOSTEREOD=\"@AUTOSTEREOD@\" $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl togl_ws.h CLEANFILES = @CLEANFILES@ $(EXAMPLE_OBJS) $(EXAMPLE_SHLIBS) CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) libraries: #======================================================================== # Example section. These are examples because we don't want to install them. # And they're not tests because we currently have no automatic way to see # if they work. #======================================================================== examples: $(EXAMPLE_SHLIBS) double$(SHLIB_SUFFIX): double.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="double.$(OBJEXT) $(PKG_STUB_LIB_FILE)" $@ ; \ fi gears$(SHLIB_SUFFIX): gears.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="gears.$(OBJEXT) $(PKG_STUB_LIB_FILE)" $@ ; \ fi index$(SHLIB_SUFFIX): index.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="index.$(OBJEXT) $(PKG_STUB_LIB_FILE)" $@ ; \ fi overlay$(SHLIB_SUFFIX): overlay.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="overlay.$(OBJEXT) $(PKG_STUB_LIB_FILE)" $@ ; \ fi stereo$(SHLIB_SUFFIX): stereo.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="stereo.$(OBJEXT) $(PKG_STUB_LIB_FILE)" $@ ; \ fi texture$(SHLIB_SUFFIX): texture.$(OBJEXT) image.$(OBJEXT) $(PKG_STUB_LIB_FILE) -match=`expr 'x$(PKG_OBJECTS)' : '.*togl.*'`; \ if [ $$match -eq 0 ]; then \ $(MAKE_SHARED_LIB) ; \ else \ $(MAKE) PKG_OBJECTS="texture.$(OBJEXT) image.$(OBJEXT) $(PKG_STUB_LIB_FILE) $(LIBGLU)" $@ ; \ fi #======================================================================== # Stub section. #======================================================================== toglDecls.h toglStubInit.c: togl.decls $(TCLSH) `@CYGPATH@ $(TCL_SRC_DIR)/tools/genStubs.tcl` . togl.decls #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: # @echo "If you have documentation to create, place the commands to" # @echo "build the docs in the 'doc:' target. For example:" # @echo " xml2nroff sample.xml > sample.n" # @echo " xml2html sample.xml > sample.html" install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @mkdir -p $(DESTDIR)$(includedir) @echo "Installing header files in $(DESTDIR)$(includedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ done #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: doc # @mkdir -p $(DESTDIR)$(mandir)/mann # @echo "Installing documentation in $(DESTDIR)$(mandir)" # @list='$(srcdir)/doc/*.n'; for i in $$list; do \ # echo "Installing $$i"; \ # rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ # $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ # done test: binaries libraries $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) -rm -f $(PKG_STUB_LIB_FILE) ${MAKE_STUB_LIB} $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # sample.$(OBJEXT): $(srcdir)/generic/sample.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # Distribution creation # You may need to tweak this target to make it work correctly. #======================================================================== COMPRESS = tar zcvf $(PKG_DIR)-src.tar.gz $(PKG_DIR) DIST_ROOT = /tmp/togl-dist DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) BINPKG_DIR = $(PKG_DIR)-@TCL_VERSION@-$(subst Darwin,MacOSX,$(subst CYGWIN,Windows,$(shell uname -s | sed -e 's/[-_].*//'))) BINDIST_DIR = $(DIST_ROOT)/$(BINPKG_DIR) dist-clean: rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR)* dist: dist-clean mkdir -p $(DIST_DIR) cp -p $(srcdir)/README* $(srcdir)/LICENSE* $(srcdir)/togl.decls \ $(srcdir)/*.py $(srcdir)/*.tcl \ $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \ ben.rgb tree2.rgba \ $(DIST_DIR)/ chmod 664 $(DIST_DIR)/* chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in for i in $(srcdir)/*.[ch]; do \ if [ -f $$i ]; then \ cp -p $$i $(DIST_DIR)/ ; \ fi; \ done cd $(DIST_DIR); rm -f $(CONFIG_CLEAN_FILES) mkdir $(DIST_DIR)/tclconfig cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \ $(DIST_DIR)/tclconfig/ chmod 664 $(DIST_DIR)/tclconfig/tcl.m4 chmod +x $(DIST_DIR)/tclconfig/install-sh list='examples doc generic library mac tests unix win StereoI'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ mkdir $(DIST_DIR)/$$p; \ cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \ fi; \ done (cd $(DIST_ROOT); $(COMPRESS);) bindist-clean: rm -rf $(BINDIST_DIR) $(DIST_ROOT)/$(PKG_DIR)* bindist: all bindist-clean mkdir -p $(BINDIST_DIR) $(MAKE) prefix=$(BINDIST_DIR) exec_prefix=$(BINDIST_DIR) install $(INSTALL_DATA) README.bin $(BINDIST_DIR)/README.txt mkdir -p $(BINDIST_DIR)/doc @list='doc/*.html doc/*.js'; for i in $$list; do \ echo "Installing $$i"; \ rm -f $(BINDIST_DIR)/doc/`basename $$i`; \ $(INSTALL_DATA) $$i $(BINDIST_DIR)/doc ; \ done if [ @TOGL_WINDOWINGSYSTEM@ == TOGL_WGL ]; then \ (cd $(DIST_ROOT); zip -rDX9 $(BINPKG_DIR).zip $(BINPKG_DIR)); \ else \ (cd $(DIST_ROOT); tar zcvf $(BINPKG_DIR).tar.gz $(BINPKG_DIR)); \ fi #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log config.status #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: binaries @mkdir -p $(DESTDIR)$(libdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ fi; \ fi; \ fi; \ done @mkdir -p $(DESTDIR)$(pkglibdir) @list='$(pkglib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ fi; \ fi; \ fi; \ done @list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ echo " Install LICENSE $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) LICENSE $(DESTDIR)$(pkglibdir); \ else \ echo " Install LICENSE.togl $(DESTDIR)$(libdir)"; \ $(INSTALL_DATA) LICENSE $(DESTDIR)$(libdir)/LICENSE.togl; \ fi #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: binaries @mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(pkglib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(libdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # 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: # Additional dependencies togl.$(OBJEXT): toglFont.c Togl2.0/overlay.c0000644000175500010010000001224210663455073012604 0ustar gregcNone/* $Id: overlay.c,v 1.10 2007/08/03 16:48:50 gregcouch Exp $ */ /* * Togl - a Tk OpenGL widget * Copyright (C) 1996-1997 Brian Paul and Ben Bederson * Copyright (C) 2006-2007 Greg Couch * See the LICENSE file for copyright details. */ /* * An example Togl program using an overlay. */ #define USE_TOGL_STUBS #include "togl.h" #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /* Overlay color indexes: */ static unsigned long Red, Green; /* * Togl widget create callback. This is called by Tcl/Tk when the widget has * been realized. Here's where one may do some one-time context setup or * initializations. */ static int create_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } /* allocate overlay color indexes */ Red = Togl_AllocColorOverlay(togl, 1, 0, 0); Green = Togl_AllocColorOverlay(togl, 0, 1, 0); /* in this demo we always show the overlay */ if (Togl_ExistsOverlay(togl)) { Togl_ShowOverlay(togl); printf("Red and green lines are in the overlay\n"); } else { printf("Sorry, this display doesn't support overlays\n"); } return TCL_OK; } /* * Togl widget reshape callback. This is called by Tcl/Tk when the widget * has been resized. Typically, we call glViewport and perhaps setup the * projection matrix. */ static int reshape_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int width; int height; float aspect; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); aspect = (float) width / (float) height; /* Set up viewing for normal plane's context */ glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-aspect, aspect, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); /* Set up viewing for overlay plane's context */ if (Togl_ExistsOverlay(togl)) { Togl_UseLayer(togl, TOGL_OVERLAY); glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1, 1, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); Togl_UseLayer(togl, TOGL_NORMAL); } return TCL_OK; } /* * Togl widget overlay display callback. This is called by Tcl/Tk when the * overlay has to be redrawn. */ static int overlay_display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { glClear(GL_COLOR_BUFFER_BIT); glIndexi(Red); glBegin(GL_LINES); glVertex2f(-1, -1); glVertex2f(1, 1); glVertex2f(-1, 1); glVertex2f(1, -1); glEnd(); glIndexi(Green); glBegin(GL_LINE_LOOP); glVertex2f(-0.5f, -0.5f); glVertex2f(0.5f, -0.5f); glVertex2f(0.5f, 0.5f); glVertex2f(-0.5f, 0.5f); glEnd(); glFlush(); return TCL_OK; } /* * Togl widget display callback. This is called by Tcl/Tk when the widget's * contents have to be redrawn. Typically, we clear the color and depth * buffers, render our objects, then swap the front/back color buffers. */ static int display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); glBegin(GL_TRIANGLES); glColor3f(1, 0, 1); glVertex2f(-0.5f, -0.3f); glVertex2f(0.5f, -0.3f); glVertex2f(0, 0.6f); glColor3f(1, 1, 0); glVertex2f(-0.5f + 0.2f, -0.3f - 0.2f); glVertex2f(0.5f + 0.2f, -0.3f - 0.2f); glVertex2f(0 + 0.2f, 0.6f - 0.2f); glColor3f(0, 1, 1); glVertex2f(-0.5f + 0.4f, -0.3f - 0.4f); glVertex2f(0.5f + 0.4f, -0.3f - 0.4f); glVertex2f(0 + 0.4f, 0.6f - 0.4f); glEnd(); glFlush(); return TCL_OK; } /* * Called by Tcl to let me initialize the modules (Togl) I will need. */ EXTERN int Overlay_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "create_cb", create_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "display_cb", display_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape_cb", reshape_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "overlay_display_cb", overlay_display_cb, NULL, NULL); /* * Make a new Togl widget command so the Tcl code can set a C variable. */ /* NONE */ /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ return TCL_OK; } Togl2.0/overlay.tcl0000664000175500010010000000202710663455073013146 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # $Id: overlay.tcl,v 1.7 2007/08/03 16:48:50 gregcouch Exp $ # Togl - a Tk OpenGL widget # Copyright (C) 1996 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # A Tk/OpenGL widget demo using an overlay. # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/overlay[info sharedlibextension] proc setup {} { wm title . "Overlay demo" togl .win -width 200 -height 200 -rgba true -double false -overlay true -create create_cb -reshape reshape_cb -display display_cb -overlaydisplay overlay_display_cb button .btn -text Quit -command exit pack .win -expand true -fill both pack .btn -expand true -fill both } # Execution starts here! # Execution starts here! if { [info script] == $argv0 } { setup } Togl2.0/pkgIndex.tcl.in0000664000175500010010000000020110534514446013630 0ustar gregcNone# # Tcl package index file # package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \ [list load [file join $dir @PKG_LIB_FILE@]] Togl2.0/README.bin0000664000175500010010000000472711003223627012404 0ustar gregcNoneREADME.txt: Togl This is a Togl 2.X binary distribution for both users and developers. It is specific to a particular operating system (e.g., Windows, Mac OS X, Linux, etc.). Since the C ABI should be same for all compilers on the same system, using Togl via the Tcl interface should work regardless of which compiler Tcl was compiled with. The files are named: ToglTOGL_VERSION-TCL_VERSION-OS.SUFFIX For example, TOGL_VERSION=2.0, TCL_VERSION=8.4, OS=Linux, and SUFFIX=.tar.gz gives: Togl2.0-8.4-Linux.tar.gz Togl is also available at: http://sourceforge.net/projects/togl/ You can get any release of Togl from the file distributions link at the above URL. A copy of the online documentation is in the doc directory. For users: Only the lib/Togl2.X directory (and its contents) need to be installed in your Tcl library. Execute the following Tcl script to find the directories Tcl looks for packages in: puts $tcl_libPath and then copy the lib/Togl2.X directory into one of those directories. For developers: The lib/Togl2.X directory (and its contents) is all that needs to be redistributed in your application distribution. If you wish to link with Togl, then you will need the include files and a link library for your compiler. The compilers used are (OS- WINDOWING_SYSTEM): MacOSX: gcc 4.0.1, Mac OS X 10.4, ppc/i386 Linux: gcc 3.3.6, Red Hat 7.1, i386 Linux64: gcc 4.2.3 -Wl,--hash-style=both, Red Hat Server 5.1, x86_64 Windows: Microsoft Visual Studio .NET 2003, Windows XP SP2, i386 File hierarchy: README.txt this file bin/ unused (empty) lib/ Togl2.X/ Tcl package (place on Tcl's autopath) LICENSE redistribution license pkgIndex.tcl Tcl package index Togl2X.dll Windows Tcl package binary Toglstub2X.a Windows gcc/mingw link library Toglstub2X.lib Windows Visual Studio link library libToglstub2X.a UNIX (Linux, IRIX, etc.) link library include/ togl.h Main header file, includes others toglDecls.h API function declarations togl_ws.h Which windowing system togl was compiled with doc/ Documentation *.html Start with index.html The contents of the include and lib directories can be placed verbatim in the Tcl installataion hierachy. Documentation is in the doc directory. Start with doc/index.html in your web browser. Togl2.0/README.stubs0000664000175500010010000000230410534514446012773 0ustar gregcNoneThis version of Togl is entirely free from dependencies on Tcl/Tk's internal functions. It uses the public stubs interface, witch means that the same binary works with any stubs-aware wish (i.e. version >= 8.1) It has been tested on Windows NT/2000 and Linux for several Tcl/Tk versions up to 8.4a3. I haven't been able to test the Mac port, it propably needs mending but I can't see why it shouldn't work in principle. Implementation wise, what differs from Togl 1.5 is that Togl_MakeWindowExist() is replaced by Togl_CreateWindow(), a function that gets registered in Tk as a callback for window creation. In Tk/Tk 8.4a3, there is a new public API call Tk_SetClassProcs() to register this callback, but for earlier versions of Tk one needs to do this using some pointer magic. There is a run-time check to determine which method to use, hence the same binary runs on all versions of Wish from 8.1 and up. For this to work you need to compile against the headers from Tcl/Tk 8.4a3 or later, or the binary will only work for Tcl/Tk 8.1-8.4a2. The tk8.4a3 public headers (tk8.4a3.h + tkDecls.h) are included for conveniance, and they are used if the flag -DUSE_LOCAL_TK_H is specified. Jonas Beskow, December 2001Togl2.0/stereo.c0000644000175500010010000002042411002045767012416 0ustar gregcNone/* $Id: stereo.c,v 1.11 2008/04/17 00:13:42 gregcouch Exp $ */ /* * Togl - a Tk OpenGL widget * Copyright (C) 1996-1997 Brian Paul and Ben Bederson * Copyright (C) 2006-2007 Greg Couch * See the LICENSE file for copyright details. */ #define USE_TOGL_STUBS #include "togl.h" #include #include #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT static Tcl_Obj *toglFont; static double xAngle = 0, yAngle = 0, zAngle = 0; static GLfloat CornerX, CornerY, CornerZ; /* where to print strings */ static double coord_scale = 1; /* * Togl widget create callback. This is called by Tcl/Tk when the widget has * been realized. Here's where one may do some one-time context setup or * initializations. */ static int create_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } toglFont = Togl_LoadBitmapFont(togl, "Helvetica"); if (!toglFont) { printf("Couldn't load font!\n"); exit(1); } return TCL_OK; } /* * Togl widget reshape callback. This is called by Tcl/Tk when the widget * has been resized. Typically, we call glViewport and perhaps setup the * projection matrix. */ static int reshape_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { int width; int height; float aspect; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); aspect = (float) width / (float) height; glViewport(0, 0, width, height); /* Set up projection transform */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-aspect, aspect, -1, 1, 1, 10); CornerX = -aspect; CornerY = -1; CornerZ = -1.1f; /* Change back to model view transform for rendering */ glMatrixMode(GL_MODELVIEW); return TCL_OK; } static void print_string(Togl *togl, const char *s) { Togl_WriteChars(togl, toglFont, s, 0); } static void draw_eye(Togl *togl) { Togl_Clear(togl, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); Togl_Frustum(togl, -1, 1, -1, 1, 1, 10); glMatrixMode(GL_MODELVIEW); /* Front face */ glBegin(GL_QUADS); glColor3f(0.4f, 0.8f, 0.4f); /* Green-ish */ glVertex3f(-1, 1, 1); glVertex3f(1, 1, 1); glVertex3f(1, -1, 1); glVertex3f(-1, -1, 1); /* Back face */ glColor3f(0.8f, 0.8f, 0.4f); /* Yellow-ish */ glVertex3f(-1, 1, -1); glVertex3f(1, 1, -1); glVertex3f(1, -1, -1); glVertex3f(-1, -1, -1); /* Top side face */ glColor3f(0.4f, 0.4f, 0.8f); /* Blue-ish */ glVertex3f(-1, 1, 1); glVertex3f(1, 1, 1); glVertex3f(1, 1, -1); glVertex3f(-1, 1, -1); /* Bottom side face */ glColor3f(0.8f, 0.4f, 0.4f); /* Red-ish */ glVertex3f(-1, -1, 1); glVertex3f(1, -1, 1); glVertex3f(1, -1, -1); glVertex3f(-1, -1, -1); glEnd(); } /* * Togl widget display callback. This is called by Tcl/Tk when the widget's * contents have to be redrawn. Typically, we clear the color and depth * buffers, render our objects, then swap the front/back color buffers. */ static int display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } /* setup modelview matrix */ glLoadIdentity(); /* Reset modelview matrix to the identity * matrix */ glTranslatef(0, 0, -3.0); /* Move the camera back three units */ glScaled(coord_scale, coord_scale, coord_scale); /* Zoom in and out */ glRotated(xAngle, 1, 0, 0); /* Rotate by X, Y, and Z angles */ glRotated(yAngle, 0, 1, 0); glRotated(zAngle, 0, 0, 1); glEnable(GL_DEPTH_TEST); if (Togl_NumEyes(togl) == 1) { /* single eye */ Togl_DrawBuffer(togl, GL_BACK); draw_eye(togl); } else { /* stereo left eye */ Togl_DrawBuffer(togl, GL_BACK_LEFT); draw_eye(togl); /* stereo right eye */ Togl_DrawBuffer(togl, GL_BACK_RIGHT); draw_eye(togl); } glDisable(GL_DEPTH_TEST); glLoadIdentity(); glColor3f(1, 1, 1); glRasterPos3f(CornerX, CornerY, CornerZ); print_string(togl, Togl_Ident(togl)); Togl_SwapBuffers(togl); return TCL_OK; } static int setXrot_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &xAngle) != TCL_OK) { return TCL_ERROR; } /* printf( "before %f ", xAngle ); */ if (xAngle < 0) { xAngle += 360; } else if (xAngle > 360) { xAngle -= 360; } /* printf( "after %f \n", xAngle ); */ Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } static int setYrot_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &yAngle) != TCL_OK) { return TCL_ERROR; } if (yAngle < 0) { yAngle += 360; } else if (yAngle > 360) { yAngle -= 360; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } int getXrot_cb(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { Tcl_SetObjResult(interp, Tcl_NewDoubleObj(xAngle)); return TCL_OK; } int getYrot_cb(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { Tcl_SetObjResult(interp, Tcl_NewDoubleObj(yAngle)); return TCL_OK; } static int coord_scale_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName value"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &coord_scale) != TCL_OK) { return TCL_ERROR; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } EXTERN int Stereo_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "create_cb", create_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "display_cb", display_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape_cb", reshape_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "setXrot", setXrot_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "setYrot", setYrot_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "coord_scale", coord_scale_cb, NULL, NULL); /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ Tcl_CreateCommand(interp, "getXrot", getXrot_cb, NULL, NULL); Tcl_CreateCommand(interp, "getYrot", getYrot_cb, NULL, NULL); return TCL_OK; } Togl2.0/stereo.tcl0000664000175500010010000000705210663455550012771 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # $Id: stereo.tcl,v 1.7 2007/08/03 16:48:50 gregcouch Exp $ # Togl - a Tk OpenGL widget # Copyright (C) 1996 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/stereo[info sharedlibextension] # create ::stereo namespace namespace eval ::stereo { } proc stereo::setup {} { grid rowconfigure . 0 -weight 1 -minsize 200p grid columnconfigure . 1 -weight 1 -minsize 200p labelframe .c -text "Stereo mode:" grid .c -sticky nw -padx 2 -pady 2 -ipadx 2 -ipady 1 # add "nvidia" to list below when it works foreach {b} {none native sgioldstyle anaglyph cross-eye wall-eye DTI "left eye" "right eye" } { set name [string map {- _ " " _} $b] button .c.b$name -text "$b" -command "::stereo::makeGraphics {$b}" pack .c.b$name -fill x -padx 2 -pady 1 } scale .sx -label {X Axis} -from 0 -to 360 -command {::stereo::setAngle x} -orient horizontal grid .sx -columnspan 2 -sticky ew scale .sy -label {Y Axis} -from 0 -to 360 -command {::stereo::setAngle y} -orient horizontal grid .sy -columnspan 2 -sticky ew if {[string first IRIX $::tcl_platform(os)] != -1} { label .irix -justify left -wraplength 250p -text "Use /usr/gfx/setmon or /usr/bin/X11/xsetmon to change video mode for native stereo (eg., 1024x768_120s) or sgioldstyle stereo (eg., str_bot) and back." grid .irix -sticky new -columnspan 2 } button .quit -text Close -command exit grid .quit -sticky se -columnspan 2 -padx 2 -pady 2 frame .f -relief groove -borderwidth 2 -bg black grid .f -row 0 -column 1 -sticky news label .f.gr -wraplength 100p -bg black -fg white -text "To start, choose a stereo mode from the choices on the left." pack .f.gr -anchor center -expand 1 bind . {exit} } proc stereo::makeGraphics {mode} { destroy .f.gr set name ".f.gr" set width 200 set height 200 if { "$mode" == "nvidia" } { set mode "nvidia consumer stereo" set name ".gr" foreach s [grid slaves .] { grid forget $s } wm attributes . -fullscreen 1 set width [winfo screenwidth .] set height [winfo screenheight .] } if { [catch { togl $name -width $width -height $height -rgba true -stereo "$mode" -double true -depth true -ident "$mode" -create create_cb -display display_cb -reshape reshape_cb -eyeseparation 0.05 -convergence 2.0 } error] } { label $name -wraplength 100p -bg black -fg white -text "$error\n\nMake another choice from the stereo modes on the left." } pack $name -expand 1 -fill both bind $name { ::stereo::motion_event %W [lindex [%W config -width] 4] \ [lindex [%W config -height] 4] %x %y } } # This is called when mouse button 1 is pressed and moved proc stereo::motion_event { widget width height x y } { setXrot $widget [expr 360.0 * $y / $height] setYrot $widget [expr 360.0 * ($width - $x) / $width] # .sx set [expr 360.0 * $y / $height] # .sy set [expr 360.0 * ($width - $x) / $width] .sx set [getXrot] .sy set [getYrot] } # This is called when a slider is changed. proc stereo::setAngle {axis value} { global xAngle yAngle zAngle # catch because .f.gr might be a label instead of a Togl widget catch { switch -exact $axis { x {setXrot .f.gr $value} y {setYrot .f.gr $value} } } } if { [info script] == $argv0 } { ::stereo::setup } Togl2.0/StereoI/0000755000175500010010000000000011003223663012313 5ustar gregcNoneTogl2.0/StereoI/README.txt0000644000175500010010000000103410707426066014023 0ustar gregcNoneThe StereoI files are from the NVidia SDK 9.5 and are needed to use the NVidia Consumer 3D Stereo driver: "c:/Program Files/NVIDIA Corporation/SDK 9.5/LIBS/lib/Release/StereoI.lib" "c:/Program Files/NVIDIA Corporation/SDK 9.5/LIBS/inc/StereoI/StereoI.h" Currently, the Microsoft compiler must be used because StereoI.h is for C++ only, and StereoI.lib has references to msvcrt's operator new and operator delete and mingw does not provide entry points for those operators (??2@YAPAXI@Z and ??3@YAXPAX@Z) in its import library for msvcrt. Togl2.0/StereoI/StereoI.h0000644000175500010010000000372010654656163014060 0ustar gregcNone/*---------------------------------------------------------------------------------------------------- Copyright NVIDIA Corporation 2005 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS* AND NVIDIA AND AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ----------------------------------------------------------------------------------------------------*/ #ifndef STEREO_I_H #define STEREO_I_H // Stereo states: bit 0 - on/off; bit 1 - enabled/disabled. // Returned by GetStereoState. #define STEREO_STATE_ENABLED 0x2 #define STEREO_STATE_DISABLED 0x0 #define STEREO_STATE_ON 0x1 #define STEREO_STATE_OFF 0x0 // CaptureImageFormats. #define IMAGE_JPEG 0 #define IMAGE_PNG 1 // Image quality applies to JPEG only and varies from 0 to 100. 100 being the best. // Default setting for CaptureStereoImage is JPEG and quality=75. interface StereoI { virtual int CheckAPIVersion(int); virtual int GetStereoState(void); virtual int SetStereoState(int); virtual float GetSeparation(void); virtual float SetSeparation(float); virtual float GetConvergence(void); virtual float SetConvergence(float); virtual void CaptureStereoImage(int format, int quality); //Stereo images are dumped to [RootDir]\NVSTEREO.IMG }; int CreateStereoI(StereoI **ppStereoI); int isStereoEnabled(void); #endif Togl2.0/StereoI/StereoI.lib0000755000175500010010000005743410654656163014415 0ustar gregcNone! / 1108613735 0 1009 ` ??0StereoI@@QAE@XZ??0nvStereoI@@QAE@XZ??_7StereoI@@6B@??_7nvStereoI@@6B@??_C@_0BA@FGJIKEGP@CreateStereoAPI?$AA@??_C@_0M@OHDNJKND@StereoI?4dll?$AA@??_C@_13FPGAJAPJ@?$AA?2?$AA?$AA@??_C@_1BK@LBDEKHOH@?$AAn?$AAv?$AAs?$AAt?$AAe?$AAr?$AAc?$AAp?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@?CaptureStereoImage@StereoI@@UAEXHH@Z?CaptureStereoImage@nvStereoI@@UAEXHH@Z?CheckAPIVersion@StereoI@@UAEHH@Z?CheckAPIVersion@nvStereoI@@UAEHH@Z?CheckDriver@@YA_NPBG@Z?CreateStereoI@@YAHPAPAUStereoI@@@Z?GetConvergence@StereoI@@UAEMXZ?GetConvergence@nvStereoI@@UAEMXZ?GetSeparation@StereoI@@UAEMXZ?GetSeparation@nvStereoI@@UAEMXZ?GetStereoState@StereoI@@UAEHXZ?GetStereoState@nvStereoI@@UAEHXZ?SetConvergence@StereoI@@UAEMM@Z?SetConvergence@nvStereoI@@UAEMM@Z?SetSeparation@StereoI@@UAEMM@Z?SetSeparation@nvStereoI@@UAEMM@Z?SetStereoState@StereoI@@UAEHH@Z?SetStereoState@nvStereoI@@UAEHH@Z__real@00000000 / 1108613735 0 963 ` ??0StereoI@@QAE@XZ??0nvStereoI@@QAE@XZ??_7StereoI@@6B@??_7nvStereoI@@6B@??_C@_0BA@FGJIKEGP@CreateStereoAPI?$AA@??_C@_0M@OHDNJKND@StereoI?4dll?$AA@??_C@_13FPGAJAPJ@?$AA?2?$AA?$AA@??_C@_1BK@LBDEKHOH@?$AAn?$AAv?$AAs?$AAt?$AAe?$AAr?$AAc?$AAp?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@?CaptureStereoImage@StereoI@@UAEXHH@Z?CaptureStereoImage@nvStereoI@@UAEXHH@Z?CheckAPIVersion@StereoI@@UAEHH@Z?CheckAPIVersion@nvStereoI@@UAEHH@Z?CheckDriver@@YA_NPBG@Z?CreateStereoI@@YAHPAPAUStereoI@@@Z?GetConvergence@StereoI@@UAEMXZ?GetConvergence@nvStereoI@@UAEMXZ?GetSeparation@StereoI@@UAEMXZ?GetSeparation@nvStereoI@@UAEMXZ?GetStereoState@StereoI@@UAEHXZ?GetStereoState@nvStereoI@@UAEHXZ?SetConvergence@StereoI@@UAEMM@Z?SetConvergence@nvStereoI@@UAEMM@Z?SetSeparation@StereoI@@UAEMM@Z?SetSeparation@nvStereoI@@UAEMM@Z?SetStereoState@StereoI@@UAEHH@Z?SetStereoState@nvStereoI@@UAEHH@Z__real@00000000 // 1108613735 0 22 ` .\Release\StereoI.obj/0 1108613735 100666 22103 ` LFgB=#.drectvet .debug$SFx @B.text'K(( P`.debug$S (*@B.rdata;*@0@.debug$F?*O*@B.text Y*b* P`.debug$Sl**@B.rdata +-+@0@.debug$F}++@B.text ++ P`.debug$S+2,@B.debug$FP,`,@B.textj,{, P`.debug$S,-@B.debug$F9-I-@B.text S-]- P`.debug$Sc--@B.debug$F ..@B.text'.8. P`.debug$S>..@B.debug$F./@B.text#/4/ P`.debug$S:/0@B.debug$F/0?0@B.textI0Z0 P`.debug$S`00@B.debug$F1)1@B.text 31=1 P`.debug$SC11@B.debug$F11@B.text22 P`.debug$S22@B.debug$F22@B.text223 P`.debug$S33@B.rdata3@0@.debug$F33@B.text 333 P`.debug$S34@B.debug$F44@B.text444 P`.debug$S4]5@B.debug$F{55@B.text 555 P`.debug$S5G6@B.debug$Fe6u6@B.text66 P`.debug$S6=7@B.debug$F[7k7@B.textu7z7 P`.debug$S78@B.debug$F78G8@B.textQ8T8 P`.debug$SZ88@B.debug$F99@B.text9!9 P`.debug$S'99@B.debug$F99@B.text 9: P`.debug$S::@B.rdata ::@0@.debug$F&;6;@B.textu@;;< P`.debug$S_<=@B.rdata$=@0@.rdata 4=@0@.rdata@=@0@.debug$FZ=j=@B.debug$TPt=@B/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"Version.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" y=c:\sw\devrel\Sdk\Libs\src\StereoI\Release\StereoI.obj8    Microsoft (R) Optimizing Compiler$T2 $esp .cbLocals + .cbSavedRegs + = $T0 .raSearchStart = $eip $T0 ^ = $esp $T0 4 + =$T2 $esp .cbLocals + .cbSavedRegs + = $T0 .raSearchStart = $eip $T0 ^ = $esp $T0 4 + = $ebx $T0 16 - ^ =CC_CDECLCC_MSCPASCALCC_PASCALCC_MACPASCALCC_STDCALLCC_FPFASTCALLCC_SYSCALLCC_MPWCDECLCC_MPWPASCALCVAR_STATICURLZONE_INTRANETURLZONEREG_DEFAULTURLZONEREG_HKLM@ BINDSTRING_POST_COOKIE'@BINDSTRING_FLAG_BIND_TO_OBJECTSYS_WIN32SYS_MACNODE_INVALIDNODE_ELEMENTNODE_ATTRIBUTENODE_TEXTNODE_CDATA_SECTIONNODE_ENTITY_REFERENCENODE_ENTITYNODE_COMMENT NODE_DOCUMENTCOR_VERSION_MAJOR_V2 NODE_DOCUMENT_TYPE NODE_DOCUMENT_FRAGMENT^XMLELEMTYPE_DOCUMENT#BINDSTATUS_FINDINGRESOURCEBINDSTATUS_CONNECTINGBINDSTATUS_REDIRECTING%BINDSTATUS_BEGINDOWNLOADDATA#BINDSTATUS_ENDDOWNLOADDATA+BINDSTATUS_BEGINDOWNLOADCOMPONENTS(BINDSTATUS_INSTALLINGCOMPONENTS) BINDSTATUS_ENDDOWNLOADCOMPONENTS# BINDSTATUS_USINGCACHEDCOPY" BINDSTATUS_SENDINGREQUEST% BINDSTATUS_MIMETYPEAVAILABLE*BINDSTATUS_CACHEFILENAMEAVAILABLE&BINDSTATUS_BEGINSYNCOPERATION$BINDSTATUS_ENDSYNCOPERATION#BINDSTATUS_BEGINUPLOADDATA!BINDSTATUS_ENDUPLOADDATA#BINDSTATUS_PROTOCOLCLASSIDBINDSTATUS_ENCODING-BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE(BINDSTATUS_CLASSINSTALLLOCATIONBINDSTATUS_DECODING&BINDSTATUS_LOADINGMIMEHANDLER,BINDSTATUS_CONTENTDISPOSITIONATTACH'BINDSTATUS_CLSIDCANINSTANTIATE%BINDSTATUS_IUNKNOWNAVAILABLEVT_I2BINDSTATUS_DIRECTBINDBINDSTATUS_RAWMIMETYPE" BINDSTATUS_PROXYDETECTING !BINDSTATUS_ACCEPTRANGES"BINDSTATUS_COOKIE_SENT+#BINDSTATUS_COMPACT_POLICY_RECEIVED%$BINDSTATUS_COOKIE_SUPPRESSEDVT_BSTR VT_DISPATCH'&BINDSTATUS_COOKIE_STATE_ACCEPT''BINDSTATUS_COOKIE_STATE_REJECT'(BINDSTATUS_COOKIE_STATE_PROMPT..BINDSTATUS_PERSISTENT_COOKIE_RECEIVED$VT_RECORDIdleShutdownPARSE_CANONICALIZEPARSE_FRIENDLYPARSE_SECURITY_URLPARSE_ROOTDOCUMENTPARSE_DOCUMENTPARSE_ENCODEPARSE_DECODE PARSE_PATH_FROM_URLVT_RESERVED PARSE_URL_FROM_PATH PARSE_MIME PARSE_SERVER PARSE_SCHEMAPARSE_SITEPARSE_DOMAINPARSE_LOCATIONPARSE_SECURITY_DOMAINPARSE_ESCAPECHANGEKIND_ADDMEMBER CHANGEKIND_DELETEMEMBER}PSU_DEFAULTCHANGEKIND_SETNAMES$CHANGEKIND_SETDOCUMENTATIONCHANGEKIND_GENERALCHANGEKIND_INVALIDATE CHANGEKIND_CHANGEFAILED > QUERY_IS_INSTALLEDENTRY&TYSPEC_MIMETYPE&TYSPEC_FILENAME&TYSPEC_PROGID&TYSPEC_PACKAGENAMECIP_DISK_FULLCIP_ACCESS_DENIED!CIP_NEWER_VERSION_EXISTS!CIP_OLDER_VERSION_EXISTSCIP_NAME_CONFLICT1CIP_TRUST_VERIFICATION_COMPONENT_MISSING+CIP_EXE_SELF_REGISTERATION_TIMEOUTCIP_UNSAFE_TO_ABORTTKIND_INTERFACETKIND_DISPATCHTKIND_ALIAS (DESCKIND_IMPLICITAPPOBJntagPARAMDESCrtagPARAMDESCEXptagBINDPTRlLPPARAMDESCEXCALLCONVpBINDPTRTYPEKINDFUNCKINDnPARAMDESCbHINSTANCEtagTLIBATTRhELEMDESCGVARIANTARGSAFEARRAYBOUNDhtagELEMDESC(DESCKIND"TYPEDESC\tagEXCEPINFOtagSTATSTGCVARKINDatagFUNCDESC "ULONGtagIDLDESC IIDiCreateStereoAPIFunctionLONGLONGetagApplicationTypetagCABSTRcPIDMSI_STATUS_VALUE!PROPVAR_PAD3 LPVOIDaFUNCDESCtagCACLSIDtagCADBL "SIZE_T"HREFTYPE CAUBtagTYPEKIND(tagDESCKIND4tagCACYtagSYSKIND^tagXMLEMEM_TYPE!OLECHARCtagVARKIND\EXCEPINFO_FILETIME#ULONGLONGEVARDESCILPCOLESTR pLPSTRWIUnknownMEMBERIDItagARRAYDESC ADOUBLEEtagVARDESC :CY@tagBINDSTRINGDECIMALILPCWSTRSYSKIND CAULBSTRBLOB tagCAH>_tagQUERYOPTION :tagCY8ITypeComp tBOOLwtagCAUItagCAFILETIMEtagDISPPARAMSVARIANT_BOOL "LCID{tagSAFEARRAYAPROPVARIANTJIStereoAPICAPROPVARIANT&tagTYSPEC"tagTYPEDESCtagCLIPDATA CADATE!wchar_t tagCACIDLDESCtagTYPEATTRtagSAFEARRAYBOUNDtagBLOBtagURLZONE_LARGE_INTEGER#ReplacesCorHdrNumericDefines_ULARGE_INTEGERISequentialStreamVARENUM tagCAItagCAUBtagFUNCKIND"LPSAFEARRAY_URLZONEREGtagBSTRBLOBTLIBATTRLARGE_INTEGERIEnumSTATSTG!VARTYPEITypeLib tagDECCLIPDATATYPEATTRGtagVARIANT DISPID !USHORT PVOIDtagCADATEbHMODULE CALtagCAUHULARGE_INTEGERIRecordInfoCASCODE  UCHARCAFILETIMEDISPPARAMSCLPVARIANTynvStereoI "DWORDINVOKEKINDSTATSTG5tagCALPWSTR !WORD  BYTE CAFLT}_tagPSUACTION!PROPVAR_PAD12CALPSTR qWCHAR{SAFEARRAYtagCABOOL wCAUIuIStorage SHORTfPCSTEREOAPI LONG @FLOAT5CALPWSTR 4CACY`StereoI2tagCALPSTR/ITypeInfo ADATE !LPWSTR LPVERSIONEDSTREAMIStreamAtagPROPVARIANTCABSTRBLOBtagVersionedStream CAH _GUIDFILETIMEtagCAFLTtagCACLIPDATAtagBINDSTATUSGVARIANTIDispatchtagDOMNodeTypetagShutdownType SCODE tagCALtagCAPROPVARIANT !BSTRtagCABSTRBLOB tINTtagCHANGEKINDCACLIPDATA CADBL CAUH GUIDCACLSID pCHAR CAC BLOBdHINSTANCE__ CAI CLSID!PROPVAR_PAD2__MIDL_ICodeInstall_0001 uUINTtagCALLCONV CABOOL_tagPARSEACTIONtagCASCODEtagCAUL CABSTR S\$VD$ PSw^2[ WVWVjSuW_^2[ ÍL$QT$RhWWtՋD$p_^[ %4>Y_p#.< G JNefhow~   W | W#[ W 1 }CheckDriver Ifilename uiLen "dwDummyHandle lpvi   \ ($ 6 ]StereoI::StereoI Pthis %X% \%   %APQ/$ > onvStereoI::GetSeparation lthis /X/ \/ /T$ARPQ=$>pnvStereoI::SetSeparation lthis @in =X= \= =APQ(J$ ? onvStereoI::GetConvergence lthis JXJ \J JT$ARPQ,W$?pnvStereoI::SetConvergence lthis @in WXW \W WT$VRT$ FRPQXvVP\^dD# C# qnvStereoI::CaptureStereoImage lthis tformat tquality dxd |d # dT$ARPQdq$?mnvStereoI::SetStereoState lthis tin qXq \q qAPQh~$ ? nnvStereoI::GetStereoState lthis ~X~ \~ ~T$ARPQl$@mnvStereoI::CheckAPIVersion lthis tversion X \ $<TStereoI::GetSeparation Pthis X \ $ < VStereoI::SetSeparation Pthis @in X \ $=TStereoI::GetConvergence Pthis X \ $ = VStereoI::SetConvergence Pthis @in X \ $AXStereoI::CaptureStereoImage Pthis tformat tquality X \ 3$=QStereoI::SetStereoState Pthis tin X \ 3$=SStereoI::GetStereoState Pthis X \ 3$>QStereoI::CheckAPIVersion Pthis tversion X \ $ : vnvStereoI::nvStereoI lthis X \ ~q /=JWd Vt$th>uchtRjt3ht)hPtQЃt j^3^"/8@IP     7HXgpqtDus3utCreateStereoI LppStereoI x  |  CreateStereoAPIStereoI.dllnvstercp.dllu J%Hpś5c:\sw\devrel\sdk\libs\src\stereoi\release\vc70.pdb.file g.\StereoI.cpp@comp.id `@feat.00.drectvet.debug$SF.textQ.debug$S .filegc:\sw\devrel\sdk\libs\src\stereoi\stereoi.cpp ( .rdataہ/P ] u  .bfe.lfe.efe3.debug$F.text 4Y.debug$S .rdata   .debug$F .text  .debug$S   2 + .bf eP.lf e.ef eP.debug$F  .textQeqG.debug$S ?{,.bfeS.lfe.efeS.debug$F.text 0g\.debug$S L ]-.bfeV.lfe.ef eV.debug$F.text 88.debug$S0 Y8..bfeY.lfe.efeY.debug$F.text#d.debug$SS f#4/.bfe\.lfe.ef#e\.debug$F.textuzf.debug$S{ sZ0.bfe_.lfe.efe_.debug$F.text 5(%.debug$S  =1.bfeb.lfe.ef eb.debug$F.text R,.debug$S!  2.bf ee.lf e.ef ee.debug$F" .text#/Dl.debug$S$## 3.rdata%%.bf#ej.lf#e.ef#ej.debug$F&#.text' ,~.debug$S(''  3.bf'em.lf'e.ef 'em.debug$F)'.text*/Dl.debug$S+*3* 4.bf*ep.lf*e.ef*ep.debug$F,*.text- ,~.debug$S.-S-  5.bf-es.lf-e.ef -es.debug$F/-.text0&Z.debug$S10t0 6.bf0ev.lf0e.ef0ev.debug$F20.text3zf.debug$S433 z7.bf3ey.lf3e.ef3ey.debug$F53.text6.debug$S766 T8.bf6e|.lf6e.ef6e|.debug$F86.text9zf.debug$S:99 !9.bf9e.lf9e.ef9e.debug$F;9.text< 4Y.debug$S=<< .rdata> >.debug$F?<.text@uWxZ.debug$SA@%@ u<I.rdataBEaB.rdataC CcC.rdataD*'D.bf@e7.lf@e.efu@eM.debug$FE@.debug$TFP?CheckDriver@@YA_NPBG@Z_VerQueryValueW@16??_C@_13FPGAJAPJ@?$AA?2?$AA?$AA@??3@YAXPAX@Z_GetFileVersionInfoW@16??2@YAPAXI@Z_GetFileVersionInfoSizeW@8??0StereoI@@QAE@XZ??_7StereoI@@6B@?GetSeparation@nvStereoI@@UAEMXZ__fltused?SetSeparation@nvStereoI@@UAEMM@Z?GetConvergence@nvStereoI@@UAEMXZ?SetConvergence@nvStereoI@@UAEMM@Z?CaptureStereoImage@nvStereoI@@UAEXHH@Z?SetStereoState@nvStereoI@@UAEHH@Z?GetStereoState@nvStereoI@@UAEHXZ?CheckAPIVersion@nvStereoI@@UAEHH@Z?GetSeparation@StereoI@@UAEMXZ__real@00000000?SetSeparation@StereoI@@UAEMM@Z?GetConvergence@StereoI@@UAEMXZ?SetConvergence@StereoI@@UAEMM@Z?CaptureStereoImage@StereoI@@UAEXHH@Z?SetStereoState@StereoI@@UAEHH@Z?GetStereoState@StereoI@@UAEHXZ?CheckAPIVersion@StereoI@@UAEHH@Z??0nvStereoI@@QAE@XZ??_7nvStereoI@@6B@?CreateStereoI@@YAHPAPAUStereoI@@@Z__imp__GetProcAddress@8??_C@_0BA@FGJIKEGP@CreateStereoAPI?$AA@__imp__LoadLibraryA@4??_C@_0M@OHDNJKND@StereoI?4dll?$AA@??_C@_1BK@LBDEKHOH@?$AAn?$AAv?$AAs?$AAt?$AAe?$AAr?$AAc?$AAp?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@ Togl2.0/tclconfig/0000755000175500010010000000000011003223662012710 5ustar gregcNoneTogl2.0/tclconfig/install-sh0000755000175500010010000000421211003223662014713 0ustar gregcNone#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 Togl2.0/tclconfig/tcl.m40000664000175500010010000037536011003223662013754 0ustar gregcNone# tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: tcl.m4,v 1.10 2008/04/17 00:47:34 gregcouch Exp $ AC_PREREQ(2.57) dnl TEA extensions pass us the version of TEA they think they dnl are compatible with (must be set in TEA_INIT below) dnl TEA_VERSION="3.6" # Possible values for key variables defined: # # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') # TEA_PLATFORM - windows unix # #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TCLCONFIG], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_WARN([Can't find Tcl configuration definitions]) exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_WARN([Can't find Tk configuration definitions]) exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd ${TCL_BIN_DIR}; pwd`" \ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) # TEA specific: AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd ${TK_BIN_DIR}; pwd`" \ "`cd ${TK_BIN_DIR}/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" # TEA specific: Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) # TEA specific: AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory or the tclsh installed in a bin # directory. This macro will correctly determine the name # of the tclsh executable even if tclsh has not yet been # built in the build directory. The tclsh found is always # associated with a tclConfig.sh file. This tclsh should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi AC_MSG_RESULT([${TCLSH_PROG}]) AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Determine the fully qualified path name of the wish executable # in the Tk build directory or the wish installed in a bin # directory. This macro will correctly determine the name # of the wish executable even if wish has not yet been # built in the build directory. The wish found is always # associated with a tkConfig.sh file. This wish should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_WISH], [ AC_MSG_CHECKING([for wish]) if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TK_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`/" break fi done WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" fi AC_MSG_RESULT([${WISH_PROG}]) AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is specified # as an arg (optional), threads are enabled by default, "no" means # threads are disabled. "yes" is the default. # # TCL_THREADS is checked so that if you are compiling an extension # against a threaded core, your extension must be compiled threaded # as well. # # Note that it is legal to have a thread enabled extension run in a # threaded or non-threaded Tcl core, but a non-threaded extension may # only run in a non-threaded Tcl core. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [build with threads]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC, 1, [Do we want to use the threaded memory allocator?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) if test "`uname -s`" = "SunOS" ; then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) fi AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = 1; then AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) AC_MSG_RESULT([yes (default)]) else AC_MSG_RESULT([no]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads.]) fi ;; *) if test "${TCL_THREADS}" = "1"; then AC_MSG_WARN([ --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. # Requires the following vars to be set in the Makefile: # CFLAGS_DEFAULT # LDFLAGS_DEFAULT # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to $(CFLAGS_OPTIMIZE) if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false # DBGX Formerly used as debug library extension; # always blank now. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SYMBOLS], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_CONFIG_CFLAGS]) AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, AC_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi # TEA specific: if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) AC_SUBST(TCL_DBGX) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, AC_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, [ AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # TEA_CONFIG_SYSTEM # # Determine what the system is (some things cannot be easily checked # on a feature-driven basis, alas). This can usually be done via the # "uname" command, but there are a few systems, like Next, where # this doesn't work. # # Arguments: # none # # Results: # Defines the following var: # # system - System/platform/version identification code. # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_SYSTEM], [ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows elif test -f /usr/lib/NextStep/software_version; then tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_WARN([can't find uname command]) tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi fi fi ]) system=$tcl_cv_sys_version ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_CFLAGS], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, AC_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, AC_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) # Force 64bit on with VIS AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes]) # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. AC_CACHE_CHECK([if compiler supports visibility "hidden"], tcl_cv_cc_visibility_hidden, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" AC_TRY_LINK([ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes, tcl_cv_cc_visibility_hidden=no) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ AC_DEFINE(MODULE_SCOPE, [extern __attribute__((__visibility__("hidden")))], [Compiler support for module scope symbols]) ]) # Step 0.d: Disable -rpath support? AC_MSG_CHECKING([if rpath support is requested]) AC_ARG_ENABLE(rpath, AC_HELP_STRING([--disable-rpath], [disable rpath support (default: on)]), [doRpath=$enableval], [doRpath=yes]) AC_MSG_RESULT([$doRpath]) # TEA specific: Cross-compiling options for Windows/CE builds? AS_IF([test "${TEA_PLATFORM}" = windows], [ AC_MSG_CHECKING([if Windows/CE build is requested]) AC_ARG_ENABLE(wince, AC_HELP_STRING([--enable-wince], [enable Win/CE support (where applicable)]), [doWince=$enableval], [doWince=no]) AC_MSG_RESULT([$doWince]) ]) # Step 1: set the variable "system" to hold the name and version number # for the system. TEA_CONFIG_SYSTEM # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case. do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O AS_IF([test "$GCC" = yes], [ # TEA specific: CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" ], [CFLAGS_WARNING=""]) TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_PROG(AR, ar, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in # TEA specific: windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) AC_MSG_WARN([Ensure latest Platform SDK is installed]) do64bit="no" else AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) fi if test "$GCC" = "yes" ; then AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) fi TEA_PATH_CELIB # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 TEA_ADD_LIBS([bufferoverflowU.lib]) elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) done AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" AC_SUBST(CELIB_DIR) else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD="$CC -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [ # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) ]) LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker on AIX 4+ AS_IF([test "$do64bit" = yes -a "`uname -v`" -gt 3], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported with GCC on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" ]) ]) AS_IF([test "`uname -m`" = ia64], [ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" AS_IF([test "$GCC" = yes], [ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ], [ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' ]) LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ], [ AS_IF([test "$GCC" = yes], [SHLIB_LD='${CC} -shared'], [ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" ]) SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} TCL_NEEDS_EXP_FILE=1 # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' ]) # AIX v<=4.1 has some different flags than 4.2+ AS_IF([test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4], [ AC_LIBOBJ([tclLoadAix]) DL_LIBS="-lld" ]) # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) AS_IF([test $libbsd = yes], [ MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) ]) ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) # TEA specific: Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library AS_IF([test "`uname -m`" = ia64], [ SHLIB_SUFFIX=".so" # Use newer C++ library for C++ extensions #if test "$GCC" != "yes" ; then # CPPFLAGS="-AA" #fi ], [ SHLIB_SUFFIX=".sl" ]) AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = "yes"], [ AS_IF([test "$GCC" = yes], [ case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' SHLIB_LD_LIBS='${LIBS}' AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac ], [ do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" ]) ]) ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AS_IF([test "$GCC" = yes], [ CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" ], [ case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" ]) ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported by gcc]) ], [ do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" ]) ]) ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}' DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) AS_IF([test $do64bit = yes], [ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_m64 = yes], [ CFLAGS="$CFLAGS -m64" do64bit_ok=yes ]) ]) # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"]) ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" SHLIB_LD='${CC} -shared' DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; NetBSD-1.*|FreeBSD-[[1-2]].*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) AS_IF([test $tcl_cv_ld_elf = yes], [ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' ], [ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' ]) # Ancient FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) AS_IF([test $tcl_cv_ld_elf = yes], [ LDFLAGS=-Wl,-export-dynamic ], [LDFLAGS=""]) # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*|FreeBSD-*) # FreeBSD 3.* and greater have ELF. # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}' SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "${TCL_THREADS}" = "1"], [ # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ]) case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" AS_IF([test $do64bit = yes], [ case `arch` in ppc) AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], tcl_cv_cc_arch_ppc64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes, tcl_cv_cc_arch_ppc64=no) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes ]);; i386) AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], tcl_cv_cc_arch_x86_64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes, tcl_cv_cc_arch_x86_64=no) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [ CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes ]);; *) AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; esac ], [ # Check for combined 32-bit and 64-bit fat build AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ fat_32_64=yes]) ]) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_single_module = yes], [ SHLIB_LD="${SHLIB_LD} -Wl,-single_module" ]) SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [ LDFLAGS="$LDFLAGS -prebind"]) LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_search_paths_first = yes], [ LDFLAGS="$LDFLAGS -Wl,-search_paths_first" ]) AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ AC_DEFINE(MODULE_SCOPE, [__private_extern__], [Compiler support for module scope symbols]) ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" AC_TRY_LINK([#include ], [XrmInitialize();], tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done]) ]) # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua -o "$tcl_cv_lib_x11_64" = no], [ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done]) ]) ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -nostdlib -r' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" AS_IF([test "$SHARED_BUILD" = 1], [SHLIB_LD="ld -shared"], [ SHLIB_LD="ld -non_shared" ]) SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" AS_IF([test "$SHARED_BUILD" = 1], [ SHLIB_LD="${CC} -shared" ], [ SHLIB_LD="${CC} -non_shared" ]) SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) # see pthread_intro(3) for pthread support on osf1, k.furukawa AS_IF([test "${TCL_THREADS}" = 1], [ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` AS_IF([test "$GCC" = yes], [ LIBS="$LIBS -lpthread -lmach -lexc" ], [ CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ]) ]) ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. AS_IF([test "$GCC" = yes], [ SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" ], [ SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" ]) SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ], [ SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ arch=`isainfo` AS_IF([test "$arch" = "sparcv9 sparc"], [ AS_IF([test "$GCC" = yes], [ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" ]) ], [ do64bit_ok=yes AS_IF([test "$do64bitVIS" = yes], [ CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" ], [ CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" ]) # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" ]) ], [AS_IF([test "$arch" = "amd64 i386"], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported with GCC on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" ]) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "$do64bit_ok" = yes], [ # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" ]) ], [ case $system in SunOS-5.[[1-9]][[0-9]]*) SHLIB_LD='${CC} -G -z text ${LDFLAGS}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' ]) ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_Bexport = yes], [ LDFLAGS="$LDFLAGS -Wl,-Bexport" ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) ]) dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so dnl # until the end of configure, as configure's compile and link tests use dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's dnl # preprocessing tests use only CPPFLAGS. AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, AC_HELP_STRING([--enable-load], [allow dynamic loading and "load" command (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) AS_IF([test "$tcl_ok" = no], [DL_OBJS=""]) AS_IF([test "x$DL_OBJS" != x], [BUILD_DLTEST="\$(DLTEST_TARGETS)"], [ AC_MSG_WARN([Can't figure out how to do dynamic loading or shared libraries on this system.]) SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" BUILD_DLTEST="" ]) LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. AS_IF([test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes], [ case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac]) AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [ # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}']) AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a']) AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(LD_LIBRARY_PATH_VAR) # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN([TEA_SERIAL_PORT], [ AC_CHECK_HEADERS(sys/modem.h) AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; esac ]) #-------------------------------------------------------------------- # TEA_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # # tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and # CHECK on limits.h #-------------------------------------------------------------------- AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)]) if test $tcl_cv_dirent_h = no; then AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) fi # TEA specific: AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) AC_CHECK_HEADER(limits.h, [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(sys/param.h) ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # PKG_LIBS (appends to) # #-------------------------------------------------------------------- AC_DEFUN([TEA_PATH_X], [ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN([TEA_PATH_UNIX_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_TRY_CPP([#include ], found_xincludes="yes", found_xincludes="no") if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test found_xincludes = "no"; then AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi # TEA specific: if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN([TEA_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) TEA_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([TEA_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN([TEA_BUGGY_STRTOD], [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; double value; value = strtod(infString, &term); if ((term != infString) && (term[-1] == 0)) { exit(1); } value = strtod(nanString, &term); if ((term != nanString) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, tcl_cv_strtod_buggy=buggy)]) if test "$tcl_cv_strtod_buggy" = buggy; then AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # TEA specific: Don't perform the eval of the libraries here because # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # _LARGEFILE_SOURCE64 # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include ], [char *p = (char *)open64;]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_type_64bit=__int64, tcl_type_64bit="long long") # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_TRY_COMPILE(,[switch (0) { case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, [What type should be used to define wide integers?]) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_VERSION # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN([TEA_INIT], [ # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.6" AC_MSG_CHECKING([for correct TEA configuration]) if test x"${PACKAGE_NAME}" = x ; then AC_MSG_ERROR([ The PACKAGE_NAME variable must be defined by your TEA configure.in]) fi if test x"$1" = x ; then AC_MSG_ERROR([ TEA version not specified.]) elif test "$1" != "${TEA_VERSION}" ; then AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) else AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) # This package name must be replaced statically for AC_SUBST to work AC_SUBST(PKG_LIB_FILE) # Substitute STUB_LIB_FILE in case package creates a stub library too. AC_SUBST(PKG_STUB_LIB_FILE) # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) AC_SUBST(PKG_TCL_SOURCES) AC_SUBST(PKG_HEADERS) AC_SUBST(PKG_INCLUDES) AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_ADD_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_SOURCES # PKG_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_SOURCES], [ vars="$@" for i in $vars; do case $i in [\$]*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH # To add more dirs here (like 'src'), you have to update VPATH # in Makefile.in as well if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find source file '$i']) fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done AC_SUBST(PKG_SOURCES) AC_SUBST(PKG_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_STUB_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_STUB_SOURCES # PKG_STUB_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_STUB_SOURCES], [ vars="$@" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find stub source file '$i']) fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_TCL_SOURCES -- # # Specify one or more Tcl source files. These should be platform # independent runtime files. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_TCL_SOURCES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_TCL_SOURCES], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done AC_SUBST(PKG_TCL_SOURCES) ]) #------------------------------------------------------------------------ # TEA_ADD_HEADERS -- # # Specify one or more source headers. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_HEADERS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_HEADERS], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find header file '${srcdir}/$i']) fi PKG_HEADERS="$PKG_HEADERS $i" done AC_SUBST(PKG_HEADERS) ]) #------------------------------------------------------------------------ # TEA_ADD_INCLUDES -- # # Specify one or more include dirs. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_INCLUDES], [ vars="$@" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done AC_SUBST(PKG_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_ADD_LIBS -- # # Specify one or more libraries. Users should check for # the right platform before adding to their list. For Windows, # libraries provided in "foo.lib" format will be converted to # "-lfoo" when using GCC (mingw). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_LIBS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_LIBS], [ vars="$@" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done AC_SUBST(PKG_LIBS) ]) #------------------------------------------------------------------------ # TEA_ADD_CFLAGS -- # # Specify one or more CFLAGS. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_CFLAGS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_CFLAGS], [ PKG_CFLAGS="$PKG_CFLAGS $@" AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN([TEA_PREFIX], [ if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else AC_MSG_NOTICE([--prefix defaulting to /usr/local]) prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) exec_prefix=${TCL_EXEC_PREFIX} else AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) exec_prefix=$prefix fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER_CC -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.in files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER_CC], [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_PROG_RANLIB #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER], [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_CACHE_CHECK([if the compiler understands -pipe], tcl_cv_cc_pipe, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- AC_C_BIGENDIAN if test "${TEA_PLATFORM}" = "unix" ; then TEA_TCL_LINK_LIBS TEA_MISSING_POSIX_HEADERS # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library #------------------------------------------------------------------------ AC_DEFUN([TEA_MAKE_LIB], [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(RANLIB_STUB) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN([TEA_LIB_SPEC], [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substs the following vars: # TCL_TOP_DIR_NATIVE # TCL_GENERIC_DIR_NATIVE # TCL_UNIX_DIR_NATIVE # TCL_WIN_DIR_NATIVE # TCL_BMAP_DIR_NATIVE # TCL_TOOL_DIR_NATIVE # TCL_PLATFORM_DIR_NATIVE # TCL_BIN_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl private include files]) TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi ;; esac else if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) fi fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_GENERIC_DIR_NATIVE) AC_SUBST(TCL_UNIX_DIR_NATIVE) AC_SUBST(TCL_WIN_DIR_NATIVE) AC_SUBST(TCL_BMAP_DIR_NATIVE) AC_SUBST(TCL_TOOL_DIR_NATIVE) AC_SUBST(TCL_PLATFORM_DIR_NATIVE) AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ AC_MSG_CHECKING([for Tk private include files]) TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} else TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" # Detect and add ttk subdir if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" fi if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi ;; esac else if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) fi fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_UNIX_DIR_NATIVE) AC_SUBST(TK_WIN_DIR_NATIVE) AC_SUBST(TK_GENERIC_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_PLATFORM_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "${TK_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_INCLUDES) if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then case ${with_$1config} in */$1Config.sh ) if test -f ${with_$1config}; then AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` fi;; esac if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN([Cannot find $1 configuration definitions]) exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . "${$1_BIN_DIR}/$1Config.sh" else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f "${$1_BIN_DIR}/Makefile" ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_BIN_DIR) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) #------------------------------------------------------------------------ # TEA_PATH_CELIB -- # # Locate Keuchel's celib emulation layer for targeting Win/CE # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-celib=... # # Defines the following vars: # CELIB_DIR Full path to the directory containing # the include and platform lib files #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CELIB], [ # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) AC_MSG_CHECKING([for Windows/CE celib directory]) AC_CACHE_VAL(ac_cv_c_celibconfig,[ # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_celibconfig}" = x ; then AC_MSG_ERROR([Cannot find celib support library directory]) else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` AC_MSG_RESULT([found $CELIB_DIR]) fi fi ]) # Local Variables: # mode: autoconf # End: Togl2.0/texture.c0000644000175500010010000004077310663455074012636 0ustar gregcNone/* $Id: texture.c,v 1.14 2007/08/03 16:48:50 gregcouch Exp $ */ /* * Togl - a Tk OpenGL widget * Copyright (C) 1996-1997 Brian Paul and Ben Bederson * Copyright (C) 2006-2007 Greg Couch * See the LICENSE file for copyright details. */ /* * An example Togl program demonstrating texture mapping */ #define USE_TOGL_STUBS #include "togl.h" #include #include #if defined(TOGL_AGL) # include #else # include #endif #include "image.h" #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT #define CHECKER 0 #define FACE 1 #define TREE 2 static GLenum minfilter = GL_NEAREST_MIPMAP_LINEAR; static GLenum magfilter = GL_LINEAR; static GLenum swrap = GL_REPEAT; static GLenum twrap = GL_REPEAT; static GLenum envmode = GL_MODULATE; static GLubyte polycolor[4] = { 255, 255, 255, 255 }; static int teximage = CHECKER; static double coord_scale = 1; static double xrot = 0; static double yrot = 0; static double texscale = 1; static GLint width, height; static GLboolean blend = GL_FALSE; /* * Load a texture image. n is one of CHECKER, FACE or TREE. */ static void texture_image(int n) { if (n == CHECKER) { #define WIDTH 64 #define HEIGHT 64 GLubyte teximage[WIDTH * HEIGHT][4]; int i, j; for (i = 0; i < HEIGHT; i++) { for (j = 0; j < WIDTH; j++) { GLubyte value; value = ((i / 4 + j / 4) % 2) ? 0xff : 0x00; teximage[i * WIDTH + j][0] = value; teximage[i * WIDTH + j][1] = value; teximage[i * WIDTH + j][2] = value; teximage[i * WIDTH + j][3] = value; } } glEnable(GL_TEXTURE_2D); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, teximage); blend = GL_FALSE; #undef WIDTH #undef HEIGHT } else if (n == FACE) { TK_RGBImageRec *img = tkRGBImageLoad("ben.rgb"); if (img) { glEnable(GL_TEXTURE_2D); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gluBuild2DMipmaps(GL_TEXTURE_2D, img->sizeZ, img->sizeX, img->sizeY, img->sizeZ == 3 ? GL_RGB : GL_RGBA, GL_UNSIGNED_BYTE, img->data); blend = GL_TRUE; } } else if (n == TREE) { TK_RGBImageRec *img = tkRGBImageLoad("tree2.rgba"); if (img) { glEnable(GL_TEXTURE_2D); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); gluBuild2DMipmaps(GL_TEXTURE_2D, img->sizeZ, img->sizeX, img->sizeY, img->sizeZ == 3 ? GL_RGB : GL_RGBA, GL_UNSIGNED_BYTE, img->data); blend = GL_TRUE; } } else { abort(); } } /* * Togl widget create callback. This is called by Tcl/Tk when the widget has * been realized. Here's where one may do some one-time context setup or * initializations. */ static int create_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { glEnable(GL_DEPTH_TEST); /* Enable depth buffering */ texture_image(CHECKER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magfilter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter); return TCL_OK; } /* * Togl widget reshape callback. This is called by Tcl/Tk when the widget * has been resized. Typically, we call glViewport and perhaps setup the * projection matrix. */ static int reshape_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } width = Togl_Width(togl); height = Togl_Height(togl); glViewport(0, 0, width, height); return TCL_OK; } static void check_error(char *where) { GLenum error; while (1) { error = glGetError(); if (error == GL_NO_ERROR) { break; } printf("OpenGL error near %s: %s\n", where, gluErrorString(error)); } } /* * Togl widget display callback. This is called by Tcl/Tk when the widget's * contents have to be redrawn. Typically, we clear the color and depth * buffers, render our objects, then swap the front/back color buffers. */ static int display_cb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { float aspect = (float) width / (float) height; Togl *togl; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } check_error("begin display\n"); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Draw background image */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); glBegin(GL_POLYGON); glColor3f(0, 0, 0.3f); glVertex2f(-1, -1); glColor3f(0, 0, 0.3f); glVertex2f(1, -1); glColor3f(0, 0, 0.9f); glVertex2f(1, 1); glColor3f(0, 0, 0.9f); glVertex2f(-1, 1); glEnd(); /* draw textured object */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-aspect, aspect, -1, 1, 2, 10); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -5); glScaled(texscale, texscale, texscale); glRotated(yrot, 0, 1, 0); glRotated(xrot, 1, 0, 0); glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glColor4ubv(polycolor); if (blend) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); } glBegin(GL_POLYGON); glTexCoord2f(0, 0); glVertex2f(-1, -1); glTexCoord2d(coord_scale, 0); glVertex2f(1, -1); glTexCoord2d(coord_scale, coord_scale); glVertex2f(1, 1); glTexCoord2d(0, coord_scale); glVertex2f(-1, 1); glEnd(); glDisable(GL_BLEND); Togl_SwapBuffers(togl); return TCL_OK; } /* * Called when a magnification filter radio button is pressed. */ static int magfilter_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "GL_NEAREST", "GL_LINEAR", NULL }; static const GLenum magfilters[] = { GL_NEAREST, GL_LINEAR }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName magnification-filter-type"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "magnification filter type", 0, &index); if (result == TCL_OK) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magfilters[index]); Togl_PostRedisplay(togl); } return result; } /* * Called when a minification filter radio button is pressed. */ static int minfilter_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "GL_NEAREST", "GL_LINEAR", "GL_NEAREST_MIPMAP_NEAREST", "GL_LINEAR_MIPMAP_NEAREST", "GL_NEAREST_MIPMAP_LINEAR", "GL_LINEAR_MIPMAP_LINEAR", NULL }; static const GLenum minfilters[] = { GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_LINEAR }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName minification-filter-type"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "minification filter type", 0, &index); if (result == TCL_OK) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilters[index]); Togl_PostRedisplay(togl); } return result; } static int xrot_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &xrot) != TCL_OK) { return TCL_ERROR; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } static int yrot_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName angle"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &yrot) != TCL_OK) { return TCL_ERROR; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } static int texscale_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName value"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &texscale) != TCL_OK) { return TCL_ERROR; } Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } /* * Called when S texture coordinate wrapping is changed. */ static int swrap_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "GL_CLAMP", "GL_REPEAT", NULL }; static const GLenum swraps[] = { GL_CLAMP, GL_REPEAT }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName wrap-mode"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "wrap mode", 0, &index); if (result == TCL_OK) { swrap = swraps[index]; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, swrap); Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); } return result; } /* * Called when T texture coordinate wrapping is changed. */ static int twrap_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "GL_CLAMP", "GL_REPEAT", NULL }; static const GLenum twraps[] = { GL_CLAMP, GL_REPEAT }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName wrap-mode"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "wrap mode", 0, &index); if (result == TCL_OK) { twrap = twraps[index]; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, twrap); Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); } return result; } /* * Called when the texture environment mode is changed. */ static int envmode_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "GL_MODULATE", "GL_DECAL", "GL_BLEND", NULL }; static const GLenum envmodes[] = { GL_MODULATE, GL_DECAL, GL_BLEND }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName texture-env-mode"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "texture env mode", 0, &index); if (result == TCL_OK) { envmode = envmodes[index]; glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, envmode); Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); } return result; } /* * Called when the polygon color is changed. */ static int polycolor_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl; int r, g, b; if (objc != 5) { Tcl_WrongNumArgs(interp, 1, objv, "pathName r g b"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetIntFromObj(interp, objv[2], &r) != TCL_OK || Tcl_GetIntFromObj(interp, objv[3], &g) != TCL_OK || Tcl_GetIntFromObj(interp, objv[4], &b) != TCL_OK) { return TCL_ERROR; } polycolor[0] = r; polycolor[1] = g; polycolor[2] = b; Togl_PostRedisplay(togl); return TCL_OK; } /* * Called when the texture image is to be changed */ static int teximage_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { static const char *names[] = { "CHECKER", "FACE", "TREE", NULL }; static const GLenum teximages[] = { CHECKER, FACE, TREE }; int result, index; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName texture-image-name"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[2], names, "texture image name", 0, &index); if (result == TCL_OK) { teximage = teximages[index]; texture_image(teximage); Togl_PostRedisplay(togl); /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); } return result; } /* * Called when the texture coordinate scale is changed. */ static int coord_scale_cmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { double s; Togl *togl; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "pathName scale"); return TCL_ERROR; } if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) { return TCL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[2], &s) != TCL_OK) { return TCL_ERROR; } if (s > 0 && s < 10) { coord_scale = s; Togl_PostRedisplay(togl); } /* Let result string equal value */ Tcl_SetObjResult(interp, objv[2]); return TCL_OK; } EXTERN int Texture_Init(Tcl_Interp *interp) { /* * Initialize Tcl and the Togl widget module. */ if (Tcl_InitStubs(interp, "8.1", 0) == NULL || Togl_InitStubs(interp, "2.0", 0) == NULL) { return TCL_ERROR; } /* * Specify the C callback functions for widget creation, display, * and reshape. */ Tcl_CreateObjCommand(interp, "create_cb", create_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "display_cb", display_cb, NULL, NULL); Tcl_CreateObjCommand(interp, "reshape_cb", reshape_cb, NULL, NULL); /* * Make a new Togl widget command so the Tcl code can set a C variable. */ Tcl_CreateObjCommand(interp, "min_filter", minfilter_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "mag_filter", magfilter_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "xrot", xrot_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "yrot", yrot_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "texscale", texscale_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "swrap", swrap_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "twrap", twrap_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "envmode", envmode_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "polycolor", polycolor_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "teximage", teximage_cmd, NULL, NULL); Tcl_CreateObjCommand(interp, "coord_scale", coord_scale_cmd, NULL, NULL); /* * Call Tcl_CreateCommand for application-specific commands, if * they weren't already created by the init procedures called above. */ return TCL_OK; } Togl2.0/texture.tcl0000664000175500010010000002325210663455074013171 0ustar gregcNone#!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # $Id: texture.tcl,v 1.8 2007/08/03 16:48:50 gregcouch Exp $ # Togl - a Tk OpenGL widget # Copyright (C) 1996 Brian Paul and Ben Bederson # Copyright (C) 2006-2007 Greg Couch # See the LICENSE file for copyright details. # Togl texture map demo package provide texture 1.0 # add parent directory to path to find Togl's pkgIndex in current directory if { [file exists pkgIndex.tcl] } { set auto_path [linsert $auto_path 0 ..] } # following load also loads Tk and Togl packages load [file dirname [info script]]/texture[info sharedlibextension] # create ::texture namespace namespace eval ::texture { } # Called magnification filter changes proc ::texture::new_magfilter {} { global magfilter mag_filter .f1.view $magfilter } # Called minification filter changes proc ::texture::new_minfilter {} { global minfilter min_filter .f1.view $minfilter } # Called when texture image radio button changes proc ::texture::new_image {} { global image teximage .f1.view $image } # Called when texture S wrap button changes proc ::texture::new_swrap {} { global swrap swrap .f1.view $swrap } # Called when texture T wrap button changes proc ::texture::new_twrap {} { global twrap twrap .f1.view $twrap } # Called when texture environment radio button selected proc ::texture::new_env {} { global envmode envmode .f1.view $envmode } # Called when polygon color sliders change proc ::texture::new_color { foo } { global poly_red poly_green poly_blue polycolor .f1.view $poly_red $poly_green $poly_blue } proc ::texture::new_coord_scale { name element op } { global coord_scale coord_scale .f1.view $coord_scale } proc ::texture::take_photo {} { image create photo teximg .f1.view takephoto teximg teximg write image.ppm -format ppm } # Make the widgets proc ::texture::setup {} { global magfilter global minfilter global image global swrap global twrap global envmode global poly_red global poly_green global poly_blue global coord_scale global startx starty # location of mouse when button pressed global xangle yangle global xangle0 yangle0 global texscale texscale0 wm title . "Texture Map Options" ### Two frames: top half and bottom half frame .f1 frame .f2 ### The OpenGL window togl .f1.view -width 250 -height 250 -rgba true -double true -depth true -create create_cb -reshape reshape_cb -display display_cb ### Filter radio buttons frame .f1.filter -relief ridge -borderwidth 3 frame .f1.filter.mag -relief ridge -borderwidth 2 label .f1.filter.mag.label -text "Magnification Filter" -anchor w radiobutton .f1.filter.mag.nearest -text GL_NEAREST -anchor w -variable magfilter -value GL_NEAREST -command ::texture::new_magfilter radiobutton .f1.filter.mag.linear -text GL_LINEAR -anchor w -variable magfilter -value GL_LINEAR -command ::texture::new_magfilter frame .f1.filter.min -relief ridge -borderwidth 2 label .f1.filter.min.label -text "Minification Filter" -anchor w radiobutton .f1.filter.min.nearest -text GL_NEAREST -anchor w -variable minfilter -value GL_NEAREST -command ::texture::new_minfilter radiobutton .f1.filter.min.linear -text GL_LINEAR -anchor w -variable minfilter -value GL_LINEAR -command ::texture::new_minfilter radiobutton .f1.filter.min.nearest_mipmap_nearest -text GL_NEAREST_MIPMAP_NEAREST -anchor w -variable minfilter -value GL_NEAREST_MIPMAP_NEAREST -command ::texture::new_minfilter radiobutton .f1.filter.min.linear_mipmap_nearest -text GL_LINEAR_MIPMAP_NEAREST -anchor w -variable minfilter -value GL_LINEAR_MIPMAP_NEAREST -command ::texture::new_minfilter radiobutton .f1.filter.min.nearest_mipmap_linear -text GL_NEAREST_MIPMAP_LINEAR -anchor w -variable minfilter -value GL_NEAREST_MIPMAP_LINEAR -command ::texture::new_minfilter radiobutton .f1.filter.min.linear_mipmap_linear -text GL_LINEAR_MIPMAP_LINEAR -anchor w -variable minfilter -value GL_LINEAR_MIPMAP_LINEAR -command ::texture::new_minfilter pack .f1.filter.mag -fill x pack .f1.filter.mag.label -fill x pack .f1.filter.mag.nearest -side top -fill x pack .f1.filter.mag.linear -side top -fill x pack .f1.filter.min -fill both -expand true pack .f1.filter.min.label -side top -fill x pack .f1.filter.min.nearest -side top -fill x pack .f1.filter.min.linear -side top -fill x pack .f1.filter.min.nearest_mipmap_nearest -side top -fill x pack .f1.filter.min.linear_mipmap_nearest -side top -fill x pack .f1.filter.min.nearest_mipmap_linear -side top -fill x pack .f1.filter.min.linear_mipmap_linear -side top -fill x ### Texture coordinate scale and wrapping frame .f2.coord -relief ridge -borderwidth 3 frame .f2.coord.scale -relief ridge -borderwidth 2 label .f2.coord.scale.label -text "Max Texture Coord" -anchor w entry .f2.coord.scale.entry -textvariable coord_scale trace variable coord_scale w ::texture::new_coord_scale frame .f2.coord.s -relief ridge -borderwidth 2 label .f2.coord.s.label -text "GL_TEXTURE_WRAP_S" -anchor w radiobutton .f2.coord.s.repeat -text "GL_REPEAT" -anchor w -variable swrap -value GL_REPEAT -command ::texture::new_swrap radiobutton .f2.coord.s.clamp -text "GL_CLAMP" -anchor w -variable swrap -value GL_CLAMP -command ::texture::new_swrap frame .f2.coord.t -relief ridge -borderwidth 2 label .f2.coord.t.label -text "GL_TEXTURE_WRAP_T" -anchor w radiobutton .f2.coord.t.repeat -text "GL_REPEAT" -anchor w -variable twrap -value GL_REPEAT -command ::texture::new_twrap radiobutton .f2.coord.t.clamp -text "GL_CLAMP" -anchor w -variable twrap -value GL_CLAMP -command ::texture::new_twrap pack .f2.coord.scale -fill both -expand true pack .f2.coord.scale.label -side top -fill x pack .f2.coord.scale.entry -side top -fill x pack .f2.coord.s -fill x pack .f2.coord.s.label -side top -fill x pack .f2.coord.s.repeat -side top -fill x pack .f2.coord.s.clamp -side top -fill x pack .f2.coord.t -fill x pack .f2.coord.t.label -side top -fill x pack .f2.coord.t.repeat -side top -fill x pack .f2.coord.t.clamp -side top -fill x ### Texture image radio buttons (just happens to fit into the coord frame) frame .f2.env -relief ridge -borderwidth 3 frame .f2.env.image -relief ridge -borderwidth 2 label .f2.env.image.label -text "Texture Image" -anchor w radiobutton .f2.env.image.checker -text "Checker" -anchor w -variable image -value CHECKER -command ::texture::new_image radiobutton .f2.env.image.tree -text "Tree" -anchor w -variable image -value TREE -command ::texture::new_image radiobutton .f2.env.image.face -text "Face" -anchor w -variable image -value FACE -command ::texture::new_image pack .f2.env.image -fill x pack .f2.env.image.label -side top -fill x pack .f2.env.image.checker -side top -fill x pack .f2.env.image.tree -side top -fill x pack .f2.env.image.face -side top -fill x ### Texture Environment label .f2.env.label -text "GL_TEXTURE_ENV_MODE" -anchor w radiobutton .f2.env.modulate -text "GL_MODULATE" -anchor w -variable envmode -value GL_MODULATE -command ::texture::new_env radiobutton .f2.env.decal -text "GL_DECAL" -anchor w -variable envmode -value GL_DECAL -command ::texture::new_env radiobutton .f2.env.blend -text "GL_BLEND" -anchor w -variable envmode -value GL_BLEND -command ::texture::new_env pack .f2.env.label -fill x pack .f2.env.modulate -side top -fill x pack .f2.env.decal -side top -fill x pack .f2.env.blend -side top -fill x ### Polygon color frame .f2.color -relief ridge -borderwidth 3 label .f2.color.label -text "Polygon color" -anchor w scale .f2.color.red -label Red -from 0 -to 255 -orient horizontal -variable poly_red -command ::texture::new_color scale .f2.color.green -label Green -from 0 -to 255 -orient horizontal -variable poly_green -command ::texture::new_color scale .f2.color.blue -label Blue -from 0 -to 255 -orient horizontal -variable poly_blue -command ::texture::new_color pack .f2.color.label -fill x pack .f2.color.red -side top -fill x pack .f2.color.green -side top -fill x pack .f2.color.blue -side top -fill x ### Main widgets pack .f1.view -side left -fill both -expand true pack .f1.filter -side left -fill y pack .f1 -side top -fill both -expand true pack .f2.coord .f2.env -side left -fill both pack .f2.color -fill x pack .f2 -side top -fill x button .photo -text "Take Photo" -command ::texture::take_photo pack .photo -expand true -fill both button .quit -text Quit -command exit pack .quit -expand true -fill both bind .f1.view { set startx %x set starty %y set xangle0 $xangle set yangle0 $yangle } bind .f1.view { set xangle [expr $xangle0 + (%x - $startx) / 3.0 ] set yangle [expr $yangle0 + (%y - $starty) / 3.0 ] yrot .f1.view $xangle xrot .f1.view $yangle } bind .f1.view { set startx %x set starty %y set texscale0 $texscale } bind .f1.view { set q [ expr ($starty - %y) / 400.0 ] set texscale [expr $texscale0 * exp($q)] texscale .f1.view $texscale } # set default values: set minfilter GL_NEAREST_MIPMAP_LINEAR set magfilter GL_LINEAR set swrap GL_REPEAT set twrap GL_REPEAT set envmode GL_MODULATE set image CHECKER set poly_red 255 set poly_green 255 set poly_blue 255 set coord_scale 1.0 set xangle 0.0 set yangle 0.0 set texscale 1.0 } # Execution starts here! if { [info script] == $argv0 } { ::texture::setup } Togl2.0/togl.c0000644000175500010010000042650211002310753012057 0ustar gregcNone/* $Id: togl.c,v 1.106 2008/04/19 06:32:11 gregcouch Exp $ */ /* vi:set sw=4: */ /* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2008 Greg Couch * See the LICENSE file for copyright details. */ /* * Currently we support X11, Win32 and Mac OS X only */ #define USE_TOGL_STUB_PROCS #include "togl.h" #include #include #include #ifndef TOGL_USE_FONTS # define TOGL_USE_FONTS 1 #endif #ifndef TOGL_USE_OVERLAY # if defined(TOGL_X11) || defined(TOGL_WGL) # define TOGL_USE_OVERLAY 1 # endif #endif /* Use TCL_STUPID to cast (const char *) to (char *) where the Tcl function * prototype argument should really be const */ #define TCL_STUPID (char *) /* Use WIDGREC to cast widgRec or recordPtr arguments */ #define WIDGREC (char *) /*** Windows headers ***/ #if defined(TOGL_WGL) # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN # include # ifndef PFD_SUPPORT_COMPOSITION // for Vista -- not strictly needed because we don't use PFD_SUPPORT_GDI/BITMAP # define PFD_SUPPORT_COMPOSITION 0x00008000 # endif # include # ifdef _MSC_VER # include # include "StereoI/StereoI.h" /* NVidia Consumer 3D stereo */ # else # ifdef UNICODE # define StringCchPrintf snwprintf # else # define StringCchPrintf snprintf # endif # endif /*** X Window System headers ***/ #elif defined(TOGL_X11) # include # include # include /* for XA_RGB_DEFAULT_MAP atom */ # if defined(__vms) # include /* for XmuLookupStandardColormap */ # else # include /* for XmuLookupStandardColormap */ # endif # include # ifdef __sgi # include # endif # ifdef HAVE_AUTOSTEREO # include # endif /*** Mac headers ***/ #elif defined(TOGL_AGL) # define Cursor QDCursor # include # undef Cursor # include /* usa MacDrawable */ # include #else /* make sure only one platform defined */ # error Unsupported platform, or confused platform defines... #endif #define NC3D "NVidia Consumer 3D Stereo" #ifndef STEREO_BUFFER_NONE /* From , but we use this constants elsewhere */ # define STEREO_BUFFER_NONE 0 # define STEREO_BUFFER_LEFT 1 # define STEREO_BUFFER_RIGHT 2 #endif /*** Standard C headers ***/ #include #include #include #ifdef TOGL_WGL # include #endif #if TK_MAJOR_VERSION < 8 # error Sorry Togl requires Tcl/Tk ver 8.0 or higher. #endif #ifdef USE_TCL_STUBS # if TK_MAJOR_VERSION < 8 || (TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 1) # error Sorry stub support requires Tcl/Tk ver 8.1 or higher. # endif #endif #if defined(TOGL_AGL) # if TK_MAJOR_VERSION < 8 || (TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 4) # error Sorry Mac Aqua version requires Tcl/Tk ver 8.4.0 or higher. # endif #endif /* TOGL_AGL */ /* workaround for bug #123153 in tcl ver8.4a2 (tcl.h) */ #if defined(Tcl_InitHashTable) && defined(USE_TCL_STUBS) # undef Tcl_InitHashTable # define Tcl_InitHashTable (tclStubsPtr->tcl_InitHashTable) #endif #if TK_MAJOR_VERSION > 8 || (TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION >= 4) # define HAVE_TK_SETCLASSPROCS /* pointer to Tk_SetClassProcs function in the stub table */ static void (*SetClassProcsPtr) _ANSI_ARGS_((Tk_Window, Tk_ClassProcs *, ClientData)); #endif /* * Copy of TkClassProcs declarations from tkInt.h * (this is needed for Tcl ver =< 8.4a3) */ typedef Window (TkClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin, Window parent, ClientData instanceData)); typedef void (TkClassGeometryProc) _ANSI_ARGS_((ClientData instanceData)); typedef void (TkClassModalProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent *eventPtr)); typedef struct TkClassProcs { TkClassCreateProc *createProc; TkClassGeometryProc *geometryProc; TkClassModalProc *modalProc; } TkClassProcs; /* Defaults */ #define DEFAULT_WIDTH "400" #define DEFAULT_HEIGHT "400" #define DEFAULT_IDENT "" #define DEFAULT_FONTNAME "Courier" #define DEFAULT_TIME "1" #ifdef TOGL_WGL /* Maximum size of a logical palette corresponding to a colormap in color index * mode. */ # define MAX_CI_COLORMAP_SIZE 4096 # define MAX_CI_COLORMAP_BITS 12 # if TOGL_USE_FONTS != 1 /* * copy of TkWinColormap from tkWinInt.h */ typedef struct { HPALETTE palette; /* Palette handle used when drawing. */ UINT size; /* Number of entries in the palette. */ int stale; /* 1 if palette needs to be realized, otherwise * 0. If the palette is stale, then an idle * handler is scheduled to realize the palette. */ Tcl_HashTable refCounts; /* Hash table of palette entry reference counts * indexed by pixel value. */ } TkWinColormap; # else # include # endif static LRESULT(CALLBACK *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) = NULL; # define TK_WIN_CHILD_CLASS_NAME "TkChild" #endif /* TOGL_WGL */ #define MAX(a,b) (((a)>(b))?(a):(b)) #define TCL_ERR(interp, string) \ do { \ Tcl_ResetResult(interp); \ Tcl_AppendResult(interp, string, NULL); \ return TCL_ERROR; \ } while (0) /* The constant DUMMY_WINDOW is used to signal window creation failure from * Togl_CreateWindow() */ #define DUMMY_WINDOW ((Window) -1) #define ALL_EVENTS_MASK \ (KeyPressMask \ |KeyReleaseMask \ |ButtonPressMask \ |ButtonReleaseMask \ |EnterWindowMask \ |LeaveWindowMask \ |PointerMotionMask \ |ExposureMask \ |VisibilityChangeMask \ |FocusChangeMask \ |PropertyChangeMask \ |ColormapChangeMask) /* * The following structure contains pointers to functions used for * processing the custom "-stereo" option. Copied from tkPanedWindow.c. */ static int SetStereo(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, int internalOffset, char *oldInternalPtr, int flags); static Tcl_Obj *GetStereo(ClientData clientData, Tk_Window tkwin, char *recordPtr, int internalOffset); static void RestoreStereo(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr); static Tk_ObjCustomOption stereoOption = { "stereo", /* name */ SetStereo, /* setProc */ GetStereo, /* getProc */ RestoreStereo, /* restoreProc */ NULL, /* freeProc */ 0 }; /* * Stuff we initialize on a per package (Togl_Init) basis. * Since Tcl uses one interpreter per thread, any per-thread * data goes here. */ struct Togl_PackageGlobals { Tk_OptionTable optionTable; /* Used to parse options */ Togl *toglHead; /* Head of linked list of all Togl widgets */ int nextContextTag; /* Used to assign similar context tags */ }; typedef struct Togl_PackageGlobals Togl_PackageGlobals; extern ToglStubs toglStubs; /* should be only non-const global */ struct Togl { Togl *Next; /* next in linked list */ #if defined(TOGL_WGL) HDC tglGLHdc; /* Device context of device that OpenGL calls * will be drawn on */ HGLRC tglGLHglrc; /* OpenGL rendering context to be made current */ int CiColormapSize; /* (Maximum) size of colormap in color index * mode */ # ifdef STEREO_I_H StereoI *pStereoI; # endif #elif defined(TOGL_X11) GLXContext GlCtx; /* Normal planes GLX context */ #elif defined(TOGL_AGL) AGLContext aglCtx; #endif int contextTag; /* all contexts with same tag share display * lists */ XVisualInfo *VisInfo; /* Visual info of the current */ Display *display; /* X's token for the window's display. */ Tk_Window TkWin; /* Tk window structure */ Tcl_Interp *Interp; /* Tcl interpreter */ Tcl_Command widgetCmd; /* Token for togl's widget command */ Togl_PackageGlobals *tpg; /* Used to access globals */ #ifndef NO_TK_CURSOR Tk_Cursor Cursor; /* The widget's cursor */ #endif int Width, Height; /* Dimensions of window */ int SetGrid; /* positive is grid size for window manager */ int TimerInterval; /* Time interval for timer in milliseconds */ Tcl_TimerToken timerHandler; /* Token for togl's timer handler */ Bool RgbaFlag; /* configuration flags (ala GLX parameters) */ int RgbaRed; int RgbaGreen; int RgbaBlue; Bool DoubleFlag; Bool DepthFlag; int DepthSize; Bool AccumFlag; int AccumRed; int AccumGreen; int AccumBlue; int AccumAlpha; Bool AlphaFlag; int AlphaSize; Bool StencilFlag; int StencilSize; Bool PrivateCmapFlag; Bool OverlayFlag; int Stereo; double EyeSeparation; double Convergence; int AuxNumber; Bool Indirect; int PixelFormat; int SwapInterval; const char *ShareList; /* name (ident) of Togl to share dlists with */ const char *ShareContext; /* name (ident) to share OpenGL context with */ const char *Ident; /* User's identification string */ ClientData Client_Data; /* Pointer to user data */ Bool UpdatePending; /* Should normal planes be redrawn? */ Tcl_Obj *CreateProc; /* Callback when widget is realized */ Tcl_Obj *DisplayProc; /* Callback when widget is redrawn */ Tcl_Obj *ReshapeProc; /* Callback when window size changes */ Tcl_Obj *DestroyProc; /* Callback when widget is destroyed */ Tcl_Obj *TimerProc; /* Callback when widget is idle */ /* Overlay stuff */ #if defined(TOGL_X11) GLXContext OverlayCtx; /* Overlay planes OpenGL context */ #elif defined(TOGL_WGL) HGLRC tglGLOverlayHglrc; #endif Window OverlayWindow; /* The overlay window, or 0 */ Tcl_Obj *OverlayDisplayProc; /* Overlay redraw proc */ Bool OverlayUpdatePending; /* Should overlay be redrawn? */ Colormap OverlayCmap; /* colormap for overlay is created */ int OverlayTransparentPixel; /* transparent pixel */ Bool OverlayIsMapped; GLfloat *EpsRedMap; /* Index2RGB Maps for Color index modes */ GLfloat *EpsGreenMap; GLfloat *EpsBlueMap; GLint EpsMapSize; /* = Number of indices in our Togl */ int currentStereoBuffer; #ifdef HAVE_AUTOSTEREO int as_initialized; /* for autostereo package */ ASHandle ash; /* for autostereo package */ #endif int badWindow; /* true when Togl_CreateWindow fails */ }; /* * Prototypes for functions local to this file */ static int Togl_ObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv); static void Togl_ObjCmdDelete(ClientData clientData); static void Togl_EventProc(ClientData clientData, XEvent *eventPtr); static Window Togl_CreateWindow(Tk_Window, Window, ClientData); static void Togl_WorldChanged(ClientData); #ifdef MESA_COLOR_HACK static int get_free_color_cells(Display *display, int screen, Colormap colormap); static void free_default_color_cells(Display *display, Colormap colormap); #endif static void ToglCmdDeletedProc(ClientData); #if defined(TOGL_AGL) static void SetMacBufRect(Togl *togl); #endif /* * Setup Togl widget configuration options: */ #define GEOMETRY_MASK 0x1 /* widget geometry */ #define FORMAT_MASK 0x2 /* pixel format */ #define CURSOR_MASK 0x4 #define TIMER_MASK 0x8 #define OVERLAY_MASK 0x10 #define SWAP_MASK 0x20 #define STEREO_MASK 0x40 #define STEREO_FORMAT_MASK 0x80 static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, TCL_STUPID "-height", "height", "Height", DEFAULT_HEIGHT, -1, Tk_Offset(Togl, Height), 0, NULL, GEOMETRY_MASK}, {TK_OPTION_PIXELS, TCL_STUPID "-width", "width", "Width", DEFAULT_WIDTH, -1, Tk_Offset(Togl, Width), 0, NULL, GEOMETRY_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-rgba", "rgba", "Rgba", "true", -1, Tk_Offset(Togl, RgbaFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-redsize", "redsize", "RedSize", "1", -1, Tk_Offset(Togl, RgbaRed), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-greensize", "greensize", "GreenSize", "1", -1, Tk_Offset(Togl, RgbaGreen), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-bluesize", "bluesize", "BlueSize", "1", -1, Tk_Offset(Togl, RgbaBlue), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-double", "double", "Double", "false", -1, Tk_Offset(Togl, DoubleFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-depth", "depth", "Depth", "false", -1, Tk_Offset(Togl, DepthFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-depthsize", "depthsize", "DepthSize", "1", -1, Tk_Offset(Togl, DepthSize), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-accum", "accum", "Accum", "false", -1, Tk_Offset(Togl, AccumFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-accumredsize", "accumredsize", "AccumRedSize", "1", -1, Tk_Offset(Togl, AccumRed), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-accumgreensize", "accumgreensize", "AccumGreenSize", "1", -1, Tk_Offset(Togl, AccumGreen), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-accumbluesize", "accumbluesize", "AccumBlueSize", "1", -1, Tk_Offset(Togl, AccumBlue), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-accumalphasize", "accumalphasize", "AccumAlphaSize", "1", -1, Tk_Offset(Togl, AccumAlpha), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-alpha", "alpha", "Alpha", "false", -1, Tk_Offset(Togl, AlphaFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-alphasize", "alphasize", "AlphaSize", "1", -1, Tk_Offset(Togl, AlphaSize), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-stencil", "stencil", "Stencil", "false", -1, Tk_Offset(Togl, StencilFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-stencilsize", "stencilsize", "StencilSize", "1", -1, Tk_Offset(Togl, StencilSize), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-auxbuffers", "auxbuffers", "AuxBuffers", "0", -1, Tk_Offset(Togl, AuxNumber), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-privatecmap", "privateCmap", "PrivateCmap", "false", -1, Tk_Offset(Togl, PrivateCmapFlag), 0, NULL, FORMAT_MASK}, {TK_OPTION_BOOLEAN, TCL_STUPID "-overlay", "overlay", "Overlay", "false", -1, Tk_Offset(Togl, OverlayFlag), 0, NULL, OVERLAY_MASK}, {TK_OPTION_CUSTOM, TCL_STUPID "-stereo", "stereo", "Stereo", "", -1, Tk_Offset(Togl, Stereo), 0, (ClientData) &stereoOption, STEREO_FORMAT_MASK}, {TK_OPTION_DOUBLE, TCL_STUPID "-eyeseparation", "eyeseparation", "EyeSeparation", "2.0", -1, Tk_Offset(Togl, EyeSeparation), 0, NULL, STEREO_MASK}, {TK_OPTION_DOUBLE, TCL_STUPID "-convergence", "convergence", "Convergence", "35.0", -1, Tk_Offset(Togl, Convergence), 0, NULL, STEREO_MASK}, #ifndef NO_TK_CURSOR {TK_OPTION_CURSOR, TCL_STUPID "-cursor", "cursor", "Cursor", "", -1, Tk_Offset(Togl, Cursor), TK_OPTION_NULL_OK, NULL, CURSOR_MASK}, #endif {TK_OPTION_INT, TCL_STUPID "-setgrid", "setGrid", "SetGrid", "0", -1, Tk_Offset(Togl, SetGrid), 0, NULL, GEOMETRY_MASK}, {TK_OPTION_INT, TCL_STUPID "-time", "time", "Time", DEFAULT_TIME, -1, Tk_Offset(Togl, TimerInterval), 0, NULL, TIMER_MASK}, {TK_OPTION_STRING, TCL_STUPID "-sharelist", "sharelist", "ShareList", NULL, -1, Tk_Offset(Togl, ShareList), 0, NULL, FORMAT_MASK}, {TK_OPTION_STRING, TCL_STUPID "-sharecontext", "sharecontext", "ShareContext", NULL, -1, Tk_Offset(Togl, ShareContext), 0, NULL, FORMAT_MASK}, {TK_OPTION_STRING, TCL_STUPID "-ident", "ident", "Ident", DEFAULT_IDENT, -1, Tk_Offset(Togl, Ident), 0, NULL, 0}, {TK_OPTION_BOOLEAN, TCL_STUPID "-indirect", "indirect", "Indirect", "false", -1, Tk_Offset(Togl, Indirect), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-pixelformat", "pixelFormat", "PixelFormat", "0", -1, Tk_Offset(Togl, PixelFormat), 0, NULL, FORMAT_MASK}, {TK_OPTION_INT, TCL_STUPID "-swapinterval", "swapInterval", "SwapInterval", "1", -1, Tk_Offset(Togl, SwapInterval), 0, NULL, SWAP_MASK}, {TK_OPTION_STRING, TCL_STUPID "-createcommand", "createCommand", "CallbackCommand", NULL, Tk_Offset(Togl, CreateProc), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-create", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-createcommand", 0}, {TK_OPTION_STRING, TCL_STUPID "-displaycommand", "displayCommand", "CallbackCommand", NULL, Tk_Offset(Togl, DisplayProc), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-display", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-displaycommand", 0}, {TK_OPTION_STRING, TCL_STUPID "-reshapecommand", "reshapeCommand", "CallbackCommand", NULL, Tk_Offset(Togl, ReshapeProc), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-reshape", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-reshapecommand", 0}, {TK_OPTION_STRING, TCL_STUPID "-destroycommand", "destroyCommand", "CallbackCommand", NULL, Tk_Offset(Togl, DestroyProc), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-destroy", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-destroycommand", 0}, {TK_OPTION_STRING, TCL_STUPID "-timercommand", "timerCommand", "CallabckCommand", NULL, Tk_Offset(Togl, TimerProc), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-timer", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-timercommand", 0}, {TK_OPTION_STRING, TCL_STUPID "-overlaydisplaycommand", "overlaydisplayCommand", "CallbackCommand", NULL, Tk_Offset(Togl, OverlayDisplayProc), -1, TK_OPTION_NULL_OK, NULL, OVERLAY_MASK}, {TK_OPTION_SYNONYM, TCL_STUPID "-overlaydisplay", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-overlaydisplaycommand", 0}, /* Tcl3D backwards compatibility */ {TK_OPTION_SYNONYM, TCL_STUPID "-createproc", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-createcommand", 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-displayproc", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-displaycommand", 0}, {TK_OPTION_SYNONYM, TCL_STUPID "-reshapeproc", NULL, NULL, NULL, -1, -1, 0, (ClientData) "-reshapecommand", 0}, /* end Tcl3D compatibility */ {TK_OPTION_END, NULL, NULL, NULL, NULL, -1, -1, 0, NULL, 0} }; /* * Add given togl widget to linked list. */ static void AddToList(Togl *t) { t->Next = t->tpg->toglHead; t->tpg->toglHead = t; } /* * Remove given togl widget from linked list. */ static void RemoveFromList(Togl *t) { Togl *prev; Togl *cur; for (cur = t->tpg->toglHead, prev = NULL; cur; prev = cur, cur = cur->Next) { if (t != cur) continue; if (prev) { prev->Next = cur->Next; } else { t->tpg->toglHead = cur->Next; } break; } if (cur) cur->Next = NULL; } /* * Return pointer to togl widget given a user identifier string. */ static Togl * FindTogl(Togl *togl, const char *ident) { Togl *t; for (t = togl->tpg->toglHead; t; t = t->Next) { if (strcmp(t->Ident, ident) == 0) break; } return t; } /* * Return pointer to another togl widget with same OpenGL context. */ static Togl * FindToglWithSameContext(Togl *togl) { Togl *t; for (t = togl->tpg->toglHead; t != NULL; t = t->Next) { if (t == togl) continue; #if defined(TOGL_WGL) if (t->tglGLHglrc == togl->tglGLHglrc) #elif defined(TOGL_X11) if (t->GlCtx == togl->GlCtx) #elif defined(TOGL_AGL) if (t->aglCtx == togl->aglCtx) #endif { return t; } } return NULL; } #if TOGL_USE_OVERLAY /* * Return pointer to another togl widget with same OpenGL overlay context. */ static Togl * FindToglWithSameOverlayContext(Togl *togl) { Togl *t; for (t = togl->tpg->toglHead; t != NULL; t = t->Next) { if (t == togl) continue; # if defined(TOGL_X11) if (t->OverlayCtx == togl->OverlayCtx) # elif defined(TOGL_WGL) if (t->tglGLOverlayHglrc == togl->tglGLOverlayHglrc) # endif { return t; } } return NULL; } #endif #if defined(TOGL_X11) /* * Return an X colormap to use for OpenGL RGB-mode rendering. * Input: dpy - the X display * scrnum - the X screen number * visinfo - the XVisualInfo as returned by glXChooseVisual() * Return: an X Colormap or 0 if there's a _serious_ error. */ static Colormap get_rgb_colormap(Display *dpy, int scrnum, const XVisualInfo *visinfo, Tk_Window tkwin) { Atom hp_cr_maps; Status status; int numCmaps; int i; XStandardColormap *standardCmaps; Window root = XRootWindow(dpy, scrnum); Bool using_mesa; /* * First check if visinfo's visual matches the default/root visual. */ if (visinfo->visual == Tk_Visual(tkwin)) { /* use the default/root colormap */ Colormap cmap; cmap = Tk_Colormap(tkwin); # ifdef MESA_COLOR_HACK (void) get_free_color_cells(dpy, scrnum, cmap); # endif return cmap; } /* * Check if we're using Mesa. */ if (strstr(glXQueryServerString(dpy, scrnum, GLX_VERSION), "Mesa")) { using_mesa = True; } else { using_mesa = False; } /* * Next, if we're using Mesa and displaying on an HP with the "Color * Recovery" feature and the visual is 8-bit TrueColor, search for a * special colormap initialized for dithering. Mesa will know how to * dither using this colormap. */ if (using_mesa) { hp_cr_maps = XInternAtom(dpy, "_HP_RGB_SMOOTH_MAP_LIST", True); if (hp_cr_maps # ifdef __cplusplus && visinfo->visual->c_class == TrueColor # else && visinfo->visual->class == TrueColor # endif && visinfo->depth == 8) { status = XGetRGBColormaps(dpy, root, &standardCmaps, &numCmaps, hp_cr_maps); if (status) { for (i = 0; i < numCmaps; i++) { if (standardCmaps[i].visualid == visinfo->visual->visualid) { Colormap cmap = standardCmaps[i].colormap; (void) XFree(standardCmaps); return cmap; } } (void) XFree(standardCmaps); } } } /* * Next, try to find a standard X colormap. */ # if !HP && !SUN # ifndef SOLARIS_BUG status = XmuLookupStandardColormap(dpy, visinfo->screen, visinfo->visualid, visinfo->depth, XA_RGB_DEFAULT_MAP, /* replace */ False, /* retain */ True); if (status == 1) { status = XGetRGBColormaps(dpy, root, &standardCmaps, &numCmaps, XA_RGB_DEFAULT_MAP); if (status == 1) { for (i = 0; i < numCmaps; i++) { if (standardCmaps[i].visualid == visinfo->visualid) { Colormap cmap = standardCmaps[i].colormap; (void) XFree(standardCmaps); return cmap; } } (void) XFree(standardCmaps); } } # endif # endif /* * If we get here, give up and just allocate a new colormap. */ return XCreateColormap(dpy, root, visinfo->visual, AllocNone); } #elif defined(TOGL_WGL) /* Code to create RGB palette is taken from the GENGL sample program of Win32 * SDK */ static const unsigned char threeto8[8] = { 0, 0111 >> 1, 0222 >> 1, 0333 >> 1, 0444 >> 1, 0555 >> 1, 0666 >> 1, 0377 }; static const unsigned char twoto8[4] = { 0, 0x55, 0xaa, 0xff }; static const unsigned char oneto8[2] = { 0, 255 }; static const int defaultOverride[13] = { 0, 3, 24, 27, 64, 67, 88, 173, 181, 236, 247, 164, 91 }; static const PALETTEENTRY defaultPalEntry[20] = { {0, 0, 0, 0}, {0x80, 0, 0, 0}, {0, 0x80, 0, 0}, {0x80, 0x80, 0, 0}, {0, 0, 0x80, 0}, {0x80, 0, 0x80, 0}, {0, 0x80, 0x80, 0}, {0xC0, 0xC0, 0xC0, 0}, {192, 220, 192, 0}, {166, 202, 240, 0}, {255, 251, 240, 0}, {160, 160, 164, 0}, {0x80, 0x80, 0x80, 0}, {0xFF, 0, 0, 0}, {0, 0xFF, 0, 0}, {0xFF, 0xFF, 0, 0}, {0, 0, 0xFF, 0}, {0xFF, 0, 0xFF, 0}, {0, 0xFF, 0xFF, 0}, {0xFF, 0xFF, 0xFF, 0} }; static unsigned char ComponentFromIndex(int i, UINT nbits, UINT shift) { unsigned char val; val = (unsigned char) (i >> shift); switch (nbits) { case 1: val &= 0x1; return oneto8[val]; case 2: val &= 0x3; return twoto8[val]; case 3: val &= 0x7; return threeto8[val]; default: return 0; } } static Colormap Win32CreateRgbColormap(PIXELFORMATDESCRIPTOR pfd) { TkWinColormap *cmap = (TkWinColormap *) ckalloc(sizeof (TkWinColormap)); LOGPALETTE *pPal; int n, i; n = 1 << pfd.cColorBits; pPal = (PLOGPALETTE) LocalAlloc(LMEM_FIXED, sizeof (LOGPALETTE) + n * sizeof (PALETTEENTRY)); pPal->palVersion = 0x300; pPal->palNumEntries = n; for (i = 0; i < n; i++) { pPal->palPalEntry[i].peRed = ComponentFromIndex(i, pfd.cRedBits, pfd.cRedShift); pPal->palPalEntry[i].peGreen = ComponentFromIndex(i, pfd.cGreenBits, pfd.cGreenShift); pPal->palPalEntry[i].peBlue = ComponentFromIndex(i, pfd.cBlueBits, pfd.cBlueShift); pPal->palPalEntry[i].peFlags = 0; } /* fix up the palette to include the default GDI palette */ if ((pfd.cColorBits == 8) && (pfd.cRedBits == 3) && (pfd.cRedShift == 0) && (pfd.cGreenBits == 3) && (pfd.cGreenShift == 3) && (pfd.cBlueBits == 2) && (pfd.cBlueShift == 6)) { for (i = 1; i <= 12; i++) pPal->palPalEntry[defaultOverride[i]] = defaultPalEntry[i]; } cmap->palette = CreatePalette(pPal); LocalFree(pPal); cmap->size = n; cmap->stale = 0; /* Since this is a private colormap of a fix size, we do not need a valid * hash table, but a dummy one */ Tcl_InitHashTable(&cmap->refCounts, TCL_ONE_WORD_KEYS); return (Colormap) cmap; } static Colormap Win32CreateCiColormap(Togl *togl) { /* Create a colormap with size of togl->CiColormapSize and set all entries * to black */ LOGPALETTE logPalette; TkWinColormap *cmap = (TkWinColormap *) ckalloc(sizeof (TkWinColormap)); logPalette.palVersion = 0x300; logPalette.palNumEntries = 1; logPalette.palPalEntry[0].peRed = 0; logPalette.palPalEntry[0].peGreen = 0; logPalette.palPalEntry[0].peBlue = 0; logPalette.palPalEntry[0].peFlags = 0; cmap->palette = CreatePalette(&logPalette); cmap->size = togl->CiColormapSize; ResizePalette(cmap->palette, cmap->size); /* sets new entries to black */ cmap->stale = 0; /* Since this is a private colormap of a fix size, we do not need a valid * hash table, but a dummy one */ Tcl_InitHashTable(&cmap->refCounts, TCL_ONE_WORD_KEYS); return (Colormap) cmap; } /* ErrorExit is from */ static void ErrorExit(LPTSTR lpszFunction) { /* Retrieve the system error message for the last-error code */ LPTSTR lpMsgBuf; LPTSTR lpDisplayBuf; DWORD err = GetLastError(); if (err == 0) { /* The function said it failed, but GetLastError says it didn't, so * pretend it didn't. */ return; } FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); /* Display the error message and exit the process */ lpDisplayBuf = (LPTSTR) LocalAlloc(LMEM_ZEROINIT, (lstrlen(lpMsgBuf) + lstrlen(lpszFunction) + 40) * sizeof (TCHAR)); StringCchPrintf(lpDisplayBuf, LocalSize(lpDisplayBuf), TEXT("%s failed with error %ld: %s"), lpszFunction, err, lpMsgBuf); MessageBox(NULL, lpDisplayBuf, TEXT("Error"), MB_OK); LocalFree(lpMsgBuf); LocalFree(lpDisplayBuf); ExitProcess(err); } #endif /* * Togl_Init * * Called upon system startup to create togl command. */ int Togl_Init(Tcl_Interp *interp) { int major, minor, patchLevel, releaseType; #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { return TCL_ERROR; } #endif #ifdef USE_TK_STUBS if (Tk_InitStubs(interp, TCL_STUPID "8.1", 0) == NULL) { return TCL_ERROR; } #endif Tcl_GetVersion(&major, &minor, &patchLevel, &releaseType); #ifdef HAVE_TK_SETCLASSPROCS if (major > 8 || (major == 8 && (minor > 4 || (minor == 4 && (releaseType > 0 || patchLevel >= 2))))) { # ifdef USE_TK_STUBS SetClassProcsPtr = tkStubsPtr->tk_SetClassProcs; # else SetClassProcsPtr = Tk_SetClassProcs; # endif } else { SetClassProcsPtr = NULL; } #else if (major > 8 || (major == 8 && (minor > 4 || (minor == 4 && (releaseType > 0 || patchLevel >= 2))))) { TCL_ERR(interp, "Sorry, this instance of Togl was not compiled to work with Tcl/Tk 8.4a2 or higher."); } #endif if (Tcl_CreateObjCommand(interp, "togl", Togl_ObjCmd, NULL, Togl_ObjCmdDelete) == NULL) { return TCL_ERROR; } if (Tcl_PkgProvideEx(interp, "Togl", TOGL_VERSION, &toglStubs) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } /* * Togl_CallCallback * * Call command with togl widget as only argument */ int Togl_CallCallback(Togl *togl, Tcl_Obj *cmd) { int result; Tcl_Obj *objv[3]; if (cmd == NULL || togl->widgetCmd == NULL) return TCL_OK; objv[0] = cmd; Tcl_IncrRefCount(objv[0]); objv[1] = Tcl_NewStringObj(Tcl_GetCommandName(togl->Interp, togl->widgetCmd), -1); Tcl_IncrRefCount(objv[1]); objv[2] = NULL; result = Tcl_EvalObjv(togl->Interp, 2, objv, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(objv[1]); Tcl_DecrRefCount(objv[0]); return result; } /* * Togl_Timer * * Gets called from Tk_CreateTimerHandler. */ static void Togl_Timer(ClientData clientData) { Togl *togl = (Togl *) clientData; if (togl->TimerProc) { if (Togl_CallCallback(togl, togl->TimerProc) != TCL_OK) { togl->timerHandler = NULL; return; } /* * Re-register this callback since Tcl/Tk timers are "one-shot". * That is, after the timer callback is called it not normally * called again. That's not the behavior we want for Togl. */ togl->timerHandler = Tcl_CreateTimerHandler(togl->TimerInterval, Togl_Timer, (ClientData) togl); } } /* * Togl_MakeCurrent * * Bind the OpenGL rendering context to the specified * Togl widget. If given a NULL argument, then the * OpenGL context is released without assigning a new one. */ void Togl_MakeCurrent(const Togl *togl) { #if defined(TOGL_WGL) int res = TRUE; if (togl == NULL) { HDC hdc = wglGetCurrentDC(); if (hdc != NULL) res = wglMakeCurrent(hdc, NULL); } else { res = wglMakeCurrent(togl->tglGLHdc, togl->tglGLHglrc); } if (!res) { ErrorExit(TEXT("wglMakeCurrent")); } #elif defined(TOGL_X11) if (togl == NULL || togl->GlCtx == NULL) { Display *display = togl ? togl->display : glXGetCurrentDisplay(); if (display) (void) glXMakeCurrent(display, None, NULL); } else { GLXDrawable drawable = togl->TkWin ? Tk_WindowId(togl->TkWin) : None; (void) glXMakeCurrent(togl->display, drawable, togl->GlCtx); } #elif defined(TOGL_AGL) if (togl == NULL || togl->aglCtx == NULL) { (void) aglSetCurrentContext(NULL); } else { (void) aglSetCurrentContext(togl->aglCtx); } #endif } /* * Togl_TakePhoto * * Take a photo image of the current OpenGL window. May have problems * if window is partially obscured, either by other windows or by the * edges of the display. */ int Togl_TakePhoto(Togl *togl, Tk_PhotoHandle photo) { GLubyte *buffer; Tk_PhotoImageBlock photoBlock; int y, midy; unsigned char *cp; int width = Togl_Width(togl), height = Togl_Height(togl); /* * TIP #116 altered Tk_PhotoPutBlock API to add interp arg that 8.4 * doesn't have. * We need to remove that for compiling with 8.4. */ #if (TK_MAJOR_VERSION == 8) && (TK_MINOR_VERSION < 5) # define TK_PHOTOPUTBLOCK(interp, hdl, blk, x, y, w, h, cr) \ Tk_PhotoPutBlock(hdl, blk, x, y, w, h, cr) #else # define TK_PHOTOPUTBLOCK Tk_PhotoPutBlock #endif buffer = (GLubyte *) ckalloc(width * height * 4); photoBlock.pixelPtr = buffer; photoBlock.width = width; photoBlock.height = height; photoBlock.pitch = width * 4; photoBlock.pixelSize = 4; photoBlock.offset[0] = 0; photoBlock.offset[1] = 1; photoBlock.offset[2] = 2; photoBlock.offset[3] = 3; glPushAttrib(GL_PIXEL_MODE_BIT); if (togl->DoubleFlag) { glReadBuffer(GL_FRONT); } if (!togl->RgbaFlag) { #if defined(TOGL_WGL) /* Due to the lack of a unique inverse mapping from the frame buffer to * the logical palette we need a translation map from the complete * logical palette. */ int n, i; TkWinColormap *cmap = (TkWinColormap *) Tk_Colormap(togl->TkWin); LPPALETTEENTRY entry = (LPPALETTEENTRY) malloc(togl->EpsMapSize * sizeof (PALETTEENTRY)); n = GetPaletteEntries(cmap->palette, 0, togl->EpsMapSize, entry); for (i = 0; i < n; i++) { togl->EpsRedMap[i] = (GLfloat) (entry[i].peRed / 255.0); togl->EpsGreenMap[i] = (GLfloat) (entry[i].peGreen / 255.0); togl->EpsBlueMap[i] = (GLfloat) (entry[i].peBlue / 255.0); } free(entry); #endif /* TOGL_WGL */ glPixelMapfv(GL_PIXEL_MAP_I_TO_R, togl->EpsMapSize, togl->EpsRedMap); glPixelMapfv(GL_PIXEL_MAP_I_TO_G, togl->EpsMapSize, togl->EpsGreenMap); glPixelMapfv(GL_PIXEL_MAP_I_TO_B, togl->EpsMapSize, togl->EpsBlueMap); } glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); glPixelStorei(GL_PACK_ALIGNMENT, 4); /* guarantee performance */ glPixelStorei(GL_PACK_SWAP_BYTES, GL_FALSE); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); #if 1 glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_ROWS, 0); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); /* Some OpenGL drivers are buggy and return zero for Alpha instead of one * for RGB pixel formats. If that is happening to you, upgrade your * graphics driver. */ /* OpenGL's origin is bottom-left, Tk Photo image's is top-left, so mirror * the rows around the middle row. */ midy = height / 2; cp = buffer; for (y = 0; y < midy; ++y) { int m_y = height - 1 - y; /* mirror y */ unsigned char *m_cp = buffer + m_y * photoBlock.pitch; int x; for (x = 0; x < photoBlock.pitch; ++x) { unsigned char c = *cp; *cp++ = *m_cp; *m_cp++ = c; } } #else /* OpenGL's origin is bottom-left, Tk Photo image's is top-left, so save * rows in reverse order. */ glPixelStorei(GL_PACK_ROW_LENGTH, width); glPixelStorei(GL_PACK_SKIP_ROWS, -1); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer + width * (height - 1) * 4); #endif TK_PHOTOPUTBLOCK(togl->Interp, photo, &photoBlock, 0, 0, width, height, TK_PHOTO_COMPOSITE_SET); glPopClientAttrib(); /* restore PACK_ALIGNMENT */ glPopAttrib(); /* restore glReadBuffer */ ckfree((char *) buffer); return TCL_OK; } Bool Togl_SwapInterval(const Togl *togl, int interval) { #ifdef TOGL_AGL GLint swapInterval = interval; return aglSetInteger(togl->aglCtx, AGL_SWAP_INTERVAL, &swapInterval); #endif #ifdef TOGL_WGL typedef BOOL (WINAPI *BOOLFuncInt) (int); typedef const char *(WINAPI *StrFuncHDC) (HDC); static BOOLFuncInt swapInterval = NULL; static initialized = False; if (!initialized) { const char *extensions; StrFuncHDC getExtensionsString; getExtensionsString = (StrFuncHDC) wglGetProcAddress("wglGetExtensionsStringARB"); if (getExtensionsString == NULL) getExtensionsString = (StrFuncHDC) wglGetProcAddress("wglGetExtensionsStringEXT"); if (getExtensionsString) { extensions = getExtensionsString(togl->tglGLHdc); if (strstr(extensions, "WGL_EXT_swap_control") != NULL) { swapInterval = (BOOLFuncInt) wglGetProcAddress("wglSwapIntervalEXT"); } } initialized = True; } if (swapInterval) return swapInterval(interval); return False; #endif #ifdef TOGL_X11 typedef int (*IntFuncInt) (int); static IntFuncInt swapInterval = NULL; static int initialized = False; if (!initialized) { const char *extensions = glXQueryExtensionsString(togl->display, Tk_ScreenNumber(togl->TkWin)); if (strstr(extensions, "GLX_SGI_swap_control") != NULL) { swapInterval = (IntFuncInt) Togl_GetProcAddr("glXSwapIntervalSGI"); } else if (strstr(extensions, "GLX_MESA_swap_control") != NULL) { swapInterval = (IntFuncInt) Togl_GetProcAddr("glXSwapIntervalMESA"); } initialized = True; } if (swapInterval) return swapInterval(interval) == 0; return False; #endif } #if defined(TOGL_AGL) /* tell OpenGL which part of the Mac window to render to */ static void SetMacBufRect(Togl *togl) { GLint wrect[4]; /* set wrect[0,1] to lower left corner of widget */ wrect[2] = Tk_Width(togl->TkWin); wrect[3] = Tk_Height(togl->TkWin); wrect[0] = ((TkWindow *) (togl->TkWin))->privatePtr->xOff; Rect r; GetPortBounds(((TkWindow *) (togl->TkWin))->privatePtr->toplevel->grafPtr, &r); wrect[1] = r.bottom - wrect[3] - ((TkWindow *) (togl->TkWin))->privatePtr->yOff; aglSetInteger(togl->aglCtx, AGL_BUFFER_RECT, wrect); aglEnable(togl->aglCtx, AGL_BUFFER_RECT); aglUpdateContext(togl->aglCtx); } #endif /* * Called when the widget's contents must be redrawn. Basically, we * just call the user's render callback function. * * Note that the parameter type is ClientData so this function can be * passed to Tk_DoWhenIdle(). */ static void Togl_Render(ClientData clientData) { Togl *togl = (Togl *) clientData; if (togl->DisplayProc) { Togl_MakeCurrent(togl); #ifdef TOGL_AGL SetMacBufRect(togl); #endif Togl_CallCallback(togl, togl->DisplayProc); } #if defined(TOGL_AGL) else { /* Always need to update on resize */ SetMacBufRect(togl); } #endif togl->UpdatePending = False; } static void Togl_RenderOverlay(ClientData clientData) { Togl *togl = (Togl *) clientData; if (togl->OverlayFlag && togl->OverlayDisplayProc) { #if defined(TOGL_WGL) int res = wglMakeCurrent(togl->tglGLHdc, togl->tglGLOverlayHglrc); if (!res) { ErrorExit(TEXT("wglMakeCurrent overlay")); } #elif defined(TOGL_X11) (void) glXMakeCurrent(Tk_Display(togl->TkWin), togl->OverlayWindow, togl->OverlayCtx); #endif /* TOGL_WGL */ Togl_CallCallback(togl, togl->OverlayDisplayProc); } togl->OverlayUpdatePending = False; } static void Togl_LeaveStereo(Togl *togl, int oldStereo) { switch (oldStereo) { default: break; #ifdef STEREO_I_H case TOGL_STEREO_NVIDIA_CON: if (togl->pStereoI) { togl->pStereoI->SetStereoState(STEREO_STATE_OFF); } break; #endif #ifdef HAVE_AUTOSTEREO case TOGL_STEREO_NATIVE: if (togl->ash != -1) { ASClosedStereoWindow(togl->ash); togl->ash = -1; } break; #endif #ifdef __sgi case TOGL_STEREO_SGIOLDSTYLE: togl->currentStereoBuffer = STEREO_BUFFER_NONE; glXWaitGL(); /* sync with GL command stream before calling X */ XSGISetStereoBuffer(togl->display, Tk_WindowId(togl->TkWin), togl->currentStereoBuffer); glXWaitX(); /* sync with X command stream before calling GL */ break; #endif } } /* * See domentation about what can't be changed */ static int Togl_ObjConfigure(Tcl_Interp *interp, Togl *togl, int objc, Tcl_Obj *const *objv) { Tk_SavedOptions savedOptions; int error, mask; int undoMask = 0; Tcl_Obj *errorResult = NULL; int oldStereo = togl->Stereo; for (error = 0; error <= 1; ++error, mask = undoMask) { if (error == 0) { /* * Tk_SetOptions parses the command arguments * and looks for defaults in the resource database. */ if (Tk_SetOptions(interp, WIDGREC togl, togl->tpg->optionTable, objc, objv, togl->TkWin, &savedOptions, &mask) != TCL_OK) { /* previous values are restored, so nothing to do */ return TCL_ERROR; } } else { /* * Restore options from saved values */ errorResult = Tcl_GetObjResult(interp); Tcl_IncrRefCount(errorResult); Tk_RestoreSavedOptions(&savedOptions); } if (mask & GEOMETRY_MASK) { Togl_WorldChanged((ClientData) togl); /* this added per Lou Arata */ Tk_ResizeWindow(togl->TkWin, togl->Width, togl->Height); if (togl->ReshapeProc && #if defined(TOGL_WGL) togl->tglGLHglrc #elif defined(TOGL_X11) togl->GlCtx #elif defined(TOGL_AGL) togl->aglCtx #endif ) { Togl_MakeCurrent(togl); Togl_CallCallback(togl, togl->ReshapeProc); } undoMask |= GEOMETRY_MASK; } if (mask & OVERLAY_MASK) { #if !TOGL_USE_OVERLAY if (togl->OverlayFlag) { Tcl_AppendResult(interp, "Sorry, overlay was disabled", NULL); continue; } #else # if defined(TOGL_X11) if (togl->OverlayCtx) # elif defined(TOGL_WGL) if (togl->tglGLOverlayHglrc) # endif { /* * Trying to change existing pixel format/graphics context */ Tcl_AppendResult(interp, "Unable to change overlay pixel format", NULL); continue; } #endif } if (mask & SWAP_MASK) { if ( #if defined(TOGL_WGL) togl->tglGLHglrc #elif defined(TOGL_X11) togl->GlCtx #elif defined(TOGL_AGL) togl->aglCtx #endif ) { /* * Change existing swap interval */ Togl_MakeCurrent(togl); /* TODO: needed? */ Togl_SwapInterval(togl, togl->SwapInterval); undoMask |= SWAP_MASK; } } if (error == 0 && (mask & STEREO_FORMAT_MASK) != 0) { if (oldStereo == TOGL_STEREO_NATIVE || togl->Stereo == TOGL_STEREO_NATIVE) { /* only native stereo affects the visual format */ mask |= FORMAT_MASK; } if (togl->Stereo == TOGL_STEREO_SGIOLDSTYLE) { #ifndef __sgi Tcl_AppendResult(interp, "sgioldstyle: only available on SGI computers", NULL); continue; #else int event, error; /* Make sure Display supports SGIStereo */ if (XSGIStereoQueryExtension(Tk_Display(togl->TkWin), &event, &error) == False) { Tcl_AppendResult(interp, "sgioldstyle: SGIStereo X extension is missing", NULL); continue; } /* Make sure Window (Screen) supports SGIStereo */ if (XSGIQueryStereoMode(Tk_Display(togl->TkWin), Tk_WindowId(Tk_Parent(togl->TkWin))) == X_STEREO_UNSUPPORTED) { Tcl_AppendResult(interp, "sgioldstyle: unsupported by screen", NULL); continue; } #endif } } if (mask & FORMAT_MASK) { #if defined(TOGL_WGL) if (togl->tglGLHglrc) #elif defined(TOGL_X11) if (togl->GlCtx) #elif defined(TOGL_AGL) if (togl->aglCtx) #endif { /* * Trying to change existing pixel format/graphics context * TODO: (re)create graphics context * * save old graphics context * try to create new one and share display lists * if failure, then restore old one */ Tcl_AppendResult(interp, "Unable to change pixel format", NULL); continue; } /* Whether or not the format is okay is figured out when togl tries * to create the window. */ #ifdef MESA_COLOR_HACK free_default_color_cells(Tk_Display(togl->TkWin), Tk_Colormap(togl->TkWin)); #endif undoMask |= FORMAT_MASK; } if (oldStereo != togl->Stereo) { /* leaving stereo */ Togl_LeaveStereo(togl, oldStereo); } #if !defined(_WIN32) || !defined(STEREO_I_H) if (togl->Stereo == TOGL_STEREO_NVIDIA_CON) { # ifndef _WIN32 Tcl_AppendResult(interp, NC3D ": Microsoft Windows option only", NULL); continue; # elif !defined(STEREO_I_H) Tcl_AppendResult(interp, NC3D ": only available when togl is compiled with Microsoft Visual Studio", NULL); continue; # endif } #endif if (mask & TIMER_MASK) { if (togl->timerHandler != NULL) { Tcl_DeleteTimerHandler(togl->timerHandler); } if (togl->TimerProc) { togl->timerHandler = Tcl_CreateTimerHandler(togl->TimerInterval, Togl_Timer, (ClientData) togl); } undoMask |= TIMER_MASK; } break; } if (error == 0) { Tk_FreeSavedOptions(&savedOptions); return TCL_OK; } else { Tcl_SetObjResult(interp, errorResult); Tcl_DecrRefCount(errorResult); return TCL_ERROR; } } static int Togl_ObjWidget(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl *togl = (Togl *) clientData; const char *commands[] = { "cget", "configure", "extensions", "postredisplay", "render", "swapbuffers", "makecurrent", "takephoto", "loadbitmapfont", "unloadbitmapfont", "write", "uselayer", "showoverlay", "hideoverlay", "postredisplayoverlay", "renderoverlay", "existsoverlay", "ismappedoverlay", "getoverlaytransparentvalue", "drawbuffer", "clear", "frustum", "ortho", "numeyes", "contexttag", NULL }; enum command { TOGL_CGET, TOGL_CONFIGURE, TOGL_EXTENSIONS, TOGL_POSTREDISPLAY, TOGL_RENDER, TOGL_SWAPBUFFERS, TOGL_MAKECURRENT, TOGL_TAKEPHOTO, TOGL_LOADBITMAPFONT, TOGL_UNLOADBITMAPFONT, TOGL_WRITE, TOGL_USELAYER, TOGL_SHOWOVERLAY, TOGL_HIDEOVERLAY, TOGL_POSTREDISPLAYOVERLAY, TOGL_RENDEROVERLAY, TOGL_EXISTSOVERLAY, TOGL_ISMAPPEDOVERLAY, TOGL_GETOVERLAYTRANSPARENTVALUE, TOGL_DRAWBUFFER, TOGL_CLEAR, TOGL_FRUSTUM, TOGL_ORTHO, TOGL_NUMEYES, TOGL_CONTEXTTAG }; int result = TCL_OK; Tcl_Obj *objPtr; int index; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "command ?arg arg ...?"); return TCL_ERROR; } Tk_Preserve((ClientData) togl); result = Tcl_GetIndexFromObj(interp, objv[1], commands, "option", 0, &index); switch (index) { case TOGL_CGET: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "option"); result = TCL_ERROR; break; } objPtr = Tk_GetOptionValue(interp, WIDGREC togl, togl->tpg->optionTable, (objc == 3) ? objv[2] : NULL, togl->TkWin); if (objPtr == NULL) { result = TCL_ERROR; break; } Tcl_SetObjResult(interp, objPtr); break; case TOGL_CONFIGURE: if (objc <= 3) { /* * Return one item if the option is given, * or return all configuration information */ objPtr = Tk_GetOptionInfo(interp, WIDGREC togl, togl->tpg->optionTable, (objc == 3) ? objv[2] : NULL, togl->TkWin); if (objPtr == NULL) { result = TCL_ERROR; } else { Tcl_SetObjResult(interp, objPtr); } } else { /* Execute a configuration change */ result = Togl_ObjConfigure(interp, togl, objc - 2, objv + 2); } break; case TOGL_EXTENSIONS: /* Return a list of OpenGL extensions available */ /* TODO: -glu for glu extensions, -platform for glx/wgl extensions */ if (objc == 2) { const char *extensions; Tcl_Obj *objPtr; int length = -1; extensions = (const char *) glGetString(GL_EXTENSIONS); objPtr = Tcl_NewStringObj(extensions, -1); /* convert to list by asking for its length */ (void) Tcl_ListObjLength(interp, objPtr, &length); Tcl_SetObjResult(interp, objPtr); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_POSTREDISPLAY: /* schedule the widget to be redrawn */ if (objc == 2) { Togl_PostRedisplay(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_RENDER: /* force the widget to be redrawn */ if (objc == 2) { Togl_Render((ClientData) togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_SWAPBUFFERS: /* force the widget to be redrawn */ if (objc == 2) { Togl_SwapBuffers(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_MAKECURRENT: /* force the widget to be redrawn */ if (objc == 2) { Togl_MakeCurrent(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_TAKEPHOTO: { /* force the widget to be redrawn */ if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "name"); result = TCL_ERROR; } else { const char *name; Tk_PhotoHandle photo; name = Tcl_GetStringFromObj(objv[2], NULL); photo = Tk_FindPhoto(interp, name); if (photo == NULL) { Tcl_AppendResult(interp, "image \"", name, "\" doesn't exist or is not a photo image", NULL); result = TCL_ERROR; break; } Togl_TakePhoto(togl, photo); } break; } case TOGL_LOADBITMAPFONT: #if TOGL_USE_FONTS != 1 Tcl_AppendResult(interp, "unsupported", NULL); result = TCL_ERROR; #else if (objc >= 3) { Tcl_Obj *font, *list; list = Tcl_NewListObj(objc - 2, objv + 2); Tcl_IncrRefCount(list); font = Togl_LoadBitmapFont(togl, Tcl_GetString(list)); Tcl_DecrRefCount(list); if (font) { Tcl_SetObjResult(interp, font); result = TCL_OK; } else { Tcl_AppendResult(interp, "Could not allocate font", NULL); result = TCL_ERROR; } } else { Tcl_WrongNumArgs(interp, 2, objv, "fontname"); result = TCL_ERROR; } #endif break; case TOGL_UNLOADBITMAPFONT: #if TOGL_USE_FONTS != 1 Tcl_AppendResult(interp, "unsupported", NULL); result = TCL_ERROR; #else if (objc == 3) { result = Togl_UnloadBitmapFont(togl, objv[2]); } else { Tcl_WrongNumArgs(interp, 2, objv, "toglfont"); result = TCL_ERROR; } #endif break; case TOGL_WRITE:{ #if TOGL_USE_FONTS != 1 Tcl_AppendResult(interp, "unsupported", NULL); result = TCL_ERROR; #else /* Tcl_Obj *toglfont = objv[2]; */ int wobjc = objc - 3; Tcl_Obj *const *wobjv = objv + 3; while (wobjc > 1) { const char *name = Tcl_GetStringFromObj(wobjv[0], NULL); int oc, i; Tcl_Obj **ov; double args[4]; if (Tcl_ListObjGetElements(NULL, wobjv[1], &oc, &ov) != TCL_OK) { oc = 0; } else if (oc <= 4) { for (i = 0; i < oc; ++i) { if (Tcl_GetDoubleFromObj(NULL, ov[i], &args[i]) != TCL_OK) { } } } if (strcmp(name, "-color") == 0) { if (oc == 4) glColor4f(args[0], args[1], args[2], args[3]); else if (oc == 3) glColor3f(args[0], args[1], args[2]); else goto write_usage; } else if (strcmp(name, "-pos") == 0) { if (oc == 4) glRasterPos4f(args[0], args[1], args[2], args[3]); else if (oc == 3) glRasterPos3f(args[0], args[1], args[2]); else if (oc == 2) glRasterPos2f(args[0], args[1]); else goto write_usage; } else goto write_usage; wobjc -= 2; wobjv += 2; } if (wobjc != 1) goto write_usage; result = Togl_WriteObj(togl, objv[2], wobjv[0]); if (result != -1) result = TCL_OK; else { Tcl_AppendResult(interp, "togl write failed", NULL); result = TCL_ERROR; } break; write_usage: Tcl_WrongNumArgs(interp, 2, objv, "[-pos {x y [z [w]]}]" " [-color {r g b [a]}" " string"); result = TCL_ERROR; #endif break; } case TOGL_USELAYER: if (objc == 3) { int layer; result = Tcl_GetIntFromObj(interp, objv[2], &layer); if (result == TCL_OK) { Togl_UseLayer(togl, layer); } } else { Tcl_WrongNumArgs(interp, 2, objv, "layer"); result = TCL_ERROR; } break; case TOGL_SHOWOVERLAY: if (objc == 2) { Togl_ShowOverlay(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_HIDEOVERLAY: if (objc == 2) { Togl_HideOverlay(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_POSTREDISPLAYOVERLAY: if (objc == 2) { Togl_PostOverlayRedisplay(togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_RENDEROVERLAY: /* force the overlay to be redrawn */ if (objc == 2) { Togl_RenderOverlay((ClientData) togl); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_EXISTSOVERLAY: if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewIntObj(Togl_ExistsOverlay(togl))); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_ISMAPPEDOVERLAY: if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewIntObj(Togl_IsMappedOverlay(togl))); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_GETOVERLAYTRANSPARENTVALUE: if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewIntObj(Togl_GetOverlayTransparentValue(togl))); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_DRAWBUFFER: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "mode"); result = TCL_ERROR; } else { int mask; result = Tcl_GetIntFromObj(interp, objv[2], &mask); if (result == TCL_ERROR) break; Togl_DrawBuffer(togl, (GLenum) mask); } break; case TOGL_CLEAR: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "mask"); result = TCL_ERROR; } else { int mask; result = Tcl_GetIntFromObj(interp, objv[2], &mask); if (result == TCL_ERROR) break; Togl_Clear(togl, (GLbitfield) mask); } break; case TOGL_FRUSTUM: if (objc != 8) { Tcl_WrongNumArgs(interp, 2, objv, "left right bottom top near far"); result = TCL_ERROR; } else { double left, right, bottom, top, zNear, zFar; if (Tcl_GetDoubleFromObj(interp, objv[2], &left) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[3], &right) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[4], &bottom) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[5], &top) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[6], &zNear) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[7], &zFar) == TCL_ERROR) { result = TCL_ERROR; break; } Togl_Frustum(togl, left, right, bottom, top, zNear, zFar); } break; case TOGL_ORTHO: if (objc != 8) { Tcl_WrongNumArgs(interp, 2, objv, "left right bottom top near far"); result = TCL_ERROR; } else { double left, right, bottom, top, zNear, zFar; if (Tcl_GetDoubleFromObj(interp, objv[2], &left) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[3], &right) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[4], &bottom) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[5], &top) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[6], &zNear) == TCL_ERROR || Tcl_GetDoubleFromObj(interp, objv[7], &zFar) == TCL_ERROR) { result = TCL_ERROR; break; } Togl_Ortho(togl, left, right, bottom, top, zNear, zFar); } break; case TOGL_NUMEYES: if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewIntObj(Togl_NumEyes(togl))); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; case TOGL_CONTEXTTAG: if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewIntObj(Togl_ContextTag(togl))); } else { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; } break; } Tk_Release((ClientData) togl); return result; } /* * Togl_ObjCmdDelete * * Called when togl command is removed from interpreter. */ static void Togl_ObjCmdDelete(ClientData clientData) { if (clientData != NULL) { Togl_PackageGlobals *tpg = (Togl_PackageGlobals *) clientData; Tk_DeleteOptionTable(tpg->optionTable); ckfree((char *) clientData); } } /* * Togl_ObjCmd * * Called when Togl is executed - creation of a Togl widget. * * Creates a new window * * Creates an 'Togl' data structure * * Creates an event handler for this window * * Creates a command that handles this object * * Configures this Togl for the given arguments */ int Togl_ObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) { Togl_PackageGlobals *tpg; Togl *togl; Tk_Window tkwin; if (objc <= 1) { Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); return TCL_ERROR; } tpg = (Togl_PackageGlobals *) clientData; if (tpg == NULL) { Tcl_CmdInfo info; const char *name; /* * Initialize the Togl_PackageGlobals for this widget the * first time a Togl widget is created. The globals are * saved as our client data. */ tpg = (Togl_PackageGlobals *) ckalloc(sizeof (Togl_PackageGlobals)); if (tpg == NULL) { return TCL_ERROR; } tpg->nextContextTag = 0; tpg->optionTable = Tk_CreateOptionTable(interp, optionSpecs); tpg->toglHead = NULL; name = Tcl_GetString(objv[0]); Tcl_GetCommandInfo(interp, name, &info); info.objClientData = (ClientData) tpg; Tcl_SetCommandInfo(interp, name, &info); } /* Create the window. */ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), Tcl_GetString(objv[1]), NULL); if (tkwin == NULL) { return TCL_ERROR; } Tk_SetClass(tkwin, "Togl"); /* Create Togl data structure */ togl = (Togl *) ckalloc(sizeof (Togl)); if (togl == NULL) { return TCL_ERROR; } /* initialize Togl data structures values */ togl->Next = NULL; #if defined(TOGL_WGL) togl->tglGLHdc = NULL; togl->tglGLHglrc = NULL; togl->tglGLOverlayHglrc = NULL; # ifdef STEREO_I_H togl->pStereoI = NULL; # endif #elif defined(TOGL_X11) togl->GlCtx = NULL; togl->OverlayCtx = NULL; #elif defined(TOGL_AGL) togl->aglCtx = NULL; #endif togl->contextTag = 0; togl->display = Tk_Display(tkwin); togl->TkWin = tkwin; togl->Interp = interp; togl->VisInfo = NULL; togl->OverlayWindow = None; togl->OverlayCmap = None; togl->OverlayTransparentPixel = 0; togl->OverlayIsMapped = False; togl->UpdatePending = False; togl->OverlayUpdatePending = False; togl->tpg = tpg; togl->Client_Data = NULL; /* for EPS Output */ togl->EpsRedMap = togl->EpsGreenMap = togl->EpsBlueMap = NULL; togl->EpsMapSize = 0; #ifndef NO_TK_CURSOR togl->Cursor = None; #endif togl->Width = 0; togl->Height = 0; togl->SetGrid = 0; togl->TimerInterval = 0; togl->RgbaFlag = True; togl->RgbaRed = 1; togl->RgbaGreen = 1; togl->RgbaBlue = 1; togl->DoubleFlag = False; togl->DepthFlag = False; togl->DepthSize = 1; togl->AccumFlag = False; togl->AccumRed = 1; togl->AccumGreen = 1; togl->AccumBlue = 1; togl->AccumAlpha = 1; togl->AlphaFlag = False; togl->AlphaSize = 1; togl->StencilFlag = False; togl->StencilSize = 1; togl->OverlayFlag = False; togl->Stereo = TOGL_STEREO_NONE; togl->AuxNumber = 0; togl->Indirect = False; togl->PixelFormat = 0; togl->SwapInterval = 1; togl->CreateProc = NULL; togl->DisplayProc = NULL; togl->ReshapeProc = NULL; togl->DestroyProc = NULL; togl->TimerProc = NULL; togl->timerHandler = NULL; togl->OverlayDisplayProc = NULL; togl->ShareList = NULL; togl->ShareContext = NULL; togl->Ident = NULL; togl->PrivateCmapFlag = False; togl->currentStereoBuffer = STEREO_BUFFER_NONE; #ifdef HAVE_AUTOSTEREO togl->as_initialized = False; togl->ash = -1; #endif togl->badWindow = False; /* Create command event handler */ togl->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(tkwin), Togl_ObjWidget, (ClientData) togl, ToglCmdDeletedProc); /* * Setup the Tk_ClassProcs callbacks to point at our own window creation * function * * We need to check at runtime if we should use the new Tk_SetClassProcs() * API or if we need to modify the window structure directly */ #ifdef HAVE_TK_SETCLASSPROCS if (SetClassProcsPtr != NULL) { /* use public API (Tk 8.4+) */ Tk_ClassProcs *procsPtr; procsPtr = (Tk_ClassProcs *) ckalloc(sizeof (Tk_ClassProcs)); procsPtr->size = sizeof (Tk_ClassProcs); procsPtr->createProc = Togl_CreateWindow; procsPtr->worldChangedProc = Togl_WorldChanged; procsPtr->modalProc = NULL; /* Tk_SetClassProcs(togl->TkWin, procsPtr, (ClientData) togl); */ (SetClassProcsPtr) (togl->TkWin, procsPtr, (ClientData) togl); } else #endif { /* use private API */ /* * We need to set these fields in the Tk_FakeWin structure: dummy17 = * classProcsPtr dummy18 = instanceData */ TkClassProcs *procsPtr; Tk_FakeWin *winPtr = (Tk_FakeWin *) (togl->TkWin); procsPtr = (TkClassProcs *) ckalloc(sizeof (TkClassProcs)); procsPtr->createProc = Togl_CreateWindow; procsPtr->geometryProc = Togl_WorldChanged; procsPtr->modalProc = NULL; winPtr->dummy17 = (char *) procsPtr; winPtr->dummy18 = (ClientData) togl; } Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask, Togl_EventProc, (ClientData) togl); /* Configure Togl widget */ if (Tk_InitOptions(interp, WIDGREC togl, tpg->optionTable, tkwin) != TCL_OK || Togl_ObjConfigure(interp, togl, objc - 2, objv + 2) != TCL_OK) { goto error; } /* * If OpenGL window wasn't already created by Togl_ObjConfigure() we * create it now. We can tell by checking if the OpenGL context has * been initialized. */ if (! #if defined(TOGL_WGL) togl->tglGLHdc #elif defined(TOGL_X11) togl->GlCtx #elif defined(TOGL_AGL) togl->aglCtx #endif ) { Tk_MakeWindowExist(togl->TkWin); if (Tk_WindowId(togl->TkWin) == DUMMY_WINDOW) { /* Make sure Tk does not try to delete dummy window by creating a * non-OpenGL one (because Tk _really_ doesn't want * Tk_MakeWindowExist to fail). */ togl->badWindow = True; Tk_WindowId(togl->TkWin) = None; Tk_MakeWindowExist(togl->TkWin); goto error; } Togl_MakeCurrent(togl); } if (togl->contextTag == 0) togl->contextTag = ++tpg->nextContextTag; (void) Togl_SwapInterval(togl, togl->SwapInterval); /* If defined, call create callback */ if (togl->CreateProc) { if (Togl_CallCallback(togl, togl->CreateProc) != TCL_OK) { goto error; } } glViewport(0, 0, togl->Width, togl->Height); #if defined(TOGL_X11) if (togl->OverlayFlag) { Togl_UseLayer(togl, TOGL_OVERLAY); glViewport(0, 0, togl->Width, togl->Height); Togl_UseLayer(togl, TOGL_NORMAL); } #endif /* If defined, call reshape proc */ if (togl->ReshapeProc) { if (Togl_CallCallback(togl, togl->ReshapeProc) != TCL_OK) { goto error; } } #if defined(STEREO_I_H) if (togl->Stereo == TOGL_STEREO_NVIDIA_CON) { /* check if driver is installed */ if (!togl->pStereoI && !CreateStereoI(&togl->pStereoI)) { Tcl_AppendResult(interp, NC3D " driver is not installed;" " see ", NULL); goto error; } if (togl->pStereoI->GetStereoState() == STEREO_STATE_DISABLED) { Tcl_AppendResult(interp, NC3D " is disabled." " Please enable it in the driver control panel.", NULL); goto error; } # if 0 /* check if full screen */ if (togl->Width != WidthOfScreen(Tk_Screen(togl->TkWin)) || togl->Height != HeightOfScreen(Tk_Screen(togl->TkWin))) { fprintf(stderr, " not fullscreen %d x %d should be %d x %d\n", togl->Width, togl->Height, WidthOfScreen(Tk_Screen(togl->TkWin)), HeightOfScreen(Tk_Screen(togl->TkWin))); Tcl_AppendResult(interp, NC3D " only works for fullscreen windows.", NULL); goto error; } # endif /* Turn on stereo */ togl->pStereoI->SetStereoState(STEREO_STATE_ON); } #endif Tcl_AppendResult(interp, Tk_PathName(tkwin), NULL); /* Add to linked list */ AddToList(togl); return TCL_OK; error: (void) Tcl_DeleteCommandFromToken(interp, togl->widgetCmd); Tcl_AppendResult(interp, "\nCouldn't configure togl widget", NULL); return TCL_ERROR; } #if TOGL_USE_OVERLAY /* * Do all the setup for overlay planes * Return: TCL_OK or TCL_ERROR */ static int SetupOverlay(Togl *togl) { # if defined(TOGL_X11) # ifdef GLX_TRANSPARENT_TYPE_EXT static int ovAttributeList[] = { GLX_BUFFER_SIZE, 2, GLX_LEVEL, 1, GLX_TRANSPARENT_TYPE_EXT, GLX_TRANSPARENT_INDEX_EXT, None }; # else static int ovAttributeList[] = { GLX_BUFFER_SIZE, 2, GLX_LEVEL, 1, None }; # endif Display *dpy; XVisualInfo *visinfo; TkWindow *winPtr = (TkWindow *) togl->TkWin; XSetWindowAttributes swa; Tcl_HashEntry *hPtr; int new_flag; dpy = Tk_Display(togl->TkWin); visinfo = glXChooseVisual(dpy, Tk_ScreenNumber(winPtr), ovAttributeList); if (!visinfo) { Tcl_AppendResult(togl->Interp, Tk_PathName(winPtr), ": No suitable overlay index visual available", NULL); togl->OverlayCtx = 0; togl->OverlayWindow = 0; togl->OverlayCmap = 0; return TCL_ERROR; } # ifdef GLX_TRANSPARENT_INDEX_EXT { int fail = glXGetConfig(dpy, visinfo, GLX_TRANSPARENT_INDEX_VALUE_EXT, &togl->OverlayTransparentPixel); if (fail) togl->OverlayTransparentPixel = 0; /* maybe, maybe ... */ } # else togl->OverlayTransparentPixel = 0; /* maybe, maybe ... */ # endif /* share display lists with normal layer context */ togl->OverlayCtx = glXCreateContext(dpy, visinfo, togl->GlCtx, !togl->Indirect); swa.colormap = XCreateColormap(dpy, XRootWindow(dpy, visinfo->screen), visinfo->visual, AllocNone); togl->OverlayCmap = swa.colormap; swa.border_pixel = 0; swa.event_mask = ALL_EVENTS_MASK; togl->OverlayWindow = XCreateWindow(dpy, Tk_WindowId(togl->TkWin), 0, 0, togl->Width, togl->Height, 0, visinfo->depth, InputOutput, visinfo->visual, CWBorderPixel | CWColormap | CWEventMask, &swa); hPtr = Tcl_CreateHashEntry(&winPtr->dispPtr->winTable, (const char *) togl->OverlayWindow, &new_flag); Tcl_SetHashValue(hPtr, winPtr); /* XMapWindow( dpy, togl->OverlayWindow ); */ togl->OverlayIsMapped = False; /* Make sure window manager installs our colormap */ XSetWMColormapWindows(dpy, togl->OverlayWindow, &togl->OverlayWindow, 1); return TCL_OK; # elif defined(TOGL_WGL) || defined(TOGL_AGL) /* not yet implemented on these */ return TCL_ERROR; # endif } #endif /* TOGL_USE_OVERLAY */ #ifdef TOGL_WGL # define TOGL_CLASS_NAME "Togl Class" static Bool ToglClassInitialized = False; static LRESULT CALLBACK Win32WinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { LONG result; Togl *togl = (Togl *) GetWindowLongPtr(hwnd, 0); WNDCLASS childClass; switch (message) { case WM_WINDOWPOSCHANGED: /* Should be processed by DefWindowProc, otherwise a double buffered * context is not properly resized when the corresponding window is * resized. */ break; case WM_DESTROY: if (togl && togl->TkWin != NULL) { if (togl->SetGrid > 0) { Tk_UnsetGrid(togl->TkWin); } (void) Tcl_DeleteCommandFromToken(togl->Interp, togl->widgetCmd); } break; case WM_ERASEBKGND: /* We clear our own window */ return 1; default: # if USE_STATIC_LIB return TkWinChildProc(hwnd, message, wParam, lParam); # else /* * OK, since TkWinChildProc is not explicitly exported in the * dynamic libraries, we have to retrieve it from the class info * registered with windows. * */ if (tkWinChildProc == NULL) { GetClassInfo(Tk_GetHINSTANCE(), TK_WIN_CHILD_CLASS_NAME, &childClass); tkWinChildProc = childClass.lpfnWndProc; } return tkWinChildProc(hwnd, message, wParam, lParam); # endif } result = DefWindowProc(hwnd, message, wParam, lParam); Tcl_ServiceAll(); return result; } #endif /* TOGL_WGL */ /* * Togl_CreateWindow * * Window creation function, invoked as a callback from Tk_MakeWindowExist. * Creates an OpenGL window for the Togl widget. */ static Window Togl_CreateWindow(Tk_Window tkwin, Window parent, ClientData instanceData) { Togl *togl = (Togl *) instanceData; XVisualInfo *visinfo = NULL; Display *dpy; Colormap cmap; int scrnum; Window window; #if defined(TOGL_X11) Bool directCtx = True; int attrib_list[1000]; int attrib_count; int dummy; XSetWindowAttributes swa; # define MAX_ATTEMPTS 12 static int ci_depths[MAX_ATTEMPTS] = { 8, 4, 2, 1, 12, 16, 8, 4, 2, 1, 12, 16 }; static int dbl_flags[MAX_ATTEMPTS] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1 }; #elif defined(TOGL_WGL) HWND hwnd, parentWin; int pixelformat; HINSTANCE hInstance; WNDCLASS ToglClass; PIXELFORMATDESCRIPTOR pfd; #elif defined(TOGL_AGL) GLint attribs[20]; int na; AGLPixelFormat fmt; #endif /* TOGL_X11 */ if (togl->badWindow) { TkWindow *winPtr = (TkWindow *) tkwin; window = TkpMakeWindow(winPtr, parent); return window; } dpy = Tk_Display(tkwin); #if defined(TOGL_X11) /* Make sure OpenGL's GLX extension supported */ if (!glXQueryExtension(dpy, &dummy, &dummy)) { Tcl_SetResult(togl->Interp, TCL_STUPID "X server has no OpenGL GLX extension", TCL_STATIC); return DUMMY_WINDOW; } if (togl->ShareContext && FindTogl(togl, togl->ShareContext)) { /* share OpenGL context with existing Togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareContext); assert(shareWith != NULL); assert(shareWith->GlCtx != NULL); togl->GlCtx = shareWith->GlCtx; togl->contextTag = shareWith->contextTag; togl->VisInfo = shareWith->VisInfo; visinfo = togl->VisInfo; } else { if (togl->PixelFormat) { XVisualInfo template; int count = 1; int stereo = 0; template.visualid = togl->PixelFormat; visinfo = XGetVisualInfo(dpy, VisualIDMask, &template, &count); if (visinfo == NULL) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose pixel format", TCL_STATIC); return DUMMY_WINDOW; } /* fill in flags normally passed in that affect behavior */ (void) glXGetConfig(dpy, visinfo, GLX_RGBA, &togl->RgbaFlag); (void) glXGetConfig(dpy, visinfo, GLX_DOUBLEBUFFER, &togl->DoubleFlag); (void) glXGetConfig(dpy, visinfo, GLX_STEREO, &stereo); if (stereo) togl->Stereo = TOGL_STEREO_NATIVE; else togl->Stereo = TOGL_STEREO_NONE; } else { int attempt; /* It may take a few tries to get a visual */ for (attempt = 0; attempt < MAX_ATTEMPTS; attempt++) { attrib_count = 0; attrib_list[attrib_count++] = GLX_USE_GL; if (togl->RgbaFlag) { /* RGB[A] mode */ attrib_list[attrib_count++] = GLX_RGBA; attrib_list[attrib_count++] = GLX_RED_SIZE; attrib_list[attrib_count++] = togl->RgbaRed; attrib_list[attrib_count++] = GLX_GREEN_SIZE; attrib_list[attrib_count++] = togl->RgbaGreen; attrib_list[attrib_count++] = GLX_BLUE_SIZE; attrib_list[attrib_count++] = togl->RgbaBlue; if (togl->AlphaFlag) { attrib_list[attrib_count++] = GLX_ALPHA_SIZE; attrib_list[attrib_count++] = togl->AlphaSize; } /* for EPS Output */ if (togl->EpsRedMap) free(togl->EpsRedMap); if (togl->EpsGreenMap) free(togl->EpsGreenMap); if (togl->EpsBlueMap) free(togl->EpsBlueMap); togl->EpsRedMap = togl->EpsGreenMap = togl->EpsBlueMap = NULL; togl->EpsMapSize = 0; } else { /* Color index mode */ int depth; attrib_list[attrib_count++] = GLX_BUFFER_SIZE; depth = ci_depths[attempt]; attrib_list[attrib_count++] = depth; } if (togl->DepthFlag) { attrib_list[attrib_count++] = GLX_DEPTH_SIZE; attrib_list[attrib_count++] = togl->DepthSize; } if (togl->DoubleFlag || dbl_flags[attempt]) { attrib_list[attrib_count++] = GLX_DOUBLEBUFFER; } if (togl->StencilFlag) { attrib_list[attrib_count++] = GLX_STENCIL_SIZE; attrib_list[attrib_count++] = togl->StencilSize; } if (togl->AccumFlag) { attrib_list[attrib_count++] = GLX_ACCUM_RED_SIZE; attrib_list[attrib_count++] = togl->AccumRed; attrib_list[attrib_count++] = GLX_ACCUM_GREEN_SIZE; attrib_list[attrib_count++] = togl->AccumGreen; attrib_list[attrib_count++] = GLX_ACCUM_BLUE_SIZE; attrib_list[attrib_count++] = togl->AccumBlue; if (togl->AlphaFlag) { attrib_list[attrib_count++] = GLX_ACCUM_ALPHA_SIZE; attrib_list[attrib_count++] = togl->AccumAlpha; } } if (togl->AuxNumber != 0) { attrib_list[attrib_count++] = GLX_AUX_BUFFERS; attrib_list[attrib_count++] = togl->AuxNumber; } if (togl->Indirect) { directCtx = False; } if (togl->Stereo == TOGL_STEREO_NATIVE) { attrib_list[attrib_count++] = GLX_STEREO; } attrib_list[attrib_count++] = None; visinfo = glXChooseVisual(dpy, Tk_ScreenNumber(tkwin), attrib_list); if (visinfo) { /* found a GLX visual! */ break; } } togl->VisInfo = visinfo; if (visinfo == NULL) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose pixel format", TCL_STATIC); return DUMMY_WINDOW; } } /* * Create a new OpenGL rendering context. */ if (togl->ShareList) { /* share display lists with existing togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareList); GLXContext shareCtx; if (shareWith) { shareCtx = shareWith->GlCtx; togl->contextTag = shareWith->contextTag; } else { shareCtx = None; } togl->GlCtx = glXCreateContext(dpy, visinfo, shareCtx, directCtx); } else { /* don't share display lists */ togl->GlCtx = glXCreateContext(dpy, visinfo, None, directCtx); } if (togl->GlCtx == NULL) { Tcl_SetResult(togl->Interp, TCL_STUPID "could not create rendering context", TCL_STATIC); return DUMMY_WINDOW; } } #endif /* TOGL_X11 */ #ifdef TOGL_WGL parentWin = Tk_GetHWND(parent); hInstance = Tk_GetHINSTANCE(); if (!ToglClassInitialized) { ToglClassInitialized = True; ToglClass.style = CS_HREDRAW | CS_VREDRAW; ToglClass.cbClsExtra = 0; ToglClass.cbWndExtra = sizeof (LONG_PTR); /* to save Togl* */ ToglClass.hInstance = hInstance; ToglClass.hbrBackground = NULL; ToglClass.lpszMenuName = NULL; ToglClass.lpszClassName = TOGL_CLASS_NAME; ToglClass.lpfnWndProc = Win32WinProc; ToglClass.hIcon = NULL; ToglClass.hCursor = NULL; if (!RegisterClass(&ToglClass)) { Tcl_SetResult(togl->Interp, TCL_STUPID "unable register Togl window class", TCL_STATIC); return DUMMY_WINDOW; } } hwnd = CreateWindow(TOGL_CLASS_NAME, NULL, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, togl->Width, togl->Height, parentWin, NULL, hInstance, NULL); SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); togl->tglGLHdc = GetDC(hwnd); pfd.nSize = sizeof (PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_SUPPORT_COMPOSITION; if (togl->DoubleFlag) { pfd.dwFlags |= PFD_DOUBLEBUFFER; } /* The stereo flag is not supported in the generic OpenGL implementation, * but may be supported by specific hardware devices. */ if (togl->Stereo == TOGL_STEREO_NATIVE) { pfd.dwFlags |= PFD_STEREO; } if (togl->PixelFormat) { pixelformat = togl->PixelFormat; } else { pfd.cColorBits = togl->RgbaRed + togl->RgbaGreen + togl->RgbaBlue; pfd.iPixelType = togl->RgbaFlag ? PFD_TYPE_RGBA : PFD_TYPE_COLORINDEX; /* Alpha bitplanes are not supported in the current generic OpenGL * implementation, but may be supported by specific hardware devices. */ pfd.cAlphaBits = togl->AlphaFlag ? togl->AlphaSize : 0; pfd.cAccumBits = togl->AccumFlag ? (togl->AccumRed + togl->AccumGreen + togl->AccumBlue + togl->AccumAlpha) : 0; pfd.cDepthBits = togl->DepthFlag ? togl->DepthSize : 0; pfd.cStencilBits = togl->StencilFlag ? togl->StencilSize : 0; /* Auxiliary buffers are not supported in the current generic OpenGL * implementation, but may be supported by specific hardware devices. */ pfd.cAuxBuffers = togl->AuxNumber; pfd.iLayerType = PFD_MAIN_PLANE; if ((pixelformat = ChoosePixelFormat(togl->tglGLHdc, &pfd)) == 0) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose pixel format", TCL_STATIC); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; DestroyWindow(hwnd); return DUMMY_WINDOW; } } if (SetPixelFormat(togl->tglGLHdc, pixelformat, &pfd) == FALSE) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose pixel format", TCL_STATIC); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; DestroyWindow(hwnd); return DUMMY_WINDOW; } /* Get the actual pixel format */ DescribePixelFormat(togl->tglGLHdc, pixelformat, sizeof (pfd), &pfd); if (togl->PixelFormat) { /* fill in flags normally passed in that affect behavior */ togl->RgbaFlag = pfd.iPixelType == PFD_TYPE_RGBA; togl->DoubleFlag = pfd.cDepthBits > 0; if ((pfd.dwFlags & PFD_STEREO) != 0) togl->Stereo = TOGL_STEREO_NATIVE; else togl->Stereo = TOGL_STEREO_NONE; /* TODO: set depth flag, and more */ } else if (togl->Stereo == TOGL_STEREO_NATIVE && (pfd.dwFlags & PFD_STEREO) == 0) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose stereo pixel format", TCL_STATIC); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; DestroyWindow(hwnd); return DUMMY_WINDOW; } if (togl->ShareContext && FindTogl(togl, togl->ShareContext)) { /* share OpenGL context with existing Togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareContext); assert(shareWith); assert(shareWith->tglGLHglrc); togl->tglGLHglrc = shareWith->tglGLHglrc; togl->contextTag = shareWith->contextTag; togl->VisInfo = shareWith->VisInfo; visinfo = togl->VisInfo; } else { /* * Create a new OpenGL rendering context. And check to share lists. */ togl->tglGLHglrc = wglCreateContext(togl->tglGLHdc); if (togl->ShareList) { /* share display lists with existing togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareList); if (shareWith) { if (!wglShareLists(shareWith->tglGLHglrc, togl->tglGLHglrc)) { # if 0 LPVOID lpMsgBuf; DWORD err = GetLastError(); FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); fprintf(stderr, "unable to share display lists: %d: %s\n", err, lpMsgBuf); LocalFree(lpMsgBuf); # endif Tcl_SetResult(togl->Interp, TCL_STUPID "unable to share display lists", TCL_STATIC); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; DestroyWindow(hwnd); return DUMMY_WINDOW; } togl->contextTag = shareWith->contextTag; } } if (!togl->tglGLHglrc) { Tcl_SetResult(togl->Interp, TCL_STUPID "could not create rendering context", TCL_STATIC); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; DestroyWindow(hwnd); return DUMMY_WINDOW; } /* Just for portability, define the simplest visinfo */ visinfo = (XVisualInfo *) malloc(sizeof (XVisualInfo)); visinfo->visual = DefaultVisual(dpy, DefaultScreen(dpy)); visinfo->depth = visinfo->visual->bits_per_rgb; togl->VisInfo = visinfo; } SetWindowLongPtr(hwnd, 0, (LONG_PTR) togl); #endif /* TOGL_WGL */ /* for TOGL_AGL, we create the window first, then choose the pixel format */ /* * find a colormap */ scrnum = Tk_ScreenNumber(tkwin); if (togl->RgbaFlag) { /* Colormap for RGB mode */ #if defined(TOGL_X11) cmap = get_rgb_colormap(dpy, scrnum, visinfo, tkwin); #elif defined(TOGL_WGL) if (pfd.dwFlags & PFD_NEED_PALETTE) { cmap = Win32CreateRgbColormap(pfd); } else { cmap = DefaultColormap(dpy, scrnum); } /* for EPS Output */ if (togl->EpsRedMap) free(togl->EpsRedMap); if (togl->EpsGreenMap) free(togl->EpsGreenMap); if (togl->EpsBlueMap) free(togl->EpsBlueMap); togl->EpsRedMap = togl->EpsGreenMap = togl->EpsBlueMap = NULL; togl->EpsMapSize = 0; #elif defined(TOGL_AGL) cmap = DefaultColormap(dpy, scrnum); /* for EPS Output */ if (togl->EpsRedMap) free(togl->EpsRedMap); if (togl->EpsGreenMap) free(togl->EpsGreenMap); if (togl->EpsBlueMap) free(togl->EpsBlueMap); togl->EpsRedMap = togl->EpsGreenMap = togl->EpsBlueMap = NULL; togl->EpsMapSize = 0; #endif } else { /* Colormap for CI mode */ #ifdef TOGL_WGL /* this logic is to overcome a combination driver/compiler bug: 1. * cColorBits may be unusally large (e.g., 32 instead of 8 or 12) 2. 1 * << 32 might be 1 instead of zero (gcc for ia32) */ if (pfd.cColorBits >= MAX_CI_COLORMAP_BITS) { togl->CiColormapSize = MAX_CI_COLORMAP_SIZE; } else { togl->CiColormapSize = 1 << pfd.cColorBits; if (togl->CiColormapSize >= MAX_CI_COLORMAP_SIZE) togl->CiColormapSize = MAX_CI_COLORMAP_SIZE; } #endif if (togl->PrivateCmapFlag) { /* need read/write colormap so user can store own color entries */ #if defined(TOGL_X11) cmap = XCreateColormap(dpy, XRootWindow(dpy, visinfo->screen), visinfo->visual, AllocAll); #elif defined(TOGL_WGL) cmap = Win32CreateCiColormap(togl); #elif defined(TOGL_AGL) /* need to figure out how to do this correctly on Mac... */ cmap = DefaultColormap(dpy, scrnum); #endif } else { if (visinfo->visual == DefaultVisual(dpy, scrnum)) { /* share default/root colormap */ cmap = Tk_Colormap(tkwin); } else { /* make a new read-only colormap */ cmap = XCreateColormap(dpy, XRootWindow(dpy, visinfo->screen), visinfo->visual, AllocNone); } } } #if !defined(TOGL_AGL) /* Make sure Tk knows to switch to the new colormap when the cursor is over * this window when running in color index mode. */ (void) Tk_SetWindowVisual(tkwin, visinfo->visual, visinfo->depth, cmap); #endif #ifdef TOGL_WGL /* Install the colormap */ SelectPalette(togl->tglGLHdc, ((TkWinColormap *) cmap)->palette, TRUE); RealizePalette(togl->tglGLHdc); #endif #if defined(TOGL_X11) swa.colormap = cmap; swa.border_pixel = 0; swa.event_mask = ALL_EVENTS_MASK; window = XCreateWindow(dpy, parent, 0, 0, togl->Width, togl->Height, 0, visinfo->depth, InputOutput, visinfo->visual, CWBorderPixel | CWColormap | CWEventMask, &swa); /* Make sure window manager installs our colormap */ (void) XSetWMColormapWindows(dpy, window, &window, 1); #elif defined(TOGL_WGL) window = Tk_AttachHWND(tkwin, hwnd); #elif defined(TOGL_AGL) { TkWindow *winPtr = (TkWindow *) tkwin; window = TkpMakeWindow(winPtr, parent); } #endif #if TOGL_USE_OVERLAY if (togl->OverlayFlag) { if (SetupOverlay(togl) == TCL_ERROR) { fprintf(stderr, "Warning: couldn't setup overlay.\n"); togl->OverlayFlag = False; } } #endif /* Request the X window to be displayed */ (void) XMapWindow(dpy, window); #if defined(TOGL_AGL) if (togl->ShareContext && FindTogl(togl, togl->ShareContext)) { /* share OpenGL context with existing Togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareContext); assert(shareWith); assert(shareWith->aglCtx); togl->aglCtx = shareWith->aglCtx; togl->contextTag = shareWith->contextTag; togl->VisInfo = shareWith->VisInfo; visinfo = togl->VisInfo; } else { AGLContext shareCtx = NULL; if (togl->PixelFormat) { /* fill in RgbaFlag, DoubleFlag, and Stereo */ fmt = (AGLPixelFormat) togl->PixelFormat; GLint has_rgba, has_doublebuf, has_stereo; if (aglDescribePixelFormat(fmt, AGL_RGBA, &has_rgba) && aglDescribePixelFormat(fmt, AGL_DOUBLEBUFFER, &has_doublebuf) && aglDescribePixelFormat(fmt, AGL_STEREO, &has_stereo)) { togl->RgbaFlag = (has_rgba ? True : False); togl->DoubleFlag = (has_doublebuf ? True : False); togl->Stereo = (has_stereo ? TOGL_STEREO_NATIVE : TOGL_STEREO_NONE); } else { Tcl_SetResult(togl->Interp, TCL_STUPID "failed querying pixel format attributes", TCL_STATIC); return DUMMY_WINDOW; } } else { /* Need to do this after mapping window, so MacDrawable structure * is more completely filled in */ na = 0; attribs[na++] = AGL_MINIMUM_POLICY; /* ask for hardware-accelerated onscreen */ attribs[na++] = AGL_ACCELERATED; attribs[na++] = AGL_NO_RECOVERY; if (togl->RgbaFlag) { /* RGB[A] mode */ attribs[na++] = AGL_RGBA; attribs[na++] = AGL_RED_SIZE; attribs[na++] = togl->RgbaRed; attribs[na++] = AGL_GREEN_SIZE; attribs[na++] = togl->RgbaGreen; attribs[na++] = AGL_BLUE_SIZE; attribs[na++] = togl->RgbaBlue; if (togl->AlphaFlag) { attribs[na++] = AGL_ALPHA_SIZE; attribs[na++] = togl->AlphaSize; } } else { /* Color index mode */ attribs[na++] = AGL_BUFFER_SIZE; attribs[na++] = 8; } if (togl->DepthFlag) { attribs[na++] = AGL_DEPTH_SIZE; attribs[na++] = togl->DepthSize; } if (togl->DoubleFlag) { attribs[na++] = AGL_DOUBLEBUFFER; } if (togl->StencilFlag) { attribs[na++] = AGL_STENCIL_SIZE; attribs[na++] = togl->StencilSize; } if (togl->AccumFlag) { attribs[na++] = AGL_ACCUM_RED_SIZE; attribs[na++] = togl->AccumRed; attribs[na++] = AGL_ACCUM_GREEN_SIZE; attribs[na++] = togl->AccumGreen; attribs[na++] = AGL_ACCUM_BLUE_SIZE; attribs[na++] = togl->AccumBlue; if (togl->AlphaFlag) { attribs[na++] = AGL_ACCUM_ALPHA_SIZE; attribs[na++] = togl->AccumAlpha; } } if (togl->AuxNumber != 0) { attribs[na++] = AGL_AUX_BUFFERS; attribs[na++] = togl->AuxNumber; } if (togl->Stereo == TOGL_STEREO_NATIVE) { attribs[na++] = AGL_STEREO; } attribs[na++] = AGL_NONE; if ((fmt = aglChoosePixelFormat(NULL, 0, attribs)) == NULL) { Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't choose pixel format", TCL_STATIC); return DUMMY_WINDOW; } } /* * Check whether to share lists. */ if (togl->ShareList) { /* share display lists with existing togl widget */ Togl *shareWith = FindTogl(togl, togl->ShareList); if (shareWith) { shareCtx = shareWith->aglCtx; togl->contextTag = shareWith->contextTag; } } if ((togl->aglCtx = aglCreateContext(fmt, shareCtx)) == NULL) { GLenum err = aglGetError(); aglDestroyPixelFormat(fmt); if (err == AGL_BAD_MATCH) Tcl_SetResult(togl->Interp, TCL_STUPID "unable to share display lists" ": shared context doesn't match", TCL_STATIC); else if (err == AGL_BAD_CONTEXT) Tcl_SetResult(togl->Interp, TCL_STUPID "unable to share display lists" ": bad shared context", TCL_STATIC); else if (err == AGL_BAD_PIXELFMT) Tcl_SetResult(togl->Interp, TCL_STUPID "could not create rendering context" ": bad pixel format", TCL_STATIC); else Tcl_SetResult(togl->Interp, TCL_STUPID "could not create rendering context" ": unknown reason", TCL_STATIC); return DUMMY_WINDOW; } aglDestroyPixelFormat(fmt); if (!aglSetDrawable(togl->aglCtx, ((MacDrawable *) (window))->toplevel->grafPtr)) { aglDestroyContext(togl->aglCtx); Tcl_SetResult(togl->Interp, TCL_STUPID "couldn't set drawable", TCL_STATIC); return DUMMY_WINDOW; } /* Just for portability, define the simplest visinfo */ visinfo = (XVisualInfo *) malloc(sizeof (XVisualInfo)); visinfo->visual = DefaultVisual(dpy, DefaultScreen(dpy)); visinfo->depth = visinfo->visual->bits_per_rgb; Tk_SetWindowVisual(tkwin, visinfo->visual, visinfo->depth, cmap); } #endif /* TOGL_AGL */ #if defined(TOGL_X11) /* Check for a single/double buffering snafu */ { int dbl_flag; if (glXGetConfig(dpy, visinfo, GLX_DOUBLEBUFFER, &dbl_flag)) { if (!togl->DoubleFlag && dbl_flag) { /* We requested single buffering but had to accept a */ /* double buffered visual. Set the GL draw buffer to */ /* be the front buffer to simulate single buffering. */ glDrawBuffer(GL_FRONT); } } } #endif /* for EPS Output */ if (!togl->RgbaFlag) { int index_size; #if defined(TOGL_X11) || defined(TOGL_AGL) GLint index_bits; glGetIntegerv(GL_INDEX_BITS, &index_bits); index_size = 1 << index_bits; #elif defined(TOGL_WGL) index_size = togl->CiColormapSize; #endif /* TOGL_X11 */ if (togl->EpsMapSize != index_size) { if (togl->EpsRedMap) free(togl->EpsRedMap); if (togl->EpsGreenMap) free(togl->EpsGreenMap); if (togl->EpsBlueMap) free(togl->EpsBlueMap); togl->EpsMapSize = index_size; togl->EpsRedMap = (GLfloat *) calloc(index_size, sizeof (GLfloat)); togl->EpsGreenMap = (GLfloat *) calloc(index_size, sizeof (GLfloat)); togl->EpsBlueMap = (GLfloat *) calloc(index_size, sizeof (GLfloat)); } } #ifdef HAVE_AUTOSTEREO if (togl->Stereo == TOGL_STEREO_NATIVE) { if (!togl->as_initialized) { const char *autostereod; togl->as_initialized = True; if ((autostereod = getenv("AUTOSTEREOD")) == NULL) autostereod = AUTOSTEREOD; if (autostereod && *autostereod) { if (ASInitialize(togl->display, autostereod) == Success) { togl->ash = ASCreatedStereoWindow(dpy); } } } else { togl->ash = ASCreatedStereoWindow(dpy); } } #endif return window; } /* * Togl_WorldChanged * * Add support for setgrid option. */ static void Togl_WorldChanged(ClientData instanceData) { Togl *togl = (Togl *) instanceData; Tk_GeometryRequest(togl->TkWin, togl->Width, togl->Height); Tk_SetInternalBorder(togl->TkWin, 0); if (togl->SetGrid > 0) { Tk_SetGrid(togl->TkWin, togl->Width / togl->SetGrid, togl->Height / togl->SetGrid, togl->SetGrid, togl->SetGrid); } else { Tk_UnsetGrid(togl->TkWin); } } /* * ToglFree * * Wrap the ckfree macro. */ static void ToglFree(char *clientData) { ckfree(clientData); } /* * ToglCmdDeletedProc * * This procedure is invoked when a widget command is deleted. If * the widget isn't already in the process of being destroyed, * this command destroys it. * * Results: * None. * * Side effects: * The widget is destroyed. * *---------------------------------------------------------------------- */ static void ToglCmdDeletedProc(ClientData clientData) { Togl *togl = (Togl *) clientData; Tk_Window tkwin = togl->TkWin; /* * This procedure could be invoked either because the window was * destroyed and the command was then deleted (in which case tkwin * is NULL) or because the command was deleted, and then this procedure * destroys the widget. */ if (tkwin) { Tk_DeleteEventHandler(tkwin, ExposureMask | StructureNotifyMask, Togl_EventProc, (ClientData) togl); } Tk_Preserve((ClientData) togl); Tcl_EventuallyFree((ClientData) togl, ToglFree); Togl_LeaveStereo(togl, togl->Stereo); if (togl->DestroyProc) { /* call user's cleanup code */ Togl_CallCallback(togl, togl->DestroyProc); } if (togl->TimerProc != NULL) { Tcl_DeleteTimerHandler(togl->timerHandler); togl->timerHandler = NULL; } if (togl->UpdatePending) { Tcl_CancelIdleCall(Togl_Render, (ClientData) togl); togl->UpdatePending = False; } #ifndef NO_TK_CURSOR if (togl->Cursor != None) { Tk_FreeCursor(togl->display, togl->Cursor); togl->Cursor = None; } #endif /* remove from linked list */ RemoveFromList(togl); togl->TkWin = NULL; if (tkwin != NULL && Tk_WindowId(tkwin) != DUMMY_WINDOW) { #if defined(TOGL_X11) if (togl->GlCtx) { if (FindToglWithSameContext(togl) == NULL) glXDestroyContext(togl->display, togl->GlCtx); togl->GlCtx = NULL; } # if TOGL_USE_OVERLAY if (togl->OverlayCtx) { Tcl_HashEntry *entryPtr; TkWindow *winPtr = (TkWindow *) tkwin; if (winPtr) { entryPtr = Tcl_FindHashEntry(&winPtr->dispPtr->winTable, (const char *) togl->OverlayWindow); Tcl_DeleteHashEntry(entryPtr); } if (FindToglWithSameOverlayContext(togl) == NULL) glXDestroyContext(togl->display, togl->OverlayCtx); togl->OverlayCtx = NULL; } # endif /* TOGL_USE_OVERLAY */ #endif #if defined(TOGL_WGL) if (togl->tglGLHglrc) { if (FindToglWithSameContext(togl) == NULL) wglDeleteContext(togl->tglGLHglrc); togl->tglGLHglrc = NULL; } if (tkwin && togl->tglGLHdc) { HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); ReleaseDC(hwnd, togl->tglGLHdc); togl->tglGLHdc = NULL; } #endif /* TODO: delete contexts on other platforms */ if (togl->SetGrid > 0) { Tk_UnsetGrid(tkwin); } Tk_DestroyWindow(tkwin); } Tk_Release((ClientData) togl); } /* * This gets called to handle Togl window configuration events */ static void Togl_EventProc(ClientData clientData, XEvent *eventPtr) { Togl *togl = (Togl *) clientData; switch (eventPtr->type) { case Expose: if (eventPtr->xexpose.count == 0) { if (!togl->UpdatePending && eventPtr->xexpose.window == Tk_WindowId(togl->TkWin)) { Togl_PostRedisplay(togl); } #if defined(TOGL_X11) if (!togl->OverlayUpdatePending && togl->OverlayFlag && togl->OverlayIsMapped && eventPtr->xexpose.window == togl->OverlayWindow) { Togl_PostOverlayRedisplay(togl); } #endif } break; case ConfigureNotify: if (togl->Width != Tk_Width(togl->TkWin) || togl->Height != Tk_Height(togl->TkWin)) { togl->Width = Tk_Width(togl->TkWin); togl->Height = Tk_Height(togl->TkWin); (void) XResizeWindow(Tk_Display(togl->TkWin), Tk_WindowId(togl->TkWin), togl->Width, togl->Height); #if defined(TOGL_X11) if (togl->OverlayFlag) { (void) XResizeWindow(Tk_Display(togl->TkWin), togl->OverlayWindow, togl->Width, togl->Height); (void) XRaiseWindow(Tk_Display(togl->TkWin), togl->OverlayWindow); } #endif Togl_MakeCurrent(togl); glViewport(0, 0, togl->Width, togl->Height); #if defined(TOGL_X11) if (togl->OverlayFlag) { Togl_UseLayer(togl, TOGL_OVERLAY); glViewport(0, 0, togl->Width, togl->Height); Togl_UseLayer(togl, TOGL_NORMAL); } #endif if (togl->ReshapeProc) { Togl_CallCallback(togl, togl->ReshapeProc); } #ifndef TOGL_WGL /* causes double redisplay on Win32 platform */ Togl_PostRedisplay(togl); #endif } break; case MapNotify: #if defined(TOGL_AGL) { /* * See comment for the UnmapNotify case below. */ AGLDrawable d = TkMacOSXGetDrawablePort(Tk_WindowId(togl->TkWin)); aglSetDrawable(togl->aglCtx, d); } #endif break; case UnmapNotify: #if defined(TOGL_AGL) { /* * For Mac OS X Aqua, Tk subwindows are not implemented as * separate Aqua windows. They are just different regions of * a single Aqua window. To unmap them they are just not drawn. * Have to disconnect the AGL context otherwise they will continue * to be displayed directly by Aqua. */ aglSetDrawable(togl->aglCtx, NULL); } #endif break; case DestroyNotify: if (togl->TkWin != NULL) { if (togl->SetGrid > 0) { Tk_UnsetGrid(togl->TkWin); } (void) Tcl_DeleteCommandFromToken(togl->Interp, togl->widgetCmd); } break; default: /* nothing */ ; } } void Togl_PostRedisplay(Togl *togl) { if (!togl->UpdatePending) { togl->UpdatePending = True; Tk_DoWhenIdle(Togl_Render, (ClientData) togl); } } Bool Togl_UpdatePending(const Togl *togl) { return togl->UpdatePending; } void Togl_SwapBuffers(const Togl *togl) { if (togl->DoubleFlag) { #if defined(TOGL_WGL) int res = SwapBuffers(togl->tglGLHdc); if (!res) { ErrorExit(TEXT("SwapBuffers")); } #elif defined(TOGL_X11) glXSwapBuffers(Tk_Display(togl->TkWin), Tk_WindowId(togl->TkWin)); #elif defined(TOGL_AGL) aglSwapBuffers(togl->aglCtx); #endif } else { glFlush(); } } const char * Togl_Ident(const Togl *togl) { return togl->Ident; } int Togl_Width(const Togl *togl) { return togl->Width; } int Togl_Height(const Togl *togl) { return togl->Height; } Tcl_Interp * Togl_Interp(const Togl *togl) { return togl->Interp; } Tk_Window Togl_TkWin(const Togl *togl) { return togl->TkWin; } const char * Togl_CommandName(const Togl *togl) { return Tcl_GetCommandName(togl->Interp, togl->widgetCmd); } int Togl_ContextTag(const Togl *togl) { return togl->contextTag; } #if defined(TOGL_X11) /* * A replacement for XAllocColor. This function should never * fail to allocate a color. When XAllocColor fails, we return * the nearest matching color. If we have to allocate many colors * this function isn't too efficient; the XQueryColors() could be * done just once. * Written by Michael Pichler, Brian Paul, Mark Kilgard * Input: dpy - X display * cmap - X colormap * cmapSize - size of colormap * In/Out: color - the XColor struct * Output: exact - 1=exact color match, 0=closest match */ static void noFaultXAllocColor(Display *dpy, Colormap cmap, int cmapSize, XColor *color, int *exact) { XColor *ctable, subColor; int i, bestmatch; double mindist; /* 3*2^16^2 exceeds long int precision. */ /* First try just using XAllocColor. */ if (XAllocColor(dpy, cmap, color)) { *exact = 1; return; } /* Retrieve color table entries. */ /* XXX alloca candidate. */ ctable = (XColor *) ckalloc(cmapSize * sizeof (XColor)); for (i = 0; i < cmapSize; i++) { ctable[i].pixel = i; } (void) XQueryColors(dpy, cmap, ctable, cmapSize); /* Find best match. */ bestmatch = -1; mindist = 0; for (i = 0; i < cmapSize; i++) { double dr = (double) color->red - (double) ctable[i].red; double dg = (double) color->green - (double) ctable[i].green; double db = (double) color->blue - (double) ctable[i].blue; double dist = dr * dr + dg * dg + db * db; if (bestmatch < 0 || dist < mindist) { bestmatch = i; mindist = dist; } } /* Return result. */ subColor.red = ctable[bestmatch].red; subColor.green = ctable[bestmatch].green; subColor.blue = ctable[bestmatch].blue; ckfree((char *) ctable); /* Try to allocate the closest match color. This should only fail if the * cell is read/write. Otherwise, we're incrementing the cell's reference * count. */ if (!XAllocColor(dpy, cmap, &subColor)) { /* do this to work around a problem reported by Frank Ortega */ subColor.pixel = (unsigned long) bestmatch; subColor.red = ctable[bestmatch].red; subColor.green = ctable[bestmatch].green; subColor.blue = ctable[bestmatch].blue; subColor.flags = DoRed | DoGreen | DoBlue; } *color = subColor; } #elif defined(TOGL_WGL) static UINT Win32AllocColor(const Togl *togl, float red, float green, float blue) { /* Modified version of XAllocColor emulation of Tk. - returns index, * instead of color itself - allocates logical palette entry even for * non-palette devices */ TkWinColormap *cmap = (TkWinColormap *) Tk_Colormap(togl->TkWin); UINT index; COLORREF newColor, closeColor; PALETTEENTRY entry, closeEntry; int isNew, refCount; Tcl_HashEntry *entryPtr; entry.peRed = (unsigned char) (red * 255 + .5); entry.peGreen = (unsigned char) (green * 255 + .5); entry.peBlue = (unsigned char) (blue * 255 + .5); entry.peFlags = 0; /* * Find the nearest existing palette entry. */ newColor = RGB(entry.peRed, entry.peGreen, entry.peBlue); index = GetNearestPaletteIndex(cmap->palette, newColor); GetPaletteEntries(cmap->palette, index, 1, &closeEntry); closeColor = RGB(closeEntry.peRed, closeEntry.peGreen, closeEntry.peBlue); /* * If this is not a duplicate and colormap is not full, allocate a new entry. */ if (newColor != closeColor) { if (cmap->size == (unsigned int) togl->CiColormapSize) { entry = closeEntry; } else { cmap->size++; ResizePalette(cmap->palette, cmap->size); index = cmap->size - 1; SetPaletteEntries(cmap->palette, index, 1, &entry); SelectPalette(togl->tglGLHdc, cmap->palette, TRUE); RealizePalette(togl->tglGLHdc); } } newColor = PALETTERGB(entry.peRed, entry.peGreen, entry.peBlue); entryPtr = Tcl_CreateHashEntry(&cmap->refCounts, (CONST char *) newColor, &isNew); if (isNew) { refCount = 1; } else { refCount = ((int) Tcl_GetHashValue(entryPtr)) + 1; } Tcl_SetHashValue(entryPtr, (ClientData) refCount); /* for EPS output */ togl->EpsRedMap[index] = (GLfloat) (entry.peRed / 255.0); togl->EpsGreenMap[index] = (GLfloat) (entry.peGreen / 255.0); togl->EpsBlueMap[index] = (GLfloat) (entry.peBlue / 255.0); return index; } static void Win32FreeColor(const Togl *togl, unsigned long index) { TkWinColormap *cmap = (TkWinColormap *) Tk_Colormap(togl->TkWin); COLORREF cref; UINT count, refCount; PALETTEENTRY entry, *entries; Tcl_HashEntry *entryPtr; if (index >= cmap->size) { panic("Tried to free a color that isn't allocated."); } GetPaletteEntries(cmap->palette, index, 1, &entry); cref = PALETTERGB(entry.peRed, entry.peGreen, entry.peBlue); entryPtr = Tcl_FindHashEntry(&cmap->refCounts, (CONST char *) cref); if (!entryPtr) { panic("Tried to free a color that isn't allocated."); } refCount = (int) Tcl_GetHashValue(entryPtr) - 1; if (refCount == 0) { count = cmap->size - index; entries = (PALETTEENTRY *) ckalloc(sizeof (PALETTEENTRY) * count); GetPaletteEntries(cmap->palette, index + 1, count, entries); SetPaletteEntries(cmap->palette, index, count, entries); SelectPalette(togl->tglGLHdc, cmap->palette, TRUE); RealizePalette(togl->tglGLHdc); ckfree((char *) entries); cmap->size--; Tcl_DeleteHashEntry(entryPtr); } else { Tcl_SetHashValue(entryPtr, (ClientData) refCount); } } static void Win32SetColor(const Togl *togl, unsigned long index, float red, float green, float blue) { TkWinColormap *cmap = (TkWinColormap *) Tk_Colormap(togl->TkWin); PALETTEENTRY entry; entry.peRed = (unsigned char) (red * 255 + .5); entry.peGreen = (unsigned char) (green * 255 + .5); entry.peBlue = (unsigned char) (blue * 255 + .5); entry.peFlags = 0; SetPaletteEntries(cmap->palette, index, 1, &entry); SelectPalette(togl->tglGLHdc, cmap->palette, TRUE); RealizePalette(togl->tglGLHdc); /* for EPS output */ togl->EpsRedMap[index] = (GLfloat) (entry.peRed / 255.0); togl->EpsGreenMap[index] = (GLfloat) (entry.peGreen / 255.0); togl->EpsBlueMap[index] = (GLfloat) (entry.peBlue / 255.0); } #endif /* TOGL_X11 */ unsigned long Togl_AllocColor(const Togl *togl, float red, float green, float blue) { if (togl->RgbaFlag) { (void) fprintf(stderr, "Error: Togl_AllocColor illegal in RGBA mode.\n"); return 0; } /* TODO: maybe not... */ if (togl->PrivateCmapFlag) { (void) fprintf(stderr, "Error: Togl_AllocColor illegal with private colormap\n"); return 0; } #if defined(TOGL_X11) { XColor xcol; int exact; xcol.red = (short) (red * 65535.0); xcol.green = (short) (green * 65535.0); xcol.blue = (short) (blue * 65535.0); noFaultXAllocColor(Tk_Display(togl->TkWin), Tk_Colormap(togl->TkWin), Tk_Visual(togl->TkWin)->map_entries, &xcol, &exact); /* for EPS output */ togl->EpsRedMap[xcol.pixel] = (float) xcol.red / 65535.0; togl->EpsGreenMap[xcol.pixel] = (float) xcol.green / 65535.0; togl->EpsBlueMap[xcol.pixel] = (float) xcol.blue / 65535.0; return xcol.pixel; } #elif defined(TOGL_WGL) return Win32AllocColor(togl, red, green, blue); #elif defined(TOGL_AGL) /* still need to implement this on Mac... */ return 0; #endif } void Togl_FreeColor(const Togl *togl, unsigned long pixel) { if (togl->RgbaFlag) { (void) fprintf(stderr, "Error: Togl_FreeColor illegal in RGBA mode.\n"); return; } /* TODO: maybe not... */ if (togl->PrivateCmapFlag) { (void) fprintf(stderr, "Error: Togl_FreeColor illegal with private colormap\n"); return; } #if defined(TOGL_X11) (void) XFreeColors(Tk_Display(togl->TkWin), Tk_Colormap(togl->TkWin), &pixel, 1, 0); #elif defined(TOGL_WGL) Win32FreeColor(togl, pixel); #endif } void Togl_SetColor(const Togl *togl, unsigned long index, float red, float green, float blue) { if (togl->RgbaFlag) { (void) fprintf(stderr, "Error: Togl_SetColor illegal in RGBA mode.\n"); return; } if (!togl->PrivateCmapFlag) { (void) fprintf(stderr, "Error: Togl_SetColor requires a private colormap\n"); return; } #if defined(TOGL_X11) { XColor xcol; xcol.pixel = index; xcol.red = (short) (red * 65535.0); xcol.green = (short) (green * 65535.0); xcol.blue = (short) (blue * 65535.0); xcol.flags = DoRed | DoGreen | DoBlue; (void) XStoreColor(Tk_Display(togl->TkWin), Tk_Colormap(togl->TkWin), &xcol); /* for EPS output */ togl->EpsRedMap[xcol.pixel] = (float) xcol.red / 65535.0; togl->EpsGreenMap[xcol.pixel] = (float) xcol.green / 65535.0; togl->EpsBlueMap[xcol.pixel] = (float) xcol.blue / 65535.0; } #elif defined(TOGL_WGL) Win32SetColor(togl, index, red, green, blue); #endif } #if TOGL_USE_FONTS == 1 # include "toglFont.c" #else Tcl_Obj * Togl_LoadBitmapFont(const Togl *togl, const char *fontname) { return NULL; } int Togl_UnloadBitmapFont(const Togl *togl, Tcl_Obj *bitmapfont) { return TCL_OK; } int Togl_WriteObj(const Togl *togl, const Tcl_Obj *toglfont, const Tcl_Obj *obj) { return -1; } int Togl_WriteChars(const Togl *togl, const Tcl_Obj *toglfont, const char *str, int len) { return -1; } #endif /* TOGL_USE_FONTS */ /* * Overlay functions */ void Togl_UseLayer(Togl *togl, int layer) { if (layer == TOGL_NORMAL) { #if defined(TOGL_WGL) int res = wglMakeCurrent(togl->tglGLHdc, togl->tglGLHglrc); if (!res) { ErrorExit(TEXT("wglMakeCurrent")); } #elif defined(TOGL_X11) (void) glXMakeCurrent(Tk_Display(togl->TkWin), Tk_WindowId(togl->TkWin), togl->GlCtx); #elif defined(TOGL_AGL) (void) aglSetCurrentContext(togl->aglCtx); #endif /* TOGL_WGL */ } else if (layer == TOGL_OVERLAY && togl->OverlayWindow) { #if defined(TOGL_WGL) int res = wglMakeCurrent(togl->tglGLHdc, togl->tglGLOverlayHglrc); if (!res) { ErrorExit(TEXT("wglMakeCurrent overlay")); } #elif defined(TOGL_X11) (void) glXMakeCurrent(Tk_Display(togl->TkWin), togl->OverlayWindow, togl->OverlayCtx); #elif defined(TOGL_AGL) #endif /* TOGL_WGL */ } else { /* error */ } } void Togl_ShowOverlay(Togl *togl) { #if defined(TOGL_X11) /* not yet implemented on Windows */ if (togl->OverlayWindow) { (void) XMapWindow(Tk_Display(togl->TkWin), togl->OverlayWindow); (void) XInstallColormap(Tk_Display(togl->TkWin), togl->OverlayCmap); togl->OverlayIsMapped = True; } #endif } void Togl_HideOverlay(Togl *togl) { if (togl->OverlayWindow && togl->OverlayIsMapped) { (void) XUnmapWindow(Tk_Display(togl->TkWin), togl->OverlayWindow); togl->OverlayIsMapped = False; } } void Togl_PostOverlayRedisplay(Togl *togl) { if (!togl->OverlayUpdatePending && togl->OverlayWindow && togl->OverlayDisplayProc) { Tk_DoWhenIdle(Togl_RenderOverlay, (ClientData) togl); togl->OverlayUpdatePending = True; } } int Togl_ExistsOverlay(const Togl *togl) { return togl->OverlayFlag; } int Togl_GetOverlayTransparentValue(const Togl *togl) { return togl->OverlayTransparentPixel; } int Togl_IsMappedOverlay(const Togl *togl) { return togl->OverlayFlag && togl->OverlayIsMapped; } unsigned long Togl_AllocColorOverlay(const Togl *togl, float red, float green, float blue) { #if defined(TOGL_X11) /* not yet implemented on Windows */ if (togl->OverlayFlag && togl->OverlayCmap) { XColor xcol; xcol.red = (short) (red * 65535.0); xcol.green = (short) (green * 65535.0); xcol.blue = (short) (blue * 65535.0); if (!XAllocColor(Tk_Display(togl->TkWin), togl->OverlayCmap, &xcol)) return (unsigned long) -1; return xcol.pixel; } #endif /* TOGL_X11 */ return (unsigned long) -1; } void Togl_FreeColorOverlay(const Togl *togl, unsigned long pixel) { #if defined(TOGL_X11) /* not yet implemented on Windows */ if (togl->OverlayFlag && togl->OverlayCmap) { (void) XFreeColors(Tk_Display(togl->TkWin), togl->OverlayCmap, &pixel, 1, 0); } #endif /* TOGL_X11 */ } /* * User client data */ ClientData Togl_GetClientData(const Togl *togl) { return togl->Client_Data; } void Togl_SetClientData(Togl *togl, ClientData clientData) { togl->Client_Data = clientData; } #ifdef MESA_COLOR_HACK /* * Let's know how many free colors do we have */ # define RLEVELS 5 # define GLEVELS 9 # define BLEVELS 5 /* to free dithered_rgb_colormap pixels allocated by Mesa */ static unsigned long *ToglMesaUsedPixelCells = NULL; static int ToglMesaUsedFreeCells = 0; static int get_free_color_cells(Display *display, int screen, Colormap colormap) { if (!ToglMesaUsedPixelCells) { XColor xcol; int i; int colorsfailed, ncolors = XDisplayCells(display, screen); long r, g, b; ToglMesaUsedPixelCells = (unsigned long *) ckalloc(ncolors * sizeof (unsigned long)); /* Allocate X colors and initialize color_table[], red_table[], etc */ /* de Mesa 2.1: xmesa1.c setup_dithered_(...) */ i = colorsfailed = 0; for (r = 0; r < RLEVELS; r++) for (g = 0; g < GLEVELS; g++) for (b = 0; b < BLEVELS; b++) { int exact; xcol.red = (r * 65535) / (RLEVELS - 1); xcol.green = (g * 65535) / (GLEVELS - 1); xcol.blue = (b * 65535) / (BLEVELS - 1); noFaultXAllocColor(display, colormap, ncolors, &xcol, &exact); ToglMesaUsedPixelCells[i++] = xcol.pixel; if (!exact) { colorsfailed++; } } ToglMesaUsedFreeCells = i; XFreeColors(display, colormap, ToglMesaUsedPixelCells, ToglMesaUsedFreeCells, 0x00000000); } return ToglMesaUsedFreeCells; } static void free_default_color_cells(Display *display, Colormap colormap) { if (ToglMesaUsedPixelCells) { XFreeColors(display, colormap, ToglMesaUsedPixelCells, ToglMesaUsedFreeCells, 0x00000000); ckfree((char *) ToglMesaUsedPixelCells); ToglMesaUsedPixelCells = NULL; ToglMesaUsedFreeCells = 0; } } #endif /* * Original stereo code contributed by Ben Evans (Ben.Evans@anusf.anu.edu.au) * and was based on SGI's /usr/share/src/OpenGL/teach/stereo/glwstereo.c, * which is identical to the 1997/12/1 glwstereo.c code in the CrystalEyes * Software Development Kit. */ int Togl_NumEyes(const Togl *togl) { if (togl->Stereo > TOGL_STEREO_ONE_EYE_MAX) return 2; return 1; } /* call instead of glDrawBuffer */ void Togl_DrawBuffer(Togl *togl, GLenum mode) { if (togl->Stereo <= TOGL_STEREO_ONE_EYE_MAX) { /* Only drawing a single eye */ if (togl->currentStereoBuffer != STEREO_BUFFER_NONE) { glViewport(0, 0, togl->Width, togl->Height); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); togl->currentStereoBuffer = STEREO_BUFFER_NONE; } switch (mode) { case GL_FRONT: case GL_BACK: case GL_FRONT_AND_BACK: break; case GL_LEFT: case GL_FRONT_LEFT: case GL_RIGHT: case GL_FRONT_RIGHT: mode = GL_FRONT; break; case GL_BACK_LEFT: case GL_BACK_RIGHT: mode = GL_BACK; break; default: break; } glDrawBuffer(mode); #ifdef STEREO_I_H if (togl->Stereo == TOGL_STEREO_NVIDIA_CON) { if (togl->pStereoI) { togl->pStereoI->SetSeparation((float) togl->EyeSeparation); togl->pStereoI->SetConvergence((float) togl->Convergence); } } #endif return; } /* called once for each eye */ switch (mode) { case GL_FRONT: case GL_BACK: case GL_FRONT_AND_BACK: /* ** Simultaneous drawing to both left and right buffers isn't ** really possible if we don't have a stereo capable visual. ** For now just fall through and use the left buffer. */ case GL_LEFT: case GL_FRONT_LEFT: case GL_BACK_LEFT: togl->currentStereoBuffer = STEREO_BUFFER_LEFT; break; case GL_RIGHT: case GL_FRONT_RIGHT: case GL_BACK_RIGHT: togl->currentStereoBuffer = STEREO_BUFFER_RIGHT; break; default: break; } if (togl->Stereo != TOGL_STEREO_NATIVE) { switch (mode) { default: mode = GL_FRONT; break; case GL_BACK: case GL_BACK_LEFT: case GL_BACK_RIGHT: mode = GL_BACK; break; } } switch (togl->Stereo) { default: break; #ifdef __sgi case TOGL_STEREO_SGIOLDSTYLE: glXWaitGL(); /* sync with GL command stream before calling X */ XSGISetStereoBuffer(togl->display, Tk_WindowId(togl->TkWin), togl->currentStereoBuffer); glXWaitX(); /* sync with X command stream before calling GL */ break; #endif case TOGL_STEREO_ANAGLYPH: if (togl->currentStereoBuffer == STEREO_BUFFER_LEFT) glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE); else glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE); break; case TOGL_STEREO_CROSS_EYE: if (togl->currentStereoBuffer == STEREO_BUFFER_LEFT) glViewport(togl->Width / 2 + 1, 0, togl->Width / 2, togl->Height); else glViewport(0, 0, togl->Width / 2, togl->Height); break; case TOGL_STEREO_WALL_EYE: if (togl->currentStereoBuffer == STEREO_BUFFER_LEFT) glViewport(0, 0, togl->Width / 2, togl->Height); else glViewport(togl->Width / 2 + 1, 0, togl->Width / 2, togl->Height); break; case TOGL_STEREO_DTI: if (togl->currentStereoBuffer == STEREO_BUFFER_LEFT) glViewport(0, 0, togl->Width / 2, togl->Height); else glViewport(togl->Width / 2 + 1, 0, togl->Width / 2, togl->Height); break; } glDrawBuffer(mode); } /* call instead of glClear */ void Togl_Clear(const Togl *togl, GLbitfield mask) { switch (togl->Stereo) { default: break; case TOGL_STEREO_CROSS_EYE: case TOGL_STEREO_WALL_EYE: case TOGL_STEREO_DTI: if (togl->currentStereoBuffer != STEREO_BUFFER_LEFT) { /* Since glViewport does not affect what is cleared (unlike * glScissor), only clear in left eye */ return; } } #if 0 /* only needed if we wish to support multi-eye clears */ if (togl->Stereo > TOGL_STEREO_ONE_EYE_MAX) { GLenum drawBuffer = togl->currentDrawBuffer; switch (drawBuffer) { case GL_FRONT: Togl_DrawBuffer(togl, GL_FRONT_RIGHT); glClear(mask); Togl_DrawBuffer(togl, drawBuffer); break; case GL_BACK: Togl_DrawBuffer(togl, GL_BACK_RIGHT); glClear(mask); Togl_DrawBuffer(togl, drawBuffer); break; case GL_FRONT_AND_BACK: Togl_DrawBuffer(togl, GL_RIGHT); glClear(mask); Togl_DrawBuffer(togl, drawBuffer); break; case GL_LEFT: case GL_FRONT_LEFT: case GL_BACK_LEFT: case GL_RIGHT: case GL_FRONT_RIGHT: case GL_BACK_RIGHT: default: break; } } #endif glClear(mask); } void Togl_Frustum(const Togl *togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) { GLdouble eyeOffset = 0, eyeShift = 0; if (togl->Stereo == TOGL_STEREO_LEFT_EYE || togl->currentStereoBuffer == STEREO_BUFFER_LEFT) eyeOffset = -togl->EyeSeparation / 2; /* for left eye */ else if (togl->Stereo == TOGL_STEREO_RIGHT_EYE || togl->currentStereoBuffer == STEREO_BUFFER_RIGHT) eyeOffset = togl->EyeSeparation / 2; /* for right eye */ eyeShift = (togl->Convergence - zNear) * (eyeOffset / togl->Convergence); /* compenstate for altered viewports */ switch (togl->Stereo) { default: break; case TOGL_STEREO_SGIOLDSTYLE: case TOGL_STEREO_DTI: /* squished image is expanded, nothing needed */ break; case TOGL_STEREO_CROSS_EYE: case TOGL_STEREO_WALL_EYE:{ GLdouble delta = (top - bottom) / 2; top += delta; bottom -= delta; break; } } glFrustum(left + eyeShift, right + eyeShift, bottom, top, zNear, zFar); glTranslated(-eyeShift, 0, 0); } void Togl_Ortho(const Togl *togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) { /* TODO: debug this */ GLdouble eyeOffset = 0, eyeShift = 0; if (togl->currentStereoBuffer == STEREO_BUFFER_LEFT) eyeOffset = -togl->EyeSeparation / 2; /* for left eye */ else if (togl->currentStereoBuffer == STEREO_BUFFER_RIGHT) eyeOffset = togl->EyeSeparation / 2; /* for right eye */ eyeShift = (togl->Convergence - zNear) * (eyeOffset / togl->Convergence); /* compenstate for altered viewports */ switch (togl->Stereo) { default: break; case TOGL_STEREO_SGIOLDSTYLE: case TOGL_STEREO_DTI: /* squished image is expanded, nothing needed */ break; case TOGL_STEREO_CROSS_EYE: case TOGL_STEREO_WALL_EYE:{ GLdouble delta = (top - bottom) / 2; top += delta; bottom -= delta; break; } } glOrtho(left + eyeShift, right + eyeShift, bottom, top, zNear, zFar); glTranslated(-eyeShift, 0, 0); } int Togl_GetToglFromObj(Tcl_Interp *interp, Tcl_Obj *obj, Togl **toglPtr) { Tcl_Command toglCmd; Tcl_CmdInfo info; toglCmd = Tcl_GetCommandFromObj(interp, obj); if (Tcl_GetCommandInfoFromToken(toglCmd, &info) == 0 || info.objProc != Togl_ObjWidget) { Tcl_AppendResult(interp, "expected togl command argument", NULL); return TCL_ERROR; } *toglPtr = (Togl *) info.objClientData; return TCL_OK; } int Togl_GetToglFromName(Tcl_Interp *interp, const char *cmdName, Togl **toglPtr) { Tcl_CmdInfo info; if (Tcl_GetCommandInfo(interp, cmdName, &info) == 0 || info.objProc != Togl_ObjWidget) { Tcl_AppendResult(interp, "expected togl command argument", NULL); return TCL_ERROR; } *toglPtr = (Togl *) info.objClientData; return TCL_OK; } static int ObjectIsEmpty(Tcl_Obj *objPtr); /* *---------------------------------------------------------------------- * * GetStereo - * * Converts an internal int into a a Tcl string obj. * * Results: * Tcl_Obj containing the string representation of the stereo value. * * Side effects: * Creates a new Tcl_Obj. * *---------------------------------------------------------------------- */ static Tcl_Obj * GetStereo(ClientData clientData, Tk_Window tkwin, char *recordPtr, int internalOffset) /* recordPtr is a pointer to widget record. */ /* internalOffset is the offset within *recordPtr containing the stereo * value. */ { int stereo = *(int *) (recordPtr + internalOffset); const char *name = "unknown"; switch (stereo) { case TOGL_STEREO_NONE: name = ""; break; case TOGL_STEREO_LEFT_EYE: name = "left eye"; break; case TOGL_STEREO_RIGHT_EYE: name = "right eye"; break; case TOGL_STEREO_NVIDIA_CON: name = "nvidia consumer stereo"; break; case TOGL_STEREO_NATIVE: name = "native"; break; case TOGL_STEREO_SGIOLDSTYLE: name = "sgioldstyle"; break; case TOGL_STEREO_ANAGLYPH: name = "anaglyph"; break; case TOGL_STEREO_CROSS_EYE: name = "cross-eye"; break; case TOGL_STEREO_WALL_EYE: name = "wall-eye"; break; case TOGL_STEREO_DTI: name = "dti"; break; } return Tcl_NewStringObj(name, -1); } /* *---------------------------------------------------------------------- * * SetStereo -- * * Converts a Tcl_Obj representing a widgets stereo into an * integer value. * * Results: * Standard Tcl result. * * Side effects: * May store the integer value into the internal representation * pointer. May change the pointer to the Tcl_Obj to NULL to indicate * that the specified string was empty and that is acceptable. * *---------------------------------------------------------------------- */ static int SetStereo(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, int internalOffset, char *oldInternalPtr, int flags) /* interp is the current interp; may be used for errors. */ /* tkwin is the Window for which option is being set. */ /* value is a pointer to the pointer to the value object. We use a pointer * to the pointer because we may need to return a value (NULL). */ /* recordPtr is a pointer to storage for the widget record. */ /* internalOffset is the offset within *recordPtr at which the internal * value is to be stored. */ /* oldInternalPtr is a pointer to storage for the old value. */ /* flags are the flags for the option, set Tk_SetOptions. */ { int stereo = 0; char *string, *internalPtr; internalPtr = (internalOffset > 0) ? recordPtr + internalOffset : NULL; if (flags & TK_OPTION_NULL_OK && ObjectIsEmpty(*value)) { *value = NULL; } else { /* * Convert the stereo specifier into an integer value. */ string = Tcl_GetString(*value); if (strcmp(string, "") == 0 || strcasecmp(string, "none") == 0 || strcasecmp(string, "false") == 0) { stereo = TOGL_STEREO_NONE; } else if (strcasecmp(string, "native") == 0 || strcasecmp(string, "true") == 0) { stereo = TOGL_STEREO_NATIVE; /* check if available when creating visual */ } else if (strcasecmp(string, "left eye") == 0) { stereo = TOGL_STEREO_LEFT_EYE; } else if (strcasecmp(string, "right eye") == 0) { stereo = TOGL_STEREO_RIGHT_EYE; } else if (strcasecmp(string, "nvidia consumer stereo") == 0) { stereo = TOGL_STEREO_NVIDIA_CON; } else if (strcasecmp(string, "sgioldstyle") == 0) { stereo = TOGL_STEREO_SGIOLDSTYLE; } else if (strcasecmp(string, "anaglyph") == 0) { stereo = TOGL_STEREO_ANAGLYPH; } else if (strcasecmp(string, "cross-eye") == 0) { stereo = TOGL_STEREO_CROSS_EYE; } else if (strcasecmp(string, "wall-eye") == 0) { stereo = TOGL_STEREO_WALL_EYE; } else if (strcasecmp(string, "dti") == 0) { stereo = TOGL_STEREO_DTI; } else { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "bad stereo value \"", Tcl_GetString(*value), "\"", NULL); return TCL_ERROR; } } if (internalPtr != NULL) { *((int *) oldInternalPtr) = *((int *) internalPtr); *((int *) internalPtr) = stereo; } return TCL_OK; } /* *---------------------------------------------------------------------- * RestoreStereo -- * * Restore a stereo option value from a saved value. * * Results: * None. * * Side effects: * Restores the old value. * *---------------------------------------------------------------------- */ static void RestoreStereo(ClientData clientData, Tk_Window tkwin, char *internalPtr, char *oldInternalPtr) { *(int *) internalPtr = *(int *) oldInternalPtr; } /* *---------------------------------------------------------------------- * * ObjectIsEmpty -- * * This procedure tests whether the string value of an object is * empty. * * Results: * The return value is 1 if the string value of objPtr has length * zero, and 0 otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int ObjectIsEmpty(Tcl_Obj *objPtr) /* objPtr = Object to test. May be NULL. */ { int length; if (objPtr == NULL) { return 1; } if (objPtr->bytes != NULL) { return (objPtr->length == 0); } Tcl_GetStringFromObj(objPtr, &length); return (length == 0); } Togl2.0/togl.decls0000664000175500010010000000724111002045770012730 0ustar gregcNonelibrary togl interface togl # Declare each of the functions in the public Togl interface. Note that # the an index should never be reused for a different function in order # to preserve backwards compatibility. # package initialization declare 0 generic { int Togl_Init(Tcl_Interp *interp) } # Miscellaneous declare 1 generic { void Togl_MakeCurrent(const Togl *togl) } declare 2 generic { void Togl_PostRedisplay(Togl *togl) } declare 3 generic { void Togl_SwapBuffers(const Togl *togl) } declare 33 generic { Bool Togl_SwapInterval(const Togl *togl, int interval) } # Query functions declare 4 generic { const char *Togl_Ident(const Togl *togl) } declare 5 generic { int Togl_Width(const Togl *togl) } declare 6 generic { int Togl_Height(const Togl *togl) } declare 7 generic { Tcl_Interp *Togl_Interp(const Togl *togl) } declare 8 generic { Tk_Window Togl_TkWin(const Togl *togl) } declare 9 generic { const char *Togl_CommandName(const Togl *togl) } declare 36 generic { int Togl_ContextTag(const Togl *togl) } declare 37 generic { Bool Togl_UpdatePending(const Togl *togl) } # Color Index mode declare 10 generic { unsigned long Togl_AllocColor(const Togl *togl, float red, float green, float blue) } declare 11 generic { void Togl_FreeColor(const Togl *togl, unsigned long index) } declare 12 generic { void Togl_SetColor(const Togl *togl, unsigned long index, float red, float green, float blue) } # Bitmap fonts declare 13 generic { Tcl_Obj *Togl_LoadBitmapFont(const Togl *togl, const char *fontname) } declare 14 generic { int Togl_UnloadBitmapFont(const Togl *togl, Tcl_Obj *toglfont) } declare 38 generic { int Togl_WriteObj(const Togl *togl, const Tcl_Obj *toglfont, Tcl_Obj *obj) } declare 39 generic { int Togl_WriteChars(const Togl *togl, const Tcl_Obj *toglfont, const char *str, int len) } # Overlay functions declare 15 generic { void Togl_UseLayer(Togl *togl, int layer) } declare 16 generic { void Togl_ShowOverlay(Togl *togl) } declare 17 generic { void Togl_HideOverlay(Togl *togl) } declare 18 generic { void Togl_PostOverlayRedisplay(Togl *togl) } declare 19 generic { int Togl_ExistsOverlay(const Togl *togl) } declare 20 generic { int Togl_GetOverlayTransparentValue(const Togl *togl) } declare 21 generic { int Togl_IsMappedOverlay(const Togl *togl) } declare 22 generic { unsigned long Togl_AllocColorOverlay(const Togl *togl, float red, float green, float blue) } declare 23 generic { void Togl_FreeColorOverlay(const Togl *togl, unsigned long index) } # User client data declare 24 generic { ClientData Togl_GetClientData(const Togl *togl) } declare 25 generic { void Togl_SetClientData(Togl *togl, ClientData clientData) } # Stereo support declare 26 generic { void Togl_DrawBuffer(Togl *togl, GLenum mode) } declare 27 generic { void Togl_Clear(const Togl *togl, GLbitfield mask) } declare 28 generic { void Togl_Frustum(const Togl *togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far) } declare 34 generic { void Togl_Ortho(const Togl *togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far) } declare 35 generic { int Togl_NumEyes(const Togl *togl) } # save current contents of OpenGL window into photo image declare 30 generic { int Togl_TakePhoto(Togl *togl, Tk_PhotoHandle photo) } # platform-independent lookup of OpenGL functions declare 31 generic { Togl_FuncPtr Togl_GetProcAddr(const char *funcname) } # Return the Togl data associated with pathName declare 29 generic { int Togl_GetToglFromObj(Tcl_Interp *interp, Tcl_Obj *obj, Togl **toglPtr) } declare 32 generic { int Togl_GetToglFromName(Tcl_Interp *interp, const char *cmdName, Togl **toglPtr) } Togl2.0/togl.h0000644000175500010010000000616011002045770012062 0ustar gregcNone/* $Id: togl.h,v 1.37 2008/04/17 00:13:42 gregcouch Exp $ */ /* vi:set sw=4: */ /* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2008 Greg Couch * See the LICENSE file for copyright details. */ #ifndef TOGL_H # define TOGL_H # include "togl_ws.h" # ifdef TOGL_WGL # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN # if defined(_MSC_VER) # define DllEntryPoint DllMain # endif # endif # ifdef TOGL_AGL # ifndef MAC_OSX_TCL # define MAC_OSX_TCL 1 # endif # ifndef MAC_OSX_TK # define MAC_OSX_TK 1 # endif # endif # ifdef USE_TOGL_STUBS # ifndef USE_TCL_STUBS # define USE_TCL_STUBS # endif # ifndef USE_TK_STUBS # define USE_TK_STUBS # endif # endif # include # include # if defined(TOGL_AGL) # include # else # include # endif # ifdef BUILD_togl # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT # endif # ifndef CONST84 # define CONST84 # endif # ifndef NULL # define NULL 0 # endif # ifndef EXTERN # define EXTERN extern # endif # ifdef __cplusplus /* *INDENT-OFF* */ extern "C" { /* *INDENT-ON* */ # endif # define TOGL_VERSION "2.0" # define TOGL_MAJOR_VERSION 2 # define TOGL_MINOR_VERSION 0 /* * "Standard" fonts which can be specified to Togl_LoadBitmapFont() * Deprecated. Use the Tk font name or description instead. */ # define TOGL_BITMAP_8_BY_13 "8x13" # define TOGL_BITMAP_9_BY_15 "9x15" # define TOGL_BITMAP_TIMES_ROMAN_10 "Times 10" # define TOGL_BITMAP_TIMES_ROMAN_24 "Times 24" # define TOGL_BITMAP_HELVETICA_10 "Helvetica 10" # define TOGL_BITMAP_HELVETICA_12 "Helvetica 12" # define TOGL_BITMAP_HELVETICA_18 "Helvetica 18" /* * Normal and overlay plane constants */ # define TOGL_NORMAL 1 # define TOGL_OVERLAY 2 /* * Stereo techniques: * Only the native method uses OpenGL quad-buffered stereo. * All need the eye offset and eye distance set properly. */ /* These versions need one eye drawn */ # define TOGL_STEREO_NONE 0 # define TOGL_STEREO_LEFT_EYE 1 /* just the left eye */ # define TOGL_STEREO_RIGHT_EYE 2 /* just the right eye */ # define TOGL_STEREO_NVIDIA_CON 3 /* GeForce Consumer 3D stereo */ # define TOGL_STEREO_ONE_EYE_MAX 127 /* These versions need both eyes drawn */ # define TOGL_STEREO_NATIVE 128 # define TOGL_STEREO_SGIOLDSTYLE 129 /* interlaced, SGI API */ # define TOGL_STEREO_ANAGLYPH 130 # define TOGL_STEREO_CROSS_EYE 131 # define TOGL_STEREO_WALL_EYE 132 # define TOGL_STEREO_DTI 133 /* dti3d.com */ struct Togl; typedef struct Togl Togl; typedef void (*Togl_FuncPtr) (); const char *Togl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, const char *version, int exact)); # ifndef USE_TOGL_STUBS # define Togl_InitStubs(interp, version, exact) \ Tcl_PkgRequire(interp, "Togl", version, exact) # endif # ifdef __cplusplus /* *INDENT-OFF* */ } /* *INDENT-ON* */ # endif /* * Platform independent exported functions */ # include "toglDecls.h" #endif Togl2.0/Togl.py0000664000175500010010000000625010663455067012245 0ustar gregcNone """ Tkinter support for the Togl 2.X Tk OpenGL widget. Copyright (C) 2006-2007 Greg Couch See the LICENSE file for copyright details. """ __all__ = ['Togl', 'NORMAL', 'OVERLAY'] import Tkinter import weakref, atexit # Overlay constants NORMAL = 1 OVERLAY = 2 class Togl(Tkinter.Widget): """Tk OpenGL Widget""" _instances = weakref.WeakKeyDictionary() def __init__(self, master=None, cnf={}, **kw): """Return new Togl widget""" if master is None: master = Tkinter._default_root master.tk.call('package', 'require', 'Togl', '2.0') Tkinter.Widget.__init__(self, master, "togl", cnf, kw) Togl._instances[self] = True def _cbsubst(self, *args): """callback command argument substitution""" if len(args) != 1: return args return (self._nametowidget(args[0]),) def _options(self, cnf, kw = None): """Internal function.""" if kw: cnf = Tkinter._cnfmerge((cnf, kw)) else: cnf = Tkinter._cnfmerge(cnf) res = () for k, v in cnf.items(): if v is not None: if k[-1] == '_': k = k[:-1] if callable(v): if k.endswith('command'): v = self._register(v, self._cbsubst) else: v = self._register(v) res = res + ('-'+k, v) return res # cget, configure are inherited def extensions(self): """Return list of supported OpenGL extensions""" return self.tk.call(self._w, 'extensions') def postredisplay(self): """Cause the displaycommand callback to be called the next time the event loop is idle.""" self.tk.call(self._w, 'postredisplay') def render(self): """Call the displaycommand callback immediately.""" self.tk.call(self._w, 'render') def swapbuffers(self): """If single-buffred, just flush OpenGL command buffer. If double-buffered, swap front and back buffers. (So this is appropriate to call after every frame is drawn.)""" self.tk.call(self._w, 'swapbuffers') def makecurrent(self): """Make widget the current OpenGL context""" self.tk.call(self._w, 'makecurrent') def takephoto(self, imageName): """Copy current contents of widget into the given photo image """ self.tk.call(self._w, 'takephoto', imageName) def loadbitmapfont(self, name): return self.tk.call(self._w, 'loadbitmapfont', name) def unloadbitmapfont(self, fontbase): self.tk.call(self._w, 'unloadbitmapfont', fontbase) def uselayer(self, layer): self.tk.call(self._w, 'uselayer', layer) def showoverlay(self): self.tk.call(self._w, 'showoverlay') def hideoverlay(self): self.tk.call(self._w, 'hideoverlay') def postredisplayoverlay(self): self.tk.call(self._w, 'postredisplayoverlay') def renderoverlay(self): self.tk.call(self._w, 'renderoverlay') def existsoverlay(self): return self.tk.call(self._w, 'existsoverlay') def ismappedoverlay(self): return self.tk.call(self._w, 'ismappedoverlay') def getoverlaytransparentvalue(self): return self.tk.call(self._w, 'getoverlaytransparentvalue') def destroy(self): del Togl._instances[self] Tkinter.Widget.destroy(self) def _cleanup(): # destroy OpenGL contexts early, so destroycommand's don't # try to make any OpenGL calls during exit. for t in Togl._instances.keys(): try: t.destroy() except Tkinter.TclError: pass atexit.register(_cleanup) Togl2.0/toglDecls.h0000755000175500010010000002736511002045770013052 0ustar gregcNone#ifndef ToglDecls_H # define ToglDecls_H /* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2008 Greg Couch * See the LICENSE file for copyright details. */ /* !BEGIN!: Do not edit below this line. */ /* * Exported function declarations: */ /* 0 */ EXTERN int Togl_Init _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ EXTERN void Togl_MakeCurrent _ANSI_ARGS_((const Togl * togl)); /* 2 */ EXTERN void Togl_PostRedisplay _ANSI_ARGS_((Togl * togl)); /* 3 */ EXTERN void Togl_SwapBuffers _ANSI_ARGS_((const Togl * togl)); /* 4 */ EXTERN const char * Togl_Ident _ANSI_ARGS_((const Togl * togl)); /* 5 */ EXTERN int Togl_Width _ANSI_ARGS_((const Togl * togl)); /* 6 */ EXTERN int Togl_Height _ANSI_ARGS_((const Togl * togl)); /* 7 */ EXTERN Tcl_Interp * Togl_Interp _ANSI_ARGS_((const Togl * togl)); /* 8 */ EXTERN Tk_Window Togl_TkWin _ANSI_ARGS_((const Togl * togl)); /* 9 */ EXTERN const char * Togl_CommandName _ANSI_ARGS_((const Togl * togl)); /* 10 */ EXTERN unsigned long Togl_AllocColor _ANSI_ARGS_((const Togl * togl, float red, float green, float blue)); /* 11 */ EXTERN void Togl_FreeColor _ANSI_ARGS_((const Togl * togl, unsigned long index)); /* 12 */ EXTERN void Togl_SetColor _ANSI_ARGS_((const Togl * togl, unsigned long index, float red, float green, float blue)); /* 13 */ EXTERN Tcl_Obj * Togl_LoadBitmapFont _ANSI_ARGS_((const Togl * togl, const char * fontname)); /* 14 */ EXTERN int Togl_UnloadBitmapFont _ANSI_ARGS_((const Togl * togl, Tcl_Obj * toglfont)); /* 15 */ EXTERN void Togl_UseLayer _ANSI_ARGS_((Togl * togl, int layer)); /* 16 */ EXTERN void Togl_ShowOverlay _ANSI_ARGS_((Togl * togl)); /* 17 */ EXTERN void Togl_HideOverlay _ANSI_ARGS_((Togl * togl)); /* 18 */ EXTERN void Togl_PostOverlayRedisplay _ANSI_ARGS_((Togl * togl)); /* 19 */ EXTERN int Togl_ExistsOverlay _ANSI_ARGS_((const Togl * togl)); /* 20 */ EXTERN int Togl_GetOverlayTransparentValue _ANSI_ARGS_(( const Togl * togl)); /* 21 */ EXTERN int Togl_IsMappedOverlay _ANSI_ARGS_((const Togl * togl)); /* 22 */ EXTERN unsigned long Togl_AllocColorOverlay _ANSI_ARGS_(( const Togl * togl, float red, float green, float blue)); /* 23 */ EXTERN void Togl_FreeColorOverlay _ANSI_ARGS_((const Togl * togl, unsigned long index)); /* 24 */ EXTERN ClientData Togl_GetClientData _ANSI_ARGS_((const Togl * togl)); /* 25 */ EXTERN void Togl_SetClientData _ANSI_ARGS_((Togl * togl, ClientData clientData)); /* 26 */ EXTERN void Togl_DrawBuffer _ANSI_ARGS_((Togl * togl, GLenum mode)); /* 27 */ EXTERN void Togl_Clear _ANSI_ARGS_((const Togl * togl, GLbitfield mask)); /* 28 */ EXTERN void Togl_Frustum _ANSI_ARGS_((const Togl * togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)); /* 29 */ EXTERN int Togl_GetToglFromObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * obj, Togl ** toglPtr)); /* 30 */ EXTERN int Togl_TakePhoto _ANSI_ARGS_((Togl * togl, Tk_PhotoHandle photo)); /* 31 */ EXTERN Togl_FuncPtr Togl_GetProcAddr _ANSI_ARGS_((const char * funcname)); /* 32 */ EXTERN int Togl_GetToglFromName _ANSI_ARGS_(( Tcl_Interp * interp, const char * cmdName, Togl ** toglPtr)); /* 33 */ EXTERN Bool Togl_SwapInterval _ANSI_ARGS_((const Togl * togl, int interval)); /* 34 */ EXTERN void Togl_Ortho _ANSI_ARGS_((const Togl * togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)); /* 35 */ EXTERN int Togl_NumEyes _ANSI_ARGS_((const Togl * togl)); /* 36 */ EXTERN int Togl_ContextTag _ANSI_ARGS_((const Togl * togl)); /* 37 */ EXTERN Bool Togl_UpdatePending _ANSI_ARGS_((const Togl * togl)); /* 38 */ EXTERN int Togl_WriteObj _ANSI_ARGS_((const Togl * togl, const Tcl_Obj * toglfont, Tcl_Obj * obj)); /* 39 */ EXTERN int Togl_WriteChars _ANSI_ARGS_((const Togl * togl, const Tcl_Obj * toglfont, const char * str, int len)); typedef struct ToglStubs { int magic; struct ToglStubHooks *hooks; int (*togl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ void (*togl_MakeCurrent) _ANSI_ARGS_((const Togl * togl)); /* 1 */ void (*togl_PostRedisplay) _ANSI_ARGS_((Togl * togl)); /* 2 */ void (*togl_SwapBuffers) _ANSI_ARGS_((const Togl * togl)); /* 3 */ const char * (*togl_Ident) _ANSI_ARGS_((const Togl * togl)); /* 4 */ int (*togl_Width) _ANSI_ARGS_((const Togl * togl)); /* 5 */ int (*togl_Height) _ANSI_ARGS_((const Togl * togl)); /* 6 */ Tcl_Interp * (*togl_Interp) _ANSI_ARGS_((const Togl * togl)); /* 7 */ Tk_Window (*togl_TkWin) _ANSI_ARGS_((const Togl * togl)); /* 8 */ const char * (*togl_CommandName) _ANSI_ARGS_((const Togl * togl)); /* 9 */ unsigned long (*togl_AllocColor) _ANSI_ARGS_((const Togl * togl, float red, float green, float blue)); /* 10 */ void (*togl_FreeColor) _ANSI_ARGS_((const Togl * togl, unsigned long index)); /* 11 */ void (*togl_SetColor) _ANSI_ARGS_((const Togl * togl, unsigned long index, float red, float green, float blue)); /* 12 */ Tcl_Obj * (*togl_LoadBitmapFont) _ANSI_ARGS_((const Togl * togl, const char * fontname)); /* 13 */ int (*togl_UnloadBitmapFont) _ANSI_ARGS_((const Togl * togl, Tcl_Obj * toglfont)); /* 14 */ void (*togl_UseLayer) _ANSI_ARGS_((Togl * togl, int layer)); /* 15 */ void (*togl_ShowOverlay) _ANSI_ARGS_((Togl * togl)); /* 16 */ void (*togl_HideOverlay) _ANSI_ARGS_((Togl * togl)); /* 17 */ void (*togl_PostOverlayRedisplay) _ANSI_ARGS_((Togl * togl)); /* 18 */ int (*togl_ExistsOverlay) _ANSI_ARGS_((const Togl * togl)); /* 19 */ int (*togl_GetOverlayTransparentValue) _ANSI_ARGS_((const Togl * togl)); /* 20 */ int (*togl_IsMappedOverlay) _ANSI_ARGS_((const Togl * togl)); /* 21 */ unsigned long (*togl_AllocColorOverlay) _ANSI_ARGS_((const Togl * togl, float red, float green, float blue)); /* 22 */ void (*togl_FreeColorOverlay) _ANSI_ARGS_((const Togl * togl, unsigned long index)); /* 23 */ ClientData (*togl_GetClientData) _ANSI_ARGS_((const Togl * togl)); /* 24 */ void (*togl_SetClientData) _ANSI_ARGS_((Togl * togl, ClientData clientData)); /* 25 */ void (*togl_DrawBuffer) _ANSI_ARGS_((Togl * togl, GLenum mode)); /* 26 */ void (*togl_Clear) _ANSI_ARGS_((const Togl * togl, GLbitfield mask)); /* 27 */ void (*togl_Frustum) _ANSI_ARGS_((const Togl * togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)); /* 28 */ int (*togl_GetToglFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * obj, Togl ** toglPtr)); /* 29 */ int (*togl_TakePhoto) _ANSI_ARGS_((Togl * togl, Tk_PhotoHandle photo)); /* 30 */ Togl_FuncPtr (*togl_GetProcAddr) _ANSI_ARGS_((const char * funcname)); /* 31 */ int (*togl_GetToglFromName) _ANSI_ARGS_((Tcl_Interp * interp, const char * cmdName, Togl ** toglPtr)); /* 32 */ Bool (*togl_SwapInterval) _ANSI_ARGS_((const Togl * togl, int interval)); /* 33 */ void (*togl_Ortho) _ANSI_ARGS_((const Togl * togl, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)); /* 34 */ int (*togl_NumEyes) _ANSI_ARGS_((const Togl * togl)); /* 35 */ int (*togl_ContextTag) _ANSI_ARGS_((const Togl * togl)); /* 36 */ Bool (*togl_UpdatePending) _ANSI_ARGS_((const Togl * togl)); /* 37 */ int (*togl_WriteObj) _ANSI_ARGS_((const Togl * togl, const Tcl_Obj * toglfont, Tcl_Obj * obj)); /* 38 */ int (*togl_WriteChars) _ANSI_ARGS_((const Togl * togl, const Tcl_Obj * toglfont, const char * str, int len)); /* 39 */ } ToglStubs; #ifdef __cplusplus extern "C" { #endif extern ToglStubs *toglStubsPtr; #ifdef __cplusplus } #endif #if defined(USE_TOGL_STUBS) && !defined(USE_TOGL_STUB_PROCS) /* * Inline function declarations: */ #ifndef Togl_Init #define Togl_Init \ (toglStubsPtr->togl_Init) /* 0 */ #endif #ifndef Togl_MakeCurrent #define Togl_MakeCurrent \ (toglStubsPtr->togl_MakeCurrent) /* 1 */ #endif #ifndef Togl_PostRedisplay #define Togl_PostRedisplay \ (toglStubsPtr->togl_PostRedisplay) /* 2 */ #endif #ifndef Togl_SwapBuffers #define Togl_SwapBuffers \ (toglStubsPtr->togl_SwapBuffers) /* 3 */ #endif #ifndef Togl_Ident #define Togl_Ident \ (toglStubsPtr->togl_Ident) /* 4 */ #endif #ifndef Togl_Width #define Togl_Width \ (toglStubsPtr->togl_Width) /* 5 */ #endif #ifndef Togl_Height #define Togl_Height \ (toglStubsPtr->togl_Height) /* 6 */ #endif #ifndef Togl_Interp #define Togl_Interp \ (toglStubsPtr->togl_Interp) /* 7 */ #endif #ifndef Togl_TkWin #define Togl_TkWin \ (toglStubsPtr->togl_TkWin) /* 8 */ #endif #ifndef Togl_CommandName #define Togl_CommandName \ (toglStubsPtr->togl_CommandName) /* 9 */ #endif #ifndef Togl_AllocColor #define Togl_AllocColor \ (toglStubsPtr->togl_AllocColor) /* 10 */ #endif #ifndef Togl_FreeColor #define Togl_FreeColor \ (toglStubsPtr->togl_FreeColor) /* 11 */ #endif #ifndef Togl_SetColor #define Togl_SetColor \ (toglStubsPtr->togl_SetColor) /* 12 */ #endif #ifndef Togl_LoadBitmapFont #define Togl_LoadBitmapFont \ (toglStubsPtr->togl_LoadBitmapFont) /* 13 */ #endif #ifndef Togl_UnloadBitmapFont #define Togl_UnloadBitmapFont \ (toglStubsPtr->togl_UnloadBitmapFont) /* 14 */ #endif #ifndef Togl_UseLayer #define Togl_UseLayer \ (toglStubsPtr->togl_UseLayer) /* 15 */ #endif #ifndef Togl_ShowOverlay #define Togl_ShowOverlay \ (toglStubsPtr->togl_ShowOverlay) /* 16 */ #endif #ifndef Togl_HideOverlay #define Togl_HideOverlay \ (toglStubsPtr->togl_HideOverlay) /* 17 */ #endif #ifndef Togl_PostOverlayRedisplay #define Togl_PostOverlayRedisplay \ (toglStubsPtr->togl_PostOverlayRedisplay) /* 18 */ #endif #ifndef Togl_ExistsOverlay #define Togl_ExistsOverlay \ (toglStubsPtr->togl_ExistsOverlay) /* 19 */ #endif #ifndef Togl_GetOverlayTransparentValue #define Togl_GetOverlayTransparentValue \ (toglStubsPtr->togl_GetOverlayTransparentValue) /* 20 */ #endif #ifndef Togl_IsMappedOverlay #define Togl_IsMappedOverlay \ (toglStubsPtr->togl_IsMappedOverlay) /* 21 */ #endif #ifndef Togl_AllocColorOverlay #define Togl_AllocColorOverlay \ (toglStubsPtr->togl_AllocColorOverlay) /* 22 */ #endif #ifndef Togl_FreeColorOverlay #define Togl_FreeColorOverlay \ (toglStubsPtr->togl_FreeColorOverlay) /* 23 */ #endif #ifndef Togl_GetClientData #define Togl_GetClientData \ (toglStubsPtr->togl_GetClientData) /* 24 */ #endif #ifndef Togl_SetClientData #define Togl_SetClientData \ (toglStubsPtr->togl_SetClientData) /* 25 */ #endif #ifndef Togl_DrawBuffer #define Togl_DrawBuffer \ (toglStubsPtr->togl_DrawBuffer) /* 26 */ #endif #ifndef Togl_Clear #define Togl_Clear \ (toglStubsPtr->togl_Clear) /* 27 */ #endif #ifndef Togl_Frustum #define Togl_Frustum \ (toglStubsPtr->togl_Frustum) /* 28 */ #endif #ifndef Togl_GetToglFromObj #define Togl_GetToglFromObj \ (toglStubsPtr->togl_GetToglFromObj) /* 29 */ #endif #ifndef Togl_TakePhoto #define Togl_TakePhoto \ (toglStubsPtr->togl_TakePhoto) /* 30 */ #endif #ifndef Togl_GetProcAddr #define Togl_GetProcAddr \ (toglStubsPtr->togl_GetProcAddr) /* 31 */ #endif #ifndef Togl_GetToglFromName #define Togl_GetToglFromName \ (toglStubsPtr->togl_GetToglFromName) /* 32 */ #endif #ifndef Togl_SwapInterval #define Togl_SwapInterval \ (toglStubsPtr->togl_SwapInterval) /* 33 */ #endif #ifndef Togl_Ortho #define Togl_Ortho \ (toglStubsPtr->togl_Ortho) /* 34 */ #endif #ifndef Togl_NumEyes #define Togl_NumEyes \ (toglStubsPtr->togl_NumEyes) /* 35 */ #endif #ifndef Togl_ContextTag #define Togl_ContextTag \ (toglStubsPtr->togl_ContextTag) /* 36 */ #endif #ifndef Togl_UpdatePending #define Togl_UpdatePending \ (toglStubsPtr->togl_UpdatePending) /* 37 */ #endif #ifndef Togl_WriteObj #define Togl_WriteObj \ (toglStubsPtr->togl_WriteObj) /* 38 */ #endif #ifndef Togl_WriteChars #define Togl_WriteChars \ (toglStubsPtr->togl_WriteChars) /* 39 */ #endif #endif /* defined(USE_TOGL_STUBS) && !defined(USE_TOGL_STUB_PROCS) */ /* !END!: Do not edit above this line. */ #endif Togl2.0/toglFont.c0000644000175500010010000003600511003161356012705 0ustar gregcNone/* $Id: toglFont.c,v 1.3 2008/04/21 18:54:38 gregcouch Exp $ */ /* vi:set sw=4: */ /* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2008 Greg Couch * See the LICENSE file for copyright details. */ /* * Togl Bitmap Font support * * If bitmap font support is requested, then this file is included into * togl.c. Parts of this file are based on , * "Creating and Using Tcl Handles in C Extensions". * * Neither the Tk public nor the internal interface give enough information * to reuse the font in OpenGL, so we copy the private structures here to * access what we need. * * Globals needed by the font module are in togl.c */ #include #ifdef _WIN32 # define snprintf _snprintf #endif struct Togl_BitmapFontInfo { GLuint base; GLuint first; GLuint last; int contextTag; /* TODO: keep original font and/or encoding */ }; typedef struct Togl_BitmapFontInfo Togl_BitmapFontInfo; #define BITMAP_FONT_INFO(obj) \ ((Togl_BitmapFontInfo *) (obj)->internalRep.otherValuePtr) #define SET_BITMAP_FONT_INFO(obj) \ (obj)->internalRep.otherValuePtr static void Togl_FontFree(Tcl_Obj *obj); static void Togl_FontDup(Tcl_Obj *src, Tcl_Obj *dup); static void Togl_FontString(Tcl_Obj *obj); static int Togl_FontSet(Tcl_Interp *interp, Tcl_Obj *obj); static Tcl_ObjType Togl_BitmapFontType = { "Togl BitmapFont", /* name */ Togl_FontFree, /* free internal rep */ Togl_FontDup, /* dup internal rep */ Togl_FontString, /* update string from internal rep */ Togl_FontSet /* set internal rep from string */ }; static int Togl_FontSet(Tcl_Interp *interp, Tcl_Obj *obj) { if (interp) Tcl_AppendResult(interp, "cannot (re)build object of type \"", Togl_BitmapFontType.name, "\"", NULL); return TCL_ERROR; } static void Togl_FontFree(Tcl_Obj *obj) { Togl_BitmapFontInfo *bfi = BITMAP_FONT_INFO(obj); ckfree((char *) bfi); } static void Togl_FontString(Tcl_Obj *obj) { /* assert(obj->bytes == NULL) */ static char buf[256]; register unsigned len; Togl_BitmapFontInfo *bfi = BITMAP_FONT_INFO(obj); #ifndef TOGL_AGL snprintf(buf, sizeof buf, "{{%s} %d %d %d}", Togl_BitmapFontType.name, bfi->base, bfi->first, bfi->last); #else /* unlike every other platform, on Aqua, GLint is long */ snprintf(buf, sizeof buf, "{{%s} %ld %ld %ld}", Togl_BitmapFontType.name, bfi->base, bfi->first, bfi->last); #endif len = strlen(buf); obj->bytes = (char *) ckalloc(len + 1); strcpy(obj->bytes, buf); obj->length = len; } static void Togl_FontDup(Tcl_Obj *src, Tcl_Obj *dup) { /* * When duplicated, lose the font-ness and just be a string. * So don't copy the internal representation and don't set * dup->typePtr. */ } #if defined(TOGL_X11) /* From tkUnixFont.c */ /* * The following structure encapsulates an individual screen font. A font * object is made up of however many SubFonts are necessary to display a * stream of multilingual characters. */ typedef struct FontFamily FontFamily; typedef struct SubFont { char **fontMap; /* Pointer to font map from the FontFamily, * cached here to save a dereference. */ XFontStruct *fontStructPtr; /* The specific screen font that will be used * when displaying/measuring chars belonging to * the FontFamily. */ FontFamily *familyPtr; /* The FontFamily for this SubFont. */ } SubFont; /* * The following structure represents Unix's implementation of a font * object. */ # define SUBFONT_SPACE 3 # define BASE_CHARS 256 typedef struct UnixFont { TkFont font; /* Stuff used by generic font package. Must be * first in structure. */ SubFont staticSubFonts[SUBFONT_SPACE]; /* Builtin space for a limited number of SubFonts. */ int numSubFonts; /* Length of following array. */ SubFont *subFontArray; /* Array of SubFonts that have been loaded in * order to draw/measure all the characters * encountered by this font so far. All fonts * start off with one SubFont initialized by * AllocFont() from the original set of font * attributes. Usually points to * staticSubFonts, but may point to malloced * space if there are lots of SubFonts. */ SubFont controlSubFont; /* Font to use to display control-character * expansions. */ # if 0 Display *display; /* Display that owns font. */ int pixelSize; /* Original pixel size used when font was * constructed. */ TkXLFDAttributes xa; /* Additional attributes that specify the * preferred foundry and encoding to use when * constructing additional SubFonts. */ int widths[BASE_CHARS]; /* Widths of first 256 chars in the base font, * for handling common case. */ int underlinePos; /* Offset from baseline to origin of underline * bar (used when drawing underlined font) * (pixels). */ int barHeight; /* Height of underline or overstrike bar (used * when drawing underlined or strikeout font) * (pixels). */ # endif } UnixFont; #elif defined(TOGL_WGL) # include /* From tkWinFont.c */ typedef struct FontFamily FontFamily; /* * The following structure encapsulates an individual screen font. A font * object is made up of however many SubFonts are necessary to display a * stream of multilingual characters. */ typedef struct SubFont { char **fontMap; /* Pointer to font map from the FontFamily, * cached here to save a dereference. */ HFONT hFont; /* The specific screen font that will be used * when displaying/measuring chars belonging to * the FontFamily. */ FontFamily *familyPtr; /* The FontFamily for this SubFont. */ } SubFont; /* * The following structure represents Windows' implementation of a font * object. */ # define SUBFONT_SPACE 3 # define BASE_CHARS 128 typedef struct WinFont { TkFont font; /* Stuff used by generic font package. Must be * first in structure. */ SubFont staticSubFonts[SUBFONT_SPACE]; /* Builtin space for a limited number of SubFonts. */ int numSubFonts; /* Length of following array. */ SubFont *subFontArray; /* Array of SubFonts that have been loaded in * order to draw/measure all the characters * encountered by this font so far. All fonts * start off with one SubFont initialized by * AllocFont() from the original set of font * attributes. Usually points to * staticSubFonts, but may point to malloced * space if there are lots of SubFonts. */ HWND hwnd; /* Toplevel window of application that owns * this font, used for getting HDC for * offscreen measurements. */ int pixelSize; /* Original pixel size used when font was * constructed. */ int widths[BASE_CHARS]; /* Widths of first 128 chars in the base font, * for handling common case. The base font is * always used to draw characters between * 0x0000 and 0x007f. */ } WinFont; #elif defined(TOGL_AGL) typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ int refCount; /* How many SubFonts are referring to this * FontFamily. When the refCount drops to * zero, this FontFamily may be freed. */ /* * Key. */ FMFontFamily faceNum; /* Unique face number key for this FontFamily. */ /* * Derived properties. */ Tcl_Encoding encoding; /* Encoding for this font family. */ # if 0 int isSymbolFont; /* Non-zero if this is a symbol family. */ int isMultiByteFont; /* Non-zero if this is a multi-byte family. */ char typeTable[256]; /* Table that identfies all lead bytes for a * multi-byte family, used when measuring * chars. If a byte is a lead byte, the value * at the corresponding position in the * typeTable is 1, otherwise 0. If this is a * single-byte font, all entries are 0. */ char *fontMap[FONTMAP_PAGES]; /* Two-level sparse table used to determine quickly if the specified * character exists. As characters are encountered, more pages in this * table are dynamically added. The contents of each page is a bitmask * consisting of FONTMAP_BITSPERPAGE bits, representing whether this font * can be used to display the given character at the corresponding bit * position. The high bits of the character are used to pick which page of * the table is used. */ # endif } FontFamily; /* * The following structure encapsulates an individual screen font. A font * object is made up of however many SubFonts are necessary to display a * stream of multilingual characters. */ typedef struct SubFont { char **fontMap; /* Pointer to font map from the FontFamily, * cached here to save a dereference. */ FontFamily *familyPtr; /* The FontFamily for this SubFont. */ } SubFont; /* * The following structure represents Macintosh's implementation of a font * object. */ # define SUBFONT_SPACE 3 typedef struct MacFont { TkFont font; /* Stuff used by generic font package. Must be * first in structure. */ SubFont staticSubFonts[SUBFONT_SPACE]; /* Builtin space for a limited number of SubFonts. */ int numSubFonts; /* Length of following array. */ SubFont *subFontArray; /* Array of SubFonts that have been loaded in * order to draw/measure all the characters * encountered by this font so far. All fonts * start off with one SubFont initialized by * AllocFont() from the original set of font * attributes. Usually points to * staticSubFonts, but may point to malloced * space if there are lots of SubFonts. */ short size; /* Font size in pixels, constructed from font * attributes. */ short style; /* Style bits, constructed from font * attributes. */ } MacFont; #endif /* * Load the named bitmap font as a sequence of bitmaps in a display list. * fontname may be any font recognized by Tk_GetFont. */ Tcl_Obj * Togl_LoadBitmapFont(const Togl *togl, const char *fontname) { Tk_Font font; Togl_BitmapFontInfo *bfi; Tcl_Obj *obj; #if defined(TOGL_X11) UnixFont *unixfont; XFontStruct *fontinfo; #elif defined(TOGL_WGL) WinFont *winfont; HFONT oldFont; TEXTMETRIC tm; #elif defined(TOGL_AGL) MacFont *macfont; #endif int first, last, count; GLuint fontbase; if (!fontname) { fontname = DEFAULT_FONTNAME; } font = Tk_GetFont(togl->Interp, togl->TkWin, fontname); if (!font) { return NULL; } #if defined(TOGL_X11) unixfont = (UnixFont *) font; fontinfo = unixfont->subFontArray->fontStructPtr; first = fontinfo->min_char_or_byte2; last = fontinfo->max_char_or_byte2; #elif defined(TOGL_WGL) winfont = (WinFont *) font; oldFont = (HFONT) SelectObject(togl->tglGLHdc, winfont->subFontArray->hFont); GetTextMetrics(togl->tglGLHdc, &tm); first = tm.tmFirstChar; last = tm.tmLastChar; #elif defined(TOGL_AGL) macfont = (MacFont *) font; first = 10; /* don't know how to determine font range on * Mac... */ last = 255; #endif if (last > 255) last = 255; /* no unicode support */ count = last - first + 1; fontbase = glGenLists((GLuint) (last + 1)); if (fontbase == 0) { #ifdef TOGL_WGL SelectObject(togl->tglGLHdc, oldFont); #endif Tk_FreeFont(font); return NULL; } #if defined(TOGL_WGL) wglUseFontBitmaps(togl->tglGLHdc, first, count, fontbase + first); SelectObject(togl->tglGLHdc, oldFont); #elif defined(TOGL_X11) glXUseXFont(fontinfo->fid, first, count, (int) fontbase + first); #elif defined(TOGL_AGL) aglUseFont(togl->aglCtx, macfont->subFontArray->familyPtr->faceNum, macfont->style, macfont->size, first, count, fontbase + first); #endif Tk_FreeFont(font); bfi = (Togl_BitmapFontInfo *) ckalloc(sizeof (Togl_BitmapFontInfo)); bfi->base = fontbase; bfi->first = first; bfi->last = last; bfi->contextTag = togl->contextTag; obj = Tcl_NewObj(); SET_BITMAP_FONT_INFO(obj) = bfi; obj->typePtr = &Togl_BitmapFontType; return obj; } /* * Release the display lists which were generated by Togl_LoadBitmapFont(). */ int Togl_UnloadBitmapFont(const Togl *togl, Tcl_Obj *toglfont) { Togl_BitmapFontInfo *bfi; if (toglfont == NULL || toglfont->typePtr != &Togl_BitmapFontType) { Tcl_Interp *interp = Togl_Interp(togl); Tcl_AppendResult(interp, "font not found", NULL); return TCL_ERROR; } bfi = BITMAP_FONT_INFO(toglfont); glDeleteLists(bfi->base, bfi->last + 1); /* match glGenLists */ return TCL_OK; } int Togl_WriteObj(const Togl *togl, const Tcl_Obj *toglfont, Tcl_Obj *obj) { const char *str; int len; str = Tcl_GetStringFromObj(obj, &len); return Togl_WriteChars(togl, toglfont, str, len); } int Togl_WriteChars(const Togl *togl, const Tcl_Obj *toglfont, const char *str, int len) { /* TODO: assume utf8 encoding and convert to font encoding */ Togl_BitmapFontInfo *bfi; if (toglfont == NULL || toglfont->typePtr != &Togl_BitmapFontType) return -1; bfi = BITMAP_FONT_INFO(toglfont); if (Togl_ContextTag(togl) != bfi->contextTag) return -1; if (len == 0) len = strlen(str); glListBase(bfi->base); glCallLists(len, GL_UNSIGNED_BYTE, str); return len; } Togl2.0/toglProcAddr.c0000644000175500010010000000306311001053401013460 0ustar gregcNone/* $Id */ /* vi:set sw=4: */ /* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2006 Greg Couch * See the LICENSE file for copyright details. */ #include "togl.h" #if defined(TOGL_OSMESA) || defined(TOGL_WGL) /* nothing extra to include */ #elif defined(__APPLE__) # include #else # if !defined(TOGL_X11) || !defined(GLX_VERSION_1_4) # include # endif #endif Togl_FuncPtr Togl_GetProcAddr(const char *funcname) { #if defined(TOGL_OSMESA) return (Togl_FuncPtr) OSMesaGetProcAddress(funcname); #elif defined(TOGL_WGL) return (Togl_FuncPtr) wglGetProcAddress(funcname); #elif defined(__APPLE__) char buf[256]; NSSymbol nssym = NULL; sprintf(buf, "_%.*s", (int) sizeof buf - 1, funcname); if (NSIsSymbolNameDefined(buf)) nssym = NSLookupAndBindSymbol(buf); if (nssym) return (Togl_FuncPtr) NSAddressOfSymbol(nssym); return NULL; #else # if defined(TOGL_X11) && defined(GLX_VERSION_1_4) /* Strictly speaking, we can only call glXGetProcAddress if glXQueryVersion * says we're using version 1.4 or later. */ return (Togl_FuncPtr) glXGetProcAddress(funcname); # else /* Linux, IRIX, OSF/1, ? */ static void *dlHandle = NULL; if (dlHandle == NULL) dlHandle = dlopen(NULL, RTLD_LAZY); /* Strictly speaking, the following cast of a data pointer to a function * pointer is not legal in ISO C, but we don't have any choice. */ return (Togl_FuncPtr) dlsym(dlHandle, funcname); # endif #endif } Togl2.0/toglpy.h0000644000175500010010000000443710663455075012457 0ustar gregcNone/* * getToglFromWidget: * * Given a Python widget, get the corresponding Togl pointer. * and should be included before this. If included into a C file, * there should be a static keyword just before the include. * * There should be one copy of getToglFromWidget per-shared libary so that * the library's Tcl/Tk/Togl stub pointers are properly initialized. * * Copyright (C) 2006 Greg Couch * See the LICENSE file for copyright details. */ Togl * getToglFromWidget(PyObject *widget) { PyObject *cmdNameObj, *tk, *interpAddr; const char *cmdName; Tcl_Interp *interp; Togl *curTogl; #ifdef USE_TOGL_STUBS static int didOnce = 0; #endif /* Python: cmdName = widget._w */ /* Python: interpAddr = widget.tk.interpaddr() */ cmdNameObj = PyObject_GetAttrString(widget, "_w"); tk = PyObject_GetAttrString(widget, "tk"); if (cmdNameObj == NULL || !PyString_Check(cmdNameObj) || tk == NULL) { Py_XDECREF(cmdNameObj); Py_XDECREF(tk); #ifdef __cplusplus throw std::invalid_argument("not a Tk widget"); #else return NULL; #endif } interpAddr = PyEval_CallMethod(tk, "interpaddr", "()"); if (interpAddr == NULL || !PyInt_Check(interpAddr)) { Py_DECREF(cmdNameObj); Py_DECREF(tk); Py_XDECREF(interpAddr); #ifdef __cplusplus throw std::invalid_argument("not a Tk widget"); #else return NULL; #endif } cmdName = PyString_AsString(cmdNameObj); interp = (Tcl_Interp *) PyInt_AsLong(interpAddr); #ifdef USE_TOGL_STUBS if (!didOnce) { /* make sure stubs are initialized before calling a Togl function. */ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL || Tk_InitStubs(interp, TK_VERSION, 0) == NULL || Togl_InitStubs(interp, TOGL_VERSION, 0) == NULL) # ifdef __cplusplus throw std::runtime_error("unable to initialize Togl"); # else return NULL; # endif didOnce = 1; } #endif if (Togl_GetToglFromName(interp, cmdName, &curTogl) != TCL_OK) curTogl = NULL; Py_DECREF(cmdNameObj); Py_DECREF(tk); Py_DECREF(interpAddr); #ifdef __cplusplus if (curTogl == NULL) throw std::invalid_argument("not a Togl widget"); #endif return curTogl; } Togl2.0/toglStubInit.c0000755000175500010010000000304211002045770013536 0ustar gregcNone/* * Togl - a Tk OpenGL widget * * Copyright (C) 1996-2002 Brian Paul and Ben Bederson * Copyright (C) 2005-2008 Greg Couch * See the LICENSE file for copyright details. */ #include "togl.h" /* !BEGIN!: Do not edit below this line. */ ToglStubs toglStubs = { TCL_STUB_MAGIC, NULL, Togl_Init, /* 0 */ Togl_MakeCurrent, /* 1 */ Togl_PostRedisplay, /* 2 */ Togl_SwapBuffers, /* 3 */ Togl_Ident, /* 4 */ Togl_Width, /* 5 */ Togl_Height, /* 6 */ Togl_Interp, /* 7 */ Togl_TkWin, /* 8 */ Togl_CommandName, /* 9 */ Togl_AllocColor, /* 10 */ Togl_FreeColor, /* 11 */ Togl_SetColor, /* 12 */ Togl_LoadBitmapFont, /* 13 */ Togl_UnloadBitmapFont, /* 14 */ Togl_UseLayer, /* 15 */ Togl_ShowOverlay, /* 16 */ Togl_HideOverlay, /* 17 */ Togl_PostOverlayRedisplay, /* 18 */ Togl_ExistsOverlay, /* 19 */ Togl_GetOverlayTransparentValue, /* 20 */ Togl_IsMappedOverlay, /* 21 */ Togl_AllocColorOverlay, /* 22 */ Togl_FreeColorOverlay, /* 23 */ Togl_GetClientData, /* 24 */ Togl_SetClientData, /* 25 */ Togl_DrawBuffer, /* 26 */ Togl_Clear, /* 27 */ Togl_Frustum, /* 28 */ Togl_GetToglFromObj, /* 29 */ Togl_TakePhoto, /* 30 */ Togl_GetProcAddr, /* 31 */ Togl_GetToglFromName, /* 32 */ Togl_SwapInterval, /* 33 */ Togl_Ortho, /* 34 */ Togl_NumEyes, /* 35 */ Togl_ContextTag, /* 36 */ Togl_UpdatePending, /* 37 */ Togl_WriteObj, /* 38 */ Togl_WriteChars, /* 39 */ }; /* !END!: Do not edit above this line. */ Togl2.0/toglStubLib.c0000644000175500010010000000243510663455074013361 0ustar gregcNone#ifndef USE_TCL_STUBS # define USE_TCL_STUBS #endif #undef USE_TCL_STUB_PROCS #ifndef USE_TK_STUBS # define USE_TK_STUBS #endif #undef USE_TK_STUB_PROCS #include "togl.h" ToglStubs *toglStubsPtr; /* ** Ensure that Togl_InitStubs is built as an exported symbol. The other stub ** functions should be built as non-exported symbols. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT /* * Togl_InitStubs -- * * Checks that the correct version of Togl is loaded and that it * supports stubs. It then initialises the stub table pointers. * * Results: * The actual version of Togl that satisfies the request, or * NULL to indicate that an error occurred. * * Side effects: * sets the stub table pointer. * */ #ifdef Togl_InitStubs # undef Togl_InitStubs #endif const char * Togl_InitStubs(Tcl_Interp *interp, const char *version, int exact) { const char *actualVersion; actualVersion = Tcl_PkgRequireEx(interp, "Togl", version, exact, (ClientData *) &toglStubsPtr); if (!actualVersion) { return NULL; } if (!toglStubsPtr) { Tcl_SetResult(interp, "This implementation of Togl does not support stubs", TCL_STATIC); return NULL; } return actualVersion; } Togl2.0/togl_ws.h.in0000664000175500010010000000020210534514447013204 0ustar gregcNone#ifndef TOGL_WS_H # define TOGL_WS_H /* define windowing system togl is compiled with */ # define @TOGL_WINDOWINGSYSTEM@ #endif Togl2.0/tree2.rgba0000664000175500010010000020100010534514447012625 0ustar gregcNoneno name@@@?0?;?000@0@1@116@@000@0@,)55@?,0000 @0::@600000*@566@45)0000)@1540@4@004@)114@1@004F@1145)000@ 0@0*104)000 ,@0,45@)000 @0156@:@00 @@0*4>@;@0@  ((64,51:@6>,>( (( ($6,*>54@1,16:5$JJ (6C(@E50(((*@@1,54)$*441,, $$ $ T@?*> fa>151:4*((((((( (;))$(*)$1E41,, N@((6?C)(((  L\lF;,*5 65WF>4;4*(450(((((0E$4*5N   ,?((((*(056()0,()0,0$W NJ,1*FcPFI;IZoV>@ 44C50((,?   L,1N@00:440>F>*((((>5,)( *5>Jp0**5?$1$(@(((,:6($,4(140)*,**)6O4* ((5;6456TP``:1F??400((((*6 (N\ $YVpQ;1:>;:*00450500(((0NPF*((*0550())1045) (0((()*(()*)(,,)***5*))*( (((0>0(*:5J:0444>:0((()),4$(E@? ]C;;;;;6NQPFZN551466J0((055*0>4( *>:@()*,,**( ** (5:1($($(*) *)***1*$)* ( ((0**(((*:*00*:5((((**5 FC66((IP51( ;;;;54oJF:4:5;:5T:***44*(:0( (*( )),*$$  ( (:0 ( *( ((((*(((0:(4:((((((()),FI0C66;$L;TY;6I5; ;;;;44;o{Y444:5@:054*(((**(**((( ( (   0( ((  ((((( ( ((((((*(((** *0((((((((()**4>4:,5a?5:bTEC10?L;;;;::r`>@>:00>0(**((((((((( ( (     (4*((( (( (((( ((((((*(())(*((*)*,*0*:@4445>Lz;;;;;5bwY>@55*(**(((((( (      (((550*( ( (((( ( ((*(((((((((((****0**4*04>@YmJ;;;;5Q]|J:40:40(((((((((((( *( ( (   ((4E0((( (( (((( (((( (((((**(((((((((((**(4*400555JN>0;;;;5Yrf>50*0*(((((((( (((((>:( ( *(  *:0(( ((((*0*((*(( (((((((((( ((((((*(05(000554:@4*;;;;;5qcE:4*(((((((((( ((( 05( (    *((000((( *4*((((( (((((((((((((((***((44*5445>55540;;;;;@?cmTEJ:( ((((( ((((*:0  (((( (( ( (* (  (0>>0(( (0((( ( (((*((((*(((00540(*40*444:F:5440;;;;;ENc|kT>@5( ( ((((( **J4 ((( *4(   (040 (( ( ( (((( *0(((:@0((**00004:@YE444;;;;;?IT|qZfV>40( (( (((EJ*  (   (  ** (*4*( (*( (*( (((( (( ((50((*0:5**0:NNoJ445;;;;;?FNJ`TT@:50(( (((5b*  (   >E>0*0J:( (( (*( (( (0@*(*04PT504:E:>>55;;;;;;;;Y`P60440**( (((((* *0r5    (Vc\F@EJ5* (*(( 0(((((((( ( (0E\:055@@YE:V\E@:5455;;;;;;;;OZo;;;C4**( ((*((4 4\::0    (( *NfbYNVE00((**0(*( (((((((( (0>550>55*4@\mm`@514:54;;;::65WF`PC>C0((( ((( ((((( 0\V>0 (0*    40 *JT>5@*4>4*((*04*( (((( (((*00**(((*FJN>EE>;;>EFE;;;6l1I\rE:;@0(*( ((( (*0( (>F4* 4F* (    :FF50**545* (*50( ( *( (*(( (****(((*5@F504:J@WTVVT:;?;m{rrV>I@F5*@*( (( (45 (40( (5PF4   (  0@0(** *5@* ((054( :@*( *4( ((*(( (((5NE505:E:;LFF>5;Ec~mYELwbY5*@J0( (5(((0J*4*0*(((EEmpT   0  ((  (* ((:TP0((044(( ( ( 5J( 0( ( ((((*(((((((0>>005:::66;YF;;Ycmkf`bY:4@P@0( *( (0VFY@54((0EY{Y4   0J  ((4(  (0JJ0**(* * ( ( ((((0*((04**((0>*0>P:>5;lyE;;vbprqbm`@:450***(((( EbmJ4(*EoY|:( (( (0(  4: (>E44(((   ( (((*(((5\5*))),*4EP@55Nreb;;v|Q\cZI@T:00*0 05((( (@rY::\JE:(  *((( *4 ( 4@>5*(  ( (((**(*4@45,))0E]T>I45Lq@;;:PWmfbLcJ40*0*(>Y0( ( (>TfbbY>*(( 0(  ((((    (*(  ((( ( ((4*0*05>((*))*4`bZ@EFQY{:6;Z\~flc>(((*(0FE*(**( *>mTE* ( (  >J(  ((0     *0( (( (***045>4?;((*40@>C6JYZbJ@55;n6|wbJTmVE((((0:05**(0( (((***( (((( ( FT( (*5(   *4(**( (((((*04:FF5(,@?*0@`@554NfkZWC45565p~?5?apP@50 (:((( 4*(((54(( (((((( (( 4EV* (((*( (   ((*5TP0 ( ((((*0:@>P0(((,,(4;@514:n`x\|J66614ye>>PcP\@50( (*( *5@4*J@ ( *4( (( EV@ (0 4*  (:0(( ((*>TF* (( *@TTF>*((((**F??0*5:IVf\rN:::vY>PN@5:40(((((( (4@T*N> (0*(( ( ((@YN   ((   5N:0( ( (( (4( (* (0>N\T>(((((*5{F>0,1@PI]P{Z445:@I1JE:4045(*E@0( ( ( 4J(FE (  ((5J5(   (* (( *>F5* (((( ( ( ( (0>@4JT>0*((**EW464,1;IV]Q@FV55;:NZ154040EN4*P\>(4b: ((05(*5(  (:\5 ((((( 04 (( (( (0@E( (( (((( (( ((((0::(4:*50((*,,5050:?:OhF@:ozJ6;:ZF504FV`00EJ4(*cV(*0@N*0N0  0F4 4:E4:@(( >@( (:@@( ((*( (((((((**(**00*4***4?4;1*,;EI{E:::;CZ6@YC;44;@F04VN*((NV054:4((V:( (( * (*( PfN**0( *04*( *@0 ( ( ( ((*0*(**((4**05001>J;C?400IO~E>LZ:cZ5ZnJ50*04E5>T50*(mmF:E( ( ( (( (@0 55( 5bN( (((05((*(( (4(  (((  ((*0*(((((***4@106CTN;@>>1>NF;YZVCI6h\qaO5EV>@4:F44**JbWN:( :5 (( (>0( (0VP0( 44(*(((@N4(*****((** ((05( (*(((*(40((:4*0015;QN::?4C:NEO]wq@Lz|6a\aphO0\\FV:0@\E45:cc{>*( (:5((( (( *50(*4\Y4  >:( (( Pb@00(*00500*(( (((04 (((((*::0(***),4>:::OOJ5\F\qVFlVZk;IqQITf(Jc@`E04oP**4PYE4((((( 4:((( ((*04@4VN@(( :E*0 4>:*0*0500*004( *0*( ( ((((((*0:0*4(*),1:;:ECOP:?CEVoT?OL\JqILLIEP05|pfFEJkP*::\T>40((( (>*(:0( (((*4@:TFP*:V(*0 0((**05404*E>5*55J5( ((*00 (4((((((***(0*4J5((0416056CF::>]mECOFZCJ?Ep?]p60(Pk`@5>4:Vk`@:5***((*(( (JF4(((((*0:JEE*Ew4 (5EN@4FE5>cmT5:\pPF* *4**(((4E>*(((0*44(4:E\>0*5F00>50>:55;TV;JNQ:6?L`r@>(0{mOT0**4N`\c\m\EN**V>(( *40*(((0((*>J4(@*(4 *(>fkJ5445PwyVEFybF5*((00*>>>JF5*(*5:55:(0:V\:**0:>444::>>?>;booOJl;::wTTbT@((wb:555NTb{\F*0@>*(( (***(**4(5c5**4 (4*(0(4YkYJ:>F@fpfTcp`bJ>50*(0*ETYN4****>N\F5(*:N@0555JPE44>FE>JVO@]|lEPJ6:CNeVPrC0(4l~V@TJN\Yk{FN>:5** 40E(((04*4(:rN*04 (5:54 4fykVPTk{yocVPbTF4:504F`54@E:4*0:YcV4(*4::0@F@fcT>40>:?EJPJE;IOEOrk;:11YPC:1*4akY{TY00`w|mw\4 (VN*(((*0*((0Vm0(*:F004* 5o||wwpkYbkF4\pV55:JT`N(*NJ@40*0Nof@54EJE4>F4Ybk`405@bTEFJ>6PZTWO|:;:4?lP;0)*0FrWpbP0(04YNPTJ4(** \` ((((*((*:F* VkJ4(@( (>@V\kopTNN`@0VrF5:PmP****4@55>>JVb\N0F\`>NN:JPY\;:@VTEFE>@PVqqal6;:510J0000:y\pJ:(((((0@:P(04 ** (((((**((0*(45>5(>0 (*ETobVJJ@>05P{yJNY\bJ040>>5@EPVPJ@@4(4Tf@JYJVVbL;F@>O:;@:FFLJV|6;:p11ea@>0VmzZcJCF4:*0(((0V0(( ((((((0*( (4EJN@:0*(   (0>`rmF:545VkN\{cJ>44>E:0::4@E:000*(>YNP\@PT`C5>JE@;5::JVPaYL{F:;{n4:V@YFN;,*4>:@40((( 005( (*(*(((0* *T{T@:0(  :PTmfJ@4>VrcyTJ4(*TJF400*4>N@>:4*4YTT:>`VkPEOcf\ZE::YVTZlk`6ww\>;610)*5>`J@4(*0 (0 ((4*0***:0 4pyo`P4((*   (*>b{YT>>fkV>E0*:\VV55:>>>P>5NJ5(54>5PNF`TJcmcNTTE>JNTQN]nk4{\oQ;4*)*(((050>V:04*0 F0(0@((((*(0N>00( (:yb:50*(* (( (0kkJ>N\::::@J@F>4:@NFFV>4FJ5((5E5VYPP\bc\JT\mkF>JTrhevhl1k~w]`TF@4****)**F4:NF(*(( (kF04T0*((**4wT0 :PwT4:45:( (( ((0*fNFbPNPPEJV@4@J>FPF5:P@>N@4((5F>TbPE\aN>EJ\fFCOPwnzF66{@YJTEE55F44::@>F4P4** (*04* J@0(***4J5( (45*:F>5YY0  ( 0N5FT``NP`pcVVP04F`TPN40*4>@NF:4504:E>@E:CFJCJEN@@CIn]`c6:\NFNTOO`\PFNJYJJ0:05fT(*(0@* *:0(**((4:5@**((*(**05JYw>   4YfJJ\NcfbJNTTE@>4(0@cpVV@>0:PFJb`P@05ETJ\V:J`TVc@::>@Vw1P4|W:cIJ{P;Coko`EE:P4((FY:(( EJ( ((*(((*((*4f@0((*( 0>54( >N`YJVE>VTPcV0:0*545Nwy\NYPkwcm`@5bo`kP>TcccfP>FFQ4x4pmk]NoqC6>OYCzrE>P>6FTJ(JmE(((4cP5(E:00*(**(*5b{oJN:*(( (0:0 ( 0*PTN`P@`fF4*>T>5PE>JPkyJ>PopEYcokPJrcro|r\oYYqoaW4hOV54]cZ]WC1EpoP>V`5>fF**0:cT0(YV:5*(**0FcPm`ok0 ((*( (((( (Tomc\fN4N\4(@wJ>NNJN>Pm\J\ybTbPb@FVcr\cVVf|rqlTkpOVI56>6@::?QLCC1:PwWYPP>5NJ500>\Y* >T@54*(05\mN>f{N:@((*(((5( **((((JcJbyrE((4*4ffcfcP5@bkowE>>:00FJJN@VmwpkYVrmlcz:656>L|Z?m\zV>EFTac54>4:4*0>EE* *:>44*(*JT:(:{kFF(0T0( *( ((((( *0(TPV:**5*4crrkfkNETprrm::>:40ETYbNccYTO{n\r?6;:66>l~ff{NPFCL`Y5@:044040**(:>:(((*04:E*(:myY0(050((((((((((( *005>* (E40EPJ\ob\JNVcwykc@@@:>4@>Nk\Vbro\bPrxxfoooohV5:::;1CYz44NYc\TQ```o:@J:*E40*** :V5((((4N:(((4@T>4*40****( (*((*(((0PY\* (@*5\>Jb`cppormpyk|E0J:5@JENbpYTmll|rmolnwlla`::;;NT\{::6OlobY`YT\PY:bV:>J>(*TE0((*5f@((((0F@44>50**0((4F*5E400>Yb> (*F\``mF@kpwJNV`Tm@:YFEFFJYpw\Pc|{xqbyry~mxP6;;o:{`|rY`Y{YTFfP>Tc:0T>*(05Em>5*(*4F:5TF:4(>4*5*>*:N544Py0 0*(5>0@@0>:N>:J?I:>LICC\NNV|mT]lkbefkoyoahV;;;::;;~b@lYeYerrfNycTY:5bN:J0**:JPY44*((*0(:T**0*fN*0(444E540Jb@ ( (*:0(NP@5((0;I??6NT?4>Q\PTko\VfLO~bYeTe]waY]`;;;66;5bVWrn\]ONcwwFmFT>5NypP>co|P0*>oNF:50((*((*40(0::4*4(4J5Y>05:( ( (**>0*0500**4Fb]L?cP>:CNZcYfcVPP::ZZEJ`f\Lb;;;;65:55656Tf]oc?:5J:Fcr`w|{JF:Fr4(*>5*000(*:*(*54*>N*0*4* 5*EV5@c00*4( (055***005446\`cNPmLCQkbhv\ZVbYCCWqTQWpwCN;;;;;:6:;;NlJlkQLFrF\rc~yFEF0P\E4*(4N0****N`:(*0:>PfE0((((**Jc>5>*F>5*((*>5:0*404E5>VcFP`Vh{VFYeWeyWYVppaZoxy`\lzY~f\e\;;;;;;;;;;~fZTfeY\mzN]w\P\NJT>Vk:540@JFP@@kT500450>`k4>:*5>5Epf>*@TF*(((0:5:0440**@ye?N\YxZJ\QWekhe]cZOqc{O?ELL\wq;;;;;;;;;;::15OnxqO\rqqw]Qbvpmop\VVcr>>@45kPN|V\:44@5( *5E44>5@555w{E:YoJ0>(*:PF:*040**@mO]{Vb|peV]OWh`lmJV\whal?Wnao~Nqh;;;;;;;;;;::Q5LC\zF]rWI;>J>VTTT\k@:J@:@:5V0*4@F4*(*F4*0EEPJE0Jk45pN*4:ENfwr40544005@Nw~rbpnhV`hcYTVZ?CLEJp|e>>4loVZO5;;;;;;;;;;4IFQ\hxQWlOOC50?{xc`I>cJ>JV{rTEo4:@TE4:05*F545kYbff0*0(*FcJ**4>@@V>04440?EETTfknaNOpzZPZ>OLEOkzlFIlfq?555;;;;;;;;;;5kmynm?6WLF:5;CWyyry|`>46;>@bmYYm`4>PTV:4*4*(*5*PTPP>(*(((*******00>*0000*;Pwmy`zzYV|PVyOZZmfynO{x55;;;;;;;;;;;;k5nY>6;??FC:QkxkxoNJOC?LCOPTrk\cobF4T\\@E:@5**((0**(((0((054455*04550044445TrYnZhrr`f]\\OrfffVfWY\::;;;;;;;;;;;;;;;;;;c::CeIr`O\lQZxpFJENJpbk\mycNTN>N@5JofPNE@E0*00(((((*5>50:E>44*55E54Pk@:4@YmVNro|vv`vnVq|QTavN;;;;;;;;;;;;;;;;;;;::T@vfWZcpTxponrNYJFYwrpJrVNyE:mrP:>:>54b`(((((*YY::4FPE5:04>45\fN>5bVVO?@P~rk`TpTEO;?O:;;;;;;;;;;;;;;;;;;;:56~lpYTI>Wna|bJFJFVoNFcoJc{{VE``>F:*05Y@((((0:J:>TE5JE0:>@>**F@JVJbVJJ?TNoko\IJY>N?5J;;;;;;;;;;;;;;;;;;;;51YWpw\EPrr`Fc{YrpOTJETcyNTPNboNY`FJF5>Yb>(*T4 *(0PN>0>TF5>:(4\V>054:JbPw|ECC?m|~z{llk]v~bP\LmLO|`a;;;;;;;;;;;;;;;;;;;;5\JJam``wJ>CIJ`OEac`J`JIZfY`rkoyYmk:40>F\E((@0 *4*>E5:FE5E44**VJEP5@NE5{YYLY~parYEObW]zb\xob;;;;;;;;;;;;;;;;;;;;;Nok|>5Pl`ENQTeoQYTY\Tc{pooJE55::045J*((**0>05>5>@*44*To@:`5FPE55`mlQJO@?>l|~WNEJpInnbbZZ;;;;;;;;;;;;;;;;;;;;;;WrFfywwrcCFNPcbbW{pTEZykpw]V5E4@5>J`4**(44F455*045045JkV545TP``p5vnlCIEWICJPoYnQfxbN]f::;;;;;;;;;;;;;;;;;;;;;;WamPTYEaLJJ\J@FJTbn]rYN?bcw|ooC@O5Y>E5*5PTP@**:F5:5000>554\bf54@Vc::5511\Qff@5FeFP]Lrln6:;;;;;;;;;;;;;;;;;;;;;;;;;5vpnfPIIN\hL>E\|YornP@b`r{ZJcv@?T:>FF5((0ENF540400**4:E5:4FP`>5@Pr]oTYYY{nCEpO\I>E?wvP]{c@J;66;;;;;;;;;;;;;;;;;;;;;;;;;54{lFIh]poV?@?chbfkOYpc{xL54TVPq@J:J5**((0:4*4:0((05F\54>ETV:>@Jp{Tlr`5`|CzfJpC?;;55;lCW;44;;;;;;;;;;;;;;;;;;;;;;;;;;;qlEV{nx{I`cP`q\hOETCVeJF4;:N]aPPNVV5ET0*4:04>:0*5@@NF@>NTJE>N\TokbqbbT4{r;JJ5\QF;;;;;:6W;66;;;;;;;;;;;;;;;;;;;;;;;;;;;lcwhZZpok\YNb\@;>CLTkoZ>OFeE*:`>*54:Yc@04@J>NYJJVobYJmkaZZhcWO]O4YY``FF;~NF;;;;;;66|6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;c|ofYQbk|vrf;?`YYkaq{YO:6;:NI:@Nf@44:FP@5@@N`wEPNYpP@QymaL?WcFPYY{{`;`;;|@;;;;;;;:::6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;c\PVVTZlhCCF\yNqkar\?C;PPmm5F`>44>@@:@FcrcPbLLvI>QcezN;z~r`{`{{Y;;;;5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;r5|xyLb|qy~~{Iq\`ha~~ll@ErnwPc\TEJF5:FPfF>@Nb{kmNPlPW]YT]mIl``F;;;Fn6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6|cԝrcYwb6C{EPPYVLYWWPO`F>:N\T::5:`bkNEPffywTLo\\hT|OPlmrqY]`;;;;F\lEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:56;y˼aT]]J6kbLcWvzqNPhbkzxxWw`VP@:IT:4>Jk`hfENf`VT`NTcNoQLNYWWOTf;;;;F\C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;65::rcFLT\E{QQZqPP~Wb|LVbOJP>cfJ6FbrEL`TTbm`rLV?Cb;I`C]vYZx;;;;;@I]O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66:rQqc\|JTToWbyCJ{NJEw`wpZ@FP`cYPbze?E;JOV@pmw;;;;;;;;;;;;LYJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66;QP`4WLcZ]T::PheF|c`TLy|e>@m|kOFPTNbewZEF`kYLrw;;;;;;;;;;;;;;;JJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;l:LZzxwxm66:NkJNovfbVLVpL45x~Y`TL@;?JPTprpofllw;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:6E?x64~lec;::;;;?@WZeTVopNOJL:4>xWWQ;?LYfcVfl~f;ww;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:6Wzz:4hac;;;;;;;5f;E~VTmTEbP;>6CavfzfJ6{TOraavY;Z;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:65NNyL;;;;;;>@{Yk`TkYC>`TEPIPF:a\J@bn\Y]lx~vohl;;;pN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:55;::I`]Y;;;;;;Yy`LYwP>Y|YVPW;4>pQFEao\WTbeekYC;;;;;ZfqN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:6:;::`TL;;;;;:FvevV?]wVVY5@>:bpofQcZm\Vflox?;;;;;;NqN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;LYL;;;;6:;F@Wlvo`WWT\yh5?J]PcF`ocW]|r:;;;;;;;;;N;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;>;@amVoV\wCP{O46?wozW|ObVZoY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;C@IaxϲVVwJPLPJFONqycJoOblcJWWY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6@eeoO~VQN\yma\nf@EbmyVCnT`kLN\o;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::Pbe]OQYJTwx`oaIN|{yxkJCwOҕY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yknlf\QLOhcWQo~p{{JwJ>c\Yn;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6?xxxZQNWwwpfWQl`axWYETck]n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66|pfYWWˈlT\h:]JkYlfmZC>Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Vmzwʉ~{oYY6`CkweQ]hrY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:`wmclfl`eavONQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Q{y]OfLLTfmlwoTZmJ@yC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Qxw{wyc;@Noa|pWCPNC@IC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;]|xL;;El;>@E:6:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;JzWYL;;;;Nl|L;::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;      )         $$   ,,  $ 0* ,)$ (JI(0>F$0FE50(((* $  *4$$$ )*(*$ $ PC>4> TV>5;:>4*((((((( ($ $$( ,C (( O>**;?@10),,()(  FWcL?11:  :6F:4,0*((440(((((4C*5*5N  (,?(( (0(1,($ $()554)W(NE044F`PEE>I$VeO;E(54I>0**4@   I45?5*(0*00>J>0(***E:1, (5:Fc40,>@(5)(@((($;;($ ($ $,1440*:P1*$((5?;5:>WOc];5PII5440***4? ),Ya *TPemF:46;::*0*5:4:44**(4PYP0,)*455*,,(4441, (*(((($(($ ($$,144:1,04 (((4@0*0>>V>455;F@4***004;),OIF($$eF$ ]]]]]TJQOEOJ5445:;F0*(0>:44F5*(0@@F,00441,( $$( ** ( 5:1($($$ **,4160)00 ((((000***0@044*@:((**11>$ NN;?,))0OV;:*$ ]]]]NFbfJ@:5:55>:N5**0:>0*>5*( (*(()04*)( (((:0 ( ( (*(** ((((**((4:(:>((((((*),4LJ0F6>@((J?TW>>N>@)(]]]]II]YpV444:45:4540***40(0**(( ( (  *( (( (*((( ( ((((((****** 00( (((***(,0*5@5?5>]?::bTFC66EJ]]]]YYmm`@F@>44E5000*****(((((( ((      *50**(( ((((( ((((( ((((*0*(** (*(*000*0*:>445:>Jp]]]]]Ohop\@@:50*00*(***(((((((( (*(  (  (*:>4*(( (((( (((( (((((0*****((((((****4*04045@>V`E]]]]LWb{N:54>55*((((***(((((0* (*( (((( ( (  ((( **:J0*(( (((*((( **(* ((*((00((*(( ((*(****404445:5EJ>4]]]]L]xkE:40400*(*(***((((((@>* (( (( (( *(  ( (( ( ( 4@4*( ((*(040((0*( (((***((((((((((***45*0045:5>>40]]]]]NyfF@50***(((((**(((*((4>* ((( ( ((( (( ((   **(540*** *50***(( (((((*((((((*(***(*55*544:>55544]]]]]\JboVNP>*((( ((((*(((***0@4 ((*( ** (( (0 (  ((5EE5*(((0**( (((*((((*((*00440*0540445:E:5544]]]]]ZOe{mY@F>* (( ((((0*(((0*N5 (((((( ( *4(   ((4:4 (((( * ( ((((( *4***>@0****44004>@TE545]]]]]\YWyp]k`E:4*( ( ( (*(((0(FJ* ( (((  (  00 *050( (0* ( (*(((((( ( (*:0((04>5004:NNkF44:]]]]]\YONaVVF@>4** ( ((((((**:`* (((  EJ@404T@( (*( ( (*(( ((( (4@***45NN545:E>>>55]]]]]]]]\`V?4::400*(( (**((*( (*4o5 (  ( *`k`JFJP:0(*0**( ( (( ((0((((*((((( (0EV:05:E@YE:VY@@:55::]]]]]]]VQ`o@@CI500*(((((00**5( 5Y@>4 (( ((   ( *(  (0Pmf\PYF45((004**( (((((*(((( ( (4>550>5:45E`kfY@55:>>5]]]WTOIWJ]QICI50*((*(( (**(*((5c\F5( 040 ( (  ( 50  0PV@>E05E50((0450*(( ( ((((( (((**04*****4JNN>@E>??@FNJ]]QIn@N]oJ?@F500*(**0(((04(( *FP>4( (:J4  (  (@NJ:400>::0 ((4:0((( ( *( ((*( (****(((*5@F:45:JEVQ\YT@]\OovwYCJFN@4F40((**((*5:( *:5*((:VJ5 (   (*  5E4*40(4>F0((*:>4*( :>*( *5* ( ((**(( (((5N@50:>@>@NJJ@>]PknWLOyk]@4NV5*(*>***5P04*40***EJorV  (0  *(*( (*  ((@\T5(*4:5(( *( ( 5F( 4(( (( (*((((((*4@>00:::::;@\J]]]|{alkkcf`@:F\F4((0*((5bJ\@>5**4F\yY5 4J  *05(   *0PP40000 ( (( ( (((*4**(04**(*0>*4@N>@>@orF]]qanpncmcJE:>500000**( ((NkoN:00Fm\y>((( ( ((  ((*5* 45 ((EJ:50** ( ((((*(((:V50,,0105EN?>>Prb`]]qyT\c]LJY@5545*(4:0**( ((Er{\@E`{NJ:* *(((( (  (*(((( *0 ( 5FE>0* (( ( ((*(0***4>450015F]Q@I;?Qr|a]]FTWlhcOeP55050*EY4(((( *FYfcc\@*0*( (( 5*  ((**   ( (*0*(  *0(   ( (4*0*0::(**),45]]WCJLTawOO]ZZzflkF0**404NJ4044* (4FmVJ0(((*((( ( EN(  **0    ((( 04*( (((( (0*0045>5??**044?>E;OZZaWVIJ]nLnbIVp\J0((04@5:40*5* (**(*00* ((0***( *( (JV* (*0:(   ( 05***( ((***(*45>JE5*,C@00@\>55:Neh\]NFLOQLpC:Ecr\JE5((*@0*(((50***>4 ((( (*****( ** :FT*  ****(((  ( ( ((0:TP4( (((***4>@@P0**(11*5>C655>k]xY~ZOOP@CyhC@TfTbJ@5*((40( 0:F:0P@ *(0:((**( ( JV> (4 ((5*   *>4(( *(0EVF* (( (0EVPF>**(((*0E@?405:JTfZn`QPTrYCVTF:>:5**(**(( (*4EY0P@(((4*(* * (((*(J\N( (  *( (  :N>4* (*(*4* ** (4@PYT@***(*05rE>016EOJ]Q|YIIPYQJ6PJ@:45:00JE4((*((((5N*JF(((( ( ( ((0*>T@( ( ( *0 ** (0EJ:0(((((*((((( (( (4>@4JT:4**(*0FQ4;54:@LWZWEFYJQ]CO]6>55:5JT:4Y`E*4b>***4:*0:* ( (*@c@( (*((*(44(*( **( (((4EE* (( *(*((*( ((((4::(4:*54***1,5155@E@QeLE?oyYT]J\N>4:PYb55JP5*0kY(05FN44T0 ( ( ( (4P:( (5@F5:@** (EJ( (((>F@* ((** ( (((((**(*0***00*400*5@5;101CILqE@@?CEkPV`L@:>CJP5>\P40*VV5>:>4((V>( ((**( 4( ( *4* VfN0*0* (445*((( 0E4( ((( ( (**040***(*4**05444?L>F@555JPzE@JW>ckN]oO:445:N>EV@54*kfPEF( ((*((((( (F0 *(>>* :bN*(*0(4>*(*((( (:((  *** (**040*((((*004>44;EVP?E>?:CNFEYWVCLPk]p{hT:J\EJ;CN:544Nc]V@(( (E:(*((( (J5* 05bV5( (:4(0***EP500004***00(( (*5:( **(***(40((:400046;QP;;C6F>OFP`onEOz|Pa`bnmT4bbP`@5E\F:>>ccr@0*((( (>:***((( 0>5*5:cY5(  E>((*((YfE45*040>450*( ((*44 (*((*0*>:0*0*0*,4>;;;QQO:]L`rTJ|nTYmVYrWNTf0PcFcJ55kN04:VY@5***(( (5>***( (((05>J:bTF** >F04 5F@4404:444445* *40* (( (((***004>404**),1:>?FCQT?EEIQpY@LIaNv\WPOJT4:ofNJPmP5@@`V@:4***(((*@**E:0(*(04:JEbPV*:T(44 4(**05>5450J@:0>>N5( (*044 *5*((((*000*444N:*(4556466FI>>C`hIFQFZJOP\oIarC5*Tk`F>E:F\m\E@>444*00*((*YP:000*055>TJF0Fo0(( ((>NVJ:JJ>EkoY:@`oPF0( *500*((5F>*((*44:5*5>FY>0*>J04>:4>:::CV|W@QQTOL\WcrJC04wlPT544>Tcbmbp`FT00V@**((0:5540000*0EN5(F**4 0*EprT>55>V{{YJPwbJ>0(*440EE@NF5**0>@:>>*4>Y\:000>>445>>@>EC@bloQPmYYYwZ\m\J0*pcC:>@TVf{bP45FE0*( *040*045*>f>4*5 *50(4(5bm\N@FJFmrkVfr`cN@:40(44NV\P4**00ETbN>*0@PE0:::NPE45@FJ@PVPC\xkNWNTYWQe\TwI505lzWFYPV`YkyNTEE>40(50E***454:*>rT444 *:>:5 :k{m\TTk{wmcVTcVF5>>45Jb:5@E>504@`kY:*0:@:0EFFcbT@54@@ELJPNE>NOITwh~]WE?\QF>:45`ob|\`54br|ryb:(((0\N0((*444*(4`p5**@J5450(>r||yypk\cfF5`oY>>>TVbN*0FJE:445TpfF:5FJF4@F5V`f\54:EaPEJJ>;PYVYP{|T]VEFmW@5445Jy]pn\5*45YNY\J5*00 (\\(((***0**0@J0(\fP:*@( (@EY`op|pTNJbE4Y|pJ:@TmP*0005F::E@JYf`N4F\\>TP>NPVYC>EYQJFE@@PZoo]lP]VI>?O545:@y`vV@*****4@>T*44( *0(((****40**50*55F>*>4( ((0FVofYNPFE4:TypNP\`cN454@@:FJVVPJE@4*4Pc@JYJVV`L@NE@P??@>JFQN~WQ]Wp>>faFE:Yoz]cJJN>>05*(*4V50*( (((((****54*((*:FNTE>00* (4EcwpN@>5>YkTbycNE45@F>4@>5EF:444**>YPT\EPTVC;>NFI@:>>NVTb\P~YWYyh?YYI\OVC50:EEE54*(*(45:( ((*000**0:0((0YyPE:4* (>PTokNE:EVpfwVN5*4\NJ:554:@NE@>5*5\TT:E`YbPEPec`ZI>@YVW\hlkLry]E@?;614>EbNJ:*05((04( ((*0505040@4( (5oyo`T50(0( ((0@c{\V@EkkV@J54@b\Y>:>E@@N>:PP:*:5@:VPFYTNbh`PTTF@JPVVQhwnCy\pY@:415,*05@5>YE:>45(*N4*5E((*0004P@450 (>yb@::4(*( (( *5kykN@P\>@>@FNEJ@:>@PJJT>5NN:*0:F:YYPN\``VJV`mfJENTwkozmo?m~ra`WLE;4410,*4T:>NJ04**(*kJ45Y40*004:rT0 ( >TrP5@>>>* (* **40k|NNbTNPTFPYE5@NEJPF:>TE@TF500:J@T`J@YZN@IL`{bFFOVwx{VJPzE\NWIN>@F;:@@JFJ5T:4*((0450*TF4*000:N5( ((((5:0>N>:`\4( (( 5T>{FVbbPP\fc\VT5:NbYYP:40:EETJ>5:45:F@EE:ELNEPJNEEFNwaefNY\OOPWOO`cVNPV`PJ5@4>fT00(4F0(((4>5*0000:>:@00*(**000:P\w>(( :`fNP\PfkbNTVNEE@5*4Jkp\\F@5@TJNb\T@45FVN\T:F\T\fE>>EEVv;Y>~kYcNL{QCFpkobNJ>P:*(Pb@**(F|N0***00*000005k{F4***(( (4@:5*(( ( EPb\PYF@YVTmY4@40:5:Tyy\T\Tmwfm`@:`m\bJ>P\\ckT@IFT>y>rkf`]ppJ?ET\Iz{J@YF?JTJ0PwN00*5fP>0N@55**0004>cypNP:**( (*4>0 *( (( *50TYT`PEcfN50EYE>VF@NTmwJEVo{mET`fcNJm`mm|p\kWZqqcYLhTW;;`b\b`F:JrwWEV`>EoN445EkV40c`E@4*005Pr\o`of4( (0*0*(**(((((VrpcbbN5P\5*FrP@PPNP@Vp`Nbr`T`P\@FTb{kY`VVh~wonhWloTWYPPC;E>?IVQJJ:>Tx`cVYJ@TP>45Ec\0(E`J@:405>frT@kyN>E*(0((*5( (00***(JcNc{oE**54:mmckcT>Ecorr@>@:45NJJPETcombWWwmkey~YPPPCN|ZEney\EJTYfk@>J>@:04EJJ0(4@F550*4NY:*>{oNJ*4T0((4*((*****(04*YPV:44>4:fywof|kNJVpryk>>@:54JVY`PcycYTP{m]pPL]WQTCh~kh|Y`PNQ``>J@5::44440*@FE0**05::E0*@p{\0*5:400*0*(*(**((4:5>E0(0P55PTTbobYJPVbrwo{fEEE>@4E@Pf\V\mk\`TwyykppppkZIYWW];F\zFFTcmaYY```p@JT@4F54450(Ec>0***:T>0*(5ET@50:54400*(*0(*00*0:V\\0 *E*@kETkbfpomrkr{mF4N:>EFETboVTkek{pmqhkomnckVY]]LV\WYTOlpeZ`ZVb\\@f\@@TE00\J4*04>mE0*((4PJ55@@4004**5N0>N>45F`c@((((00PkkfoJEkp{rNP\aWoE;]FFNFJ\moYQe{yrnazqwzpycT]]pW`~qZ`ZYYNcTEVf>4VF40:@Nk@>0*0:P@:TF>:*@54>0J4@T>:>\w0((((400>E5JE4@>PE@NFL>@OJIJ\TPYyfT]k~keffepyqell]]]TT]]ykIpZk\mzvfTwk\b@>fVET:40ET``::0(*04*>T0455kP45*::>J>:5Tb@((*(((*0@50TPF>0,5@JE@;TVC;@TYNVkm\YkPTa\fWcfhbfk]]]NN]LbW\wk]bQTewwFkJYE>TyV@kpT40EoPP@@5(*0**05404E@:4:05P>\@5@@*((((((*04E405:54446Ib]NEfTE?EOZb\f`VVT@@]ZLObp`Wq]]]]ONWLJC@JYf`peFC>PEPkyf{PNENp:04>>4454*4@0**>50ET454:0(:4F\>Fc0504*((*5>>44454>::?bbcPTpQFVkblwZZVe\FJZpWTWmvLh]]]]]YQW]YQlOlm\YP{Tf{l~|{NJP5\bJ:40:T:4440Vb@*05@ETmF40*0004NfE>>0N@:0((0E>>45:55N>F`mJT`Yn{YI]h]hyYZWppb]pyyb]my]~h]op]]]]]]]]]]|h\Vpl]crzVcwbTbTTYE`mE:>5FPNYJEkY@555:0Eck:E@4@FENymE4EYJ0*0*5@>>4>:404J|mETc\z`O`Y\emlkah]WpcxQFJP~O`~]]]]]]]]]]YYE>WozyV`{wppbWex{rwpb`\mrEEF::kYTY\>55F:*(4@J::F@J@@@{{JE\pN5@00@TN@45:444FoQc|ZcymkZ`V\kbnoQZazmcmFZppo|Tqy]]]]]]]]]]YYY?OEayPb{YOCEPEY\`\bmJ@PF@JE@Y50:EJ50*0T>04JP\VP:Pm5@wP45>JTkyw54>5:55>ETzwcyvlYblhaZ\bILTNPq{eEEFppak`Q]]]]]]]]]]FLNT]hrZ`qQTF;:Izw|kmOEfNEP\y\Fo{5>FYJ5>5>4N>::oboom444*4NfN00:EEFY>45::5@LJV\mmnaQQpzbWbFWTNVl{pONlfrNIQQ]]]]]]]]]]IkoynnF@\NJC?EL`yzy{|bF>?CFNor``ob:ETV`>:050(4>0TVTT@*4**0444404455E045550@W{zw|cyy]ZY]xWbbpfynTyIL]]]]]]]]]]]]lNn\F@EFELLCTrzlzyPQWNETNZV`wmcfpmN:YccFN@F>**00400***40*4@::>>4::::44:::5>Yp\wcovvfmeccWqkkkWkY\kYY]]]]]]]]]]]]]]]]]]e?CFhLr`VarY`~rNONYTwfwcp{fV`VF\J@TrkPVFFN5455*(**00>F>5EPF::4@>F:5TpF>:Fbp\V|{xzc|r\qyWVbwZ]]]]]]]]]]]]]]]]]]]TTVIwfZ]hq\{wwmoYcPPcy{rT|bYPFpwT@E@F:5fb****04b`>@5P\J>@::E:>bfTE>fZ`YJJY{of\rVJP@I\Y]]]]]]]]]]]]]]]]]]]TLT~npZYNC]mb|bVQVNYpNNmwVp|bPc`EP@05>`E**004ET>@TE>VJ4EFF@44NET\PfZQOJYVpnrcPQ\EPE?T]]]]]]]]]]]]]]]]]]]]PF\\px`JWvp]J`v\{pQ`WN\kyJY`YowPbfPTJ>FbcE*0Y4(00:VPE4E\F5EE0:c\E5>>@PcV|JOLFpz~~kkfbxhYbToOQ{ck]]]]]]]]]]]]]]]]]]]]PbONcoaavLEFJP\OJbf]NkVTekYbwr{boo@::EN`F*(F5*050@J@@PJ:F:>40\PJT@FTF>|bbT]|qcvaLT~eZawccypq]]]]]]]]]]]]]]]]]]]]]Wp{l{E?Wm`IPVYhn]c`beWm|rpwPN>:EE55:N0(*44:E5>E>EF4>:4VrF@b@PVF>>brlVNQJEEl~~Z|PIPwOqohokk]]]]]]]]]]]]]]]]]]]]]]`vLevvxrcIJVVomocyVLa|o{{c\>N>F>EPb5040>>N:>>45:>5:>TpY>:>YVbbp>ywnLOL\NJNVoYlWcqfWblYY]]]]]]]]]]]]]]]]]]]]]]`cqWY\LeONPbPJTVboxcwbVFlkwrwNIT>`EJ>5>T\VE45@P@E>455E@>:fkk>:F`m@@>>;;cZhhJ;LkOQaTqmpPY]]]]]]]]]]]]]]]]]]]]]]]]YLrqvkVNLTcnQENfcryrZFlcw|cQeyJJ]>FJJ>0*4NTN>:5>:440>@J>@:PYcE>J\{`oW]\\w\ZpW]PEVVwxYb||hIP]PP]]]]]]]]]]]]]]]]]]]]]]]]]NE{mJNncvrZJIImrmkmQckyT@:\\VqFV@N:44005@>55@5005@Vb>:@J\`@EFNyYoxb>b~\zhOpV\]]QQ]rJ]]OO]]]]]]]]]]]]]]]]]]]]]]]]]]]ymIW~rz~Omo\kycnQNYJ]mON;E@YkcV\Y`Y>NY50:>:>FE54>FFYPFEV\PNEVbVrohwhhW;r]ZZPcac]]]]]YV\]TT]]]]]]]]]]]]]]]]]]]]]]]]]]]mkoeeyym`bQhcF@FINWrq\FTNmJ5EkE0>>EcoJ:>FNFY`TT`yk`Prkb`ale\TcV>\\bbZZ]~\c]]]]]]TTQ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]~fwla\hn~vrn@F`ZZkcqzZTC?@@QN?FVoJ::FNVJ>JJVfyNYVbwVFWypaPEYeLY\\b]b]]W]]]]]]]YYYQ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]eaY]]\alkFJNfyPqlhzcINCYYpm>PmF5:EFFENPoyoYkTVxLCWck|TEz{yvbbZ]]]]O]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]vNyyPly~{{P~xf`hb~ppIJypwTf\VFVP>@NYkNJJVfopTWlPZ`]YcpOmzbbY]]]cnJ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TfϜyfcrc>LNTPYYPa]aQTcNE@P\T>E>EkkoVPYkmYVwaakYTVmlqqZ`b]]]]cnp]a]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TLQYzźfY`fN>phVcYyzqOTqhmzzx]{h]VF>OY?>EVwkpoJTmfcYfQZlTpZQQ]ZYQWh]]]]cna]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]PJTTyeLPZaNVT`qQW]e~Q`lYPVLkmQ@Pk{LVf\\mpkxQ`IJhELbZb~v\kx]]]]]aVbh]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]NJYwWqkbNTZqZkxIPyQPJ{f{xbIP\km\YkoIJEOV\Yp]]]]]]]]]]]]bee]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]PP]YWcL~ؾZQe]]WVVVhcNfkZTy{fFLrkVLY\TfmaJOcl\h{]]]]]]]]]]]]]]]ee]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]oYP]y~vrwmQTYWkQTlwpm]QYpO>>~bhZQFEEVYYvxrphmm]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TPIEyPIzmff]YY]]]\V``e~\`wwVWQO@>F`bZ?FO\ok`oq~h]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TPZyyVJhbc]]]]]]]FfEN`\r\PkVEFCIlzloT>zYWykhyc]p]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]YPNOOf]]]]]]LIzble\o`LFbVO\TWOChfQJfva`enznhm]]]~h]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TIP]TFLaco]]]]]]h{bPb~ZEbbaY\E?Iw\OPmqaa\kmckmb]]]]]qzh]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TPY]TJa]f]]]]]WWrhw\Cfyba`?JECkwvmZh`va\kpoz\]]]]]]hh]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]fof]]]]TJL\NYkwwcaa`fzl@JTe\mJcql]b{qY]]]]]]]]]h]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]QINmlWw`fFZ~T>@Fzra~Tf``~p]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\WWhyŭ``{NZVVNJWTw~kNoQcnhO]]p]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]QWfh~nT`\Ofrb]opJLfp~`NmYbkQQb~]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]WW`ehbQWaL]|vbxhNPz~xlQFwVəp]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]ymznhf\VWnm\Trzq{|]wLEc`]|]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TZyyyc\Wawwpf\Tpabwf\NWhlc|]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]TT|qh`Z\pY`lFaOkmwkmeOFo]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]bmyvŒrfZCaLkq\em˃o]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]Yox{ryyp~bwmwWPh]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]mxwaTkh]eypmwzlenQIb]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]mxwzvzw]\cqmph]a\TVab]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]o|yf]]c{]QVbYTY]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]foof]]]]k{f]YY]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]             ** *)),     1)($ II* (     0)()*  ,4>)$  ( 0*   * (0   )   6,,,>1()$*1;0 $ * )  ; *  *   *E$)  $0 $,,54 )$)  $ 14 ?:W`;) $   **($ ( *  $  )$(4)((((($@@?4?5( *  ((  *   () ,0  (((( \kJ00 4   *(   **)$(,$,1$$)$( (((( (JF4  (    ( 6$ 54*,$ *0((((((V@5 (  (0 (((*;\((((($:TE*    ( (04Pb:(((($05]E(  ((( ***:E5 (((($4C{4 *( (  ( ***45* ((((( CP0( (( ( (*4****((((((00PW@50(( (  ( ((  ((*0>00**((((((14Qx>40 4   4:   (04N>*0*(((((*5?lW:4*(00 0( (( (05@`@*00(((((*46:C5* (@ *  (5  (@@*(*0044400((((((((?Jb0  V( (*( ((  5N0 ( *4N50NV5500*00((((((()4:Q$$(*( :((  (*((0( 0** *(((5PcfY:0,,00*((($$$$E4>,((* ::* (*    >@E5>>4544544((($F,>O)((((*(  0(     *4:0(04@5LC:>50(*)FPJJ4()(**(  50  (05 (*E:0*05:4144400(4T6PfC:(*>4, ((( 4 00JN>  0**@ (55**0444,,1>5((?ZwN;>>544* (** 0(@0* 4:V:  >  **  ( (4(*4E4401CF5((Q@EWLE;@5( (4>0 0J:V\*( * ( 0N* $()5@4,*5FEP((\e:;?6,(,  (FP:((@c54*(  (4(*$ $(5LE5>)*:Va)(():?E5P@,0(*> 5@@EE4   ( **  )INL6::EEyN)((;:INY>;:0 0* (E40*4  (*4(10 ( 146,:F;>0*(((L$PT5015*  ( 0: (  (0:*$54 5N4***>OC>>1(($$ L`Q*()4>0(  ( (( 0:** (**4  $$*01)(*0ZE\vC`5(($ $QE$ 45*4( (0(50*5**   ( *04*( ;41$ *,4?N@Qv:((${P@$*0( ( (0>:0((:5((044(*m50($)4;6F;`@(($$0v1**  0* (>:4*(  (  (( 04 :F(,,$(06FJ@4;6((()6o:  ( *05>* @  * (4  (* (( (  ($)),00EW;4,Wc6$((>mhp0( (055 *0 @5 0: (> ( (*4(*0( (((   (*$($ 01;m:00001o@$,]hW60*(((**(5045 * F0>N: (  (,(,*($$:@r:4>F*L~@$WZ>T1(( * *:( NE( 0( (F:    * $(10***)$0>54EC?44f(J>Jwl@:(*@**$,5 5C:4(** 5:  ( * 0 $)(00))0),*>:>Icb5:`\(o>:CWL5 :@05)$4@0 **CCF(** (5> (* *    00   $))))110(606@C>yO?@kO(6rF41>F4>0:* (N5 5:* (* ((* 54*(4   ( ( ()(*)16,116E?11C>J4V0;wf444> (FJN405J: ((:5*( 0  (*(505(E (   *  (  0( ((( ))04044OY541:;04,4xP0FT) 4TmLE0(0(*>F:* (  (*( **05b( ( *  04* (05*(  0(   (*:*  0 **(00004J{C0:06n))*;EPV,, YN1: (5>@>:>:05>*  (0 4  *0(  (44*((:E4(  (((40( ( ( (5:(**(((*004444Y`\:6\(((QVw65>50krJ,(**5:@TcPTT@4 0*  ((E (( (00* *(000*44**((  (040(*50  0( (450((0:40:E>4Ql\4>C((Q05O?6Y1 *Wh>0@45EFNf{{fE*5* (  4 ( *(N4 ((*((0::44000445540*0**   *5 00( (444  ( *0*>@40((4046:>>:4>?>LNCw($ F>1*$ *PvlJ:Y:E( >NbFE:J5 >:  (( 5J *5 4::544400>F4((:54 (005*54* *45* 44* *0(:>>@*(05YI::>:1IPLNIrr$(($,Z4, (5cF;I54 (*:4*00  @F  (*EN4 0 **04:40**0(*555((0:4 *( *(**040 055*04(05:;,0:NcI:5:55FLfJVW$(($ f1 $$ *`L>hF1( **: (  ((( 0( (400(((  (55**4440 (* **040*((  0>005055@40544@0,44:>C>zyFqQ$($L>C0*(EJV>F414(*( >( ( *00((  050( 04(4:4*( ((*( (( ((( *5404*55E0*0:410004>FEL~F:h4$(TT (bb\>4C44*  **0  (*   :kbV:0* *(04*( (0::45*( 0**   (*(((((:54((:>J:4:EF@?444JFIIOJ6\$h`VbbNrF*0,($$ (*@0(   * ( ( (NPNF@ *0:0* 0J@:*  (404 (**(5( 00(( ((405F:4EJE::>55>@FE>5>L pWlELoV:,(  *:(  4  * @0 (VF*( 5>0*((JJ5 (*0(*((((4005( 00((*(::@>@FE@:>ETP:5>CVN:LNF FLwkN:50*($  * 054 P4( 5  (c@ (:`E(* (*5E**40:>*0*(*4* **(*40 (0**40 (0*5::5FI;046JfP::?CY>`ca5$(Tw0O05,e,((4((**0(5(:  0* (( (:*((*50 @E * >@**44**5E4000 *4000  **40( * (*4044*1454;:>55:>>EEWyJ($Z?4;@511:@6055@:: (J:  0*  *0(4  *EE`0*5*(4*454**04*((  (5>00*((400>:50 (455>:0:F>EJ50,1:JY(1(\>$E44q4))Lb@:0*40E((0(4\5 ( (Pk0((5**  (00*4* 00040 *  (0>F@4440:@:>PYP>0(FE>E:4ENNJE>555L(O(PE@C6;k0(*CL,Qb>*(5**:>5*5*(F>(** ( ( (EYV:@0 (0 *0*40*55**:* 40*44:>**0EJEJPFJV\F4E@EE:>\NVOOPET@EQLC6~ Y;J( NOE:04(4JPE5*4:((5* (@: >4** ( (404EfE``  (05405*(*4 *@>*(0000*4>54:E:0EY:0JY@45>EVNEJE@IWVTTF>PP5:4($)$0**15Z:01(*5YL44**((4*  *:: (*(*(( (*@>40P\:** * (**5:>( (>EE555:5(*:>:EPE***( (555:5@JNJF@@PNIFTY]lpq(((()4\:*@5Qc>004:@VV:( ( *( *44 ((((( ::b**P@44(@  004(  55:::@:4*4FF>TP>**40((4>>E5ETN@@>:\TJ;J\fw0(($$(*W{rLkFEZy46114fc`:>(*( ( *0* ((*4 *@EE (* (* * *004>:4045>EF:EE:**40*(405@>>ETNEJ>N@@:>E>>;:4(($$(*6ZZQ$ n4:>:4::::>**4( 0 (4( *:0 (*50( *   >@> ( 0(*4E5:E>>E>PP:EF* 50*054:@J>>QNNVTL>\LNVPC~Z6F((((6;>I$(`$0>NN>;6:64{J44b5(>0(*4*0*  *F5  *0((4   5(0( 0:@0 *444>0*>@JJ0::>6>0,;5455:@ENE@IWYOLFV@ZN`VbFY@:(((haLN$fWI:TTfEI6:6I5Pb@@0*54*:@(0* **5P0*  (0((E>( *( 00 (4(((4VT * (( *((*(400:*4,0:614>5:@TPF>CIZVLJJOP;@E?:;hE>(((((((Y];x,@5@6>@ObbbE0>F:05((:4(0( 05:E(*  *E E5 ((((0(( *5*  0( *05*(14,,,551)0;@>>JN@@J::YI@NCQ:V@656FOhcc((($$( @:4LZF:44@IIb:\45**0F@N4(@FYV0( 0P50**( ( **( ( (4(@0 ** 0 (*(( *6E@;0@5,,4:EJENF@@@,*@@14Elb;C0Ic(((($ $ (()>Q:I@Z***b:*0>J:@@>0**0\P@( 0* * *(*:( ( (05 4N ( *  (* ((((*((,EEF@@TJ60;ICJWJ@@NE11EeC:Icbbe*5(((((($$((q;Y0LET450>b4:>6NYF@@005(4:** :(  5E0(*4:E4 4@**0 400  0*0 (*((0*0@F5@N@FO>1@E>FWE?CEE>>41>@@6IWe4NNF:@((((((((((ZWQF4b;C>@@ZPcP1;F54>44>0:F**( 0c5:0**F5( (* *@J 00(( 0JE* 0>4 (**0 **(((4Y`L1>I>NQ>4C?@EPOLILE?TNkv0,,0|e4F@Q(((((((((((($(:EQF0;J>CLP>;EVE>EE@>>@F00*(*N>:NN:@( (4((0((4(4(((PP0*@N5(4 0>:*((0(((4bP@IY@EPFE>E;@NIPN:CEPNJVy5I?F;f6ZL((((((((((((;*40CY,:P>?;,15,>NFEF5:>>F4050***(EP5 (05(0( (40555 0F((NV: (0:>NY\**0*0**05@bcT]J@JJJ>@LJI@CE55>66WcO0)$OkY@C>((((((((((( 145?Om]:5:Z4F6,(0TNFE@:>1,>44::@E50@F (0@0(*((0( (P@>>J  0E5 *550@4*0*005:5@Ero]hVETFIC66PVE?I5;>6;JZT1;YPYr0((((((((((((( TEe~PW0*:000,40@TJFF@E>*),,005>J5>@> (:>>*( ( :@:0* (((0 (0**(5;Tf\YbYePETFOO>;QW@CW>IlIhcq@ZeY>bY((((((((((((((pbbI(PJ1*1*,150>>YPJ@414104415>F@T:EE4* :::*004(   (((00 ((*0((*0000>kbTEYICEQPZ\fPO`YLOFII@VfOO:::FLE((((((((((((((((((((cI()*?0PL??:45IC15144E>E>NNF440(**(4@@45400  (0( (*0** (*5**EP4405@VN@:FNJPYPP`{]YnLakCQEaY\@@Qla:((((((((((((((((((($$c5*IJ?CPTq;C>:LV4:545TPpT45F50FJ*(EJ5(*(0* JN @E**(4:4(*(*4**PT@54N;::5:>br\kTYmkk{oe>PJEWb?6?,5?(((((((((((((((((((($$(PFN:E6*:YOr~ZFPTVF:115>F544:05@J4*>Y@*0* *E4 *4**:4(45 *054(*@:@J>E:55:F>behZfYIcrZEFwofaaI66E1;4*6((((((((((((((((((((((;:QJJ5;NVL5QhrEEOP>>1,>@J5:54>504:450(*5@( >( >5* (04**0 (>@4*404>N@PJ:544T\TZNZvmbVVT>LqIaF?J;V;>bNI(((((((((((((((((((((@44ENrIJY:141:NC:FII:J515F>>FE>T@>FNE*( *0:**  (04(*0**5(*( >\:5F4:@:4cTE?;IeZPZ:4>hhLE{r;a]@WPmF`Zp{I(((((((((((((((((((((Yz0F\Wkp0,FNE:?C;EW>@>:56:JEJVPNfPN40*(**((*:  (4((*(55(0*(@T54J4>E:44JPVqlY@@E1,4V]a;f@*6If4EpWJICC((((((((((((((((((((((`6|Q5P]\e\VE65>5E@>6J@41:JJVTckF@F\?>(* *(05F* ((4 ( ((0***5N@404E>JJ`1Y>pzQ;?4C656EZ>YEOcI0?Pe:((((((((((((((((((((((((`6EqF6:;5L40:E:45::>F@J:5,:FVJPJT@YN0,:*@*4* *:E@4 *4(**(*(40*(:EJ00:EJ5541*,wmkN5LzW1):n@5;qE;ZT>((((((((((((((((((((((((((($]OmI@:51>E?:,4EPN:VVQ;1>@NJ\]60@L1,@0*05*  055(( ( *0500*5:E54:>NIN@FCCb>af01T?J100*JI1@OmhL,0(((((((((((((((((((((((((((($ ]Na15F@NJ6144JZC@NN\;:@JkE\Z5,$656\40*5*  *( (* (*5F4045>>4:::PYCPQmJ4J\h0P\Pn,],*(((((;ZT4;((((((((((((((((((((((((((((((@NZ1CPJTY5EE@EN@C::@16?mp45),,6?NI>55:@*4: *0((0*( *445555::5:5@EEVfNFQII@*WTqc(::(:l1*(((((((C((((((((((((((((((((((((((((((TTpm`IbkTNC:?JEVZP@>0;T@1,*,04?E@*55@1(>0 **0>F0*(4:0:F>:>FEF@N\VLCCQI>6E;,EEJJ55(T`,*((((((((O$((((((((((((((((((((((((((((((TpzZQFp`PE;6>FWQTV>)*:66FCNT6Y5((**41(04@4**45:4*44:FVY5>>@N4,>YTJ60?F6>rEEYYJ(J((TF)((((((((($V$((((((((((((((((((((((((((((((p`F|@cy|c?@;;?NNh1,1EbQ0ZNJ6bC:01,>:>@*0>4**445045EPbE>N?>O0*>JOZ5,hbcTJYJYYqF((((T$(((((((((((((((((((((((((((((((((((((((((bT F?rVcb>JYVNTVZJ4`@E:FC\]b>>10COT>:>:445*05:N:45:EbJFJ>:?4;FC?IJ:LfmcJJ5(((*TP$((((((((((((((((((((((((((((((((((((((((((($FFEhQNJ\wpQI)1J1:1Z5:6y:51|]15P@54*5@@0004@@J>5@NJY\PP?>J@@Oq?Q>CNTaW~FIJ((((*5?n*)(((((((((((((((((((((((((((((((((((((((($ (@qcJCEE5(?;6>>CQN5:L>OQJJ:J@@>40;:,,5:N?NJ:>FE@cffEJ:>J;Vc1,;Cp>@55EcT((((*Nph5)((((((((((((((((((((((((((((((((((((((($$$(LYhehE4>CC1NP44?O]60]Lz4FcZW4;@65:1FE6,;NT16E@@FVJYkV>E11N16ElV,FhYCCEEE((((()*?`0((((((((((((((((((((((((((((((((((((((( (L6bob`Nf\:5NI*?1Y>@:Np])*`c4]b;5P@NNTJ\cm?45>>FE@FOC041:h?E,pQT@(((((((EEE(((((,5v,((((((((((((((((((((((((((((((((((((((( (:;5(kf5,zE?E0((bNo4QL*PP@PL>:PLC,0ETolZT>55>@PPO\@5:OYE4cp>@(((((((((E((((((,,(((((((((((((((((((((((((((((((((((((((((((Fw(,IbQLZZ\PnN$((bN:W50VJhF@\V@;;I5**NWIN@;,*1>EF]`Z\\`\LNNccppp@c((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((($$0,x?$ aNJLmT((((((*16ENba@>FJ>>61,)0N`C@>(06FTTJywEF`pmLccc(Ecc@@((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((($$;QkT($N\ENT(((((((T**TWEEJ>:J@11*4@TL]T;(afb??\]EFY{@TTTT(@ccT((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((bbh(((E**Y4(((((()0c4JEENF;5JC;@6>5,JcE40@N`E?NYZcWVPNcTT(((QqcT5(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((b(($ $($))6E?((((((>Z~L>F`ZC5JbF@CC0(1VcC64LZNFEENYOVV@,(T((((@LTT5(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((bb(($$(($(n6;4((((($0r\>FkoyJ6IVF@E,11,JTQN>fwJFP4CFV`h*((cb((((5Tc5(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((b(((((((((4?4(((($()00IVFNpoT@@FJZW*16I>kcT,|kJW64Epla$(((((((((5E(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((**,IYCrbyykVJE\*;]>(**aTVo\c@P;Q,CyP?(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((0,1IlJ\qe??\0;6e44\,??WkZT0W4?CN*05~p?((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((($,NOOhoO4N??5E\PLJPN01FTZc?0W;@vN)1>~P((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((($$>I@>14T{E6@`ocEVkI46fmaZbycC44a4ep?((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((TOPON`E>:>WVccrq{E?]mc\Z6Q6,PI0|O((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((*@@EE>:@WWbcVOE?WPQr`Y`z@>4:@Q1P(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((\PEEEEcWZEc>>Y,?>W?PIWC10~hr?((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((bZ?TeP]`f]\TCL*?0VYJY>CNV?(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((EvZWpkNJOL{Wk;hIEI;6vZ;(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((;fcbx:1:E46?LYJcYT>@C50Yb,((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((;EObTp]I(0:bnZI\W@,:60,1,((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((EElb\@EE4((0Oalbb()*,$$(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((4\cc??4((((5aaN\fc4(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((