Shared admin folder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

acinclude.m4.in 188 KiB

8 years ago
8 years ago
8 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915
  1. ## -*- autoconf -*-
  2. dnl This file is part of the TDE libraries/packages
  3. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  4. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  5. dnl This file is free software; you can redistribute it and/or
  6. dnl modify it under the terms of the GNU Library General Public
  7. dnl License as published by the Free Software Foundation; either
  8. dnl version 2 of the License, or (at your option) any later version.
  9. dnl This library is distributed in the hope that it will be useful,
  10. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. dnl Library General Public License for more details.
  13. dnl You should have received a copy of the GNU Library General Public License
  14. dnl along with this library; see the file COPYING.LIB. If not, write to
  15. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. dnl Boston, MA 02110-1301, USA.
  17. dnl IMPORTANT NOTE:
  18. dnl Please do not modify this file unless you expect your modifications to be
  19. dnl carried into every other module in the repository.
  20. dnl
  21. dnl Single-module modifications are best placed in configure.in for tdelibs
  22. dnl and tdebase or configure.in.in if present.
  23. # serial 2
  24. # Added 12/03/2011 by Timothy Pearson to shut automake serial warnings up
  25. # KDE_PATH_X_DIRECT
  26. dnl Internal subroutine of AC_PATH_X.
  27. dnl Set ac_x_includes and/or ac_x_libraries.
  28. AC_DEFUN([KDE_PATH_X_DIRECT],
  29. [
  30. AC_REQUIRE([KDE_CHECK_LIB64])
  31. if test "$ac_x_includes" = NO; then
  32. # Guess where to find include files, by looking for this one X11 .h file.
  33. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  34. # First, try using that file with no special directory specified.
  35. AC_TRY_CPP([#include <$x_direct_test_include>],
  36. [# We can compile using X headers with no special include directory.
  37. ac_x_includes=],
  38. [# Look for the header file in a standard set of common directories.
  39. # Check X11 before X11Rn because it is often a symlink to the current release.
  40. for ac_dir in \
  41. /usr/X11/include \
  42. /usr/X11R6/include \
  43. /usr/X11R5/include \
  44. /usr/X11R4/include \
  45. \
  46. /usr/include/X11 \
  47. /usr/include/X11R6 \
  48. /usr/include/X11R5 \
  49. /usr/include/X11R4 \
  50. \
  51. /usr/local/X11/include \
  52. /usr/local/X11R6/include \
  53. /usr/local/X11R5/include \
  54. /usr/local/X11R4/include \
  55. \
  56. /usr/local/include/X11 \
  57. /usr/local/include/X11R6 \
  58. /usr/local/include/X11R5 \
  59. /usr/local/include/X11R4 \
  60. \
  61. /usr/X386/include \
  62. /usr/x386/include \
  63. /usr/XFree86/include/X11 \
  64. \
  65. /usr/include \
  66. /usr/local/include \
  67. /usr/unsupported/include \
  68. /usr/athena/include \
  69. /usr/local/x11r5/include \
  70. /usr/lpp/Xamples/include \
  71. \
  72. /usr/openwin/include \
  73. /usr/openwin/share/include \
  74. ; \
  75. do
  76. if test -r "$ac_dir/$x_direct_test_include"; then
  77. ac_x_includes=$ac_dir
  78. break
  79. fi
  80. done])
  81. fi # $ac_x_includes = NO
  82. if test "$ac_x_libraries" = NO; then
  83. # Check for the libraries.
  84. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  85. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  86. # See if we find them without any special options.
  87. # Don't add to $LIBS permanently.
  88. ac_save_LIBS="$LIBS"
  89. LIBS="-l$x_direct_test_library $LIBS"
  90. AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  91. [LIBS="$ac_save_LIBS"
  92. # We can link X programs with no special library path.
  93. ac_x_libraries=],
  94. [LIBS="$ac_save_LIBS"
  95. # First see if replacing the include by lib works.
  96. # Check X11 before X11Rn because it is often a symlink to the current release.
  97. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${tdelibsuff}/` \
  98. /usr/X11/lib${tdelibsuff} \
  99. /usr/X11R6/lib${tdelibsuff} \
  100. /usr/X11R5/lib${tdelibsuff} \
  101. /usr/X11R4/lib${tdelibsuff} \
  102. \
  103. /usr/lib${tdelibsuff}/X11 \
  104. /usr/lib${tdelibsuff}/X11R6 \
  105. /usr/lib${tdelibsuff}/X11R5 \
  106. /usr/lib${tdelibsuff}/X11R4 \
  107. \
  108. /usr/local/X11/lib${tdelibsuff} \
  109. /usr/local/X11R6/lib${tdelibsuff} \
  110. /usr/local/X11R5/lib${tdelibsuff} \
  111. /usr/local/X11R4/lib${tdelibsuff} \
  112. \
  113. /usr/local/lib${tdelibsuff}/X11 \
  114. /usr/local/lib${tdelibsuff}/X11R6 \
  115. /usr/local/lib${tdelibsuff}/X11R5 \
  116. /usr/local/lib${tdelibsuff}/X11R4 \
  117. \
  118. /usr/X386/lib${tdelibsuff} \
  119. /usr/x386/lib${tdelibsuff} \
  120. /usr/XFree86/lib${tdelibsuff}/X11 \
  121. \
  122. /usr/lib${tdelibsuff} \
  123. /usr/local/lib${tdelibsuff} \
  124. /usr/unsupported/lib${tdelibsuff} \
  125. /usr/athena/lib${tdelibsuff} \
  126. /usr/local/x11r5/lib${tdelibsuff} \
  127. /usr/lpp/Xamples/lib${tdelibsuff} \
  128. /lib/usr/lib${tdelibsuff}/X11 \
  129. \
  130. /usr/openwin/lib${tdelibsuff} \
  131. /usr/openwin/share/lib${tdelibsuff} \
  132. ; \
  133. do
  134. dnl Don't even attempt the hair of trying to link an X program!
  135. for ac_extension in a so sl; do
  136. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  137. ac_x_libraries=$ac_dir
  138. break 2
  139. fi
  140. done
  141. done])
  142. fi # $ac_x_libraries = NO
  143. ])
  144. dnl ------------------------------------------------------------------------
  145. dnl Find a file (or one of more files in a list of dirs)
  146. dnl ------------------------------------------------------------------------
  147. dnl
  148. AC_DEFUN([AC_FIND_FILE],
  149. [
  150. $3=NO
  151. for i in $2;
  152. do
  153. for j in $1;
  154. do
  155. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  156. if test -r "$i/$j"; then
  157. echo "taking that" >&AC_FD_CC
  158. $3=$i
  159. break 2
  160. fi
  161. done
  162. done
  163. ])
  164. dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
  165. dnl if-not-found, test-parameter, prepend-path)
  166. dnl
  167. dnl Look for program-name in list-of-dirs+$PATH.
  168. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  169. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  170. dnl test-parameter: if set, the program is executed with this arg,
  171. dnl and only a successful exit code is required.
  172. AC_DEFUN([KDE_FIND_PATH],
  173. [
  174. AC_MSG_CHECKING([for $1])
  175. if test -n "$$2"; then
  176. kde_cv_path="$$2";
  177. else
  178. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  179. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  180. [
  181. kde_cv_path="NONE"
  182. kde_save_IFS=$IFS
  183. IFS=':'
  184. dirs=""
  185. for dir in $PATH; do
  186. dirs="$dirs $dir"
  187. done
  188. if test -z "$6"; then dnl Append dirs in PATH (default)
  189. dirs="$3 $dirs"
  190. else dnl Prepend dirs in PATH (if 6th arg is set)
  191. dirs="$dirs $3"
  192. fi
  193. IFS=$kde_save_IFS
  194. for dir in $dirs; do
  195. if test -x "$dir/$1"; then
  196. if test -n "$5"
  197. then
  198. evalstr="$dir/$1 $5 2>&1 "
  199. if eval $evalstr; then
  200. kde_cv_path="$dir/$1"
  201. break
  202. fi
  203. else
  204. kde_cv_path="$dir/$1"
  205. break
  206. fi
  207. fi
  208. done
  209. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  210. ])
  211. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  212. fi
  213. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  214. AC_MSG_RESULT(not found)
  215. $4
  216. else
  217. AC_MSG_RESULT($kde_cv_path)
  218. $2=$kde_cv_path
  219. fi
  220. ])
  221. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  222. [
  223. AC_MSG_ERROR([No TQt meta object compiler (tqmoc) found!
  224. Please check whether you installed Qt correctly.
  225. You need to have a running tqmoc binary.
  226. configure tried to run $ac_cv_path_moc and the test didn't
  227. succeed. If configure shouldn't have tried this one, set
  228. the environment variable MOC to the right one before running
  229. configure.
  230. ])
  231. ])
  232. AC_DEFUN([KDE_TQTMOC_ERROR_MESSAGE],
  233. [
  234. AC_MSG_ERROR([No Trinity Qt meta object compiler (tmoc) found!
  235. Please check whether you installed the Trinity Qt Interface correctly.
  236. You need to have a running tmoc binary.
  237. configure tried to run $ac_cv_path_moc and the test didn't
  238. succeed. If configure shouldn't have tried this one, set
  239. the environment variable TQTMOC to the right one before running
  240. configure.
  241. ])
  242. ])
  243. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  244. [
  245. AC_MSG_WARN([No TQt ui compiler (tquic) found!
  246. Please check whether you installed TQt correctly.
  247. You need to have a running uic binary.
  248. configure tried to run $ac_cv_path_uic and the test didn't
  249. succeed. If configure shouldn't have tried this one, set
  250. the environment variable UIC to the right one before running
  251. configure.
  252. ])
  253. ])
  254. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  255. [
  256. AC_MSG_CHECKING([whether uic supports -$1 ])
  257. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  258. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  259. [
  260. cat >conftest.ui <<EOT
  261. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  262. EOT
  263. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  264. if AC_TRY_EVAL(ac_uic_testrun); then
  265. eval "kde_cv_prog_uic_$kde_cache=yes"
  266. else
  267. eval "kde_cv_prog_uic_$kde_cache=no"
  268. fi
  269. rm -f conftest*
  270. ])
  271. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  272. AC_MSG_RESULT([yes])
  273. :
  274. $3
  275. else
  276. AC_MSG_RESULT([no])
  277. :
  278. $4
  279. fi
  280. ])
  281. dnl ------------------------------------------------------------------------
  282. dnl Find the meta object compiler and the ui compiler in the PATH,
  283. dnl in $QTDIR/bin, and some more usual places
  284. dnl ------------------------------------------------------------------------
  285. dnl
  286. AC_DEFUN([AC_PATH_QT_MOC_UIC],
  287. [
  288. AC_REQUIRE([KDE_CHECK_PERL])
  289. qt_bindirs=""
  290. for dir in $kde_qt_dirs; do
  291. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  292. done
  293. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  294. if test ! "$ac_qt_bindir" = "NO"; then
  295. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  296. fi
  297. if test "$kde_qtver" = "3"; then
  298. qt_bindirs="/usr/share/tqt3/bin /usr/share/qt3/bin $qt_bindirs"
  299. fi
  300. if test "$kde_qtver" = "4"; then
  301. qt_bindirs="/usr/share/qt4/bin $qt_bindirs"
  302. fi
  303. KDE_FIND_PATH(tqmoc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  304. if test -z "$UIC_NOT_NEEDED"; then
  305. if test $kde_qtver = 3; then
  306. KDE_FIND_PATH(uic-tqt, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  307. fi
  308. if test $kde_qtver = 4; then
  309. KDE_FIND_PATH(uic-tqt, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  310. fi
  311. if test -z "$UIC_PATH" ; then
  312. KDE_UIC_ERROR_MESSAGE
  313. exit 1
  314. else
  315. UIC=$UIC_PATH
  316. if test $kde_qtver = 3; then
  317. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  318. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  319. if test x$ac_uic_supports_libpath = xyes; then
  320. UIC="$UIC -L \$(kde_widgetdir)"
  321. fi
  322. if test x$ac_uic_supports_nounload = xyes; then
  323. UIC="$UIC -nounload"
  324. fi
  325. fi
  326. if test $kde_qtver = 4; then
  327. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  328. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  329. if test x$ac_uic_supports_libpath = xyes; then
  330. UIC="$UIC -L \$(kde_widgetdir)"
  331. fi
  332. if test x$ac_uic_supports_nounload = xyes; then
  333. UIC="$UIC -nounload"
  334. fi
  335. fi
  336. fi
  337. else
  338. UIC="echo uic not available: "
  339. fi
  340. AC_SUBST(MOC)
  341. AC_SUBST(UIC)
  342. UIC_TR="i18n"
  343. if test $kde_qtver = 3; then
  344. UIC_TR="tr2i18n"
  345. fi
  346. if test $kde_qtver = 4; then
  347. UIC_TR="tr2i18n"
  348. fi
  349. AC_SUBST(UIC_TR)
  350. ])
  351. AC_DEFUN([KDE_1_CHECK_PATHS],
  352. [
  353. KDE_1_CHECK_PATH_HEADERS
  354. KDE_TEST_RPATH=
  355. if test -n "$USE_RPATH"; then
  356. if test -n "$kde_libraries"; then
  357. KDE_TEST_RPATH="-R $kde_libraries"
  358. fi
  359. if test -n "$qt_libraries"; then
  360. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  361. fi
  362. if test -n "$x_libraries"; then
  363. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  364. fi
  365. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  366. fi
  367. AC_MSG_CHECKING([for TDE libraries installed])
  368. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -ltdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  369. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  370. AC_MSG_RESULT(yes)
  371. else
  372. AC_MSG_ERROR([your system fails at linking a small TDE application!
  373. Check, if your compiler is installed correctly and if you have used the
  374. same compiler to compile Qt and tdelibs as you did use now.
  375. For more details about this problem, look at the end of config.log.])
  376. fi
  377. if eval `TDEDIR= ./conftest 2>&5`; then
  378. kde_result=done
  379. else
  380. kde_result=problems
  381. fi
  382. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  383. kde_have_all_paths=yes
  384. KDE_SET_PATHS($kde_result)
  385. ])
  386. AC_DEFUN([KDE_SET_PATHS],
  387. [
  388. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  389. kde_htmldir=\"$kde_htmldir\" \
  390. kde_appsdir=\"$kde_appsdir\" \
  391. kde_icondir=\"$kde_icondir\" \
  392. kde_sounddir=\"$kde_sounddir\" \
  393. kde_datadir=\"$kde_datadir\" \
  394. kde_locale=\"$kde_locale\" \
  395. kde_cgidir=\"$kde_cgidir\" \
  396. kde_confdir=\"$kde_confdir\" \
  397. kde_kcfgdir=\"$kde_kcfgdir\" \
  398. kde_mimedir=\"$kde_mimedir\" \
  399. kde_toolbardir=\"$kde_toolbardir\" \
  400. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  401. kde_templatesdir=\"$kde_templatesdir\" \
  402. kde_bindir=\"$kde_bindir\" \
  403. kde_servicesdir=\"$kde_servicesdir\" \
  404. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  405. kde_moduledir=\"$kde_moduledir\" \
  406. kde_styledir=\"$kde_styledir\" \
  407. kde_widgetdir=\"$kde_widgetdir\" \
  408. xdg_appsdir=\"$xdg_appsdir\" \
  409. xdg_menudir=\"$xdg_menudir\" \
  410. xdg_directorydir=\"$xdg_directorydir\" \
  411. kde_result=$1"
  412. ])
  413. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  414. [
  415. if test "$1" = "default"; then
  416. if test -z "$kde_htmldir"; then
  417. kde_htmldir='\${datadir}/doc/tde/HTML'
  418. fi
  419. if test -z "$kde_appsdir"; then
  420. kde_appsdir='\${datadir}/applnk'
  421. fi
  422. if test -z "$kde_icondir"; then
  423. kde_icondir='\${datadir}/icons'
  424. fi
  425. if test -z "$kde_sounddir"; then
  426. kde_sounddir='\${datadir}/sounds'
  427. fi
  428. if test -z "$kde_datadir"; then
  429. kde_datadir='\${datadir}/apps'
  430. fi
  431. if test -z "$kde_locale"; then
  432. kde_locale='\${datadir}/locale'
  433. fi
  434. if test -z "$kde_cgidir"; then
  435. kde_cgidir='\${exec_prefix}/cgi-bin'
  436. fi
  437. if test -z "$kde_confdir"; then
  438. kde_confdir='\${datadir}/config'
  439. fi
  440. if test -z "$kde_kcfgdir"; then
  441. kde_kcfgdir='\${datadir}/config.kcfg'
  442. fi
  443. if test -z "$kde_mimedir"; then
  444. kde_mimedir='\${datadir}/mimelnk'
  445. fi
  446. if test -z "$kde_toolbardir"; then
  447. kde_toolbardir='\${datadir}/toolbar'
  448. fi
  449. if test -z "$kde_wallpaperdir"; then
  450. kde_wallpaperdir='\${datadir}/wallpapers'
  451. fi
  452. if test -z "$kde_templatesdir"; then
  453. kde_templatesdir='\${datadir}/templates'
  454. fi
  455. if test -z "$kde_bindir"; then
  456. kde_bindir='\${exec_prefix}/bin'
  457. fi
  458. if test -z "$kde_servicesdir"; then
  459. kde_servicesdir='\${datadir}/services'
  460. fi
  461. if test -z "$kde_servicetypesdir"; then
  462. kde_servicetypesdir='\${datadir}/servicetypes'
  463. fi
  464. if test -z "$kde_moduledir"; then
  465. if test "$kde_qtver" = "2"; then
  466. kde_moduledir='\${libdir}/kde2'
  467. else
  468. kde_moduledir='\${libdir}/trinity'
  469. fi
  470. fi
  471. if test -z "$kde_styledir"; then
  472. kde_styledir='\${libdir}/trinity/plugins/styles'
  473. fi
  474. if test -z "$kde_widgetdir"; then
  475. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  476. fi
  477. if test -z "$xdg_appsdir"; then
  478. xdg_appsdir='\${datadir}/applications/tde'
  479. fi
  480. if test -z "$xdg_menudir"; then
  481. xdg_menudir='\${sysconfdir}/xdg/menus'
  482. fi
  483. if test -z "$xdg_directorydir"; then
  484. xdg_directorydir='\${datadir}/desktop-directories'
  485. fi
  486. KDE_SET_PATHS(defaults)
  487. else
  488. if test $kde_qtver = 1; then
  489. AC_MSG_RESULT([compiling])
  490. KDE_1_CHECK_PATHS
  491. else
  492. AC_MSG_ERROR([path checking not yet supported for TDE 2])
  493. fi
  494. fi
  495. ])
  496. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  497. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  498. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  499. test -z "$kde_datadir" || test -z "$kde_locale" ||
  500. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  501. test -z "$kde_kcfgdir" ||
  502. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  503. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  504. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  505. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  506. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  507. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  508. test "x$kde_have_all_paths" != "xyes"; then
  509. kde_have_all_paths=no
  510. fi
  511. ])
  512. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  513. [
  514. AC_MSG_ERROR([The important program $1 was not found!
  515. Please check whether you installed TDE correctly.
  516. ])
  517. ])
  518. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  519. [
  520. AC_MSG_ERROR([The important program $1 was not found!
  521. Please check whether you installed aRts correctly or use
  522. --without-arts to compile without aRts support (this will remove functionality).
  523. ])
  524. ])
  525. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  526. [
  527. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/trinity/bin /opt/trinity/bin /usr/kde/bin /usr/local/kde/bin"
  528. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  529. if test -n "$TDEDIRS"; then
  530. kde_save_IFS=$IFS
  531. IFS=:
  532. for dir in $TDEDIRS; do
  533. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  534. done
  535. IFS=$kde_save_IFS
  536. fi
  537. ])
  538. AC_DEFUN([KDE_SUBST_PROGRAMS],
  539. [
  540. AC_ARG_WITH(arts,
  541. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  542. [build_arts=$withval],
  543. [build_arts=yes]
  544. )
  545. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  546. if test "$build_arts" = "no"; then
  547. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  548. fi
  549. KDE_SET_DEFAULT_BINDIRS
  550. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  551. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  552. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  553. if test "$build_arts" '!=' "no"; then
  554. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  555. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  556. fi
  557. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  558. trinity14ornewer=1
  559. if test "$kde_qtver" = "3"; then
  560. if test "$KDECONFIG" != "compiled"; then
  561. if test `$KDECONFIG --version | grep TDE | sed 's/TDE: R\(..\).*/\1/'` -lt 14; then
  562. trinity14ornewer=
  563. fi
  564. fi
  565. fi
  566. if test "$kde_qtver" = "4"; then
  567. trinity14ornewer=1
  568. fi
  569. if test -n "$trinity14ornewer"; then
  570. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  571. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  572. KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
  573. AC_SUBST(MAKEKDEWIDGETS)
  574. fi
  575. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  576. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  577. kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/trinity/share /opt/trinity/share /opt/kde/share $prefix/share"
  578. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  579. AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  580. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  581. KDE_XSL_STYLESHEET=""
  582. else
  583. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
  584. fi
  585. fi
  586. DCOP_DEPENDENCIES='$(DCOPIDL)'
  587. if test -n "$trinity14ornewer"; then
  588. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  589. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  590. AC_SUBST(KCONFIG_COMPILER)
  591. AC_SUBST(KCFG_DEPENDENCIES)
  592. AC_SUBST(DCOPIDLNG)
  593. fi
  594. AC_SUBST(DCOPIDL)
  595. AC_SUBST(DCOPIDL2CPP)
  596. AC_SUBST(DCOP_DEPENDENCIES)
  597. AC_SUBST(MCOPIDL)
  598. AC_SUBST(ARTSCCONFIG)
  599. AC_SUBST(MEINPROC)
  600. AC_SUBST(KDE_XSL_STYLESHEET)
  601. AC_SUBST(XMLLINT)
  602. ])dnl
  603. AC_DEFUN([AC_CREATE_KFSSTND],
  604. [
  605. AC_REQUIRE([AC_CHECK_RPATH])
  606. AC_MSG_CHECKING([for TDE paths])
  607. kde_result=""
  608. kde_cached_paths=yes
  609. AC_CACHE_VAL(kde_cv_all_paths,
  610. [
  611. KDE_SET_DEFAULT_PATHS($1)
  612. kde_cached_paths=no
  613. ])
  614. eval "$kde_cv_all_paths"
  615. KDE_CHECK_PATHS_FOR_COMPLETENESS
  616. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  617. # wrong values were cached, may be, we can set better ones
  618. kde_result=
  619. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  620. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  621. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  622. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  623. kde_have_all_paths=
  624. kde_styledir=
  625. kde_widgetdir=
  626. xdg_appsdir = xdg_menudir= xdg_directorydir=
  627. KDE_SET_DEFAULT_PATHS($1)
  628. eval "$kde_cv_all_paths"
  629. KDE_CHECK_PATHS_FOR_COMPLETENESS
  630. kde_result="$kde_result (cache overridden)"
  631. fi
  632. if test "$kde_have_all_paths" = "no"; then
  633. AC_MSG_ERROR([configure could not run a little TDE program to test the environment.
  634. Since it had compiled and linked before, it must be a strange problem on your system.
  635. Look at config.log for details. If you are not able to fix this, look at
  636. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  637. (If you're using an egcs version on Linux, you may update binutils!)
  638. ])
  639. else
  640. rm -f conftest*
  641. AC_MSG_RESULT($kde_result)
  642. fi
  643. bindir=$kde_bindir
  644. KDE_SUBST_PROGRAMS
  645. ])
  646. AC_DEFUN([AC_SUBST_KFSSTND],
  647. [
  648. AC_SUBST(kde_htmldir)
  649. AC_SUBST(kde_appsdir)
  650. AC_SUBST(kde_icondir)
  651. AC_SUBST(kde_sounddir)
  652. AC_SUBST(kde_datadir)
  653. AC_SUBST(kde_locale)
  654. AC_SUBST(kde_confdir)
  655. AC_SUBST(kde_kcfgdir)
  656. AC_SUBST(kde_mimedir)
  657. AC_SUBST(kde_wallpaperdir)
  658. AC_SUBST(kde_bindir)
  659. dnl X Desktop Group standards
  660. AC_SUBST(xdg_appsdir)
  661. AC_SUBST(xdg_menudir)
  662. AC_SUBST(xdg_directorydir)
  663. dnl for TDE 2
  664. AC_SUBST(kde_templatesdir)
  665. AC_SUBST(kde_servicesdir)
  666. AC_SUBST(kde_servicetypesdir)
  667. AC_SUBST(kde_moduledir)
  668. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  669. AC_SUBST(kde_styledir)
  670. AC_SUBST(kde_widgetdir)
  671. if test "$kde_qtver" = 1; then
  672. kde_minidir="$kde_icondir/mini"
  673. else
  674. # for TDE 1 - this breaks KDE2 apps using minidir, but
  675. # that's the plan ;-/
  676. kde_minidir="/dev/null"
  677. fi
  678. dnl AC_SUBST(kde_minidir)
  679. dnl AC_SUBST(kde_cgidir)
  680. dnl AC_SUBST(kde_toolbardir)
  681. ])
  682. AC_DEFUN([KDE_MISC_TESTS],
  683. [
  684. dnl Checks for libraries.
  685. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  686. AC_SUBST(LIBUTIL)
  687. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  688. AC_SUBST(LIBCOMPAT)
  689. kde_have_crypt=
  690. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  691. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  692. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  693. You should install libcrypt from another source or configure with PAM
  694. support])
  695. kde_have_crypt=no
  696. ]))
  697. AC_SUBST(LIBCRYPT)
  698. if test $kde_have_crypt = yes; then
  699. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  700. fi
  701. AC_CHECK_SOCKLEN_T
  702. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  703. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  704. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  705. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  706. fi
  707. AC_CHECK_FUNC(inet_ntoa)
  708. if test $ac_cv_func_inet_ntoa = no; then
  709. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  710. fi
  711. AC_CHECK_FUNC(connect)
  712. if test $ac_cv_func_connect = no; then
  713. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  714. $X_EXTRA_LIBS)
  715. fi
  716. AC_CHECK_FUNC(remove)
  717. if test $ac_cv_func_remove = no; then
  718. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  719. fi
  720. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  721. AC_CHECK_FUNC(shmat, ,
  722. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  723. # more headers that need to be explicitly included on darwin
  724. AC_CHECK_HEADERS(sys/types.h stdint.h)
  725. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  726. AC_CHECK_HEADERS(sys/bitypes.h)
  727. # darwin requires a poll emulation library
  728. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  729. # for some image handling on Mac OS X
  730. AC_CHECK_HEADERS(Carbon/Carbon.h)
  731. # CoreAudio framework
  732. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  733. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  734. FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
  735. ])
  736. AC_CHECK_RES_INIT
  737. AC_SUBST(LIB_POLL)
  738. AC_SUBST(FRAMEWORK_COREAUDIO)
  739. LIBSOCKET="$X_EXTRA_LIBS"
  740. AC_SUBST(LIBSOCKET)
  741. AC_SUBST(X_EXTRA_LIBS)
  742. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  743. AC_SUBST(LIBUCB)
  744. case $host in dnl this *is* LynxOS specific
  745. *-*-lynxos* )
  746. AC_MSG_CHECKING([LynxOS header file wrappers])
  747. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  748. AC_MSG_RESULT(disabled)
  749. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  750. ;;
  751. esac
  752. KDE_CHECK_TYPES
  753. KDE_CHECK_LIBDL
  754. KDE_CHECK_STRLCPY
  755. KDE_CHECK_PIE_SUPPORT
  756. # darwin needs this to initialize the environment
  757. AC_CHECK_HEADERS(crt_externs.h)
  758. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  759. AH_VERBATIM(_DARWIN_ENVIRON,
  760. [
  761. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  762. # include <sys/time.h>
  763. # include <crt_externs.h>
  764. # define environ (*_NSGetEnviron())
  765. #endif
  766. ])
  767. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  768. [
  769. /*
  770. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  771. * that defines bzero.
  772. */
  773. #if defined(_AIX)
  774. #include <strings.h>
  775. #endif
  776. ])
  777. AC_CHECK_FUNCS([vsnprintf snprintf])
  778. AH_VERBATIM(_TRU64,[
  779. /*
  780. * On HP-UX, the declaration of vsnprintf() is needed every time !
  781. */
  782. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  783. #if __STDC__
  784. #include <stdarg.h>
  785. #include <stdlib.h>
  786. #else
  787. #include <varargs.h>
  788. #endif
  789. #ifdef __cplusplus
  790. extern "C"
  791. #endif
  792. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  793. #ifdef __cplusplus
  794. extern "C"
  795. #endif
  796. int snprintf(char *str, size_t n, char const *fmt, ...);
  797. #endif
  798. ])
  799. ])
  800. dnl ------------------------------------------------------------------------
  801. dnl Find the header files and libraries for X-Windows. Extended the
  802. dnl macro AC_PATH_X
  803. dnl ------------------------------------------------------------------------
  804. dnl
  805. AC_DEFUN([K_PATH_X],
  806. [
  807. AC_REQUIRE([KDE_MISC_TESTS])dnl
  808. AC_REQUIRE([KDE_CHECK_LIB64])
  809. AC_ARG_ENABLE(
  810. embedded,
  811. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  812. kde_use_qt_emb=$enableval,
  813. kde_use_qt_emb=no
  814. )
  815. AC_ARG_ENABLE(
  816. qtopia,
  817. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  818. kde_use_qt_emb_palm=$enableval,
  819. kde_use_qt_emb_palm=no
  820. )
  821. AC_ARG_ENABLE(
  822. mac,
  823. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  824. kde_use_qt_mac=$enableval,
  825. kde_use_qt_mac=no
  826. )
  827. # used to disable x11-specific stuff on special platforms
  828. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  829. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  830. AC_MSG_CHECKING(for X)
  831. AC_CACHE_VAL(kde_cv_have_x,
  832. [# One or both of the vars are not set, and there is no cached value.
  833. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  834. kde_x_includes=NO
  835. else
  836. kde_x_includes=$x_includes
  837. fi
  838. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  839. kde_x_libraries=NO
  840. else
  841. kde_x_libraries=$x_libraries
  842. fi
  843. # below we use the standard autoconf calls
  844. ac_x_libraries=$kde_x_libraries
  845. ac_x_includes=$kde_x_includes
  846. KDE_PATH_X_DIRECT
  847. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  848. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  849. dnl location. The correct location is /usr/lib32 or an undefined value
  850. dnl (the linker is smart enough to pick the correct default library).
  851. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  852. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  853. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  854. dnl x_includes should be left alone.
  855. case "$host" in
  856. mips-sgi-irix6*)
  857. ;;
  858. *-*-solaris*)
  859. ;;
  860. *)
  861. _AC_PATH_X_XMKMF
  862. if test -z "$ac_x_includes"; then
  863. ac_x_includes="."
  864. fi
  865. if test -z "$ac_x_libraries"; then
  866. ac_x_libraries="/usr/lib${tdelibsuff}"
  867. fi
  868. esac
  869. #from now on we use our own again
  870. # when the user already gave --x-includes, we ignore
  871. # what the standard autoconf macros told us.
  872. if test "$kde_x_includes" = NO; then
  873. kde_x_includes=$ac_x_includes
  874. fi
  875. # for --x-libraries too
  876. if test "$kde_x_libraries" = NO; then
  877. kde_x_libraries=$ac_x_libraries
  878. fi
  879. if test "$kde_x_includes" = NO; then
  880. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  881. fi
  882. if test "$kde_x_libraries" = NO; then
  883. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  884. fi
  885. # Record where we found X for the cache.
  886. kde_cv_have_x="have_x=yes \
  887. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  888. ])dnl
  889. eval "$kde_cv_have_x"
  890. if test "$have_x" != yes; then
  891. AC_MSG_RESULT($have_x)
  892. no_x=yes
  893. else
  894. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  895. fi
  896. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  897. X_INCLUDES=""
  898. x_includes="."; dnl better than nothing :-
  899. else
  900. x_includes=$kde_x_includes
  901. X_INCLUDES="-I$x_includes"
  902. fi
  903. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
  904. X_LDFLAGS=""
  905. x_libraries="/usr/lib"; dnl better than nothing :-
  906. else
  907. x_libraries=$kde_x_libraries
  908. X_LDFLAGS="-L$x_libraries"
  909. fi
  910. all_includes="$X_INCLUDES"
  911. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  912. # Check for libraries that X11R6 Xt/Xaw programs need.
  913. ac_save_LDFLAGS="$LDFLAGS"
  914. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  915. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  916. # check for ICE first), but we must link in the order -lSM -lICE or
  917. # we get undefined symbols. So assume we have SM if we have ICE.
  918. # These have to be linked with before -lX11, unlike the other
  919. # libraries we check for below, so use a different variable.
  920. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  921. AC_CHECK_LIB(ICE, IceConnectionNumber,
  922. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  923. LDFLAGS="$ac_save_LDFLAGS"
  924. LIB_X11='-lX11 $(LIBSOCKET)'
  925. AC_MSG_CHECKING(for libXext)
  926. AC_CACHE_VAL(kde_cv_have_libXext,
  927. [
  928. kde_ldflags_safe="$LDFLAGS"
  929. kde_libs_safe="$LIBS"
  930. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  931. LIBS="-lXext -lX11 $LIBSOCKET"
  932. AC_TRY_LINK([
  933. #include <stdio.h>
  934. #ifdef STDC_HEADERS
  935. # include <stdlib.h>
  936. #endif
  937. ],
  938. [
  939. printf("hello Xext\n");
  940. ],
  941. kde_cv_have_libXext=yes,
  942. kde_cv_have_libXext=no
  943. )
  944. LDFLAGS=$kde_ldflags_safe
  945. LIBS=$kde_libs_safe
  946. ])
  947. AC_MSG_RESULT($kde_cv_have_libXext)
  948. if test "$kde_cv_have_libXext" = "no"; then
  949. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  950. can't find it itself, we stop here assuming that make wouldn't find
  951. them either.])
  952. fi
  953. LIB_XEXT="-lXext"
  954. QTE_NORTTI=""
  955. CFLAGS="$CFLAGS -I/usr/include/tqt"
  956. CXXFLAGS="$CXXFLAGS -I/usr/include/tqt"
  957. elif test "$kde_use_qt_emb" = "yes"; then
  958. dnl We're using QT Embedded
  959. CPPFLAGS=-DQWS
  960. CXXFLAGS="$CXXFLAGS -fno-rtti"
  961. QTE_NORTTI="-fno-rtti -DQWS"
  962. X_PRE_LIBS=""
  963. LIB_X11=""
  964. LIB_XEXT=""
  965. LIB_XRENDER=""
  966. LIBSM=""
  967. X_INCLUDES=""
  968. X_LDFLAGS=""
  969. x_includes=""
  970. x_libraries=""
  971. elif test "$kde_use_qt_mac" = "yes"; then
  972. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  973. dnl be included to get the information) --Sam
  974. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  975. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  976. X_PRE_LIBS=""
  977. LIB_X11=""
  978. LIB_XEXT=""
  979. LIB_XRENDER=""
  980. LIBSM=""
  981. X_INCLUDES=""
  982. X_LDFLAGS=""
  983. x_includes=""
  984. x_libraries=""
  985. fi
  986. AC_SUBST(X_PRE_LIBS)
  987. AC_SUBST(LIB_X11)
  988. AC_SUBST(LIB_XRENDER)
  989. AC_SUBST(LIBSM)
  990. AC_SUBST(X_INCLUDES)
  991. AC_SUBST(X_LDFLAGS)
  992. AC_SUBST(x_includes)
  993. AC_SUBST(x_libraries)
  994. AC_SUBST(QTE_NORTTI)
  995. AC_SUBST(LIB_XEXT)
  996. ])
  997. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  998. [
  999. AC_REQUIRE([KDE_USE_QT])
  1000. cat > conftest.$ac_ext <<EOF
  1001. #include "confdefs.h"
  1002. EOF
  1003. if test "$kde_qtver" = "4"; then
  1004. cat >> conftest.$ac_ext <<EOF
  1005. #include <Qt/qglobal.h>
  1006. #include <Qt/qapplication.h>
  1007. EOF
  1008. fi
  1009. if test "$kde_qtver" = "3"; then
  1010. if $PKG_CONFIG --exists qt-mt ; then
  1011. cat >> conftest.$ac_ext <<EOF
  1012. #include <tqt.h>
  1013. #include <qglobal.h>
  1014. #include <qapplication.h>
  1015. EOF
  1016. else
  1017. cat >> conftest.$ac_ext <<EOF
  1018. #include <tqglobal.h>
  1019. #include <tqapplication.h>
  1020. EOF
  1021. fi
  1022. fi
  1023. if test "$kde_qtver" = "2"; then
  1024. cat >> conftest.$ac_ext <<EOF
  1025. #include <qevent.h>
  1026. #include <qstring.h>
  1027. #include <qstyle.h>
  1028. EOF
  1029. if test $kde_qtsubver -gt 0; then
  1030. cat >> conftest.$ac_ext <<EOF
  1031. #if TQT_VERSION < 210
  1032. #error 1
  1033. #endif
  1034. EOF
  1035. fi
  1036. fi
  1037. if test "$kde_qtver" = "3"; then
  1038. if $PKG_CONFIG --exists qt-mt ; then
  1039. cat >> conftest.$ac_ext <<EOF
  1040. #include <qcursor.h>
  1041. #include <qstylefactory.h>
  1042. #include <private/qucomextra_p.h>
  1043. EOF
  1044. else
  1045. cat >> conftest.$ac_ext <<EOF
  1046. #include <tqcursor.h>
  1047. #include <tqstylefactory.h>
  1048. #include <tqucomextra_p.h>
  1049. EOF
  1050. fi
  1051. fi
  1052. if test "$kde_qtver" = "4"; then
  1053. cat >> conftest.$ac_ext <<EOF
  1054. #include <Qt/qcursor.h>
  1055. #include <Qt/qstylefactory.h>
  1056. EOF
  1057. fi
  1058. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  1059. cat >> conftest.$ac_ext <<EOF
  1060. #error 1
  1061. #endif
  1062. int main() {
  1063. EOF
  1064. if test "$kde_qtver" = "2"; then
  1065. cat >> conftest.$ac_ext <<EOF
  1066. QStringList *t = new QStringList();
  1067. Q_UNUSED(t);
  1068. EOF
  1069. if test $kde_qtsubver -gt 0; then
  1070. cat >> conftest.$ac_ext <<EOF
  1071. QString s;
  1072. s.setLatin1("Elvis is alive", 14);
  1073. EOF
  1074. fi
  1075. fi
  1076. if test "$kde_qtver" = "3"; then
  1077. if $PKG_CONFIG --exists qt-mt ; then
  1078. cat >> conftest.$ac_ext <<EOF
  1079. (void)QStyleFactory::create(QString::null);
  1080. QCursor c(Qt::WhatsThisCursor);
  1081. EOF
  1082. else
  1083. cat >> conftest.$ac_ext <<EOF
  1084. (void)TQStyleFactory::create(TQString::null);
  1085. TQCursor c(TQt::WhatsThisCursor);
  1086. EOF
  1087. fi
  1088. fi
  1089. if test "$kde_qtver" = "4"; then
  1090. cat >> conftest.$ac_ext <<EOF
  1091. (void)QStyleFactory::create(QString::null);
  1092. QCursor c(Qt::WhatsThisCursor);
  1093. EOF
  1094. fi
  1095. cat >> conftest.$ac_ext <<EOF
  1096. return 0;
  1097. }
  1098. EOF
  1099. ])
  1100. AC_DEFUN([KDE_USE_QT],
  1101. [
  1102. #if test -z "$1"; then
  1103. # Current default Qt version: 3.3
  1104. kde_qtver=3
  1105. kde_qtsubver=3
  1106. AC_LANG_SAVE
  1107. AC_LANG_CPLUSPLUS
  1108. ac_cxxflags_safe="$CXXFLAGS"
  1109. CXXFLAGS="-I/usr/include/tqt"
  1110. AC_TRY_COMPILE([
  1111. #define TQT_VERSION_ONLY
  1112. #include <tqt.h>
  1113. #undef TQT_VERSION_ONLY
  1114. #ifdef USE_QT4
  1115. choke me
  1116. #endif
  1117. ], ,
  1118. kde_qtver=3,
  1119. kde_qtver=4
  1120. )
  1121. CXXFLAGS="$ac_cxxflags_safe"
  1122. AC_LANG_RESTORE
  1123. if test "$kde_qtver" = "3"; then
  1124. AC_MSG_RESULT(Detected TQt3...)
  1125. fi
  1126. if test "$kde_qtver" = "4"; then
  1127. AC_MSG_RESULT(Detected TQt4...)
  1128. fi
  1129. #else
  1130. # kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1131. # # following is the check if subversion isnt found in passed argument
  1132. # if test "$kde_qtsubver" = "$1"; then
  1133. # kde_qtsubver=1
  1134. # fi
  1135. # kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1136. # if test "$kde_qtver" = "1"; then
  1137. # kde_qtsubver=42
  1138. # fi
  1139. #fi
  1140. if test -z "$2"; then
  1141. if test "$kde_qtver" = "2"; then
  1142. if test $kde_qtsubver -gt 0; then
  1143. kde_qt_minversion=">= Qt 2.2.2"
  1144. else
  1145. kde_qt_minversion=">= Qt 2.0.2"
  1146. fi
  1147. fi
  1148. if test "$kde_qtver" = "3"; then
  1149. if test $kde_qtsubver -gt 0; then
  1150. if test $kde_qtsubver -gt 1; then
  1151. if test $kde_qtsubver -gt 2; then
  1152. kde_qt_minversion=">= Qt 3.3 and < 4.0"
  1153. else
  1154. kde_qt_minversion=">= Qt 3.2 and < 4.0"
  1155. fi
  1156. else
  1157. kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
  1158. fi
  1159. else
  1160. kde_qt_minversion=">= Qt 3.0 and < 4.0"
  1161. fi
  1162. fi
  1163. if test "$kde_qtver" = "4"; then
  1164. if test $kde_qtsubver -gt 0; then
  1165. if test $kde_qtsubver -gt 1; then
  1166. if test $kde_qtsubver -gt 2; then
  1167. kde_qt_minversion=">= Qt 4.3 and < 5.0"
  1168. else
  1169. kde_qt_minversion=">= Qt 4.2 and < 5.0"
  1170. fi
  1171. else
  1172. kde_qt_minversion=">= Qt 4.1 and < 5.0"
  1173. fi
  1174. else
  1175. kde_qt_minversion=">= Qt 4.0 and < 5.0"
  1176. fi
  1177. fi
  1178. if test "$kde_qtver" = "1"; then
  1179. kde_qt_minversion=">= 1.42 and < 2.0"
  1180. fi
  1181. else
  1182. kde_qt_minversion="$2"
  1183. fi
  1184. if test -z "$3"; then
  1185. if test $kde_qtver = 4; then
  1186. if test $kde_qtsubver -gt 0; then
  1187. kde_qt_verstring="TQT_VERSION >= 0x04@VER@00 && TQT_VERSION < 0x050000"
  1188. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1189. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1190. else
  1191. kde_qt_verstring="TQT_VERSION >= 400 && TQT_VERSION < 0x050000"
  1192. fi
  1193. fi
  1194. if test $kde_qtver = 3; then
  1195. if test $kde_qtsubver -gt 0; then
  1196. kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1197. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1198. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1199. else
  1200. kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1201. fi
  1202. fi
  1203. if test $kde_qtver = 2; then
  1204. if test $kde_qtsubver -gt 0; then
  1205. kde_qt_verstring="TQT_VERSION >= 222"
  1206. else
  1207. kde_qt_verstring="TQT_VERSION >= 200"
  1208. fi
  1209. fi
  1210. if test $kde_qtver = 1; then
  1211. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1212. fi
  1213. else
  1214. kde_qt_verstring="$3"
  1215. fi
  1216. if test $kde_qtver = 4; then
  1217. kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
  1218. fi
  1219. if test $kde_qtver = 3; then
  1220. kde_qt_dirs="$QTDIR /usr/lib/tqt3 /usr/lib/qt3 /usr/lib/qt /usr/share/tqt3 /usr/share/qt3 /usr/lib${tdelibsuff}/qt-3.3"
  1221. if test -z "$PKG_CONFIG"; then
  1222. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1223. fi
  1224. if test "$PKG_CONFIG" != "no" ; then
  1225. if $PKG_CONFIG --exists qt-mt ; then
  1226. kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix qt-mt`"
  1227. LIB_QUI="-lqui"
  1228. AC_SUBST(LIB_QUI)
  1229. else
  1230. if $PKG_CONFIG --exists tqt-mt ; then
  1231. kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix tqt-mt`"
  1232. LIB_QUI="-ltqui"
  1233. AC_SUBST(LIB_QUI)
  1234. fi
  1235. fi
  1236. fi
  1237. fi
  1238. if test $kde_qtver = 2; then
  1239. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  1240. fi
  1241. if test $kde_qtver = 1; then
  1242. kde_qt_dirs="$QTDIR /usr/lib/qt"
  1243. fi
  1244. ])
  1245. AC_DEFUN([KDE_CHECK_QT_DIRECT],
  1246. [
  1247. AC_REQUIRE([KDE_USE_QT])
  1248. AC_MSG_CHECKING([if Qt compiles without flags])
  1249. AC_CACHE_VAL(kde_cv_qt_direct,
  1250. [
  1251. AC_LANG_SAVE
  1252. AC_LANG_CPLUSPLUS
  1253. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1254. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1255. ac_cxxflags_safe="$CXXFLAGS"
  1256. ac_ldflags_safe="$LDFLAGS"
  1257. ac_libs_safe="$LIBS"
  1258. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  1259. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1260. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1261. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  1262. else
  1263. LIBS="$LIBQT $LIBSOCKET"
  1264. fi
  1265. LD_LIBRARY_PATH=
  1266. export LD_LIBRARY_PATH
  1267. LIBRARY_PATH=
  1268. export LIBRARY_PATH
  1269. KDE_PRINT_QT_PROGRAM
  1270. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1271. kde_cv_qt_direct="yes"
  1272. else
  1273. kde_cv_qt_direct="no"
  1274. echo "configure: failed program was:" >&AC_FD_CC
  1275. cat conftest.$ac_ext >&AC_FD_CC
  1276. fi
  1277. rm -f conftest*
  1278. CXXFLAGS="$ac_cxxflags_safe"
  1279. LDFLAGS="$ac_ldflags_safe"
  1280. LIBS="$ac_libs_safe"
  1281. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1282. export LD_LIBRARY_PATH
  1283. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1284. export LIBRARY_PATH
  1285. AC_LANG_RESTORE
  1286. ])
  1287. if test "$kde_cv_qt_direct" = "yes"; then
  1288. AC_MSG_RESULT(yes)
  1289. $1
  1290. else
  1291. AC_MSG_RESULT(no)
  1292. $2
  1293. fi
  1294. ])
  1295. dnl ------------------------------------------------------------------------
  1296. dnl Try to find the Qt headers and libraries.
  1297. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  1298. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  1299. dnl ------------------------------------------------------------------------
  1300. dnl
  1301. AC_DEFUN([AC_PATH_QT_1_3],
  1302. [
  1303. AC_REQUIRE([K_PATH_X])
  1304. AC_REQUIRE([KDE_USE_QT])
  1305. AC_REQUIRE([KDE_CHECK_LIB64])
  1306. dnl ------------------------------------------------------------------------
  1307. dnl Add configure flag to enable linking to MT version of Qt library.
  1308. dnl ------------------------------------------------------------------------
  1309. AC_ARG_ENABLE(
  1310. mt,
  1311. AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
  1312. kde_use_qt_mt=$enableval,
  1313. [
  1314. if test $kde_qtver = 3; then
  1315. kde_use_qt_mt=yes
  1316. else
  1317. if test $kde_qtver = 4; then
  1318. kde_use_qt_mt=yes
  1319. else
  1320. kde_use_qt_mt=no
  1321. fi
  1322. fi
  1323. ]
  1324. )
  1325. USING_QT_MT=""
  1326. dnl ------------------------------------------------------------------------
  1327. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1328. dnl ------------------------------------------------------------------------
  1329. KDE_MT_LDFLAGS=
  1330. KDE_MT_LIBS=
  1331. if test "x$kde_use_qt_mt" = "xyes"; then
  1332. KDE_CHECK_THREADING
  1333. if test "x$kde_use_threading" = "xyes"; then
  1334. CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
  1335. KDE_MT_LDFLAGS="$USE_THREADS"
  1336. KDE_MT_LIBS="$LIBPTHREAD"
  1337. else
  1338. kde_use_qt_mt=no
  1339. fi
  1340. fi
  1341. AC_SUBST(KDE_MT_LDFLAGS)
  1342. AC_SUBST(KDE_MT_LIBS)
  1343. kde_qt_was_given=yes
  1344. dnl ------------------------------------------------------------------------
  1345. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1346. dnl ------------------------------------------------------------------------
  1347. if test -z "$LIBQT_GLOB"; then
  1348. if test "$kde_qtver" = "4"; then
  1349. LIBQT_GLOB="libQtCore.*"
  1350. fi
  1351. if test "$kde_qtver" = "3"; then
  1352. if test "x$kde_use_qt_emb" = "xyes"; then
  1353. LIBQT_GLOB="libqte.*"
  1354. else
  1355. if $PKG_CONFIG --exists qt-mt ; then
  1356. LIBQT_GLOB="libqt.*"
  1357. else
  1358. LIBQT_GLOB="libtqt.*"
  1359. fi
  1360. fi
  1361. fi
  1362. fi
  1363. dnl ------------------------------------------------------------
  1364. dnl If we got --enable-embedded then adjust the Qt library name.
  1365. dnl Also Qt4 uses a different library name
  1366. dnl ------------------------------------------------------------
  1367. if test "$kde_qtver" = "4"; then
  1368. qtlib="QtCore -lQtGui -lQtNetwork -ltqt"
  1369. fi
  1370. if test "$kde_qtver" = "3"; then
  1371. if test "x$kde_use_qt_emb" = "xyes"; then
  1372. qtlib="qte"
  1373. else
  1374. if $PKG_CONFIG --exists qt-mt ; then
  1375. qtlib="qt"
  1376. else
  1377. qtlib="tqt"
  1378. fi
  1379. fi
  1380. fi
  1381. kde_int_qt="-l$qtlib"
  1382. if test -z "$LIBQPE"; then
  1383. dnl ------------------------------------------------------------
  1384. dnl If we got --enable-palmtop then add -lqpe to the link line
  1385. dnl ------------------------------------------------------------
  1386. if test "x$kde_use_qt_emb" = "xyes"; then
  1387. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1388. LIB_QPE="-lqpe"
  1389. else
  1390. LIB_QPE=""
  1391. fi
  1392. else
  1393. LIB_QPE=""
  1394. fi
  1395. fi
  1396. dnl ------------------------------------------------------------------------
  1397. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1398. dnl ------------------------------------------------------------------------
  1399. if test "x$kde_use_qt_mt" = "xyes"; then
  1400. if test $kde_qtver = 3; then
  1401. LIBQT="-l$qtlib-mt"
  1402. kde_int_qt="-l$qtlib-mt"
  1403. LIBQT_GLOB="lib$qtlib-mt.*"
  1404. else
  1405. if test $kde_qtver = 4; then
  1406. LIBQT="-l$qtlib"
  1407. fi
  1408. fi
  1409. USING_QT_MT="using -mt"
  1410. else
  1411. LIBQT="-l$qtlib"
  1412. fi
  1413. if test $kde_qtver != 1; then
  1414. AC_REQUIRE([AC_FIND_PNG])
  1415. AC_REQUIRE([AC_FIND_JPEG])
  1416. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  1417. fi
  1418. if test $kde_qtver = 3; then
  1419. AC_REQUIRE([KDE_CHECK_LIBDL])
  1420. LIBQT="$LIBQT $LIBDL"
  1421. fi
  1422. if test $kde_qtver = 4; then
  1423. AC_REQUIRE([KDE_CHECK_LIBDL])
  1424. LIBQT="$LIBQT $LIBDL"
  1425. fi
  1426. AC_MSG_CHECKING([for Qt])
  1427. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1428. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1429. fi
  1430. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1431. qt_libraries=""
  1432. qt_includes=""
  1433. AC_ARG_WITH(qt-dir,
  1434. AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
  1435. [ ac_qt_includes="$withval"/include
  1436. ac_qt_libraries="$withval"/lib${tdelibsuff}
  1437. ac_qt_bindir="$withval"/bin
  1438. ])
  1439. AC_ARG_WITH(qt-includes,
  1440. AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
  1441. [
  1442. ac_qt_includes="$withval"
  1443. ])
  1444. kde_qt_libs_given=no
  1445. AC_ARG_WITH(qt-libraries,
  1446. AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
  1447. [ ac_qt_libraries="$withval"
  1448. kde_qt_libs_given=yes
  1449. ])
  1450. AC_CACHE_VAL(ac_cv_have_qt,
  1451. [#try to guess Qt locations
  1452. qt_incdirs=""
  1453. for dir in $kde_qt_dirs; do
  1454. qt_incdirs="$qt_incdirs $dir/include $dir"
  1455. done
  1456. if test -z "$PKG_CONFIG"; then
  1457. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1458. fi
  1459. if test "$PKG_CONFIG" != "no" ; then
  1460. if $PKG_CONFIG --exists qt-mt ; then
  1461. qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir qt-mt`"
  1462. else
  1463. if $PKG_CONFIG --exists tqt-mt ; then
  1464. qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir tqt-mt`"
  1465. fi
  1466. fi
  1467. fi
  1468. qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/tqt3 /usr/include/qt3 $x_includes"
  1469. if test ! "$ac_qt_includes" = "NO"; then
  1470. qt_incdirs="$ac_qt_includes $qt_incdirs"
  1471. fi
  1472. if test "$kde_qtver" != "1"; then
  1473. if test "$kde_qtver" = "4"; then
  1474. kde_qt_header="Qt/qstyle.h"
  1475. else
  1476. kde_qt_header=qstyle.h
  1477. kde_tqt_header=ntqstyle.h
  1478. fi
  1479. else
  1480. kde_qt_header=qglobal.h
  1481. kde_tqt_header=ntqglobal.h
  1482. fi
  1483. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1484. if test "$qt_incdir" = "NO"; then
  1485. AC_FIND_FILE($kde_tqt_header, $qt_incdirs, qt_incdir)
  1486. fi
  1487. ac_qt_includes="$qt_incdir"
  1488. qt_libdirs=""
  1489. for dir in $kde_qt_dirs; do
  1490. qt_libdirs="$qt_libdirs $dir/lib${tdelibsuff} $dir/lib $dir"
  1491. done
  1492. if test -z "$PKG_CONFIG"; then
  1493. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1494. fi
  1495. if test "$PKG_CONFIG" != "no" ; then
  1496. if $PKG_CONFIG --exists qt-mt ; then
  1497. qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir qt-mt`"
  1498. else
  1499. if $PKG_CONFIG --exists tqt-mt ; then
  1500. qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir tqt-mt`"
  1501. fi
  1502. fi
  1503. fi
  1504. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1505. if test ! "$ac_qt_libraries" = "NO"; then
  1506. qt_libdir=$ac_qt_libraries
  1507. else
  1508. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1509. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  1510. qt_libdir=NONE
  1511. for dir in $qt_libdirs; do
  1512. try="ls -1 $dir/${LIBQT_GLOB}"
  1513. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1514. done
  1515. fi
  1516. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1517. if test -e "$a"; then
  1518. LIBQT="$LIBQT ${kde_int_qt}_incremental"
  1519. break
  1520. fi
  1521. done
  1522. ac_qt_libraries="$qt_libdir"
  1523. AC_LANG_SAVE
  1524. AC_LANG_CPLUSPLUS
  1525. ac_cxxflags_safe="$CXXFLAGS"
  1526. ac_ldflags_safe="$LDFLAGS"
  1527. ac_libs_safe="$LIBS"
  1528. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1529. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1530. LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
  1531. KDE_PRINT_QT_PROGRAM
  1532. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1533. rm -f conftest*
  1534. else
  1535. echo "configure: failed program was:" >&AC_FD_CC
  1536. cat conftest.$ac_ext >&AC_FD_CC
  1537. ac_qt_libraries="NO"
  1538. fi
  1539. rm -f conftest*
  1540. CXXFLAGS="$ac_cxxflags_safe"
  1541. LDFLAGS="$ac_ldflags_safe"
  1542. LIBS="$ac_libs_safe"
  1543. AC_LANG_RESTORE
  1544. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1545. ac_cv_have_qt="have_qt=no"
  1546. ac_qt_notfound=""
  1547. missing_qt_mt=""
  1548. if test "$ac_qt_includes" = NO; then
  1549. if test "$ac_qt_libraries" = NO; then
  1550. ac_qt_notfound="(headers and libraries)";
  1551. else
  1552. ac_qt_notfound="(headers)";
  1553. fi
  1554. else
  1555. if test "x$kde_use_qt_mt" = "xyes"; then
  1556. missing_qt_mt="
  1557. Make sure that you have compiled Qt with thread support!"
  1558. ac_qt_notfound="(library $qtlib-mt)";
  1559. else
  1560. ac_qt_notfound="(library $qtlib)";
  1561. fi
  1562. fi
  1563. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1564. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1565. else
  1566. have_qt="yes"
  1567. fi
  1568. ])
  1569. eval "$ac_cv_have_qt"
  1570. if test "$have_qt" != yes; then
  1571. AC_MSG_RESULT([$have_qt]);
  1572. else
  1573. ac_cv_have_qt="have_qt=yes \
  1574. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  1575. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  1576. qt_libraries="$ac_qt_libraries"
  1577. qt_includes="$ac_qt_includes"
  1578. fi
  1579. if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
  1580. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1581. fi
  1582. AC_SUBST(qt_libraries)
  1583. AC_SUBST(qt_includes)
  1584. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  1585. QT_INCLUDES=""
  1586. else
  1587. QT_INCLUDES="-I$qt_includes"
  1588. all_includes="$QT_INCLUDES $all_includes"
  1589. fi
  1590. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1591. QT_LDFLAGS=""
  1592. else
  1593. QT_LDFLAGS="-L$qt_libraries"
  1594. all_libraries="$QT_LDFLAGS $all_libraries"
  1595. fi
  1596. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1597. AC_SUBST(QT_INCLUDES)
  1598. AC_SUBST(QT_LDFLAGS)
  1599. AC_PATH_QT_MOC_UIC
  1600. KDE_CHECK_TQT
  1601. KDE_CHECK_QT_JPEG
  1602. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1603. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) $(LIBTQT_LDFLAGS)'
  1604. else
  1605. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) $(LIBTQT_LDFLAGS)'
  1606. fi
  1607. test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
  1608. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1609. if test -e "$a"; then
  1610. LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
  1611. break
  1612. fi
  1613. done
  1614. AC_SUBST(LIB_QT)
  1615. AC_SUBST(LIB_QPE)
  1616. AC_SUBST(kde_qtver)
  1617. ])
  1618. AC_DEFUN([AC_PATH_QT],
  1619. [
  1620. AC_PATH_QT_1_3
  1621. ])
  1622. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1623. [
  1624. AC_REQUIRE([AC_PATH_QT_MOC_UIC])
  1625. if test x$ac_uic_supports_libpath = xyes; then
  1626. AC_MSG_CHECKING([if UIC has TDE plugins available])
  1627. AC_CACHE_VAL(kde_cv_uic_plugins,
  1628. [
  1629. cat > actest.ui << EOF
  1630. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1631. <class>NewConnectionDialog</class>
  1632. <widget class="TQDialog">
  1633. <widget class="KLineEdit">
  1634. <property name="name">
  1635. <cstring>testInput</cstring>
  1636. </property>
  1637. </widget>
  1638. </widget>
  1639. </UI>
  1640. EOF
  1641. kde_cv_uic_plugins=no
  1642. kde_line="$UIC_PATH -L $kde_widgetdir"
  1643. if test x$ac_uic_supports_nounload = xyes; then
  1644. kde_line="$kde_line -nounload"
  1645. fi
  1646. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1647. if AC_TRY_EVAL(kde_line); then
  1648. # if you're trying to debug this check and think it's incorrect,
  1649. # better check your installation. The check _is_ correct - your
  1650. # installation is not.
  1651. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1652. kde_cv_uic_plugins=yes
  1653. fi
  1654. fi
  1655. rm -f actest.ui actest.cpp
  1656. ])
  1657. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1658. if test "$kde_cv_uic_plugins" != yes; then
  1659. AC_MSG_ERROR([
  1660. you need to install tdelibs first.
  1661. If you did install tdelibs, then the Qt version that is picked up by
  1662. this configure is not the same version you used to compile tdelibs.
  1663. The Qt Plugin installed by tdelibs is *ONLY* loadable if it is the
  1664. _same Qt version_, compiled with the _same compiler_ and the same Qt
  1665. configuration settings.
  1666. ])
  1667. fi
  1668. fi
  1669. ])
  1670. AC_DEFUN([KDE_CHECK_FINAL],
  1671. [
  1672. AC_ARG_ENABLE(final,
  1673. AC_HELP_STRING([--enable-final],
  1674. [build size optimized apps (experimental - needs lots of memory)]),
  1675. kde_use_final=$enableval, kde_use_final=no)
  1676. if test "x$kde_use_final" = "xyes"; then
  1677. KDE_USE_FINAL_TRUE=""
  1678. KDE_USE_FINAL_FALSE="#"
  1679. else
  1680. KDE_USE_FINAL_TRUE="#"
  1681. KDE_USE_FINAL_FALSE=""
  1682. fi
  1683. AC_SUBST(KDE_USE_FINAL_TRUE)
  1684. AC_SUBST(KDE_USE_FINAL_FALSE)
  1685. ])
  1686. AC_DEFUN([KDE_CHECK_CLOSURE],
  1687. [
  1688. AC_ARG_ENABLE(closure,
  1689. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1690. kde_use_closure=$enableval, kde_use_closure=no)
  1691. KDE_NO_UNDEFINED=""
  1692. if test "x$kde_use_closure" = "xyes"; then
  1693. KDE_USE_CLOSURE_TRUE=""
  1694. KDE_USE_CLOSURE_FALSE="#"
  1695. # CXXFLAGS="$CXXFLAGS $REPO"
  1696. else
  1697. KDE_USE_CLOSURE_TRUE="#"
  1698. KDE_USE_CLOSURE_FALSE=""
  1699. KDE_NO_UNDEFINED=""
  1700. case $host in
  1701. *-*-linux-gnu)
  1702. KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
  1703. [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
  1704. [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
  1705. [KDE_NO_UNDEFINED=""])],
  1706. [KDE_NO_UNDEFINED=""])
  1707. ;;
  1708. esac
  1709. fi
  1710. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1711. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1712. AC_SUBST(KDE_NO_UNDEFINED)
  1713. ])
  1714. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1715. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1716. [
  1717. AC_ARG_ENABLE(new_ldflags,
  1718. AC_HELP_STRING([--enable-new-ldflags],
  1719. [enable the new linker flags]),
  1720. kde_use_new_ldflags=$enableval,
  1721. kde_use_new_ldflags=no)
  1722. LDFLAGS_AS_NEEDED=""
  1723. LDFLAGS_NEW_DTAGS=""
  1724. if test "x$kde_use_new_ldflags" = "xyes"; then
  1725. LDFLAGS_NEW_DTAGS=""
  1726. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1727. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1728. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1729. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1730. fi
  1731. AC_SUBST(LDFLAGS_AS_NEEDED)
  1732. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1733. ])
  1734. AC_DEFUN([KDE_CHECK_NMCHECK],
  1735. [
  1736. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1737. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1738. if test "$kde_use_nmcheck" = "yes"; then
  1739. KDE_USE_NMCHECK_TRUE=""
  1740. KDE_USE_NMCHECK_FALSE="#"
  1741. else
  1742. KDE_USE_NMCHECK_TRUE="#"
  1743. KDE_USE_NMCHECK_FALSE=""
  1744. fi
  1745. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1746. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1747. ])
  1748. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1749. savex=$exec_prefix
  1750. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1751. tmp=$$2
  1752. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1753. exec_prefix=$savex
  1754. ])
  1755. dnl ------------------------------------------------------------------------
  1756. dnl Now, the same with KDE
  1757. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1758. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1759. dnl ------------------------------------------------------------------------
  1760. dnl
  1761. AC_DEFUN([AC_BASE_PATH_KDE],
  1762. [
  1763. AC_REQUIRE([KDE_CHECK_STL])
  1764. AC_REQUIRE([AC_PATH_QT])dnl
  1765. AC_REQUIRE([KDE_CHECK_LIB64])
  1766. AC_CHECK_RPATH
  1767. AC_MSG_CHECKING([for KDE])
  1768. if test "${prefix}" != NONE; then
  1769. kde_includes=${includedir}
  1770. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1771. kde_libraries=${libdir}
  1772. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1773. else
  1774. ac_kde_includes=
  1775. ac_kde_libraries=
  1776. kde_libraries=""
  1777. kde_includes=""
  1778. fi
  1779. AC_CACHE_VAL(ac_cv_have_kde,
  1780. [#try to guess kde locations
  1781. if test "$kde_qtver" = 1; then
  1782. kde_check_header="ksock.h"
  1783. kde_check_lib="libtdecore.la"
  1784. else
  1785. kde_check_header="ksharedptr.h"
  1786. kde_check_lib="libtdeio.la"
  1787. fi
  1788. if test -z "$1"; then
  1789. kde_incdirs="$kde_libs_prefix/include /opt/trinity/include/tde /opt/trinity/include/tde /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/tde /usr/include /opt/trinity/include /opt/trinity/include /opt/kde/include $x_includes $qt_includes"
  1790. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1791. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1792. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1793. ac_kde_includes="$kde_incdir"
  1794. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1795. AC_MSG_ERROR([
  1796. No TDE headers are installed in the chosen prefix. This will fail.
  1797. Please check this and use another prefix if needed!])
  1798. fi
  1799. kde_libdirs="$kde_libs_prefix/lib${tdelibsuff} /usr/lib/kde/lib${tdelibsuff} /usr/local/kde/lib${tdelibsuff} /usr/kde/lib${tdelibsuff} /usr/lib${tdelibsuff}/kde /usr/lib${tdelibsuff}/trinity /usr/lib${tdelibsuff} /usr/X11R6/lib${tdelibsuff} /usr/local/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/kde/lib${tdelibsuff} /usr/X11R6/kde/lib${tdelibsuff}"
  1800. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1801. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1802. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1803. ac_kde_libraries="$kde_libdir"
  1804. kde_widgetdir=NO
  1805. dnl this might be somewhere else
  1806. AC_FIND_FILE("trinity/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
  1807. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1808. AC_MSG_ERROR([
  1809. in the prefix, you've chosen, are no TDE libraries installed. This will fail.
  1810. So, check this please and use another prefix!])
  1811. fi
  1812. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/kdewidgets.la"; then
  1813. AC_MSG_ERROR([
  1814. I can't find the designer plugins. These are required and should have been installed
  1815. by tdelibs])
  1816. fi
  1817. if test -n "$kde_widgetdir"; then
  1818. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1819. fi
  1820. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1821. ac_cv_have_kde="have_kde=no"
  1822. else
  1823. ac_cv_have_kde="have_kde=yes \
  1824. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1825. fi
  1826. else dnl test -z $1, e.g. from tdelibs
  1827. ac_cv_have_kde="have_kde=no"
  1828. fi
  1829. ])dnl
  1830. eval "$ac_cv_have_kde"
  1831. if test "$have_kde" != "yes"; then
  1832. if test "${prefix}" = NONE; then
  1833. ac_kde_prefix="$ac_default_prefix"
  1834. else
  1835. ac_kde_prefix="$prefix"
  1836. fi
  1837. if test "$exec_prefix" = NONE; then
  1838. ac_kde_exec_prefix="$ac_kde_prefix"
  1839. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1840. else
  1841. ac_kde_exec_prefix="$exec_prefix"
  1842. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1843. fi
  1844. kde_libraries="${libdir}"
  1845. kde_includes="${includedir}"
  1846. else
  1847. ac_cv_have_kde="have_kde=yes \
  1848. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1849. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1850. kde_libraries="$ac_kde_libraries"
  1851. kde_includes="$ac_kde_includes"
  1852. fi
  1853. AC_SUBST(kde_libraries)
  1854. AC_SUBST(kde_includes)
  1855. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1856. KDE_INCLUDES=""
  1857. else
  1858. KDE_INCLUDES="-I$kde_includes"
  1859. all_includes="$KDE_INCLUDES $all_includes"
  1860. fi
  1861. KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
  1862. KDE_LDFLAGS="-L$kde_libraries"
  1863. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1864. all_libraries="$KDE_LDFLAGS $all_libraries"
  1865. fi
  1866. AC_SUBST(KDE_LDFLAGS)
  1867. AC_SUBST(KDE_INCLUDES)
  1868. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1869. all_libraries="$all_libraries $USER_LDFLAGS"
  1870. all_includes="$all_includes $USER_INCLUDES"
  1871. AC_SUBST(all_includes)
  1872. AC_SUBST(all_libraries)
  1873. if test -z "$1"; then
  1874. KDE_CHECK_UIC_PLUGINS
  1875. fi
  1876. ac_kde_libraries="$kde_libdir"
  1877. AC_SUBST(AUTODIRS)
  1878. ])
  1879. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1880. [
  1881. AC_MSG_CHECKING(for extra includes)
  1882. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1883. kde_use_extra_includes="$withval",
  1884. kde_use_extra_includes=NONE
  1885. )
  1886. kde_extra_includes=
  1887. if test -n "$kde_use_extra_includes" && \
  1888. test "$kde_use_extra_includes" != "NONE"; then
  1889. ac_save_ifs=$IFS
  1890. IFS=':'
  1891. for dir in $kde_use_extra_includes; do
  1892. kde_extra_includes="$kde_extra_includes $dir"
  1893. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1894. done
  1895. IFS=$ac_save_ifs
  1896. kde_use_extra_includes="added"
  1897. else
  1898. kde_use_extra_includes="no"
  1899. fi
  1900. AC_SUBST(USER_INCLUDES)
  1901. AC_MSG_RESULT($kde_use_extra_includes)
  1902. kde_extra_libs=
  1903. AC_MSG_CHECKING(for extra libs)
  1904. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1905. kde_use_extra_libs=$withval,
  1906. kde_use_extra_libs=NONE
  1907. )
  1908. if test -n "$kde_use_extra_libs" && \
  1909. test "$kde_use_extra_libs" != "NONE"; then
  1910. ac_save_ifs=$IFS
  1911. IFS=':'
  1912. for dir in $kde_use_extra_libs; do
  1913. kde_extra_libs="$kde_extra_libs $dir"
  1914. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1915. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1916. done
  1917. IFS=$ac_save_ifs
  1918. kde_use_extra_libs="added"
  1919. else
  1920. kde_use_extra_libs="no"
  1921. fi
  1922. AC_SUBST(USER_LDFLAGS)
  1923. AC_MSG_RESULT($kde_use_extra_libs)
  1924. ])
  1925. AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
  1926. [
  1927. AC_MSG_CHECKING([for TDE headers installed])
  1928. AC_LANG_SAVE
  1929. AC_LANG_CPLUSPLUS
  1930. cat > conftest.$ac_ext <<EOF
  1931. #ifdef STDC_HEADERS
  1932. # include <stdlib.h>
  1933. #endif
  1934. #include <stdio.h>
  1935. #include "confdefs.h"
  1936. #include <kapp.h>
  1937. int main() {
  1938. printf("kde_htmldir=\\"%s\\"\n", TDEApplication::kde_htmldir().data());
  1939. printf("kde_appsdir=\\"%s\\"\n", TDEApplication::kde_appsdir().data());
  1940. printf("kde_icondir=\\"%s\\"\n", TDEApplication::kde_icondir().data());
  1941. printf("kde_sounddir=\\"%s\\"\n", TDEApplication::kde_sounddir().data());
  1942. printf("kde_datadir=\\"%s\\"\n", TDEApplication::kde_datadir().data());
  1943. printf("kde_locale=\\"%s\\"\n", TDEApplication::kde_localedir().data());
  1944. printf("kde_cgidir=\\"%s\\"\n", TDEApplication::kde_cgidir().data());
  1945. printf("kde_confdir=\\"%s\\"\n", TDEApplication::kde_configdir().data());
  1946. printf("kde_mimedir=\\"%s\\"\n", TDEApplication::kde_mimedir().data());
  1947. printf("kde_toolbardir=\\"%s\\"\n", TDEApplication::kde_toolbardir().data());
  1948. printf("kde_wallpaperdir=\\"%s\\"\n",
  1949. TDEApplication::kde_wallpaperdir().data());
  1950. printf("kde_bindir=\\"%s\\"\n", TDEApplication::kde_bindir().data());
  1951. printf("kde_partsdir=\\"%s\\"\n", TDEApplication::kde_partsdir().data());
  1952. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1953. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1954. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1955. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1956. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1957. printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
  1958. printf("xdg_menudir=\\"/tmp/dummy\\"\n");
  1959. printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
  1960. printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
  1961. return 0;
  1962. }
  1963. EOF
  1964. ac_save_CPPFLAGS=$CPPFLAGS
  1965. CPPFLAGS="$all_includes $CPPFLAGS"
  1966. if AC_TRY_EVAL(ac_compile); then
  1967. AC_MSG_RESULT(yes)
  1968. else
  1969. AC_MSG_ERROR([your system is not able to compile a small TDE application!
  1970. Check, if you installed the TDE header files correctly.
  1971. For more details about this problem, look at the end of config.log.])
  1972. fi
  1973. CPPFLAGS=$ac_save_CPPFLAGS
  1974. AC_LANG_RESTORE
  1975. ])
  1976. AC_DEFUN([KDE_CHECK_KDEQTADDON],
  1977. [
  1978. AC_MSG_CHECKING(for kde-qt-addon)
  1979. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1980. [
  1981. kde_ldflags_safe="$LDFLAGS"
  1982. kde_libs_safe="$LIBS"
  1983. kde_cxxflags_safe="$CXXFLAGS"
  1984. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1985. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1986. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1987. if test "$kde_qtver" = "3"; then
  1988. if $PKG_CONFIG --exists qt-mt ; then
  1989. AC_TRY_LINK([
  1990. #include <qdom.h>
  1991. ],
  1992. [
  1993. QDomDocument doc;
  1994. ],
  1995. kde_cv_have_kdeqtaddon=yes,
  1996. kde_cv_have_kdeqtaddon=no
  1997. )
  1998. else
  1999. AC_TRY_LINK([
  2000. #include <tqdom.h>
  2001. ],
  2002. [
  2003. TQDomDocument doc;
  2004. ],
  2005. kde_cv_have_kdeqtaddon=yes,
  2006. kde_cv_have_kdeqtaddon=no
  2007. )
  2008. fi
  2009. fi
  2010. if test "$kde_qtver" = "4"; then
  2011. AC_TRY_LINK([
  2012. #include <Qt/qdom.h>
  2013. ],
  2014. [
  2015. QDomDocument doc;
  2016. ],
  2017. kde_cv_have_kdeqtaddon=yes,
  2018. kde_cv_have_kdeqtaddon=no
  2019. )
  2020. LDFLAGS=$kde_ldflags_safe
  2021. LIBS=$kde_libs_safe
  2022. CXXFLAGS=$kde_cxxflags_safe
  2023. ])
  2024. fi
  2025. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  2026. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  2027. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  2028. It is a separate package (and CVS module) named kde-qt-addon.])
  2029. fi
  2030. ])
  2031. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  2032. [
  2033. AC_REQUIRE([KDE_MISC_TESTS])
  2034. AC_REQUIRE([KDE_CHECK_LIBDL])
  2035. AC_REQUIRE([K_PATH_X])
  2036. if test $kde_qtver = 4; then
  2037. case $host in
  2038. *cygwin*) lib_kded="-ltdeinit_kded" ;;
  2039. *) lib_kded="" ;;
  2040. esac
  2041. AC_SUBST(LIB_KDED, $lib_kded)
  2042. AC_SUBST(LIB_TDECORE, "-ltdecore")
  2043. AC_SUBST(LIB_TDEUI, "-ltdeui")
  2044. AC_SUBST(LIB_KIO, "-ltdeio")
  2045. AC_SUBST(LIB_KJS, "-lkjs")
  2046. AC_SUBST(LIB_SMB, "-lsmb")
  2047. AC_SUBST(LIB_KAB, "-lkab")
  2048. AC_SUBST(LIB_KABC, "-lkabc")
  2049. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  2050. AC_SUBST(LIB_KSPELL, "-ltdespell")
  2051. AC_SUBST(LIB_KPARTS, "-ltdeparts")
  2052. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  2053. AC_SUBST(LIB_KUTILS, "-ltdeutils")
  2054. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  2055. AC_SUBST(LIB_KIMPROXY, "-ltdeimproxy")
  2056. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  2057. AC_SUBST(LIB_KDNSSD, "-ltdednssd")
  2058. AC_SUBST(LIB_KUNITTEST, "-ltdeunittest")
  2059. # these are for backward compatibility
  2060. AC_SUBST(LIB_KSYCOCA, "-ltdeio")
  2061. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  2062. elif test $kde_qtver = 3; then
  2063. case $host in
  2064. *cygwin*) lib_kded="-ltdeinit_kded" ;;
  2065. *) lib_kded="" ;;
  2066. esac
  2067. AC_SUBST(LIB_KDED, $lib_kded)
  2068. AC_SUBST(LIB_TDECORE, "-ltdecore")
  2069. AC_SUBST(LIB_TDEUI, "-ltdeui")
  2070. AC_SUBST(LIB_KIO, "-ltdeio")
  2071. AC_SUBST(LIB_KJS, "-lkjs")
  2072. AC_SUBST(LIB_SMB, "-lsmb")
  2073. AC_SUBST(LIB_KAB, "-lkab")
  2074. AC_SUBST(LIB_KABC, "-lkabc")
  2075. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  2076. AC_SUBST(LIB_KSPELL, "-ltdespell")
  2077. AC_SUBST(LIB_KPARTS, "-ltdeparts")
  2078. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  2079. AC_SUBST(LIB_KUTILS, "-ltdeutils")
  2080. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  2081. AC_SUBST(LIB_KIMPROXY, "-ltdeimproxy")
  2082. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  2083. AC_SUBST(LIB_KDNSSD, "-ltdednssd")
  2084. AC_SUBST(LIB_KUNITTEST, "-ltdeunittest")
  2085. # these are for backward compatibility
  2086. AC_SUBST(LIB_KSYCOCA, "-ltdeio")
  2087. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  2088. elif test $kde_qtver = 2; then
  2089. AC_SUBST(LIB_TDECORE, "-ltdecore")
  2090. AC_SUBST(LIB_TDEUI, "-ltdeui")
  2091. AC_SUBST(LIB_KIO, "-ltdeio")
  2092. AC_SUBST(LIB_KSYCOCA, "-ltdesycoca")
  2093. AC_SUBST(LIB_SMB, "-lsmb")
  2094. AC_SUBST(LIB_TDEFILE, "-ltdefile")
  2095. AC_SUBST(LIB_KAB, "-lkab")
  2096. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  2097. AC_SUBST(LIB_KSPELL, "-ltdespell")
  2098. AC_SUBST(LIB_KPARTS, "-ltdeparts")
  2099. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  2100. else
  2101. AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_QT)")
  2102. AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
  2103. AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
  2104. AC_SUBST(LIB_TDEFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
  2105. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
  2106. fi
  2107. ])
  2108. AC_DEFUN([AC_PATH_KDE],
  2109. [
  2110. AC_BASE_PATH_KDE
  2111. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  2112. [
  2113. if test "$enableval" = "no";
  2114. then ac_use_path_checking="default"
  2115. else ac_use_path_checking=""
  2116. fi
  2117. ],
  2118. [
  2119. if test "$kde_qtver" = 1;
  2120. then ac_use_path_checking=""
  2121. else ac_use_path_checking="default"
  2122. fi
  2123. ]
  2124. )
  2125. AC_CREATE_KFSSTND($ac_use_path_checking)
  2126. AC_SUBST_KFSSTND
  2127. KDE_CREATE_LIBS_ALIASES
  2128. ])
  2129. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  2130. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  2131. [
  2132. AC_MSG_CHECKING(for $1)
  2133. AC_CACHE_VAL(kde_cv_func_$1,
  2134. [
  2135. AC_LANG_SAVE
  2136. AC_LANG_CPLUSPLUS
  2137. save_CXXFLAGS="$CXXFLAGS"
  2138. kde_safe_LIBS="$LIBS"
  2139. LIBS="$LIBS $X_EXTRA_LIBS"
  2140. if test "$GXX" = "yes"; then
  2141. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  2142. fi
  2143. if test -z "$qt_includes"; then
  2144. CXXFLAGS="$CXXFLAGS"
  2145. else
  2146. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  2147. fi
  2148. AC_TRY_COMPILE([
  2149. $2
  2150. ],
  2151. [
  2152. $3
  2153. ],
  2154. kde_cv_func_$1=yes,
  2155. kde_cv_func_$1=no)
  2156. CXXFLAGS="$save_CXXFLAGS"
  2157. LIBS="$kde_safe_LIBS"
  2158. AC_LANG_RESTORE
  2159. ])
  2160. AC_MSG_RESULT($kde_cv_func_$1)
  2161. AC_MSG_CHECKING([if $1 needs custom prototype])
  2162. AC_CACHE_VAL(kde_cv_proto_$1,
  2163. [
  2164. if test "x$kde_cv_func_$1" = xyes; then
  2165. kde_cv_proto_$1=no
  2166. else
  2167. case "$1" in
  2168. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  2169. kde_cv_proto_$1="yes - in libtdefakes"
  2170. ;;
  2171. *)
  2172. kde_cv_proto_$1=unknown
  2173. ;;
  2174. esac
  2175. fi
  2176. if test "x$kde_cv_proto_$1" = xunknown; then
  2177. AC_LANG_SAVE
  2178. AC_LANG_CPLUSPLUS
  2179. kde_safe_libs=$LIBS
  2180. LIBS="$LIBS $X_EXTRA_LIBS"
  2181. AC_TRY_LINK([
  2182. $2
  2183. extern "C" $4;
  2184. ],
  2185. [
  2186. $3
  2187. ],
  2188. [ kde_cv_func_$1=yes
  2189. kde_cv_proto_$1=yes ],
  2190. [kde_cv_proto_$1="$1 unavailable"]
  2191. )
  2192. LIBS=$kde_safe_libs
  2193. AC_LANG_RESTORE
  2194. fi
  2195. ])
  2196. AC_MSG_RESULT($kde_cv_proto_$1)
  2197. if test "x$kde_cv_func_$1" = xyes; then
  2198. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  2199. $6
  2200. fi
  2201. if test "x$kde_cv_proto_$1" = xno; then
  2202. AC_DEFINE(HAVE_$5_PROTO, 1,
  2203. [Define if you have the $1 prototype])
  2204. fi
  2205. AH_VERBATIM([_HAVE_$5_PROTO],
  2206. [
  2207. #if !defined(HAVE_$5_PROTO)
  2208. #ifdef __cplusplus
  2209. extern "C" {
  2210. #endif
  2211. $4;
  2212. #ifdef __cplusplus
  2213. }
  2214. #endif
  2215. #endif
  2216. ])
  2217. ])
  2218. AC_DEFUN([AC_CHECK_SETENV],
  2219. [
  2220. KDE_CHECK_FUNC_EXT(setenv, [
  2221. #include <stdlib.h>
  2222. ],
  2223. [setenv("VAR", "VALUE", 1);],
  2224. [int setenv (const char *, const char *, int)],
  2225. [SETENV])
  2226. ])
  2227. AC_DEFUN([AC_CHECK_UNSETENV],
  2228. [
  2229. KDE_CHECK_FUNC_EXT(unsetenv, [
  2230. #include <stdlib.h>
  2231. ],
  2232. [unsetenv("VAR");],
  2233. [void unsetenv (const char *)],
  2234. [UNSETENV])
  2235. ])
  2236. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  2237. [
  2238. KDE_CHECK_FUNC_EXT(getdomainname, [
  2239. #include <stdlib.h>
  2240. #include <unistd.h>
  2241. #include <netdb.h>
  2242. ],
  2243. [
  2244. char buffer[200];
  2245. getdomainname(buffer, 200);
  2246. ],
  2247. [#include <sys/types.h>
  2248. int getdomainname (char *, size_t)],
  2249. [GETDOMAINNAME])
  2250. ])
  2251. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  2252. [
  2253. KDE_CHECK_FUNC_EXT(gethostname, [
  2254. #include <stdlib.h>
  2255. #include <unistd.h>
  2256. ],
  2257. [
  2258. char buffer[200];
  2259. gethostname(buffer, 200);
  2260. ],
  2261. [int gethostname (char *, unsigned int)],
  2262. [GETHOSTNAME])
  2263. ])
  2264. AC_DEFUN([AC_CHECK_USLEEP],
  2265. [
  2266. KDE_CHECK_FUNC_EXT(usleep, [
  2267. #include <unistd.h>
  2268. ],
  2269. [
  2270. usleep(200);
  2271. ],
  2272. [int usleep (unsigned int)],
  2273. [USLEEP])
  2274. ])
  2275. AC_DEFUN([AC_CHECK_RANDOM],
  2276. [
  2277. KDE_CHECK_FUNC_EXT(random, [
  2278. #include <stdlib.h>
  2279. ],
  2280. [
  2281. random();
  2282. ],
  2283. [long int random(void)],
  2284. [RANDOM])
  2285. KDE_CHECK_FUNC_EXT(srandom, [
  2286. #include <stdlib.h>
  2287. ],
  2288. [
  2289. srandom(27);
  2290. ],
  2291. [void srandom(unsigned int)],
  2292. [SRANDOM])
  2293. ])
  2294. AC_DEFUN([AC_CHECK_INITGROUPS],
  2295. [
  2296. KDE_CHECK_FUNC_EXT(initgroups, [
  2297. #include <sys/types.h>
  2298. #include <unistd.h>
  2299. #include <grp.h>
  2300. ],
  2301. [
  2302. char buffer[200];
  2303. initgroups(buffer, 27);
  2304. ],
  2305. [int initgroups(const char *, gid_t)],
  2306. [INITGROUPS])
  2307. ])
  2308. AC_DEFUN([AC_CHECK_MKSTEMPS],
  2309. [
  2310. KDE_CHECK_FUNC_EXT(mkstemps, [
  2311. #include <stdlib.h>
  2312. #include <unistd.h>
  2313. ],
  2314. [
  2315. mkstemps("/tmp/aaaXXXXXX", 6);
  2316. ],
  2317. [int mkstemps(char *, int)],
  2318. [MKSTEMPS])
  2319. ])
  2320. AC_DEFUN([AC_CHECK_MKSTEMP],
  2321. [
  2322. KDE_CHECK_FUNC_EXT(mkstemp, [
  2323. #include <stdlib.h>
  2324. #include <unistd.h>
  2325. ],
  2326. [
  2327. mkstemp("/tmp/aaaXXXXXX");
  2328. ],
  2329. [int mkstemp(char *)],
  2330. [MKSTEMP])
  2331. ])
  2332. AC_DEFUN([AC_CHECK_MKDTEMP],
  2333. [
  2334. KDE_CHECK_FUNC_EXT(mkdtemp, [
  2335. #include <stdlib.h>
  2336. #include <unistd.h>
  2337. ],
  2338. [
  2339. mkdtemp("/tmp/aaaXXXXXX");
  2340. ],
  2341. [char *mkdtemp(char *)],
  2342. [MKDTEMP])
  2343. ])
  2344. AC_DEFUN([AC_CHECK_RES_INIT],
  2345. [
  2346. AC_MSG_CHECKING([if res_init needs -lresolv])
  2347. kde_libs_safe="$LIBS"
  2348. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  2349. AC_TRY_LINK(
  2350. [
  2351. #include <sys/types.h>
  2352. #include <netinet/in.h>
  2353. #include <arpa/nameser.h>
  2354. #include <resolv.h>
  2355. ],
  2356. [
  2357. res_init();
  2358. ],
  2359. [
  2360. LIBRESOLV="-lresolv"
  2361. AC_MSG_RESULT(yes)
  2362. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  2363. ],
  2364. [ AC_MSG_RESULT(no) ]
  2365. )
  2366. LIBS=$kde_libs_safe
  2367. AC_SUBST(LIBRESOLV)
  2368. KDE_CHECK_FUNC_EXT(res_init,
  2369. [
  2370. #include <sys/types.h>
  2371. #include <netinet/in.h>
  2372. #include <arpa/nameser.h>
  2373. #include <resolv.h>
  2374. ],
  2375. [res_init()],
  2376. [int res_init(void)],
  2377. [RES_INIT])
  2378. ])
  2379. AC_DEFUN([AC_CHECK_STRLCPY],
  2380. [
  2381. KDE_CHECK_FUNC_EXT(strlcpy, [
  2382. #include <string.h>
  2383. ],
  2384. [ char buf[20];
  2385. strlcpy(buf, "TDE function test", sizeof(buf));
  2386. ],
  2387. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2388. [STRLCPY])
  2389. ])
  2390. AC_DEFUN([AC_CHECK_STRLCAT],
  2391. [
  2392. KDE_CHECK_FUNC_EXT(strlcat, [
  2393. #include <string.h>
  2394. ],
  2395. [ char buf[20];
  2396. buf[0]='\0';
  2397. strlcat(buf, "TDE function test", sizeof(buf));
  2398. ],
  2399. [unsigned long strlcat(char*, const char*, unsigned long)],
  2400. [STRLCAT])
  2401. ])
  2402. AC_DEFUN([AC_CHECK_RES_QUERY],
  2403. [
  2404. KDE_CHECK_FUNC_EXT(res_query, [
  2405. #include <sys/types.h>
  2406. #include <netinet/in.h>
  2407. #include <arpa/nameser.h>
  2408. #include <resolv.h>
  2409. #include <netdb.h>
  2410. ],
  2411. [
  2412. res_query(NULL, 0, 0, NULL, 0);
  2413. ],
  2414. [int res_query(const char *, int, int, unsigned char *, int)],
  2415. [RES_QUERY])
  2416. ])
  2417. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2418. [
  2419. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2420. #include <sys/types.h>
  2421. #include <netinet/in.h>
  2422. #include <arpa/nameser.h>
  2423. #include <resolv.h>
  2424. ],
  2425. [
  2426. dn_skipname (NULL, NULL);
  2427. ],
  2428. [int dn_skipname (unsigned char *, unsigned char *)],
  2429. [DN_SKIPNAME])
  2430. ])
  2431. AC_DEFUN([AC_FIND_GIF],
  2432. [AC_MSG_CHECKING([for giflib])
  2433. AC_CACHE_VAL(ac_cv_lib_gif,
  2434. [ac_save_LIBS="$LIBS"
  2435. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2436. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2437. else
  2438. LIBS="$all_libraries -lgif"
  2439. fi
  2440. AC_TRY_LINK(dnl
  2441. [
  2442. #ifdef __cplusplus
  2443. extern "C" {
  2444. #endif
  2445. int GifLastError(void);
  2446. #ifdef __cplusplus
  2447. }
  2448. #endif
  2449. /* We use char because int might match the return type of a gcc2
  2450. builtin and then its argument prototype would still apply. */
  2451. ],
  2452. [return GifLastError();],
  2453. eval "ac_cv_lib_gif=yes",
  2454. eval "ac_cv_lib_gif=no")
  2455. LIBS="$ac_save_LIBS"
  2456. ])dnl
  2457. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2458. AC_MSG_RESULT(yes)
  2459. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2460. else
  2461. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2462. fi
  2463. ])
  2464. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2465. [
  2466. AC_MSG_CHECKING([for libjpeg$2])
  2467. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2468. [
  2469. ac_save_LIBS="$LIBS"
  2470. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2471. ac_save_CFLAGS="$CFLAGS"
  2472. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2473. AC_TRY_LINK(
  2474. [
  2475. #ifdef __cplusplus
  2476. extern "C" {
  2477. #endif
  2478. void jpeg_CreateDecompress();
  2479. #ifdef __cplusplus
  2480. }
  2481. #endif
  2482. ],
  2483. [jpeg_CreateDecompress();],
  2484. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2485. eval "ac_cv_lib_jpeg_$1=no")
  2486. LIBS="$ac_save_LIBS"
  2487. CFLAGS="$ac_save_CFLAGS"
  2488. ])
  2489. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2490. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2491. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2492. else
  2493. AC_MSG_RESULT(no)
  2494. $3
  2495. fi
  2496. ])
  2497. AC_DEFUN([AC_FIND_JPEG],
  2498. [
  2499. dnl first look for libraries
  2500. KDE_FIND_JPEG_HELPER(6b, 6b,
  2501. KDE_FIND_JPEG_HELPER(normal, [],
  2502. [
  2503. LIBJPEG=
  2504. ]
  2505. )
  2506. )
  2507. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2508. dnl requires system dependent includes loaded before it)
  2509. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2510. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2511. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2512. dnl if headers _and_ libraries are missing, this is no error, and we
  2513. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2514. dnl if only one is missing, it means a configuration error, but we still
  2515. dnl only warn
  2516. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2517. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2518. else
  2519. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2520. AC_MSG_WARN([
  2521. There is an installation error in jpeg support. You seem to have only one
  2522. of either the headers _or_ the libraries installed. You may need to either
  2523. provide correct --with-extra-... options, or the development package of
  2524. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2525. Disabling JPEG support.
  2526. ])
  2527. else
  2528. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2529. fi
  2530. jpeg_incdir=
  2531. LIBJPEG=
  2532. fi
  2533. AC_SUBST(LIBJPEG)
  2534. AH_VERBATIM(_AC_CHECK_JPEG,
  2535. [/*
  2536. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2537. * headers and I'm too lazy to write a configure test as long as only
  2538. * unixware is related
  2539. */
  2540. #ifdef _UNIXWARE
  2541. #define HAVE_BOOLEAN
  2542. #endif
  2543. ])
  2544. ])
  2545. AC_DEFUN([KDE_CHECK_TQT],
  2546. [
  2547. AC_MSG_CHECKING([if TQt is available])
  2548. AC_CACHE_VAL(kde_cv_tqt,
  2549. [
  2550. AC_LANG_SAVE
  2551. AC_LANG_CPLUSPLUS
  2552. ac_save_LIBS="$LIBS"
  2553. LIBS="$all_libraries $USER_LDFLAGS $LIBQT -ltqt"
  2554. ac_save_CXXFLAGS="$CXXFLAGS"
  2555. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2556. if test "$kde_qtver" -gt "2"; then
  2557. AC_TRY_LINK(
  2558. [#include <tqtimer.h>],
  2559. [
  2560. TQTimer *test_timer(0);
  2561. test_timer->start(1000);],
  2562. eval "kde_cv_tqt=no",
  2563. eval "kde_cv_tqt=yes")
  2564. fi
  2565. LIBS="$ac_save_LIBS"
  2566. CXXFLAGS="$ac_save_CXXFLAGS"
  2567. AC_LANG_RESTORE
  2568. ])
  2569. if eval "test ! \"`echo $kde_cv_tqt`\" = no"; then
  2570. AC_MSG_RESULT(no)
  2571. dnl AC_MSG_ERROR([You are attempting to compile Trinity without the Trinity Qt Interface installed. Please install libtqtinterface-dev and try again!])
  2572. AC_MSG_WARN([You are attempting to compile Trinity without the Trinity Qt Interface installed. Please install libtqtinterface-dev and try again!])
  2573. TQTMOC="\$PATH=\$PATH:\$(srcdir)/ tmoc"
  2574. LIBTQT_LDFLAGS="-ltqt"
  2575. AC_SUBST(LIBTQT_LDFLAGS)
  2576. qtlib="$qtlib $LIBTQT_LDFLAGS"
  2577. else
  2578. AC_MSG_RESULT(yes)
  2579. LIBTQT_LDFLAGS="-ltqt"
  2580. AC_SUBST(LIBTQT_LDFLAGS)
  2581. dnl all_libraries="$all_libraries $LIBTQT_LDFLAGS"
  2582. QT_LDFLAGS="$QT_LDFLAGS $LIBTQT_LDFLAGS"
  2583. AC_SUBST(QT_LDFLAGS)
  2584. qtlib="$qtlib $LIBTQT_LDFLAGS"
  2585. LIBTQT_CXXFLAGS="-include tqt.h"
  2586. all_includes="$all_includes $LIBTQT_CXXFLAGS"
  2587. QT_INCLUDES="$QT_INCLUDES $LIBTQT_CXXFLAGS"
  2588. KDE_FIND_PATH(tmoc, TQTMOC, [$qt_bindirs], [KDE_TQTMOC_ERROR_MESSAGE])
  2589. AC_SUBST(TQTMOC)
  2590. KDE_FIND_PATH(dcopidl, TQTDCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  2591. KDE_FIND_PATH(dcopidl2cpp, TQTDCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  2592. if test "$build_arts" '!=' "no"; then
  2593. KDE_FIND_PATH(mcopidl, TQTMCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  2594. fi
  2595. if test -n "$trinity14ornewer"; then
  2596. KDE_FIND_PATH(dcopidlng, TQTDCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  2597. fi
  2598. AC_SUBST(TQTDCOPIDL)
  2599. AC_SUBST(TQTMCOPIDL)
  2600. AC_SUBST(TQTDCOPIDLNG)
  2601. AC_SUBST(TQTDCOPIDL2CPP)
  2602. fi
  2603. ])
  2604. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2605. [
  2606. if test -n "$LIBJPEG"; then
  2607. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2608. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2609. [
  2610. AC_LANG_SAVE
  2611. AC_LANG_CPLUSPLUS
  2612. ac_save_LIBS="$LIBS"
  2613. LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
  2614. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2615. ac_save_CXXFLAGS="$CXXFLAGS"
  2616. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2617. if test "$kde_qtver" = "4"; then
  2618. AC_TRY_LINK(
  2619. [#include <Qt/qapplication.h>],
  2620. [
  2621. int argc;
  2622. char** argv;
  2623. QApplication app(argc, argv);],
  2624. eval "kde_cv_qt_jpeg=no",
  2625. eval "kde_cv_qt_jpeg=yes")
  2626. fi
  2627. if test "$kde_qtver" = "3"; then
  2628. if $PKG_CONFIG --exists qt-mt ; then
  2629. AC_TRY_LINK(
  2630. [#include <qapplication.h>],
  2631. [
  2632. int argc;
  2633. char** argv;
  2634. QApplication app(argc, argv);],
  2635. eval "kde_cv_qt_jpeg=no",
  2636. eval "kde_cv_qt_jpeg=yes")
  2637. else
  2638. AC_TRY_LINK(
  2639. [#include <tqapplication.h>],
  2640. [
  2641. int argc;
  2642. char** argv;
  2643. TQApplication app(argc, argv);],
  2644. eval "kde_cv_qt_jpeg=no",
  2645. eval "kde_cv_qt_jpeg=yes")
  2646. fi
  2647. fi
  2648. LIBS="$ac_save_LIBS"
  2649. CXXFLAGS="$ac_save_CXXFLAGS"
  2650. AC_LANG_RESTORE
  2651. fi
  2652. ])
  2653. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2654. AC_MSG_RESULT(yes)
  2655. LIBJPEG_QT='$(LIBJPEG)'
  2656. else
  2657. AC_MSG_RESULT(no)
  2658. LIBJPEG_QT=
  2659. fi
  2660. ])
  2661. AC_DEFUN([AC_FIND_ZLIB],
  2662. [
  2663. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2664. AC_MSG_CHECKING([for libz])
  2665. AC_CACHE_VAL(ac_cv_lib_z,
  2666. [
  2667. kde_save_LIBS="$LIBS"
  2668. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2669. kde_save_CFLAGS="$CFLAGS"
  2670. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2671. AC_TRY_LINK(dnl
  2672. [
  2673. #include<zlib.h>
  2674. #include<string.h>
  2675. ],
  2676. [
  2677. char buf[42];
  2678. gzFile f = (gzFile) 0;
  2679. /* this would segfault.. but we only link, don't run */
  2680. (void) gzgets(f, buf, sizeof(buf));
  2681. return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
  2682. ],
  2683. eval "ac_cv_lib_z='-lz'",
  2684. eval "ac_cv_lib_z=no")
  2685. LIBS="$kde_save_LIBS"
  2686. CFLAGS="$kde_save_CFLAGS"
  2687. ])dnl
  2688. if test ! "$ac_cv_lib_z" = no; then
  2689. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2690. LIBZ="$ac_cv_lib_z"
  2691. AC_MSG_RESULT($ac_cv_lib_z)
  2692. else
  2693. AC_MSG_ERROR(not found.
  2694. Possibly configure picks up an outdated version
  2695. installed by XFree86. Remove it from your system.
  2696. Check your installation and look into config.log)
  2697. LIBZ=""
  2698. fi
  2699. AC_SUBST(LIBZ)
  2700. ])
  2701. AC_DEFUN([KDE_TRY_TIFFLIB],
  2702. [
  2703. AC_MSG_CHECKING([for libtiff $1])
  2704. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2705. [
  2706. AC_LANG_SAVE
  2707. AC_LANG_CPLUSPLUS
  2708. kde_save_LIBS="$LIBS"
  2709. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2710. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2711. else
  2712. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2713. fi
  2714. kde_save_CXXFLAGS="$CXXFLAGS"
  2715. kde_save_LDFLAGS="$LDFLAGS"
  2716. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2717. LDFLAGS="$LDFLAGS -ltqt"
  2718. AC_TRY_LINK(dnl
  2719. [
  2720. #include<tiffio.h>
  2721. ],
  2722. [return (TIFFOpen( "", "r") == 0); ],
  2723. [
  2724. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2725. ], [
  2726. kde_cv_libtiff_$1=no
  2727. ])
  2728. LIBS="$kde_save_LIBS"
  2729. CXXFLAGS="$kde_save_CXXFLAGS"
  2730. LDFLAGS="$kde_save_LDFLAGS"
  2731. AC_LANG_RESTORE
  2732. ])
  2733. if test "$kde_cv_libtiff_$1" = "no"; then
  2734. AC_MSG_RESULT(no)
  2735. LIBTIFF=""
  2736. $3
  2737. else
  2738. LIBTIFF="$kde_cv_libtiff_$1"
  2739. AC_MSG_RESULT(yes)
  2740. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2741. $2
  2742. fi
  2743. ])
  2744. AC_DEFUN([AC_FIND_TIFF],
  2745. [
  2746. AC_REQUIRE([K_PATH_X])
  2747. AC_REQUIRE([AC_FIND_ZLIB])
  2748. AC_REQUIRE([AC_FIND_JPEG])
  2749. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2750. KDE_TRY_TIFFLIB(tiff, [],
  2751. KDE_TRY_TIFFLIB(tiff34))
  2752. AC_SUBST(LIBTIFF)
  2753. ])
  2754. AC_DEFUN([KDE_FIND_LIBEXR],
  2755. [
  2756. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2757. AC_REQUIRE([AC_FIND_ZLIB])
  2758. AC_CACHE_VAL(ac_cv_libexr,
  2759. [
  2760. if test -z "$PKG_CONFIG"; then
  2761. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2762. fi
  2763. AC_MSG_CHECKING([for OpenEXR libraries])
  2764. if test "$PKG_CONFIG" = "no" ; then
  2765. AC_MSG_RESULT(no)
  2766. echo "*** The pkg-config script could not be found. Make sure it is"
  2767. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2768. echo "*** to the full path to pkg-config."
  2769. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2770. else
  2771. if ! $PKG_CONFIG --exists OpenEXR ; then
  2772. AC_MSG_RESULT(no)
  2773. EXRSTATUS=no
  2774. else
  2775. if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
  2776. AC_MSG_RESULT(no)
  2777. EXRSTATUS=old
  2778. else
  2779. kde_save_LIBS="$LIBS"
  2780. LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
  2781. AC_LANG_SAVE
  2782. AC_LANG_CPLUSPLUS
  2783. kde_save_CXXFLAGS="$CXXFLAGS"
  2784. kde_save_LDFLAGS="$LDFLAGS"
  2785. LDFLAGS="$LFLAGS -ltqt"
  2786. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2787. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2788. AC_TRY_LINK(dnl
  2789. [
  2790. #include <ImfRgbaFile.h>
  2791. ],
  2792. [
  2793. using namespace Imf;
  2794. RgbaInputFile file ("dummy");
  2795. return 0;
  2796. ],
  2797. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2798. eval "ac_cv_libexr=no"
  2799. )
  2800. LIBS="$kde_save_LIBS"
  2801. CXXFLAGS="$kde_save_CXXFLAGS"
  2802. LDFLAGS="$kde_save_LDFLAGS"
  2803. AC_LANG_RESTORE
  2804. ])dnl
  2805. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2806. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2807. LIB_EXR="$ac_cv_libexr"
  2808. AC_MSG_RESULT($ac_cv_libexr)
  2809. else
  2810. AC_MSG_RESULT(no)
  2811. LIB_EXR=""
  2812. fi
  2813. fi
  2814. fi
  2815. fi
  2816. AC_SUBST(LIB_EXR)
  2817. AC_SUBST(EXR_FLAGS)
  2818. ])
  2819. AC_DEFUN([AC_FIND_PNG],
  2820. [
  2821. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2822. AC_REQUIRE([AC_FIND_ZLIB])
  2823. AC_MSG_CHECKING([for libpng])
  2824. AC_CACHE_VAL(ac_cv_lib_png,
  2825. [
  2826. kde_save_LIBS="$LIBS"
  2827. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2828. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2829. else
  2830. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2831. fi
  2832. kde_save_CFLAGS="$CFLAGS"
  2833. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2834. AC_TRY_LINK(dnl
  2835. [
  2836. #include<png.h>
  2837. ],
  2838. [
  2839. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2840. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2841. return( png_ptr != 0 );
  2842. ],
  2843. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2844. eval "ac_cv_lib_png=no"
  2845. )
  2846. LIBS="$kde_save_LIBS"
  2847. CFLAGS="$kde_save_CFLAGS"
  2848. ])dnl
  2849. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2850. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2851. LIBPNG="$ac_cv_lib_png"
  2852. AC_SUBST(LIBPNG)
  2853. AC_MSG_RESULT($ac_cv_lib_png)
  2854. else
  2855. AC_MSG_RESULT(no)
  2856. LIBPNG=""
  2857. AC_SUBST(LIBPNG)
  2858. fi
  2859. ])
  2860. AC_DEFUN([AC_FIND_JASPER],
  2861. [
  2862. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2863. AC_REQUIRE([AC_FIND_JPEG])
  2864. AC_MSG_CHECKING([for jasper])
  2865. AC_CACHE_VAL(ac_cv_jasper,
  2866. [
  2867. kde_save_LIBS="$LIBS"
  2868. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2869. kde_save_CFLAGS="$CFLAGS"
  2870. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2871. AC_TRY_LINK(dnl
  2872. [
  2873. #include<jasper/jasper.h>
  2874. ],
  2875. [
  2876. return( jas_init() );
  2877. ],
  2878. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2879. eval "ac_cv_jasper=no"
  2880. )
  2881. LIBS="$kde_save_LIBS"
  2882. CFLAGS="$kde_save_CFLAGS"
  2883. ])dnl
  2884. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2885. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2886. LIB_JASPER="$ac_cv_jasper"
  2887. AC_MSG_RESULT($ac_cv_jasper)
  2888. else
  2889. AC_MSG_RESULT(no)
  2890. LIB_JASPER=""
  2891. fi
  2892. AC_SUBST(LIB_JASPER)
  2893. ])
  2894. AC_DEFUN([AC_CHECK_BOOL],
  2895. [
  2896. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2897. ])
  2898. AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
  2899. [
  2900. AC_MSG_CHECKING(if you need GNU extensions)
  2901. AC_CACHE_VAL(ac_cv_gnu_extensions,
  2902. [
  2903. cat > conftest.c << EOF
  2904. #include <features.h>
  2905. #ifdef __GNU_LIBRARY__
  2906. yes
  2907. #endif
  2908. EOF
  2909. if (eval "$ac_cpp conftest.c") 2>&5 |
  2910. egrep "yes" >/dev/null 2>&1; then
  2911. rm -rf conftest*
  2912. ac_cv_gnu_extensions=yes
  2913. else
  2914. ac_cv_gnu_extensions=no
  2915. fi
  2916. ])
  2917. AC_MSG_RESULT($ac_cv_gnu_extensions)
  2918. if test "$ac_cv_gnu_extensions" = "yes"; then
  2919. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  2920. fi
  2921. ])
  2922. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2923. [
  2924. AC_MSG_CHECKING([whether $CXX supports -$1])
  2925. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2926. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2927. [
  2928. AC_LANG_SAVE
  2929. AC_LANG_CPLUSPLUS
  2930. save_CXXFLAGS="$CXXFLAGS"
  2931. CXXFLAGS="$CXXFLAGS -$1"
  2932. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2933. CXXFLAGS="$save_CXXFLAGS"
  2934. AC_LANG_RESTORE
  2935. ])
  2936. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2937. AC_MSG_RESULT(yes)
  2938. :
  2939. $2
  2940. else
  2941. AC_MSG_RESULT(no)
  2942. :
  2943. $3
  2944. fi
  2945. ])
  2946. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2947. [
  2948. AC_MSG_CHECKING([whether $CC supports -$1])
  2949. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2950. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2951. [
  2952. AC_LANG_SAVE
  2953. AC_LANG_C
  2954. save_CFLAGS="$CFLAGS"
  2955. CFLAGS="$CFLAGS -$1"
  2956. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2957. CFLAGS="$save_CFLAGS"
  2958. AC_LANG_RESTORE
  2959. ])
  2960. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2961. AC_MSG_RESULT(yes)
  2962. :
  2963. $2
  2964. else
  2965. AC_MSG_RESULT(no)
  2966. :
  2967. $3
  2968. fi
  2969. ])
  2970. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2971. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2972. dnl it's all white-space separated
  2973. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2974. [ __val=$$1
  2975. __forbid=" $2 "
  2976. if test -n "$__val"; then
  2977. __new=""
  2978. ac_save_IFS=$IFS
  2979. IFS=" "
  2980. for i in $__val; do
  2981. case "$__forbid" in
  2982. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2983. *) # Careful to not add spaces, where there were none, because otherwise
  2984. # libtool gets confused, if we change e.g. CXX
  2985. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2986. esac
  2987. done
  2988. IFS=$ac_save_IFS
  2989. $1=$__new
  2990. fi
  2991. ])
  2992. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2993. [
  2994. AC_MSG_CHECKING([whether $CC is blacklisted])
  2995. dnl In theory we have tu run this test against $CC and $CXX
  2996. dnl in C and in C++ mode, because its perfectly legal for
  2997. dnl the user to mix compiler versions, since C has a defined
  2998. dnl ABI.
  2999. dnl
  3000. dnl For now, we assume the user is not on crack.
  3001. AC_TRY_COMPILE([
  3002. #ifdef __GNUC__
  3003. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  3004. choke me
  3005. #endif
  3006. #endif
  3007. ], ,
  3008. kde_bad_compiler=no,
  3009. kde_bad_compiler=yes
  3010. )
  3011. AC_MSG_RESULT($kde_bad_compiler)
  3012. if test "$kde_bad_compiler" = "yes"; then
  3013. AC_MSG_ERROR([
  3014. This particular compiler version is blacklisted because it
  3015. is known to miscompile KDE. Please use a newer version, or
  3016. if that is not yet available, choose an older version.
  3017. Please do not report a bug or bother us reporting this
  3018. configure error. We know about it, and we introduced
  3019. it by intention to avoid untraceable bugs or crashes in KDE.
  3020. ])
  3021. fi
  3022. ])
  3023. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  3024. [
  3025. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  3026. kde_cv_opt_noinline_match,
  3027. [
  3028. kde_cv_opt_noinline_match=irrelevant
  3029. dnl if we don't use both -O2 and -fno-inline, this check is moot
  3030. if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
  3031. && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
  3032. ac_cflags_save="$CFLAGS"
  3033. CFLAGS="$CFLAGS -D_USE_GNU"
  3034. AC_TRY_LINK([
  3035. #include <string.h>
  3036. ], [ const char *pt, *et;
  3037. et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
  3038. ],
  3039. kde_cv_opt_noinline_match=yes,
  3040. kde_cv_opt_noinline_match=no
  3041. )
  3042. CFLAGS="$ac_cflags_save"
  3043. fi
  3044. ])
  3045. ])
  3046. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  3047. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  3048. [dnl
  3049. if test "x$kde_use_qt_emb" != "xyes"; then
  3050. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  3051. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  3052. else
  3053. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  3054. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  3055. fi
  3056. ])
  3057. AC_DEFUN([AC_CHECK_COMPILERS],
  3058. [
  3059. AC_ARG_ENABLE(debug,
  3060. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  3061. [
  3062. case $enableval in
  3063. yes)
  3064. kde_use_debug_code="yes"
  3065. kde_use_debug_define=no
  3066. ;;
  3067. full)
  3068. kde_use_debug_code="full"
  3069. kde_use_debug_define=no
  3070. ;;
  3071. *)
  3072. kde_use_debug_code="no"
  3073. kde_use_debug_define=yes
  3074. ;;
  3075. esac
  3076. ],
  3077. [kde_use_debug_code="no"
  3078. kde_use_debug_define=no
  3079. ])
  3080. dnl Just for configure --help
  3081. AC_ARG_ENABLE(dummyoption,
  3082. AC_HELP_STRING([--disable-debug],
  3083. [disables debug output and debug symbols [default=no]]),
  3084. [],[])
  3085. AC_ARG_ENABLE(strict,
  3086. AC_HELP_STRING([--enable-strict],
  3087. [compiles with strict compiler options (may not work!)]),
  3088. [
  3089. if test $enableval = "no"; then
  3090. kde_use_strict_options="no"
  3091. else
  3092. kde_use_strict_options="yes"
  3093. fi
  3094. ], [kde_use_strict_options="no"])
  3095. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  3096. [
  3097. if test $enableval = "no"; then
  3098. kde_use_warnings="no"
  3099. else
  3100. kde_use_warnings="yes"
  3101. fi
  3102. ], [kde_use_warnings="yes"])
  3103. dnl enable warnings for debug build
  3104. if test "$kde_use_debug_code" != "no"; then
  3105. kde_use_warnings=yes
  3106. fi
  3107. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  3108. [kde_use_profiling=$enableval],
  3109. [kde_use_profiling="no"]
  3110. )
  3111. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  3112. CFLAGS=" $CFLAGS"
  3113. AC_PROG_CC
  3114. AC_PROG_CPP
  3115. AC_C_BIGENDIAN
  3116. if test "$GCC" = "yes"; then
  3117. if test "$kde_use_debug_code" != "no"; then
  3118. if test $kde_use_debug_code = "full"; then
  3119. CFLAGS="-g3 -fno-inline $CFLAGS"
  3120. else
  3121. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  3122. fi
  3123. else
  3124. CFLAGS="-O2 $CFLAGS"
  3125. fi
  3126. fi
  3127. if test "$kde_use_debug_define" = "yes"; then
  3128. CFLAGS="-DNDEBUG $CFLAGS"
  3129. fi
  3130. case "$host" in
  3131. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  3132. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  3133. esac
  3134. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  3135. LDFLAGS=""
  3136. fi
  3137. CXXFLAGS=" $CXXFLAGS"
  3138. AC_PROG_CXX
  3139. KDE_CHECK_FOR_BAD_COMPILER
  3140. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  3141. if test "$kde_use_debug_code" != "no"; then
  3142. if test "$CXX" = "KCC"; then
  3143. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  3144. else
  3145. if test "$kde_use_debug_code" = "full"; then
  3146. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  3147. else
  3148. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  3149. fi
  3150. fi
  3151. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  3152. dnl convenience compiler flags
  3153. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  3154. AC_SUBST(WOVERLOADED_VIRTUAL)
  3155. else
  3156. if test "$CXX" = "KCC"; then
  3157. CXXFLAGS="+K3 $CXXFLAGS"
  3158. else
  3159. CXXFLAGS="-O2 $CXXFLAGS"
  3160. fi
  3161. fi
  3162. fi
  3163. if test "$kde_use_debug_define" = "yes"; then
  3164. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  3165. fi
  3166. if test "$kde_use_profiling" = "yes"; then
  3167. KDE_CHECK_COMPILER_FLAG(pg,
  3168. [
  3169. CFLAGS="-pg $CFLAGS"
  3170. CXXFLAGS="-pg $CXXFLAGS"
  3171. ])
  3172. fi
  3173. if test "$kde_use_warnings" = "yes"; then
  3174. if test "$GCC" = "yes"; then
  3175. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  3176. case $host in
  3177. *-*-linux-gnu)
  3178. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  3179. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
  3180. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  3181. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  3182. ;;
  3183. esac
  3184. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  3185. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  3186. dnl ### FIXME: revert for TDE 4
  3187. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  3188. fi
  3189. fi
  3190. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  3191. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  3192. fi
  3193. AC_ARG_ENABLE(pch,
  3194. AC_HELP_STRING([--enable-pch],
  3195. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  3196. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  3197. HAVE_GCC_VISIBILITY=0
  3198. AC_SUBST([HAVE_GCC_VISIBILITY])
  3199. if test "$GXX" = "yes"; then
  3200. gcc_no_reorder_blocks=NO
  3201. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  3202. if test $kde_use_debug_code != "no" && \
  3203. test $kde_use_debug_code != "full" && \
  3204. test "YES" = "$gcc_no_reorder_blocks" ; then
  3205. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  3206. CFLAGS="$CFLAGS -fno-reorder-blocks"
  3207. fi
  3208. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  3209. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  3210. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  3211. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  3212. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  3213. if test "$kde_use_pch" = "yes"; then
  3214. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  3215. echo >conftest.h
  3216. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  3217. kde_gcc_supports_pch=yes
  3218. AC_MSG_RESULT(yes)
  3219. else
  3220. kde_gcc_supports_pch=no
  3221. AC_MSG_RESULT(no)
  3222. fi
  3223. if test "$kde_gcc_supports_pch" = "yes"; then
  3224. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  3225. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  3226. kde_gcc_supports_pch=yes
  3227. AC_MSG_RESULT(yes)
  3228. else
  3229. kde_gcc_supports_pch=no
  3230. AC_MSG_RESULT(no)
  3231. fi
  3232. fi
  3233. rm -f conftest.h conftest.h.gch
  3234. fi
  3235. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  3236. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  3237. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  3238. fi
  3239. fi
  3240. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  3241. if test "$CXX" = "KCC"; then
  3242. dnl unfortunately we currently cannot disable exception support in KCC
  3243. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  3244. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  3245. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  3246. if test "$kde_use_pch" = "yes"; then
  3247. dnl TODO: support --pch-dir!
  3248. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  3249. dnl the below works (but the dir must exist), but it's
  3250. dnl useless for a whole package.
  3251. dnl The are precompiled headers for each source file, so when compiling
  3252. dnl from scratch, it doesn't make a difference, and they take up
  3253. dnl around ~5Mb _per_ sourcefile.
  3254. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  3255. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  3256. fi
  3257. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  3258. dnl all implementations that are defined inside the class {} declaration.
  3259. dnl because of templates-compatibility with broken gcc compilers, this
  3260. dnl can cause excessive inlining. This flag limits it to a sane level
  3261. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  3262. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  3263. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  3264. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  3265. dnl Some source files are shared between multiple executables
  3266. dnl (or libraries) and some of those need template instantiations.
  3267. dnl In that case KCC needs to compile those sources with
  3268. dnl --one_instantiation_per_object. To make it easy for us we compile
  3269. dnl _all_ objects with that flag (--one_per is a shorthand).
  3270. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  3271. fi
  3272. AC_SUBST(USE_EXCEPTIONS)
  3273. dnl obsolete macro - provided to keep things going
  3274. USE_RTTI=
  3275. AC_SUBST(USE_RTTI)
  3276. case "$host" in
  3277. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  3278. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  3279. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  3280. *-*-solaris*)
  3281. if test "$GXX" = yes; then
  3282. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  3283. if test ! -f $libstdcpp; then
  3284. AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
  3285. fi
  3286. fi
  3287. ;;
  3288. esac
  3289. AC_VALIDIFY_CXXFLAGS
  3290. AC_PROG_CXXCPP
  3291. if test "$GCC" = yes; then
  3292. NOOPT_CFLAGS=-O0
  3293. fi
  3294. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  3295. AC_ARG_ENABLE(coverage,
  3296. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  3297. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  3298. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  3299. ac_coverage_linker="-lgcc"
  3300. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  3301. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  3302. ac_coverage_linker=""
  3303. else
  3304. AC_MSG_ERROR([coverage with your compiler is not supported])
  3305. fi
  3306. CFLAGS="$CFLAGS $ac_coverage_compiler"
  3307. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  3308. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  3309. ])
  3310. AC_SUBST(NOOPT_CXXFLAGS)
  3311. AC_SUBST(NOOPT_CFLAGS)
  3312. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  3313. KDE_CHECK_NEW_LDFLAGS
  3314. KDE_CHECK_FINAL
  3315. KDE_CHECK_CLOSURE
  3316. KDE_CHECK_NMCHECK
  3317. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  3318. ])
  3319. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  3320. [
  3321. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  3322. [
  3323. AC_LANG_SAVE
  3324. AC_LANG_CPLUSPLUS
  3325. safe_CXXFLAGS=$CXXFLAGS
  3326. safe_LDFLAGS=$LDFLAGS