configure.in 302 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.58)
  3. dnl ---------------------------------------------------------------------------
  4. dnl
  5. dnl Top-level configure.in for wxWidgets by Robert Roebling, Phil Blecker,
  6. dnl Vadim Zeitlin and Ron Lee
  7. dnl
  8. dnl This script is under the wxWindows licence.
  9. dnl ---------------------------------------------------------------------------
  10. dnl ---------------------------------------------------------------------------
  11. dnl initialization
  12. dnl ---------------------------------------------------------------------------
  13. AC_INIT([wxWidgets], [3.0.1], [wx-dev@lists.wxwidgets.org])
  14. dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package
  15. AC_CONFIG_SRCDIR([wx-config.in])
  16. dnl sets build, host variables and the same with _alias
  17. AC_CANONICAL_BUILD
  18. AC_CANONICAL_HOST
  19. dnl notice that if --host was given but --build was not, cross_compiling is
  20. dnl only set to "maybe" and not "yes" and will be either set to "yes" later or
  21. dnl configure will exit with error in AC_PROG_CC so don't test for = "yes" here
  22. if test "$cross_compiling" != "no"; then
  23. HOST_PREFIX="${host_alias}-"
  24. HOST_SUFFIX="-$host_alias"
  25. else
  26. HOST_PREFIX=
  27. HOST_SUFFIX=
  28. fi
  29. dnl When making releases do:
  30. dnl
  31. dnl wx_release_number += 1
  32. wx_major_version_number=3
  33. wx_minor_version_number=0
  34. wx_release_number=1
  35. wx_subrelease_number=0
  36. WX_RELEASE=$wx_major_version_number.$wx_minor_version_number
  37. WX_VERSION=$WX_RELEASE.$wx_release_number
  38. WX_SUBVERSION=$WX_VERSION.$wx_subrelease_number
  39. WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number
  40. dnl Autoconf-2.60 changed the meaning of top_builddir variable, so we have
  41. dnl to use our own replacement that will work with both 2.5x and 2.60+:
  42. wx_top_builddir="`pwd`"
  43. AC_SUBST(wx_top_builddir)
  44. dnl ------------------------------------------------------------------------
  45. dnl Check platform (host system)
  46. dnl ------------------------------------------------------------------------
  47. dnl OS (assume Unix)
  48. USE_UNIX=1
  49. USE_OS2=0
  50. USE_WIN32=0
  51. USE_DOS=0
  52. USE_BEOS=0
  53. USE_MAC=0
  54. dnl Unix kind
  55. USE_AIX=
  56. USE_BSD= dnl any BSD
  57. USE_DARWIN= dnl a.k.a. Mac OS X
  58. USE_FREEBSD=
  59. USE_GNU= dnl GNU/Hurd
  60. USE_HPUX=
  61. USE_LINUX=
  62. USE_NETBSD=
  63. USE_OPENBSD=
  64. USE_OSF= dnl OSF/1 (obsolete?)
  65. USE_SGI=
  66. USE_SOLARIS= dnl Solaris ("SunOS" >= 5)
  67. USE_SUN= dnl SunOS or Solaris
  68. USE_SUNOS= dnl old/real SunOS (obsolete)
  69. USE_SVR4= dnl SysV R4
  70. USE_SYSV= dnl any System V
  71. USE_VMS=
  72. USE_ULTRIX=
  73. USE_UNIXWARE=
  74. dnl hardware platform
  75. USE_ALPHA=
  76. dnl on some platforms xxx_r() functions are declared inside "#ifdef
  77. dnl _REENTRANT" and it's easier to just define this symbol for these platforms
  78. dnl than checking it during run-time
  79. NEEDS_D_REENTRANT_FOR_R_FUNCS=0
  80. dnl the list of all available toolkits
  81. dnl
  82. dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
  83. ALL_TOOLKITS="COCOA GTK OSX_CARBON OSX_COCOA OSX_IPHONE MICROWIN MOTIF MSW PM X11 DFB"
  84. dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
  85. dnl which are either yes or no
  86. DEFAULT_wxUSE_OLD_COCOA=0
  87. DEFAULT_wxUSE_GTK=0
  88. DEFAULT_wxUSE_OSX_CARBON=0
  89. DEFAULT_wxUSE_OSX_COCOA=0
  90. DEFAULT_wxUSE_OSX_IPHONE=0
  91. DEFAULT_wxUSE_MICROWIN=0
  92. DEFAULT_wxUSE_MOTIF=0
  93. DEFAULT_wxUSE_MSW=0
  94. DEFAULT_wxUSE_PM=0
  95. DEFAULT_wxUSE_X11=0
  96. DEFAULT_wxUSE_DFB=0
  97. dnl these are the values which are really default for the given platform:
  98. dnl they're used if no --with-<toolkit> options were given to detect the
  99. dnl toolkit to use by default for the target platform
  100. DEFAULT_DEFAULT_wxUSE_OLD_COCOA=0
  101. DEFAULT_DEFAULT_wxUSE_GTK=0
  102. DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0
  103. DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0
  104. DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0
  105. DEFAULT_DEFAULT_wxUSE_MICROWIN=0
  106. DEFAULT_DEFAULT_wxUSE_MOTIF=0
  107. DEFAULT_DEFAULT_wxUSE_MSW=0
  108. DEFAULT_DEFAULT_wxUSE_PM=0
  109. DEFAULT_DEFAULT_wxUSE_X11=0
  110. DEFAULT_DEFAULT_wxUSE_DFB=0
  111. PROGRAM_EXT=
  112. SAMPLES_RPATH_FLAG=
  113. DYLIB_RPATH_INSTALL=
  114. DYLIB_RPATH_POSTLINK=
  115. DEFAULT_STD_FLAG=yes
  116. dnl to support a new system, you need to add its canonical name (as determined
  117. dnl by config.sub or specified by the configure command line) to this "case"
  118. dnl and also define the shared library flags below - search for
  119. dnl SHARED_LIB_SETUP to find the exact place
  120. case "${host}" in
  121. *-hp-hpux* )
  122. USE_HPUX=1
  123. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  124. NEEDS_D_REENTRANT_FOR_R_FUNCS=1
  125. AC_DEFINE(__HPUX__)
  126. dnl many standard declarations in HP-UX headers are only included if either
  127. dnl _HPUX_SOURCE is defined, see stdsyms(5)
  128. CPPFLAGS="-D_HPUX_SOURCE $CPPFLAGS"
  129. ;;
  130. *-*-linux* )
  131. USE_LINUX=1
  132. AC_DEFINE(__LINUX__)
  133. TMP=`uname -m`
  134. if test "x$TMP" = "xalpha"; then
  135. USE_ALPHA=1
  136. AC_DEFINE(__ALPHA__)
  137. fi
  138. DEFAULT_DEFAULT_wxUSE_GTK=1
  139. ;;
  140. *-*-gnu* | *-*-k*bsd*-gnu )
  141. USE_GNU=1
  142. TMP=`uname -m`
  143. if test "x$TMP" = "xalpha"; then
  144. USE_ALPHA=1
  145. AC_DEFINE(__ALPHA__)
  146. fi
  147. DEFAULT_DEFAULT_wxUSE_GTK=1
  148. ;;
  149. *-*-irix5* | *-*-irix6* )
  150. USE_SGI=1
  151. USE_SVR4=1
  152. AC_DEFINE(__SGI__)
  153. AC_DEFINE(__SVR4__)
  154. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  155. ;;
  156. *-*-qnx*)
  157. USE_QNX=1
  158. AC_DEFINE(__QNX__)
  159. DEFAULT_DEFAULT_wxUSE_X11=1
  160. ;;
  161. *-*-solaris2* )
  162. USE_SUN=1
  163. USE_SOLARIS=1
  164. USE_SVR4=1
  165. AC_DEFINE(__SUN__)
  166. AC_DEFINE(__SOLARIS__)
  167. AC_DEFINE(__SVR4__)
  168. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  169. NEEDS_D_REENTRANT_FOR_R_FUNCS=1
  170. ;;
  171. *-*-sunos4* )
  172. USE_SUN=1
  173. USE_SUNOS=1
  174. USE_BSD=1
  175. AC_DEFINE(__SUN__)
  176. AC_DEFINE(__SUNOS__)
  177. AC_DEFINE(__BSD__)
  178. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  179. ;;
  180. *-*-freebsd*)
  181. USE_BSD=1
  182. USE_FREEBSD=1
  183. AC_DEFINE(__FREEBSD__)
  184. AC_DEFINE(__BSD__)
  185. DEFAULT_DEFAULT_wxUSE_GTK=1
  186. ;;
  187. *-*-openbsd*|*-*-mirbsd*)
  188. USE_BSD=1
  189. USE_OPENBSD=1
  190. AC_DEFINE(__OPENBSD__)
  191. AC_DEFINE(__BSD__)
  192. DEFAULT_DEFAULT_wxUSE_GTK=1
  193. ;;
  194. *-*-netbsd*)
  195. USE_BSD=1
  196. USE_NETBSD=1
  197. AC_DEFINE(__NETBSD__)
  198. AC_DEFINE(__BSD__)
  199. DEFAULT_DEFAULT_wxUSE_GTK=1
  200. NEEDS_D_REENTRANT_FOR_R_FUNCS=1
  201. dnl some standard declarations in NetBSD headers are only included if
  202. dnl _NETBSD_SOURCE and _LIBC are defined, e.g. getservbyname_r in netdb.h
  203. CPPFLAGS="-D_NETBSD_SOURCE -D_LIBC $CPPFLAGS"
  204. ;;
  205. *-*-osf* )
  206. USE_ALPHA=1
  207. USE_OSF=1
  208. AC_DEFINE(__ALPHA__)
  209. AC_DEFINE(__OSF__)
  210. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  211. NEEDS_D_REENTRANT_FOR_R_FUNCS=1
  212. ;;
  213. *-*-dgux5* )
  214. USE_ALPHA=1
  215. USE_SVR4=1
  216. AC_DEFINE(__ALPHA__)
  217. AC_DEFINE(__SVR4__)
  218. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  219. ;;
  220. *-*-sysv5* )
  221. USE_SYSV=1
  222. USE_SVR4=1
  223. AC_DEFINE(__SYSV__)
  224. AC_DEFINE(__SVR4__)
  225. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  226. ;;
  227. *-*-aix* )
  228. USE_AIX=1
  229. USE_SYSV=1
  230. USE_SVR4=1
  231. AC_DEFINE(__AIX__)
  232. AC_DEFINE(__SYSV__)
  233. AC_DEFINE(__SVR4__)
  234. DEFAULT_DEFAULT_wxUSE_MOTIF=1
  235. ;;
  236. *-*-*UnixWare*)
  237. USE_SYSV=1
  238. USE_SVR4=1
  239. USE_UNIXWARE=1
  240. AC_DEFINE(__UNIXWARE__)
  241. ;;
  242. *-*-cygwin* | *-*-mingw32* )
  243. dnl MBN: some of the defines have been moved after toolkit detection
  244. dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin
  245. dnl USE_UNIX must be set and not USE_WIN32
  246. PROGRAM_EXT=".exe"
  247. DEFAULT_DEFAULT_wxUSE_MSW=1
  248. ;;
  249. *-pc-msdosdjgpp )
  250. USE_UNIX=0
  251. USE_DOS=1
  252. AC_DEFINE(__DOS__)
  253. PROGRAM_EXT=".exe"
  254. ;;
  255. *-pc-os2_emx | *-pc-os2-emx )
  256. AC_DEFINE(__EMX__)
  257. USE_OS2=1
  258. AC_DEFINE(__OS2__)
  259. PROGRAM_EXT=".exe"
  260. DEFAULT_DEFAULT_wxUSE_PM=1
  261. dnl "c++" wrapper is not always available, so always use plain gcc.
  262. CXX=gcc
  263. LDFLAGS="$LDFLAGS -Zcrtdll"
  264. dnl
  265. dnl Some special code that's automatically added by autoconf-2.57 for OS/2
  266. dnl and hopefully also by autoconf-2.58 and newer on all other platforms.
  267. dnl For now however, we still need it to make sure the configure script
  268. dnl works on OS/2 no matter what platform it is generated on.
  269. ac_executable_extensions=".exe"
  270. export ac_executable_extensions
  271. dnl This strange code is necessary to deal with handling of
  272. dnl backslashes by ksh and pdksh's sh variant.
  273. ac_save_IFS="$IFS"
  274. IFS='\\'
  275. ac_TEMP_PATH=
  276. for ac_dir in $PATH; do
  277. IFS=$ac_save_IFS
  278. if test -z "$ac_TEMP_PATH"; then
  279. ac_TEMP_PATH="$ac_dir"
  280. else
  281. ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
  282. fi
  283. done
  284. export PATH="$ac_TEMP_PATH"
  285. unset ac_TEMP_PATH
  286. DEFAULT_STD_FLAG=no
  287. ;;
  288. arm-apple-darwin*)
  289. dnl iPhone
  290. USE_BSD=1
  291. USE_DARWIN=1
  292. AC_DEFINE(__BSD__)
  293. AC_DEFINE(__DARWIN__)
  294. DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=1
  295. ;;
  296. *-*-darwin* )
  297. dnl Darwin based distributions (including Mac OS X)
  298. USE_BSD=1
  299. USE_DARWIN=1
  300. AC_DEFINE(__BSD__)
  301. AC_DEFINE(__DARWIN__)
  302. AC_DEFINE(TARGET_CARBON)
  303. DEFAULT_DEFAULT_wxUSE_OSX_COCOA=1
  304. ;;
  305. *-*-beos* )
  306. dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
  307. USE_BEOS=1
  308. AC_DEFINE(__BEOS__)
  309. ;;
  310. *)
  311. AC_MSG_WARN([*** System type ${host} is unknown, assuming generic Unix and continuing nevertheless.])
  312. AC_MSG_WARN([*** Please report the build results to wx-dev@lists.wxwidgets.org.])
  313. DEFAULT_DEFAULT_wxUSE_X11=1
  314. DEFAULT_wxUSE_SHARED=no
  315. esac
  316. dnl ---------------------------------------------------------------------------
  317. dnl command line options for configure
  318. dnl ---------------------------------------------------------------------------
  319. dnl the default values for all options - we collect them all here to simplify
  320. dnl modification of the default values (for example, if the defaults for some
  321. dnl platform should be changed, it can be done here too)
  322. dnl
  323. dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
  324. dnl it's only necessary to list the options which should be disabled by
  325. dnl default, all the rest have default value of "yes" (or, rather, of
  326. dnl wxUSE_ALL_FEATURES which is the only which has to be set to "yes" by
  327. dnl default)
  328. DEFAULT_wxUSE_ALL_FEATURES=yes
  329. DEFAULT_wxUSE_STD_CONTAINERS=no
  330. DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
  331. DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
  332. dnl libraries disabled by default
  333. DEFAULT_wxUSE_DMALLOC=no
  334. DEFAULT_wxUSE_LIBGNOMEVFS=no
  335. DEFAULT_wxUSE_LIBHILDON=no
  336. DEFAULT_wxUSE_LIBHILDON2=no
  337. DEFAULT_wxUSE_LIBMSPACK=no
  338. DEFAULT_wxUSE_LIBSDL=no
  339. dnl features disabled by default
  340. DEFAULT_wxUSE_ACCESSIBILITY=no
  341. DEFAULT_wxUSE_IPV6=no
  342. DEFAULT_wxUSE_GSTREAMER8=no
  343. DEFAULT_wxUSE_UNICODE_UTF8=no
  344. DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
  345. dnl automatic features
  346. DEFAULT_wxUSE_ARTPROVIDER_TANGO=auto
  347. DEFAULT_wxUSE_OPENGL=auto
  348. DEFAULT_wxUSE_MEDIACTRL=auto
  349. DEFAULT_wxUSE_COMPILER_TLS=auto
  350. DEFAULT_wxUSE_HOTKEY=auto
  351. DEFAULT_wxUSE_METAFILE=auto
  352. dnl Mac/Cocoa users need to enable building universal binaries explicitly
  353. DEFAULT_wxUSE_UNIVERSAL_BINARY=no
  354. DEFAULT_wxUSE_MAC_ARCH=no
  355. DEFAULT_wxUSE_OFFICIAL_BUILD=no
  356. dnl Always default to no. Only special cases require this.
  357. DEFAULT_wxUSE_OBJC_UNIQUIFYING=no
  358. dnl ===========================
  359. dnl deal with configure options
  360. dnl ===========================
  361. dnl we use several macros here:
  362. dnl - AC_ARG_WITH/AC_ARG_ENABLE are the standard autoconf macros, see
  363. dnl autoconf manual for details about them
  364. dnl - WX_ARG_WITH/WX_ARG_ENABLE are their wx counterparts which perform
  365. dnl the caching of the command line options and also use DEFAULT_foo
  366. dnl variable as the default value for "foo" if neither --enable-foo nor
  367. dnl --disable-foo is specified
  368. dnl - WX_ARG_SYS_WITH is a special version of WX_ARG_WITH which allows
  369. dnl to choose not only whether an external library is used but also if we
  370. dnl use the copy of it included with wxWidgets or an already installed
  371. dnl system version
  372. dnl - WX_ARG_WITHOUT/WX_ARG_DISABLE mirror WX_ARG_WITH/WX_ARG_ENABLE but
  373. dnl should be used for the options which are enabled by default
  374. dnl - WX_ARG_FEATURE is a version of WX_ARG_ENABLE which should be used for
  375. dnl optional features, i.e. options which should be disabled if
  376. dnl --disable-all-features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are
  377. dnl also affected by this)
  378. dnl ---------------------------------------------------------------------------
  379. dnl global build options
  380. dnl ---------------------------------------------------------------------------
  381. WX_ARG_DISABLE(gui, [ --disable-gui don't build GUI parts of the library], wxUSE_GUI)
  382. WX_ARG_ENABLE(monolithic, [ --enable-monolithic build wxWidgets as single library], wxUSE_MONOLITHIC)
  383. WX_ARG_ENABLE(plugins, [ --enable-plugins build parts of wxWidgets as loadable components], wxUSE_PLUGINS)
  384. WX_ARG_WITHOUT(subdirs, [ --without-subdirs don't generate makefiles for samples/demos/...], wxWITH_SUBDIRS)
  385. AC_ARG_WITH(flavour, [ --with-flavour=NAME specify a name to identify this build], [WX_FLAVOUR="$withval"])
  386. WX_ARG_ENABLE(official_build, [ --enable-official_build official build of wxWidgets (win32 DLL only)], wxUSE_OFFICIAL_BUILD)
  387. AC_ARG_ENABLE(vendor, [ --enable-vendor=VENDOR vendor name (win32 DLL only)], [VENDOR="$enableval"])
  388. if test "x$VENDOR" = "x"; then
  389. VENDOR="custom"
  390. fi
  391. WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
  392. if test "$wxUSE_ALL_FEATURES" = "no"; then
  393. dnl this is a bit ugly but currently we have no choice but to manually
  394. dnl reset all the options with default value of auto if all features are to
  395. dnl be disabled because we can't have an option with default value of
  396. dnl "auto-or-no-if-wxUSE_ALL_FEATURES-is-disabled"
  397. DEFAULT_wxUSE_ARTPROVIDER_TANGO=no
  398. DEFAULT_wxUSE_MEDIACTRL=no
  399. fi
  400. dnl ---------------------------------------------------------------------------
  401. dnl port selection
  402. dnl ---------------------------------------------------------------------------
  403. if test "$wxUSE_GUI" = "yes"; then
  404. WX_ARG_ENABLE(universal, [ --enable-universal use wxWidgets GUI controls instead of native ones], wxUSE_UNIVERSAL)
  405. if test "$wxUSE_UNIVERSAL" = "yes"; then
  406. AC_ARG_WITH(themes, [ --with-themes=all|list use only the specified comma-separated list of wxUniversal themes], [wxUNIV_THEMES="$withval"])
  407. fi
  408. dnl we use AC_ARG_WITH and not WX_ARG_WITH for the toolkit options as they
  409. dnl shouldn't default to wxUSE_ALL_FEATURES
  410. AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 3, 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
  411. AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
  412. AC_ARG_WITH(osx_carbon, [ --with-osx_carbon use Mac OS X (Carbon)], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
  413. AC_ARG_WITH(osx_cocoa, [ --with-osx_cocoa use Mac OS X (Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
  414. AC_ARG_WITH(osx_iphone, [ --with-osx_iphone use iPhone OS X port], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
  415. AC_ARG_WITH(osx, [ --with-osx use Mac OS X (default port, Cocoa)], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
  416. AC_ARG_WITH(carbon, [ --with-carbon same as --with-osx_carbon], [wxUSE_OSX_CARBON="$withval" CACHE_OSX_CARBON=1 TOOLKIT_GIVEN=1])
  417. AC_ARG_WITH(cocoa, [ --with-cocoa same as --with-osx_cocoa], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
  418. AC_ARG_WITH(iphone, [ --with-iphone same as --with-osx_iphone], [wxUSE_OSX_IPHONE="$withval" CACHE_OSX_IPHONE=1 TOOLKIT_GIVEN=1])
  419. AC_ARG_WITH(mac, [ --with-mac same as --with-osx], [wxUSE_OSX_COCOA="$withval" CACHE_OSX_COCOA=1 TOOLKIT_GIVEN=1])
  420. AC_ARG_WITH(old_cocoa, [ --with-old_cocoa use old, deprecated, Cocoa port], [wxUSE_OLD_COCOA="$withval" CACHE_OLD_COCOA=1 TOOLKIT_GIVEN=1])
  421. AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
  422. AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
  423. AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
  424. AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
  425. AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
  426. AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
  427. WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
  428. WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE)
  429. dnl check that no more than one toolkit is given and that if none are given that
  430. dnl we have a default one
  431. AC_MSG_CHECKING(for toolkit)
  432. # In Wine, we need to default to MSW, not GTK or MOTIF
  433. if test "$wxUSE_WINE" = "yes"; then
  434. DEFAULT_DEFAULT_wxUSE_GTK=0
  435. DEFAULT_DEFAULT_wxUSE_MOTIF=0
  436. DEFAULT_DEFAULT_wxUSE_MSW=1
  437. wxUSE_SHARED=no
  438. CC=${CC:-winegcc}
  439. CXX=${CXX:-wineg++}
  440. fi
  441. if test "$wxUSE_GUI" = "yes"; then
  442. if test "$USE_BEOS" = 1; then
  443. AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
  444. fi
  445. if test "$TOOLKIT_GIVEN" = 1; then
  446. dnl convert "yes", "any" or a number to 1 and "no" to 0
  447. for toolkit in $ALL_TOOLKITS; do
  448. var=wxUSE_$toolkit
  449. eval "value=\$${var}"
  450. if test "x$value" = "xno"; then
  451. eval "$var=0"
  452. elif test "x$value" != "x"; then
  453. eval "$var=1"
  454. fi
  455. if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then
  456. eval "wx${toolkit}_VERSION=$value"
  457. fi
  458. done
  459. else
  460. dnl try to guess the most appropriate toolkit for this platform
  461. for toolkit in $ALL_TOOLKITS; do
  462. var=DEFAULT_DEFAULT_wxUSE_$toolkit
  463. eval "wxUSE_$toolkit=\$${var}"
  464. done
  465. fi
  466. dnl we suppose that expr is available (maybe there is a better way to do
  467. dnl this? what about using ALL_TOOLKITS? TODO)
  468. NUM_TOOLKITS=`expr ${wxUSE_OLD_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \
  469. + ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_DFB:-0} \
  470. + ${wxUSE_MICROWIN:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}`
  471. dnl Allow wxUSE_PM only for OS/2 with EMX.
  472. case "${host}" in
  473. *-pc-os2_emx | *-pc-os2-emx )
  474. NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
  475. esac
  476. case "$NUM_TOOLKITS" in
  477. 1)
  478. ;;
  479. 0)
  480. AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host})
  481. ;;
  482. *)
  483. AC_MSG_ERROR(Please specify at most one toolkit)
  484. esac
  485. for toolkit in $ALL_TOOLKITS; do
  486. var=wxUSE_$toolkit
  487. eval "value=\$${var}"
  488. if test "$value" = 1; then
  489. toolkit_echo=`echo $toolkit | tr '[[A-Z]]' '[[a-z]]'`
  490. AC_MSG_RESULT($toolkit_echo)
  491. fi
  492. done
  493. else
  494. if test "x$host_alias" != "x"; then
  495. AC_MSG_RESULT(base ($host_alias hosted) only)
  496. else
  497. AC_MSG_RESULT(base only)
  498. fi
  499. fi
  500. wxUSE_MAC=0
  501. if test "$wxUSE_OSX_CARBON" = 1 \
  502. -o "$wxUSE_OSX_COCOA" = 1 \
  503. -o "$wxUSE_OSX_IPHONE" = 1; then
  504. wxUSE_MAC=1
  505. fi
  506. dnl ---------------------------------------------------------------------------
  507. dnl external libraries
  508. dnl ---------------------------------------------------------------------------
  509. WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
  510. WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
  511. WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF)
  512. WX_ARG_WITHOUT(libjbig, [ --without-libjbig don't use libjbig in libtiff even if available)], wxUSE_LIBJBIG)
  513. WX_ARG_WITHOUT(liblzma, [ --without-liblzma don't use liblzma in libtiff even if available)], wxUSE_LIBLZMA)
  514. WX_ARG_SYS_WITH(libxpm, [ --with-libxpm use libxpm (XPM file format)], wxUSE_LIBXPM)
  515. WX_ARG_WITH(libiconv, [ --with-libiconv use libiconv (character conversion)], wxUSE_LIBICONV)
  516. WX_ARG_WITH(libmspack, [ --with-libmspack use libmspack (CHM help files loading)], wxUSE_LIBMSPACK)
  517. WX_ARG_WITHOUT(gtkprint, [ --without-gtkprint don't use GTK printing support], wxUSE_GTKPRINT)
  518. WX_ARG_WITH(gnomevfs, [ --with-gnomevfs use GNOME VFS for associating MIME types], wxUSE_LIBGNOMEVFS)
  519. WX_ARG_WITH(libnotify, [ --with-libnotify use libnotify for notifications], wxUSE_LIBNOTIFY)
  520. WX_ARG_WITH(hildon, [ --with-hildon use Hildon framework for Nokia 770/800/810], wxUSE_LIBHILDON)
  521. WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
  522. fi
  523. dnl for GUI only
  524. WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC)
  525. WX_ARG_WITH(sdl, [ --with-sdl use SDL for audio on Unix], wxUSE_LIBSDL)
  526. WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX)
  527. WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
  528. WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT)
  529. AC_MSG_CHECKING([for --with-macosx-sdk])
  530. AC_ARG_WITH(macosx-sdk, [ --with-macosx-sdk=PATH use an OS X SDK at PATH], [
  531. wxUSE_MACOSX_SDK=$withval
  532. wx_cv_use_macosx_sdk="wxUSE_MACOSX_SDK=$withval"
  533. ])
  534. AC_MSG_RESULT([$wxUSE_MACOSX_SDK])
  535. AC_MSG_CHECKING([for --with-macosx-version-min])
  536. AC_ARG_WITH(macosx-version-min, [ --with-macosx-version-min=VER build binaries which require at least this OS X version], [
  537. wxUSE_MACOSX_VERSION_MIN=$withval
  538. wx_cv_use_macosx_version_min="wxUSE_MACOSX_VERSION_MIN=$withval"
  539. ])
  540. AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
  541. dnl ---------------------------------------------------------------------------
  542. dnl debugging options
  543. dnl ---------------------------------------------------------------------------
  544. dnl don't use WX_ARG_ENABLE as it just gets in the way instead of helping with
  545. dnl this rather unusual option
  546. AC_MSG_CHECKING([for --enable-debug])
  547. AC_ARG_ENABLE(debug, [ --enable-debug build library for debugging],
  548. [
  549. if test "$enableval" = yes; then
  550. wxUSE_DEBUG=yes
  551. elif test "$enableval" = no; then
  552. wxUSE_DEBUG=no
  553. elif test "$enableval" = max; then
  554. wxUSE_DEBUG=yes
  555. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -DwxDEBUG_LEVEL=2"
  556. else
  557. AC_MSG_ERROR([Invalid --enable-debug value, must be yes, no or max])
  558. fi
  559. ],
  560. wxUSE_DEBUG=default
  561. )
  562. AC_MSG_RESULT([${enable_debug-default}])
  563. case "$wxUSE_DEBUG" in
  564. yes)
  565. dnl build the library for debugging: enable debugging code and generate
  566. dnl the debug information for the library itself
  567. DEFAULT_wxUSE_DEBUG_FLAG=yes
  568. DEFAULT_wxUSE_DEBUG_INFO=yes
  569. dnl also disable optimizations by default if --enable-debug was used
  570. dnl (this can still be overridden by an explicit --enable-optimise)
  571. DEFAULT_wxUSE_OPTIMISE=no
  572. ;;
  573. no)
  574. dnl --disable-debug is equivalent to both --disable-debug_flag and
  575. dnl --disable-debug_info
  576. DEFAULT_wxUSE_DEBUG_FLAG=no
  577. DEFAULT_wxUSE_DEBUG_INFO=no
  578. ;;
  579. default)
  580. dnl the library is built with debugging support by default but without
  581. dnl debug information as this requires much, much more disk space
  582. DEFAULT_wxUSE_DEBUG_FLAG=yes
  583. DEFAULT_wxUSE_DEBUG_INFO=no
  584. ;;
  585. esac
  586. WX_ARG_DISABLE(debug_flag, [ --disable-debug_flag disable all debugging support], wxUSE_DEBUG_FLAG)
  587. WX_ARG_ENABLE(debug_info, [ --enable-debug_info generate debug information], wxUSE_DEBUG_INFO)
  588. dnl enabled if just --enable-debug_{flag,info} was
  589. dnl
  590. dnl in any case, only set the default value and allow overriding it with an
  591. WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
  592. WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt obsolete, don't use: use wxDebugContext], wxUSE_DEBUG_CONTEXT)
  593. WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing obsolete, don't use: create code with memory tracing], wxUSE_MEM_TRACING)
  594. dnl ---------------------------------------------------------------------------
  595. dnl global compile options
  596. dnl ---------------------------------------------------------------------------
  597. WX_ARG_DISABLE(shared, [ --disable-shared create static library instead of shared], wxUSE_SHARED)
  598. WX_ARG_ENABLE(stl, [ --enable-stl use standard C++ classes for everything], wxUSE_STL)
  599. if test "$wxUSE_STL" = "yes"; then
  600. DEFAULT_wxUSE_STD_CONTAINERS=yes
  601. DEFAULT_wxUSE_STD_IOSTREAM=yes
  602. DEFAULT_wxUSE_STD_STRING=yes
  603. fi
  604. WX_ARG_ENABLE(std_containers,[ --enable-std_containers use standard C++ container classes], wxUSE_STD_CONTAINERS)
  605. WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
  606. WX_ARG_ENABLE(std_string, [ --enable-std_string use standard C++ string classes], wxUSE_STD_STRING)
  607. WX_ARG_ENABLE(std_string_conv_in_wxstring, [ --enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString], wxUSE_STD_STRING_CONV_IN_WXSTRING)
  608. WX_ARG_DISABLE(unicode, [ --disable-unicode compile without Unicode support], wxUSE_UNICODE)
  609. WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU)
  610. WX_ARG_ENABLE_PARAM(utf8, [ --enable-utf8 use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
  611. WX_ARG_ENABLE(utf8only, [ --enable-utf8only only support UTF-8 locales in UTF-8 build (Unix only)], wxUSE_UNICODE_UTF8_LOCALE)
  612. WX_ARG_ENABLE(extended_rtti, [ --enable-extended_rtti use extended RTTI (XTI)], wxUSE_EXTENDED_RTTI)
  613. if test "$USE_OS2" = 1; then
  614. DEFAULT_wxUSE_OMF=no
  615. WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF)
  616. fi
  617. WX_ARG_DISABLE(optimise, [ --disable-optimise compile without optimisations], wxUSE_OPTIMISE)
  618. WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
  619. WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
  620. WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
  621. WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
  622. WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
  623. WX_ARG_DISABLE(vararg_macros,[ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS)
  624. WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary=archs create universal binary for the specified (or all supported) architectures]], wxUSE_UNIVERSAL_BINARY)
  625. WX_ARG_ENABLE_PARAM(macosx_arch, [[ --enable-macosx_arch=ARCH build for just the specified architecture]], wxUSE_MAC_ARCH)
  626. WX_ARG_ENABLE(compat26, [ --enable-compat26 enable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6)
  627. WX_ARG_DISABLE(compat28, [ --disable-compat28 disable wxWidgets 2.8 compatibility], WXWIN_COMPATIBILITY_2_8)
  628. WX_ARG_DISABLE(rpath, [ --disable-rpath disable use of rpath for uninstalled builds], wxUSE_RPATH)
  629. WX_ARG_ENABLE(objc_uniquifying,[ --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING)
  630. WX_ARG_DISABLE(visibility, [ --disable-visibility disable use of ELF symbols visibility even if supported], wxUSE_VISIBILITY)
  631. WX_ARG_DISABLE(tls, [ --disable-tls disable use of compiler TLS support], wxUSE_COMPILER_TLS)
  632. dnl ---------------------------------------------------------------------------
  633. dnl optional non GUI features
  634. dnl ---------------------------------------------------------------------------
  635. WX_ARG_FEATURE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
  636. WX_ARG_FEATURE(xlocale, [ --enable-xlocale use x-locale support (requires wxLocale)], wxUSE_XLOCALE)
  637. WX_ARG_FEATURE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
  638. WX_ARG_FEATURE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL)
  639. WX_ARG_FEATURE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP)
  640. WX_ARG_FEATURE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP)
  641. WX_ARG_FEATURE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE)
  642. WX_ARG_FEATURE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
  643. WX_ARG_FEATURE(ipv6, [ --enable-ipv6 enable IPv6 support in wxSocket], wxUSE_IPV6)
  644. WX_ARG_FEATURE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE)
  645. WX_ARG_FEATURE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ)
  646. WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
  647. WX_ARG_FEATURE(baseevtloop, [ --enable-baseevtloop use event loop in console programs too], wxUSE_CONSOLE_EVENTLOOP)
  648. WX_ARG_FEATURE(epollloop, [ --enable-epollloop use wxEpollDispatcher class (Linux only)], wxUSE_EPOLL_DISPATCHER)
  649. WX_ARG_FEATURE(selectloop, [ --enable-selectloop use wxSelectDispatcher class], wxUSE_SELECT_DISPATCHER)
  650. dnl please keep the settings below in alphabetical order
  651. WX_ARG_FEATURE(any, [ --enable-any use wxAny class], wxUSE_ANY)
  652. WX_ARG_FEATURE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
  653. WX_ARG_FEATURE(arcstream, [ --enable-arcstream use wxArchive streams], wxUSE_ARCHIVE_STREAMS)
  654. WX_ARG_FEATURE(base64, [ --enable-base64 use base64 encoding/decoding functions], wxUSE_BASE64)
  655. WX_ARG_FEATURE(backtrace, [ --enable-backtrace use wxStackWalker class for getting backtraces], wxUSE_STACKWALKER)
  656. WX_ARG_FEATURE(catch_segvs, [ --enable-catch_segvs catch signals in wxApp::OnFatalException (Unix only)], wxUSE_ON_FATAL_EXCEPTION)
  657. WX_ARG_FEATURE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
  658. WX_ARG_FEATURE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
  659. WX_ARG_FEATURE(debugreport, [ --enable-debugreport use wxDebugReport class], wxUSE_DEBUGREPORT)
  660. WX_ARG_FEATURE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
  661. WX_ARG_FEATURE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
  662. WX_ARG_FEATURE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
  663. WX_ARG_FEATURE(exceptions, [ --enable-exceptions build exception-safe library], wxUSE_EXCEPTIONS)
  664. WX_ARG_FEATURE(ffile, [ --enable-ffile use wxFFile class], wxUSE_FFILE)
  665. WX_ARG_FEATURE(file, [ --enable-file use wxFile class], wxUSE_FILE)
  666. WX_ARG_FEATURE(filehistory, [ --enable-filehistory use wxFileHistory class], wxUSE_FILE_HISTORY)
  667. WX_ARG_FEATURE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM)
  668. WX_ARG_FEATURE(fontenum, [ --enable-fontenum use wxFontEnumerator class], wxUSE_FONTENUM)
  669. WX_ARG_FEATURE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP)
  670. WX_ARG_FEATURE(fs_archive, [ --enable-fs_archive use virtual archive filesystems], wxUSE_FS_ARCHIVE)
  671. WX_ARG_FEATURE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
  672. WX_ARG_FEATURE(fs_zip, [ --enable-fs_zip now replaced by fs_archive], wxUSE_FS_ZIP)
  673. WX_ARG_FEATURE(fsvolume, [ --enable-fsvolume use wxFSVolume class], wxUSE_FSVOLUME)
  674. WX_ARG_FEATURE(fswatcher, [ --enable-fswatcher use wxFileSystemWatcher class], wxUSE_FSWATCHER)
  675. WX_ARG_FEATURE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
  676. WX_ARG_FEATURE(log, [ --enable-log use logging system], wxUSE_LOG)
  677. WX_ARG_FEATURE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
  678. WX_ARG_FEATURE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
  679. WX_ARG_FEATURE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
  680. WX_ARG_FEATURE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
  681. WX_ARG_FEATURE(sound, [ --enable-sound use wxSound class], wxUSE_SOUND)
  682. WX_ARG_FEATURE(stdpaths, [ --enable-stdpaths use wxStandardPaths class], wxUSE_STDPATHS)
  683. WX_ARG_FEATURE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH)
  684. WX_ARG_FEATURE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
  685. WX_ARG_FEATURE(sysoptions, [ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
  686. WX_ARG_FEATURE(tarstream, [ --enable-tarstream use wxTar streams], wxUSE_TARSTREAM)
  687. WX_ARG_FEATURE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER)
  688. WX_ARG_FEATURE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
  689. WX_ARG_FEATURE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
  690. WX_ARG_FEATURE(variant, [ --enable-variant use wxVariant class], wxUSE_VARIANT)
  691. WX_ARG_FEATURE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM)
  692. dnl URL-related classes
  693. WX_ARG_FEATURE(url, [ --enable-url use wxURL class], wxUSE_URL)
  694. WX_ARG_FEATURE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL)
  695. WX_ARG_FEATURE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP)
  696. WX_ARG_FEATURE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP)
  697. WX_ARG_FEATURE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE)
  698. WX_ARG_FEATURE(threads, [ --enable-threads use threads], wxUSE_THREADS)
  699. WX_ARG_ENABLE(iniconf, [ --enable-iniconf use wxIniConfig (Win32 only)], wxUSE_INICONF)
  700. WX_ARG_FEATURE(regkey, [ --enable-regkey use wxRegKey class (Win32 only)], wxUSE_REGKEY)
  701. if test "$wxUSE_GUI" = "yes"; then
  702. dnl ---------------------------------------------------------------------------
  703. dnl optional "big" GUI features
  704. dnl ---------------------------------------------------------------------------
  705. WX_ARG_FEATURE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
  706. WX_ARG_FEATURE(help, [ --enable-help use help subsystem], wxUSE_HELP)
  707. WX_ARG_FEATURE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP)
  708. WX_ARG_FEATURE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
  709. WX_ARG_FEATURE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP)
  710. WX_ARG_FEATURE(xrc, [ --enable-xrc use XRC resources sub-library], wxUSE_XRC)
  711. WX_ARG_FEATURE(aui, [ --enable-aui use AUI docking library], wxUSE_AUI)
  712. WX_ARG_FEATURE(propgrid, [ --enable-propgrid use wxPropertyGrid library], wxUSE_PROPGRID)
  713. WX_ARG_FEATURE(ribbon, [ --enable-ribbon use wxRibbon library], wxUSE_RIBBON)
  714. WX_ARG_FEATURE(stc, [ --enable-stc use wxStyledTextCtrl library], wxUSE_STC)
  715. WX_ARG_FEATURE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
  716. WX_ARG_FEATURE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI)
  717. WX_ARG_FEATURE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW)
  718. WX_ARG_FEATURE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG)
  719. WX_ARG_FEATURE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI)
  720. WX_ARG_FEATURE(mdidoc, [ --enable-mdidoc use docview architecture with MDI], wxUSE_MDI_ARCHITECTURE)
  721. WX_ARG_FEATURE(mediactrl, [ --enable-mediactrl use wxMediaCtrl class], wxUSE_MEDIACTRL)
  722. WX_ARG_FEATURE(gstreamer8, [ --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
  723. WX_ARG_FEATURE(richtext, [ --enable-richtext use wxRichTextCtrl], wxUSE_RICHTEXT)
  724. WX_ARG_FEATURE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
  725. WX_ARG_FEATURE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
  726. WX_ARG_FEATURE(svg, [ --enable-svg use wxSVGFileDC device context], wxUSE_SVG)
  727. WX_ARG_FEATURE(webkit, [ --enable-webkit use wxWebKitCtrl (Mac-only, use wxWebView instead)], wxUSE_WEBKIT)
  728. WX_ARG_FEATURE(webview, [ --enable-webview use wxWebView library], wxUSE_WEBVIEW)
  729. dnl wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter
  730. dnl can't be disabled, don't even provide an option to do it
  731. if test "$wxUSE_MAC" != 1; then
  732. WX_ARG_FEATURE(graphics_ctx,[ --enable-graphics_ctx use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT)
  733. fi
  734. dnl ---------------------------------------------------------------------------
  735. dnl IPC &c
  736. dnl ---------------------------------------------------------------------------
  737. WX_ARG_FEATURE(clipboard, [ --enable-clipboard use wxClipboard class], wxUSE_CLIPBOARD)
  738. WX_ARG_FEATURE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
  739. dnl ---------------------------------------------------------------------------
  740. dnl optional GUI controls (in alphabetical order except the first one)
  741. dnl ---------------------------------------------------------------------------
  742. dnl don't set DEFAULT_wxUSE_XXX below if the option is not specified
  743. DEFAULT_wxUSE_CONTROLS=none
  744. WX_ARG_DISABLE(controls, [ --disable-controls disable compilation of all standard controls], wxUSE_CONTROLS)
  745. dnl even with --disable-controls, some may be enabled by an explicit
  746. dnl --enable-<control> later on the command line -- but by default all will be
  747. dnl disabled
  748. if test "$wxUSE_CONTROLS" = "no"; then
  749. DEFAULT_wxUSE_ACCEL=no
  750. DEFAULT_wxUSE_ANIMATIONCTRL=no
  751. DEFAULT_wxUSE_BANNERWINDOW=no
  752. DEFAULT_wxUSE_BMPBUTTON=no
  753. DEFAULT_wxUSE_BUTTON=no
  754. DEFAULT_wxUSE_CALCTRL=no
  755. DEFAULT_wxUSE_CARET=no
  756. DEFAULT_wxUSE_CHECKBOX=no
  757. DEFAULT_wxUSE_CHECKLISTBOX=no
  758. DEFAULT_wxUSE_CHOICE=no
  759. DEFAULT_wxUSE_CHOICEBOOK=no
  760. DEFAULT_wxUSE_COLLPANE=no
  761. DEFAULT_wxUSE_COLOURPICKERCTRL=no
  762. DEFAULT_wxUSE_COMBOBOX=no
  763. DEFAULT_wxUSE_COMBOBOX=no
  764. DEFAULT_wxUSE_COMMANDLINKBUTTON=no
  765. DEFAULT_wxUSE_DATAVIEWCTRL=no
  766. DEFAULT_wxUSE_DATEPICKCTRL=no
  767. DEFAULT_wxUSE_DETECT_SM=no
  768. DEFAULT_wxUSE_DIRPICKERCTRL=no
  769. DEFAULT_wxUSE_DISPLAY=no
  770. DEFAULT_wxUSE_FILECTRL=no
  771. DEFAULT_wxUSE_FILEPICKERCTRL=no
  772. DEFAULT_wxUSE_FONTPICKERCTRL=no
  773. DEFAULT_wxUSE_GAUGE=no
  774. DEFAULT_wxUSE_GRID=no
  775. DEFAULT_wxUSE_HEADERCTRL=no
  776. DEFAULT_wxUSE_HYPERLINKCTRL=no
  777. DEFAULT_wxUSE_IMAGLIST=no
  778. DEFAULT_wxUSE_LISTBOOK=no
  779. DEFAULT_wxUSE_LISTBOX=no
  780. DEFAULT_wxUSE_LISTCTRL=no
  781. DEFAULT_wxUSE_MARKUP=no
  782. DEFAULT_wxUSE_NOTEBOOK=no
  783. DEFAULT_wxUSE_POPUPWIN=no
  784. DEFAULT_wxUSE_RADIOBOX=no
  785. DEFAULT_wxUSE_RADIOBTN=no
  786. DEFAULT_wxUSE_RICHMSGDLG=no
  787. DEFAULT_wxUSE_RICHTOOLTIP=no
  788. DEFAULT_wxUSE_REARRANGECTRL=no
  789. DEFAULT_wxUSE_SASH=no
  790. DEFAULT_wxUSE_SCROLLBAR=no
  791. DEFAULT_wxUSE_SEARCHCTRL=no
  792. DEFAULT_wxUSE_SLIDER=no
  793. DEFAULT_wxUSE_SPINBTN=no
  794. DEFAULT_wxUSE_SPINCTRL=no
  795. DEFAULT_wxUSE_SPLITTER=no
  796. DEFAULT_wxUSE_STATBMP=no
  797. DEFAULT_wxUSE_STATBOX=no
  798. DEFAULT_wxUSE_STATLINE=no
  799. DEFAULT_wxUSE_STATUSBAR=no
  800. DEFAULT_wxUSE_TIMEPICKCTRL=no
  801. DEFAULT_wxUSE_TIPWINDOW=no
  802. DEFAULT_wxUSE_TOGGLEBTN=no
  803. DEFAULT_wxUSE_TOOLBAR=no
  804. DEFAULT_wxUSE_TOOLBAR_NATIVE=no
  805. DEFAULT_wxUSE_TOOLBOOK=no
  806. DEFAULT_wxUSE_TOOLTIPS=no
  807. DEFAULT_wxUSE_TREEBOOK=no
  808. DEFAULT_wxUSE_TREECTRL=no
  809. DEFAULT_wxUSE_TREELISTCTRL=no
  810. fi
  811. dnl features affecting multiple controls
  812. WX_ARG_FEATURE(markup, [ --enable-markup support wxControl::SetLabelMarkup], wxUSE_MARKUP)
  813. dnl please keep the settings below in alphabetical order
  814. WX_ARG_FEATURE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
  815. WX_ARG_FEATURE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL)
  816. WX_ARG_FEATURE(bannerwindow,[ --enable-bannerwindow use wxBannerWindow class], wxUSE_BANNERWINDOW)
  817. WX_ARG_FEATURE(artstd, [ --enable-artstd use standard XPM icons in wxArtProvider], wxUSE_ARTPROVIDER_STD)
  818. WX_ARG_FEATURE(arttango, [ --enable-arttango use Tango icons in wxArtProvider], wxUSE_ARTPROVIDER_TANGO)
  819. WX_ARG_FEATURE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
  820. WX_ARG_FEATURE(bmpcombobox, [ --enable-bmpcombobox use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX)
  821. WX_ARG_FEATURE(button, [ --enable-button use wxButton class], wxUSE_BUTTON)
  822. WX_ARG_FEATURE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL)
  823. WX_ARG_FEATURE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
  824. WX_ARG_FEATURE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
  825. WX_ARG_FEATURE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
  826. WX_ARG_FEATURE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
  827. WX_ARG_FEATURE(choicebook, [ --enable-choicebook use wxChoicebook class], wxUSE_CHOICEBOOK)
  828. WX_ARG_FEATURE(collpane, [ --enable-collpane use wxCollapsiblePane class], wxUSE_COLLPANE)
  829. WX_ARG_FEATURE(colourpicker,[ --enable-colourpicker use wxColourPickerCtrl class], wxUSE_COLOURPICKERCTRL)
  830. WX_ARG_FEATURE(combobox, [ --enable-combobox use wxComboBox class], wxUSE_COMBOBOX)
  831. WX_ARG_FEATURE(comboctrl, [ --enable-comboctrl use wxComboCtrl class], wxUSE_COMBOCTRL)
  832. WX_ARG_FEATURE(commandlinkbutton, [ --enable-commandlinkbutton use wxCommmandLinkButton class], wxUSE_COMMANDLINKBUTTON)
  833. WX_ARG_FEATURE(dataviewctrl,[ --enable-dataviewctrl use wxDataViewCtrl class], wxUSE_DATAVIEWCTRL)
  834. WX_ARG_FEATURE(datepick, [ --enable-datepick use wxDatePickerCtrl class], wxUSE_DATEPICKCTRL)
  835. WX_ARG_FEATURE(detect_sm, [ --enable-detect_sm use code to detect X11 session manager], wxUSE_DETECT_SM)
  836. WX_ARG_FEATURE(dirpicker, [ --enable-dirpicker use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL)
  837. WX_ARG_FEATURE(display, [ --enable-display use wxDisplay class], wxUSE_DISPLAY)
  838. WX_ARG_FEATURE(editablebox, [ --enable-editablebox use wxEditableListBox class], wxUSE_EDITABLELISTBOX)
  839. WX_ARG_FEATURE(filectrl, [ --enable-filectrl use wxFileCtrl class], wxUSE_FILECTRL)
  840. WX_ARG_FEATURE(filepicker, [ --enable-filepicker use wxFilePickerCtrl class], wxUSE_FILEPICKERCTRL)
  841. WX_ARG_FEATURE(fontpicker, [ --enable-fontpicker use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL)
  842. WX_ARG_FEATURE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
  843. WX_ARG_FEATURE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
  844. WX_ARG_FEATURE(headerctrl, [ --enable-headerctrl use wxHeaderCtrl class], wxUSE_HEADERCTRL)
  845. WX_ARG_FEATURE(hyperlink, [ --enable-hyperlink use wxHyperlinkCtrl class], wxUSE_HYPERLINKCTRL)
  846. WX_ARG_FEATURE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
  847. WX_ARG_FEATURE(infobar, [ --enable-infobar use wxInfoBar class], wxUSE_INFOBAR)
  848. WX_ARG_FEATURE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK)
  849. WX_ARG_FEATURE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
  850. WX_ARG_FEATURE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
  851. WX_ARG_FEATURE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
  852. WX_ARG_FEATURE(notifmsg, [ --enable-notifmsg use wxNotificationMessage class], wxUSE_NOTIFICATION_MESSAGE)
  853. WX_ARG_FEATURE(odcombobox, [ --enable-odcombobox use wxOwnerDrawnComboBox class], wxUSE_ODCOMBOBOX)
  854. WX_ARG_FEATURE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN)
  855. WX_ARG_FEATURE(prefseditor, [ --enable-prefseditor use wxPreferencesEditor class], wxUSE_PREFERENCES_EDITOR)
  856. WX_ARG_FEATURE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
  857. WX_ARG_FEATURE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
  858. WX_ARG_FEATURE(richmsgdlg, [ --enable-richmsgdlg use wxRichMessageDialog class], wxUSE_RICHMSGDLG)
  859. WX_ARG_FEATURE(richtooltip, [ --enable-richtooltip use wxRichToolTip class], wxUSE_RICHTOOLTIP)
  860. WX_ARG_FEATURE(rearrangectrl,[ --enable-rearrangectrl use wxRearrangeList/Ctrl/Dialog], wxUSE_REARRANGECTRL)
  861. WX_ARG_FEATURE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
  862. WX_ARG_FEATURE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
  863. WX_ARG_FEATURE(searchctrl, [ --enable-searchctrl use wxSearchCtrl class], wxUSE_SEARCHCTRL)
  864. WX_ARG_FEATURE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
  865. WX_ARG_FEATURE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
  866. WX_ARG_FEATURE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL)
  867. WX_ARG_FEATURE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
  868. WX_ARG_FEATURE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
  869. WX_ARG_FEATURE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
  870. WX_ARG_FEATURE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
  871. WX_ARG_FEATURE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT)
  872. WX_ARG_FEATURE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
  873. WX_ARG_FEATURE(taskbaricon, [ --enable-taskbaricon use wxTaskBarIcon class], wxUSE_TASKBARICON)
  874. WX_ARG_FEATURE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE)
  875. WX_ARG_FEATURE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL)
  876. WX_ARG_FEATURE(datepick, [ --enable-timepick use wxTimePickerCtrl class], wxUSE_TIMEPICKCTRL)
  877. WX_ARG_FEATURE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW)
  878. WX_ARG_FEATURE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN)
  879. WX_ARG_FEATURE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
  880. WX_ARG_FEATURE(toolbook, [ --enable-toolbook use wxToolbook class], wxUSE_TOOLBOOK)
  881. WX_ARG_FEATURE(treebook, [ --enable-treebook use wxTreebook class], wxUSE_TREEBOOK)
  882. WX_ARG_FEATURE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
  883. WX_ARG_FEATURE(treelist, [ --enable-treelist use wxTreeListCtrl class], wxUSE_TREELISTCTRL)
  884. dnl ---------------------------------------------------------------------------
  885. dnl common dialogs
  886. dnl ---------------------------------------------------------------------------
  887. WX_ARG_FEATURE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS)
  888. WX_ARG_FEATURE(aboutdlg, [ --enable-aboutdlg use wxAboutBox], wxUSE_ABOUTDLG)
  889. WX_ARG_FEATURE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG)
  890. WX_ARG_FEATURE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG)
  891. WX_ARG_FEATURE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG)
  892. WX_ARG_FEATURE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG)
  893. WX_ARG_FEATURE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG)
  894. WX_ARG_FEATURE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
  895. WX_ARG_FEATURE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG)
  896. WX_ARG_FEATURE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG)
  897. WX_ARG_FEATURE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH)
  898. WX_ARG_FEATURE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
  899. WX_ARG_FEATURE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
  900. WX_ARG_FEATURE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
  901. WX_ARG_FEATURE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG)
  902. dnl ---------------------------------------------------------------------------
  903. dnl misc GUI options
  904. dnl ---------------------------------------------------------------------------
  905. WX_ARG_FEATURE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS)
  906. WX_ARG_FEATURE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
  907. WX_ARG_FEATURE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
  908. WX_ARG_FEATURE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
  909. WX_ARG_FEATURE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOUSEWHEEL)
  910. WX_ARG_FEATURE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
  911. WX_ARG_FEATURE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
  912. WX_ARG_FEATURE(hotkey, [ --enable-hotkey use wxWindow::RegisterHotKey()], wxUSE_HOTKEY)
  913. WX_ARG_FEATURE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK)
  914. WX_ARG_FEATURE(metafile, [ --enable-metafiles use wxMetaFile], wxUSE_METAFILE)
  915. WX_ARG_FEATURE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE)
  916. WX_ARG_FEATURE(accessibility,[ --enable-accessibility enable accessibility support], wxUSE_ACCESSIBILITY)
  917. WX_ARG_FEATURE(uiactionsim, [ --enable-uiactionsim use wxUIActionSimulator (experimental)], wxUSE_UIACTIONSIMULATOR)
  918. WX_ARG_FEATURE(dctransform, [ --enable-dctransform use wxDC::SetTransformMatrix and related], wxUSE_DC_TRANSFORM_MATRIX)
  919. WX_ARG_FEATURE(webviewwebkit,[ --enable-webviewwebkit use wxWebView WebKit backend], wxUSE_WEBVIEW_WEBKIT)
  920. dnl ---------------------------------------------------------------------------
  921. dnl support for image formats that do not rely on external library
  922. dnl ---------------------------------------------------------------------------
  923. WX_ARG_FEATURE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE)
  924. WX_ARG_FEATURE(image, [ --enable-image use wxImage class], wxUSE_IMAGE)
  925. WX_ARG_FEATURE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF)
  926. WX_ARG_FEATURE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
  927. WX_ARG_FEATURE(tga, [ --enable-tga use tga images (TGA file format)], wxUSE_TGA)
  928. WX_ARG_FEATURE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF)
  929. WX_ARG_FEATURE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
  930. WX_ARG_FEATURE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM)
  931. WX_ARG_FEATURE(ico_cur, [ --enable-ico_cur use Windows ICO and CUR formats], wxUSE_ICO_CUR)
  932. dnl ---------------------------------------------------------------------------
  933. dnl wxMSW-only options
  934. dnl ---------------------------------------------------------------------------
  935. WX_ARG_FEATURE(dccache, [ --enable-dccache cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING)
  936. WX_ARG_FEATURE(ps-in-msw, [ --enable-ps-in-msw use PS printing in wxMSW (Win32 only)], wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
  937. WX_ARG_FEATURE(ownerdrawn, [ --enable-ownerdrawn use owner drawn controls (Win32 and OS/2 only)], wxUSE_OWNER_DRAWN)
  938. WX_ARG_FEATURE(uxtheme, [ --enable-uxtheme enable support for Windows XP themed look (Win32 only)], wxUSE_UXTHEME)
  939. WX_ARG_FEATURE(wxdib, [ --enable-wxdib use wxDIB class (Win32 only)], wxUSE_DIB)
  940. WX_ARG_FEATURE(webviewie, [ --enable-webviewie use wxWebView IE backend (Win32 only)], wxUSE_WEBVIEW_IE)
  941. dnl this one is not really MSW-specific but it exists mainly to be turned off
  942. dnl under MSW, it should be off by default on the other platforms
  943. if test "$wxUSE_MSW" != 1; then
  944. DEFAULT_wxUSE_AUTOID_MANAGEMENT=no
  945. fi
  946. WX_ARG_FEATURE(autoidman, [ --enable-autoidman use automatic ids management], wxUSE_AUTOID_MANAGEMENT)
  947. fi
  948. dnl for GUI only
  949. dnl ---------------------------------------------------------------------------
  950. dnl Checks for programs
  951. dnl ---------------------------------------------------------------------------
  952. dnl flush the cache because checking for programs might abort
  953. AC_CACHE_SAVE
  954. dnl C-compiler checks
  955. dnl defines CC with the compiler to use
  956. dnl defines GCC with yes if using gcc
  957. dnl defines GCC empty if not using gcc
  958. dnl defines CFLAGS
  959. dnl
  960. dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
  961. dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
  962. dnl (if not already present in C*FLAGS) the -g and -O flags ourselves below
  963. CFLAGS=${CFLAGS:=}
  964. AC_BAKEFILE_PROG_CC
  965. dnl is -traditional needed for correct compilations
  966. dnl adds -traditional for gcc if needed
  967. AC_PROG_GCC_TRADITIONAL
  968. dnl C++-compiler checks
  969. dnl defines CXX with the compiler to use
  970. dnl defines GXX with yes if using gxx
  971. dnl defines GXX empty if not using gxx
  972. dnl defines CXXFLAGS
  973. dnl
  974. dnl see CFLAGS line above
  975. CXXFLAGS=${CXXFLAGS:=}
  976. AC_BAKEFILE_PROG_CXX
  977. dnl configure always sets CXX to something as it falls back to g++ even if no
  978. dnl C++ compiler was found, but we prefer to abort now with a clear error
  979. dnl message rather than give errors about all tests failures below
  980. if test "$CXX" = "g++" -a "$GXX" != "yes"; then
  981. AC_MSG_ERROR([C++ compiler is needed to build wxWidgets])
  982. fi
  983. dnl ar command
  984. dnl defines AR with the appropriate command
  985. dnl
  986. dnl For Sun CC AC_BAKEFILE below sets AR to the compiler itself.
  987. if test "x$SUNCXX" != xyes; then
  988. AC_CHECK_TOOL(AR, ar)
  989. if test "x$AR" = "x" ; then
  990. AC_MSG_ERROR([ar is needed to build wxWidgets])
  991. fi
  992. fi
  993. dnl ---------------------------------------------------------------------------
  994. dnl Mac-specific SDK/architectures checks
  995. dnl ---------------------------------------------------------------------------
  996. if test "$wxUSE_MAC" = 1; then
  997. retest_macosx_linking=no
  998. OSX_ARCH_OPTS=""
  999. dnl Deal with architecture selection. By default, we compile for the current
  1000. dnl architecture, whatever it is. With --enable-universal_binary the list of
  1001. dnl architectures can be explicitly specified. If it isn't, we compile for all
  1002. dnl supported ones.
  1003. if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
  1004. if test "x$wxUSE_MAC_ARCH" != xno; then
  1005. AC_MSG_WARN([--enable-macosx_arch is ignored when --enable-universal_binary is used.])
  1006. fi
  1007. if test "x$wxUSE_UNIVERSAL_BINARY" != xyes; then
  1008. OSX_ARCH_OPTS=$wxUSE_UNIVERSAL_BINARY
  1009. else dnl Use all architectures supported
  1010. OSX_ARCH_OPTS="ppc,i386"
  1011. if test "$wxUSE_OSX_COCOA" = 1; then
  1012. OSX_ARCH_OPTS="$OSX_ARCH_OPTS,x86_64"
  1013. fi
  1014. fi
  1015. AC_MSG_CHECKING([for architectures to use in universal binary])
  1016. AC_MSG_RESULT([$OSX_ARCH_OPTS])
  1017. dnl NOTE: Only the compiler driver needs arch flags. The link editor
  1018. dnl is incapable of using them but the compiler driver (which we use
  1019. dnl as LD when building dynamic libraries) uses them to invoke the
  1020. dnl real ld multiple times. If we moved to libtool -dynamic we would
  1021. dnl need no arch flags because libtool automatically invokes ld for
  1022. dnl every architecture found in the fat input files.
  1023. dnl
  1024. dnl For static library builds, AR/RANLIB automatically create proper
  1025. dnl fat archives although AR is unable to update them once RANLIB has
  1026. dnl made them into proper fat archives. Fortunately, our link process
  1027. dnl simply removes the .a file before using ar to create a new one.
  1028. dnl If we did move to libtool -static we still wouldn't need arch flags
  1029. dnl because libtool automatically figures it out based on input.
  1030. retest_macosx_linking=yes
  1031. else
  1032. if test "x$wxUSE_MAC_ARCH" != xno; then
  1033. OSX_ARCH_OPTS=$wxUSE_MAC_ARCH
  1034. fi
  1035. fi
  1036. if test "x$OSX_ARCH_OPTS" != "x"; then
  1037. dnl Check if there is more than one architecture
  1038. if echo $OSX_ARCH_OPTS | grep -q ","; then
  1039. AC_MSG_WARN([Disabling dependency tracking due to universal binary build.])
  1040. disable_macosx_deps=yes
  1041. dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
  1042. dnl and including all architecture directories with each compiler invocation.
  1043. dnl That would require a major rework of Bakefile and at the same time it would be nice to have
  1044. dnl Objective-C++ precompiled headers.
  1045. AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
  1046. bk_use_pch=no
  1047. fi
  1048. OSX_ARCH_OPTS=`echo $OSX_ARCH_OPTS | sed -e 's/^/-arch /' -e 's/,/ -arch /g'`
  1049. CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
  1050. CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
  1051. OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
  1052. OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
  1053. LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
  1054. fi
  1055. dnl Set up the Mac OS X SDK. We do this early so configure tests will occur
  1056. dnl with the SDK in place.
  1057. dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path
  1058. if test "x$wxUSE_MACOSX_SDK" = "xno"; then
  1059. wxUSE_MACOSX_SDK=
  1060. elif test "x$wxUSE_MACOSX_SDK" = "xyes"; then
  1061. # TODO: Search for most recent SDK and use it.
  1062. wxUSE_MACOSX_SDK="/Developer/SDKs/MacOSX10.4u.sdk"
  1063. fi
  1064. if test "x$wxUSE_MACOSX_SDK" != "x"; then
  1065. AC_MSG_CHECKING([for SDK directory $wxUSE_MACOSX_SDK])
  1066. if ! test -d "$wxUSE_MACOSX_SDK"; then
  1067. AC_MSG_FAILURE([not found])
  1068. else
  1069. AC_MSG_RESULT([exists])
  1070. fi
  1071. dnl CC and CXX will have these flags added below, after the compiler has been chosen
  1072. MACOSX_SDK_OPTS="-isysroot $wxUSE_MACOSX_SDK"
  1073. retest_macosx_linking=yes
  1074. dnl NOTE: When libtool is used in lieu of AR/RANLIB (i.e. in static mode)
  1075. dnl the syslibroot makes no difference. We aren't using libtool now but
  1076. dnl if we ever did, be aware that you don't need to worry about it.
  1077. fi
  1078. dnl Set up the deployment target
  1079. dnl No : Don't specify a min version even if using an SDK
  1080. dnl Yes : Use the version from the SDK if used, otherwise same as no
  1081. dnl Param: Use the specified version
  1082. if test "x$wxUSE_MACOSX_VERSION_MIN" = "xno"; then
  1083. wxUSE_MACOSX_VERSION_MIN=
  1084. elif test "x$wxUSE_MACOSX_VERSION_MIN" = "xyes"; then
  1085. if test "x$wxUSE_MACOSX_SDK" != "x"; then
  1086. AC_MSG_CHECKING([SDK deployment version])
  1087. dnl We need to quote the next line where we don't need macros and do need [] in the regex
  1088. [
  1089. MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" buildSettings | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
  1090. ]
  1091. # If that failed, try again with the new key
  1092. if test "x$MACOSX_SDK_PLIST_VERSION_MIN" == "x"; then
  1093. [
  1094. MACOSX_SDK_PLIST_VERSION_MIN=`defaults read "$wxUSE_MACOSX_SDK/SDKSettings" DefaultProperties | grep '^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}[^"]*"\{0,1\}; *$' | sed 's/^ *"\{0,1\}MACOSX_DEPLOYMENT_TARGET"\{0,1\} *= *"\{0,1\}\([^"]*\)"\{0,1\} *; *$/\1/'`
  1095. ]
  1096. fi
  1097. if test "x$MACOSX_SDK_PLIST_VERSION_MIN" != "x"; then
  1098. wxUSE_MACOSX_VERSION_MIN=$MACOSX_SDK_PLIST_VERSION_MIN
  1099. AC_MSG_RESULT([$wxUSE_MACOSX_VERSION_MIN])
  1100. else
  1101. AC_MSG_WARN([Could not determine deployment target from SDKSettings.plist])
  1102. wxUSE_MACOSX_VERSION_MIN=
  1103. fi
  1104. else
  1105. wxUSE_MACOSX_VERSION_MIN=
  1106. fi
  1107. elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then
  1108. wxUSE_MACOSX_VERSION_MIN=10.5
  1109. fi
  1110. if test "x$MACOSX_SDK_OPTS" != "x"; then
  1111. eval "CC=\"$CC $MACOSX_SDK_OPTS\""
  1112. eval "CXX=\"$CXX $MACOSX_SDK_OPTS\""
  1113. eval "LD=\"$LD $MACOSX_SDK_OPTS\""
  1114. retest_macosx_linking=yes
  1115. fi
  1116. if test "x$wxUSE_MACOSX_VERSION_MIN" != "x"; then
  1117. if test "$wxUSE_OSX_IPHONE" = 1; then
  1118. MACOSX_VERSION_MIN_OPTS="-miphoneos-version-min=$wxUSE_MACOSX_VERSION_MIN"
  1119. else
  1120. MACOSX_VERSION_MIN_OPTS="-mmacosx-version-min=$wxUSE_MACOSX_VERSION_MIN"
  1121. fi
  1122. eval "CC=\"$CC $MACOSX_VERSION_MIN_OPTS\""
  1123. eval "CXX=\"$CXX $MACOSX_VERSION_MIN_OPTS\""
  1124. eval "LD=\"$LD $MACOSX_VERSION_MIN_OPTS\""
  1125. retest_macosx_linking=yes
  1126. fi
  1127. dnl If either an SDK or a version option was added, make sure that we can
  1128. dnl still compile and link both C and C++. If we didn't do this, then most
  1129. dnl of the remaining tests would fail.
  1130. if test "x$retest_macosx_linking" = "xyes"; then
  1131. AC_LANG_PUSH(C)
  1132. AC_MSG_CHECKING([if C compiler ($CC) works with SDK/version options])
  1133. AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
  1134. AC_LANG_POP()
  1135. AC_LANG_PUSH(C++)
  1136. AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options])
  1137. AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no. Try a different SDK]); exit 1])
  1138. AC_LANG_POP()
  1139. fi
  1140. fi dnl wxUSE_MAC
  1141. case "${host}" in
  1142. dnl The other BSD's should probably go in here too, since this is
  1143. dnl to workaround a strange static lib BSDism.
  1144. dnl Mac OS X install seems to ignore -p option...
  1145. *-*-darwin* )
  1146. INSTALL_PROGRAM="cp -fp"
  1147. INSTALL_DATA="cp -fp"
  1148. ;;
  1149. *)
  1150. ;;
  1151. esac
  1152. dnl ------------------------------------------------------------------------
  1153. dnl Platform specific tests
  1154. dnl ------------------------------------------------------------------------
  1155. if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then
  1156. dnl While g++ predefines _GNU_SOURCE by default, gcc does not, so do it
  1157. dnl explicitly to ensure that the tests done below using C compiler
  1158. dnl succeed, otherwise things like pthread_mutexattr_settype() (and many
  1159. dnl others) wouldn't be detected.
  1160. AC_DEFINE(_GNU_SOURCE)
  1161. dnl For non-g++ compilers (including gcc, as mentioned above) we need to
  1162. dnl add this flag explicitly when building our own code later too.
  1163. GNU_SOURCE_FLAG="-D_GNU_SOURCE"
  1164. CFLAGS="$GNU_SOURCE_FLAG $CFLAGS"
  1165. fi
  1166. if test "x$USE_AIX" = "x1"; then
  1167. dnl xlC needs -qunique under AIX so that one source file can be
  1168. dnl compiled to multiple object files and safely linked together.
  1169. if test "x$XLCXX" = "xyes"; then
  1170. CXXFLAGS="-qunique $CXXFLAGS"
  1171. fi
  1172. dnl AIX sys/timer.h header #defines func_data as t_union.data breaking the
  1173. dnl compilation of GTK+ headers that use func_data as parameter name in
  1174. dnl several places. We could work around this by inserting "#undef
  1175. dnl func_data" in the code but IBM provides a possibility to disable this
  1176. dnl #define by pre-defining the symbol below and this seems to be simpler.
  1177. dnl And if we have any problems because of it we can always remove it and
  1178. dnl use the #undef approach.
  1179. CPPFLAGS="-D_LINUX_SOURCE_COMPAT $CPPFLAGS"
  1180. fi
  1181. dnl This case is for PowerPC OS X vs. everything else
  1182. case "${host}" in
  1183. powerpc-*-darwin* )
  1184. AC_MSG_CHECKING([if __POWERPC__ is already defined])
  1185. AC_TRY_COMPILE([],[#ifndef __POWERPC__
  1186. choke me for lack of PowerPC
  1187. #endif
  1188. ],
  1189. [AC_MSG_RESULT([yes])],
  1190. [AC_MSG_RESULT([no])
  1191. AC_DEFINE(__POWERPC__)
  1192. ])
  1193. ;;
  1194. esac
  1195. dnl This case is for OS X vs. everything else
  1196. case "${host}" in
  1197. *-*-darwin* )
  1198. AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
  1199. AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
  1200. ],[],
  1201. [AC_MSG_RESULT([yes])],
  1202. [AC_MSG_RESULT([no])
  1203. AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
  1204. AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
  1205. #include <CoreFoundation/CFBase.h>
  1206. ],[],
  1207. [AC_MSG_RESULT([yes])
  1208. dnl We must use -D so source files that don't include wx/setup.h
  1209. dnl but do include CFBase will work.
  1210. CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"],
  1211. [AC_MSG_FAILURE([no. CoreFoundation not available.])]
  1212. )
  1213. ]
  1214. )
  1215. ;;
  1216. esac
  1217. dnl Determine whether we want to use Cygwin as Windows or POSIX platform: the
  1218. dnl latter makes more sense for wxGTK/Motif/X11 ports
  1219. wants_win32=0
  1220. doesnt_want_win32=0
  1221. case "${host}" in
  1222. *-*-cygwin*)
  1223. if test "$wxUSE_MSW" = 1 ; then
  1224. wants_win32=1
  1225. else
  1226. dnl when we use cygwin compiler with -mno-cygwin option it uses mingw32
  1227. dnl headers and libraries, so it's Windows-like in this case
  1228. AC_CACHE_CHECK([if -mno-cygwin is in effect], wx_cv_nocygwin,
  1229. [
  1230. AC_TRY_COMPILE(
  1231. [],
  1232. [
  1233. #ifdef __MINGW32__
  1234. choke me
  1235. #endif
  1236. ],
  1237. wx_cv_nocygwin=no,
  1238. wx_cv_nocygwin=yes
  1239. )
  1240. ]
  1241. )
  1242. if test "$wx_cv_nocygwin" = "yes"; then
  1243. wants_win32=1
  1244. else
  1245. doesnt_want_win32=1
  1246. fi
  1247. fi
  1248. if test "$wants_win32" = 1 ; then
  1249. BAKEFILE_FORCE_PLATFORM=win32
  1250. fi
  1251. ;;
  1252. *-*-mingw*)
  1253. wants_win32=1
  1254. ;;
  1255. esac
  1256. if test "$wxUSE_WINE" = "yes"; then
  1257. wants_win32=1
  1258. LDFLAGS_GUI="-mwindows"
  1259. fi
  1260. dnl NB: The two tests below are *NOT* mutually exclusive! They should only
  1261. dnl take effect on Cygwin/Mingw and not other platforms.
  1262. if test "$wants_win32" = 1 ; then
  1263. USE_UNIX=0
  1264. USE_WIN32=1
  1265. AC_DEFINE(__WIN32__)
  1266. AC_DEFINE(__WINDOWS__)
  1267. AC_DEFINE(__GNUWIN32__)
  1268. AC_DEFINE(STRICT)
  1269. fi
  1270. if test "$doesnt_want_win32" = 1 ; then
  1271. USE_UNIX=1
  1272. USE_WIN32=0
  1273. fi
  1274. dnl (end of Windows-only piece)
  1275. if test "$USE_UNIX" = 1 ; then
  1276. wxUSE_UNIX=yes
  1277. AC_DEFINE(__UNIX__)
  1278. fi
  1279. dnl This case is for OS/2 vs. everything else
  1280. case "${host}" in
  1281. *-pc-os2_emx | *-pc-os2-emx )
  1282. dnl ---------------------------------------------------------------------
  1283. dnl When we are using gcc on OS/2, we want to be either using resources
  1284. dnl (PM) or a more complete POSIX emulation for Motif/GTK+/X11.
  1285. dnl Moreover we need to link explicitly against either stdcpp.a or
  1286. dnl stdcxx.a (depending on compiler version), since we are using "gcc",
  1287. dnl not "g++/c++".
  1288. dnl ---------------------------------------------------------------------
  1289. dnl (OS/2-only piece)
  1290. if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
  1291. dnl More complete Unix emulation for unix-like ports
  1292. dnl by linking in POSIX/2's cExt (if available).
  1293. AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt")
  1294. fi
  1295. dnl Check for the gcc version (and thereby for the C runtime library).
  1296. dnl wx_cv_gccversion = EMX2 -> Standard EMX environment
  1297. dnl wx_cv_gccversion = EMX3 -> EMX with gcc-3.0.3 or gcc-3.2.1
  1298. dnl wx_cv_gccversion = Innotek5 -> gcc-3.2.2 with Innotek libc5
  1299. dnl wx_cv_gccversion = Innotek6 -> gcc-3.3.5 with Innotek libc6.
  1300. AC_CACHE_CHECK([for gcc/libc version], wx_cv_gccversion,[
  1301. AC_TRY_RUN(
  1302. dnl Check the gcc version macro.
  1303. [
  1304. #include <stdio.h>
  1305. int main()
  1306. {
  1307. FILE *f=fopen("conftestval", "w");
  1308. if (!f) exit(1);
  1309. fprintf(f,
  1310. #if (__GNUC__ < 3)
  1311. "EMX2"
  1312. #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2)))
  1313. "EMX3"
  1314. #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2)
  1315. "Innotek5"
  1316. #else
  1317. "Innotek6"
  1318. #endif
  1319. );
  1320. exit(0);
  1321. }
  1322. ],
  1323. wx_cv_gccversion=`cat conftestval`,
  1324. wx_cv_gccversion="EMX2",
  1325. dnl Compilation error: Assuming standard EMX environment
  1326. wx_cv_gccversion="EMX2"
  1327. )
  1328. ])
  1329. if test "$wx_cv_gccversion" = "EMX2"; then
  1330. LIBS="$LIBS -lstdcpp"
  1331. LDFLAGS="$LDFLAGS -Zsysv-signals"
  1332. else
  1333. if test "$wx_cv_gccversion" = "EMX3"; then
  1334. LIBS="$LIBS -lstdcxx -lgcc"
  1335. LDFLAGS="$LDFLAGS -Zsysv-signals"
  1336. else
  1337. LIBS="$LIBS -lstdc++"
  1338. fi
  1339. fi
  1340. if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then
  1341. AC_MSG_WARN([Building DLLs requires OMF mode, enabled])
  1342. wxUSE_OMF=yes
  1343. enable_omf=yes
  1344. fi
  1345. dnl (end of OS/2-only piece)
  1346. ;;
  1347. esac
  1348. dnl ------------------------------------------------------------------------
  1349. dnl Check for headers
  1350. dnl ------------------------------------------------------------------------
  1351. dnl Note: non-empty last parameter makes check compile-only,
  1352. dnl skipping worthless preprocessing check
  1353. AC_CHECK_HEADERS(langinfo.h wchar.h,,, [AC_INCLUDES_DEFAULT])
  1354. dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
  1355. if test "$ac_cv_header_wchar_h" != "yes"; then
  1356. AC_CHECK_HEADERS([wcstr.h],,, [AC_INCLUDES_DEFAULT()])
  1357. fi
  1358. case "${host}" in
  1359. *-pc-os2_emx | *-pc-os2-emx )
  1360. dnl Explicitly link -lintl if langinfo.h is available
  1361. dnl and intl not yet included in libc
  1362. if test $ac_cv_header_langinfo_h = "yes" \
  1363. -a \( "$wx_cv_gccversion" = "EMX2" \
  1364. -o "$wx_cv_gccversion" = "EMX3" \
  1365. -o "$wx_cv_gccversion" = "Innotek5" \); then
  1366. LIBS="$LIBS -lintl"
  1367. fi
  1368. ;;
  1369. esac
  1370. if test "$USE_UNIX" = 1 ; then
  1371. dnl POSIX needs this for select(), but old systems don't have it
  1372. AC_CHECK_HEADERS([sys/select.h],,, [AC_INCLUDES_DEFAULT()])
  1373. dnl Header defining C++ ABI is currently only available with g++ but test
  1374. dnl for it unconditionally in case it becomes supported by other compilers.
  1375. AC_LANG_PUSH(C++)
  1376. AC_CHECK_HEADERS([cxxabi.h],,, [AC_INCLUDES_DEFAULT()])
  1377. AC_LANG_POP()
  1378. fi
  1379. dnl ---------------------------------------------------------------------------
  1380. dnl Checks for compiler characteristics
  1381. dnl ---------------------------------------------------------------------------
  1382. dnl defines const to be empty if c-compiler does not support const fully
  1383. AC_C_CONST
  1384. dnl defines inline to a sensible value for the c-compiler
  1385. AC_C_INLINE
  1386. dnl check the sizes of integral types (give some reasonable default values for
  1387. dnl cross-compiling)
  1388. dnl defines the size of certain types of variables in SIZEOF_<TYPE>
  1389. AC_CHECK_SIZEOF(short, 2)
  1390. AC_CHECK_SIZEOF(void *, 4)
  1391. AC_CHECK_SIZEOF(int, 4)
  1392. AC_CHECK_SIZEOF(long, 4)
  1393. AC_CHECK_SIZEOF(size_t, 4)
  1394. case "${host}" in
  1395. arm-*-linux* )
  1396. AC_CHECK_SIZEOF(long long, 8)
  1397. ;;
  1398. *-hp-hpux* )
  1399. AC_CHECK_SIZEOF(long long, 0)
  1400. if test "$ac_cv_sizeof_long_long" != 0; then
  1401. dnl HPUX 10.20 headers need this define in order to use long long definitions
  1402. CPPFLAGS="-D_INCLUDE_LONGLONG $CPPFLAGS"
  1403. fi
  1404. ;;
  1405. * )
  1406. AC_CHECK_SIZEOF(long long, 0)
  1407. esac
  1408. dnl SGI/Irix's stdio.h does not include wchar_t. Mac OS X does not provide
  1409. dnl wchar.h and wchar_t is defined by stdlib.h (GD)
  1410. AC_CHECK_SIZEOF(wchar_t, 0,
  1411. [
  1412. /* DJGPP's wchar_t is now a keyword in C++ (still not C though) */
  1413. #if defined(__DJGPP__) && !( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 )
  1414. # error "fake wchar_t"
  1415. #endif
  1416. #ifdef HAVE_WCHAR_H
  1417. # ifdef __CYGWIN__
  1418. # include <stddef.h>
  1419. # endif
  1420. # include <wchar.h>
  1421. #endif
  1422. #ifdef HAVE_STDLIB_H
  1423. # include <stdlib.h>
  1424. #endif
  1425. #include <stdio.h>
  1426. ]
  1427. )
  1428. if test "$ac_cv_sizeof_wchar_t" = 0; then
  1429. AC_MSG_ERROR([wxWidgets requires wchar_t support.])
  1430. fi
  1431. AC_DEFINE(wxUSE_WCHAR_T)
  1432. dnl checks needed to define wxVaCopy
  1433. AC_CACHE_CHECK([for va_copy],
  1434. wx_cv_func_va_copy,
  1435. [
  1436. AC_LANG_PUSH(C++)
  1437. AC_LINK_IFELSE([
  1438. AC_LANG_SOURCE([
  1439. #include <stdarg.h>
  1440. void foo(char *f, ...)
  1441. {
  1442. va_list ap1, ap2;
  1443. va_start(ap1, f);
  1444. va_copy(ap2, ap1);
  1445. va_end(ap2);
  1446. va_end(ap1);
  1447. }
  1448. int main()
  1449. {
  1450. foo("hi", 17);
  1451. return 0;
  1452. }])
  1453. ],
  1454. wx_cv_func_va_copy=yes,
  1455. wx_cv_func_va_copy=no
  1456. )
  1457. AC_LANG_POP()
  1458. ]
  1459. )
  1460. if test $wx_cv_func_va_copy = "yes"; then
  1461. AC_DEFINE(HAVE_VA_COPY)
  1462. else
  1463. dnl try to understand how can we copy va_lists
  1464. AC_CACHE_CHECK([if va_list can be copied by value],
  1465. wx_cv_type_va_list_lvalue,
  1466. [
  1467. AC_RUN_IFELSE([
  1468. AC_LANG_SOURCE([
  1469. #include <stdarg.h>
  1470. int foo(char *f, ...)
  1471. {
  1472. va_list ap1, ap2;
  1473. va_start(ap1, f);
  1474. ap2 = ap1;
  1475. if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 )
  1476. return 1;
  1477. va_end(ap2);
  1478. va_end(ap1);
  1479. return 0;
  1480. }
  1481. int main()
  1482. {
  1483. return foo("hi", 17);
  1484. }])
  1485. ],
  1486. wx_cv_type_va_list_lvalue=yes,
  1487. wx_cv_type_va_list_lvalue=no,
  1488. dnl assume most common case for cross-compiling...
  1489. wx_cv_type_va_list_lvalue=yes
  1490. )
  1491. ]
  1492. )
  1493. if test $wx_cv_type_va_list_lvalue != "yes"; then
  1494. dnl we suppose that the only thing which can't be copied like this
  1495. dnl are arrays... only experience will show whether this is really true
  1496. AC_DEFINE(VA_LIST_IS_ARRAY)
  1497. fi
  1498. fi
  1499. dnl don't check for vararg macros if they're explicitly disabled: this is
  1500. dnl useful if the user code using the library wants to limit itself to standard
  1501. dnl C++ only (e.g. is compiled with g++ -std=c++98)
  1502. if test "$wxUSE_VARARG_MACROS" = "yes"; then
  1503. dnl Check if variadic macros (C99 feature) are supported:
  1504. AC_CACHE_CHECK(
  1505. [whether the compiler supports variadic macros],
  1506. [wx_cv_have_variadic_macros],
  1507. [
  1508. dnl C compiler might support variadic macros when C++ one doesn't
  1509. dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly
  1510. AC_LANG_PUSH(C++)
  1511. AC_COMPILE_IFELSE([
  1512. AC_LANG_PROGRAM(
  1513. [
  1514. #include <stdio.h>
  1515. #define test(fmt, ...) printf(fmt, __VA_ARGS__)
  1516. ],
  1517. [
  1518. test("%s %d %p", "test", 1, 0);
  1519. ]
  1520. )],
  1521. [wx_cv_have_variadic_macros=yes],
  1522. [wx_cv_have_variadic_macros=no]
  1523. )
  1524. AC_LANG_POP()
  1525. ]
  1526. )
  1527. if test $wx_cv_have_variadic_macros = "yes"; then
  1528. AC_DEFINE(HAVE_VARIADIC_MACROS)
  1529. fi
  1530. else
  1531. AC_DEFINE(wxNO_VARIADIC_MACROS)
  1532. fi dnl wxUSE_VARARG_MACROS == yes
  1533. dnl check for large file support
  1534. LARGEFILE_CPPFLAGS=
  1535. AC_SYS_LARGEFILE
  1536. if test "$ac_cv_sys_file_offset_bits" = "64"; then
  1537. LARGEFILE_CPPFLAGS="-D_FILE_OFFSET_BITS=64"
  1538. elif test "$ac_cv_sys_large_files" = 1; then
  1539. LARGEFILE_CPPFLAGS="-D_LARGE_FILES"
  1540. fi
  1541. dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command
  1542. dnl line because otherwise the system headers risk being included before
  1543. dnl wx/defs.h which defines these constants leading to inconsistent
  1544. dnl sizeof(off_t) in different source files of the same program and linking
  1545. dnl problems
  1546. if test -n "$LARGEFILE_CPPFLAGS"; then
  1547. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $LARGEFILE_CPPFLAGS"
  1548. dnl We get "Large Files (ILP32) not supported in strict ANSI mode."
  1549. dnl #error from HP standard headers unless __STDC_EXT__ is defined.
  1550. dnl The compiler should define it automatically, but some old g++
  1551. dnl versions don't define it, so test and add it if necessary. AFAIK
  1552. dnl the problem only affects the C++ compiler so it is added to
  1553. dnl CXXFLAGS only.
  1554. if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then
  1555. AC_CACHE_CHECK(
  1556. [if -D__STDC_EXT__ is required],
  1557. wx_cv_STDC_EXT_required,
  1558. [
  1559. AC_LANG_PUSH(C++)
  1560. AC_TRY_COMPILE(
  1561. [],
  1562. [
  1563. #ifndef __STDC_EXT__
  1564. choke me
  1565. #endif
  1566. ],
  1567. wx_cv_STDC_EXT_required=no,
  1568. wx_cv_STDC_EXT_required=yes
  1569. )
  1570. AC_LANG_POP()
  1571. ]
  1572. )
  1573. if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
  1574. WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__"
  1575. fi
  1576. fi
  1577. fi
  1578. dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
  1579. dnl
  1580. dnl it may be affected by large file flags (this happens under HP-UX 11 for
  1581. dnl example) so set them before using it and also use C++ to ensure that we get
  1582. dnl errors, not warnings, about the missing functions
  1583. AC_LANG_PUSH(C++)
  1584. old_CPPFLAGS="$CPPFLAGS"
  1585. CPPFLAGS="$CPPFLAGS $LARGEFILE_CPPFLAGS"
  1586. AC_FUNC_FSEEKO
  1587. CPPFLAGS="$old_CPPFLAGS"
  1588. AC_LANG_POP()
  1589. if test "$ac_cv_sys_largefile_source" != no; then
  1590. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
  1591. fi
  1592. dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
  1593. WX_C_BIGENDIAN
  1594. dnl check for iostream (as opposed to iostream.h) standard header
  1595. WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
  1596. dnl check whether C++ compiler supports explicit keyword
  1597. WX_CPP_EXPLICIT
  1598. dnl With Sun CC, temporaries have block scope by default. This flag is needed
  1599. dnl to get the expression scope behaviour that conforms to the standard.
  1600. if test "x$SUNCXX" = xyes; then
  1601. CXXFLAGS="-features=tmplife $GNU_SOURCE_FLAG $CXXFLAGS"
  1602. fi
  1603. dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do
  1604. dnl was to hack their C++ compiler to accept them silently -- but C compiler
  1605. dnl still spits out dozens of warnings for each X include file, so suppress
  1606. dnl them
  1607. if test "x$SUNCC" = xyes; then
  1608. CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS"
  1609. fi
  1610. dnl SGI mipsPro compiler version 7.4.4 and later (and maybe some earlier
  1611. dnl versions too but it's known that 7.4.2 doesn't give this warning but does
  1612. dnl instead warn about "unknown warning number 3970" which explains that we
  1613. dnl don't want to do this for it) gives this warning for "conversion from
  1614. dnl pointer to same-sized integral type" even when there is an explicit cast
  1615. dnl and as there is no way to turn it off and there are hundreds of these
  1616. dnl warnings in wx sources, just turn it off for now
  1617. dnl
  1618. dnl a better long term solution would be to use #pragma set/reset woff in
  1619. dnl wxPtrToUInt() and use it instead of casts elsewhere
  1620. if test "x$SGICC" = "xyes"; then
  1621. AC_CACHE_CHECK([if cc version is 7.4.4 or greater],
  1622. wx_cv_prog_sgicc744,
  1623. [
  1624. AC_TRY_COMPILE([],
  1625. [
  1626. #if _SGI_COMPILER_VERSION >= 744
  1627. chock me: mipsPro is 7.4.4 or later
  1628. #endif
  1629. ],
  1630. wx_cv_prog_sgicc744=no,
  1631. wx_cv_prog_sgicc744=yes
  1632. )
  1633. ]
  1634. )
  1635. if test "x$wx_cv_prog_sgicc744" = "xyes"; then
  1636. CFLAGS="-woff 3970 $CFLAGS"
  1637. fi
  1638. fi
  1639. if test "x$SGICXX" = "xyes"; then
  1640. AC_CACHE_CHECK([if CC version is 7.4.4 or greater],
  1641. wx_cv_prog_sgicxx744,
  1642. [
  1643. AC_LANG_PUSH(C++)
  1644. AC_TRY_COMPILE([],
  1645. [
  1646. #if _SGI_COMPILER_VERSION >= 744
  1647. chock me: mipsPro is 7.4.4 or later
  1648. #endif
  1649. ],
  1650. wx_cv_prog_sgicxx744=no,
  1651. wx_cv_prog_sgicxx744=yes
  1652. )
  1653. AC_LANG_POP()
  1654. ]
  1655. )
  1656. if test "x$wx_cv_prog_sgicxx744" = "xyes"; then
  1657. CXXFLAGS="-woff 3970 $CXXFLAGS"
  1658. fi
  1659. fi
  1660. dnl HP-UX c89/aCC compiler warnings
  1661. if test "x$HPCC" = "xyes"; then
  1662. dnl 2011: "unrecognized preprocessor directive": nice warning but it's given
  1663. dnl even for directives inside #if which is not true (i.e. which are
  1664. dnl used for other compilers/OS) and so we have no way to get rid of it
  1665. dnl 2450: "long long is non standard" -- yes, we know
  1666. CFLAGS="+W 2011,2450 $CFLAGS"
  1667. fi
  1668. if test "x$HPCXX" = "xyes"; then
  1669. dnl 2340: "value copied to temporary, reference to temporary used": very
  1670. dnl painful as triggered by any occurrence of user-defined conversion
  1671. dnl 4232: "conversion from 'Foo *' to a more strictly aligned type 'Bar *'
  1672. dnl may cause misaligned access": this might indicate a real problem
  1673. dnl but any use of GTK+ cast macros results in it so it's unusable
  1674. dnl for wxGTK code
  1675. CXXFLAGS="+W 2340,4232 $CXXFLAGS"
  1676. fi
  1677. dnl DEC/Compaq/HP cxx warnings
  1678. if test "x$COMPAQCXX" = "xyes"; then
  1679. dnl -w0 enables all warnings, then we disable some of them:
  1680. dnl basclsnondto: base class dtor non virtual (sometimes we do want this)
  1681. dnl unrimpret: "end of routine block may be unreachable" is given for
  1682. dnl every "if ( ) return ...; else return ...;"
  1683. dnl intconlosbit: "conversion to integral type of smaller size could lose
  1684. dnl data" this is a useful warning but there are too many of
  1685. dnl them for now
  1686. CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
  1687. fi
  1688. dnl the next few tests are all for C++ features and so need to be done using
  1689. dnl C++ compiler
  1690. AC_LANG_PUSH(C++)
  1691. dnl check for std::string or std::wstring
  1692. if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then
  1693. if test "$wxUSE_UNICODE" = "yes"; then
  1694. std_string="std::wstring"
  1695. char_type="wchar_t"
  1696. else
  1697. std_string="std::string"
  1698. char_type="char"
  1699. fi
  1700. dnl check if <string> declares std::[w]string
  1701. AC_CACHE_CHECK([for $std_string in <string>],
  1702. wx_cv_class_stdstring,
  1703. [
  1704. AC_TRY_COMPILE([#include <string>],
  1705. [$std_string foo;],
  1706. wx_cv_class_stdstring=yes,
  1707. wx_cv_class_stdstring=no
  1708. )
  1709. ]
  1710. )
  1711. if test "$wx_cv_class_stdstring" = yes; then
  1712. if test "$wxUSE_UNICODE" = "yes"; then
  1713. AC_DEFINE(HAVE_STD_WSTRING)
  1714. fi
  1715. dnl we don't need HAVE_STD_STRING, we just suppose it's available if
  1716. dnl wxUSE_STD_STRING==yes
  1717. else
  1718. AC_CACHE_CHECK([if std::basic_string<$char_type> works],
  1719. wx_cv_class_stdbasicstring,
  1720. [
  1721. AC_TRY_COMPILE([
  1722. #ifdef HAVE_WCHAR_H
  1723. # ifdef __CYGWIN__
  1724. # include <stddef.h>
  1725. # endif
  1726. # include <wchar.h>
  1727. #endif
  1728. #ifdef HAVE_STDLIB_H
  1729. # include <stdlib.h>
  1730. #endif
  1731. #include <stdio.h>
  1732. #include <string>
  1733. ],
  1734. [std::basic_string<$char_type> foo;
  1735. const $char_type* dummy = foo.c_str();],
  1736. wx_cv_class_stdbasicstring=yes,
  1737. wx_cv_class_stdbasicstring=no
  1738. )
  1739. ]
  1740. )
  1741. if test "$wx_cv_class_stdbasicstring" != yes; then
  1742. if test "$wxUSE_STL" = "yes"; then
  1743. AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>])
  1744. elif test "$wxUSE_STD_STRING" = "yes"; then
  1745. AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>])
  1746. else
  1747. AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
  1748. wxUSE_STD_STRING=no
  1749. fi
  1750. fi
  1751. fi
  1752. fi
  1753. if test "$wxUSE_STD_IOSTREAM" = "yes"; then
  1754. AC_CHECK_TYPES([std::istream, std::ostream],,
  1755. [wxUSE_STD_IOSTREAM=no],
  1756. [#include <iostream>])
  1757. if test "$wxUSE_STD_IOSTREAM" != "yes"; then
  1758. if test "$wxUSE_STD_IOSTREAM" = "yes"; then
  1759. AC_MSG_ERROR([Can't use --enable-std_iostreams without std::istream and std::ostream])
  1760. else
  1761. AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams])
  1762. fi
  1763. fi
  1764. fi
  1765. if test "$wxUSE_STL" = "yes"; then
  1766. dnl check for basic STL functionality
  1767. AC_CACHE_CHECK([for basic STL functionality],
  1768. wx_cv_lib_stl,
  1769. [AC_TRY_COMPILE([#include <string>
  1770. #include <functional>
  1771. #include <algorithm>
  1772. #include <vector>
  1773. #include <list>],
  1774. [std::vector<int> moo;
  1775. std::list<int> foo;
  1776. std::vector<int>::iterator it =
  1777. std::find_if(moo.begin(), moo.end(),
  1778. std::bind2nd(std::less<int>(), 3));],
  1779. wx_cv_lib_stl=yes,
  1780. wx_cv_lib_stl=no
  1781. )]
  1782. )
  1783. if test "$wx_cv_lib_stl" != yes; then
  1784. AC_MSG_ERROR([Can't use --enable-stl as basic STL functionality is missing])
  1785. fi
  1786. dnl check for compliant std::string::compare
  1787. AC_CACHE_CHECK([for compliant std::string::compare],
  1788. wx_cv_func_stdstring_compare,
  1789. [AC_TRY_COMPILE([#include <string>],
  1790. [std::string foo, bar;
  1791. foo.compare(bar);
  1792. foo.compare(1, 1, bar);
  1793. foo.compare(1, 1, bar, 1, 1);
  1794. foo.compare("");
  1795. foo.compare(1, 1, "");
  1796. foo.compare(1, 1, "", 2);],
  1797. wx_cv_func_stdstring_compare=yes,
  1798. wx_cv_func_stdstring_compare=no
  1799. )]
  1800. )
  1801. if test "$wx_cv_func_stdstring_compare" = yes; then
  1802. AC_DEFINE(HAVE_STD_STRING_COMPARE)
  1803. fi
  1804. if test "$wx_cv_class_gnuhashmapset" = yes; then
  1805. AC_DEFINE(HAVE_EXT_HASH_MAP)
  1806. AC_DEFINE(HAVE_GNU_CXX_HASH_MAP)
  1807. fi
  1808. AC_CHECK_HEADER([unordered_map],
  1809. [AC_CACHE_CHECK([for unordered_map and unordered_set in std],
  1810. wx_cv_class_stdunorderedmapset,
  1811. [AC_TRY_COMPILE([#include <unordered_map>
  1812. #include <unordered_set>],
  1813. [std::unordered_map<double*, char*> test1;
  1814. std::unordered_set<char*> test2;],
  1815. wx_cv_class_stdunorderedmapset=yes,
  1816. wx_cv_class_stdunorderedmapset=no)
  1817. ]
  1818. )],
  1819. [],
  1820. [ ]
  1821. )
  1822. if test "$wx_cv_class_stdunorderedmapset" = yes; then
  1823. AC_DEFINE(HAVE_STD_UNORDERED_MAP)
  1824. AC_DEFINE(HAVE_STD_UNORDERED_SET)
  1825. else
  1826. AC_CHECK_HEADER([tr1/unordered_map],
  1827. [AC_CACHE_CHECK([for unordered_map and unordered_set in std::tr1],
  1828. wx_cv_class_tr1unorderedmapset,
  1829. [AC_TRY_COMPILE([#include <tr1/unordered_map>
  1830. #include <tr1/unordered_set>],
  1831. [std::tr1::unordered_map<double*, char*> test1;
  1832. std::tr1::unordered_set<char*> test2;
  1833. #if defined(__GNUC__) && (__GNUC__==4) && (__GNUC_MINOR__<2)
  1834. #error can't use unordered_{map,set} with gcc-4.[01]: http://gcc.gnu.org/PR24389
  1835. #endif],
  1836. wx_cv_class_tr1unorderedmapset=yes,
  1837. wx_cv_class_tr1unorderedmapset=no)
  1838. ]
  1839. )],
  1840. [],
  1841. [ ]
  1842. )
  1843. if test "$wx_cv_class_tr1unorderedmapset" = yes; then
  1844. AC_DEFINE(HAVE_TR1_UNORDERED_MAP)
  1845. AC_DEFINE(HAVE_TR1_UNORDERED_SET)
  1846. else
  1847. dnl check for hash_map and hash_set headers
  1848. AC_CHECK_HEADER([hash_map],
  1849. [AC_CACHE_CHECK([for std::hash_map and hash_set],
  1850. wx_cv_class_stdhashmapset,
  1851. [AC_TRY_COMPILE([#include <hash_map>
  1852. #include <hash_set>],
  1853. [std::hash_map<double*, char*, std::hash<double*>, std::equal_to<double*> > test1;
  1854. std::hash_set<char*, std::hash<char*>, std::equal_to<char*> > test2;],
  1855. wx_cv_class_stdhashmapset=yes,
  1856. wx_cv_class_stdhashmapset=no)
  1857. ]
  1858. )],
  1859. [],
  1860. [ ]
  1861. )
  1862. if test "$wx_cv_class_stdhashmapset" = yes; then
  1863. AC_DEFINE(HAVE_HASH_MAP)
  1864. AC_DEFINE(HAVE_STD_HASH_MAP)
  1865. fi
  1866. AC_CHECK_HEADER([ext/hash_map],
  1867. [AC_CACHE_CHECK([for GNU hash_map and hash_set],
  1868. wx_cv_class_gnuhashmapset,
  1869. [AC_TRY_COMPILE([#include <ext/hash_map>
  1870. #include <ext/hash_set>],
  1871. [__gnu_cxx::hash_map<double*, char*, __gnu_cxx::hash<double*>, std::equal_to<double*> > test1;
  1872. __gnu_cxx::hash_set<char*, __gnu_cxx::hash<char*>, std::equal_to<char*> > test2;],
  1873. wx_cv_class_gnuhashmapset=yes,
  1874. wx_cv_class_gnuhashmapset=no)
  1875. ]
  1876. )],
  1877. [],
  1878. [ ]
  1879. )
  1880. fi
  1881. fi
  1882. fi
  1883. AC_CHECK_HEADERS([type_traits tr1/type_traits], break)
  1884. dnl check for atomic operations builtins for wx/atomic.h:
  1885. WX_ATOMIC_BUILTINS
  1886. dnl pop C++
  1887. AC_LANG_POP()
  1888. dnl ---------------------------------------------------------------------------
  1889. dnl Define search path for includes and libraries: all headers and libs will be
  1890. dnl looked for in all directories of this path
  1891. dnl ---------------------------------------------------------------------------
  1892. dnl Notice that /usr/include should *not* be in this list, otherwise it breaks
  1893. dnl compilation on Solaris/AIX/... with gcc because standard (non ANSI C)
  1894. dnl headers are included instead of the "fixed" (ANSI-fied) gcc ones.
  1895. dnl
  1896. dnl Also try to put all directories which may contain X11R6 before those which
  1897. dnl may contain X11R5/4 - we want to use R6 on machines which have both!
  1898. dnl
  1899. dnl In the same vein. Motif 2.1 should be tried before Motif 1.2 for the
  1900. dnl systems which have both (AIX 4.x does)
  1901. SEARCH_INCLUDE="\
  1902. /usr/local/include \
  1903. /usr/local/X11/include \
  1904. /usr/local/include/X11 \
  1905. /usr/local/X11R7/include \
  1906. /usr/local/X11R6/include \
  1907. /usr/local/include/X11R7 \
  1908. /usr/local/include/X11R6 \
  1909. \
  1910. /usr/Motif-2.1/include \
  1911. /usr/Motif-1.2/include \
  1912. /usr/include/Motif1.2 \
  1913. \
  1914. /usr/dt/include \
  1915. /usr/openwin/include \
  1916. \
  1917. /usr/include/Xm \
  1918. \
  1919. /usr/X11R7/include \
  1920. /usr/X11R6/include \
  1921. /usr/X11R6.4/include \
  1922. \
  1923. /usr/include/X11R7 \
  1924. /usr/include/X11R6 \
  1925. \
  1926. /usr/X11/include \
  1927. /usr/include/X11 \
  1928. \
  1929. /usr/XFree86/include/X11 \
  1930. /usr/pkg/include \
  1931. \
  1932. /usr/local/X1R5/include \
  1933. /usr/local/include/X11R5 \
  1934. /usr/X11R5/include \
  1935. /usr/include/X11R5 \
  1936. \
  1937. /usr/local/X11R4/include \
  1938. /usr/local/include/X11R4 \
  1939. /usr/X11R4/include \
  1940. /usr/include/X11R4 \
  1941. \
  1942. /usr/openwin/share/include"
  1943. dnl try to find out the standard lib locations for the systems with multiple
  1944. dnl ABIs
  1945. AC_MSG_CHECKING([for libraries directories])
  1946. case "${host}" in
  1947. *-*-irix6* )
  1948. AC_CACHE_VAL(
  1949. wx_cv_std_libpath,
  1950. [
  1951. for d in WX_STD_LIBPATH(); do
  1952. for e in a so sl dylib dll.a; do
  1953. libc="$d/libc.$e"
  1954. if test -f $libc; then
  1955. save_LIBS="$LIBS"
  1956. LIBS="$libc"
  1957. AC_LINK_IFELSE([
  1958. AC_LANG_SOURCE([int main() { return 0; }])
  1959. ],
  1960. wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
  1961. LIBS="$save_LIBS"
  1962. if test "x$wx_cv_std_libpath" != "x"; then
  1963. break 2
  1964. fi
  1965. fi
  1966. done
  1967. done
  1968. ]
  1969. )
  1970. ;;
  1971. *-*-solaris2* )
  1972. dnl use ../lib or ../lib/64 depending on the size of void*
  1973. if test "$ac_cv_sizeof_void_p" = 8 -a -d "/usr/lib/64"; then
  1974. wx_cv_std_libpath="lib/64"
  1975. fi
  1976. ;;
  1977. *-*-linux* )
  1978. dnl Recent Debian versions (as of 2011) use new approach to multiarch
  1979. dnl and put the libraries under /usr/lib/arch-linux-gnu. Annoyingly,
  1980. dnl "arch" here is not `uname -m` because it is "i386" even when uname
  1981. dnl returns e.g. "i686". So we need to test for it explicitly.
  1982. if test "$ac_cv_sizeof_void_p" = 8; then
  1983. if test -d "/usr/lib/`uname -m`-linux-gnu"; then
  1984. wx_cv_std_libfullpath="/usr/lib/`uname -m`-linux-gnu"
  1985. elif test -d "/usr/lib64" -a ! -h "/usr/lib64"; then
  1986. wx_cv_std_libpath="lib64"
  1987. fi
  1988. else
  1989. case "${host}" in
  1990. i*86-*-linux* )
  1991. if test -d '/usr/lib/i386-linux-gnu'; then
  1992. wx_cv_std_libfullpath='/usr/lib/i386-linux-gnu'
  1993. fi
  1994. esac
  1995. fi
  1996. dnl And on top of all this, some packages haven't been updated for
  1997. dnl full multiarch support yet so we still need to look in /usr/lib
  1998. dnl too as well.
  1999. if test -n "$wx_cv_std_libfullpath" -a -d "/usr/lib"; then
  2000. wx_cv_std_libfullpath="$wx_cv_std_libfullpath /usr/lib"
  2001. fi
  2002. ;;
  2003. esac
  2004. if test -z "$wx_cv_std_libpath"; then
  2005. wx_cv_std_libpath="lib"
  2006. fi
  2007. if test -z "$wx_cv_std_libfullpath"; then
  2008. wx_cv_std_libfullpath="/usr/$wx_cv_std_libpath"
  2009. fi
  2010. AC_MSG_RESULT($wx_cv_std_libfullpath)
  2011. SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` $wx_cv_std_libfullpath"
  2012. dnl Cross compiling with gcc?
  2013. if test "$build" != "$host" -a "$GCC" = yes; then
  2014. dnl for gcc cross-compilers "$CC -print-prog-name=ld" prints the path to
  2015. dnl the linker. Stripping off the trailing '/bin/ld' gives us a candiate
  2016. dnl for a 'root' below which libraries and headers for the target system
  2017. dnl might be installed.
  2018. if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then
  2019. cross_root=`dirname $cross_root`
  2020. cross_root=`dirname $cross_root`
  2021. dnl substitute this candiate root for '^/usr' in the search lists,
  2022. dnl strip out any that don't start '^/usr'.
  2023. SEARCH_LIB=`for x in $SEARCH_LIB; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
  2024. SEARCH_INCLUDE=`for x in $SEARCH_INCLUDE; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"`
  2025. SEARCH_INCLUDE="$SEARCH_INCLUDE $cross_root/include"
  2026. dnl also have pkg-config search for *.pc files under this 'root'
  2027. if test -z "$PKG_CONFIG_PATH"; then
  2028. PKG_CONFIG_PATH="$cross_root/local/lib/pkgconfig:$cross_root/lib/pkgconfig"
  2029. export PKG_CONFIG_PATH
  2030. fi
  2031. dnl AC_PATH_XTRA doesn't work currently unless -x-includes and
  2032. dnl -x-libraries are given on the command line. So if they are not
  2033. dnl set then set them here to plausible defaults.
  2034. if test -z "$x_includes" -o "$x_includes" = NONE; then
  2035. WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h)
  2036. x_includes=$ac_find_includes
  2037. fi
  2038. if test -z "$x_libraries" -o "$x_libraries" = NONE; then
  2039. WX_PATH_FIND_LIBRARIES(Xt)
  2040. x_libraries=$ac_find_libraries
  2041. fi
  2042. fi
  2043. fi
  2044. dnl ------------------------------------------------------------------------
  2045. dnl Check for libraries
  2046. dnl ------------------------------------------------------------------------
  2047. dnl flush the cache because checking for libraries below might abort
  2048. AC_CACHE_SAVE
  2049. dnl Only add the -lm library if floating point functions cannot be used
  2050. dnl without it. This check is important on cygwin because of the bizarre
  2051. dnl way that they have organized functions into libraries. On cygwin, both
  2052. dnl libc.a and libm.a are symbolic links to a single lib libcygwin.a. This
  2053. dnl means that
  2054. dnl 1) linking with -lm is not necessary, and
  2055. dnl 2) linking with -lm is dangerous if the order of libraries is wrong
  2056. dnl In particular, if you compile any program with -mno-cygwin and link with
  2057. dnl -lm, it will crash instantly when it is run. This happens because the
  2058. dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces
  2059. dnl the ___main function instead of allowing it to be defined by
  2060. dnl /usr/lib/mingw/libmingw32.a as it should be.
  2061. dnl
  2062. dnl On MacOS X, this test will find that -lm is unnecessary and leave it out.
  2063. dnl
  2064. dnl Just check a few floating point functions. If they are all found without
  2065. dnl -lm, then we must not need -lm.
  2066. have_cos=0
  2067. have_floor=0
  2068. AC_CHECK_FUNCS(cos, have_cos=1)
  2069. AC_CHECK_FUNCS(floor, have_floor=1)
  2070. AC_MSG_CHECKING(if floating point functions link without -lm)
  2071. if test "$have_cos" = 1 -a "$have_floor" = 1; then
  2072. AC_MSG_RESULT(yes)
  2073. else
  2074. AC_MSG_RESULT(no)
  2075. LIBS="$LIBS -lm"
  2076. # use different functions to avoid configure caching
  2077. have_sin=0
  2078. have_ceil=0
  2079. AC_CHECK_FUNCS(sin, have_sin=1)
  2080. AC_CHECK_FUNCS(ceil, have_ceil=1)
  2081. AC_MSG_CHECKING(if floating point functions link with -lm)
  2082. if test "$have_sin" = 1 -a "$have_ceil" = 1; then
  2083. AC_MSG_RESULT(yes)
  2084. else
  2085. AC_MSG_RESULT(no)
  2086. # not sure we should warn the user, crash, etc.
  2087. fi
  2088. fi
  2089. dnl check for C99 string to long long conversion functions, assume that if we
  2090. dnl have the unsigned variants, then we have the signed ones as well
  2091. dnl
  2092. dnl at least under SGI these functions are only available in C99 code and not
  2093. dnl in C++ so do these tests using C++ compiler
  2094. AC_LANG_PUSH(C++)
  2095. if test "wxUSE_UNICODE" = "yes"; then
  2096. WX_CHECK_FUNCS(wcstoull)
  2097. else
  2098. WX_CHECK_FUNCS(strtoull)
  2099. fi
  2100. AC_LANG_POP()
  2101. dnl ---------------------------------------------------------------------------
  2102. dnl Optional libraries
  2103. dnl
  2104. dnl --with-<lib>=sys
  2105. dnl looks for system library and fails if not found
  2106. dnl
  2107. dnl --with-<lib>
  2108. dnl --with-<lib>=yes
  2109. dnl looks for system library and, if not found, prints a warning,
  2110. dnl falls back to the builtin wx version, and continues configuration
  2111. dnl
  2112. dnl --with-<lib>=builtin
  2113. dnl uses builtin wx version without searching for system library
  2114. dnl
  2115. dnl --with-<lib>=no
  2116. dnl --without-<lib>
  2117. dnl do not use library (neither system nor builtin wx version)
  2118. dnl
  2119. dnl ---------------------------------------------------------------------------
  2120. dnl ------------------------------------------------------------------------
  2121. dnl Check for regex libraries
  2122. dnl ------------------------------------------------------------------------
  2123. if test "$wxUSE_REGEX" != "no"; then
  2124. AC_DEFINE(wxUSE_REGEX)
  2125. if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_REGEX" = "yes"; then
  2126. AC_MSG_WARN([Defaulting to the builtin regex library for Unicode build.])
  2127. wxUSE_REGEX=builtin
  2128. fi
  2129. if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then
  2130. dnl according to Unix 98 specs, regcomp() is in libc but I believe that
  2131. dnl on some old systems it may be in libregex - check for it too?
  2132. AC_CHECK_HEADER(regex.h, [AC_CHECK_FUNCS(regcomp re_search)],, [ ])
  2133. if test "x$ac_cv_func_regcomp" != "xyes"; then
  2134. if test "$wxUSE_REGEX" = "sys" ; then
  2135. AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version])
  2136. else
  2137. AC_MSG_WARN([system regex library not found, will use built-in instead])
  2138. wxUSE_REGEX=builtin
  2139. fi
  2140. else
  2141. dnl we are using the system library
  2142. wxUSE_REGEX=sys
  2143. dnl only the built-in supports advanced REs
  2144. AC_DEFINE(WX_NO_REGEX_ADVANCED)
  2145. fi
  2146. fi
  2147. fi
  2148. dnl ------------------------------------------------------------------------
  2149. dnl Check for zlib compression library
  2150. dnl ------------------------------------------------------------------------
  2151. ZLIB_LINK=
  2152. if test "$wxUSE_ZLIB" != "no" ; then
  2153. AC_DEFINE(wxUSE_ZLIB)
  2154. if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then
  2155. dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we
  2156. dnl should still use it because hopefully (can someone confirm this?)
  2157. dnl Apple did fix the security problem in it and not using the system
  2158. dnl library results in a whole bunch of warnings when linking with
  2159. dnl Carbon framework
  2160. if test "$USE_DARWIN" = 1; then
  2161. system_zlib_h_ok="yes"
  2162. else
  2163. dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is
  2164. dnl known to not work) and although I don't know which is
  2165. dnl the minimal required version it's safer to test for 1.1.4 as
  2166. dnl it fixes a security problem in 1.1.3 -- and hopefully nobody
  2167. dnl has anything more ancient (1.1.3 was released in July 1998)
  2168. dnl anyhow
  2169. AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h,
  2170. [AC_TRY_RUN(
  2171. dnl zlib.h defines ZLIB_VERSION="x.y.z"
  2172. [
  2173. #include <zlib.h>
  2174. #include <stdio.h>
  2175. int main()
  2176. {
  2177. FILE *f=fopen("conftestval", "w");
  2178. if (!f) exit(1);
  2179. fprintf(f, "%s",
  2180. ZLIB_VERSION[0] == '1' &&
  2181. (ZLIB_VERSION[2] > '1' ||
  2182. (ZLIB_VERSION[2] == '1' &&
  2183. ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
  2184. exit(0);
  2185. }
  2186. ],
  2187. ac_cv_header_zlib_h=`cat conftestval`,
  2188. ac_cv_header_zlib_h=no,
  2189. dnl cross-compiling: don't have an answer, try later
  2190. unset ac_cv_header_zlib_h
  2191. )]
  2192. )
  2193. dnl If the test above did not come up with a value (e.g. cross
  2194. dnl compiling) then this should give a definitive answer
  2195. AC_CHECK_HEADER(zlib.h,,, [ ])
  2196. system_zlib_h_ok=$ac_cv_header_zlib_h
  2197. fi
  2198. if test "$system_zlib_h_ok" = "yes"; then
  2199. AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz")
  2200. fi
  2201. if test "x$ZLIB_LINK" = "x" ; then
  2202. if test "$wxUSE_ZLIB" = "sys" ; then
  2203. AC_MSG_ERROR([zlib library not found or too old! Use --with-zlib=builtin to use built-in version])
  2204. else
  2205. AC_MSG_WARN([zlib library not found or too old, will use built-in instead])
  2206. wxUSE_ZLIB=builtin
  2207. fi
  2208. else
  2209. dnl we are using the system library
  2210. wxUSE_ZLIB=sys
  2211. fi
  2212. fi
  2213. fi
  2214. dnl ------------------------------------------------------------------------
  2215. dnl Check for png library
  2216. dnl ------------------------------------------------------------------------
  2217. PNG_LINK=
  2218. if test "$wxUSE_LIBPNG" != "no" ; then
  2219. AC_DEFINE(wxUSE_LIBPNG)
  2220. dnl for the check below to have a chance to succeed, we must already have
  2221. dnl libz somewhere
  2222. if test "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
  2223. AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead])
  2224. wxUSE_LIBPNG=builtin
  2225. fi
  2226. if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then
  2227. dnl libpng version 0.9 is known to not work, if an even newer
  2228. dnl version is required, just bump it up in the test below
  2229. AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h,
  2230. [AC_TRY_RUN(
  2231. dnl png.h defines PNG_LIBPNG_VER=number
  2232. [
  2233. #include <png.h>
  2234. #include <stdio.h>
  2235. int main()
  2236. {
  2237. FILE *f=fopen("conftestval", "w");
  2238. if (!f) exit(1);
  2239. fprintf(f, "%s",
  2240. PNG_LIBPNG_VER > 90 ? "yes" : "no");
  2241. exit(0);
  2242. }
  2243. ],
  2244. ac_cv_header_png_h=`cat conftestval`,
  2245. ac_cv_header_png_h=no,
  2246. dnl cross-compiling: test (later) if we have any png.h
  2247. unset ac_cv_header_png_h
  2248. )]
  2249. )
  2250. AC_CHECK_HEADER(png.h,,, [ ])
  2251. if test "$ac_cv_header_png_h" = "yes"; then
  2252. AC_CHECK_LIB(png, png_sig_cmp, PNG_LINK=" -lpng -lz", , [-lz -lm])
  2253. fi
  2254. if test "x$PNG_LINK" = "x" ; then
  2255. if test "$wxUSE_LIBPNG" = "sys" ; then
  2256. AC_MSG_ERROR([system png library not found or too old! Use --with-libpng=builtin to use built-in version])
  2257. else
  2258. AC_MSG_WARN([system png library not found or too old, will use built-in instead])
  2259. wxUSE_LIBPNG=builtin
  2260. fi
  2261. else
  2262. dnl we are using the system library
  2263. wxUSE_LIBPNG=sys
  2264. fi
  2265. fi
  2266. fi
  2267. dnl ------------------------------------------------------------------------
  2268. dnl Check for jpeg library
  2269. dnl ------------------------------------------------------------------------
  2270. dnl this check must be done before the check for libtiff as libtiff uses
  2271. dnl libjpeg itself
  2272. JPEG_LINK=
  2273. if test "$wxUSE_LIBJPEG" != "no" ; then
  2274. AC_DEFINE(wxUSE_LIBJPEG)
  2275. if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then
  2276. dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
  2277. dnl HAVE_STDLIB_H which are already defined and this provokes
  2278. dnl a compiler warning which configure considers as an error...
  2279. AC_MSG_CHECKING(for jpeglib.h)
  2280. AC_CACHE_VAL(ac_cv_header_jpeglib_h,
  2281. AC_TRY_COMPILE(
  2282. [
  2283. #undef HAVE_STDLIB_H
  2284. #include <stdio.h>
  2285. #include <jpeglib.h>
  2286. ],
  2287. [
  2288. ],
  2289. ac_cv_header_jpeglib_h=yes,
  2290. ac_cv_header_jpeglib_h=no
  2291. )
  2292. )
  2293. AC_MSG_RESULT($ac_cv_header_jpeglib_h)
  2294. if test "$ac_cv_header_jpeglib_h" = "yes"; then
  2295. AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
  2296. fi
  2297. if test "x$JPEG_LINK" = "x" ; then
  2298. if test "$wxUSE_LIBJPEG" = "sys" ; then
  2299. AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
  2300. else
  2301. AC_MSG_WARN([system jpeg library not found, will use built-in instead])
  2302. wxUSE_LIBJPEG=builtin
  2303. fi
  2304. else
  2305. dnl we are using the system library
  2306. wxUSE_LIBJPEG=sys
  2307. if test "$wxUSE_MSW" = 1; then
  2308. dnl boolean is defined by the jpeg headers and also by the
  2309. dnl Windows headers of some compilers. This type has been
  2310. dnl renamed in the builtin, so it is only an issue when
  2311. dnl using an external jpeg lib on Windows.
  2312. AC_CHECK_TYPES(
  2313. [boolean],
  2314. [
  2315. AC_CHECK_SIZEOF(
  2316. [boolean],
  2317. [],
  2318. [
  2319. #undef HAVE_BOOLEAN
  2320. #include <stdio.h>
  2321. #include <jpeglib.h>
  2322. ])
  2323. AC_DEFINE_UNQUOTED(
  2324. [wxHACK_BOOLEAN],
  2325. [wxInt`expr 8 \* $ac_cv_sizeof_boolean`])
  2326. ],
  2327. [],
  2328. [#include <windows.h>])
  2329. fi
  2330. fi
  2331. fi
  2332. fi
  2333. dnl ------------------------------------------------------------------------
  2334. dnl Check for tiff library
  2335. dnl ------------------------------------------------------------------------
  2336. TIFF_LINK=
  2337. TIFF_PREREQ_LINKS=-lm
  2338. if test "$wxUSE_LIBTIFF" != "no" ; then
  2339. AC_DEFINE(wxUSE_LIBTIFF)
  2340. if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
  2341. dnl libtiff may depend on libjpeg and libz so use them in the test
  2342. dnl below or it would fail
  2343. if test "$wxUSE_LIBJPEG" = "sys"; then
  2344. TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK"
  2345. fi
  2346. if test "$wxUSE_ZLIB" = "sys"; then
  2347. TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK"
  2348. fi
  2349. AC_CHECK_HEADER(tiffio.h,
  2350. [
  2351. AC_CHECK_LIB(tiff, TIFFError,
  2352. TIFF_LINK=" -ltiff",
  2353. ,
  2354. $TIFF_PREREQ_LINKS)
  2355. ],
  2356. [],
  2357. [ ]
  2358. )
  2359. if test "x$TIFF_LINK" = "x" ; then
  2360. if test "$wxUSE_LIBTIFF" = "sys" ; then
  2361. AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
  2362. else
  2363. AC_MSG_WARN([system tiff library not found, will use built-in instead])
  2364. wxUSE_LIBTIFF=builtin
  2365. fi
  2366. else
  2367. dnl we are using the system library
  2368. wxUSE_LIBTIFF=sys
  2369. fi
  2370. fi
  2371. if test "$wxUSE_LIBTIFF" = "builtin" ; then
  2372. if test "$wxUSE_LIBJPEG" = "no"; then
  2373. dnl we have to prevent the builtin libtiff configure from building the
  2374. dnl library with JPEG support as this was explicitly disabled by user,
  2375. dnl but unfortunately it needs --disable-jpeg and not --without-libjpeg
  2376. dnl (which will be passed to it anyhow as configure passes arguments to
  2377. dnl the top-level script to all the other ones called recursively), so
  2378. dnl we need to hack around this
  2379. ac_configure_args="$ac_configure_args --disable-jpeg"
  2380. fi
  2381. if test "$wxUSE_LIBLZMA" = "yes"; then
  2382. dnl If libtiff configure detects lzma library, it enables support for
  2383. dnl LZMA compression and using it requires linking with liblzma.
  2384. AC_CHECK_LIB(lzma, lzma_code, [LIBS="$LIBS -llzma"])
  2385. else
  2386. dnl Prevent libtiff configure from looking for liblzma if it's
  2387. dnl explicitly disabled.
  2388. ac_configure_args="$ac_configure_args --disable-lzma"
  2389. fi
  2390. dnl Similarly for jbig
  2391. if test "$wxUSE_LIBJBIG" = "yes"; then
  2392. AC_CHECK_LIB(jbig, jbg_dec_init, [LIBS="$LIBS -ljbig"])
  2393. else
  2394. ac_configure_args="$ac_configure_args --disable-jbig"
  2395. fi
  2396. AC_CONFIG_SUBDIRS([src/tiff])
  2397. fi
  2398. fi
  2399. dnl ------------------------------------------------------------------------
  2400. dnl Check for expat libraries
  2401. dnl ------------------------------------------------------------------------
  2402. if test "$wxUSE_EXPAT" != "no"; then
  2403. wxUSE_XML=yes
  2404. AC_DEFINE(wxUSE_EXPAT)
  2405. AC_DEFINE(wxUSE_XML)
  2406. if test "$wxUSE_EXPAT" = "sys" -o "$wxUSE_EXPAT" = "yes" ; then
  2407. AC_CHECK_HEADER([expat.h], [found_expat_h=1],, [ ])
  2408. if test "x$found_expat_h" = "x1"; then
  2409. dnl Expat 1.95.6 comes with broken expat.h:
  2410. AC_CACHE_CHECK([if expat.h is valid C++ header],
  2411. wx_cv_expat_is_not_broken,
  2412. [
  2413. AC_LANG_PUSH(C++)
  2414. AC_TRY_COMPILE([#include <expat.h>],[],
  2415. wx_cv_expat_is_not_broken=yes,
  2416. wx_cv_expat_is_not_broken=no
  2417. )
  2418. AC_LANG_POP()
  2419. ]
  2420. )
  2421. if test "$wx_cv_expat_is_not_broken" = "yes" ; then
  2422. AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LINK=" -lexpat")
  2423. fi
  2424. fi
  2425. if test "x$EXPAT_LINK" = "x" ; then
  2426. if test "$wxUSE_EXPAT" = "sys" ; then
  2427. AC_MSG_ERROR([system expat library not found! Use --with-expat=builtin to use built-in version])
  2428. else
  2429. AC_MSG_WARN([system expat library not found, will use built-in instead])
  2430. wxUSE_EXPAT=builtin
  2431. fi
  2432. else
  2433. dnl we are using the system library
  2434. wxUSE_EXPAT=sys
  2435. fi
  2436. fi
  2437. if test "$wxUSE_EXPAT" = "builtin" ; then
  2438. dnl Expat needs this:
  2439. AC_CONFIG_SUBDIRS([src/expat])
  2440. fi
  2441. fi
  2442. dnl ------------------------------------------------------------------------
  2443. dnl Check for libmspack
  2444. dnl ------------------------------------------------------------------------
  2445. if test "$wxUSE_LIBMSPACK" != "no"; then
  2446. AC_CHECK_HEADER([mspack.h], [found_mspack_h=1],, [ ])
  2447. if test "x$found_mspack_h" = "x1"; then
  2448. AC_CHECK_LIB(mspack, mspack_create_chm_decompressor,
  2449. MSPACK_LINK=" -lmspack")
  2450. fi
  2451. if test "x$MSPACK_LINK" = "x" ; then
  2452. wxUSE_LIBMSPACK=no
  2453. fi
  2454. fi
  2455. if test "$wxUSE_LIBMSPACK" != "no"; then
  2456. AC_DEFINE(wxUSE_LIBMSPACK)
  2457. fi
  2458. dnl ----------------------------------------------------------------
  2459. dnl search for toolkit (widget sets)
  2460. dnl ----------------------------------------------------------------
  2461. TOOLKIT=
  2462. TOOLKIT_INCLUDE=
  2463. WIDGET_SET=
  2464. dnl are we building for a win32 target environment?
  2465. dnl If so, setup common stuff needed for both GUI and Base libs.
  2466. if test "$USE_WIN32" = 1 ; then
  2467. AC_CHECK_HEADERS(w32api.h,,, [ ])
  2468. AC_CHECK_HEADER(windows.h,,
  2469. [
  2470. AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
  2471. ],
  2472. [ ])
  2473. LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32"
  2474. case "${host}" in
  2475. x86_64-*-mingw32* )
  2476. dnl we need to define this to embed the manifest for correct
  2477. dnl platform from wx/msw/wx.rc (this is not needed for x86 which is
  2478. dnl the default in wx/msw/rcdefs.h)
  2479. WINDRES_CPU_DEFINE="--define WX_CPU_AMD64"
  2480. ;;
  2481. esac
  2482. if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
  2483. LIBS="$LIBS -loleacc"
  2484. fi
  2485. case "${host}" in
  2486. *-*-cygwin* )
  2487. dnl Cygwin doesn't include these by default
  2488. LIBS="$LIBS -lkernel32 -luser32"
  2489. esac
  2490. dnl Flags to be passed to windres by the applications using wxWidgets.
  2491. WXCONFIG_RESFLAGS="--define __WIN32__ --define __GNUWIN32__ $WINDRES_CPU_DEFINE"
  2492. fi
  2493. if test "$wxUSE_GUI" = "yes"; then
  2494. USE_GUI=1
  2495. GUI_TK_LIBRARY=
  2496. WXGTK1=
  2497. WXGTK127=
  2498. WXGTK2=
  2499. WXGTK3=
  2500. WXGPE=
  2501. if test "$wxUSE_OLD_COCOA" = 1 ; then
  2502. if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes"; then
  2503. AC_MSG_WARN([Printing not supported under wxCocoa yet, disabled])
  2504. wxUSE_PRINTING_ARCHITECTURE=no
  2505. fi
  2506. if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
  2507. AC_MSG_WARN([Drag and Drop not supported under wxCocoa yet, disabled])
  2508. wxUSE_DRAG_AND_DROP=no
  2509. fi
  2510. if test "$wxUSE_DRAGIMAGE" = "yes"; then
  2511. AC_MSG_WARN([wxDragImage not supported under wxCocoa yet, disabled])
  2512. wxUSE_DRAGIMAGE=no
  2513. fi
  2514. fi
  2515. if test "$wxUSE_MSW" = 1 ; then
  2516. TOOLKIT=MSW
  2517. GUIDIST=MSW_DIST
  2518. dnl -mwindows causes a heap of other default gui libs to be linked in.
  2519. case "${host}" in
  2520. *-*-mingw32* )
  2521. WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows"
  2522. esac
  2523. fi
  2524. if test "$wxUSE_GTK" = 1; then
  2525. dnl GTK+ test program must be compiled with C compiler
  2526. AC_MSG_CHECKING([for GTK+ version])
  2527. gtk_version_cached=1
  2528. AC_CACHE_VAL(wx_cv_lib_gtk,
  2529. [
  2530. dnl stupid GTK+ AM macros produce their own messages, so we
  2531. dnl have to pass to the next line
  2532. gtk_version_cached=0
  2533. AC_MSG_RESULT()
  2534. dnl we must link against lgthread unless the user
  2535. dnl used --disable-threads
  2536. GTK_MODULES=
  2537. if test "$wxUSE_THREADS" = "yes"; then
  2538. GTK_MODULES=gthread
  2539. fi
  2540. if test -z "$wxGTK_VERSION"; then
  2541. wxGTK_VERSION=any
  2542. fi
  2543. dnl detect GTK2
  2544. wx_cv_lib_gtk=
  2545. if test "x$wxGTK_VERSION" != "x1"
  2546. then
  2547. dnl The gthread.pc that ships with Solaris returns '-mt',
  2548. dnl it's correct for Sun CC, but gcc requires '-pthreads'.
  2549. dnl So disable the compile check and remove the -mt below.
  2550. case "${host}" in
  2551. *-*-solaris2* )
  2552. if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then
  2553. enable_gtktest=no
  2554. fi
  2555. esac
  2556. if test "$wxGTK_VERSION" != 3; then
  2557. AM_PATH_GTK_2_0(2.6.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
  2558. fi
  2559. if test -z "$wx_cv_lib_gtk"; then
  2560. if test "$wxGTK_VERSION" = 3 -o "$wxGTK_VERSION" = any; then
  2561. AM_PATH_GTK_3_0(, wx_cv_lib_gtk=3, , $GTK_MODULES)
  2562. fi
  2563. fi
  2564. fi
  2565. dnl detect GTK1.x
  2566. if test -z "$wx_cv_lib_gtk"; then
  2567. if test "x$wxGTK_VERSION" = "x1" -o "x$wxGTK_VERSION" = "xany" ; then
  2568. AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
  2569. if test -z "$wx_cv_lib_gtk"; then
  2570. AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
  2571. fi
  2572. fi
  2573. fi
  2574. if test -z "$wx_cv_lib_gtk"; then
  2575. dnl looks better in AC_MSG_RESULT
  2576. wx_cv_lib_gtk=none
  2577. else
  2578. dnl we use symbols from X11 directly so we should link with it
  2579. GTK_LIBS="$GTK_LIBS -lX11"
  2580. dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
  2581. dnl subsequent runs
  2582. wx_cv_cflags_gtk=$GTK_CFLAGS
  2583. wx_cv_libs_gtk=$GTK_LIBS
  2584. fi
  2585. ]
  2586. )
  2587. dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
  2588. dnl enough
  2589. if test "$gtk_version_cached" = 1; then
  2590. AC_MSG_RESULT($wx_cv_lib_gtk)
  2591. fi
  2592. case "$wx_cv_lib_gtk" in
  2593. 3) WXGTK3=1
  2594. TOOLKIT_VERSION=3
  2595. ;;
  2596. 2.0) WXGTK2=1
  2597. TOOLKIT_VERSION=2
  2598. ;;
  2599. 1.2.7) WXGTK127=1
  2600. WXGTK1=1
  2601. ;;
  2602. 1.2*) WXGTK1=1 ;;
  2603. *) AC_MSG_ERROR([
  2604. The development files for GTK+ were not found. For GTK+ 2, please
  2605. ensure that pkg-config is in the path and that gtk+-2.0.pc is
  2606. installed. For GTK+ 1.2 please check that gtk-config is in the path,
  2607. and that the version is 1.2.3 or above. Also check that the
  2608. libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
  2609. --libs' are in the LD_LIBRARY_PATH or equivalent.
  2610. ])
  2611. ;;
  2612. esac
  2613. if test "$WXGTK3" = 1; then
  2614. AC_DEFINE(__WXGTK218__)
  2615. AC_DEFINE(__WXGTK210__)
  2616. elif test "$WXGTK2" = 1; then
  2617. save_CFLAGS="$CFLAGS"
  2618. save_LIBS="$LIBS"
  2619. CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
  2620. LIBS="$LIBS $wx_cv_libs_gtk"
  2621. dnl test if we have at least GTK+ 2.18:
  2622. AC_MSG_CHECKING([if GTK+ is version >= 2.18])
  2623. AC_TRY_COMPILE([
  2624. #include <gtk/gtk.h>
  2625. ],
  2626. [
  2627. #if !GTK_CHECK_VERSION(2,18,0)
  2628. Not GTK+ 2.18
  2629. #endif
  2630. ],
  2631. [
  2632. AC_DEFINE(__WXGTK218__)
  2633. AC_DEFINE(__WXGTK210__)
  2634. AC_MSG_RESULT([yes])
  2635. ac_wxgtk218=1
  2636. ],
  2637. [
  2638. AC_MSG_RESULT([no])
  2639. ac_wxgtk218=0
  2640. ])
  2641. if test "$ac_wxgtk218" = 0; then
  2642. dnl test if we have at least GTK+ 2.10:
  2643. AC_MSG_CHECKING([if GTK+ is version >= 2.10])
  2644. AC_TRY_COMPILE([
  2645. #include <gtk/gtk.h>
  2646. ],
  2647. [
  2648. #if !GTK_CHECK_VERSION(2,10,0)
  2649. Not GTK+ 2.10
  2650. #endif
  2651. ],
  2652. [
  2653. AC_DEFINE(__WXGTK210__)
  2654. AC_MSG_RESULT([yes])
  2655. ac_wxgtk210=1
  2656. ],
  2657. [
  2658. AC_MSG_RESULT([no])
  2659. ac_wxgtk210=0
  2660. ])
  2661. fi
  2662. CFLAGS="$save_CFLAGS"
  2663. LIBS="$save_LIBS"
  2664. else
  2665. if test "$wxUSE_UNICODE" = "yes"; then
  2666. AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x])
  2667. wxUSE_UNICODE=no
  2668. fi
  2669. dnl test for XIM support in libgdk
  2670. AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
  2671. dnl we need poll() in src/gtk1/app.cpp (we know that Darwin doesn't
  2672. dnl have it but we do the check for the others)
  2673. if test "$USE_DARWIN" != 1; then
  2674. AC_CHECK_FUNCS(poll)
  2675. fi
  2676. fi
  2677. TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
  2678. GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY"
  2679. TOOLKIT=GTK
  2680. GUIDIST=GTK_DIST
  2681. dnl test for external libxpm if we're configured to use it
  2682. if test "$wxUSE_GPE" = "yes"; then
  2683. AC_MSG_CHECKING(for gpewidget library)
  2684. WX_PATH_FIND_LIBRARIES(gpewidget)
  2685. if test "$ac_find_libraries" != "" ; then
  2686. WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
  2687. dnl -lgpewidget must be before all GTK libs and
  2688. dnl we guess its path from the prefix
  2689. GUI_TK_LIBRARY="-L${prefix}/lib -lgpewidget $GUI_TK_LIBRARY"
  2690. WXGPE=1
  2691. AC_MSG_RESULT([found in $ac_find_libraries])
  2692. else
  2693. AC_MSG_RESULT(not found)
  2694. fi
  2695. dnl AC_MSG_CHECKING(for gpe library)
  2696. dnl WX_PATH_FIND_LIBRARIES(gpe)
  2697. dnl if test "$ac_find_libraries" != "" ; then
  2698. dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
  2699. dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe"
  2700. dnl AC_MSG_RESULT(found in $ac_find_libraries)
  2701. dnl else
  2702. dnl AC_MSG_RESULT(not found)
  2703. dnl fi
  2704. fi
  2705. fi
  2706. if test "$wxUSE_DFB" = 1; then
  2707. PKG_PROG_PKG_CONFIG()
  2708. PKG_CHECK_MODULES(DIRECTFB,
  2709. [directfb >= 0.9.23],
  2710. [
  2711. wxUSE_UNIVERSAL="yes"
  2712. TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
  2713. GUI_TK_LIBRARY="$DIRECTFB_LIBS"
  2714. TOOLKIT=DFB
  2715. GUIDIST=DFB_DIST
  2716. ],
  2717. [
  2718. AC_MSG_ERROR([DirectFB not found.])
  2719. ]
  2720. )
  2721. fi
  2722. if test "$wxUSE_MICROWIN" = 1; then
  2723. AC_MSG_CHECKING(for MicroWindows)
  2724. if test "x$MICROWINDOWS" = x ; then
  2725. AC_MSG_RESULT(not found)
  2726. AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
  2727. else
  2728. AC_MSG_RESULT($MICROWINDOWS)
  2729. fi
  2730. if test -f $MICROWINDOWS/lib/libmwin.a; then
  2731. AC_MSG_RESULT(MicroWindows' libraries found.)
  2732. else
  2733. AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
  2734. fi
  2735. TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
  2736. GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
  2737. wxUSE_UNIVERSAL="yes"
  2738. TOOLKIT=MICROWIN
  2739. GUIDIST=MICROWIN_DIST
  2740. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
  2741. fi
  2742. dnl common part of X11 and Motif port checks
  2743. if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
  2744. dnl use standard macros to check for X headers/libs, this brings
  2745. dnl support for the standard configure options --x-includes,
  2746. dnl --x-libraries and --no-x
  2747. AC_PATH_XTRA
  2748. if test "$no_x" = "yes"; then
  2749. AC_MSG_ERROR([X11 not found, please use --x-includes and/or --x-libraries options (see config.log for details)])
  2750. fi
  2751. dnl for some reason AC_PATH_XTRA seems to add -INONE and -LNONE (and
  2752. dnl also sometimes -RNONE) to X_CFLAGS and X_LIBS respectively, filter
  2753. dnl this junk out
  2754. GUI_TK_LIBRARY=`echo $X_LIBS | sed 's/ -LNONE//' | sed 's/ -RNONE//'`
  2755. TOOLKIT_INCLUDE=`echo $X_CFLAGS | sed 's/ -INONE//'`
  2756. COMPILED_X_PROGRAM=0
  2757. fi
  2758. if test "$wxUSE_X11" = 1; then
  2759. if test "$wxUSE_NANOX" = "yes"; then
  2760. AC_MSG_CHECKING(for MicroWindows/NanoX distribution)
  2761. if test "x$MICROWIN" = x ; then
  2762. AC_MSG_RESULT(not found)
  2763. AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.])
  2764. else
  2765. AC_MSG_RESULT($MICROWIN)
  2766. AC_DEFINE(wxUSE_NANOX)
  2767. fi
  2768. fi
  2769. if test "$wxUSE_UNICODE" = "yes"; then
  2770. PKG_PROG_PKG_CONFIG()
  2771. PKG_CHECK_MODULES(PANGOXFT, pangoxft,
  2772. [
  2773. AC_DEFINE(HAVE_PANGO_XFT)
  2774. CFLAGS="$PANGOXFT_CFLAGS $CFLAGS"
  2775. CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS"
  2776. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS"
  2777. ],
  2778. [
  2779. AC_MSG_ERROR([pangoxft library not found, library cannot be compiled in Unicode mode])
  2780. ]
  2781. )
  2782. PKG_CHECK_MODULES(PANGOFT2, pangoft2,
  2783. [
  2784. CFLAGS="$PANGOFT2_CFLAGS $CFLAGS"
  2785. CXXFLAGS="$PANGOFT2_CFLAGS $CXXFLAGS"
  2786. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOFT2_LIBS"
  2787. ],
  2788. [
  2789. AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support])
  2790. wxUSE_PRINTING_ARCHITECTURE="no"
  2791. ]
  2792. )
  2793. AC_CHECK_FUNCS([pango_font_family_is_monospace])
  2794. fi
  2795. wxUSE_UNIVERSAL="yes"
  2796. if test "$wxUSE_NANOX" = "yes"; then
  2797. TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
  2798. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
  2799. GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
  2800. else
  2801. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11"
  2802. fi
  2803. TOOLKIT=X11
  2804. GUIDIST=X11_DIST
  2805. fi
  2806. if test "$wxUSE_MOTIF" = 1; then
  2807. AC_MSG_CHECKING(for Motif/Lesstif headers)
  2808. WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
  2809. if test "$ac_find_includes" != "" ; then
  2810. AC_MSG_RESULT(found in $ac_find_includes)
  2811. WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
  2812. TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
  2813. else
  2814. save_CFLAGS=$CFLAGS
  2815. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  2816. AC_TRY_COMPILE(
  2817. [
  2818. #include <Xm/Xm.h>
  2819. ],
  2820. [
  2821. int version;
  2822. version = xmUseVersion;
  2823. ],
  2824. [
  2825. AC_MSG_RESULT(found in default search path)
  2826. COMPILED_X_PROGRAM=1
  2827. ],
  2828. [
  2829. AC_MSG_RESULT(no)
  2830. AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h)
  2831. ]
  2832. )
  2833. CFLAGS=$save_CFLAGS
  2834. fi
  2835. AC_MSG_CHECKING(for Motif/Lesstif library)
  2836. WX_PATH_FIND_LIBRARIES(Xm)
  2837. if test "x$ac_find_libraries" != "x" ; then
  2838. AC_MSG_RESULT(found in $ac_find_libraries)
  2839. WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
  2840. GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
  2841. else
  2842. dnl it might happen that we found headers in one of the standard
  2843. dnl paths but the libs are elsewhere but still in default (linker)
  2844. dnl path -- try to compile a test program to check for this
  2845. save_CFLAGS=$CFLAGS
  2846. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  2847. save_LIBS="$LIBS"
  2848. LIBS="$GUI_TK_LIBRARY -lXm -lXmu -lXext -lX11"
  2849. AC_TRY_LINK(
  2850. [
  2851. #include <Xm/Xm.h>
  2852. ],
  2853. [
  2854. int version;
  2855. version = xmUseVersion;
  2856. ],
  2857. [
  2858. AC_MSG_RESULT(found in default search path)
  2859. COMPILED_X_PROGRAM=1
  2860. ],
  2861. [
  2862. AC_MSG_RESULT(no)
  2863. AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
  2864. ]
  2865. )
  2866. CFLAGS=$save_CFLAGS
  2867. LIBS="$save_LIBS"
  2868. fi
  2869. AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE])
  2870. libp_link=""
  2871. libsm_ice_link=""
  2872. libs_found=0
  2873. for libp in "" " -lXp"; do
  2874. if test "$libs_found" = 0; then
  2875. for libsm_ice in "" " -lSM -lICE"; do
  2876. if test "$libs_found" = 0; then
  2877. save_LIBS="$LIBS"
  2878. LIBS="$GUI_TK_LIBRARY -lXm ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11"
  2879. save_CFLAGS=$CFLAGS
  2880. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  2881. AC_TRY_LINK(
  2882. [
  2883. #include <Xm/Xm.h>
  2884. #include <Xm/List.h>
  2885. ],
  2886. [
  2887. XmString string = NULL;
  2888. Widget w = NULL;
  2889. int position = 0;
  2890. XmListAddItem(w, string, position);
  2891. ],
  2892. [
  2893. libp_link="$libp"
  2894. libsm_ice_link="$libsm_ice"
  2895. AC_MSG_RESULT(
  2896. [need${libp_link}${libsm_ice_link}])
  2897. libs_found=1
  2898. ], []
  2899. )
  2900. LIBS="$save_LIBS"
  2901. CFLAGS=$save_CFLAGS
  2902. fi
  2903. done
  2904. fi
  2905. done
  2906. if test "$libs_found" = 0; then
  2907. AC_MSG_RESULT([can't find the right libraries])
  2908. AC_MSG_ERROR([can't link a simple motif program])
  2909. fi
  2910. dnl this seems to be needed under IRIX and shouldn't do any harm
  2911. dnl elsewhere
  2912. AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"])
  2913. save_CFLAGS=$CFLAGS
  2914. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  2915. AC_CACHE_CHECK([for Motif 2],
  2916. wx_cv_lib_motif2,
  2917. AC_TRY_COMPILE([
  2918. #include <Xm/Xm.h>
  2919. ],
  2920. [
  2921. #if XmVersion < 2000
  2922. Not Motif 2
  2923. #endif
  2924. ],
  2925. wx_cv_lib_motif2="yes",
  2926. wx_cv_lib_motif2="no"))
  2927. if test "$wx_cv_lib_motif2" = "yes"; then
  2928. AC_DEFINE(__WXMOTIF20__,1)
  2929. else
  2930. AC_DEFINE(__WXMOTIF20__,0)
  2931. fi
  2932. AC_CACHE_CHECK([whether Motif is Lesstif],
  2933. wx_cv_lib_lesstif,
  2934. AC_TRY_COMPILE([
  2935. #include <Xm/Xm.h>
  2936. ],
  2937. [
  2938. #if !defined(LesstifVersion) || LesstifVersion <= 0
  2939. Not Lesstif
  2940. #endif
  2941. ],
  2942. wx_cv_lib_lesstif="yes",
  2943. wx_cv_lib_lesstif="no")
  2944. )
  2945. if test "$wx_cv_lib_lesstif" = "yes"; then
  2946. AC_DEFINE(__WXLESSTIF__,1)
  2947. else
  2948. AC_DEFINE(__WXLESSTIF__,0)
  2949. fi
  2950. CFLAGS=$save_CFLAGS
  2951. GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
  2952. TOOLKIT=MOTIF
  2953. GUIDIST=MOTIF_DIST
  2954. fi
  2955. dnl more tests common to X11 and Motif:
  2956. if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
  2957. dnl test for external libxpm if we're configured to use it
  2958. if test "$wxUSE_LIBXPM" = "sys"; then
  2959. AC_MSG_CHECKING(for Xpm library)
  2960. WX_PATH_FIND_LIBRARIES(Xpm)
  2961. if test "$ac_find_libraries" != "" ; then
  2962. WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
  2963. GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
  2964. AC_MSG_RESULT(found in $ac_find_libraries)
  2965. AC_CACHE_CHECK([for X11/xpm.h],
  2966. wx_cv_x11_xpm_h,
  2967. [
  2968. save_CFLAGS=$CFLAGS
  2969. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  2970. AC_TRY_COMPILE(
  2971. [
  2972. #include <X11/xpm.h>
  2973. ],
  2974. [
  2975. int version;
  2976. version = XpmLibraryVersion();
  2977. ],
  2978. wx_cv_x11_xpm_h=yes,
  2979. wx_cv_x11_xpm_h=no
  2980. )
  2981. CFLAGS=$save_CFLAGS
  2982. ]
  2983. )
  2984. if test $wx_cv_x11_xpm_h = "yes"; then
  2985. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXpm"
  2986. AC_DEFINE(wxHAVE_LIB_XPM)
  2987. else
  2988. AC_MSG_WARN([built-in less efficient XPM decoder will be used])
  2989. fi
  2990. fi
  2991. fi
  2992. dnl XShapeQueryExtension checks: first the library, then prototype
  2993. AC_CHECK_LIB([Xext], [XShapeQueryExtension],
  2994. [
  2995. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext"
  2996. wxHAVE_XEXT_LIB=1
  2997. ],
  2998. [], [$GUI_TK_LIBRARY -lX11])
  2999. if test "$wxHAVE_XEXT_LIB" = 1; then
  3000. save_CFLAGS="$CFLAGS"
  3001. CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
  3002. AC_MSG_CHECKING([for X11/extensions/shape.h])
  3003. AC_TRY_COMPILE([
  3004. #include <X11/Xlib.h>
  3005. #include <X11/extensions/shape.h>
  3006. ],
  3007. [
  3008. int dummy1, dummy2;
  3009. XShapeQueryExtension((Display*)NULL,
  3010. (int*)NULL, (int*)NULL);
  3011. ],
  3012. [
  3013. AC_DEFINE(HAVE_XSHAPE)
  3014. AC_MSG_RESULT([found])
  3015. ],
  3016. [
  3017. AC_MSG_RESULT([not found])
  3018. ])
  3019. CFLAGS="$save_CFLAGS"
  3020. fi
  3021. fi
  3022. if test "$wxUSE_OSX_CARBON" = 1; then
  3023. AC_MSG_CHECKING([for compiler syntax to enable Pascal strings])
  3024. if test "$GCC" = yes; then
  3025. AC_MSG_RESULT([gcc])
  3026. CPPFLAGS_PASCAL="-fpascal-strings"
  3027. elif test "`echo $CXX | sed -e 's@.*/@@'`" = "xlC"; then
  3028. AC_MSG_RESULT([xlc])
  3029. CPPFLAGS_PASCAL="-qmacpstr"
  3030. else
  3031. AC_MSG_RESULT([none])
  3032. fi
  3033. if test "x$wxUSE_UNIX" = "xyes"; then
  3034. CPPFLAGS="$CPPFLAGS_PASCAL -I/Developer/Headers/FlatCarbon $CPPFLAGS"
  3035. else
  3036. dnl platform.h needs TARGET_CARBON before setup.h
  3037. CPPFLAGS="$CPPFLAGS_PASCAL -DTARGET_CARBON $CPPFLAGS"
  3038. fi
  3039. TOOLKIT=OSX_CARBON
  3040. dnl we can't call this MAC_DIST or autoconf thinks its a macro
  3041. GUIDIST=OSX_CARBON_DIST
  3042. dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
  3043. dnl are different, so they need different names:
  3044. WXBASEPORT="_carbon"
  3045. dnl in addition to defining __WXOSX_CARBON__ for this toolkit we want
  3046. dnl to also define these extra symbols to make it possible to test for
  3047. dnl any Mac port (__WXMAC__ is for backwards compatibility, __WXOSX__
  3048. dnl is a new name)
  3049. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
  3050. fi
  3051. if test "$wxUSE_OSX_COCOA" = 1; then
  3052. TOOLKIT=OSX_COCOA
  3053. GUIDIST=OSX_COCOA_DIST
  3054. dnl see the comment above in wxUSE_OSX_CARBON branch
  3055. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
  3056. fi
  3057. if test "$wxUSE_OSX_IPHONE" = 1; then
  3058. TOOLKIT=OSX_IPHONE
  3059. fi
  3060. if test "$wxUSE_OLD_COCOA" = 1; then
  3061. TOOLKIT=COCOA
  3062. GUIDIST=COCOA_DIST
  3063. fi
  3064. if test "$wxUSE_PM" = 1; then
  3065. TOOLKIT=PM
  3066. GUIDIST=PM_DIST
  3067. AC_CACHE_CHECK([for type SPBCDATA],
  3068. wx_cv_spbcdata,
  3069. [
  3070. AC_TRY_COMPILE(
  3071. [
  3072. #define INCL_PM
  3073. #include <os2.h>
  3074. ],
  3075. [
  3076. SPBCDATA test;
  3077. ],
  3078. wx_cv_spbcdata=yes,
  3079. wx_cv_spbcdata=no
  3080. )
  3081. ]
  3082. )
  3083. if test $wx_cv_spbcdata = "yes"; then
  3084. AC_DEFINE(HAVE_SPBCDATA)
  3085. fi
  3086. fi
  3087. dnl the name of the directory where the files for this toolkit live
  3088. if test "$TOOLKIT" = "PM" ; then
  3089. TOOLKIT_DIR="os2"
  3090. else
  3091. TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'`
  3092. fi
  3093. if test "$wxUSE_UNIVERSAL" = "yes"; then
  3094. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
  3095. WIDGET_SET=univ
  3096. fi
  3097. dnl distribute samples/demos/utils with GUI versions
  3098. GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
  3099. DISTDIR="wx\$(TOOLKIT)"
  3100. else
  3101. USE_GUI=0
  3102. dnl this doesn't quite work right for wxBase, but the places
  3103. dnl where it is wrong aren't fatal (yet) though.
  3104. TOOLKIT_DIR="base"
  3105. dnl the sources, their dependenices and the headers
  3106. if test "$USE_WIN32" = 1 ; then
  3107. dnl yes, the toolkit for wxBase on win32 is actually MSW
  3108. dnl wxBase on unix does not need a 'TOOLKIT' defined.
  3109. TOOLKIT="MSW"
  3110. fi
  3111. dnl distribute only wxBase sources/headers
  3112. GUIDIST="BASE_DIST"
  3113. DISTDIR="wxBase"
  3114. fi
  3115. dnl ---------------------------------------------------------------------------
  3116. dnl Optional libraries included when system library is not used
  3117. dnl ---------------------------------------------------------------------------
  3118. dnl do this after test for X11 above so that we have a chance of finding Xlib.h
  3119. if test "$wxUSE_GUI" = "yes"; then
  3120. if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then
  3121. dnl defines HAVE_X11_XKBLIB_H
  3122. AC_CHECK_HEADERS([X11/Xlib.h],,, [ ])
  3123. AC_CHECK_HEADERS([X11/XKBlib.h],,,
  3124. [
  3125. #if HAVE_X11_XLIB_H
  3126. #include <X11/Xlib.h>
  3127. #endif
  3128. ])
  3129. fi
  3130. fi
  3131. dnl ---------------------------------------------------------------------------
  3132. dnl wxDisplay checks
  3133. dnl ---------------------------------------------------------------------------
  3134. USE_XINERAMA=0
  3135. if test "$wxUSE_DISPLAY" = "yes"; then
  3136. dnl Xinerama is used for wxGTK1/wxX11/wxMotif only
  3137. if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$WXGTK1" = 1; then
  3138. WX_FIND_LIB(Xinerama, XineramaQueryScreens)
  3139. if test "$ac_find_libraries" != "" ; then
  3140. if test "$ac_find_libraries" != "std" ; then
  3141. WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
  3142. if test "$ac_path_to_link" != " -L/usr/lib" ; then
  3143. LDFLAGS="$LDFLAGS $ac_path_to_link"
  3144. fi
  3145. fi
  3146. USE_XINERAMA=1
  3147. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama"
  3148. else
  3149. AC_MSG_WARN([Xinerama not found; disabling wxDisplay])
  3150. wxUSE_DISPLAY="no"
  3151. fi
  3152. elif test "$wxUSE_MSW" = 1; then
  3153. dnl DirectDraw for MSW - optionally used by WxDisplay.
  3154. AC_CHECK_HEADER([ddraw.h], [], [], [#include <windows.h>])
  3155. fi
  3156. fi
  3157. if test "$wxUSE_DISPLAY" = "yes"; then
  3158. dnl wxGTK2 needs Xxf86vm as well as Xinerama-using ports from above
  3159. if test "$USE_XINERAMA" = 1 -o "$wxUSE_GTK" = 1; then
  3160. WX_FIND_LIB(Xxf86vm, XF86VidModeQueryExtension)
  3161. if test "$ac_find_libraries" != "" ; then
  3162. AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],
  3163. [
  3164. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm"
  3165. ],
  3166. [],
  3167. [
  3168. #if HAVE_X11_XLIB_H
  3169. #include <X11/Xlib.h>
  3170. #endif
  3171. ])
  3172. fi
  3173. fi
  3174. fi
  3175. dnl ---------------------------------------------------------------------------
  3176. dnl X11 session management
  3177. dnl ---------------------------------------------------------------------------
  3178. if test "$wxUSE_DETECT_SM" = "yes"; then
  3179. if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_OLD_COCOA" != 1; then
  3180. WX_FIND_LIB(SM, SmcOpenConnection)
  3181. if test "$ac_find_libraries" != "" ; then
  3182. if test "$ac_find_libraries" != "std" ; then
  3183. WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
  3184. if test "$ac_path_to_link" != " -L/usr/lib" ; then
  3185. LDFLAGS="$LDFLAGS $ac_path_to_link"
  3186. fi
  3187. fi
  3188. GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM"
  3189. else
  3190. AC_MSG_WARN([libSM not found; disabling session management detection])
  3191. wxUSE_DETECT_SM="no"
  3192. fi
  3193. else
  3194. wxUSE_DETECT_SM="no"
  3195. fi
  3196. fi
  3197. dnl ---------------------------------------------------------------------------
  3198. dnl OpenGL libraries
  3199. dnl ---------------------------------------------------------------------------
  3200. USE_OPENGL=0
  3201. if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then
  3202. dnl look in glcanvas.h for the list of platforms supported by wxGlCanvas:
  3203. if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
  3204. OPENGL_LIBS="-framework OpenGL -framework AGL"
  3205. elif test "$wxUSE_MSW" = 1; then
  3206. OPENGL_LIBS="-lopengl32 -lglu32"
  3207. elif test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_GTK" = 1; then
  3208. dnl adjust CPPFLAGS to include GL/gl.h location if necessary
  3209. dnl (/opt/graphics/OpenGL is for HP-UX systems, bug 925307)
  3210. AC_MSG_CHECKING([for OpenGL headers])
  3211. WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /opt/graphics/OpenGL/include], GL/gl.h)
  3212. if test "$ac_find_includes" != "" ; then
  3213. AC_MSG_RESULT(found in $ac_find_includes)
  3214. WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
  3215. CPPFLAGS="$ac_path_to_include $CPPFLAGS"
  3216. else
  3217. AC_MSG_RESULT([not found])
  3218. fi
  3219. AC_CHECK_HEADER(GL/gl.h, [
  3220. AC_CHECK_HEADER(GL/glu.h, [
  3221. found_gl=0
  3222. WX_FIND_LIB(GL, glBegin, [/opt/graphics/OpenGL/lib])
  3223. if test "$ac_find_libraries" != "" ; then
  3224. if test "$ac_find_libraries" != "std" ; then
  3225. WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
  3226. if test "$ac_path_to_link" != " -L/usr/lib" ; then
  3227. LDFLAGS_GL="$ac_path_to_link"
  3228. fi
  3229. fi
  3230. dnl don't suppose that libGL and libGLU are always in the
  3231. dnl same directory -- this is not true for some common
  3232. dnl distributions
  3233. WX_FIND_LIB(GLU, gluBeginCurve, [/opt/graphics/OpenGL/lib])
  3234. if test "$ac_find_libraries" != "" ; then
  3235. if test "$ac_find_libraries" != "std" ; then
  3236. WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
  3237. if test "$ac_path_to_link" != " -L/usr/lib" -a \
  3238. "$ac_path_to_link" != "$LDFLAGS_GL" ; then
  3239. LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
  3240. fi
  3241. fi
  3242. found_gl=1
  3243. OPENGL_LIBS="-lGL -lGLU"
  3244. fi
  3245. fi
  3246. if test "$found_gl" != 1; then
  3247. WX_FIND_LIB(MesaGL, glEnable, [/opt/graphics/OpenGL/lib])
  3248. if test "$ac_find_libraries" != "" ; then
  3249. if test "$ac_find_libraries" != "std" ; then
  3250. WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
  3251. if test "$ac_path_to_link" != " -L/usr/lib" ; then
  3252. LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link"
  3253. fi
  3254. fi
  3255. OPENGL_LIBS="-lMesaGL -lMesaGLU"
  3256. fi
  3257. fi
  3258. ],, [ ])
  3259. ],
  3260. [],
  3261. [ ])
  3262. if test "x$OPENGL_LIBS" = "x"; then
  3263. if test "$wxUSE_OPENGL" = "yes"; then
  3264. AC_MSG_ERROR([OpenGL libraries not available])
  3265. else
  3266. dnl case wxUSE_OPENGL=auto
  3267. AC_MSG_WARN([OpenGL libraries not available, disabling support for OpenGL])
  3268. wxUSE_OPENGL=no
  3269. USE_OPENGL=0
  3270. fi
  3271. fi
  3272. else
  3273. AC_MSG_WARN([wxGLCanvas not implemented for this port, library will be compiled without it.])
  3274. wxUSE_OPENGL="no"
  3275. fi
  3276. if test "$wxUSE_OPENGL" = "auto"; then
  3277. dnl if the OpenGL libraries were unavailable, this would have been
  3278. dnl changed to "no" above, if it wasn't, change it to "yes" as we've
  3279. dnl verified that we can indeed use OpenGL
  3280. wxUSE_OPENGL=yes
  3281. fi
  3282. if test "$wxUSE_OPENGL" = "yes"; then
  3283. USE_OPENGL=1
  3284. AC_DEFINE(wxUSE_OPENGL)
  3285. AC_DEFINE(wxUSE_GLCANVAS)
  3286. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf"
  3287. fi
  3288. fi
  3289. dnl the symbol which allows conditional compilation for the given toolkit
  3290. if test -n "$TOOLKIT" ; then
  3291. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__"
  3292. fi
  3293. dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
  3294. if test "$wxUSE_SHARED" = "yes"; then
  3295. case "${host}" in
  3296. *-pc-msdosdjgpp )
  3297. dnl only static for now
  3298. wxUSE_SHARED=no
  3299. AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
  3300. ;;
  3301. esac
  3302. fi
  3303. if test "$wxUSE_SHARED" = "yes"; then
  3304. dnl use versioned symbols if available on the platform
  3305. WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script])
  3306. dnl test for GCC's visibility support (sets CFLAGS_VISIBILITY, which is
  3307. dnl assigned to CFLAGS and CXXFLAGS below)
  3308. if test "$wxUSE_VISIBILITY" != "no"; then
  3309. WX_VISIBILITY
  3310. fi
  3311. dnl test for Sun CC which can be used under both Solaris and Linux
  3312. if test "x$SUNCXX" = xyes; then
  3313. SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib"
  3314. WXCONFIG_RPATH="-R\$libdir"
  3315. else
  3316. case "${host}" in
  3317. *-*-linux* | *-*-gnu* )
  3318. SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
  3319. WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
  3320. ;;
  3321. *-*-solaris2* )
  3322. dnl here we know that Sun CC is not used as we tested for it above,
  3323. dnl hence we must be using gcc
  3324. dnl newer versions of gcc need -isystem to compile X headers on
  3325. dnl Solaris (which use old style C syntax)
  3326. CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS"
  3327. dnl gcc may use Sun's ld, in which case -rpath gives a confusing
  3328. dnl error message. We have to try both -Wl,-rpath and -Wl,-R:
  3329. saveLdflags="$LDFLAGS"
  3330. LDFLAGS="$saveLdflags -Wl,-rpath,/"
  3331. AC_MSG_CHECKING([if the linker accepts -rpath])
  3332. AC_TRY_LINK(
  3333. [],[],
  3334. [
  3335. AC_MSG_RESULT([yes])
  3336. SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
  3337. WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
  3338. ],[
  3339. AC_MSG_RESULT([no])
  3340. AC_MSG_CHECKING([if the linker accepts -R])
  3341. LDFLAGS="$saveLdflags -Wl,-R,/"
  3342. AC_TRY_LINK(
  3343. [],[],
  3344. [
  3345. AC_MSG_RESULT([yes])
  3346. SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib"
  3347. WXCONFIG_RPATH="-Wl,-R,\$libdir"
  3348. ],[
  3349. AC_MSG_RESULT([no])
  3350. ])
  3351. ])
  3352. LDFLAGS="$saveLdflags"
  3353. ;;
  3354. *-*-darwin* )
  3355. install_name_tool=`which ${HOST_PREFIX}install_name_tool`
  3356. if test "$install_name_tool" -a -x "$install_name_tool"; then
  3357. DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@"
  3358. cat <<EOF >change-install-names
  3359. #!/bin/sh
  3360. libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
  3361. changes=''
  3362. for dep in \${libnames} ; do
  3363. changes="\${changes} -change \${4}/\${dep} \${3}/\${dep}"
  3364. done
  3365. for i in \${libnames} ; do
  3366. ${HOST_PREFIX}install_name_tool \${changes} -id \${3}/\${i} \${1}/\${i}
  3367. done
  3368. EOF
  3369. chmod +x change-install-names
  3370. DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib"
  3371. fi
  3372. dnl the HEADER_PAD_OPTION is required by some wx samples to avoid the error:
  3373. dnl "install_name_tool: changing install names can't be redone for: the_exe_name
  3374. dnl (for architecture ppc) because larger updated load commands do not fit
  3375. dnl (the program must be relinked)"
  3376. HEADER_PAD_OPTION="-headerpad_max_install_names"
  3377. ;;
  3378. *-*-cygwin* | *-*-mingw32* )
  3379. ;;
  3380. *-*-hpux* )
  3381. SAMPLES_RPATH_FLAG="-Wl,+b,\$(wx_top_builddir)/lib"
  3382. WXCONFIG_RPATH="-Wl,+b,\$libdir"
  3383. ;;
  3384. esac
  3385. fi
  3386. dnl this one shouldn't be used for the library build so put it in a
  3387. dnl separate variable from WXCONFIG_CPPFLAGS
  3388. WXCONFIG_ONLY_CPPFLAGS="$WXCONFIG_ONLY_CPPFLAGS -DWXUSINGDLL"
  3389. if test $wxUSE_RPATH = "no"; then
  3390. SAMPLES_RPATH_FLAG=''
  3391. DYLIB_PATH_POSTLINK=''
  3392. WXCONFIG_RPATH=''
  3393. fi
  3394. SHARED=1
  3395. else
  3396. config_linkage_component="-static"
  3397. SHARED=0
  3398. fi
  3399. UNICODE=0
  3400. lib_unicode_suffix=
  3401. WX_CHARTYPE="ansi"
  3402. if test "$wxUSE_UNICODE" = "yes"; then
  3403. lib_unicode_suffix=u
  3404. WX_CHARTYPE="unicode"
  3405. UNICODE=1
  3406. fi
  3407. WX_FLAVOUR=${WX_FLAVOUR:+-$WX_FLAVOUR}
  3408. WX_LIB_FLAVOUR=`echo $WX_FLAVOUR | tr '-' '_'`
  3409. DEBUG_INFO=0
  3410. if test "$wxUSE_DEBUG_INFO" = "yes"; then
  3411. DEBUG_INFO=1
  3412. fi
  3413. WX_VERSION_TAG=`echo WX${lib_unicode_suffix}${WX_LIB_FLAVOUR}_${WX_RELEASE} | tr '[[a-z]]' '[[A-Z]]'`
  3414. TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
  3415. TOOLCHAIN_FULLNAME="${HOST_PREFIX}${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}-${WX_CHARTYPE}${config_linkage_component}-${WX_RELEASE}${WX_FLAVOUR}"
  3416. dnl library link name
  3417. dnl These just save us from exporting lib_{unicode,flavour}_suffix.
  3418. dnl If we ever need to do that, we won't need to keep these.
  3419. if test "$wxUSE_OSX_CARBON" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
  3420. WX_LIBRARY_BASENAME_NOGUI="wx_base${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
  3421. else
  3422. WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
  3423. fi
  3424. if test "${TOOLKIT_DIR}" = "os2"; then
  3425. WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
  3426. else
  3427. WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${WX_LIB_FLAVOUR}"
  3428. fi
  3429. if test "$wxUSE_OLD_COCOA" = 1; then
  3430. AC_LANG_SAVE
  3431. AC_WX_LANG_OBJECTIVEC
  3432. dnl Recent AppKit/NSEvent.h include parts of IOKit which eventually
  3433. dnl gets IOKit/graphics/IOGraphicsTypes.h included which typedefs
  3434. dnl Point but only if MacTypes.h was not included first. Of course,
  3435. dnl if MacTypes.h is included later then you're screwed when it
  3436. dnl tries to typedef Point. Defining __Point__ will cause IOGraphicsTypes.h
  3437. dnl to not typedef Point and thus fix the problem.
  3438. AC_MSG_CHECKING([if AppKit/NSEvent.h conflicts with CoreFoundation])
  3439. AC_TRY_COMPILE([#include <AppKit/NSEvent.h>
  3440. #include <CoreFoundation/CoreFoundation.h>
  3441. ],[],
  3442. [AC_MSG_RESULT([no])],
  3443. [AC_MSG_RESULT([yes])
  3444. AC_MSG_CHECKING([if defining __Point__ will fix it])
  3445. AC_TRY_COMPILE([#define __Point__ 1
  3446. #include <AppKit/NSEvent.h>
  3447. #include <CoreFoundation/CoreFoundation.h>
  3448. ],[],
  3449. [AC_MSG_RESULT([yes])
  3450. AC_DEFINE(__Point__)
  3451. ],
  3452. [AC_MSG_FAILURE([no])]
  3453. )]
  3454. )
  3455. AC_LANG_RESTORE
  3456. fi
  3457. dnl ---------------------------------------------------------------------------
  3458. dnl Checks for typedefs
  3459. dnl ---------------------------------------------------------------------------
  3460. dnl defines mode_t if not already defined
  3461. AC_TYPE_MODE_T
  3462. dnl defines off_t if not already defined
  3463. AC_TYPE_OFF_T
  3464. dnl defines pid_t if not already defined
  3465. AC_TYPE_PID_T
  3466. dnl defines size_t if not already defined
  3467. AC_TYPE_SIZE_T
  3468. dnl sets HAVE_SSIZE_T if ssize_t is defined
  3469. AC_CHECK_TYPES(ssize_t)
  3470. dnl check what exactly size_t is on this machine - this is necessary to avoid
  3471. dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h
  3472. AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
  3473. AC_CACHE_CHECK([if size_t is unsigned int],
  3474. wx_cv_size_t_is_uint,
  3475. [
  3476. dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
  3477. dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
  3478. dnl methods in a local class (i.e. class inside a function) declaration
  3479. dnl without any objections!!
  3480. dnl
  3481. dnl hence the hack below: we must have Foo at global scope!
  3482. AC_TRY_COMPILE([#include <stddef.h>],
  3483. [
  3484. return 0; }
  3485. struct Foo { void foo(size_t); void foo(unsigned int); };
  3486. int bar() {
  3487. ],
  3488. wx_cv_size_t_is_uint=no,
  3489. wx_cv_size_t_is_uint=yes
  3490. )
  3491. ]
  3492. )
  3493. if test "$wx_cv_size_t_is_uint" = "yes"; then
  3494. AC_DEFINE(wxSIZE_T_IS_UINT)
  3495. else
  3496. AC_CACHE_CHECK([if size_t is unsigned long],
  3497. wx_cv_size_t_is_ulong,
  3498. AC_TRY_COMPILE([#include <stddef.h>],
  3499. [
  3500. return 0; }
  3501. struct Foo { void foo(size_t); void foo(unsigned long); };
  3502. int bar() {
  3503. ],
  3504. wx_cv_size_t_is_ulong=no,
  3505. wx_cv_size_t_is_ulong=yes
  3506. )
  3507. )
  3508. if test "$wx_cv_size_t_is_ulong" = "yes"; then
  3509. AC_DEFINE(wxSIZE_T_IS_ULONG)
  3510. fi
  3511. fi
  3512. AC_CACHE_CHECK([if wchar_t is separate type],
  3513. wx_cv_wchar_t_is_separate_type,
  3514. AC_TRY_COMPILE([#include <wchar.h>],
  3515. [
  3516. return 0; }
  3517. struct Foo { void foo(wchar_t);
  3518. void foo(unsigned short);
  3519. void foo(unsigned int);
  3520. void foo(unsigned long); };
  3521. int bar() {
  3522. ],
  3523. wx_cv_wchar_t_is_separate_type=yes,
  3524. wx_cv_wchar_t_is_separate_type=no
  3525. )
  3526. )
  3527. if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
  3528. AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 1)
  3529. else
  3530. AC_DEFINE(wxWCHAR_T_IS_REAL_TYPE, 0)
  3531. fi
  3532. AC_LANG_POP() dnl C++
  3533. dnl ---------------------------------------------------------------------------
  3534. dnl Checks for structures
  3535. dnl ---------------------------------------------------------------------------
  3536. dnl does passwd struct has the pw_gecos field?
  3537. AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
  3538. [
  3539. AC_TRY_COMPILE([#include <pwd.h>],
  3540. [
  3541. char *p;
  3542. struct passwd *pw;
  3543. p = pw->pw_gecos;
  3544. ],
  3545. [
  3546. wx_cv_struct_pw_gecos=yes
  3547. ],
  3548. [
  3549. wx_cv_struct_pw_gecos=no
  3550. ]
  3551. )
  3552. ]
  3553. )
  3554. if test "$wx_cv_struct_pw_gecos" = "yes"; then
  3555. AC_DEFINE(HAVE_PW_GECOS)
  3556. fi
  3557. dnl ---------------------------------------------------------------------------
  3558. dnl Check for functions
  3559. dnl ---------------------------------------------------------------------------
  3560. dnl check for wcslen in all possible places
  3561. WCSLEN_FOUND=0
  3562. WCHAR_LINK=
  3563. AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1)
  3564. if test "$WCSLEN_FOUND" = 0; then
  3565. if test "$TOOLKIT" = "MSW"; then
  3566. AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1)
  3567. else
  3568. AC_CHECK_LIB(w, wcslen, [
  3569. WCHAR_LINK=" -lw"
  3570. WCSLEN_FOUND=1
  3571. ])
  3572. fi
  3573. fi
  3574. if test "$WCSLEN_FOUND" = 1; then
  3575. AC_DEFINE(HAVE_WCSLEN)
  3576. fi
  3577. dnl Notice that unlike the functions below, this one seems to be present in all
  3578. dnl support OS X versions so it's OK to test for it here.
  3579. AC_CHECK_FUNCS(wcsftime)
  3580. dnl OS X provides the wide character functions (and also strnlen(), for some
  3581. dnl reason) only starting from 10.7 so our tests would succeed if we're
  3582. dnl configuring under 10.7 or later, yet the compiled programs would fail if
  3583. dnl ran under 10.6 or earlier. To avoid this problem, define the corresponding
  3584. dnl HAVE_XXX in wx/osx/config_xcode.h instead of testing for them here.
  3585. if test "$wxUSE_MAC" != 1; then
  3586. AC_CHECK_FUNCS([strnlen wcsdup wcsnlen wcscasecmp wcsncasecmp])
  3587. fi
  3588. dnl On HP-UX aCC need this define to find mbstrtowcs() &c
  3589. dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict
  3590. dnl with g++'s in <cwchar> (unless -D_INCLUDE__STDC_A1_SOURCE is in the
  3591. dnl flags when g++ is configured, it will declare its own).
  3592. if test "$USE_HPUX" = 1 -a "$GCC" != "yes"; then
  3593. CPPFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CPPFLAGS"
  3594. fi
  3595. dnl Try to use wcsrtombs instead of wcstombs which is buggy in old GNU
  3596. dnl libc versions if possible. AC_CHECK_FUNCS only checks it's in the
  3597. dnl library, not the header, so do a header check for mbstate_t first.
  3598. AC_CHECK_TYPES([mbstate_t],
  3599. [AC_CHECK_FUNCS(wcsrtombs)],
  3600. [],
  3601. [#include <wchar.h>])
  3602. dnl check for vsnprintf() -- a safe version of vsprintf())
  3603. dnl
  3604. dnl the trouble here is that on some systems (e.g. HP-UX 10) this function is
  3605. dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which,
  3606. dnl stupidly, provides a dummy function declaration inside its extension)
  3607. dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails
  3608. dnl
  3609. dnl so we first check if the function is in the library
  3610. dnl
  3611. dnl FIXME: replace this mess with WX_CHECK_FUNCS()
  3612. AC_CHECK_FUNCS(snprintf vsnprintf vsscanf)
  3613. AC_LANG_PUSH(C++)
  3614. if test "$ac_cv_func_vsnprintf" = "yes"; then
  3615. dnl yes it is -- now check if it is in the headers
  3616. AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl,
  3617. [
  3618. dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as
  3619. dnl taking "char *" and not "const char *" so test for this too
  3620. AC_TRY_COMPILE(
  3621. [
  3622. #include <stdio.h>
  3623. #include <stdarg.h>
  3624. ],
  3625. [
  3626. char *buf;
  3627. va_list ap;
  3628. vsnprintf(buf, 10u, "%s", ap);
  3629. ],
  3630. wx_cv_func_vsnprintf_decl=yes,
  3631. wx_cv_func_vsnprintf_decl=no
  3632. )
  3633. ]
  3634. )
  3635. if test "$wx_cv_func_vsnprintf_decl" = "yes"; then
  3636. AC_DEFINE(HAVE_VSNPRINTF_DECL)
  3637. dnl we know there is a vsnprintf declaration, but some old headers
  3638. dnl may have one taking a "char *" format instead of "const char *"
  3639. AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
  3640. [
  3641. AC_TRY_COMPILE(
  3642. [
  3643. #include <stdio.h>
  3644. #include <stdarg.h>
  3645. #ifdef __MSL__
  3646. #if __MSL__ >= 0x6000
  3647. namespace std {}
  3648. using namespace std;
  3649. #endif
  3650. #endif
  3651. ],
  3652. [
  3653. char *buf;
  3654. va_list ap;
  3655. const char *fmt = "%s";
  3656. vsnprintf(buf, 10u, fmt, ap);
  3657. ],
  3658. wx_cv_func_broken_vsnprintf_decl=no,
  3659. wx_cv_func_broken_vsnprintf_decl=yes
  3660. )
  3661. ]
  3662. )
  3663. if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
  3664. AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
  3665. fi
  3666. fi
  3667. fi
  3668. dnl the same as above but for snprintf() now: it's not present in at least AIX
  3669. dnl 4.2 headers
  3670. if test "$ac_cv_func_snprintf" = "yes"; then
  3671. AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl,
  3672. [
  3673. AC_TRY_COMPILE(
  3674. [
  3675. #include <stdio.h>
  3676. #include <stdarg.h>
  3677. #ifdef __MSL__
  3678. #if __MSL__ >= 0x6000
  3679. namespace std {}
  3680. using namespace std;
  3681. #endif
  3682. #endif
  3683. ],
  3684. [
  3685. char *buf;
  3686. snprintf(buf, 10u, "%s", "wx");
  3687. ],
  3688. wx_cv_func_snprintf_decl=yes,
  3689. wx_cv_func_snprintf_decl=no
  3690. )
  3691. ]
  3692. )
  3693. if test "$wx_cv_func_snprintf_decl" = "yes"; then
  3694. AC_DEFINE(HAVE_SNPRINTF_DECL)
  3695. fi
  3696. if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
  3697. dnl check if snprintf() has support for positional arguments
  3698. dnl NB: if snprintf() has positional support we can safely suppose that also
  3699. dnl other *printf() functions support them as they all belong to the same
  3700. dnl family and they all fallback to the same implementation
  3701. AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
  3702. [
  3703. AC_TRY_RUN(
  3704. [
  3705. #include <stdio.h>
  3706. int main (void)
  3707. {
  3708. char buffer[128];
  3709. snprintf (buffer, 128, "%2$d %3$d %1$d", 1, 2, 3);
  3710. if (strcmp ("2 3 1", buffer) == 0)
  3711. exit (0);
  3712. exit (1);
  3713. }
  3714. ],
  3715. wx_cv_func_snprintf_pos_params=no,
  3716. wx_cv_func_snprintf_pos_params=yes,
  3717. dnl be pessimistic when cross-compiling
  3718. [
  3719. AC_MSG_WARN([Assuming Unix98 printf() is not available,
  3720. define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.])
  3721. wx_cv_func_snprintf_pos_params=no
  3722. ]
  3723. )
  3724. ]
  3725. )
  3726. if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
  3727. AC_DEFINE(HAVE_UNIX98_PRINTF)
  3728. fi
  3729. fi
  3730. fi
  3731. dnl the same as above but for vsscanf() now: it's not present in at least
  3732. dnl Solaris 9 headers for gcc-3.4 (due to fixinclude's processing of stdio.h)
  3733. if test "$ac_cv_func_vsscanf" = "yes"; then
  3734. AC_CACHE_CHECK([for vsscanf declaration], wx_cv_func_vsscanf_decl,
  3735. [
  3736. AC_TRY_COMPILE(
  3737. [
  3738. #include <stdio.h>
  3739. #include <stdarg.h>
  3740. #ifdef __MSL__
  3741. #if __MSL__ >= 0x6000
  3742. namespace std {}
  3743. using namespace std;
  3744. #endif
  3745. #endif
  3746. ],
  3747. [
  3748. char *buf;
  3749. va_list args;
  3750. vsscanf(buf, "%s", args);
  3751. ],
  3752. wx_cv_func_vsscanf_decl=yes,
  3753. wx_cv_func_vsscanf_decl=no
  3754. )
  3755. ]
  3756. )
  3757. if test "$wx_cv_func_vsscanf_decl" = "yes"; then
  3758. AC_DEFINE(HAVE_VSSCANF_DECL)
  3759. dnl we know there is a vsscanf() declaration, but it can be broken by
  3760. dnl declaring vsscanf() as taking a non-const first argument (this
  3761. dnl happens at least under HP-UX 11.31, see #15638).
  3762. AC_CACHE_CHECK([if vsscanf() declaration is broken], wx_cv_func_broken_vsscanf_decl,
  3763. [
  3764. AC_TRY_COMPILE(
  3765. [
  3766. #include <stdio.h>
  3767. #include <stdarg.h>
  3768. #ifdef __MSL__
  3769. #if __MSL__ >= 0x6000
  3770. namespace std {}
  3771. using namespace std;
  3772. #endif
  3773. #endif
  3774. ],
  3775. [
  3776. const char *buf;
  3777. va_list args;
  3778. vsscanf(buf, "%s", args);
  3779. ],
  3780. wx_cv_func_broken_vsscanf_decl=no,
  3781. wx_cv_func_broken_vsscanf_decl=yes
  3782. )
  3783. ]
  3784. )
  3785. if test "$wx_cv_func_broken_vsscanf_decl" = "yes"; then
  3786. AC_DEFINE(HAVE_BROKEN_VSSCANF_DECL)
  3787. fi
  3788. fi
  3789. fi
  3790. AC_LANG_POP()
  3791. dnl also look if we have wide char IO functions, notice that [f]putws are
  3792. dnl declared in special widec.h under Solaris
  3793. wchar_headers="#include <stdio.h>
  3794. #include <wchar.h>"
  3795. case "${host}" in
  3796. *-*-solaris2* )
  3797. AC_CHECK_HEADERS(widec.h,,, [AC_INCLUDES_DEFAULT()])
  3798. if test "$ac_cv_header_widec_h" = "yes"; then
  3799. wchar_headers="$wchar_headers
  3800. #include <widec.h>"
  3801. fi
  3802. esac
  3803. WX_CHECK_FUNCS(putws fputws wprintf vswprintf vswscanf,,,
  3804. [$wchar_headers])
  3805. dnl MinGW has a vswprintf with a different prototype, and
  3806. dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
  3807. dnl finds it even if it is not declared in some versions...
  3808. AC_MSG_CHECKING([for _vsnwprintf])
  3809. AC_TRY_COMPILE([#include <wchar.h>],
  3810. [&_vsnwprintf;],
  3811. [AC_MSG_RESULT([yes])
  3812. AC_DEFINE(HAVE__VSNWPRINTF)],
  3813. [AC_MSG_RESULT([no])]);
  3814. if test "$wxUSE_FILE" = "yes"; then
  3815. WX_CHECK_FUNCS(fsync)
  3816. fi
  3817. dnl at least under IRIX with mipsPro the C99 round() function is available when
  3818. dnl building using the C compiler but not when using C++ one
  3819. AC_LANG_PUSH(C++)
  3820. WX_CHECK_FUNCS(round,,,[#include <math.h>])
  3821. AC_LANG_POP()
  3822. dnl the following tests are for Unix(like) systems only
  3823. if test "$TOOLKIT" != "MSW"; then
  3824. dnl check for available version of iconv()
  3825. if test "$wxUSE_LIBICONV" != "no" ; then
  3826. AM_ICONV
  3827. LIBS="$LIBICONV $LIBS"
  3828. fi
  3829. dnl check for POSIX signals if we need them
  3830. if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
  3831. AC_CHECK_FUNCS(sigaction)
  3832. if test "$ac_cv_func_sigaction" = "no"; then
  3833. AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
  3834. wxUSE_ON_FATAL_EXCEPTION=no
  3835. fi
  3836. if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
  3837. AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
  3838. [
  3839. dnl C compiler happily compiles the code even if there is type mismatch
  3840. AC_LANG_PUSH(C++)
  3841. AC_TRY_COMPILE([#include <signal.h>],
  3842. [
  3843. extern void testSigHandler(int);
  3844. struct sigaction sa;
  3845. sa.sa_handler = testSigHandler;
  3846. ], [
  3847. wx_cv_type_sa_handler=int
  3848. ], [
  3849. wx_cv_type_sa_handler=void
  3850. ])
  3851. AC_LANG_POP()
  3852. ])
  3853. AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
  3854. fi
  3855. fi
  3856. dnl backtrace() and backtrace_symbols() for wxStackWalker
  3857. if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
  3858. AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace,
  3859. [
  3860. AC_SEARCH_LIBS(backtrace, execinfo,
  3861. [
  3862. AC_LANG_PUSH(C++)
  3863. AC_TRY_LINK([#include <execinfo.h>],
  3864. [
  3865. void *trace[1];
  3866. char **messages;
  3867. backtrace(trace, 1);
  3868. messages = backtrace_symbols(trace, 1);
  3869. ],
  3870. wx_cv_func_backtrace=yes,
  3871. wx_cv_func_backtrace=no
  3872. )
  3873. AC_LANG_POP()
  3874. ],
  3875. wx_cv_func_backtrace=no
  3876. )
  3877. ]
  3878. )
  3879. if test "$wx_cv_func_backtrace" = "no"; then
  3880. AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available])
  3881. wxUSE_STACKWALKER=no
  3882. else
  3883. if test "$ac_cv_header_cxxabi_h" = "yes"; then
  3884. AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
  3885. [
  3886. AC_LANG_PUSH(C++)
  3887. AC_TRY_LINK([#include <cxxabi.h>],
  3888. [
  3889. int rc;
  3890. __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
  3891. ],
  3892. wx_cv_func_cxa_demangle=yes,
  3893. wx_cv_func_cxa_demangle=no
  3894. )
  3895. AC_LANG_POP()
  3896. ]
  3897. )
  3898. else
  3899. wx_cv_func_cxa_demangle=no
  3900. fi
  3901. if test "$wx_cv_func_cxa_demangle" = "yes"; then
  3902. AC_DEFINE(HAVE_CXA_DEMANGLE)
  3903. fi
  3904. fi
  3905. fi
  3906. if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != 1 -a "$USE_UNIX" != 1; then
  3907. AC_MSG_WARN([wxStackWalker is only available on Win32 and UNIX... disabled])
  3908. wxUSE_STACKWALKER=no
  3909. fi
  3910. dnl check for the function for temp files creation
  3911. AC_CHECK_FUNCS(mkstemp mktemp, break)
  3912. dnl get the library function to use for wxGetDiskSpace(): it is statfs() under
  3913. dnl Linux and *BSD and statvfs() under Solaris
  3914. AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
  3915. AC_TRY_COMPILE(
  3916. [
  3917. #if defined(__BSD__)
  3918. #include <sys/param.h>
  3919. #include <sys/mount.h>
  3920. #else
  3921. #include <sys/vfs.h>
  3922. #endif
  3923. ],
  3924. [
  3925. long l;
  3926. struct statfs fs;
  3927. statfs("/", &fs);
  3928. l = fs.f_bsize;
  3929. l += fs.f_blocks;
  3930. l += fs.f_bavail;
  3931. ],
  3932. wx_cv_func_statfs=yes,
  3933. wx_cv_func_statfs=no
  3934. )
  3935. )
  3936. if test "$wx_cv_func_statfs" = "yes"; then
  3937. dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
  3938. AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
  3939. AC_LANG_PUSH(C++)
  3940. AC_TRY_COMPILE(
  3941. [
  3942. #if defined(__BSD__)
  3943. #include <sys/param.h>
  3944. #include <sys/mount.h>
  3945. #else
  3946. #include <sys/vfs.h>
  3947. #endif
  3948. ],
  3949. [
  3950. struct statfs fs;
  3951. statfs("", &fs);
  3952. ],
  3953. wx_cv_func_statfs_decl=yes,
  3954. wx_cv_func_statfs_decl=no
  3955. )
  3956. AC_LANG_POP()
  3957. )
  3958. if test "$wx_cv_func_statfs_decl" = "yes"; then
  3959. AC_DEFINE(HAVE_STATFS_DECL)
  3960. fi
  3961. wx_cv_type_statvfs_t="struct statfs"
  3962. AC_DEFINE(HAVE_STATFS)
  3963. else
  3964. AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
  3965. AC_TRY_COMPILE(
  3966. [
  3967. #include <stddef.h>
  3968. #include <sys/statvfs.h>
  3969. ],
  3970. [
  3971. statvfs("/", NULL);
  3972. ],
  3973. wx_cv_func_statvfs=yes,
  3974. wx_cv_func_statvfs=no
  3975. )
  3976. )
  3977. if test "$wx_cv_func_statvfs" = "yes"; then
  3978. dnl we also have to check whether we should use statvfs_t (works under
  3979. dnl Solaris 8, doesn't work under Solaris 7) or "struct statvfs" (vice
  3980. dnl versa) as the argument for statvfs in 64 bit off_t mode (in 32 bit
  3981. dnl mode both work fine)
  3982. dnl
  3983. dnl for this check C++ compiler has to be used as passing incompatible
  3984. dnl pointers is just a warning and not an error in C
  3985. AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t,
  3986. AC_LANG_PUSH(C++)
  3987. AC_TRY_COMPILE(
  3988. [
  3989. #include <sys/statvfs.h>
  3990. ],
  3991. [
  3992. long l;
  3993. statvfs_t fs;
  3994. statvfs("/", &fs);
  3995. l = fs.f_bsize;
  3996. l += fs.f_blocks;
  3997. l += fs.f_bavail;
  3998. ],
  3999. wx_cv_type_statvfs_t=statvfs_t,
  4000. [
  4001. AC_TRY_COMPILE(
  4002. [
  4003. #include <sys/statvfs.h>
  4004. ],
  4005. [
  4006. long l;
  4007. struct statvfs fs;
  4008. statvfs("/", &fs);
  4009. l = fs.f_bsize;
  4010. l += fs.f_blocks;
  4011. l += fs.f_bavail;
  4012. ],
  4013. wx_cv_type_statvfs_t="struct statvfs",
  4014. wx_cv_type_statvfs_t="unknown"
  4015. )
  4016. ]
  4017. )
  4018. AC_LANG_POP()
  4019. )
  4020. if test "$wx_cv_type_statvfs_t" != "unknown"; then
  4021. AC_DEFINE(HAVE_STATVFS)
  4022. fi
  4023. else
  4024. dnl set it for the test below
  4025. wx_cv_type_statvfs_t="unknown"
  4026. fi
  4027. fi
  4028. if test "$wx_cv_type_statvfs_t" != "unknown"; then
  4029. AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t)
  4030. else
  4031. AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
  4032. fi
  4033. dnl check for fcntl() or at least flock() needed by Unix implementation of
  4034. dnl wxSingleInstanceChecker
  4035. if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
  4036. AC_CHECK_FUNCS(fcntl flock, break)
  4037. if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then
  4038. AC_MSG_WARN(wxSingleInstanceChecker not available)
  4039. wxUSE_SNGLINST_CHECKER=no
  4040. fi
  4041. fi
  4042. dnl look for a function to modify the environment
  4043. AC_CHECK_FUNCS(setenv putenv, break)
  4044. if test "$ac_cv_func_setenv" = "yes"; then
  4045. AC_CHECK_FUNCS(unsetenv)
  4046. fi
  4047. HAVE_SOME_SLEEP_FUNC=0
  4048. if test "$USE_BEOS" = 1; then
  4049. dnl BeOS has its own (wonder where did they get it from) sleep() function
  4050. dnl in unistd.h
  4051. AC_DEFINE(HAVE_SLEEP)
  4052. HAVE_SOME_SLEEP_FUNC=1
  4053. fi
  4054. if test "$USE_DARWIN" = 1; then
  4055. dnl Mac OS X/Darwin has both nanosleep and usleep
  4056. dnl but only usleep is defined in unistd.h
  4057. AC_DEFINE(HAVE_USLEEP)
  4058. HAVE_SOME_SLEEP_FUNC=1
  4059. fi
  4060. if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
  4061. dnl try nanosleep() in libc and libposix4, if this fails - usleep()
  4062. POSIX4_LINK=
  4063. AC_CHECK_FUNCS(nanosleep,
  4064. AC_DEFINE(HAVE_NANOSLEEP),
  4065. [
  4066. AC_CHECK_LIB(posix4, nanosleep,
  4067. [
  4068. AC_DEFINE(HAVE_NANOSLEEP)
  4069. POSIX4_LINK=" -lposix4"
  4070. ],
  4071. [
  4072. WX_CHECK_FUNCS(usleep,,
  4073. AC_MSG_WARN([wxSleep() function will not work])
  4074. )
  4075. ]
  4076. )
  4077. ]
  4078. )
  4079. fi
  4080. dnl check for uname (POSIX) and gethostname (BSD)
  4081. WX_CHECK_FUNCS(uname,,,[#include <sys/utsname.h>])
  4082. if test "$wx_cv_func_uname" != yes; then
  4083. WX_CHECK_FUNCS(gethostname)
  4084. fi
  4085. WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
  4086. dnl check for inet_addr and inet_aton (these may live either in libc, or in
  4087. dnl libnsl or libresolv or libsocket)
  4088. INET_LINK=
  4089. AC_CHECK_FUNCS(inet_addr,
  4090. AC_DEFINE(HAVE_INET_ADDR),
  4091. [
  4092. AC_CHECK_LIB(nsl, inet_addr,
  4093. INET_LINK="nsl",
  4094. [
  4095. AC_CHECK_LIB(resolv, inet_addr,
  4096. INET_LINK="resolv",
  4097. [
  4098. AC_CHECK_LIB(socket, inet_addr,
  4099. INET_LINK="socket"
  4100. )
  4101. ]
  4102. )
  4103. ]
  4104. )
  4105. ]
  4106. )
  4107. AC_CHECK_FUNCS(inet_aton,
  4108. AC_DEFINE(HAVE_INET_ATON),
  4109. [
  4110. dnl only check it in the same lib
  4111. AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
  4112. ])
  4113. if test "x$INET_LINK" != "x"; then
  4114. AC_DEFINE(HAVE_INET_ADDR)
  4115. INET_LINK=" -l$INET_LINK"
  4116. fi
  4117. WX_CHECK_FUNCS(fdopen)
  4118. if test "$wxUSE_TARSTREAM" = "yes"; then
  4119. WX_CHECK_FUNCS(sysconf)
  4120. WX_CHECK_FUNCS(getpwuid_r, [], [],
  4121. [
  4122. #define _REENTRANT
  4123. #include <pwd.h>
  4124. ],
  4125. [[
  4126. struct passwd pw, *ppw;
  4127. char buf[1024];
  4128. getpwuid_r(0, &pw, buf, sizeof(buf), &ppw)
  4129. ]])
  4130. WX_CHECK_FUNCS(getgrgid_r, [], [],
  4131. [
  4132. #define _REENTRANT
  4133. #include <grp.h>
  4134. ],
  4135. [[
  4136. struct group grp, *pgrp;
  4137. char buf[1024];
  4138. getgrgid_r(0, &grp, buf, sizeof(buf), &pgrp)
  4139. ]])
  4140. fi
  4141. fi
  4142. dnl ===========================================================================
  4143. dnl Now we have all the info we need - use it!
  4144. dnl ===========================================================================
  4145. dnl flush the cache
  4146. AC_CACHE_SAVE
  4147. dnl ---------------------------------------------------------------------------
  4148. dnl thread support for Unix (for Win32 and OS/2 see past
  4149. dnl the next matching "else")
  4150. dnl ---------------------------------------------------------------------------
  4151. dnl under MSW (except mingw32) we always have thread support
  4152. if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
  4153. dnl the code below:
  4154. dnl
  4155. dnl defines THREADS_LINK and THREADS_CFLAGS which are the options
  4156. dnl necessary to build the MT programs for the linker and compiler
  4157. dnl respectively
  4158. dnl
  4159. dnl sets wxUSE_THREADS=1 if thread support is activated
  4160. THREADS_LINK=
  4161. THREADS_CFLAGS=
  4162. if test "$wxUSE_THREADS" = "yes" ; then
  4163. if test "$USE_BEOS" = 1; then
  4164. AC_MSG_WARN([BeOS threads are not yet supported... disabled])
  4165. wxUSE_THREADS="no"
  4166. fi
  4167. fi
  4168. if test "$wxUSE_THREADS" = "yes" ; then
  4169. dnl find if POSIX threads are available
  4170. dnl
  4171. dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
  4172. dnl archive from http://ac-archive.sourceforge.net/
  4173. dnl
  4174. dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
  4175. dnl Forero Cuervo <bachue@bachue.com> for the original code
  4176. dnl TODO: cache the result
  4177. dnl define the list of the thread options to try in the loop below
  4178. dnl with the convention that anything starting with '-' is a cpp flag
  4179. dnl while anything else is a library (i.e. there is an implicit "-l")
  4180. THREAD_OPTS="-pthread"
  4181. if test "x$SUNCXX" = xyes; then
  4182. THREAD_OPTS="-mt lthread $THREAD_OPTS"
  4183. fi
  4184. case "${host}" in
  4185. *-*-solaris2* | *-*-sunos4* )
  4186. if test "x$GCC" = "xyes"; then
  4187. dnl Solaris/gcc combination use this one for some reason
  4188. THREAD_OPTS="-pthreads $THREAD_OPTS"
  4189. fi
  4190. ;;
  4191. *-*-freebsd*)
  4192. dnl look, in order, for the kernel threads, then Linux threads
  4193. dnl and finally the userland threads
  4194. THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
  4195. ;;
  4196. *-*-darwin* | *-*-cygwin* )
  4197. dnl Darwin / Mac OS X just uses -lpthread tested below
  4198. dnl and so does Cygwin
  4199. THREAD_OPTS=""
  4200. ;;
  4201. *-*-aix*)
  4202. dnl AIX calls the library libpthreads - thanks IBM!
  4203. THREAD_OPTS="pthreads"
  4204. ;;
  4205. *-hp-hpux* )
  4206. if test "x$GCC" = "xyes"; then
  4207. dnl g++ versions before 3.3.2 don't support -pthread.
  4208. $CXX -dumpspecs | grep 'pthread:' >/dev/null ||
  4209. THREAD_OPTS=""
  4210. else
  4211. dnl HP-UX aCC (tested with version B3910B A.06.05 [Jul 25
  4212. dnl 2005]) supports -mt
  4213. THREAD_OPTS="-mt"
  4214. fi
  4215. ;;
  4216. *-*-irix* )
  4217. dnl gcc under IRIX doesn't seem to like -pthread, but it
  4218. dnl doesn't give an error for it neither, just a warning
  4219. dnl message -- but this is still very annoying
  4220. if test "x$GCC" = "xyes"; then
  4221. THREAD_OPTS=""
  4222. fi
  4223. ;;
  4224. *-*-qnx*)
  4225. dnl under QNX thread functions are in libc so we don't need any
  4226. dnl special options to link with them
  4227. THREAD_OPTS=""
  4228. ;;
  4229. *-*-*UnixWare*)
  4230. dnl flying by man pages here: Caldera online docs use this
  4231. if test "x$GCC" != "xyes"; then
  4232. THREAD_OPTS="-Ethread"
  4233. fi
  4234. ;;
  4235. esac
  4236. case "${host}" in
  4237. *-*-qnx*)
  4238. dnl -lpthread works, i.e. AC_TRY_LINK() would pass, but results
  4239. dnl in warnings and is not needed under QNX so try without it
  4240. dnl first
  4241. THREAD_OPTS="none pthread"
  4242. ;;
  4243. *)
  4244. dnl simply linking with libpthread should make the test below
  4245. dnl work but it's far from certain that the threaded programs
  4246. dnl compiled without any special switches actually work, so try
  4247. dnl it after all the others
  4248. THREAD_OPTS="$THREAD_OPTS pthread none"
  4249. ;;
  4250. esac
  4251. dnl now test for all possibilities
  4252. THREADS_OK=no
  4253. for flag in $THREAD_OPTS; do
  4254. case $flag in
  4255. none)
  4256. AC_MSG_CHECKING([whether pthreads work without any flags])
  4257. ;;
  4258. -*)
  4259. AC_MSG_CHECKING([whether pthreads work with $flag])
  4260. THREADS_CFLAGS="$flag"
  4261. ;;
  4262. *)
  4263. AC_MSG_CHECKING([for the pthreads library -l$flag])
  4264. THREADS_LINK="-l$flag"
  4265. ;;
  4266. esac
  4267. save_LIBS="$LIBS"
  4268. save_CFLAGS="$CFLAGS"
  4269. LIBS="$THREADS_LINK $LIBS"
  4270. CFLAGS="$THREADS_CFLAGS $CFLAGS"
  4271. AC_TRY_LINK([#include <pthread.h>],
  4272. [pthread_create(0,0,0,0);],
  4273. THREADS_OK=yes)
  4274. LIBS="$save_LIBS"
  4275. CFLAGS="$save_CFLAGS"
  4276. AC_MSG_RESULT($THREADS_OK)
  4277. if test "x$THREADS_OK" = "xyes"; then
  4278. break;
  4279. fi
  4280. THREADS_LINK=""
  4281. THREADS_CFLAGS=""
  4282. done
  4283. if test "x$THREADS_OK" != "xyes"; then
  4284. wxUSE_THREADS=no
  4285. AC_MSG_WARN([No thread support on this system... disabled])
  4286. else
  4287. dnl yes, these special compiler flags should be used with the
  4288. dnl linker as well
  4289. dnl
  4290. dnl NB: add them to LDFLAGS immediately because we need them to be
  4291. dnl used for the subsequent tests some of which can fail without
  4292. dnl MT support, hence the reason for the duplication below:
  4293. dnl adding them just to WXCONFIG_LDFLAGS and adding the entire
  4294. dnl contents of the latter to LDFLAGS in the end is not enough.
  4295. LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
  4296. WXCONFIG_LDFLAGS="$THREADS_CFLAGS $WXCONFIG_LDFLAGS"
  4297. LIBS="$THREADS_LINK $LIBS"
  4298. AC_MSG_CHECKING([if more special flags are required for pthreads])
  4299. flag=no
  4300. case "${host}" in
  4301. *-aix*)
  4302. dnl again quoting from
  4303. dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html:
  4304. dnl
  4305. dnl When compiling and linking with -pthread, the library
  4306. dnl search path should include -L/usr/lib/threads at the
  4307. dnl beginning of the path.
  4308. LDFLAGS="-L/usr/lib/threads $LDFLAGS"
  4309. WXCONFIG_LDFLAGS="-L/usr/lib/threads $WXCONFIG_LDFLAGS"
  4310. flag="-D_THREAD_SAFE"
  4311. ;;
  4312. *-freebsd*)
  4313. flag="-D_THREAD_SAFE"
  4314. ;;
  4315. *-hp-hpux* )
  4316. flag="-D_REENTRANT"
  4317. if test "x$GCC" != "xyes"; then
  4318. dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm
  4319. flag="$flag -D_RWSTD_MULTI_THREAD"
  4320. fi
  4321. ;;
  4322. *solaris* | alpha*-osf*)
  4323. flag="-D_REENTRANT"
  4324. ;;
  4325. esac
  4326. AC_MSG_RESULT(${flag})
  4327. if test "x$flag" != xno; then
  4328. THREADS_CFLAGS="$THREADS_CFLAGS $flag"
  4329. fi
  4330. dnl don't add these options to CPPFLAGS as cpp might not know them
  4331. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS"
  4332. fi
  4333. fi
  4334. dnl do other tests only if we are using threads
  4335. if test "$wxUSE_THREADS" = "yes" ; then
  4336. AC_CHECK_FUNCS(pthread_setconcurrency,
  4337. AC_DEFINE(HAVE_PTHREAD_SET_CONCURRENCY),
  4338. [
  4339. AC_CHECK_FUNCS(thr_setconcurrency,
  4340. AC_DEFINE(HAVE_THR_SETCONCURRENCY),
  4341. AC_MSG_WARN(Setting thread concurrency will not work properly))
  4342. ])
  4343. dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so
  4344. dnl wouldn't be found by it
  4345. AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup,
  4346. [
  4347. dnl C compiler may treat pthread_cleanup_push() as an undeclared
  4348. dnl function and not give a warning even if it's unavailable, so use
  4349. dnl the C++ one for this test
  4350. AC_LANG_PUSH(C++)
  4351. AC_TRY_COMPILE([#include <pthread.h>
  4352. void ThreadCleanupFunc(void *p);
  4353. ],
  4354. [
  4355. void *p;
  4356. pthread_cleanup_push(ThreadCleanupFunc, p);
  4357. pthread_cleanup_pop(0);
  4358. ], [
  4359. wx_cv_func_pthread_cleanup=yes
  4360. ], [
  4361. wx_cv_func_pthread_cleanup=no
  4362. ]
  4363. )
  4364. AC_LANG_POP()
  4365. ])
  4366. if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
  4367. AC_DEFINE(wxHAVE_PTHREAD_CLEANUP)
  4368. fi
  4369. AC_CHECK_HEADERS(sched.h,,, [AC_INCLUDES_DEFAULT()])
  4370. if test "$ac_cv_header_sched_h" = "yes"; then
  4371. AC_CHECK_FUNC(sched_yield,
  4372. AC_DEFINE(HAVE_SCHED_YIELD),
  4373. [
  4374. AC_CHECK_LIB(posix4,
  4375. sched_yield,
  4376. [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
  4377. AC_MSG_WARN(wxThread::Yield will not work properly)
  4378. )
  4379. ]
  4380. )
  4381. fi
  4382. dnl to be able to set the thread priority, we need to have all of the
  4383. dnl following functions:
  4384. dnl 1. pthread_attr_getschedpolicy
  4385. dnl 2. sched_get_priority_min and sched_get_priority_max
  4386. dnl (this one can be in either libpthread or libposix4 (under Solaris))
  4387. dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
  4388. HAVE_PRIOR_FUNCS=0
  4389. AC_CHECK_FUNC(pthread_attr_getschedpolicy,
  4390. [AC_CHECK_FUNC(pthread_attr_setschedparam,
  4391. [AC_CHECK_FUNC(sched_get_priority_max,
  4392. HAVE_PRIOR_FUNCS=1,
  4393. [AC_CHECK_LIB([posix4], sched_get_priority_max,
  4394. [
  4395. HAVE_PRIOR_FUNCS=1
  4396. POSIX4_LINK=" -lposix4"
  4397. ],
  4398. )]
  4399. )]
  4400. )]
  4401. )
  4402. if test "$HAVE_PRIOR_FUNCS" = 1; then
  4403. AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
  4404. else
  4405. AC_MSG_WARN(Setting thread priority will not work)
  4406. fi
  4407. AC_CHECK_FUNC(pthread_cancel,
  4408. AC_DEFINE(HAVE_PTHREAD_CANCEL),
  4409. AC_MSG_WARN([wxThread::Kill() will not work properly]))
  4410. AC_CHECK_FUNC(pthread_mutex_timedlock,
  4411. AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK),
  4412. AC_MSG_WARN([wxMutex::LockTimeout() will not work]))
  4413. AC_CHECK_FUNC(pthread_attr_setstacksize,
  4414. AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE))
  4415. dnl mutexattr_t initialization is done in quite different ways on different
  4416. dnl platforms, so check for a few things:
  4417. dnl
  4418. dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
  4419. dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
  4420. dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
  4421. dnl defined, we do it by directly assigned
  4422. dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
  4423. AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
  4424. [
  4425. AC_TRY_COMPILE([#include <pthread.h>],
  4426. [
  4427. pthread_mutexattr_t attr;
  4428. pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  4429. ],
  4430. wx_cv_type_pthread_mutexattr_t=yes,
  4431. wx_cv_type_pthread_mutexattr_t=no
  4432. )
  4433. ])
  4434. if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
  4435. AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
  4436. dnl check if we already have the declaration we need, it is not
  4437. dnl present in some systems' headers
  4438. AC_CACHE_CHECK([for pthread_mutexattr_settype declaration],
  4439. wx_cv_func_pthread_mutexattr_settype_decl, [
  4440. AC_TRY_COMPILE([#include <pthread.h>],
  4441. [
  4442. pthread_mutexattr_t attr;
  4443. pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  4444. ],
  4445. wx_cv_func_pthread_mutexattr_settype_decl=yes,
  4446. wx_cv_func_pthread_mutexattr_settype_decl=no
  4447. )
  4448. ])
  4449. if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then
  4450. AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL)
  4451. fi
  4452. else
  4453. dnl don't despair, there may be another way to do it
  4454. AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
  4455. wx_cv_type_pthread_rec_mutex_init,
  4456. [
  4457. AC_TRY_COMPILE([#include <pthread.h>],
  4458. [
  4459. pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
  4460. ], [
  4461. wx_cv_type_pthread_rec_mutex_init=yes
  4462. ], [
  4463. wx_cv_type_pthread_rec_mutex_init=no
  4464. ]
  4465. )
  4466. ])
  4467. if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
  4468. AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
  4469. else
  4470. dnl this may break code working elsewhere, so at least warn about it
  4471. AC_MSG_WARN([wxMutex won't be recursive on this platform])
  4472. fi
  4473. fi
  4474. if test "$wxUSE_COMPILER_TLS" = "auto"; then
  4475. if test "$USE_NETBSD" = 1; then
  4476. AC_MSG_WARN([Disabling TLS under NetBSD, please contact wx-dev if it works now])
  4477. wxUSE_COMPILER_TLS=no
  4478. else
  4479. wxUSE_COMPILER_TLS=yes
  4480. fi
  4481. fi
  4482. if test "$wxUSE_COMPILER_TLS" = "yes"; then
  4483. dnl test for compiler thread-specific variables support
  4484. AC_CACHE_CHECK([for __thread keyword],
  4485. wx_cv_cc___thread,
  4486. [
  4487. AC_TRY_COMPILE([#include <pthread.h>],
  4488. [
  4489. static __thread int n = 0;
  4490. static __thread int *p = 0;
  4491. ],
  4492. wx_cv_cc___thread=yes,
  4493. wx_cv_cc___thread=no
  4494. )
  4495. ]
  4496. )
  4497. if test "$wx_cv_cc___thread" = "yes"; then
  4498. AX_GXX_VERSION
  4499. if test -n "$ax_cv_gxx_version"; then
  4500. dnl g++ supports __thread since at least version 3.3 but its support
  4501. dnl seems to be broken until 4.1, see
  4502. dnl http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/108388
  4503. dnl
  4504. dnl NB: we still need to test __thread support with
  4505. dnl AC_TRY_COMPILE above even for g++ 4 as it doesn't
  4506. dnl support it for all architectures (e.g. it doesn't
  4507. dnl work under OS X)
  4508. AC_MSG_CHECKING([whether __thread support in g++ is usable])
  4509. case "$ax_cv_gxx_version" in
  4510. 1.* | 2.* | 3.* )
  4511. AC_MSG_RESULT([no, it's broken])
  4512. wx_cv_cc___thread=no
  4513. ;;
  4514. *)
  4515. AC_MSG_RESULT([yes, it works])
  4516. ;;
  4517. esac
  4518. fi
  4519. fi
  4520. if test "$wx_cv_cc___thread" = "yes"; then
  4521. AC_DEFINE(HAVE___THREAD_KEYWORD)
  4522. fi
  4523. fi
  4524. if test "$ac_cv_header_cxxabi_h" = "yes"; then
  4525. AC_CACHE_CHECK([for abi::__forced_unwind() in <cxxabi.h>],
  4526. wx_cv_type_abi_forced_unwind,
  4527. [
  4528. AC_LANG_PUSH(C++)
  4529. AC_TRY_COMPILE([#include <cxxabi.h>],
  4530. [
  4531. void foo(abi::__forced_unwind&);
  4532. ],
  4533. wx_cv_type_abi_forced_unwind=yes,
  4534. wx_cv_type_abi_forced_unwind=no
  4535. )
  4536. AC_LANG_POP()
  4537. ]
  4538. )
  4539. else
  4540. wx_cv_type_abi_forced_unwind=no
  4541. fi
  4542. if test "$wx_cv_type_abi_forced_unwind" = "yes"; then
  4543. AC_DEFINE(HAVE_ABI_FORCEDUNWIND)
  4544. fi
  4545. fi
  4546. dnl from if !MSW
  4547. else
  4548. if test "$wxUSE_THREADS" = "yes" ; then
  4549. case "${host}" in
  4550. x86_64-*-mingw32* )
  4551. ;;
  4552. *-*-mingw32* )
  4553. dnl check if the compiler accepts -mthreads
  4554. AC_CACHE_CHECK([if compiler supports -mthreads],
  4555. wx_cv_cflags_mthread,
  4556. [
  4557. CFLAGS_OLD="$CFLAGS"
  4558. CFLAGS="-mthreads $CFLAGS"
  4559. AC_TRY_COMPILE([], [],
  4560. wx_cv_cflags_mthread=yes,
  4561. wx_cv_cflags_mthread=no
  4562. )
  4563. ]
  4564. )
  4565. if test "$wx_cv_cflags_mthread" = "yes"; then
  4566. dnl it does, use it
  4567. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads"
  4568. LDFLAGS="$LDFLAGS -mthreads"
  4569. else
  4570. dnl it doesn't
  4571. CFLAGS="$CFLAGS_OLD"
  4572. fi
  4573. ;;
  4574. *-pc-os2*emx )
  4575. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__"
  4576. LDFLAGS="$LDFLAGS -Zmt"
  4577. ;;
  4578. esac
  4579. fi
  4580. fi
  4581. AC_CHECK_FUNC(localtime_r, [ AC_DEFINE(HAVE_LOCALTIME_R) ])
  4582. AC_CHECK_FUNC(gmtime_r, [ AC_DEFINE(HAVE_GMTIME_R) ])
  4583. dnl By preference, we probably should use getaddrinfo which avoids thread
  4584. dnl safety issues and supports IPv6, however there currently is no code
  4585. dnl for it, so testing for it is temporarily disabled and we are restricted
  4586. dnl to gethostbyname_r/gethostbyaddr_r and getservbyname_r
  4587. dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [
  4588. dnl no getaddrinfo, so check for gethostbyname_r and
  4589. dnl related functions (taken from python's configure.in)
  4590. dnl sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments
  4591. AX_FUNC_WHICH_GETHOSTBYNAME_R
  4592. if test "x$ac_cv_func_which_gethostbyname_r" = "xno" -o \
  4593. "x$ac_cv_func_which_gethostbyname_r" = "xunknown" ; then
  4594. AC_CHECK_FUNC(gethostbyname, [ AC_DEFINE(HAVE_GETHOSTBYNAME) ])
  4595. fi
  4596. dnl A similar test for getservbyname_r
  4597. dnl I'm tempted to just not do this test which is taking much time and
  4598. dnl do something similar as for gethostbyaddr_r, but OTOH the macro
  4599. dnl doing the test already exists, so using it is easy enough. - SN
  4600. AC_raf_FUNC_WHICH_GETSERVBYNAME_R
  4601. if test "x$ac_cv_func_which_getservbyname_r" = "xno" -o \
  4602. "x$ac_cv_func_which_getservbyname_r" = "xunknown" ; then
  4603. AC_CHECK_FUNCS(getservbyname,[ AC_DEFINE(HAVE_GETSERVBYNAME) ])
  4604. fi
  4605. dnl For gethostbyaddr_r, we currently do no separate test, instead, we
  4606. dnl silently assume it's available exactly if gethostbyname_r is
  4607. dnl available and always requires two more arguments than
  4608. dnl gethostbyname_r.
  4609. dnl (also, I'm lazy and there no m4 file that's ready for use for this
  4610. dnl function, although it should be easy to rewrite the gethostbyname_r
  4611. dnl check to fit this case, if it's really needed. - SN )
  4612. dnl ]
  4613. dnl )
  4614. dnl This is currently always defined under Unix, there is no reason to ever
  4615. dnl disable compiler TLS support there.
  4616. AC_DEFINE(wxUSE_COMPILER_TLS)
  4617. if test "$wxUSE_THREADS" = "yes"; then
  4618. AC_DEFINE(wxUSE_THREADS)
  4619. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
  4620. else
  4621. dnl on some systems, _REENTRANT should be defined if we want to use any _r()
  4622. dnl functions - add tests for other functions here as well
  4623. if test "$wx_cv_func_strtok_r" = "yes"; then
  4624. AC_MSG_CHECKING(if -D_REENTRANT is needed)
  4625. if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
  4626. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"
  4627. AC_MSG_RESULT(yes)
  4628. else
  4629. AC_MSG_RESULT(no)
  4630. fi
  4631. fi
  4632. fi
  4633. if test "$WXGTK3" = 1 ; then
  4634. AC_DEFINE_UNQUOTED(__WXGTK3__, 1)
  4635. WXGTK2=1
  4636. fi
  4637. if test "$WXGTK2" = 1 ; then
  4638. AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK2)
  4639. fi
  4640. if test "$WXGTK127" = 1 ; then
  4641. AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
  4642. fi
  4643. if test "$WXGPE" = 1 ; then
  4644. AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE)
  4645. fi
  4646. dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++
  4647. dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case)
  4648. DEBUG_CFLAGS=
  4649. if `echo $CXXFLAGS $CFLAGS | grep " -g" >/dev/null`; then
  4650. dnl the CXXFLAGS or the CFLAGS variable already contains the -g flag
  4651. dnl (e.g. it was specified by the user before running configure); since
  4652. dnl later they will be merged with DEBUG_CFLAGS, don't set the -g option
  4653. dnl in DEBUG_CFLAGS to avoid (possibly different) flag duplicates
  4654. AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -g flag; ignoring the --enable-debug_info option])
  4655. elif test "$wxUSE_DEBUG_INFO" = "yes" ; then
  4656. DEBUG_CFLAGS="-g"
  4657. fi
  4658. if test "$wxUSE_DEBUG_GDB" = "yes" ; then
  4659. wxUSE_DEBUG_INFO=yes
  4660. if test "$GCC" = yes; then
  4661. DEBUG_CFLAGS="-ggdb"
  4662. fi
  4663. fi
  4664. if test "$wxUSE_DEBUG_FLAG" = "no" ; then
  4665. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -DwxDEBUG_LEVEL=0"
  4666. if test "$wxUSE_GTK" = 1 ; then
  4667. if test "$WXGTK2" = 1 ; then
  4668. CPPFLAGS="$CPPFLAGS -DG_DISABLE_CAST_CHECKS"
  4669. else
  4670. CPPFLAGS="-DGTK_NO_CHECK_CASTS $CPPFLAGS"
  4671. fi
  4672. fi
  4673. fi
  4674. if test "$wxUSE_MEM_TRACING" = "yes" ; then
  4675. AC_DEFINE(wxUSE_MEMORY_TRACING)
  4676. AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
  4677. AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS)
  4678. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
  4679. fi
  4680. if test "$wxUSE_DMALLOC" = "yes" ; then
  4681. DMALLOC_LIBS="-ldmallocthcxx"
  4682. fi
  4683. dnl cc/cxx/ld option for profiling
  4684. PROFILE_FLAGS=
  4685. if test "$wxUSE_PROFILE" = "yes" ; then
  4686. PROFILE_FLAGS=" -pg"
  4687. fi
  4688. if test "$GCC" = "yes" ; then
  4689. if test "$wxUSE_NO_RTTI" = "yes" ; then
  4690. dnl Define wxNO_RTTI on the command line because only g++ 4.3 and later
  4691. dnl define __GXX_RTTI which allows us to detect the use of -fno-rtti
  4692. dnl switch but we need to do it manually for the older versions.
  4693. WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti"
  4694. fi
  4695. if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
  4696. WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
  4697. fi
  4698. if test "$wxUSE_PERMISSIVE" = "yes" ; then
  4699. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive"
  4700. fi
  4701. dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
  4702. dnl 3.0 overflow the table of contents on rs6000 as they create an entry
  4703. dnl for each subroutine by default -- using the switch below only creates
  4704. dnl one entry per file instead at the price of minor performance penalty
  4705. dnl
  4706. dnl As of wx2.4 a bug in the hppa gcc compiler causes a similar problem
  4707. dnl without -ffunction-sections. No idea how long we'll need to maintain
  4708. dnl this, or even the extent of gcc/wx version combinations affected, but
  4709. dnl also as above, this 'fix' does not come without side effects.
  4710. dnl
  4711. dnl TODO: test for the gcc version here (how?)
  4712. case "${host}" in
  4713. powerpc*-*-aix* )
  4714. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc"
  4715. ;;
  4716. *-hppa* )
  4717. WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections"
  4718. ;;
  4719. esac
  4720. fi
  4721. dnl C/C++ compiler option for optimization (supposed to be the same for both)
  4722. OPTIMISE_CFLAGS=
  4723. if `echo $CXXFLAGS $CFLAGS | grep " -O" >/dev/null`; then
  4724. dnl the CXXFLAGS or the CFLAGS variable already contains -O optimization flag
  4725. dnl (e.g. it was specified by the user before running configure); since
  4726. dnl later they will be merged with OPTIMISE_CFLAGS, don't set the -O option
  4727. dnl in OPTIMISE_CFLAGS to avoid (possibly different) flag duplicates
  4728. AC_MSG_WARN([CXXFLAGS/CFLAGS already contains -O flag; ignoring the --disable-optimise option])
  4729. else
  4730. if test "$wxUSE_OPTIMISE" = "no" ; then
  4731. if test "$GCC" = yes ; then
  4732. dnl use -O0 because compiling with it is faster than compiling with no
  4733. dnl optimization options at all (at least with g++ 3.2)
  4734. OPTIMISE_CFLAGS="-O0"
  4735. fi
  4736. else
  4737. if test "$GCC" = yes ; then
  4738. case "${host}" in
  4739. *-pc-os2_emx | *-pc-os2-emx )
  4740. dnl Not all of the supported gcc versions understand
  4741. dnl -fstrict-aliasing and none actually needs it (yet).
  4742. OPTIMISE_CFLAGS="-O2"
  4743. ;;
  4744. *)
  4745. dnl Switch on optimisation but keep strict-aliasing off for
  4746. dnl now (see -fstrict-aliasing in the gcc manual). When it is
  4747. dnl switched back on consider using -Wstrict-aliasing=2.
  4748. OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing"
  4749. ;;
  4750. esac
  4751. else
  4752. OPTIMISE_CFLAGS="-O"
  4753. fi
  4754. fi
  4755. fi
  4756. dnl ---------------------------------------------------------------------------
  4757. dnl compatibility level
  4758. dnl ---------------------------------------------------------------------------
  4759. if test "x$WXWIN_COMPATIBILITY_2_6" = "xyes"; then
  4760. AC_DEFINE(WXWIN_COMPATIBILITY_2_6)
  4761. WXWIN_COMPATIBILITY_2_8="yes"
  4762. fi
  4763. if test "x$WXWIN_COMPATIBILITY_2_8" != "xno"; then
  4764. AC_DEFINE(WXWIN_COMPATIBILITY_2_8)
  4765. fi
  4766. dnl ---------------------------------------------------------------------------
  4767. dnl the library may be built without GUI classes at all
  4768. dnl ---------------------------------------------------------------------------
  4769. if test "$wxUSE_GUI" = "yes"; then
  4770. AC_DEFINE(wxUSE_GUI)
  4771. dnl the things we always pull in the GUI version of the library:
  4772. dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
  4773. dnl library really can't be built without those)
  4774. dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
  4775. dnl almost any program and the first 2 are needed to show a message box
  4776. dnl which want to be always able to do)
  4777. dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
  4778. dnl to compile without them (if the app doesn't do any drawing, it doesn't
  4779. dnl need the dcs, pens, brushes, ...), this just can't be done now
  4780. dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
  4781. dnl 5. misc stuff: timers, settings, message box
  4782. fi
  4783. dnl ---------------------------------------------------------------------------
  4784. dnl Unix/Windows
  4785. dnl ---------------------------------------------------------------------------
  4786. if test "$wxUSE_UNIX" = "yes"; then
  4787. AC_DEFINE(wxUSE_UNIX)
  4788. fi
  4789. dnl ------------------------------------------------------------------------
  4790. dnl DLL support
  4791. dnl ------------------------------------------------------------------------
  4792. dnl under MSW we always have LoadLibrary/GetProcAddress
  4793. if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
  4794. HAVE_DL_FUNCS=0
  4795. HAVE_SHL_FUNCS=0
  4796. if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
  4797. if test "$USE_DOS" = 1; then
  4798. HAVE_DL_FUNCS=0
  4799. else
  4800. dnl the test is a bit complicated because we check for dlopen() both with
  4801. dnl and without -ldl and we also try to find shl_load() if there is no
  4802. dnl dlopen() on this system
  4803. AC_CHECK_FUNCS(dlopen,
  4804. [
  4805. AC_DEFINE(HAVE_DLOPEN)
  4806. HAVE_DL_FUNCS=1
  4807. ],
  4808. [
  4809. AC_CHECK_LIB(dl, dlopen,
  4810. [
  4811. AC_DEFINE(HAVE_DLOPEN)
  4812. HAVE_DL_FUNCS=1
  4813. DL_LINK=" -ldl$DL_LINK"
  4814. ],
  4815. [
  4816. AC_CHECK_FUNCS(shl_load,
  4817. [
  4818. AC_DEFINE(HAVE_SHL_LOAD)
  4819. HAVE_SHL_FUNCS=1
  4820. ],
  4821. [
  4822. AC_CHECK_LIB(shl_load, dld,
  4823. [
  4824. HAVE_SHL_FUNCS=1
  4825. DL_LINK=" -ldld$DL_LINK"
  4826. ])
  4827. ])
  4828. ])
  4829. ])
  4830. dnl check also for dlerror()
  4831. if test "$HAVE_DL_FUNCS" = 1; then
  4832. AC_CHECK_FUNCS(dlerror,
  4833. AC_DEFINE(HAVE_DLERROR),
  4834. [
  4835. AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
  4836. ]
  4837. )
  4838. fi
  4839. fi
  4840. dnl Force HAVE_DL_FUNCS on for Darwin, even if the tests failed (e.g. pre-10.3)
  4841. if test "$USE_DARWIN" = 1; then
  4842. dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
  4843. HAVE_DL_FUNCS=1
  4844. fi
  4845. if test "$HAVE_DL_FUNCS" = 0; then
  4846. if test "$HAVE_SHL_FUNCS" = 0; then
  4847. if test "$USE_UNIX" = 1 -o "$USE_DOS" = 1; then
  4848. AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
  4849. wxUSE_DYNAMIC_LOADER=no
  4850. wxUSE_DYNLIB_CLASS=no
  4851. else
  4852. AC_MSG_WARN([Assuming wxLibrary class works on this platform])
  4853. fi
  4854. fi
  4855. fi
  4856. fi
  4857. fi
  4858. if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
  4859. AC_DEFINE(wxUSE_DYNAMIC_LOADER)
  4860. fi
  4861. if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
  4862. AC_DEFINE(wxUSE_DYNLIB_CLASS)
  4863. fi
  4864. dnl ---------------------------------------------------------------------------
  4865. dnl Verify consistency of plugins/monolithic/shared settings:
  4866. dnl ---------------------------------------------------------------------------
  4867. if test "$wxUSE_PLUGINS" = "yes" ; then
  4868. if test "$wxUSE_SHARED" = "no" ; then
  4869. AC_MSG_WARN([plugins supported only in shared build, disabling])
  4870. wxUSE_PLUGINS=no
  4871. fi
  4872. if test "$wxUSE_MONOLITHIC" = "yes" ; then
  4873. AC_MSG_WARN([plugins not supported monolithic build, disabling])
  4874. wxUSE_PLUGINS=no
  4875. fi
  4876. if test "$wxUSE_DYNLIB_CLASS" = "no" ; then
  4877. AC_MSG_WARN([plugins require wxDynamicLibrary, disabling])
  4878. wxUSE_PLUGINS=no
  4879. fi
  4880. if test "$wxUSE_PLUGINS" = "yes" ; then
  4881. AC_DEFINE(wxUSE_PLUGINS)
  4882. fi
  4883. fi
  4884. dnl ---------------------------------------------------------------------------
  4885. dnl File system watcher checks
  4886. dnl ---------------------------------------------------------------------------
  4887. if test "$wxUSE_FSWATCHER" = "yes"; then
  4888. dnl wxFileSystemWatcher is always available under MSW but we need either
  4889. dnl inotify or kqueue support in the system for it under Unix (this
  4890. dnl includes OS X which does have kqueue but no other platforms)
  4891. if test "$wxUSE_MSW" != "1"; then
  4892. if test "$wxUSE_UNIX" = "yes"; then
  4893. AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
  4894. if test "$ac_cv_header_sys_inotify_h" = "yes"; then
  4895. AC_DEFINE(wxHAS_INOTIFY)
  4896. else
  4897. AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
  4898. if test "$ac_cv_header_sys_event_h" = "yes"; then
  4899. AC_DEFINE(wxHAS_KQUEUE)
  4900. else
  4901. wxUSE_FSWATCHER=no
  4902. fi
  4903. fi
  4904. else
  4905. wxUSE_FSWATCHER=no
  4906. fi
  4907. else
  4908. if test "$wxUSE_THREADS" != "yes"; then
  4909. AC_MSG_WARN([wxFileSystemWatcher disabled due to --disable-threads])
  4910. wxUSE_FSWATCHER=no
  4911. fi
  4912. fi
  4913. if test "$wxUSE_FSWATCHER" = "yes"; then
  4914. AC_DEFINE(wxUSE_FSWATCHER)
  4915. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
  4916. else
  4917. AC_MSG_WARN([wxFileSystemWatcher won't be available on this platform])
  4918. fi
  4919. fi
  4920. dnl ---------------------------------------------------------------------------
  4921. dnl Register non-GUI class options for makefiles and setup.h
  4922. dnl ---------------------------------------------------------------------------
  4923. if test "$wxUSE_STL" = "yes"; then
  4924. AC_DEFINE(wxUSE_STL)
  4925. fi
  4926. if test "$wxUSE_EXTENDED_RTTI" = "yes"; then
  4927. AC_DEFINE(wxUSE_EXTENDED_RTTI)
  4928. fi
  4929. if test "$wxUSE_ANY" = "yes"; then
  4930. AC_DEFINE(wxUSE_ANY)
  4931. fi
  4932. if test "$wxUSE_APPLE_IEEE" = "yes"; then
  4933. AC_DEFINE(wxUSE_APPLE_IEEE)
  4934. fi
  4935. if test "$wxUSE_TIMER" = "yes"; then
  4936. AC_DEFINE(wxUSE_TIMER)
  4937. fi
  4938. dnl Unix implementation needs additional checks because audio support
  4939. dnl comes in many favours:
  4940. if test "$USE_UNIX" = 1 ; then
  4941. dnl it's not enough to check for just the header because OSS under NetBSD
  4942. dnl redefines ioctl as oss_ioctrl inside it and so we also need to test
  4943. dnl whether we need -lossaudio at link-time
  4944. AC_CACHE_CHECK([for SNDCTL_DSP_SPEED in sys/soundcard.h], ac_cv_header_sys_soundcard, [
  4945. AC_TRY_LINK([
  4946. #include <sys/ioctl.h>
  4947. #include <sys/soundcard.h>
  4948. ],
  4949. [
  4950. ioctl(0, SNDCTL_DSP_SPEED, 0);
  4951. ],
  4952. ac_cv_header_sys_soundcard=yes,
  4953. [
  4954. saveLibs="$LIBS"
  4955. LIBS="$saveLibs -lossaudio"
  4956. AC_TRY_LINK([
  4957. #include <sys/ioctl.h>
  4958. #include <sys/soundcard.h>
  4959. ],
  4960. [
  4961. ioctl(0, SNDCTL_DSP_SPEED, 0);
  4962. ],
  4963. ac_cv_header_sys_soundcard=yes,
  4964. [
  4965. LIBS="$saveLibs"
  4966. ac_cv_header_sys_soundcard=no
  4967. ]
  4968. )
  4969. ]
  4970. )
  4971. ])
  4972. if test "$ac_cv_header_sys_soundcard" = "yes"; then
  4973. AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
  4974. fi
  4975. fi
  4976. WITH_PLUGIN_SDL=0
  4977. if test "$wxUSE_SOUND" = "yes"; then
  4978. if test "$USE_UNIX" = 1 ; then
  4979. if test "$wxUSE_LIBSDL" != "no"; then
  4980. AM_PATH_SDL([1.2.0],
  4981. [
  4982. EXTRALIBS_SDL="$SDL_LIBS"
  4983. CFLAGS="$SDL_CFLAGS $CFLAGS"
  4984. CXXFLAGS="$SDL_CFLAGS $CXXFLAGS"
  4985. AC_DEFINE(wxUSE_LIBSDL)
  4986. ],
  4987. [wxUSE_LIBSDL="no"])
  4988. if test "$wxUSE_LIBSDL" = "yes" -a "$wxUSE_PLUGINS" = "yes" ; then
  4989. WITH_PLUGIN_SDL=1
  4990. fi
  4991. fi
  4992. fi
  4993. fi
  4994. if test "$wxUSE_SOUND" = "yes"; then
  4995. AC_DEFINE(wxUSE_SOUND)
  4996. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sound"
  4997. fi
  4998. if test "$WXGTK2" = 1; then
  4999. PKG_PROG_PKG_CONFIG()
  5000. if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
  5001. if test "$wxUSE_GTKPRINT" = "yes" ; then
  5002. if test "$WXGTK3" = 1; then
  5003. gtk_unix_print="gtk+-unix-print-3.0"
  5004. else
  5005. gtk_unix_print="gtk+-unix-print-2.0 >= 2.10"
  5006. fi
  5007. PKG_CHECK_MODULES(GTKPRINT,
  5008. [$gtk_unix_print],
  5009. [
  5010. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GTKPRINT_LIBS"
  5011. CFLAGS="$GTKPRINT_CFLAGS $CFLAGS"
  5012. CXXFLAGS="$GTKPRINT_CFLAGS $CXXFLAGS"
  5013. AC_DEFINE(wxUSE_GTKPRINT)
  5014. ],
  5015. [
  5016. AC_MSG_WARN([GTK printing support not found (GTK+ >= 2.10), library will use GNOME printing support or standard PostScript printing])
  5017. wxUSE_GTKPRINT="no"
  5018. ]
  5019. )
  5020. fi
  5021. fi
  5022. if test "$wxUSE_MIMETYPE" = "yes" ; then
  5023. if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
  5024. PKG_CHECK_MODULES(GNOMEVFS,
  5025. [gnome-vfs-2.0 >= 2.0],
  5026. [
  5027. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GNOMEVFS_LIBS"
  5028. CFLAGS="$GNOMEVFS_CFLAGS $CFLAGS"
  5029. CXXFLAGS="$GNOMEVFS_CFLAGS $CXXFLAGS"
  5030. AC_DEFINE(wxUSE_LIBGNOMEVFS)
  5031. ],
  5032. [
  5033. AC_MSG_WARN([libgnomevfs not found, library won't be able to associate MIME type])
  5034. wxUSE_LIBGNOMEVFS="no"
  5035. ]
  5036. )
  5037. fi
  5038. fi
  5039. if test "$wxUSE_NOTIFICATION_MESSAGE" = "yes" ; then
  5040. if test "$wxUSE_LIBNOTIFY" = "yes" ; then
  5041. HAVE_LIBNOTIFY=0
  5042. PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= 0.7],
  5043. [
  5044. HAVE_LIBNOTIFY=1
  5045. AC_DEFINE(wxUSE_LIBNOTIFY_0_7)
  5046. ],
  5047. [
  5048. PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= 0.4],
  5049. [HAVE_LIBNOTIFY=1],
  5050. [AC_MSG_WARN([libnotify not found, wxNotificationMessage will use generic implementation.])]
  5051. )
  5052. ]
  5053. )
  5054. if test "$HAVE_LIBNOTIFY" = "1" ; then
  5055. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $LIBNOTIFY_LIBS"
  5056. CFLAGS="$LIBNOTIFY_CFLAGS $CFLAGS"
  5057. CXXFLAGS="$LIBNOTIFY_CFLAGS $CXXFLAGS"
  5058. AC_DEFINE(wxUSE_LIBNOTIFY)
  5059. fi
  5060. fi
  5061. fi
  5062. if test "$wxUSE_LIBHILDON" = "yes" ; then
  5063. PKG_CHECK_MODULES(HILDON,
  5064. [hildon-lgpl >= 0.9],
  5065. [
  5066. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $HILDON_LIBS"
  5067. CFLAGS="$CFLAGS $HILDON_CFLAGS"
  5068. CXXFLAGS="$CXXFLAGS $HILDON_CFLAGS"
  5069. AC_DEFINE(wxUSE_LIBHILDON)
  5070. ac_hildon_lgpl=1
  5071. ],
  5072. [
  5073. AC_MSG_WARN([libhildon_lgpl not found])
  5074. wxUSE_LIBHILDON="no"
  5075. ac_hildon_lgpl=0
  5076. ]
  5077. )
  5078. if test "$ac_hildon_lgpl" = 0 ; then
  5079. PKG_CHECK_MODULES(HILDON2,
  5080. [hildon-1 >= 1.99],
  5081. [
  5082. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $HILDON2_LIBS"
  5083. CFLAGS="$CFLAGS $HILDON2_CFLAGS"
  5084. CXXFLAGS="$CXXFLAGS $HILDON2_CFLAGS"
  5085. AC_DEFINE(wxUSE_LIBHILDON2)
  5086. ],
  5087. [
  5088. AC_MSG_WARN([libhildon_1 not found])
  5089. wxUSE_LIBHILDON2="no"
  5090. ]
  5091. )
  5092. fi
  5093. fi
  5094. fi
  5095. if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
  5096. AC_DEFINE(wxUSE_CMDLINE_PARSER)
  5097. fi
  5098. if test "$wxUSE_STOPWATCH" = "yes"; then
  5099. AC_DEFINE(wxUSE_STOPWATCH)
  5100. fi
  5101. if test "$wxUSE_DATETIME" = "yes"; then
  5102. AC_DEFINE(wxUSE_DATETIME)
  5103. fi
  5104. if test "$wxUSE_FILE" = "yes"; then
  5105. AC_DEFINE(wxUSE_FILE)
  5106. fi
  5107. if test "$wxUSE_FFILE" = "yes"; then
  5108. AC_DEFINE(wxUSE_FFILE)
  5109. fi
  5110. if test "$wxUSE_ARCHIVE_STREAMS" = "yes"; then
  5111. if test "$wxUSE_STREAMS" != yes; then
  5112. AC_MSG_WARN(wxArchive requires wxStreams... disabled)
  5113. wxUSE_ARCHIVE_STREAMS=no
  5114. else
  5115. AC_DEFINE(wxUSE_ARCHIVE_STREAMS)
  5116. fi
  5117. fi
  5118. if test "$wxUSE_ZIPSTREAM" = "yes"; then
  5119. if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
  5120. AC_MSG_WARN(wxZip requires wxArchive... disabled)
  5121. elif test "$wxUSE_ZLIB" = "no"; then
  5122. AC_MSG_WARN(wxZip requires wxZlib... disabled)
  5123. else
  5124. AC_DEFINE(wxUSE_ZIPSTREAM)
  5125. fi
  5126. fi
  5127. if test "$wxUSE_TARSTREAM" = "yes"; then
  5128. if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then
  5129. AC_MSG_WARN(wxTar requires wxArchive... disabled)
  5130. else
  5131. AC_DEFINE(wxUSE_TARSTREAM)
  5132. fi
  5133. fi
  5134. if test "$wxUSE_FILE_HISTORY" = "yes"; then
  5135. AC_DEFINE(wxUSE_FILE_HISTORY)
  5136. fi
  5137. if test "$wxUSE_FILESYSTEM" = "yes"; then
  5138. if test "$wxUSE_STREAMS" != yes -o \( "$wxUSE_FILE" != yes -a "$wxUSE_FFILE" != yes \); then
  5139. AC_MSG_WARN(wxFileSystem requires wxStreams and wxFile or wxFFile... disabled)
  5140. wxUSE_FILESYSTEM=no
  5141. else
  5142. AC_DEFINE(wxUSE_FILESYSTEM)
  5143. fi
  5144. fi
  5145. if test "$wxUSE_FS_ARCHIVE" = "yes"; then
  5146. if test "$wxUSE_FILESYSTEM" != yes -o "$wxUSE_ARCHIVE_STREAMS" != yes; then
  5147. AC_MSG_WARN(wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled)
  5148. else
  5149. AC_DEFINE(wxUSE_FS_ARCHIVE)
  5150. fi
  5151. fi
  5152. if test "$wxUSE_FS_ZIP" = "yes"; then
  5153. if test "$wxUSE_FS_ARCHIVE" != yes; then
  5154. AC_MSG_WARN(wxZipFSHandler requires wxArchiveFSHandler... disabled)
  5155. else
  5156. AC_DEFINE(wxUSE_FS_ZIP)
  5157. fi
  5158. fi
  5159. if test "$wxUSE_FSVOLUME" = "yes"; then
  5160. AC_DEFINE(wxUSE_FSVOLUME)
  5161. fi
  5162. if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
  5163. if test "$USE_UNIX" != 1; then
  5164. AC_MSG_WARN([Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called])
  5165. wxUSE_ON_FATAL_EXCEPTION=no
  5166. else
  5167. AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
  5168. fi
  5169. fi
  5170. if test "$wxUSE_STACKWALKER" = "yes"; then
  5171. AC_DEFINE(wxUSE_STACKWALKER)
  5172. fi
  5173. if test "$wxUSE_DEBUGREPORT" = "yes"; then
  5174. if test "$USE_UNIX" != 1 -a "$USE_WIN32" != 1; then
  5175. AC_MSG_WARN([Creating debug reports not currently supported on this system, disabled])
  5176. wxUSE_DEBUGREPORT=no
  5177. else
  5178. AC_DEFINE(wxUSE_DEBUGREPORT)
  5179. if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
  5180. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt"
  5181. fi
  5182. fi
  5183. fi
  5184. if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
  5185. AC_DEFINE(wxUSE_SNGLINST_CHECKER)
  5186. fi
  5187. if test "$wxUSE_BUSYINFO" = "yes"; then
  5188. AC_DEFINE(wxUSE_BUSYINFO)
  5189. fi
  5190. if test "$wxUSE_HOTKEY" = "yes"; then
  5191. if test "$wxUSE_MSW" != 1 -a "$wxUSE_OSX_COCOA" != 1 -a "$wxUSE_OSX_CARBON" != 1; then
  5192. AC_MSG_WARN([Hot keys not supported by the current toolkit, disabled])
  5193. wxUSE_HOTKEY=no
  5194. fi
  5195. elif test "$wxUSE_HOTKEY" = "auto"; then
  5196. if test "$wxUSE_MSW" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OSX_CARBON" = 1; then
  5197. wxUSE_HOTKEY=yes
  5198. fi
  5199. fi
  5200. if test "$wxUSE_HOTKEY" = "yes"; then
  5201. AC_DEFINE(wxUSE_HOTKEY)
  5202. fi
  5203. if test "$wxUSE_STD_CONTAINERS" = "yes"; then
  5204. AC_DEFINE(wxUSE_STD_CONTAINERS)
  5205. fi
  5206. if test "$wxUSE_STD_IOSTREAM" = "yes"; then
  5207. AC_DEFINE(wxUSE_STD_IOSTREAM)
  5208. fi
  5209. if test "$wxUSE_STD_STRING" = "yes"; then
  5210. AC_DEFINE(wxUSE_STD_STRING)
  5211. fi
  5212. if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
  5213. AC_DEFINE(wxUSE_STD_STRING_CONV_IN_WXSTRING)
  5214. fi
  5215. if test "$wxUSE_STDPATHS" = "yes"; then
  5216. AC_DEFINE(wxUSE_STDPATHS)
  5217. fi
  5218. if test "$wxUSE_TEXTBUFFER" = "yes"; then
  5219. AC_DEFINE(wxUSE_TEXTBUFFER)
  5220. fi
  5221. if test "$wxUSE_TEXTFILE" = "yes"; then
  5222. if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then
  5223. AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled)
  5224. else
  5225. AC_DEFINE(wxUSE_TEXTFILE)
  5226. fi
  5227. fi
  5228. if test "$wxUSE_CONFIG" = "yes" ; then
  5229. if test "$wxUSE_TEXTFILE" != "yes"; then
  5230. AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
  5231. else
  5232. AC_DEFINE(wxUSE_CONFIG)
  5233. AC_DEFINE(wxUSE_CONFIG_NATIVE)
  5234. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
  5235. fi
  5236. fi
  5237. if test "$wxUSE_INTL" = "yes" ; then
  5238. if test "$wxUSE_FILE" != "yes"; then
  5239. AC_MSG_WARN(I18n code requires wxFile... disabled)
  5240. else
  5241. AC_DEFINE(wxUSE_INTL)
  5242. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
  5243. GUIDIST="$GUIDIST INTL_DIST"
  5244. fi
  5245. fi
  5246. if test "$wxUSE_XLOCALE" = "yes" ; then
  5247. AC_DEFINE(wxUSE_XLOCALE)
  5248. AC_CHECK_TYPES(locale_t,,,
  5249. [#include <xlocale.h>
  5250. #include <locale.h>])
  5251. fi
  5252. if test "$wxUSE_LOG" = "yes"; then
  5253. AC_DEFINE(wxUSE_LOG)
  5254. if test "$wxUSE_LOGGUI" = "yes"; then
  5255. AC_DEFINE(wxUSE_LOGGUI)
  5256. fi
  5257. if test "$wxUSE_LOGWINDOW" = "yes"; then
  5258. AC_DEFINE(wxUSE_LOGWINDOW)
  5259. fi
  5260. if test "$wxUSE_LOGDIALOG" = "yes"; then
  5261. AC_DEFINE(wxUSE_LOG_DIALOG)
  5262. fi
  5263. dnl the keyboard sample requires wxUSE_LOG
  5264. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard"
  5265. fi
  5266. if test "$wxUSE_LONGLONG" = "yes"; then
  5267. AC_DEFINE(wxUSE_LONGLONG)
  5268. fi
  5269. if test "$wxUSE_GEOMETRY" = "yes"; then
  5270. AC_DEFINE(wxUSE_GEOMETRY)
  5271. fi
  5272. if test "$wxUSE_BASE64" = "yes"; then
  5273. AC_DEFINE(wxUSE_BASE64)
  5274. fi
  5275. if test "$wxUSE_STREAMS" = "yes" ; then
  5276. AC_DEFINE(wxUSE_STREAMS)
  5277. fi
  5278. if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
  5279. AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
  5280. fi
  5281. if test "$wxUSE_OBJC_UNIQUIFYING" = "yes"; then
  5282. AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
  5283. fi
  5284. dnl ---------------------------------------------------------------------------
  5285. dnl console event loop stuff
  5286. dnl ---------------------------------------------------------------------------
  5287. if test "$wxUSE_CONSOLE_EVENTLOOP" = "yes"; then
  5288. AC_DEFINE(wxUSE_CONSOLE_EVENTLOOP)
  5289. if test "$wxUSE_UNIX" = "yes"; then
  5290. if test "$wxUSE_SELECT_DISPATCHER" = "yes"; then
  5291. AC_DEFINE(wxUSE_SELECT_DISPATCHER)
  5292. fi
  5293. if test "$wxUSE_EPOLL_DISPATCHER" = "yes"; then
  5294. AC_CHECK_HEADERS(sys/epoll.h,,, [AC_INCLUDES_DEFAULT()])
  5295. if test "$ac_cv_header_sys_epoll_h" = "yes"; then
  5296. AC_DEFINE(wxUSE_EPOLL_DISPATCHER)
  5297. else
  5298. AC_MSG_WARN([sys/epoll.h not available, wxEpollDispatcher disabled])
  5299. fi
  5300. fi
  5301. fi
  5302. fi
  5303. dnl ---------------------------------------------------------------------------
  5304. dnl time/date functions
  5305. dnl ---------------------------------------------------------------------------
  5306. dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
  5307. dnl function to be used for high resolution timers
  5308. AC_CHECK_FUNCS(gettimeofday ftime, break)
  5309. if test "$ac_cv_func_gettimeofday" = "yes"; then
  5310. AC_CACHE_CHECK([whether gettimeofday takes two arguments],
  5311. wx_cv_func_gettimeofday_has_2_args,
  5312. [
  5313. dnl on some _really_ old systems it takes only 1 argument
  5314. AC_TRY_COMPILE(
  5315. [
  5316. #include <sys/time.h>
  5317. #include <unistd.h>
  5318. ],
  5319. [
  5320. struct timeval tv;
  5321. gettimeofday(&tv, NULL);
  5322. ],
  5323. wx_cv_func_gettimeofday_has_2_args=yes,
  5324. AC_TRY_COMPILE(
  5325. [
  5326. #include <sys/time.h>
  5327. #include <unistd.h>
  5328. ],
  5329. [
  5330. struct timeval tv;
  5331. gettimeofday(&tv);
  5332. ],
  5333. wx_cv_func_gettimeofday_has_2_args=no,
  5334. [
  5335. AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
  5336. wx_cv_func_gettimeofday_has_2_args=unknown
  5337. ]
  5338. )
  5339. )
  5340. ])
  5341. if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
  5342. AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
  5343. fi
  5344. fi
  5345. if test "$wxUSE_DATETIME" = "yes"; then
  5346. dnl check for timezone variable
  5347. dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
  5348. AC_CACHE_CHECK(for timezone variable in <time.h>,
  5349. wx_cv_var_timezone,
  5350. [
  5351. AC_LANG_PUSH(C++)
  5352. AC_TRY_COMPILE(
  5353. [
  5354. #include <time.h>
  5355. ],
  5356. [
  5357. int tz;
  5358. tz = timezone;
  5359. ],
  5360. [
  5361. wx_cv_var_timezone=timezone
  5362. ],
  5363. [
  5364. AC_TRY_COMPILE(
  5365. [
  5366. #include <time.h>
  5367. ],
  5368. [
  5369. int tz;
  5370. tz = _timezone;
  5371. ],
  5372. [
  5373. wx_cv_var_timezone=_timezone
  5374. ],
  5375. [
  5376. AC_TRY_COMPILE(
  5377. [
  5378. #include <time.h>
  5379. ],
  5380. [
  5381. int tz;
  5382. tz = __timezone;
  5383. ],
  5384. [
  5385. wx_cv_var_timezone=__timezone
  5386. ],
  5387. [
  5388. if test "$USE_DOS" = 0 ; then
  5389. AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
  5390. fi
  5391. ]
  5392. )
  5393. ]
  5394. )
  5395. ]
  5396. )
  5397. AC_LANG_POP()
  5398. ]
  5399. )
  5400. dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
  5401. if test "x$wx_cv_var_timezone" != x ; then
  5402. AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
  5403. fi
  5404. dnl check for localtime (it's POSIX, but the check can do no harm...)
  5405. AC_CHECK_FUNCS(localtime)
  5406. if test "$ac_cv_func_localtime" = "yes"; then
  5407. AC_CACHE_CHECK(for tm_gmtoff in struct tm,
  5408. wx_cv_struct_tm_has_gmtoff,
  5409. [
  5410. AC_TRY_COMPILE(
  5411. [
  5412. #include <time.h>
  5413. ],
  5414. [
  5415. struct tm tm;
  5416. tm.tm_gmtoff++;
  5417. ],
  5418. [
  5419. wx_cv_struct_tm_has_gmtoff=yes
  5420. ],
  5421. wx_cv_struct_tm_has_gmtoff=no
  5422. )
  5423. ])
  5424. fi
  5425. if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
  5426. AC_DEFINE(WX_GMTOFF_IN_TM)
  5427. fi
  5428. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
  5429. fi
  5430. dnl ------------------------------------------------------------------------
  5431. dnl wxProcess
  5432. dnl ------------------------------------------------------------------------
  5433. AC_CHECK_FUNCS(setpriority)
  5434. dnl ------------------------------------------------------------------------
  5435. dnl wxSocket
  5436. dnl ------------------------------------------------------------------------
  5437. if test "$wxUSE_SOCKETS" = "yes"; then
  5438. dnl under MSW we always have sockets
  5439. if test "$TOOLKIT" != "MSW"; then
  5440. dnl under Solaris and OS/2, socket functions live in -lsocket
  5441. AC_CHECK_FUNC(socket,,
  5442. [
  5443. AC_CHECK_LIB(socket, socket,
  5444. if test "$INET_LINK" != " -lsocket"; then
  5445. INET_LINK="$INET_LINK -lsocket"
  5446. fi,
  5447. [
  5448. AC_MSG_WARN([socket library not found - sockets will be disabled])
  5449. wxUSE_SOCKETS=no
  5450. ]
  5451. )
  5452. ]
  5453. )
  5454. fi
  5455. fi
  5456. if test "$wxUSE_SOCKETS" = "yes" ; then
  5457. dnl this test may be appropriate if building under cygwin
  5458. dnl right now I'm assuming it also uses the winsock stuff
  5459. dnl like mingw does.. -- RL
  5460. if test "$TOOLKIT" != "MSW"; then
  5461. dnl determine the type of third argument for getsockname
  5462. dnl This test needs to be done in C++ mode since gsocket.cpp now
  5463. dnl is C++ code and pointer cast that are possible even without
  5464. dnl warning in C still fail in C++.
  5465. AC_CACHE_CHECK([what is the type of the third argument of getsockname],
  5466. wx_cv_type_getsockname3,
  5467. [
  5468. AC_LANG_PUSH(C++)
  5469. AC_TRY_COMPILE(
  5470. [
  5471. #include <sys/types.h>
  5472. #include <sys/socket.h>
  5473. ],
  5474. [
  5475. socklen_t len;
  5476. getsockname(0, 0, &len);
  5477. ],
  5478. wx_cv_type_getsockname3=socklen_t,
  5479. [
  5480. dnl the compiler will compile the version with size_t
  5481. dnl even if the real type of the last parameter is int
  5482. dnl but it should give at least a warning about
  5483. dnl converting between incompatible pointer types, so
  5484. dnl try to use it to get the correct behaviour at
  5485. dnl least with gcc (otherwise we'd always use size_t)
  5486. CFLAGS_OLD="$CFLAGS"
  5487. if test "$GCC" = yes ; then
  5488. CFLAGS="-Werror $CFLAGS"
  5489. fi
  5490. AC_TRY_COMPILE(
  5491. [
  5492. #include <sys/types.h>
  5493. #include <sys/socket.h>
  5494. ],
  5495. [
  5496. size_t len;
  5497. getsockname(0, 0, &len);
  5498. ],
  5499. wx_cv_type_getsockname3=size_t,
  5500. AC_TRY_COMPILE(
  5501. [
  5502. #include <sys/types.h>
  5503. #include <sys/socket.h>
  5504. ],
  5505. [
  5506. int len;
  5507. getsockname(0, 0, &len);
  5508. ],
  5509. wx_cv_type_getsockname3=int,
  5510. wx_cv_type_getsockname3=unknown
  5511. )
  5512. )
  5513. CFLAGS="$CFLAGS_OLD"
  5514. ]
  5515. )
  5516. AC_LANG_POP()
  5517. ])
  5518. if test "$wx_cv_type_getsockname3" = "unknown"; then
  5519. wxUSE_SOCKETS=no
  5520. AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
  5521. else
  5522. AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3)
  5523. fi
  5524. dnl Do this again for getsockopt as it may be different
  5525. AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
  5526. wx_cv_type_getsockopt5,
  5527. [
  5528. dnl Note that the rules for compatibility of pointers
  5529. dnl are somewhat different between C and C++, so code
  5530. dnl that fails in C++ may not even give a warning about
  5531. dnl converting between incompatible pointer types in C.
  5532. dnl So this test needs to be done in C++ mode.
  5533. AC_LANG_PUSH(C++)
  5534. AC_TRY_COMPILE(
  5535. [
  5536. #include <sys/types.h>
  5537. #include <sys/socket.h>
  5538. ],
  5539. [
  5540. socklen_t len;
  5541. getsockopt(0, 0, 0, 0, &len);
  5542. ],
  5543. wx_cv_type_getsockopt5=socklen_t,
  5544. [
  5545. AC_TRY_COMPILE(
  5546. [
  5547. #include <sys/types.h>
  5548. #include <sys/socket.h>
  5549. ],
  5550. [
  5551. size_t len;
  5552. getsockopt(0, 0, 0, 0, &len);
  5553. ],
  5554. wx_cv_type_getsockopt5=size_t,
  5555. AC_TRY_COMPILE(
  5556. [
  5557. #include <sys/types.h>
  5558. #include <sys/socket.h>
  5559. ],
  5560. [
  5561. int len;
  5562. getsockopt(0, 0, 0, 0, &len);
  5563. ],
  5564. wx_cv_type_getsockopt5=int,
  5565. wx_cv_type_getsockopt5=unknown
  5566. )
  5567. )
  5568. ]
  5569. )
  5570. AC_LANG_POP()
  5571. ])
  5572. if test "$wx_cv_type_getsockopt5" = "unknown"; then
  5573. wxUSE_SOCKETS=no
  5574. AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
  5575. else
  5576. AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5)
  5577. fi
  5578. fi
  5579. fi
  5580. if test "$wxUSE_SOCKETS" = "yes" ; then
  5581. if test "$wxUSE_IPV6" = "yes"; then
  5582. AC_CACHE_CHECK(
  5583. [whether we have sockaddr_in6],
  5584. [wx_cv_type_sockaddr_in6],
  5585. [
  5586. AC_TRY_COMPILE(
  5587. [
  5588. #include <sys/types.h>
  5589. #include <sys/socket.h>
  5590. #include <netinet/in.h>
  5591. ],
  5592. [
  5593. struct sockaddr_in6 sa6;
  5594. ],
  5595. wx_cv_type_sockaddr_in6=yes,
  5596. wx_cv_type_sockaddr_in6=no
  5597. )
  5598. ]
  5599. )
  5600. if test "$wx_cv_type_sockaddr_in6"="yes"; then
  5601. AC_DEFINE(wxUSE_IPV6)
  5602. else
  5603. AC_MSG_WARN([IPv6 support not available... disabled])
  5604. fi
  5605. fi
  5606. AC_DEFINE(wxUSE_SOCKETS)
  5607. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
  5608. fi
  5609. if test "$wxUSE_PROTOCOL" = "yes"; then
  5610. if test "$wxUSE_SOCKETS" != "yes"; then
  5611. AC_MSG_WARN(Protocol classes require sockets... disabled)
  5612. wxUSE_PROTOCOL=no
  5613. fi
  5614. fi
  5615. if test "$wxUSE_PROTOCOL" = "yes"; then
  5616. AC_DEFINE(wxUSE_PROTOCOL)
  5617. if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
  5618. AC_DEFINE(wxUSE_PROTOCOL_HTTP)
  5619. fi
  5620. if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
  5621. AC_DEFINE(wxUSE_PROTOCOL_FTP)
  5622. fi
  5623. if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
  5624. AC_DEFINE(wxUSE_PROTOCOL_FILE)
  5625. fi
  5626. else
  5627. if test "$wxUSE_FS_INET" = "yes"; then
  5628. AC_MSG_WARN([HTTP filesystem require protocol classes... disabled])
  5629. wxUSE_FS_INET="no"
  5630. fi
  5631. fi
  5632. if test "$wxUSE_URL" = "yes"; then
  5633. if test "$wxUSE_PROTOCOL" != "yes"; then
  5634. AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
  5635. wxUSE_URL=no
  5636. fi
  5637. if test "$wxUSE_URL" = "yes"; then
  5638. AC_DEFINE(wxUSE_URL)
  5639. fi
  5640. fi
  5641. if test "$wxUSE_VARIANT" = "yes"; then
  5642. AC_DEFINE(wxUSE_VARIANT)
  5643. fi
  5644. if test "$wxUSE_FS_INET" = "yes"; then
  5645. AC_DEFINE(wxUSE_FS_INET)
  5646. fi
  5647. dnl ---------------------------------------------------------------------------
  5648. dnl Joystick support
  5649. dnl ---------------------------------------------------------------------------
  5650. if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
  5651. wxUSE_JOYSTICK=no
  5652. dnl under MSW we always have joystick support
  5653. if test "$TOOLKIT" = "MSW"; then
  5654. wxUSE_JOYSTICK=yes
  5655. dnl mac only available on darwin
  5656. elif test "$TOOLKIT" = "OSX_COCOA" -o "$TOOLKIT" = "COCOA"; then
  5657. if test "$USE_DARWIN" = 1; then
  5658. dnl check for a bug in the headers, some have bad setEventCallout
  5659. AC_MSG_CHECKING([headers have declarations needed for joystick support])
  5660. AC_LANG_PUSH(C++)
  5661. AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
  5662. [ IOHIDQueueInterface *qi = NULL;
  5663. IOHIDCallbackFunction cb = NULL;
  5664. qi->setEventCallout(NULL, cb, NULL, NULL); ],
  5665. [ wxUSE_JOYSTICK=yes ]
  5666. )
  5667. AC_LANG_POP()
  5668. AC_MSG_RESULT($wxUSE_JOYSTICK)
  5669. fi
  5670. dnl joystick support is only for Linux 2.1.x or greater
  5671. else
  5672. dnl notice the dummy includes argument: without it, AC_CHECK_HEADER
  5673. dnl checks only whether the header can be preprocessed, not that it
  5674. dnl can be compiled and in Linux 2.6.16 joystick.h is present but
  5675. dnl can't be compiled because of an error and with the default
  5676. dnl AC_CHECK_HEADER semantics we'd still detect it in this case and
  5677. dnl build would fail later
  5678. AC_CHECK_HEADERS([linux/joystick.h], [wxUSE_JOYSTICK=yes],, [AC_INCLUDES_DEFAULT()])
  5679. fi
  5680. if test "$wxUSE_JOYSTICK" = "yes"; then
  5681. AC_DEFINE(wxUSE_JOYSTICK)
  5682. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
  5683. else
  5684. AC_MSG_WARN(Joystick not supported by this system... disabled)
  5685. fi
  5686. fi
  5687. dnl ---------------------------------------------------------------------------
  5688. dnl String stuff
  5689. dnl ---------------------------------------------------------------------------
  5690. if test "$wxUSE_FONTENUM" = "yes" ; then
  5691. AC_DEFINE(wxUSE_FONTENUM)
  5692. fi
  5693. if test "$wxUSE_FONTMAP" = "yes" ; then
  5694. AC_DEFINE(wxUSE_FONTMAP)
  5695. fi
  5696. if test "$wxUSE_UNICODE" = "yes" ; then
  5697. AC_DEFINE(wxUSE_UNICODE)
  5698. if test "$USE_WIN32" != 1; then
  5699. wxUSE_UNICODE_MSLU=no
  5700. fi
  5701. if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
  5702. AC_CHECK_LIB(unicows,main,
  5703. [
  5704. AC_DEFINE(wxUSE_UNICODE_MSLU)
  5705. ],
  5706. [
  5707. AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled.
  5708. Applications will only run on Windows NT/2000/XP!])
  5709. wxUSE_UNICODE_MSLU=no
  5710. ])
  5711. fi
  5712. fi
  5713. if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_UTF8" = "yes"; then
  5714. AC_DEFINE(wxUSE_UNICODE_UTF8)
  5715. if test "$wxUSE_UNICODE_UTF8_LOCALE" = "yes"; then
  5716. AC_DEFINE(wxUSE_UTF8_LOCALE_ONLY)
  5717. fi
  5718. fi
  5719. dnl ---------------------------------------------------------------------------
  5720. dnl big GUI components: MDI, doc/view, printing, help, ...
  5721. dnl ---------------------------------------------------------------------------
  5722. if test "$wxUSE_CONSTRAINTS" = "yes"; then
  5723. AC_DEFINE(wxUSE_CONSTRAINTS)
  5724. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
  5725. fi
  5726. if test "$wxUSE_MDI" = "yes"; then
  5727. AC_DEFINE(wxUSE_MDI)
  5728. if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
  5729. AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
  5730. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
  5731. fi
  5732. fi
  5733. if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
  5734. AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
  5735. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
  5736. fi
  5737. if test "$wxUSE_HELP" = "yes"; then
  5738. AC_DEFINE(wxUSE_HELP)
  5739. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
  5740. if test "$wxUSE_MSW" = 1; then
  5741. if test "$wxUSE_MS_HTML_HELP" = "yes"; then
  5742. AC_DEFINE(wxUSE_MS_HTML_HELP)
  5743. fi
  5744. fi
  5745. if test "$wxUSE_WXHTML_HELP" = "yes"; then
  5746. if test "$wxUSE_HTML" = "yes"; then
  5747. AC_DEFINE(wxUSE_WXHTML_HELP)
  5748. else
  5749. AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
  5750. wxUSE_WXHTML_HELP=no
  5751. fi
  5752. fi
  5753. fi
  5754. if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
  5755. AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
  5756. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
  5757. fi
  5758. if test "$wxUSE_POSTSCRIPT" = "yes" ; then
  5759. AC_DEFINE(wxUSE_POSTSCRIPT)
  5760. fi
  5761. AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
  5762. if test "$wxUSE_SVG" = "yes"; then
  5763. AC_DEFINE(wxUSE_SVG)
  5764. fi
  5765. dnl ---------------------------------------------------------------------------
  5766. dnl wxMetafile
  5767. dnl ---------------------------------------------------------------------------
  5768. if test "$wxUSE_METAFILE" = "yes"; then
  5769. if test "$wxUSE_MSW" != 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_PM" != 1; then
  5770. AC_MSG_WARN([wxMetafile is not available on this system... disabled])
  5771. wxUSE_METAFILE=no
  5772. fi
  5773. elif test "$wxUSE_METAFILE" = "auto"; then
  5774. if test "$wxUSE_MSW" = 1 -o "$wxUSE_MAC" = 1 -o "$wxUSE_PM" = 1; then
  5775. wxUSE_METAFILE=yes
  5776. fi
  5777. fi
  5778. if test "$wxUSE_METAFILE" = "yes"; then
  5779. AC_DEFINE(wxUSE_METAFILE)
  5780. if test "$wxUSE_MSW" = 1; then
  5781. dnl this one should probably be made separately configurable
  5782. AC_DEFINE(wxUSE_ENH_METAFILE)
  5783. fi
  5784. fi
  5785. dnl ---------------------------------------------------------------------------
  5786. dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
  5787. dnl ---------------------------------------------------------------------------
  5788. dnl check for ole headers and disable a few features requiring it if not
  5789. dnl present (earlier versions of mingw32 don't have ole2.h)
  5790. if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
  5791. -o "$wxUSE_CLIPBOARD" = "yes" \
  5792. -o "$wxUSE_OLE" = "yes" \
  5793. -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then
  5794. AC_CHECK_HEADER(ole2.h,,, [ ])
  5795. if test "$ac_cv_header_ole2_h" = "yes" ; then
  5796. if test "$GCC" = yes ; then
  5797. AC_MSG_CHECKING([if g++ requires -fvtable-thunks])
  5798. AC_TRY_COMPILE([#include <windows.h>
  5799. #include <ole2.h>],
  5800. [],
  5801. [AC_MSG_RESULT(no)],
  5802. [AC_MSG_RESULT(yes)
  5803. WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"])
  5804. LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
  5805. if test "$wxUSE_OLE" = "yes" ; then
  5806. AC_DEFINE(wxUSE_OLE)
  5807. AC_DEFINE(wxUSE_OLE_AUTOMATION)
  5808. AC_DEFINE(wxUSE_ACTIVEX)
  5809. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS oleauto"
  5810. fi
  5811. fi
  5812. dnl for OLE clipboard and dnd
  5813. if test "$wxUSE_DATAOBJ" = "yes" ; then
  5814. AC_DEFINE(wxUSE_DATAOBJ)
  5815. fi
  5816. else
  5817. AC_MSG_WARN([Some features disabled because OLE headers not found])
  5818. wxUSE_CLIPBOARD=no
  5819. wxUSE_DRAG_AND_DROP=no
  5820. wxUSE_DATAOBJ=no
  5821. wxUSE_OLE=no
  5822. fi
  5823. fi
  5824. if test "$wxUSE_IPC" = "yes"; then
  5825. if test "$wxUSE_SOCKETS" != "yes" -a "$USE_WIN32" != 1; then
  5826. AC_MSG_WARN(wxWidgets IPC classes require sockets... disabled)
  5827. wxUSE_IPC=no
  5828. fi
  5829. if test "$wxUSE_IPC" = "yes"; then
  5830. AC_DEFINE(wxUSE_IPC)
  5831. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
  5832. fi
  5833. fi
  5834. if test "$wxUSE_DATAOBJ" = "yes"; then
  5835. if test "$wxUSE_DFB" = 1; then
  5836. AC_MSG_WARN([wxDataObject not yet supported under $TOOLKIT... disabled])
  5837. wxUSE_DATAOBJ=no
  5838. else
  5839. AC_DEFINE(wxUSE_DATAOBJ)
  5840. fi
  5841. else
  5842. AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled])
  5843. wxUSE_CLIPBOARD=no
  5844. wxUSE_DRAG_AND_DROP=no
  5845. fi
  5846. if test "$wxUSE_CLIPBOARD" = "yes"; then
  5847. if test "$wxUSE_DFB" = 1; then
  5848. AC_MSG_WARN([Clipboard not yet supported under $TOOLKIT... disabled])
  5849. wxUSE_CLIPBOARD=no
  5850. fi
  5851. if test "$wxUSE_CLIPBOARD" = "yes"; then
  5852. AC_DEFINE(wxUSE_CLIPBOARD)
  5853. fi
  5854. fi
  5855. if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
  5856. if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_DFB" = 1; then
  5857. AC_MSG_WARN([Drag and drop not yet supported under $TOOLKIT... disabled])
  5858. wxUSE_DRAG_AND_DROP=no
  5859. fi
  5860. if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
  5861. AC_DEFINE(wxUSE_DRAG_AND_DROP)
  5862. fi
  5863. fi
  5864. if test "$wxUSE_DRAG_AND_DROP" = "yes" -o "$wxUSE_CLIPBOARD" = "yes"; then
  5865. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
  5866. fi
  5867. if test "$wxUSE_CLIPBOARD" = "yes"; then
  5868. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS clipboard"
  5869. fi
  5870. if test "$wxUSE_SPLINES" = "yes" ; then
  5871. AC_DEFINE(wxUSE_SPLINES)
  5872. fi
  5873. if test "$wxUSE_MOUSEWHEEL" = "yes" ; then
  5874. AC_DEFINE(wxUSE_MOUSEWHEEL)
  5875. fi
  5876. if test "$wxUSE_UIACTIONSIMULATOR" = "yes" ; then
  5877. AC_DEFINE(wxUSE_UIACTIONSIMULATOR)
  5878. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS uiaction"
  5879. fi
  5880. if test "$wxUSE_DC_TRANSFORM_MATRIX" = "yes" ; then
  5881. AC_DEFINE(wxUSE_DC_TRANSFORM_MATRIX)
  5882. fi
  5883. dnl ---------------------------------------------------------------------------
  5884. dnl GUI controls
  5885. dnl ---------------------------------------------------------------------------
  5886. USES_CONTROLS=0
  5887. if test "$wxUSE_CONTROLS" = "yes"; then
  5888. USES_CONTROLS=1
  5889. fi
  5890. if test "$wxUSE_MARKUP" = "yes"; then
  5891. AC_DEFINE(wxUSE_MARKUP)
  5892. fi
  5893. if test "$wxUSE_ACCEL" = "yes"; then
  5894. AC_DEFINE(wxUSE_ACCEL)
  5895. USES_CONTROLS=1
  5896. fi
  5897. if test "$wxUSE_ANIMATIONCTRL" = "yes"; then
  5898. AC_DEFINE(wxUSE_ANIMATIONCTRL)
  5899. USES_CONTROLS=1
  5900. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate"
  5901. fi
  5902. if test "$wxUSE_BANNERWINDOW" = "yes"; then
  5903. AC_DEFINE(wxUSE_BANNERWINDOW)
  5904. fi
  5905. if test "$wxUSE_BUTTON" = "yes"; then
  5906. AC_DEFINE(wxUSE_BUTTON)
  5907. USES_CONTROLS=1
  5908. fi
  5909. if test "$wxUSE_BMPBUTTON" = "yes"; then
  5910. AC_DEFINE(wxUSE_BMPBUTTON)
  5911. USES_CONTROLS=1
  5912. fi
  5913. if test "$wxUSE_CALCTRL" = "yes"; then
  5914. AC_DEFINE(wxUSE_CALENDARCTRL)
  5915. USES_CONTROLS=1
  5916. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
  5917. fi
  5918. if test "$wxUSE_CARET" = "yes"; then
  5919. AC_DEFINE(wxUSE_CARET)
  5920. USES_CONTROLS=1
  5921. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
  5922. fi
  5923. if test "$wxUSE_COLLPANE" = "yes"; then
  5924. AC_DEFINE(wxUSE_COLLPANE)
  5925. USES_CONTROLS=1
  5926. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS collpane"
  5927. fi
  5928. if test "$wxUSE_COMBOBOX" = "yes"; then
  5929. AC_DEFINE(wxUSE_COMBOBOX)
  5930. USES_CONTROLS=1
  5931. fi
  5932. if test "$wxUSE_COMBOCTRL" = "yes"; then
  5933. AC_DEFINE(wxUSE_COMBOCTRL)
  5934. USES_CONTROLS=1
  5935. fi
  5936. if test "$wxUSE_COMMANDLINKBUTTON" = "yes"; then
  5937. AC_DEFINE(wxUSE_COMMANDLINKBUTTON)
  5938. USES_CONTROLS=1
  5939. fi
  5940. if test "$wxUSE_CHOICE" = "yes"; then
  5941. AC_DEFINE(wxUSE_CHOICE)
  5942. USES_CONTROLS=1
  5943. fi
  5944. if test "$wxUSE_CHOICEBOOK" = "yes"; then
  5945. AC_DEFINE(wxUSE_CHOICEBOOK)
  5946. USES_CONTROLS=1
  5947. fi
  5948. if test "$wxUSE_CHECKBOX" = "yes"; then
  5949. AC_DEFINE(wxUSE_CHECKBOX)
  5950. USES_CONTROLS=1
  5951. fi
  5952. if test "$wxUSE_CHECKLST" = "yes"; then
  5953. AC_DEFINE(wxUSE_CHECKLISTBOX)
  5954. USES_CONTROLS=1
  5955. fi
  5956. if test "$wxUSE_COLOURPICKERCTRL" = "yes"; then
  5957. AC_DEFINE(wxUSE_COLOURPICKERCTRL)
  5958. USES_CONTROLS=1
  5959. fi
  5960. if test "$wxUSE_DATEPICKCTRL" = "yes"; then
  5961. AC_DEFINE(wxUSE_DATEPICKCTRL)
  5962. USES_CONTROLS=1
  5963. fi
  5964. if test "$wxUSE_DIRPICKERCTRL" = "yes"; then
  5965. AC_DEFINE(wxUSE_DIRPICKERCTRL)
  5966. USES_CONTROLS=1
  5967. fi
  5968. if test "$wxUSE_FILECTRL" = "yes"; then
  5969. AC_DEFINE(wxUSE_FILECTRL)
  5970. USES_CONTROLS=1
  5971. fi
  5972. if test "$wxUSE_FILEPICKERCTRL" = "yes"; then
  5973. AC_DEFINE(wxUSE_FILEPICKERCTRL)
  5974. USES_CONTROLS=1
  5975. fi
  5976. if test "$wxUSE_FONTPICKERCTRL" = "yes"; then
  5977. AC_DEFINE(wxUSE_FONTPICKERCTRL)
  5978. USES_CONTROLS=1
  5979. fi
  5980. if test "$wxUSE_DISPLAY" = "yes"; then
  5981. if test "$wxUSE_DFB" = 1; then
  5982. AC_MSG_WARN([wxDisplay not yet supported under $TOOLKIT... disabled])
  5983. wxUSE_DISPLAY=no
  5984. else
  5985. AC_DEFINE(wxUSE_DISPLAY)
  5986. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display"
  5987. fi
  5988. fi
  5989. if test "$wxUSE_DETECT_SM" = "yes"; then
  5990. AC_DEFINE(wxUSE_DETECT_SM)
  5991. fi
  5992. if test "$wxUSE_GAUGE" = "yes"; then
  5993. AC_DEFINE(wxUSE_GAUGE)
  5994. USES_CONTROLS=1
  5995. fi
  5996. if test "$wxUSE_GRID" = "yes"; then
  5997. AC_DEFINE(wxUSE_GRID)
  5998. USES_CONTROLS=1
  5999. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
  6000. fi
  6001. if test "$wxUSE_HEADERCTRL" = "yes"; then
  6002. AC_DEFINE(wxUSE_HEADERCTRL)
  6003. USES_CONTROLS=1
  6004. fi
  6005. if test "$wxUSE_HYPERLINKCTRL" = "yes"; then
  6006. AC_DEFINE(wxUSE_HYPERLINKCTRL)
  6007. USES_CONTROLS=1
  6008. fi
  6009. if test "$wxUSE_BITMAPCOMBOBOX" = "yes"; then
  6010. AC_DEFINE(wxUSE_BITMAPCOMBOBOX)
  6011. USES_CONTROLS=1
  6012. fi
  6013. if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
  6014. AC_DEFINE(wxUSE_DATAVIEWCTRL)
  6015. USES_CONTROLS=1
  6016. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
  6017. fi
  6018. if test "$wxUSE_IMAGLIST" = "yes"; then
  6019. AC_DEFINE(wxUSE_IMAGLIST)
  6020. fi
  6021. if test "$wxUSE_INFOBAR" = "yes"; then
  6022. AC_DEFINE(wxUSE_INFOBAR)
  6023. fi
  6024. if test "$wxUSE_LISTBOOK" = "yes"; then
  6025. AC_DEFINE(wxUSE_LISTBOOK)
  6026. USES_CONTROLS=1
  6027. fi
  6028. if test "$wxUSE_LISTBOX" = "yes"; then
  6029. AC_DEFINE(wxUSE_LISTBOX)
  6030. USES_CONTROLS=1
  6031. fi
  6032. if test "$wxUSE_LISTCTRL" = "yes"; then
  6033. if test "$wxUSE_IMAGLIST" = "yes"; then
  6034. AC_DEFINE(wxUSE_LISTCTRL)
  6035. USES_CONTROLS=1
  6036. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
  6037. else
  6038. AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
  6039. fi
  6040. fi
  6041. if test "$wxUSE_EDITABLELISTBOX" = "yes"; then
  6042. AC_DEFINE(wxUSE_EDITABLELISTBOX)
  6043. USES_CONTROLS=1
  6044. fi
  6045. if test "$wxUSE_NOTEBOOK" = "yes"; then
  6046. AC_DEFINE(wxUSE_NOTEBOOK)
  6047. USES_CONTROLS=1
  6048. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
  6049. fi
  6050. if test "$wxUSE_NOTIFICATION_MESSAGE" = "yes"; then
  6051. AC_DEFINE(wxUSE_NOTIFICATION_MESSAGE)
  6052. fi
  6053. if test "$wxUSE_ODCOMBOBOX" = "yes"; then
  6054. AC_DEFINE(wxUSE_ODCOMBOBOX)
  6055. USES_CONTROLS=1
  6056. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS combo"
  6057. fi
  6058. if test "$wxUSE_RADIOBOX" = "yes"; then
  6059. AC_DEFINE(wxUSE_RADIOBOX)
  6060. USES_CONTROLS=1
  6061. fi
  6062. if test "$wxUSE_RADIOBTN" = "yes"; then
  6063. AC_DEFINE(wxUSE_RADIOBTN)
  6064. USES_CONTROLS=1
  6065. fi
  6066. if test "$wxUSE_REARRANGECTRL" = "yes"; then
  6067. AC_DEFINE(wxUSE_REARRANGECTRL)
  6068. fi
  6069. if test "$wxUSE_RICHMSGDLG" = "yes"; then
  6070. AC_DEFINE(wxUSE_RICHMSGDLG)
  6071. fi
  6072. if test "$wxUSE_RICHTOOLTIP" = "yes"; then
  6073. AC_DEFINE(wxUSE_RICHTOOLTIP)
  6074. fi
  6075. if test "$wxUSE_SASH" = "yes"; then
  6076. AC_DEFINE(wxUSE_SASH)
  6077. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
  6078. fi
  6079. if test "$wxUSE_SCROLLBAR" = "yes"; then
  6080. AC_DEFINE(wxUSE_SCROLLBAR)
  6081. USES_CONTROLS=1
  6082. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll"
  6083. fi
  6084. if test "$wxUSE_SEARCHCTRL" = "yes"; then
  6085. AC_DEFINE(wxUSE_SEARCHCTRL)
  6086. USES_CONTROLS=1
  6087. fi
  6088. if test "$wxUSE_SLIDER" = "yes"; then
  6089. AC_DEFINE(wxUSE_SLIDER)
  6090. USES_CONTROLS=1
  6091. fi
  6092. if test "$wxUSE_SPINBTN" = "yes"; then
  6093. AC_DEFINE(wxUSE_SPINBTN)
  6094. USES_CONTROLS=1
  6095. fi
  6096. if test "$wxUSE_SPINCTRL" = "yes"; then
  6097. AC_DEFINE(wxUSE_SPINCTRL)
  6098. USES_CONTROLS=1
  6099. fi
  6100. if test "$wxUSE_SPLITTER" = "yes"; then
  6101. AC_DEFINE(wxUSE_SPLITTER)
  6102. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
  6103. fi
  6104. if test "$wxUSE_STATBMP" = "yes"; then
  6105. AC_DEFINE(wxUSE_STATBMP)
  6106. USES_CONTROLS=1
  6107. fi
  6108. if test "$wxUSE_STATBOX" = "yes"; then
  6109. AC_DEFINE(wxUSE_STATBOX)
  6110. USES_CONTROLS=1
  6111. fi
  6112. if test "$wxUSE_STATTEXT" = "yes"; then
  6113. AC_DEFINE(wxUSE_STATTEXT)
  6114. USES_CONTROLS=1
  6115. fi
  6116. if test "$wxUSE_STATLINE" = "yes"; then
  6117. AC_DEFINE(wxUSE_STATLINE)
  6118. USES_CONTROLS=1
  6119. fi
  6120. if test "$wxUSE_STATUSBAR" = "yes"; then
  6121. dnl this will get undefined in wx/chkconf.h if it's not supported
  6122. AC_DEFINE(wxUSE_NATIVE_STATUSBAR)
  6123. AC_DEFINE(wxUSE_STATUSBAR)
  6124. USES_CONTROLS=1
  6125. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
  6126. fi
  6127. if test "$wxUSE_TEXTCTRL" = "yes"; then
  6128. AC_DEFINE(wxUSE_TEXTCTRL)
  6129. USES_CONTROLS=1
  6130. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
  6131. dnl we don't have special switches to disable wxUSE_RICHEDIT[2], it doesn't
  6132. dnl seem useful to allow disabling them
  6133. AC_DEFINE(wxUSE_RICHEDIT)
  6134. AC_DEFINE(wxUSE_RICHEDIT2)
  6135. fi
  6136. if test "$wxUSE_TIMEPICKCTRL" = "yes"; then
  6137. AC_DEFINE(wxUSE_TIMEPICKCTRL)
  6138. USES_CONTROLS=1
  6139. fi
  6140. if test "$wxUSE_TOGGLEBTN" = "yes"; then
  6141. if test "$wxUSE_OLD_COCOA" = 1 ; then
  6142. AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled])
  6143. wxUSE_TOGGLEBTN=no
  6144. fi
  6145. if test "$wxUSE_TOGGLEBTN" = "yes"; then
  6146. AC_DEFINE(wxUSE_TOGGLEBTN)
  6147. USES_CONTROLS=1
  6148. fi
  6149. fi
  6150. if test "$wxUSE_TOOLBAR" = "yes"; then
  6151. AC_DEFINE(wxUSE_TOOLBAR)
  6152. USES_CONTROLS=1
  6153. if test "$wxUSE_UNIVERSAL" = "yes"; then
  6154. wxUSE_TOOLBAR_NATIVE="no"
  6155. else
  6156. wxUSE_TOOLBAR_NATIVE="yes"
  6157. AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
  6158. fi
  6159. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
  6160. fi
  6161. if test "$wxUSE_TOOLTIPS" = "yes"; then
  6162. if test "$wxUSE_MOTIF" = 1; then
  6163. AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled])
  6164. else
  6165. if test "$wxUSE_UNIVERSAL" = "yes"; then
  6166. AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
  6167. else
  6168. AC_DEFINE(wxUSE_TOOLTIPS)
  6169. fi
  6170. fi
  6171. fi
  6172. if test "$wxUSE_TREEBOOK" = "yes"; then
  6173. AC_DEFINE(wxUSE_TREEBOOK)
  6174. USES_CONTROLS=1
  6175. fi
  6176. if test "$wxUSE_TOOLBOOK" = "yes"; then
  6177. AC_DEFINE(wxUSE_TOOLBOOK)
  6178. USES_CONTROLS=1
  6179. fi
  6180. if test "$wxUSE_TREECTRL" = "yes"; then
  6181. if test "$wxUSE_IMAGLIST" = "yes"; then
  6182. AC_DEFINE(wxUSE_TREECTRL)
  6183. USES_CONTROLS=1
  6184. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
  6185. else
  6186. AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
  6187. fi
  6188. fi
  6189. if test "$wxUSE_TREELISTCTRL" = "yes"; then
  6190. AC_DEFINE(wxUSE_TREELISTCTRL)
  6191. USES_CONTROLS=1
  6192. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treelist"
  6193. fi
  6194. if test "$wxUSE_POPUPWIN" = "yes"; then
  6195. if test "$wxUSE_OLD_COCOA" = 1 ; then
  6196. AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
  6197. else
  6198. if test "$wxUSE_PM" = 1; then
  6199. AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
  6200. else
  6201. AC_DEFINE(wxUSE_POPUPWIN)
  6202. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
  6203. USES_CONTROLS=1
  6204. fi
  6205. fi
  6206. fi
  6207. if test "$wxUSE_PREFERENCES_EDITOR" = "yes"; then
  6208. AC_DEFINE(wxUSE_PREFERENCES_EDITOR)
  6209. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS prefseditor"
  6210. fi
  6211. if test "$wxUSE_DIALUP_MANAGER" = "yes"; then
  6212. if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
  6213. AC_MSG_WARN([Dialup manager not supported on this platform... disabled])
  6214. else
  6215. AC_DEFINE(wxUSE_DIALUP_MANAGER)
  6216. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
  6217. fi
  6218. fi
  6219. if test "$wxUSE_TIPWINDOW" = "yes"; then
  6220. if test "$wxUSE_PM" = 1; then
  6221. AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled])
  6222. else
  6223. AC_DEFINE(wxUSE_TIPWINDOW)
  6224. fi
  6225. fi
  6226. if test "$USES_CONTROLS" = 1; then
  6227. AC_DEFINE(wxUSE_CONTROLS)
  6228. fi
  6229. dnl ---------------------------------------------------------------------------
  6230. dnl misc options
  6231. dnl ---------------------------------------------------------------------------
  6232. dnl please keep the settings below in alphabetical order
  6233. if test "$wxUSE_ACCESSIBILITY" = "yes"; then
  6234. AC_DEFINE(wxUSE_ACCESSIBILITY)
  6235. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access"
  6236. fi
  6237. if test "$wxUSE_ARTPROVIDER_STD" = "yes"; then
  6238. AC_DEFINE(wxUSE_ARTPROVIDER_STD)
  6239. fi
  6240. if test "$wxUSE_ARTPROVIDER_TANGO" = "auto"; then
  6241. dnl Tango-based art provider is not needed in GTK-based ports as the
  6242. dnl native art provider completely replaces it.
  6243. if test "$wxUSE_GTK" != 1; then
  6244. dnl It also requires support for memory-mapped PNG images.
  6245. if test "$wxUSE_LIBPNG" != no -a \
  6246. "$wxUSE_IMAGE" = yes -a \
  6247. "$wxUSE_STREAMS" = yes; then
  6248. wxUSE_ARTPROVIDER_TANGO="yes"
  6249. fi
  6250. fi
  6251. fi
  6252. if test "$wxUSE_ARTPROVIDER_TANGO" = "yes"; then
  6253. AC_DEFINE(wxUSE_ARTPROVIDER_TANGO)
  6254. fi
  6255. if test "$wxUSE_DRAGIMAGE" = "yes"; then
  6256. AC_DEFINE(wxUSE_DRAGIMAGE)
  6257. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
  6258. fi
  6259. if test "$wxUSE_EXCEPTIONS" = "yes"; then
  6260. if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
  6261. AC_MSG_WARN([--enable-exceptions can't be used with --enable-no_exceptions])
  6262. else
  6263. AC_DEFINE(wxUSE_EXCEPTIONS)
  6264. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS except"
  6265. fi
  6266. fi
  6267. USE_HTML=0
  6268. if test "$wxUSE_HTML" = "yes"; then
  6269. AC_DEFINE(wxUSE_HTML)
  6270. USE_HTML=1
  6271. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox"
  6272. fi
  6273. if test "$wxUSE_WEBKIT" = "yes"; then
  6274. if test "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then
  6275. old_CPPFLAGS="$CPPFLAGS"
  6276. CPPFLAGS="-x objective-c++ $CPPFLAGS"
  6277. AC_CHECK_HEADER([WebKit/HIWebView.h],
  6278. [
  6279. AC_DEFINE(wxUSE_WEBKIT)
  6280. WEBKIT_LINK="-framework WebKit"
  6281. ],
  6282. [
  6283. AC_MSG_WARN([WebKit headers not found; disabling wxWebKit])
  6284. wxUSE_WEBKIT=no
  6285. ],
  6286. [
  6287. #include <Carbon/Carbon.h>
  6288. #include <WebKit/WebKit.h>
  6289. ])
  6290. CPPFLAGS="$old_CPPFLAGS"
  6291. elif test "$wxUSE_OLD_COCOA" = 1; then
  6292. AC_DEFINE(wxUSE_WEBKIT)
  6293. else
  6294. wxUSE_WEBKIT=no
  6295. fi
  6296. if test "$wxUSE_WEBKIT" = "yes"; then
  6297. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/htmlctrl"
  6298. fi
  6299. fi
  6300. USE_XRC=0
  6301. if test "$wxUSE_XRC" = "yes"; then
  6302. if test "$wxUSE_XML" != "yes"; then
  6303. AC_MSG_WARN([XML library not built, XRC resources disabled])
  6304. wxUSE_XRC=no
  6305. else
  6306. AC_DEFINE(wxUSE_XRC)
  6307. USE_XRC=1
  6308. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS xrc"
  6309. echo "${HOST_PREFIX}install_name_tool \${changes} \${2}/wxrc-${WX_RELEASE}" >> change-install-names
  6310. fi
  6311. fi
  6312. USE_AUI=0
  6313. if test "$wxUSE_AUI" = "yes"; then
  6314. AC_DEFINE(wxUSE_AUI)
  6315. USE_AUI=1
  6316. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS aui"
  6317. fi
  6318. USE_PROPGRID=0
  6319. if test "$wxUSE_PROPGRID" = "yes"; then
  6320. AC_DEFINE(wxUSE_PROPGRID)
  6321. USE_PROPGRID=1
  6322. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS propgrid"
  6323. fi
  6324. USE_RIBBON=0
  6325. if test "$wxUSE_RIBBON" = "yes"; then
  6326. AC_DEFINE(wxUSE_RIBBON)
  6327. USE_RIBBON=1
  6328. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ribbon"
  6329. fi
  6330. USE_STC=0
  6331. if test "$wxUSE_STC" = "yes"; then
  6332. AC_DEFINE(wxUSE_STC)
  6333. USE_STC=1
  6334. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS stc"
  6335. dnl python is used to update src/stc.h (see build/bakefiles/scintilla.bkl)
  6336. AC_PATH_PROG(PYTHON, python)
  6337. if test "x$PYTHON" = "x"; then
  6338. COND_PYTHON="#"
  6339. fi
  6340. AC_SUBST(COND_PYTHON)
  6341. fi
  6342. if test "$wxUSE_MENUS" = "yes"; then
  6343. AC_DEFINE(wxUSE_MENUS)
  6344. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
  6345. fi
  6346. if test "$wxUSE_MIMETYPE" = "yes"; then
  6347. AC_DEFINE(wxUSE_MIMETYPE)
  6348. fi
  6349. if test "$wxUSE_MINIFRAME" = "yes"; then
  6350. AC_DEFINE(wxUSE_MINIFRAME)
  6351. fi
  6352. if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
  6353. AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
  6354. fi
  6355. if test "$wxUSE_TASKBARICON" = "yes"; then
  6356. AC_DEFINE(wxUSE_TASKBARICON)
  6357. dnl This is used under MSW, just enable it always without testing for the
  6358. dnl toolkit nor providing a separate option for it because it's totally
  6359. dnl harmless to have it defined even if it's unnecessary.
  6360. AC_DEFINE(wxUSE_TASKBARICON_BALLOONS)
  6361. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
  6362. fi
  6363. if test "$wxUSE_VALIDATORS" = "yes"; then
  6364. AC_DEFINE(wxUSE_VALIDATORS)
  6365. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
  6366. fi
  6367. if test "$wxUSE_PALETTE" = "yes" ; then
  6368. if test "$wxUSE_DFB" = 1; then
  6369. AC_MSG_WARN([wxPalette not yet supported under DFB... disabled])
  6370. wxUSE_PALETTE=no
  6371. else
  6372. AC_DEFINE(wxUSE_PALETTE)
  6373. fi
  6374. fi
  6375. if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then
  6376. dnl Must be done this late because -lunicows must be before all the other libs
  6377. LIBS=" -lunicows $LIBS"
  6378. fi
  6379. USE_RICHTEXT=0
  6380. if test "$wxUSE_RICHTEXT" = "yes"; then
  6381. AC_DEFINE(wxUSE_RICHTEXT)
  6382. USE_RICHTEXT=1
  6383. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS richtext"
  6384. fi
  6385. if test "$wxUSE_WEBVIEW" = "yes"; then
  6386. USE_WEBVIEW_WEBKIT=0
  6387. if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then
  6388. if test "$wxUSE_GTK" = 1; then
  6389. webkitgtk=webkit-1.0
  6390. if test "$WXGTK3" = 1; then
  6391. webkitgtk=webkitgtk-3.0
  6392. fi
  6393. PKG_CHECK_MODULES([WEBKIT],
  6394. [$webkitgtk >= 1.3.1],
  6395. [
  6396. USE_WEBVIEW_WEBKIT=1
  6397. CPPFLAGS="$CPPFLAGS $WEBKIT_CFLAGS"
  6398. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $WEBKIT_LIBS"
  6399. ],
  6400. [
  6401. AC_MSG_WARN([webkitgtk not found.])
  6402. ])
  6403. elif test "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then
  6404. dnl Under Mac we always have the libraries but check for the
  6405. dnl headers
  6406. old_CPPFLAGS="$CPPFLAGS"
  6407. CPPFLAGS="-x objective-c++ $CPPFLAGS"
  6408. AC_CHECK_HEADER([WebKit/HIWebView.h],
  6409. [
  6410. USE_WEBVIEW_WEBKIT=1
  6411. WEBKIT_LINK="-framework WebKit"
  6412. ],
  6413. [
  6414. AC_MSG_WARN([WebKit headers not found])
  6415. ],
  6416. [
  6417. #include <Carbon/Carbon.h>
  6418. #include <WebKit/WebKit.h>
  6419. ])
  6420. CPPFLAGS="$old_CPPFLAGS"
  6421. fi
  6422. fi
  6423. wxUSE_WEBVIEW="no"
  6424. if test "$wxUSE_GTK" = 1 -o "$wxUSE_MAC" = 1; then
  6425. if test "$USE_WEBVIEW_WEBKIT" = 1; then
  6426. wxUSE_WEBVIEW="yes"
  6427. AC_DEFINE(wxUSE_WEBVIEW_WEBKIT)
  6428. else
  6429. AC_MSG_WARN([WebKit not available, disabling wxWebView])
  6430. fi
  6431. elif test "$wxUSE_MSW" = 1; then
  6432. if test "$wxUSE_WEBVIEW_IE" = "yes"; then
  6433. dnl TODO: Check for the required headers/libraries under Windows
  6434. dnl too and do the right thing automatically there too.
  6435. wxUSE_WEBVIEW="yes"
  6436. AC_DEFINE(wxUSE_WEBVIEW_IE)
  6437. fi
  6438. fi
  6439. fi
  6440. if test "$wxUSE_WEBVIEW" = "yes"; then
  6441. USE_WEBVIEW=1
  6442. AC_DEFINE(wxUSE_WEBVIEW)
  6443. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS webview"
  6444. else
  6445. USE_WEBVIEW=0
  6446. fi
  6447. dnl ---------------------------------------------------------------------------
  6448. dnl wxImage options
  6449. dnl ---------------------------------------------------------------------------
  6450. if test "$wxUSE_IMAGE" = "yes" ; then
  6451. AC_DEFINE(wxUSE_IMAGE)
  6452. if test "$wxUSE_GIF" = "yes" ; then
  6453. AC_DEFINE(wxUSE_GIF)
  6454. fi
  6455. if test "$wxUSE_PCX" = "yes" ; then
  6456. AC_DEFINE(wxUSE_PCX)
  6457. fi
  6458. if test "$wxUSE_TGA" = "yes" ; then
  6459. AC_DEFINE(wxUSE_TGA)
  6460. fi
  6461. if test "$wxUSE_IFF" = "yes" ; then
  6462. AC_DEFINE(wxUSE_IFF)
  6463. fi
  6464. if test "$wxUSE_PNM" = "yes" ; then
  6465. AC_DEFINE(wxUSE_PNM)
  6466. fi
  6467. if test "$wxUSE_XPM" = "yes" ; then
  6468. AC_DEFINE(wxUSE_XPM)
  6469. fi
  6470. if test "$wxUSE_ICO_CUR" = "yes" ; then
  6471. AC_DEFINE(wxUSE_ICO_CUR)
  6472. fi
  6473. fi
  6474. dnl ---------------------------------------------------------------------------
  6475. dnl common dialogs
  6476. dnl ---------------------------------------------------------------------------
  6477. if test "$wxUSE_ABOUTDLG" = "yes"; then
  6478. AC_DEFINE(wxUSE_ABOUTDLG)
  6479. fi
  6480. if test "$wxUSE_CHOICEDLG" = "yes"; then
  6481. AC_DEFINE(wxUSE_CHOICEDLG)
  6482. fi
  6483. if test "$wxUSE_COLOURDLG" = "yes"; then
  6484. AC_DEFINE(wxUSE_COLOURDLG)
  6485. fi
  6486. if test "$wxUSE_FILEDLG" = "yes"; then
  6487. AC_DEFINE(wxUSE_FILEDLG)
  6488. fi
  6489. if test "$wxUSE_FINDREPLDLG" = "yes"; then
  6490. AC_DEFINE(wxUSE_FINDREPLDLG)
  6491. fi
  6492. if test "$wxUSE_FONTDLG" = "yes"; then
  6493. AC_DEFINE(wxUSE_FONTDLG)
  6494. fi
  6495. if test "$wxUSE_DIRDLG" = "yes"; then
  6496. if test "$wxUSE_TREECTRL" != "yes"; then
  6497. AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
  6498. else
  6499. AC_DEFINE(wxUSE_DIRDLG)
  6500. fi
  6501. fi
  6502. if test "$wxUSE_MSGDLG" = "yes"; then
  6503. AC_DEFINE(wxUSE_MSGDLG)
  6504. fi
  6505. if test "$wxUSE_NUMBERDLG" = "yes"; then
  6506. AC_DEFINE(wxUSE_NUMBERDLG)
  6507. fi
  6508. if test "$wxUSE_PROGRESSDLG" = "yes"; then
  6509. AC_DEFINE(wxUSE_PROGRESSDLG)
  6510. fi
  6511. if test "$wxUSE_SPLASH" = "yes"; then
  6512. AC_DEFINE(wxUSE_SPLASH)
  6513. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splash"
  6514. fi
  6515. if test "$wxUSE_STARTUP_TIPS" = "yes"; then
  6516. AC_DEFINE(wxUSE_STARTUP_TIPS)
  6517. fi
  6518. if test "$wxUSE_TEXTDLG" = "yes"; then
  6519. AC_DEFINE(wxUSE_TEXTDLG)
  6520. fi
  6521. if test "$wxUSE_WIZARDDLG" = "yes"; then
  6522. AC_DEFINE(wxUSE_WIZARDDLG)
  6523. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
  6524. fi
  6525. dnl ---------------------------------------------------------------------------
  6526. dnl options used under wxMSW and wxPM
  6527. dnl ---------------------------------------------------------------------------
  6528. if test "$wxUSE_MSW" = 1 -o "$wxUSE_PM" = 1; then
  6529. if test "$wxUSE_OWNER_DRAWN" = "yes"; then
  6530. AC_DEFINE(wxUSE_OWNER_DRAWN)
  6531. fi
  6532. fi
  6533. dnl ---------------------------------------------------------------------------
  6534. dnl wxMSW-only options
  6535. dnl ---------------------------------------------------------------------------
  6536. if test "$wxUSE_MSW" = 1 ; then
  6537. if test "$wxUSE_DC_CACHEING" = "yes"; then
  6538. AC_DEFINE(wxUSE_DC_CACHEING)
  6539. fi
  6540. if test "$wxUSE_DIB" = "yes"; then
  6541. AC_DEFINE(wxUSE_WXDIB)
  6542. fi
  6543. if test "$wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW" = "yes"; then
  6544. AC_DEFINE(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
  6545. fi
  6546. if test "$wxUSE_UXTHEME" = "yes"; then
  6547. AC_DEFINE(wxUSE_UXTHEME)
  6548. fi
  6549. fi
  6550. dnl wxUSE_MSW = 1
  6551. dnl not quite MSW-only although mostly useful to disable this under MSW
  6552. if test "$wxUSE_AUTOID_MANAGEMENT" = "yes"; then
  6553. AC_DEFINE(wxUSE_AUTOID_MANAGEMENT)
  6554. fi
  6555. if test "$USE_WIN32" = 1 ; then
  6556. if test "$wxUSE_INICONF" = "yes"; then
  6557. AC_DEFINE(wxUSE_INICONF)
  6558. fi
  6559. if test "$wxUSE_REGKEY" = "yes"; then
  6560. AC_DEFINE(wxUSE_REGKEY)
  6561. fi
  6562. fi
  6563. dnl USE_WIN32 = 1
  6564. dnl ---------------------------------------------------------------------------
  6565. dnl wxGraphicsContext
  6566. dnl ---------------------------------------------------------------------------
  6567. dnl Under Mac we don't even provide --enable-graphics_ctx switch as we always
  6568. dnl need it -- but because we don't have the option, wxUSE_GRAPHICS_CONTEXT is
  6569. dnl not defined automatically and we need to do it ourselves
  6570. if test "$wxUSE_MAC" = 1; then
  6571. wxUSE_GRAPHICS_CONTEXT="yes"
  6572. fi
  6573. if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then
  6574. wx_has_graphics=0
  6575. if test "$wxUSE_MSW" = 1; then
  6576. AC_CACHE_CHECK([if GDI+ is available], wx_cv_lib_gdiplus,
  6577. [
  6578. dnl we need just the header, not the library, as we load the
  6579. dnl GDI+ DLL dynamically anyhow during run-time
  6580. AC_LANG_PUSH(C++)
  6581. AC_TRY_COMPILE(
  6582. [#include <windows.h>
  6583. #include <gdiplus.h>],
  6584. [
  6585. using namespace Gdiplus;
  6586. ],
  6587. wx_cv_lib_gdiplus=yes,
  6588. wx_cv_lib_gdiplus=no
  6589. )
  6590. AC_LANG_POP()
  6591. ]
  6592. )
  6593. if test "$wx_cv_lib_gdiplus" = "yes"; then
  6594. wx_has_graphics=1
  6595. fi
  6596. elif test "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
  6597. PKG_CHECK_MODULES(CAIRO, cairo,
  6598. [wx_has_graphics=1],
  6599. [AC_MSG_WARN([Cairo library not found])]
  6600. )
  6601. if test "$wx_has_graphics" = 1; then
  6602. dnl Check that Cairo library is new enough: wxGraphicsContext
  6603. dnl won't compile without cairo_push_group() and
  6604. dnl cairo_pop_group_to_source() which are new in 1.2.
  6605. save_LIBS="$LIBS"
  6606. LIBS="$LIBS $CAIRO_LIBS"
  6607. AC_CHECK_FUNCS([cairo_push_group])
  6608. LIBS="$save_LIBS"
  6609. if test "$ac_cv_func_cairo_push_group" = "no"; then
  6610. wx_has_graphics=0
  6611. AC_MSG_WARN([Cairo library is too old and misses cairo_push_group()])
  6612. else
  6613. AC_DEFINE(wxUSE_CAIRO)
  6614. dnl We don't need to do this for wxGTK as we already get Cairo
  6615. dnl flags as part of GTK+ ones.
  6616. if test "$wxUSE_GTK" != 1; then
  6617. CPPFLAGS="$CAIRO_CFLAGS $CPPFLAGS"
  6618. GUI_TK_LIBRARY="$GUI_TK_LIBRARY $CAIRO_LIBS"
  6619. fi
  6620. fi
  6621. fi
  6622. else
  6623. dnl assume it's ok, add more checks here if needed
  6624. wx_has_graphics=1
  6625. fi
  6626. if test "$wx_has_graphics" = 1; then
  6627. AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)
  6628. else
  6629. AC_MSG_WARN([wxGraphicsContext won't be available])
  6630. fi
  6631. fi
  6632. dnl ---------------------------------------------------------------------------
  6633. dnl wxMediaCtrl
  6634. dnl ---------------------------------------------------------------------------
  6635. USE_MEDIA=0
  6636. if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then
  6637. USE_MEDIA=1
  6638. dnl -----------------------------------------------------------------------
  6639. dnl GStreamer
  6640. dnl -----------------------------------------------------------------------
  6641. if test "$wxUSE_GTK" = 1; then
  6642. wxUSE_GSTREAMER="no"
  6643. dnl -------------------------------------------------------------------
  6644. dnl Test for at least 0.8 gstreamer module from pkg-config
  6645. dnl Even totem doesn't accept 0.9 evidently.
  6646. dnl
  6647. dnl So, we first check to see if 0.10 if available - if not we
  6648. dnl try the older 0.8 version
  6649. dnl -------------------------------------------------------------------
  6650. GST_VERSION_MAJOR=0
  6651. GST_VERSION_MINOR=10
  6652. GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
  6653. if test "$wxUSE_GSTREAMER8" = "no"; then
  6654. PKG_CHECK_MODULES(GST,
  6655. [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION],
  6656. [
  6657. wxUSE_GSTREAMER="yes"
  6658. GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
  6659. ],
  6660. [
  6661. AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
  6662. GST_VERSION_MINOR=8
  6663. ]
  6664. )
  6665. else
  6666. dnl check only for 0.8
  6667. GST_VERSION_MINOR=8
  6668. fi
  6669. if test $GST_VERSION_MINOR = "8"; then
  6670. GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
  6671. PKG_CHECK_MODULES(GST,
  6672. [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
  6673. wxUSE_GSTREAMER="yes",
  6674. [
  6675. AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
  6676. ])
  6677. fi
  6678. if test "$wxUSE_GSTREAMER" = "yes"; then
  6679. CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
  6680. EXTRALIBS_MEDIA="$GST_LIBS"
  6681. AC_DEFINE(wxUSE_GSTREAMER)
  6682. else
  6683. USE_MEDIA=0
  6684. fi
  6685. elif test "$wxUSE_MAC" = 1; then
  6686. dnl We always have the necessary libraries under Mac
  6687. dnl but we need to link with it explicitly.
  6688. GST_LIBS="-framework QTKit"
  6689. fi
  6690. if test $USE_MEDIA = 1; then
  6691. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
  6692. AC_DEFINE(wxUSE_MEDIACTRL)
  6693. else
  6694. if test "$wxUSE_MEDIACTRL" = "yes"; then
  6695. AC_MSG_ERROR([GStreamer not available])
  6696. else
  6697. dnl was set to 'auto'
  6698. AC_MSG_WARN([GStreamer not available... disabling wxMediaCtrl])
  6699. fi
  6700. fi
  6701. fi
  6702. dnl ---------------------------------------------------------------------------
  6703. dnl get the string with OS info - used by wxGetOsDescription() on MacOS X
  6704. dnl ---------------------------------------------------------------------------
  6705. if test "$cross_compiling" != "no"; then
  6706. dnl Use best guess from host as we can't use uname when cross compiling
  6707. OSINFO="\"$host\""
  6708. else
  6709. dnl attualy work out OS version
  6710. OSINFO=`uname -s -r -m`
  6711. OSINFO="\"$OSINFO\""
  6712. fi
  6713. AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
  6714. dnl ---------------------------------------------------------------------------
  6715. dnl define the variable containing the installation prefix (used in dcpsg.cpp)
  6716. dnl ---------------------------------------------------------------------------
  6717. if test "x$prefix" != "xNONE"; then
  6718. wxPREFIX=$prefix
  6719. else
  6720. wxPREFIX=$ac_default_prefix
  6721. fi
  6722. AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
  6723. dnl ---------------------------------------------------------------------------
  6724. dnl define variables with all built libraries for wx-config
  6725. dnl ---------------------------------------------------------------------------
  6726. STD_BASE_LIBS="base"
  6727. STD_GUI_LIBS=""
  6728. BUILT_WX_LIBS="base"
  6729. ALL_WX_LIBS="xrc stc gl media qa html adv core xml net base"
  6730. if test "$wxUSE_SOCKETS" = "yes" ; then
  6731. STD_BASE_LIBS="net $STD_BASE_LIBS"
  6732. BUILT_WX_LIBS="net $BUILT_WX_LIBS"
  6733. fi
  6734. if test "$wxUSE_XML" = "yes" ; then
  6735. STD_BASE_LIBS="xml $STD_BASE_LIBS"
  6736. BUILT_WX_LIBS="xml $BUILT_WX_LIBS"
  6737. fi
  6738. if test "$wxUSE_GUI" = "yes"; then
  6739. STD_GUI_LIBS="adv core"
  6740. BUILT_WX_LIBS="$STD_GUI_LIBS $BUILT_WX_LIBS"
  6741. if test "$wxUSE_DEBUGREPORT" = "yes" ; then
  6742. STD_GUI_LIBS="qa $STD_GUI_LIBS"
  6743. BUILT_WX_LIBS="qa $BUILT_WX_LIBS"
  6744. fi
  6745. if test "$wxUSE_HTML" = "yes" ; then
  6746. STD_GUI_LIBS="html $STD_GUI_LIBS"
  6747. BUILT_WX_LIBS="html $BUILT_WX_LIBS"
  6748. fi
  6749. if test "$wxUSE_MEDIACTRL" = "yes" ; then
  6750. BUILT_WX_LIBS="media $BUILT_WX_LIBS"
  6751. fi
  6752. if test "$wxUSE_OPENGL" = "yes" ; then
  6753. BUILT_WX_LIBS="gl $BUILT_WX_LIBS"
  6754. fi
  6755. if test "$wxUSE_AUI" = "yes" ; then
  6756. BUILT_WX_LIBS="aui $BUILT_WX_LIBS"
  6757. fi
  6758. if test "$wxUSE_PROPGRID" = "yes" ; then
  6759. BUILT_WX_LIBS="propgrid $BUILT_WX_LIBS"
  6760. fi
  6761. if test "$wxUSE_RIBBON" = "yes" ; then
  6762. BUILT_WX_LIBS="ribbon $BUILT_WX_LIBS"
  6763. fi
  6764. if test "$wxUSE_RICHTEXT" = "yes" ; then
  6765. BUILT_WX_LIBS="richtext $BUILT_WX_LIBS"
  6766. fi
  6767. if test "$wxUSE_STC" = "yes" ; then
  6768. BUILT_WX_LIBS="stc $BUILT_WX_LIBS"
  6769. fi
  6770. if test "$wxUSE_WEBVIEW" = "yes" ; then
  6771. STD_GUI_LIBS="webview $STD_GUI_LIBS"
  6772. BUILT_WX_LIBS="webview $BUILT_WX_LIBS"
  6773. fi
  6774. if test "$wxUSE_XRC" = "yes" ; then
  6775. STD_GUI_LIBS="xrc $STD_GUI_LIBS"
  6776. BUILT_WX_LIBS="xrc $BUILT_WX_LIBS"
  6777. fi
  6778. fi
  6779. AC_SUBST(ALL_WX_LIBS)
  6780. AC_SUBST(BUILT_WX_LIBS)
  6781. AC_SUBST(STD_BASE_LIBS)
  6782. AC_SUBST(STD_GUI_LIBS)
  6783. dnl ---------------------------------------------------------------------------
  6784. dnl Output the makefiles and such from the results found above
  6785. dnl ---------------------------------------------------------------------------
  6786. dnl all additional libraries (except wxWidgets itself) we link with
  6787. EXTRA_FRAMEWORKS=
  6788. if test "$wxUSE_MAC" = 1 ; then
  6789. if test "$USE_DARWIN" = 1; then
  6790. if test "$wxUSE_OSX_IPHONE" = 1; then
  6791. EXTRA_FRAMEWORKS="-framework IOKit -framework UIKit -framework CFNetwork -framework AudioToolbox -framework CoreFoundation -framework CoreGraphics -framework OpenGLES -framework Foundation -framework QuartzCore"
  6792. else
  6793. EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL"
  6794. dnl The case of QuickTime framework is special: we only need it in
  6795. dnl 32 bit builds and not in 64 bit and, moreover, linking with it
  6796. dnl in 64 bit builds results in a warning because the framework is
  6797. dnl not available in 64 bits itself. So make an effort to avoid it
  6798. dnl when building for 64 bits only (i.e. not universal build).
  6799. if test "$cross_compiling" != "no"; then
  6800. dnl The check below doesn't work well when cross-compiling
  6801. dnl ("file" under non-OS X systems might not recognize
  6802. dnl universal binaries) so assume we do build for 32 bits as
  6803. dnl it's safer: at worst we'll get a warning when building in
  6804. dnl 64 bits only, but at least the build will still work.
  6805. wx_cv_target_x86_64=no
  6806. else
  6807. AC_CACHE_CHECK(
  6808. [if we target only x86_64],
  6809. wx_cv_target_x86_64,
  6810. AC_LINK_IFELSE(
  6811. [AC_LANG_SOURCE([int main() { return 0; }])],
  6812. if file conftest$ac_exeext|grep -q 'i386\|ppc'; then
  6813. wx_cv_target_x86_64=no
  6814. else
  6815. wx_cv_target_x86_64=yes
  6816. fi
  6817. )
  6818. )
  6819. fi
  6820. if test "$wx_cv_target_x86_64" != "yes"; then
  6821. EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime"
  6822. fi
  6823. fi
  6824. fi
  6825. fi
  6826. if test "$wxUSE_OLD_COCOA" = 1 ; then
  6827. EXTRA_FRAMEWORKS="-framework IOKit -framework Cocoa"
  6828. if test "$wxUSE_MEDIACTRL" = "yes"; then
  6829. EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime"
  6830. fi
  6831. fi
  6832. if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_OLD_COCOA" != 1 ; then
  6833. EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices"
  6834. fi
  6835. LDFLAGS="$LDFLAGS $EXTRA_FRAMEWORKS"
  6836. WXCONFIG_LDFLAGS="$WXCONFIG_LDFLAGS $EXTRA_FRAMEWORKS"
  6837. LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
  6838. if test "$wxUSE_GUI" = "yes"; then
  6839. dnl TODO add checks that these samples will really compile (i.e. all the
  6840. dnl library features they need are present)
  6841. dnl TODO some samples are never built so far: mfc (requires VC++)
  6842. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \
  6843. erase event exec font image minimal render \
  6844. shaped svg taborder vscroll widgets wrapsizer"
  6845. if test "$wxUSE_MONOLITHIC" != "yes"; then
  6846. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
  6847. fi
  6848. if test "$TOOLKIT" = "MSW"; then
  6849. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS regtest"
  6850. if test "$wxUSE_UNIVERSAL" != "yes"; then
  6851. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw nativdlg dll"
  6852. fi
  6853. fi
  6854. if test "$TOOLKIT" = "PM" -a "$wxUSE_UNIVERSAL" != "yes"; then
  6855. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw"
  6856. fi
  6857. else
  6858. SAMPLES_SUBDIRS="console"
  6859. if test "$wxUSE_SOCKETS" = "yes" ; then
  6860. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
  6861. fi
  6862. if test "$wxUSE_IPC" = "yes" ; then
  6863. SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc"
  6864. fi
  6865. fi
  6866. dnl C/C++ compiler options used to compile wxWidgets
  6867. dnl
  6868. dnl check for icc before gcc as icc is also recognized as gcc
  6869. if test "x$INTELCC" = "xyes" ; then
  6870. dnl Warnings which can't be easily suppressed in C code are disabled:
  6871. dnl
  6872. dnl #810: conversion from "x" to "y" may lose significant bits
  6873. dnl #869: parameter "foo" was never referenced
  6874. dnl #1572: floating-point equality and inequality comparisons
  6875. dnl are unreliable
  6876. dnl #1684: conversion from pointer to same-sized integral type
  6877. dnl #2259: non-pointer conversion from "x" to "y" may lose significant
  6878. dnl bits
  6879. CWARNINGS="-Wall -wd810,869,981,1418,1572,1684,2259"
  6880. elif test "$GCC" = yes ; then
  6881. CWARNINGS="-Wall -Wundef"
  6882. fi
  6883. if test "x$INTELCXX" = "xyes" ; then
  6884. dnl Intel compiler gives some warnings which simply can't be worked
  6885. dnl around or of which we have too many (810, 869) so it's impractical to
  6886. dnl keep them enabled even if in theory it would be nice and some others
  6887. dnl (279) are generated for standard macros and so there is nothing we can
  6888. dnl do about them
  6889. dnl
  6890. dnl #279: controlling expression is constant
  6891. dnl #383: value copied to temporary, reference to temporary used
  6892. dnl #444: destructor for base class "xxx" is not virtual
  6893. dnl #981: operands are evaluated in unspecified order
  6894. dnl #1418: external definition with no prior declaration
  6895. dnl #1419: external declaration in primary source file
  6896. dnl #1881: argument must be a constant null pointer value
  6897. dnl
  6898. dnl (for others see CWARNINGS above)
  6899. CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419,1881,2259"
  6900. elif test "$GXX" = yes ; then
  6901. CXXWARNINGS="-Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy"
  6902. AX_CXXFLAGS_GCC_OPTION(-Woverloaded-virtual, CXXWARNINGS)
  6903. dnl when building under Mac we currently get hundreds of deprecation
  6904. dnl warnings for Carbon symbols from the standard headers -- disable them
  6905. dnl as we already know that they're deprecated and nothing else can be seen
  6906. dnl with these warnings on
  6907. if test "$wxUSE_MAC" = 1 ; then
  6908. CXXWARNINGS="$CXXWARNINGS -Wno-deprecated-declarations"
  6909. fi
  6910. fi
  6911. dnl combine everything together and remove the extra white space while doing it
  6912. WXCONFIG_CFLAGS=`echo $WXCONFIG_CFLAGS`
  6913. WXCONFIG_CXXFLAGS=`echo $WXCONFIG_CFLAGS $WXCONFIG_CXXFLAGS`
  6914. dnl add -I options we use during library compilation
  6915. dnl
  6916. dnl note that the order is somewhat important: wxWidgets headers should
  6917. dnl come first and the one with setup.h should be before $(top_srcdir)/include
  6918. dnl in case the latter contains setup.h used by non-autoconf makefiles
  6919. CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \
  6920. -I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \
  6921. -I\\${top_srcdir}/include $TOOLKIT_INCLUDE \
  6922. $CPPFLAGS `
  6923. C_AND_CXX_FLAGS="$DEBUG_CFLAGS $PROFILE_FLAGS $OPTIMISE_CFLAGS"
  6924. CFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $CFLAGS `
  6925. CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $C_AND_CXX_FLAGS $CXXFLAGS `
  6926. OBJCFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $OBJCFLAGS `
  6927. OBJCXXFLAGS=`echo $WXCONFIG_CXXFLAGS $C_AND_CXX_FLAGS $OBJCXXFLAGS `
  6928. dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config
  6929. dnl only stuff to it
  6930. WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS`
  6931. if test "x$MWCC" = "xyes"; then
  6932. dnl Correct MW 8.3 to be more similar to GCC. In particular we
  6933. dnl must use <regex.h> from system not our local copy on OS X,
  6934. dnl but must use local not system on OS 9.
  6935. dnl The following should make all -I paths usable for <> includes
  6936. dnl while first checking in real system paths. With 8.3 using
  6937. dnl -gccincludes it will actually check local paths before system
  6938. dnl even for <> which is totally wrong.
  6939. dnl Note that because this absolutely needs to be before any -I
  6940. dnl that we have to tack it on to the end of the compiler commandline.
  6941. CC="$CC -cwd source -I-"
  6942. CXX="$CXX -cwd source -I-"
  6943. fi
  6944. LIBS=`echo $LIBS`
  6945. EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS"
  6946. EXTRALIBS_XML="$EXPAT_LINK"
  6947. EXTRALIBS_HTML="$MSPACK_LINK"
  6948. EXTRALIBS_MEDIA="$GST_LIBS"
  6949. EXTRALIBS_STC="-lwxscintilla${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX}"
  6950. if test "$wxUSE_GUI" = "yes"; then
  6951. EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK`
  6952. fi
  6953. if test "$wxUSE_OPENGL" = "yes"; then
  6954. EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS"
  6955. fi
  6956. LDFLAGS="$LDFLAGS $PROFILE_FLAGS"
  6957. WXCONFIG_LIBS="$LIBS"
  6958. dnl wx-config must output builtin 3rd party libs in --libs in static build:
  6959. if test "$wxUSE_REGEX" = "builtin" ; then
  6960. wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty"
  6961. fi
  6962. if test "$wxUSE_EXPAT" = "builtin" ; then
  6963. wxconfig_3rdparty="expat $wxconfig_3rdparty"
  6964. fi
  6965. if test "$wxUSE_LIBTIFF" = "builtin" ; then
  6966. wxconfig_3rdparty="tiff $wxconfig_3rdparty"
  6967. fi
  6968. if test "$wxUSE_LIBJPEG" = "builtin" ; then
  6969. wxconfig_3rdparty="jpeg $wxconfig_3rdparty"
  6970. fi
  6971. if test "$wxUSE_LIBPNG" = "builtin" ; then
  6972. wxconfig_3rdparty="png $wxconfig_3rdparty"
  6973. fi
  6974. if test "$wxUSE_ZLIB" = "builtin" ; then
  6975. wxconfig_3rdparty="zlib $wxconfig_3rdparty"
  6976. fi
  6977. for i in $wxconfig_3rdparty ; do
  6978. WXCONFIG_LIBS="-lwx${i}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"
  6979. done
  6980. if test "x$wxUSE_UNIVERSAL" = "xyes" ; then
  6981. WXUNIV=1
  6982. case "$wxUNIV_THEMES" in
  6983. ''|all)
  6984. AC_DEFINE(wxUSE_ALL_THEMES)
  6985. ;;
  6986. *)
  6987. for t in `echo $wxUNIV_THEMES | tr , ' ' | tr '[[a-z]]' '[[A-Z]]'`; do
  6988. AC_DEFINE_UNQUOTED(wxUSE_THEME_$t)
  6989. done
  6990. esac
  6991. else
  6992. WXUNIV=0
  6993. fi
  6994. AC_SUBST(wxUSE_ZLIB)
  6995. AC_SUBST(wxUSE_REGEX)
  6996. AC_SUBST(wxUSE_EXPAT)
  6997. AC_SUBST(wxUSE_LIBJPEG)
  6998. AC_SUBST(wxUSE_LIBPNG)
  6999. AC_SUBST(wxUSE_LIBTIFF)
  7000. if test $wxUSE_MONOLITHIC = "yes" ; then
  7001. MONOLITHIC=1
  7002. else
  7003. MONOLITHIC=0
  7004. fi
  7005. if test $wxUSE_PLUGINS = "yes" ; then
  7006. USE_PLUGINS=1
  7007. else
  7008. USE_PLUGINS=0
  7009. fi
  7010. if test "$wxUSE_DEBUGREPORT" = "yes" ; then
  7011. USE_QA=1
  7012. else
  7013. USE_QA=0
  7014. fi
  7015. if test $wxUSE_OFFICIAL_BUILD = "yes" ; then
  7016. OFFICIAL_BUILD=1
  7017. else
  7018. OFFICIAL_BUILD=0
  7019. fi
  7020. AC_SUBST(VENDOR)
  7021. AC_SUBST(OFFICIAL_BUILD)
  7022. AC_SUBST(WX_FLAVOUR)
  7023. AC_SUBST(WX_LIB_FLAVOUR)
  7024. AC_SUBST(WXUNIV)
  7025. AC_SUBST(MONOLITHIC)
  7026. AC_SUBST(USE_PLUGINS)
  7027. AC_SUBST(LIBS)
  7028. AC_SUBST(CXXWARNINGS)
  7029. AC_SUBST(EXTRALIBS)
  7030. AC_SUBST(EXTRALIBS_XML)
  7031. AC_SUBST(EXTRALIBS_HTML)
  7032. AC_SUBST(EXTRALIBS_MEDIA)
  7033. AC_SUBST(EXTRALIBS_GUI)
  7034. AC_SUBST(EXTRALIBS_OPENGL)
  7035. AC_SUBST(EXTRALIBS_SDL)
  7036. AC_SUBST(EXTRALIBS_STC)
  7037. AC_SUBST(WITH_PLUGIN_SDL)
  7038. AC_SUBST(UNICODE)
  7039. AC_SUBST(DEBUG_INFO)
  7040. AC_SUBST(DEBUG_FLAG)
  7041. TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[[A-Z]]' '[[a-z]]'`
  7042. AC_SUBST(TOOLKIT_LOWERCASE)
  7043. AC_SUBST(TOOLKIT_VERSION)
  7044. AC_SUBST(DYLIB_RPATH_INSTALL)
  7045. AC_SUBST(DYLIB_RPATH_POSTLINK)
  7046. AC_SUBST(SAMPLES_RPATH_FLAG)
  7047. AC_SUBST(HEADER_PAD_OPTION)
  7048. AC_SUBST(HOST_SUFFIX)
  7049. AC_SUBST(CPPUNIT_CFLAGS)
  7050. AC_SUBST(CPPUNIT_LIBS)
  7051. case "$TOOLKIT" in
  7052. GTK)
  7053. TOOLKIT_DESC="GTK+"
  7054. if test "$WXGTK2" = 1; then
  7055. if test "$WXGTK3" = 1; then
  7056. TOOLKIT_DESC="$TOOLKIT_DESC 3"
  7057. else
  7058. TOOLKIT_DESC="$TOOLKIT_DESC 2"
  7059. fi
  7060. if test "$wxUSE_GTKPRINT" = "yes" ; then
  7061. TOOLKIT_EXTRA="$TOOLKIT_EXTRA GTK+ printing";
  7062. fi
  7063. if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then
  7064. TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomevfs"
  7065. fi
  7066. if test "$wxUSE_LIBNOTIFY" = "yes" ; then
  7067. TOOLKIT_EXTRA="$TOOLKIT_EXTRA libnotify"
  7068. fi
  7069. if test "$wxUSE_LIBHILDON" = "yes"; then
  7070. TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
  7071. fi
  7072. if test "$wxUSE_LIBHILDON2" = "yes"; then
  7073. TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon"
  7074. fi
  7075. if test "$TOOLKIT_EXTRA" != ""; then
  7076. TOOLKIT_DESC="$TOOLKIT_DESC with support for `echo $TOOLKIT_EXTRA | tr -s ' '`"
  7077. fi
  7078. fi
  7079. ;;
  7080. ?*)
  7081. TOOLKIT_DESC=$TOOLKIT_LOWERCASE
  7082. ;;
  7083. *)
  7084. TOOLKIT_DESC="base only"
  7085. ;;
  7086. esac
  7087. if test "$wxUSE_WINE" = "yes"; then
  7088. BAKEFILE_FORCE_PLATFORM=win32
  7089. fi
  7090. dnl gcc 3.4 has a pch bug which truncates wide character constants in headers.
  7091. dnl Hopefully for a non-unicode build there aren't any wide constants in
  7092. dnl headers, but for a unicode build it's best to disable pch.
  7093. if test "$wxUSE_UNICODE" = yes -a "$GCC" = yes -a "$bk_use_pch" != no
  7094. then
  7095. AC_CACHE_CHECK(
  7096. [for gcc precompiled header bug],
  7097. [wx_cv_gcc_pch_bug],
  7098. [[
  7099. echo '#include <stdio.h>
  7100. const wchar_t test_var[] = L"awidetest";' > conftest.h
  7101. echo '#include "conftest.h"
  7102. int main()
  7103. {
  7104. printf("%ls", test_var);
  7105. return 0;
  7106. }' > conftest.cpp
  7107. wx_cv_gcc_pch_bug="pch not supported"
  7108. if $CXX conftest.h >/dev/null 2>&1
  7109. then
  7110. wx_cv_gcc_pch_bug=
  7111. if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1
  7112. then
  7113. if tr -dc '[a-z]' < conftest$PROGRAM_EXT |
  7114. grep awidetest >/dev/null
  7115. then
  7116. wx_cv_gcc_pch_bug=no
  7117. else
  7118. wx_cv_gcc_pch_bug=yes
  7119. fi
  7120. fi
  7121. fi
  7122. rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT
  7123. ]])
  7124. if test "$wx_cv_gcc_pch_bug" = yes; then
  7125. dnl make the default for pch 'no'
  7126. dnl further below check whether the user overrode and warn them
  7127. bk_use_pch=no
  7128. fi
  7129. fi
  7130. AC_BAKEFILE([m4_include(autoconf_inc.m4)])
  7131. dnl make install path absolute (if not already);
  7132. dnl will fail with (some) MSDOS paths
  7133. case ${INSTALL} in
  7134. /* ) # Absolute
  7135. ;;
  7136. ?:* ) # Drive letter, considered as absolute.
  7137. ;;
  7138. *)
  7139. INSTALL=`pwd`/${INSTALL} ;;
  7140. esac
  7141. if test "$wxUSE_GUI" = "yes"; then
  7142. if test "$wxUSE_MSW" = 1 ; then
  7143. if test "x$WINDRES" = "x"; then
  7144. AC_MSG_ERROR([Required windres program not found])
  7145. fi
  7146. RESCOMP="$WINDRES"
  7147. fi
  7148. if test "$wxUSE_MAC" = 1 -o "$wxUSE_OLD_COCOA" = 1; then
  7149. dnl base name of the resource file for wxMac must be the same
  7150. dnl as library installation base name (-install_name)
  7151. WX_RESOURCES_MACOSX_ASCII="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.r"
  7152. WX_RESOURCES_MACOSX_DATA="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.rsrc"
  7153. dnl add the resources target for wxMac
  7154. LIBWXMACRES="\$(wx_top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
  7155. AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
  7156. MACSETFILE="\$(SETFILE)"
  7157. dnl resources are bundled both with shared library and applications
  7158. dnl since the carb resource *must* be included in the application
  7159. if test "$wxUSE_OSX_CARBON" = 1; then
  7160. POSTLINK_COMMAND="\$(REZ) -d __DARWIN__ -t APPL Carbon.r -o"
  7161. RESCOMP="$REZ"
  7162. WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL Carbon.r -o"
  7163. else
  7164. POSTLINK_COMMAND="cat /dev/null | \$(REZ) -d __DARWIN__ -t APPL ${LIBWXMACRES}"
  7165. RESCOMP="cat /dev/null \| $REZ"
  7166. WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL \$libdir/$WX_RESOURCES_MACOSX_ASCII"
  7167. fi
  7168. else
  7169. dnl default value is to (silently) do nothing in the makefile
  7170. MACSETFILE="@true"
  7171. if test "$wxUSE_PM" = 1; then
  7172. RESCOMP="emxbind"
  7173. WXCONFIG_RESFLAGS="-ep"
  7174. dnl Is this one really used anywhere for pm?
  7175. POSTLINK_COMMAND="$RESCOMP $WXCONFIG_RESFLAGS"
  7176. else
  7177. POSTLINK_COMMAND="@true"
  7178. fi
  7179. fi
  7180. fi
  7181. dnl wxUSE_GUI = 1
  7182. dnl find out if the compiler supports PCH
  7183. dnl
  7184. dnl TODO: this should be in bakefile
  7185. if test $GCC_PCH = 1
  7186. then
  7187. if test "$wx_cv_gcc_pch_bug" = yes; then
  7188. AC_MSG_WARN([*** Precompiled header support is broken on this compiler])
  7189. AC_MSG_WARN([*** --enable-precomp-headers is not recommended])
  7190. AC_MSG_WARN([*** see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13361])
  7191. fi
  7192. # Our WX_PRECOMP flag does not make sense for any language except C++ because
  7193. # the headers that benefit from precompilation are mostly C++ headers.
  7194. CXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
  7195. # When Bakefile can do multi-language PCH (e.g. C++ and Objective-C++) enable this:
  7196. #OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
  7197. fi
  7198. dnl HACK ALERT!!
  7199. dnl For now, we need to alter bk-deps not to generate deps
  7200. dnl when we've configured a Universal binary build.
  7201. dnl The next version of Bakefile will have the correct fix for this
  7202. dnl at which time, this hack can be removed.
  7203. if test "$DEPS_TRACKING" = 1 -a "$wxUSE_MAC" = 1 ; then
  7204. if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then
  7205. if test "x$disable_macosx_deps" = "xyes"; then
  7206. sed "s/DEPSMODE=gcc/DEPSMODE=none/" < bk-deps > temp
  7207. mv temp bk-deps
  7208. chmod +x bk-deps
  7209. fi
  7210. fi
  7211. fi
  7212. if test "$wxUSE_SHARED" = "yes"; then
  7213. dnl Need addtional flag on OS/2, so override bakefiles value
  7214. dnl (there currently is no suitable variable to which the
  7215. dnl missing flags could be added, AFAICS. SN, 18.12.2004. )
  7216. case "${host}" in
  7217. *-pc-os2_emx | *-pc-os2-emx )
  7218. SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
  7219. SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
  7220. cp -p ${srcdir}/src/os2/dllnames.sh .
  7221. cp -p ${srcdir}/src/os2/dllar.sh .
  7222. ;;
  7223. esac
  7224. fi
  7225. if test "$wxUSE_OMF" = "yes"; then
  7226. case "${host}" in
  7227. *-pc-os2_emx | *-pc-os2-emx )
  7228. LDFLAGS="$LDFLAGS -Zlinker /EXEPACK"
  7229. LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
  7230. WXCONFIG_LDFLAGS_GUI="-Zlinker /PMTYPE:PM"
  7231. ;;
  7232. esac
  7233. fi
  7234. dnl TOOLCHAIN_DEFS should be used for both wx and client code
  7235. WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
  7236. dnl Sun cc is compatible with gcc and so either of them can use the C
  7237. dnl libraries built with the other, i.e. gcc can be used to build wxGTK under
  7238. dnl Solaris where GTK+ is compiled using cc and cc can be used under Linux
  7239. dnl where GTK+ is built with gcc
  7240. dnl
  7241. dnl However the compiler options are not compatible at all and in particular
  7242. dnl gcc doesn't like cc -mt option and cc doesn't like -pthread. We simply
  7243. dnl filter them out as we already have the correct options for multithreaded
  7244. dnl programs if we're using threads (and if we don't, it shouldn't matter)
  7245. case "${host}" in
  7246. *-*-solaris2* )
  7247. dnl system packages are compiled with Sun CC and so pkg-config outputs
  7248. dnl CC-specific "-mt" flag, remove it when using gcc
  7249. if test "$GCC" = yes; then
  7250. CPPFLAGS=`echo $CPPFLAGS | sed 's/-mt//g'`
  7251. LIBS=`echo $LIBS | sed 's/-mt//g'`
  7252. EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-mt//g'`
  7253. fi
  7254. ;;
  7255. *-*-linux* )
  7256. dnl OTOH when using Sun CC under Linux, the flags contain gcc-specific
  7257. dnl -pthreads which Sun CC doesn't know about
  7258. if test "x$SUNCXX" = xyes; then
  7259. CPPFLAGS=`echo $CPPFLAGS | sed 's/-pthread//g'`
  7260. LIBS=`echo $LIBS | sed 's/-pthread//g'`
  7261. EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-pthread//g'`
  7262. fi
  7263. ;;
  7264. esac
  7265. dnl Add visibility support flags to CFLAGS/CXXFLAGS - do it this late so that
  7266. dnl it doesn't affect compilation checks above
  7267. CFLAGS="$CFLAGS $CFLAGS_VISIBILITY"
  7268. CXXFLAGS="$CXXFLAGS $CXXFLAGS_VISIBILITY"
  7269. OBJCFLAGS="$OBJCFLAGS $CFLAGS_VISIBILITY"
  7270. OBJCXXFLAGS="$OBJCXXFLAGS $CXXFLAGS_VISIBILITY"
  7271. dnl for convenience, sort the samples in alphabetical order
  7272. dnl
  7273. dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
  7274. dnl in this list - hence uniq. But normally, this shouldn't be needed!
  7275. dnl
  7276. dnl Unfortunately, there is a bug in OS/2's tr, such that
  7277. dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' '
  7278. dnl only removes the Unix-like part of the introduced line break.
  7279. SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
  7280. dnl subtle bakefile goop.
  7281. dnl Used in wx-config now too, as its STATIC_FLAG with different makeup.
  7282. dnl I wish we would have called it something less likely to clash with
  7283. dnl things though.
  7284. AC_SUBST(SHARED)
  7285. dnl global options
  7286. AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
  7287. AC_SUBST(WX_LIBRARY_BASENAME_GUI)
  7288. dnl toolkit options
  7289. AC_SUBST(USE_GUI)
  7290. AC_SUBST(TOOLKIT)
  7291. AC_SUBST(TOOLKIT_DIR)
  7292. AC_SUBST(TOOLCHAIN_NAME)
  7293. AC_SUBST(TOOLCHAIN_FULLNAME)
  7294. dnl wx-config options
  7295. AC_SUBST(host_alias)
  7296. AC_SUBST(cross_compiling)
  7297. AC_SUBST(WIDGET_SET)
  7298. AC_SUBST(WX_RELEASE)
  7299. AC_SUBST(WX_VERSION)
  7300. AC_SUBST(WX_SUBVERSION)
  7301. AC_SUBST(WX_CHARTYPE)
  7302. dnl note that in addition to the usual CPP/C/CXXFLAGS which are used for
  7303. dnl building the library itself, we also have WXCONFIG_-prefixed variants which
  7304. dnl are used when building the libraries using the library
  7305. dnl
  7306. dnl so put anything which should be used only during the library build in, e.g.
  7307. dnl CXXFLAGS, but put everything else (by default) into WXCONFIG_CXXFLAGS
  7308. dnl
  7309. dnl and, finally, for some things which should be only used by wx-config but
  7310. dnl not during the library compilation, use WXCONFIG_ONLY_CPPFLAGS which is
  7311. dnl added to WXCONFIG_CPPFLAGS after adding the latter to CPPFLAGS
  7312. AC_SUBST(WXCONFIG_CPPFLAGS)
  7313. AC_SUBST(WXCONFIG_CFLAGS)
  7314. AC_SUBST(WXCONFIG_CXXFLAGS)
  7315. AC_SUBST(WXCONFIG_LIBS)
  7316. AC_SUBST(WXCONFIG_RPATH)
  7317. AC_SUBST(WXCONFIG_LDFLAGS)
  7318. AC_SUBST(WXCONFIG_LDFLAGS_GUI)
  7319. AC_SUBST(WXCONFIG_RESFLAGS)
  7320. dnl distribution vars
  7321. AC_SUBST(GUIDIST)
  7322. AC_SUBST(DISTDIR)
  7323. dnl additional subdirectories where we will build
  7324. AC_SUBST(SAMPLES_SUBDIRS)
  7325. dnl additional libraries and linker settings
  7326. AC_SUBST(LDFLAGS)
  7327. AC_SUBST(LDFLAGS_GL)
  7328. AC_SUBST(OPENGL_LIBS)
  7329. AC_SUBST(DMALLOC_LIBS)
  7330. AC_SUBST(WX_VERSION_TAG)
  7331. dnl additional resurces settings
  7332. AC_SUBST(RESCOMP)
  7333. AC_SUBST(WINDRES)
  7334. AC_SUBST(REZ)
  7335. AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
  7336. AC_SUBST(WX_RESOURCES_MACOSX_DATA)
  7337. dnl additional for Mac OS X
  7338. AC_SUBST(DEREZ)
  7339. AC_SUBST(LIBWXMACRES)
  7340. AC_SUBST(POSTLINK_COMMAND)
  7341. AC_SUBST(MACSETFILE)
  7342. dnl other tools
  7343. AC_SUBST(GCC)
  7344. AC_SUBST(DLLTOOL)
  7345. dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
  7346. dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am
  7347. dnl - and we do use it)
  7348. AC_PROG_MAKE_SET
  7349. AC_CONFIG_HEADERS([lib/wx/include/${TOOLCHAIN_FULLNAME}/wx/setup.h:setup.h.in])
  7350. if test "$USE_WIN32" = 1; then
  7351. AC_CONFIG_COMMANDS([rcdefs.h],
  7352. [
  7353. mkdir -p $outdir &&
  7354. $CPP $infile | sed 's/^# *[1-9].*//;s/^ *//;/./,/^$/!d' > $outdir/rcdefs.h
  7355. ],
  7356. [
  7357. CPP="$CPP"
  7358. infile="$srcdir/include/wx/msw/genrcdefs.h"
  7359. outdir="lib/wx/include/$TOOLCHAIN_FULLNAME/wx/msw"
  7360. ]
  7361. )
  7362. fi
  7363. AC_CONFIG_FILES([ lib/wx/config/${TOOLCHAIN_FULLNAME}:wx-config.in ],
  7364. [ chmod +x lib/wx/config/${TOOLCHAIN_FULLNAME} ],
  7365. [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
  7366. AC_CONFIG_FILES([ lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}:wx-config-inplace.in ],
  7367. [ chmod +x lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} ],
  7368. [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ])
  7369. dnl this is used to run ifacecheck with the same flags used by the compiler
  7370. dnl for the real compilation:
  7371. AC_CONFIG_FILES([ utils/ifacecheck/rungccxml.sh ],
  7372. [ chmod +x utils/ifacecheck/rungccxml.sh ])
  7373. if test "$wx_cv_version_script" = "yes"; then
  7374. AC_CONFIG_FILES(version-script)
  7375. fi
  7376. AC_CONFIG_FILES(Makefile)
  7377. AC_CONFIG_COMMANDS([wx-config],
  7378. [ rm -f wx-config
  7379. ${LN_S} lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} wx-config
  7380. ],
  7381. [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}"
  7382. LN_S="${LN_S}"
  7383. ])
  7384. dnl This would give us us build dir that in every significant way
  7385. dnl resembles an installed wx in prefix=$builddir. It is troublesome
  7386. dnl though in this form because AC_CONFIG_LINKS will fail for directories
  7387. dnl on platforms that do not have symlinks.
  7388. dnl AC_CONFIG_LINKS([ include/wx-$WX_RELEASE$WX_FLAVOUR:include ])
  7389. if test "$wxWITH_SUBDIRS" != "no"; then
  7390. dnl Configure samples, demos etc. directories, but only if they are present:
  7391. if test "$wxUSE_GUI" = "yes"; then
  7392. SUBDIRS="samples demos utils"
  7393. else
  7394. dnl we build wxBase only
  7395. dnl there are no wxBase programs in demos
  7396. SUBDIRS="samples utils"
  7397. fi
  7398. dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected
  7399. AM_PATH_CPPUNIT(1.8.0, [SUBDIRS="$SUBDIRS tests"])
  7400. for subdir in $SUBDIRS; do
  7401. if test -d ${srcdir}/${subdir} ; then
  7402. if test "$wxUSE_GUI" = "yes"; then
  7403. if test ${subdir} = "samples"; then
  7404. dnl only take those samples which compile in the current
  7405. dnl configuration and which exist
  7406. makefiles="samples/Makefile.in $makefiles"
  7407. for sample in $SAMPLES_SUBDIRS; do
  7408. if test -d $srcdir/samples/$sample; then
  7409. makefiles="samples/$sample/Makefile.in $makefiles"
  7410. fi
  7411. done
  7412. else
  7413. dnl assume that everything compiles for utils &c
  7414. dnl any that shouldn't be built can be added to
  7415. dnl DISABLED_UTILS, DISABLED_DEMOS
  7416. disabled_var=DISABLED_`echo $subdir | tr '[[a-z]]' '[[A-Z]]'`
  7417. eval "disabled=\$$disabled_var"
  7418. disabled=/`echo X $disabled | sed 's@ @/|/@g'`/
  7419. makefiles=`(cd $srcdir ; find $subdir -name Makefile.in) | $EGREP -v "$disabled"`
  7420. fi
  7421. else
  7422. dnl we build wxBase only
  7423. dnl don't take all samples/utils, just those which build with wxBase
  7424. if test ${subdir} = "samples"; then
  7425. dnl only take those samples which compile in the current
  7426. dnl configuration and which exist
  7427. makefiles="samples/Makefile.in $makefiles"
  7428. for sample in `echo $SAMPLES_SUBDIRS`; do
  7429. if test -d $srcdir/samples/$sample; then
  7430. makefiles="samples/$sample/Makefile.in $makefiles"
  7431. fi
  7432. done
  7433. elif test ${subdir} = "utils"; then
  7434. makefiles=""
  7435. for util in ifacecheck ; do
  7436. if test -d $srcdir/utils/$util ; then
  7437. makefiles="utils/$util/src/Makefile.in \
  7438. $makefiles"
  7439. fi
  7440. done
  7441. else
  7442. dnl assume that everything compiles for tests
  7443. makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
  7444. fi
  7445. fi
  7446. for mkin in $makefiles ; do
  7447. mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'`
  7448. AC_CONFIG_FILES([$mk])
  7449. done
  7450. fi
  7451. done
  7452. fi dnl wxWITH_SUBDIRS
  7453. AC_OUTPUT
  7454. dnl report how we have been configured
  7455. echo
  7456. echo "Configured wxWidgets ${WX_VERSION} for \`${host}'"
  7457. echo ""
  7458. echo " Which GUI toolkit should wxWidgets use? ${TOOLKIT_DESC}"
  7459. echo " Should wxWidgets be compiled into single library? ${wxUSE_MONOLITHIC:-yes}"
  7460. echo " Should wxWidgets be linked as a shared library? ${wxUSE_SHARED:-no}"
  7461. echo $ECHO_N " Should wxWidgets support Unicode? ${wxUSE_UNICODE:-no}$ECHO_C"
  7462. if test "$wxUSE_UNICODE" = "yes"; then
  7463. if test "$wxUSE_UNICODE_UTF8" = "yes"; then
  7464. echo " (using UTF-8)"
  7465. else
  7466. echo " (using wchar_t)"
  7467. fi
  7468. else
  7469. echo
  7470. fi
  7471. echo " What level of wxWidgets compatibility should be enabled?"
  7472. echo " wxWidgets 2.6 ${WXWIN_COMPATIBILITY_2_6:-no}"
  7473. echo " wxWidgets 2.8 ${WXWIN_COMPATIBILITY_2_8:-yes}"
  7474. echo " Which libraries should wxWidgets use?"
  7475. echo " STL ${wxUSE_STL}"
  7476. echo " jpeg ${wxUSE_LIBJPEG-none}"
  7477. echo " png ${wxUSE_LIBPNG-none}"
  7478. echo " regex ${wxUSE_REGEX}"
  7479. echo " tiff ${wxUSE_LIBTIFF-none}"
  7480. if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
  7481. echo " xpm ${wxUSE_LIBXPM-none}"
  7482. fi
  7483. echo " zlib ${wxUSE_ZLIB}"
  7484. echo " expat ${wxUSE_EXPAT}"
  7485. echo " libmspack ${wxUSE_LIBMSPACK}"
  7486. echo " sdl ${wxUSE_LIBSDL}"
  7487. echo ""
  7488. dnl vi: set et sts=4 sw=4 com=\:dnl: