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 176KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450
  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 TQt 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 TQt meta object compiler (tmoc) found!
  235. Please check whether you installed the Trinity TQt 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 $TQTDIR/bin, and some more usual places
  284. dnl ------------------------------------------------------------------------
  285. dnl
  286. AC_DEFUN([AC_PATH_TQT_MOC_UIC],
  287. [
  288. AC_REQUIRE([KDE_CHECK_PERL])
  289. tqt_bindirs=""
  290. for dir in $kde_tqt_dirs; do
  291. tqt_bindirs="$tqt_bindirs $dir/bin $dir/src/moc"
  292. done
  293. tqt_bindirs="$tqt_bindirs /usr/bin /usr/X11R6/bin /usr/local/tqt/bin"
  294. if test ! "$ac_tqt_bindir" = "NO"; then
  295. tqt_bindirs="$ac_tqt_bindir $tqt_bindirs"
  296. fi
  297. if test "$kde_tqtver" = "3"; then
  298. tqt_bindirs="/usr/share/tqt3/bin $tqt_bindirs"
  299. fi
  300. KDE_FIND_PATH(tqmoc, MOC, [$tqt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  301. if test -z "$UIC_NOT_NEEDED"; then
  302. if test $kde_tqtver = 3; then
  303. KDE_FIND_PATH(uic-tqt, UIC_PATH, [$tqt_bindirs], [UIC_PATH=""])
  304. fi
  305. if test -z "$UIC_PATH" ; then
  306. KDE_UIC_ERROR_MESSAGE
  307. exit 1
  308. else
  309. UIC=$UIC_PATH
  310. if test $kde_tqtver = 3; then
  311. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  312. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  313. if test x$ac_uic_supports_libpath = xyes; then
  314. UIC="$UIC -L \$(kde_widgetdir)"
  315. fi
  316. if test x$ac_uic_supports_nounload = xyes; then
  317. UIC="$UIC -nounload"
  318. fi
  319. fi
  320. fi
  321. else
  322. UIC="echo uic not available: "
  323. fi
  324. AC_SUBST(MOC)
  325. AC_SUBST(UIC)
  326. UIC_TR="i18n"
  327. if test $kde_tqtver = 3; then
  328. UIC_TR="tr2i18n"
  329. fi
  330. AC_SUBST(UIC_TR)
  331. ])
  332. AC_DEFUN([KDE_SET_PATHS],
  333. [
  334. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  335. kde_htmldir=\"$kde_htmldir\" \
  336. kde_appsdir=\"$kde_appsdir\" \
  337. kde_icondir=\"$kde_icondir\" \
  338. kde_sounddir=\"$kde_sounddir\" \
  339. kde_datadir=\"$kde_datadir\" \
  340. kde_locale=\"$kde_locale\" \
  341. kde_cgidir=\"$kde_cgidir\" \
  342. kde_confdir=\"$kde_confdir\" \
  343. kde_kcfgdir=\"$kde_kcfgdir\" \
  344. kde_mimedir=\"$kde_mimedir\" \
  345. kde_toolbardir=\"$kde_toolbardir\" \
  346. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  347. kde_templatesdir=\"$kde_templatesdir\" \
  348. kde_bindir=\"$kde_bindir\" \
  349. kde_servicesdir=\"$kde_servicesdir\" \
  350. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  351. kde_moduledir=\"$kde_moduledir\" \
  352. kde_styledir=\"$kde_styledir\" \
  353. kde_widgetdir=\"$kde_widgetdir\" \
  354. xdg_appsdir=\"$xdg_appsdir\" \
  355. xdg_menudir=\"$xdg_menudir\" \
  356. xdg_directorydir=\"$xdg_directorydir\" \
  357. kde_result=$1"
  358. ])
  359. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  360. [
  361. if test "$1" = "default"; then
  362. if test -z "$kde_htmldir"; then
  363. kde_htmldir='\${datadir}/doc/tde/HTML'
  364. fi
  365. if test -z "$kde_appsdir"; then
  366. kde_appsdir='\${datadir}/applnk'
  367. fi
  368. if test -z "$kde_icondir"; then
  369. kde_icondir='\${datadir}/icons'
  370. fi
  371. if test -z "$kde_sounddir"; then
  372. kde_sounddir='\${datadir}/sounds'
  373. fi
  374. if test -z "$kde_datadir"; then
  375. kde_datadir='\${datadir}/apps'
  376. fi
  377. if test -z "$kde_locale"; then
  378. kde_locale='\${datadir}/locale'
  379. fi
  380. if test -z "$kde_cgidir"; then
  381. kde_cgidir='\${exec_prefix}/cgi-bin'
  382. fi
  383. if test -z "$kde_confdir"; then
  384. kde_confdir='\${datadir}/config'
  385. fi
  386. if test -z "$kde_kcfgdir"; then
  387. kde_kcfgdir='\${datadir}/config.kcfg'
  388. fi
  389. if test -z "$kde_mimedir"; then
  390. kde_mimedir='\${datadir}/mimelnk'
  391. fi
  392. if test -z "$kde_toolbardir"; then
  393. kde_toolbardir='\${datadir}/toolbar'
  394. fi
  395. if test -z "$kde_wallpaperdir"; then
  396. kde_wallpaperdir='\${datadir}/wallpapers'
  397. fi
  398. if test -z "$kde_templatesdir"; then
  399. kde_templatesdir='\${datadir}/templates'
  400. fi
  401. if test -z "$kde_bindir"; then
  402. kde_bindir='\${exec_prefix}/bin'
  403. fi
  404. if test -z "$kde_servicesdir"; then
  405. kde_servicesdir='\${datadir}/services'
  406. fi
  407. if test -z "$kde_servicetypesdir"; then
  408. kde_servicetypesdir='\${datadir}/servicetypes'
  409. fi
  410. if test -z "$kde_moduledir"; then
  411. kde_moduledir='\${libdir}/trinity'
  412. fi
  413. if test -z "$kde_styledir"; then
  414. kde_styledir='\${libdir}/trinity/plugins/styles'
  415. fi
  416. if test -z "$kde_widgetdir"; then
  417. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  418. fi
  419. if test -z "$xdg_appsdir"; then
  420. xdg_appsdir='\${datadir}/applications/tde'
  421. fi
  422. if test -z "$xdg_menudir"; then
  423. xdg_menudir='\${sysconfdir}/xdg/menus'
  424. fi
  425. if test -z "$xdg_directorydir"; then
  426. xdg_directorydir='\${datadir}/desktop-directories'
  427. fi
  428. KDE_SET_PATHS(defaults)
  429. else
  430. AC_MSG_ERROR([path checking not yet supported for TDE 2])
  431. fi
  432. ])
  433. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  434. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  435. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  436. test -z "$kde_datadir" || test -z "$kde_locale" ||
  437. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  438. test -z "$kde_kcfgdir" ||
  439. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  440. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  441. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  442. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  443. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  444. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  445. test "x$kde_have_all_paths" != "xyes"; then
  446. kde_have_all_paths=no
  447. fi
  448. ])
  449. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  450. [
  451. AC_MSG_ERROR([The important program $1 was not found!
  452. Please check whether you installed TDE correctly.
  453. ])
  454. ])
  455. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  456. [
  457. AC_MSG_ERROR([The important program $1 was not found!
  458. Please check whether you installed aRts correctly or use
  459. --without-arts to compile without aRts support (this will remove functionality).
  460. ])
  461. ])
  462. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  463. [
  464. 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"
  465. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  466. if test -n "$TDEDIRS"; then
  467. kde_save_IFS=$IFS
  468. IFS=:
  469. for dir in $TDEDIRS; do
  470. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  471. done
  472. IFS=$kde_save_IFS
  473. fi
  474. ])
  475. AC_DEFUN([KDE_SUBST_PROGRAMS],
  476. [
  477. AC_ARG_WITH(arts,
  478. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  479. [build_arts=$withval],
  480. [build_arts=yes]
  481. )
  482. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  483. if test "$build_arts" = "no"; then
  484. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  485. fi
  486. KDE_SET_DEFAULT_BINDIRS
  487. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  488. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  489. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  490. if test "$build_arts" '!=' "no"; then
  491. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  492. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  493. fi
  494. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  495. trinity14ornewer=1
  496. if test "$kde_tqtver" = "3"; then
  497. if test "$KDECONFIG" != "compiled"; then
  498. if test `$KDECONFIG --version | grep TDE | sed 's/TDE: R\(..\).*/\1/'` -lt 14; then
  499. trinity14ornewer=
  500. fi
  501. fi
  502. fi
  503. if test -n "$trinity14ornewer"; then
  504. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  505. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  506. KDE_FIND_PATH(maketdewidgets, MAKETDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(maketdewidgets)])
  507. AC_SUBST(MAKETDEWIDGETS)
  508. fi
  509. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  510. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  511. kde_sharedirs="$prefix/share /opt/trinity/share /opt/trinity/share /opt/kde/share /usr/share/kde /usr/local/share /usr/share"
  512. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  513. AC_FIND_FILE(apps/ksgmltools2/customization/tde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  514. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  515. KDE_XSL_STYLESHEET=""
  516. else
  517. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/tde-chunk.xsl"
  518. fi
  519. fi
  520. DCOP_DEPENDENCIES='$(DCOPIDL)'
  521. if test -n "$trinity14ornewer"; then
  522. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  523. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  524. AC_SUBST(KCONFIG_COMPILER)
  525. AC_SUBST(KCFG_DEPENDENCIES)
  526. AC_SUBST(DCOPIDLNG)
  527. fi
  528. AC_SUBST(DCOPIDL)
  529. AC_SUBST(DCOPIDL2CPP)
  530. AC_SUBST(DCOP_DEPENDENCIES)
  531. AC_SUBST(MCOPIDL)
  532. AC_SUBST(ARTSCCONFIG)
  533. AC_SUBST(MEINPROC)
  534. AC_SUBST(KDE_XSL_STYLESHEET)
  535. AC_SUBST(XMLLINT)
  536. ])dnl
  537. AC_DEFUN([AC_CREATE_KFSSTND],
  538. [
  539. AC_REQUIRE([AC_CHECK_RPATH])
  540. AC_MSG_CHECKING([for TDE paths])
  541. kde_result=""
  542. kde_cached_paths=yes
  543. AC_CACHE_VAL(kde_cv_all_paths,
  544. [
  545. KDE_SET_DEFAULT_PATHS($1)
  546. kde_cached_paths=no
  547. ])
  548. eval "$kde_cv_all_paths"
  549. KDE_CHECK_PATHS_FOR_COMPLETENESS
  550. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  551. # wrong values were cached, may be, we can set better ones
  552. kde_result=
  553. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  554. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  555. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  556. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  557. kde_have_all_paths=
  558. kde_styledir=
  559. kde_widgetdir=
  560. xdg_appsdir = xdg_menudir= xdg_directorydir=
  561. KDE_SET_DEFAULT_PATHS($1)
  562. eval "$kde_cv_all_paths"
  563. KDE_CHECK_PATHS_FOR_COMPLETENESS
  564. kde_result="$kde_result (cache overridden)"
  565. fi
  566. if test "$kde_have_all_paths" = "no"; then
  567. AC_MSG_ERROR([configure could not run a little TDE program to test the environment.
  568. Since it had compiled and linked before, it must be a strange problem on your system.
  569. Look at config.log for details. If you are not able to fix this, look at
  570. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  571. (If you're using an egcs version on Linux, you may update binutils!)
  572. ])
  573. else
  574. rm -f conftest*
  575. AC_MSG_RESULT($kde_result)
  576. fi
  577. bindir=$kde_bindir
  578. KDE_SUBST_PROGRAMS
  579. ])
  580. AC_DEFUN([AC_SUBST_KFSSTND],
  581. [
  582. AC_SUBST(kde_htmldir)
  583. AC_SUBST(kde_appsdir)
  584. AC_SUBST(kde_icondir)
  585. AC_SUBST(kde_sounddir)
  586. AC_SUBST(kde_datadir)
  587. AC_SUBST(kde_locale)
  588. AC_SUBST(kde_confdir)
  589. AC_SUBST(kde_kcfgdir)
  590. AC_SUBST(kde_mimedir)
  591. AC_SUBST(kde_wallpaperdir)
  592. AC_SUBST(kde_bindir)
  593. dnl X Desktop Group standards
  594. AC_SUBST(xdg_appsdir)
  595. AC_SUBST(xdg_menudir)
  596. AC_SUBST(xdg_directorydir)
  597. dnl for TDE 2
  598. AC_SUBST(kde_templatesdir)
  599. AC_SUBST(kde_servicesdir)
  600. AC_SUBST(kde_servicetypesdir)
  601. AC_SUBST(kde_moduledir)
  602. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  603. AC_SUBST(kde_styledir)
  604. AC_SUBST(kde_widgetdir)
  605. dnl AC_SUBST(kde_cgidir)
  606. dnl AC_SUBST(kde_toolbardir)
  607. ])
  608. AC_DEFUN([KDE_MISC_TESTS],
  609. [
  610. dnl Checks for libraries.
  611. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  612. AC_SUBST(LIBUTIL)
  613. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  614. AC_SUBST(LIBCOMPAT)
  615. kde_have_crypt=
  616. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  617. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  618. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  619. You should install libcrypt from another source or configure with PAM
  620. support])
  621. kde_have_crypt=no
  622. ]))
  623. AC_SUBST(LIBCRYPT)
  624. if test $kde_have_crypt = yes; then
  625. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  626. fi
  627. AC_CHECK_SOCKLEN_T
  628. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  629. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  630. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  631. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  632. fi
  633. AC_CHECK_FUNC(inet_ntoa)
  634. if test $ac_cv_func_inet_ntoa = no; then
  635. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  636. fi
  637. AC_CHECK_FUNC(connect)
  638. if test $ac_cv_func_connect = no; then
  639. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  640. $X_EXTRA_LIBS)
  641. fi
  642. AC_CHECK_FUNC(remove)
  643. if test $ac_cv_func_remove = no; then
  644. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  645. fi
  646. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  647. AC_CHECK_FUNC(shmat, ,
  648. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  649. # more headers that need to be explicitly included on darwin
  650. AC_CHECK_HEADERS(sys/types.h stdint.h)
  651. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  652. AC_CHECK_HEADERS(sys/bitypes.h)
  653. # darwin requires a poll emulation library
  654. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  655. # for some image handling on Mac OS X
  656. AC_CHECK_HEADERS(Carbon/Carbon.h)
  657. # CoreAudio framework
  658. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  659. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  660. FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
  661. ])
  662. AC_CHECK_RES_INIT
  663. AC_SUBST(LIB_POLL)
  664. AC_SUBST(FRAMEWORK_COREAUDIO)
  665. LIBSOCKET="$X_EXTRA_LIBS"
  666. AC_SUBST(LIBSOCKET)
  667. AC_SUBST(X_EXTRA_LIBS)
  668. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  669. AC_SUBST(LIBUCB)
  670. case $host in dnl this *is* LynxOS specific
  671. *-*-lynxos* )
  672. AC_MSG_CHECKING([LynxOS header file wrappers])
  673. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  674. AC_MSG_RESULT(disabled)
  675. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  676. ;;
  677. esac
  678. KDE_CHECK_TYPES
  679. KDE_CHECK_LIBDL
  680. KDE_CHECK_STRLCPY
  681. KDE_CHECK_PIE_SUPPORT
  682. # darwin needs this to initialize the environment
  683. AC_CHECK_HEADERS(crt_externs.h)
  684. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  685. AH_VERBATIM(_DARWIN_ENVIRON,
  686. [
  687. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  688. # include <sys/time.h>
  689. # include <crt_externs.h>
  690. # define environ (*_NSGetEnviron())
  691. #endif
  692. ])
  693. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  694. [
  695. /*
  696. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  697. * that defines bzero.
  698. */
  699. #if defined(_AIX)
  700. #include <strings.h>
  701. #endif
  702. ])
  703. AC_CHECK_FUNCS([vsnprintf snprintf])
  704. AH_VERBATIM(_TRU64,[
  705. /*
  706. * On HP-UX, the declaration of vsnprintf() is needed every time !
  707. */
  708. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  709. #if __STDC__
  710. #include <stdarg.h>
  711. #include <stdlib.h>
  712. #else
  713. #include <varargs.h>
  714. #endif
  715. #ifdef __cplusplus
  716. extern "C"
  717. #endif
  718. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  719. #ifdef __cplusplus
  720. extern "C"
  721. #endif
  722. int snprintf(char *str, size_t n, char const *fmt, ...);
  723. #endif
  724. ])
  725. ])
  726. dnl ------------------------------------------------------------------------
  727. dnl Find the header files and libraries for X-Windows. Extended the
  728. dnl macro AC_PATH_X
  729. dnl ------------------------------------------------------------------------
  730. dnl
  731. AC_DEFUN([K_PATH_X],
  732. [
  733. AC_REQUIRE([KDE_MISC_TESTS])dnl
  734. AC_REQUIRE([KDE_CHECK_LIB64])
  735. AC_ARG_ENABLE(
  736. embedded,
  737. AC_HELP_STRING([--enable-embedded],[link to TQt-embedded, don't use X]),
  738. kde_use_tqt_emb=$enableval,
  739. kde_use_tqt_emb=no
  740. )
  741. AC_ARG_ENABLE(
  742. tqtopia,
  743. AC_HELP_STRING([--enable-tqtopia],[link to TQt-embedded, link to the TQtopia Environment]),
  744. kde_use_tqt_emb_palm=$enableval,
  745. kde_use_tqt_emb_palm=no
  746. )
  747. AC_ARG_ENABLE(
  748. mac,
  749. AC_HELP_STRING([--enable-mac],[link to TQt/Mac (don't use X)]),
  750. kde_use_tqt_mac=$enableval,
  751. kde_use_tqt_mac=no
  752. )
  753. # used to disable x11-specific stuff on special platforms
  754. AM_CONDITIONAL(include_x11, test "$kde_use_tqt_emb" = "no" && test "$kde_use_tqt_mac" = "no")
  755. if test "$kde_use_tqt_emb" = "no" && test "$kde_use_tqt_mac" = "no"; then
  756. AC_MSG_CHECKING(for X)
  757. AC_CACHE_VAL(kde_cv_have_x,
  758. [# One or both of the vars are not set, and there is no cached value.
  759. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  760. kde_x_includes=NO
  761. else
  762. kde_x_includes=$x_includes
  763. fi
  764. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  765. kde_x_libraries=NO
  766. else
  767. kde_x_libraries=$x_libraries
  768. fi
  769. # below we use the standard autoconf calls
  770. ac_x_libraries=$kde_x_libraries
  771. ac_x_includes=$kde_x_includes
  772. KDE_PATH_X_DIRECT
  773. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  774. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  775. dnl location. The correct location is /usr/lib32 or an undefined value
  776. dnl (the linker is smart enough to pick the correct default library).
  777. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  778. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  779. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  780. dnl x_includes should be left alone.
  781. case "$host" in
  782. mips-sgi-irix6*)
  783. ;;
  784. *-*-solaris*)
  785. ;;
  786. *)
  787. _AC_PATH_X_XMKMF
  788. if test -z "$ac_x_includes"; then
  789. ac_x_includes="."
  790. fi
  791. if test -z "$ac_x_libraries"; then
  792. ac_x_libraries="/usr/lib${tdelibsuff}"
  793. fi
  794. esac
  795. #from now on we use our own again
  796. # when the user already gave --x-includes, we ignore
  797. # what the standard autoconf macros told us.
  798. if test "$kde_x_includes" = NO; then
  799. kde_x_includes=$ac_x_includes
  800. fi
  801. # for --x-libraries too
  802. if test "$kde_x_libraries" = NO; then
  803. kde_x_libraries=$ac_x_libraries
  804. fi
  805. if test "$kde_x_includes" = NO; then
  806. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  807. fi
  808. if test "$kde_x_libraries" = NO; then
  809. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  810. fi
  811. # Record where we found X for the cache.
  812. kde_cv_have_x="have_x=yes \
  813. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  814. ])dnl
  815. eval "$kde_cv_have_x"
  816. if test "$have_x" != yes; then
  817. AC_MSG_RESULT($have_x)
  818. no_x=yes
  819. else
  820. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  821. fi
  822. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  823. X_INCLUDES=""
  824. x_includes="."; dnl better than nothing :-
  825. else
  826. x_includes=$kde_x_includes
  827. X_INCLUDES="-I$x_includes"
  828. fi
  829. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
  830. X_LDFLAGS=""
  831. x_libraries="/usr/lib"; dnl better than nothing :-
  832. else
  833. x_libraries=$kde_x_libraries
  834. X_LDFLAGS="-L$x_libraries"
  835. fi
  836. all_includes="$X_INCLUDES"
  837. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  838. # Check for libraries that X11R6 Xt/Xaw programs need.
  839. ac_save_LDFLAGS="$LDFLAGS"
  840. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  841. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  842. # check for ICE first), but we must link in the order -lSM -lICE or
  843. # we get undefined symbols. So assume we have SM if we have ICE.
  844. # These have to be linked with before -lX11, unlike the other
  845. # libraries we check for below, so use a different variable.
  846. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  847. AC_CHECK_LIB(ICE, IceConnectionNumber,
  848. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  849. LDFLAGS="$ac_save_LDFLAGS"
  850. LIB_X11='-lX11 $(LIBSOCKET)'
  851. AC_MSG_CHECKING(for libXext)
  852. AC_CACHE_VAL(kde_cv_have_libXext,
  853. [
  854. kde_ldflags_safe="$LDFLAGS"
  855. kde_libs_safe="$LIBS"
  856. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  857. LIBS="-lXext -lX11 $LIBSOCKET"
  858. AC_TRY_LINK([
  859. #include <stdio.h>
  860. #ifdef STDC_HEADERS
  861. # include <stdlib.h>
  862. #endif
  863. ],
  864. [
  865. printf("hello Xext\n");
  866. ],
  867. kde_cv_have_libXext=yes,
  868. kde_cv_have_libXext=no
  869. )
  870. LDFLAGS=$kde_ldflags_safe
  871. LIBS=$kde_libs_safe
  872. ])
  873. AC_MSG_RESULT($kde_cv_have_libXext)
  874. if test "$kde_cv_have_libXext" = "no"; then
  875. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  876. can't find it itself, we stop here assuming that make wouldn't find
  877. them either.])
  878. fi
  879. LIB_XEXT="-lXext"
  880. TQTE_NORTTI=""
  881. CFLAGS="$CFLAGS -I/usr/include/tqt"
  882. CXXFLAGS="$CXXFLAGS -I/usr/include/tqt"
  883. elif test "$kde_use_tqt_emb" = "yes"; then
  884. dnl We're using TQT Embedded
  885. CPPFLAGS=-DQWS
  886. CXXFLAGS="$CXXFLAGS -fno-rtti"
  887. TQTE_NORTTI="-fno-rtti -DQWS"
  888. X_PRE_LIBS=""
  889. LIB_X11=""
  890. LIB_XEXT=""
  891. LIB_XRENDER=""
  892. LIBSM=""
  893. X_INCLUDES=""
  894. X_LDFLAGS=""
  895. x_includes=""
  896. x_libraries=""
  897. elif test "$kde_use_tqt_mac" = "yes"; then
  898. dnl We're using TQT/Mac (I use TQT_MAC so that qglobal.h doesn't *have* to
  899. dnl be included to get the information) --Sam
  900. CXXFLAGS="$CXXFLAGS -DTQT_MAC -no-cpp-precomp"
  901. CFLAGS="$CFLAGS -DTQT_MAC -no-cpp-precomp"
  902. X_PRE_LIBS=""
  903. LIB_X11=""
  904. LIB_XEXT=""
  905. LIB_XRENDER=""
  906. LIBSM=""
  907. X_INCLUDES=""
  908. X_LDFLAGS=""
  909. x_includes=""
  910. x_libraries=""
  911. fi
  912. AC_SUBST(X_PRE_LIBS)
  913. AC_SUBST(LIB_X11)
  914. AC_SUBST(LIB_XRENDER)
  915. AC_SUBST(LIBSM)
  916. AC_SUBST(X_INCLUDES)
  917. AC_SUBST(X_LDFLAGS)
  918. AC_SUBST(x_includes)
  919. AC_SUBST(x_libraries)
  920. AC_SUBST(TQTE_NORTTI)
  921. AC_SUBST(LIB_XEXT)
  922. ])
  923. AC_DEFUN([KDE_PRINT_TQT_PROGRAM],
  924. [
  925. AC_REQUIRE([KDE_USE_TQT])
  926. cat > conftest.$ac_ext <<EOF
  927. #include "confdefs.h"
  928. EOF
  929. if test "$kde_tqtver" = "3"; then
  930. if $PKG_CONFIG --exists tqt-mt ; then
  931. cat >> conftest.$ac_ext <<EOF
  932. #include <tqglobal.h>
  933. #include <tqapplication.h>
  934. EOF
  935. fi
  936. fi
  937. if test "$kde_tqtver" = "3"; then
  938. if $PKG_CONFIG --exists tqt-mt ; then
  939. cat >> conftest.$ac_ext <<EOF
  940. #include <tqcursor.h>
  941. #include <tqstylefactory.h>
  942. #include <tqucomextra_p.h>
  943. EOF
  944. fi
  945. fi
  946. echo "#if ! ($kde_tqt_verstring)" >> conftest.$ac_ext
  947. cat >> conftest.$ac_ext <<EOF
  948. #error 1
  949. #endif
  950. int main() {
  951. EOF
  952. if test "$kde_tqtver" = "3"; then
  953. if $PKG_CONFIG --exists tqt-mt ; then
  954. cat >> conftest.$ac_ext <<EOF
  955. (void)TQStyleFactory::create(TQString::null);
  956. TQCursor c(TQt::WhatsThisCursor);
  957. EOF
  958. fi
  959. fi
  960. cat >> conftest.$ac_ext <<EOF
  961. return 0;
  962. }
  963. EOF
  964. ])
  965. AC_DEFUN([KDE_USE_TQT],
  966. [
  967. kde_tqtver=0
  968. kde_tqtsubver=0
  969. AC_LANG_SAVE
  970. AC_LANG_CPLUSPLUS
  971. ac_cxxflags_safe="$CXXFLAGS"
  972. CXXFLAGS="-I/usr/include/tqt"
  973. AC_TRY_COMPILE([
  974. #define TQT_VERSION_ONLY
  975. #include <tqt.h>
  976. #undef TQT_VERSION_ONLY
  977. #ifdef USE_QT4
  978. choke me
  979. #endif
  980. ], ,
  981. kde_tqtver=3,
  982. )
  983. CXXFLAGS="$ac_cxxflags_safe"
  984. AC_LANG_RESTORE
  985. if test "$kde_tqtver" = "3"; then
  986. AC_MSG_RESULT(Detected TQt3.)
  987. # Current default TQt version: 3.3
  988. kde_tqtsubver=3
  989. else
  990. AC_MSG_ERROR(TQt3 could not be detected!)
  991. fi
  992. if test -z "$2"; then
  993. if test "$kde_tqtver" = "3"; then
  994. if test $kde_tqtsubver -gt 0; then
  995. if test $kde_tqtsubver -gt 1; then
  996. if test $kde_tqtsubver -gt 2; then
  997. kde_tqt_minversion=">= TQt 3.3 and < 4.0"
  998. else
  999. kde_tqt_minversion=">= TQt 3.2 and < 4.0"
  1000. fi
  1001. else
  1002. kde_tqt_minversion=">= TQt 3.1 (20021021) and < 4.0"
  1003. fi
  1004. else
  1005. kde_tqt_minversion=">= TQt 3.0 and < 4.0"
  1006. fi
  1007. fi
  1008. else
  1009. kde_tqt_minversion="$2"
  1010. fi
  1011. if test -z "$3"; then
  1012. if test $kde_tqtver = 3; then
  1013. if test $kde_tqtsubver -gt 0; then
  1014. kde_tqt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1015. tqtsubver=`echo "00$kde_tqtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1016. kde_tqt_verstring=`echo $kde_tqt_verstring | sed -e "s,@VER@,$tqtsubver,"`
  1017. else
  1018. kde_tqt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1019. fi
  1020. fi
  1021. else
  1022. kde_tqt_verstring="$3"
  1023. fi
  1024. if test $kde_tqtver = 3; then
  1025. kde_tqt_dirs="$TQTDIR /usr/lib/tqt3 /usr/share/tqt3"
  1026. if test -z "$PKG_CONFIG"; then
  1027. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1028. fi
  1029. if test "$PKG_CONFIG" != "no" ; then
  1030. if $PKG_CONFIG --exists tqt-mt ; then
  1031. if $PKG_CONFIG --exists tqt-mt ; then
  1032. kde_tqt_dirs="$kde_tqt_dirs `$PKG_CONFIG --variable=prefix tqt-mt`"
  1033. LIB_QUI="-ltqui"
  1034. AC_SUBST(LIB_QUI)
  1035. fi
  1036. fi
  1037. fi
  1038. fi
  1039. ])
  1040. AC_DEFUN([KDE_CHECK_TQT_DIRECT],
  1041. [
  1042. AC_REQUIRE([KDE_USE_TQT])
  1043. AC_MSG_CHECKING([if TQt compiles without flags])
  1044. AC_CACHE_VAL(kde_cv_tqt_direct,
  1045. [
  1046. AC_LANG_SAVE
  1047. AC_LANG_CPLUSPLUS
  1048. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1049. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1050. ac_cxxflags_safe="$CXXFLAGS"
  1051. ac_ldflags_safe="$LDFLAGS"
  1052. ac_libs_safe="$LIBS"
  1053. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  1054. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1055. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  1056. LIBS="$LIBTQT -lXext -lX11 $LIBSOCKET"
  1057. else
  1058. LIBS="$LIBTQT $LIBSOCKET"
  1059. fi
  1060. LD_LIBRARY_PATH=
  1061. export LD_LIBRARY_PATH
  1062. LIBRARY_PATH=
  1063. export LIBRARY_PATH
  1064. KDE_PRINT_TQT_PROGRAM
  1065. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1066. kde_cv_tqt_direct="yes"
  1067. else
  1068. kde_cv_tqt_direct="no"
  1069. echo "configure: failed program was:" >&AC_FD_CC
  1070. cat conftest.$ac_ext >&AC_FD_CC
  1071. fi
  1072. rm -f conftest*
  1073. CXXFLAGS="$ac_cxxflags_safe"
  1074. LDFLAGS="$ac_ldflags_safe"
  1075. LIBS="$ac_libs_safe"
  1076. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1077. export LD_LIBRARY_PATH
  1078. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1079. export LIBRARY_PATH
  1080. AC_LANG_RESTORE
  1081. ])
  1082. if test "$kde_cv_tqt_direct" = "yes"; then
  1083. AC_MSG_RESULT(yes)
  1084. $1
  1085. else
  1086. AC_MSG_RESULT(no)
  1087. $2
  1088. fi
  1089. ])
  1090. dnl ------------------------------------------------------------------------
  1091. dnl Try to find the TQt headers and libraries.
  1092. dnl $(TQT_LDFLAGS) will be -Ltqtliblocation (if needed)
  1093. dnl and $(TQT_INCLUDES) will be -Itqthdrlocation (if needed)
  1094. dnl ------------------------------------------------------------------------
  1095. dnl
  1096. AC_DEFUN([AC_PATH_TQT_1_3],
  1097. [
  1098. AC_REQUIRE([K_PATH_X])
  1099. AC_REQUIRE([KDE_USE_TQT])
  1100. AC_REQUIRE([KDE_CHECK_LIB64])
  1101. dnl ------------------------------------------------------------------------
  1102. dnl Add configure flag to enable linking to MT version of TQt library.
  1103. dnl ------------------------------------------------------------------------
  1104. AC_ARG_ENABLE(
  1105. mt,
  1106. AC_HELP_STRING([--disable-mt],[link to non-threaded TQt (deprecated)]),
  1107. kde_use_tqt_mt=$enableval,
  1108. [
  1109. if test $kde_tqtver = 3; then
  1110. kde_use_tqt_mt=yes
  1111. else
  1112. kde_use_tqt_mt=no
  1113. fi
  1114. ]
  1115. )
  1116. USING_TQT_MT=""
  1117. dnl ------------------------------------------------------------------------
  1118. dnl If we not get --disable-tqt-mt then adjust some vars for the host.
  1119. dnl ------------------------------------------------------------------------
  1120. KDE_MT_LDFLAGS=
  1121. KDE_MT_LIBS=
  1122. if test "x$kde_use_tqt_mt" = "xyes"; then
  1123. KDE_CHECK_THREADING
  1124. if test "x$kde_use_threading" = "xyes"; then
  1125. CPPFLAGS="$USE_THREADS -DTQT_THREAD_SUPPORT $CPPFLAGS"
  1126. KDE_MT_LDFLAGS="$USE_THREADS"
  1127. KDE_MT_LIBS="$LIBPTHREAD"
  1128. else
  1129. kde_use_tqt_mt=no
  1130. fi
  1131. fi
  1132. AC_SUBST(KDE_MT_LDFLAGS)
  1133. AC_SUBST(KDE_MT_LIBS)
  1134. kde_tqt_was_given=yes
  1135. dnl ------------------------------------------------------------------------
  1136. dnl If we haven't been told how to link to TQt, we work it out for ourselves.
  1137. dnl ------------------------------------------------------------------------
  1138. if test -z "$LIBTQT_GLOB"; then
  1139. if test "$kde_tqtver" = "3"; then
  1140. if test "x$kde_use_tqt_emb" = "xyes"; then
  1141. LIBTQT_GLOB="libtqte.*"
  1142. else
  1143. if $PKG_CONFIG --exists tqt-mt ; then
  1144. LIBTQT_GLOB="libtqt.*"
  1145. fi
  1146. fi
  1147. fi
  1148. fi
  1149. dnl ------------------------------------------------------------
  1150. dnl If we got --enable-embedded then adjust the TQt library name.
  1151. dnl Also TQt4 uses a different library name
  1152. dnl ------------------------------------------------------------
  1153. if test "$kde_tqtver" = "3"; then
  1154. if test "x$kde_use_tqt_emb" = "xyes"; then
  1155. tqtlib="tqte"
  1156. else
  1157. if $PKG_CONFIG --exists tqt-mt ; then
  1158. tqtlib="tqt"
  1159. fi
  1160. fi
  1161. fi
  1162. kde_int_tqt="-l$tqtlib"
  1163. if test -z "$LIBQPE"; then
  1164. dnl ------------------------------------------------------------
  1165. dnl If we got --enable-palmtop then add -lqpe to the link line
  1166. dnl ------------------------------------------------------------
  1167. if test "x$kde_use_tqt_emb" = "xyes"; then
  1168. if test "x$kde_use_tqt_emb_palm" = "xyes"; then
  1169. LIB_QPE="-lqpe"
  1170. else
  1171. LIB_QPE=""
  1172. fi
  1173. else
  1174. LIB_QPE=""
  1175. fi
  1176. fi
  1177. dnl ------------------------------------------------------------------------
  1178. dnl If we got --enable-tqt-mt then adjust the TQt library name for the host.
  1179. dnl ------------------------------------------------------------------------
  1180. if test "x$kde_use_tqt_mt" = "xyes"; then
  1181. if test $kde_tqtver = 3; then
  1182. LIBTQT="-l$tqtlib-mt"
  1183. kde_int_tqt="-l$tqtlib-mt"
  1184. LIBTQT_GLOB="lib$tqtlib-mt.*"
  1185. fi
  1186. USING_TQT_MT="using -mt"
  1187. else
  1188. LIBTQT="-l$tqtlib"
  1189. fi
  1190. if test $kde_tqtver != 1; then
  1191. AC_REQUIRE([AC_FIND_PNG])
  1192. AC_REQUIRE([AC_FIND_JPEG])
  1193. LIBTQT="$LIBTQT $LIBPNG $LIBJPEG"
  1194. fi
  1195. if test $kde_tqtver = 3; then
  1196. AC_REQUIRE([KDE_CHECK_LIBDL])
  1197. LIBTQT="$LIBTQT $LIBDL"
  1198. fi
  1199. AC_MSG_CHECKING([for TQt])
  1200. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  1201. LIBTQT="$LIBTQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1202. fi
  1203. ac_tqt_includes=NO ac_tqt_libraries=NO ac_tqt_bindir=NO
  1204. tqt_libraries=""
  1205. tqt_includes=""
  1206. AC_ARG_WITH(tqt-dir,
  1207. AC_HELP_STRING([--with-tqt-dir=DIR],[where the root of TQt is installed ]),
  1208. [ ac_tqt_includes="$withval"/include
  1209. ac_tqt_libraries="$withval"/lib${tdelibsuff}
  1210. ac_tqt_bindir="$withval"/bin
  1211. ])
  1212. AC_ARG_WITH(tqt-includes,
  1213. AC_HELP_STRING([--with-tqt-includes=DIR],[where the TQt includes are. ]),
  1214. [
  1215. ac_tqt_includes="$withval"
  1216. ])
  1217. kde_tqt_libs_given=no
  1218. AC_ARG_WITH(tqt-libraries,
  1219. AC_HELP_STRING([--with-tqt-libraries=DIR],[where the TQt library is installed.]),
  1220. [ ac_tqt_libraries="$withval"
  1221. kde_tqt_libs_given=yes
  1222. ])
  1223. AC_CACHE_VAL(ac_cv_have_tqt,
  1224. [#try to guess TQt locations
  1225. tqt_incdirs=""
  1226. for dir in $kde_tqt_dirs; do
  1227. tqt_incdirs="$tqt_incdirs $dir/include $dir"
  1228. done
  1229. if test -z "$PKG_CONFIG"; then
  1230. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1231. fi
  1232. if test "$PKG_CONFIG" != "no" ; then
  1233. if $PKG_CONFIG --exists tqt-mt ; then
  1234. tqt_incdirs="$tqt_incdirs `$PKG_CONFIG --variable=includedir tqt-mt`"
  1235. fi
  1236. fi
  1237. tqt_incdirs="$TQTINC $tqt_incdirs /usr/include/tqt3 /usr/include /usr/X11R6/include/X11/tqt /usr/X11R6/include/tqt $x_includes"
  1238. if test ! "$ac_tqt_includes" = "NO"; then
  1239. tqt_incdirs="$ac_tqt_includes $tqt_incdirs"
  1240. fi
  1241. kde_tqt_header=ntqstyle.h
  1242. AC_FIND_FILE($kde_tqt_header, $tqt_incdirs, tqt_incdir)
  1243. if test "$tqt_incdir" = "NO"; then
  1244. AC_FIND_FILE($kde_tqt_header, $tqt_incdirs, tqt_incdir)
  1245. fi
  1246. ac_tqt_includes="$tqt_incdir"
  1247. tqt_libdirs=""
  1248. for dir in $kde_tqt_dirs; do
  1249. tqt_libdirs="$tqt_libdirs $dir/lib${tdelibsuff} $dir/lib $dir"
  1250. done
  1251. if test -z "$PKG_CONFIG"; then
  1252. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1253. fi
  1254. if test "$PKG_CONFIG" != "no" ; then
  1255. if $PKG_CONFIG --exists tqt-mt ; then
  1256. tqt_libdirs="$tqt_incdirs `$PKG_CONFIG --variable=libdir tqt-mt`"
  1257. fi
  1258. fi
  1259. tqt_libdirs="$TQTLIB $tqt_libdirs /usr/X11R6/lib /usr/lib /usr/local/tqt/lib $x_libraries"
  1260. if test ! "$ac_tqt_libraries" = "NO"; then
  1261. tqt_libdir=$ac_tqt_libraries
  1262. else
  1263. tqt_libdirs="$ac_tqt_libraries $tqt_libdirs"
  1264. # if the TQt was given, the chance is too big that libtqt.* doesn't exist
  1265. tqt_libdir=NONE
  1266. for dir in $tqt_libdirs; do
  1267. try="ls -1 $dir/${LIBTQT_GLOB}"
  1268. if test -n "`$try 2> /dev/null`"; then tqt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1269. done
  1270. fi
  1271. for a in $tqt_libdir/lib`echo ${kde_int_tqt} | sed 's,^-l,,'`_incremental.*; do
  1272. if test -e "$a"; then
  1273. LIBTQT="$LIBTQT ${kde_int_tqt}_incremental"
  1274. break
  1275. fi
  1276. done
  1277. ac_tqt_libraries="$tqt_libdir"
  1278. AC_LANG_SAVE
  1279. AC_LANG_CPLUSPLUS
  1280. ac_cxxflags_safe="$CXXFLAGS"
  1281. ac_ldflags_safe="$LDFLAGS"
  1282. ac_libs_safe="$LIBS"
  1283. CXXFLAGS="$CXXFLAGS -I$tqt_incdir $all_includes"
  1284. LDFLAGS="$LDFLAGS -L$tqt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1285. LIBS="$LIBS $LIBTQT $KDE_MT_LIBS"
  1286. KDE_PRINT_TQT_PROGRAM
  1287. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1288. rm -f conftest*
  1289. else
  1290. echo "configure: failed program was:" >&AC_FD_CC
  1291. cat conftest.$ac_ext >&AC_FD_CC
  1292. ac_tqt_libraries="NO"
  1293. fi
  1294. rm -f conftest*
  1295. CXXFLAGS="$ac_cxxflags_safe"
  1296. LDFLAGS="$ac_ldflags_safe"
  1297. LIBS="$ac_libs_safe"
  1298. AC_LANG_RESTORE
  1299. if test "$ac_tqt_includes" = NO || test "$ac_tqt_libraries" = NO; then
  1300. ac_cv_have_tqt="have_tqt=no"
  1301. ac_tqt_notfound=""
  1302. missing_tqt_mt=""
  1303. if test "$ac_tqt_includes" = NO; then
  1304. if test "$ac_tqt_libraries" = NO; then
  1305. ac_tqt_notfound="(headers and libraries)";
  1306. else
  1307. ac_tqt_notfound="(headers)";
  1308. fi
  1309. else
  1310. if test "x$kde_use_tqt_mt" = "xyes"; then
  1311. missing_tqt_mt="
  1312. Make sure that you have compiled TQt with thread support!"
  1313. ac_tqt_notfound="(library $tqtlib-mt)";
  1314. else
  1315. ac_tqt_notfound="(library $tqtlib)";
  1316. fi
  1317. fi
  1318. AC_MSG_ERROR([TQt ($kde_tqt_minversion) $ac_tqt_notfound not found. Please check your installation!
  1319. For more details about this problem, look at the end of config.log.$missing_tqt_mt])
  1320. else
  1321. have_tqt="yes"
  1322. fi
  1323. ])
  1324. eval "$ac_cv_have_tqt"
  1325. if test "$have_tqt" != yes; then
  1326. AC_MSG_RESULT([$have_tqt]);
  1327. else
  1328. ac_cv_have_tqt="have_tqt=yes \
  1329. ac_tqt_includes=$ac_tqt_includes ac_tqt_libraries=$ac_tqt_libraries"
  1330. AC_MSG_RESULT([libraries $ac_tqt_libraries, headers $ac_tqt_includes $USING_TQT_MT])
  1331. tqt_libraries="$ac_tqt_libraries"
  1332. tqt_includes="$ac_tqt_includes"
  1333. fi
  1334. if test ! "$kde_tqt_libs_given" = "yes" && test ! "$kde_tqtver" = 3; then
  1335. KDE_CHECK_TQT_DIRECT(tqt_libraries= ,[])
  1336. fi
  1337. AC_SUBST(tqt_libraries)
  1338. AC_SUBST(tqt_includes)
  1339. if test "$tqt_includes" = "$x_includes" || test -z "$tqt_includes"; then
  1340. TQT_INCLUDES=""
  1341. else
  1342. TQT_INCLUDES="-I$tqt_includes"
  1343. all_includes="$TQT_INCLUDES $all_includes"
  1344. fi
  1345. if test "$tqt_libraries" = "$x_libraries" || test -z "$tqt_libraries"; then
  1346. TQT_LDFLAGS=""
  1347. else
  1348. TQT_LDFLAGS="-L$tqt_libraries"
  1349. all_libraries="$TQT_LDFLAGS $all_libraries"
  1350. fi
  1351. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1352. AC_SUBST(TQT_INCLUDES)
  1353. AC_SUBST(TQT_LDFLAGS)
  1354. AC_PATH_TQT_MOC_UIC
  1355. KDE_CHECK_TQT
  1356. KDE_CHECK_TQT_JPEG
  1357. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  1358. LIB_TQT="$kde_int_tqt $LIBJPEG_TQT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM) $(LIBTQT_LDFLAGS)'
  1359. else
  1360. LIB_TQT="$kde_int_tqt $LIBJPEG_TQT "'$(LIBZ) $(LIBPNG) $(LIBTQT_LDFLAGS)'
  1361. fi
  1362. test -z "$KDE_MT_LIBS" || LIB_TQT="$LIB_TQT $KDE_MT_LIBS"
  1363. for a in $tqt_libdir/lib`echo ${kde_int_tqt} | sed 's,^-l,,'`_incremental.*; do
  1364. if test -e "$a"; then
  1365. LIB_TQT="$LIB_TQT ${kde_int_tqt}_incremental"
  1366. break
  1367. fi
  1368. done
  1369. AC_SUBST(LIB_TQT)
  1370. AC_SUBST(LIB_QPE)
  1371. AC_SUBST(kde_tqtver)
  1372. ])
  1373. AC_DEFUN([AC_PATH_TQT],
  1374. [
  1375. AC_PATH_TQT_1_3
  1376. ])
  1377. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1378. [
  1379. AC_REQUIRE([AC_PATH_TQT_MOC_UIC])
  1380. if test x$ac_uic_supports_libpath = xyes; then
  1381. AC_MSG_CHECKING([if UIC has TDE plugins available])
  1382. AC_CACHE_VAL(kde_cv_uic_plugins,
  1383. [
  1384. cat > actest.ui << EOF
  1385. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1386. <class>NewConnectionDialog</class>
  1387. <widget class="TQDialog">
  1388. <widget class="KLineEdit">
  1389. <property name="name">
  1390. <cstring>testInput</cstring>
  1391. </property>
  1392. </widget>
  1393. </widget>
  1394. </UI>
  1395. EOF
  1396. kde_cv_uic_plugins=no
  1397. kde_line="$UIC_PATH -L $kde_widgetdir"
  1398. if test x$ac_uic_supports_nounload = xyes; then
  1399. kde_line="$kde_line -nounload"
  1400. fi
  1401. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1402. if AC_TRY_EVAL(kde_line); then
  1403. # if you're trying to debug this check and think it's incorrect,
  1404. # better check your installation. The check _is_ correct - your
  1405. # installation is not.
  1406. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1407. kde_cv_uic_plugins=yes
  1408. fi
  1409. fi
  1410. rm -f actest.ui actest.cpp
  1411. ])
  1412. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1413. if test "$kde_cv_uic_plugins" != yes; then
  1414. AC_MSG_ERROR([
  1415. you need to install tdelibs first.
  1416. If you did install tdelibs, then the TQt version that is picked up by
  1417. this configure is not the same version you used to compile tdelibs.
  1418. The TQt Plugin installed by tdelibs is *ONLY* loadable if it is the
  1419. _same TQt version_, compiled with the _same compiler_ and the same TQt
  1420. configuration settings.
  1421. ])
  1422. fi
  1423. fi
  1424. ])
  1425. AC_DEFUN([KDE_CHECK_FINAL],
  1426. [
  1427. AC_ARG_ENABLE(final,
  1428. AC_HELP_STRING([--enable-final],
  1429. [build size optimized apps (experimental - needs lots of memory)]),
  1430. kde_use_final=$enableval, kde_use_final=no)
  1431. if test "x$kde_use_final" = "xyes"; then
  1432. KDE_USE_FINAL_TRUE=""
  1433. KDE_USE_FINAL_FALSE="#"
  1434. else
  1435. KDE_USE_FINAL_TRUE="#"
  1436. KDE_USE_FINAL_FALSE=""
  1437. fi
  1438. AC_SUBST(KDE_USE_FINAL_TRUE)
  1439. AC_SUBST(KDE_USE_FINAL_FALSE)
  1440. ])
  1441. AC_DEFUN([KDE_CHECK_CLOSURE],
  1442. [
  1443. AC_ARG_ENABLE(closure,
  1444. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1445. kde_use_closure=$enableval, kde_use_closure=no)
  1446. KDE_NO_UNDEFINED=""
  1447. if test "x$kde_use_closure" = "xyes"; then
  1448. KDE_USE_CLOSURE_TRUE=""
  1449. KDE_USE_CLOSURE_FALSE="#"
  1450. # CXXFLAGS="$CXXFLAGS $REPO"
  1451. else
  1452. KDE_USE_CLOSURE_TRUE="#"
  1453. KDE_USE_CLOSURE_FALSE=""
  1454. KDE_NO_UNDEFINED=""
  1455. case $host in
  1456. *-*-linux-gnu)
  1457. KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
  1458. [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
  1459. [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
  1460. [KDE_NO_UNDEFINED=""])],
  1461. [KDE_NO_UNDEFINED=""])
  1462. ;;
  1463. esac
  1464. fi
  1465. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1466. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1467. AC_SUBST(KDE_NO_UNDEFINED)
  1468. ])
  1469. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1470. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1471. [
  1472. AC_ARG_ENABLE(new_ldflags,
  1473. AC_HELP_STRING([--enable-new-ldflags],
  1474. [enable the new linker flags]),
  1475. kde_use_new_ldflags=$enableval,
  1476. kde_use_new_ldflags=no)
  1477. LDFLAGS_AS_NEEDED=""
  1478. LDFLAGS_NEW_DTAGS=""
  1479. if test "x$kde_use_new_ldflags" = "xyes"; then
  1480. LDFLAGS_NEW_DTAGS=""
  1481. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1482. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1483. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1484. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1485. fi
  1486. AC_SUBST(LDFLAGS_AS_NEEDED)
  1487. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1488. ])
  1489. AC_DEFUN([KDE_CHECK_NMCHECK],
  1490. [
  1491. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1492. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1493. if test "$kde_use_nmcheck" = "yes"; then
  1494. KDE_USE_NMCHECK_TRUE=""
  1495. KDE_USE_NMCHECK_FALSE="#"
  1496. else
  1497. KDE_USE_NMCHECK_TRUE="#"
  1498. KDE_USE_NMCHECK_FALSE=""
  1499. fi
  1500. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1501. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1502. ])
  1503. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1504. savex=$exec_prefix
  1505. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1506. tmp=$$2
  1507. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1508. exec_prefix=$savex
  1509. ])
  1510. dnl ------------------------------------------------------------------------
  1511. dnl Now, the same with KDE
  1512. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1513. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1514. dnl ------------------------------------------------------------------------
  1515. dnl
  1516. AC_DEFUN([AC_BASE_PATH_KDE],
  1517. [
  1518. AC_REQUIRE([KDE_CHECK_STL])
  1519. AC_REQUIRE([AC_PATH_TQT])dnl
  1520. AC_REQUIRE([KDE_CHECK_LIB64])
  1521. AC_CHECK_RPATH
  1522. AC_MSG_CHECKING([for KDE])
  1523. if test "${prefix}" != NONE; then
  1524. kde_includes=${includedir}
  1525. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1526. kde_libraries=${libdir}
  1527. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1528. else
  1529. ac_kde_includes=
  1530. ac_kde_libraries=
  1531. kde_libraries=""
  1532. kde_includes=""
  1533. fi
  1534. AC_CACHE_VAL(ac_cv_have_kde,
  1535. [#try to guess kde locations
  1536. kde_check_header="ksharedptr.h"
  1537. kde_check_lib="libtdeio.la"
  1538. if test -z "$1"; then
  1539. 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 $tqt_includes"
  1540. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1541. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1542. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1543. ac_kde_includes="$kde_incdir"
  1544. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1545. AC_MSG_ERROR([
  1546. No TDE headers are installed in the chosen prefix. This will fail.
  1547. Please check this and use another prefix if needed!])
  1548. fi
  1549. 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}"
  1550. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1551. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1552. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1553. ac_kde_libraries="$kde_libdir"
  1554. kde_widgetdir=NO
  1555. dnl this might be somewhere else
  1556. AC_FIND_FILE("trinity/plugins/designer/tdewidgets.la", $kde_libdirs, kde_widgetdir)
  1557. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1558. AC_MSG_ERROR([
  1559. in the prefix, you've chosen, are no TDE libraries installed. This will fail.
  1560. So, check this please and use another prefix!])
  1561. fi
  1562. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/tdewidgets.la"; then
  1563. AC_MSG_ERROR([
  1564. I can't find the designer plugins. These are required and should have been installed
  1565. by tdelibs])
  1566. fi
  1567. if test -n "$kde_widgetdir"; then
  1568. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1569. fi
  1570. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1571. ac_cv_have_kde="have_kde=no"
  1572. else
  1573. ac_cv_have_kde="have_kde=yes \
  1574. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1575. fi
  1576. else dnl test -z $1, e.g. from tdelibs
  1577. ac_cv_have_kde="have_kde=no"
  1578. fi
  1579. ])dnl
  1580. eval "$ac_cv_have_kde"
  1581. if test "$have_kde" != "yes"; then
  1582. if test "${prefix}" = NONE; then
  1583. ac_kde_prefix="$ac_default_prefix"
  1584. else
  1585. ac_kde_prefix="$prefix"
  1586. fi
  1587. if test "$exec_prefix" = NONE; then
  1588. ac_kde_exec_prefix="$ac_kde_prefix"
  1589. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1590. else
  1591. ac_kde_exec_prefix="$exec_prefix"
  1592. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1593. fi
  1594. kde_libraries="${libdir}"
  1595. kde_includes="${includedir}"
  1596. else
  1597. ac_cv_have_kde="have_kde=yes \
  1598. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1599. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1600. kde_libraries="$ac_kde_libraries"
  1601. kde_includes="$ac_kde_includes"
  1602. fi
  1603. AC_SUBST(kde_libraries)
  1604. AC_SUBST(kde_includes)
  1605. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$tqt_includes" || test "$kde_includes" = "/usr/include"; then
  1606. KDE_INCLUDES=""
  1607. else
  1608. KDE_INCLUDES="-I$kde_includes"
  1609. all_includes="$KDE_INCLUDES $all_includes"
  1610. fi
  1611. KDE_DEFAULT_CXXFLAGS="-DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION"
  1612. KDE_LDFLAGS="-L$kde_libraries"
  1613. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$tqt_libraries" ; then
  1614. all_libraries="$KDE_LDFLAGS $all_libraries"
  1615. fi
  1616. AC_SUBST(KDE_LDFLAGS)
  1617. AC_SUBST(KDE_INCLUDES)
  1618. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1619. all_libraries="$all_libraries $USER_LDFLAGS"
  1620. all_includes="$all_includes $USER_INCLUDES"
  1621. AC_SUBST(all_includes)
  1622. AC_SUBST(all_libraries)
  1623. if test -z "$1"; then
  1624. KDE_CHECK_UIC_PLUGINS
  1625. fi
  1626. ac_kde_libraries="$kde_libdir"
  1627. AC_SUBST(AUTODIRS)
  1628. ])
  1629. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1630. [
  1631. AC_MSG_CHECKING(for extra includes)
  1632. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1633. kde_use_extra_includes="$withval",
  1634. kde_use_extra_includes=NONE
  1635. )
  1636. kde_extra_includes=
  1637. if test -n "$kde_use_extra_includes" && \
  1638. test "$kde_use_extra_includes" != "NONE"; then
  1639. ac_save_ifs=$IFS
  1640. IFS=':'
  1641. for dir in $kde_use_extra_includes; do
  1642. kde_extra_includes="$kde_extra_includes $dir"
  1643. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1644. done
  1645. IFS=$ac_save_ifs
  1646. kde_use_extra_includes="added"
  1647. else
  1648. kde_use_extra_includes="no"
  1649. fi
  1650. AC_SUBST(USER_INCLUDES)
  1651. AC_MSG_RESULT($kde_use_extra_includes)
  1652. kde_extra_libs=
  1653. AC_MSG_CHECKING(for extra libs)
  1654. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1655. kde_use_extra_libs=$withval,
  1656. kde_use_extra_libs=NONE
  1657. )
  1658. if test -n "$kde_use_extra_libs" && \
  1659. test "$kde_use_extra_libs" != "NONE"; then
  1660. ac_save_ifs=$IFS
  1661. IFS=':'
  1662. for dir in $kde_use_extra_libs; do
  1663. kde_extra_libs="$kde_extra_libs $dir"
  1664. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1665. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1666. done
  1667. IFS=$ac_save_ifs
  1668. kde_use_extra_libs="added"
  1669. else
  1670. kde_use_extra_libs="no"
  1671. fi
  1672. AC_SUBST(USER_LDFLAGS)
  1673. AC_MSG_RESULT($kde_use_extra_libs)
  1674. ])
  1675. AC_DEFUN([KDE_CHECK_KDETQTADDON],
  1676. [
  1677. AC_MSG_CHECKING(for kde-tqt-addon)
  1678. AC_CACHE_VAL(kde_cv_have_kdetqtaddon,
  1679. [
  1680. kde_ldflags_safe="$LDFLAGS"
  1681. kde_libs_safe="$LIBS"
  1682. kde_cxxflags_safe="$CXXFLAGS"
  1683. LIBS="-lkde-tqt-addon $LIBTQT $LIBS"
  1684. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1685. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1686. if test "$kde_tqtver" = "3"; then
  1687. if $PKG_CONFIG --exists tqt-mt ; then
  1688. AC_TRY_LINK([
  1689. #include <tqdom.h>
  1690. ],
  1691. [
  1692. TQDomDocument doc;
  1693. ],
  1694. kde_cv_have_kdetqtaddon=yes,
  1695. kde_cv_have_kdetqtaddon=no
  1696. )
  1697. fi
  1698. fi
  1699. LDFLAGS=$kde_ldflags_safe
  1700. LIBS=$kde_libs_safe
  1701. CXXFLAGS=$kde_cxxflags_safe
  1702. ])
  1703. AC_MSG_RESULT($kde_cv_have_kdetqtaddon)
  1704. if test "$kde_cv_have_kdetqtaddon" = "no"; then
  1705. AC_MSG_ERROR([Can't find libkde-tqt-addon. You need to install it first.
  1706. It is a separate package (and CVS module) named kde-tqt-addon.])
  1707. fi
  1708. ])
  1709. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  1710. [
  1711. AC_REQUIRE([KDE_MISC_TESTS])
  1712. AC_REQUIRE([KDE_CHECK_LIBDL])
  1713. AC_REQUIRE([K_PATH_X])
  1714. if test $kde_tqtver = 3; then
  1715. case $host in
  1716. *cygwin*) lib_kded="-ltdeinit_kded" ;;
  1717. *) lib_kded="" ;;
  1718. esac
  1719. AC_SUBST(LIB_KDED, $lib_kded)
  1720. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1721. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1722. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1723. AC_SUBST(LIB_KJS, "-lkjs")
  1724. AC_SUBST(LIB_SMB, "-lsmb")
  1725. AC_SUBST(LIB_KAB, "-lkab")
  1726. AC_SUBST(LIB_TDEABC, "-ltdeabc")
  1727. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1728. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1729. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1730. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1731. AC_SUBST(LIB_TDEUTILS, "-ltdeutils")
  1732. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  1733. AC_SUBST(LIB_TDEIMPROXY, "-ltdeimproxy")
  1734. AC_SUBST(LIB_TDENEWSTUFF, "-ltdenewstuff")
  1735. AC_SUBST(LIB_TDEDNSSD, "-ltdednssd")
  1736. AC_SUBST(LIB_TDEUNITTEST, "-ltdeunittest")
  1737. # these are for backward compatibility
  1738. AC_SUBST(LIB_TDESYCOCA, "-ltdeio")
  1739. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  1740. fi
  1741. ])
  1742. AC_DEFUN([AC_PATH_KDE],
  1743. [
  1744. AC_BASE_PATH_KDE
  1745. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  1746. [
  1747. if test "$enableval" = "no";
  1748. then ac_use_path_checking="default"
  1749. else ac_use_path_checking=""
  1750. fi
  1751. ],
  1752. [
  1753. ac_use_path_checking="default"
  1754. ]
  1755. )
  1756. AC_CREATE_KFSSTND($ac_use_path_checking)
  1757. AC_SUBST_KFSSTND
  1758. KDE_CREATE_LIBS_ALIASES
  1759. ])
  1760. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1761. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  1762. [
  1763. AC_MSG_CHECKING(for $1)
  1764. AC_CACHE_VAL(kde_cv_func_$1,
  1765. [
  1766. AC_LANG_SAVE
  1767. AC_LANG_CPLUSPLUS
  1768. save_CXXFLAGS="$CXXFLAGS"
  1769. kde_safe_LIBS="$LIBS"
  1770. LIBS="$LIBS $X_EXTRA_LIBS"
  1771. if test "$GXX" = "yes"; then
  1772. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1773. fi
  1774. if test -z "$tqt_includes"; then
  1775. CXXFLAGS="$CXXFLAGS"
  1776. else
  1777. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  1778. fi
  1779. AC_TRY_COMPILE([
  1780. $2
  1781. ],
  1782. [
  1783. $3
  1784. ],
  1785. kde_cv_func_$1=yes,
  1786. kde_cv_func_$1=no)
  1787. CXXFLAGS="$save_CXXFLAGS"
  1788. LIBS="$kde_safe_LIBS"
  1789. AC_LANG_RESTORE
  1790. ])
  1791. AC_MSG_RESULT($kde_cv_func_$1)
  1792. AC_MSG_CHECKING([if $1 needs custom prototype])
  1793. AC_CACHE_VAL(kde_cv_proto_$1,
  1794. [
  1795. if test "x$kde_cv_func_$1" = xyes; then
  1796. kde_cv_proto_$1=no
  1797. else
  1798. case "$1" in
  1799. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1800. kde_cv_proto_$1="yes - in libtdefakes"
  1801. ;;
  1802. *)
  1803. kde_cv_proto_$1=unknown
  1804. ;;
  1805. esac
  1806. fi
  1807. if test "x$kde_cv_proto_$1" = xunknown; then
  1808. AC_LANG_SAVE
  1809. AC_LANG_CPLUSPLUS
  1810. kde_safe_libs=$LIBS
  1811. LIBS="$LIBS $X_EXTRA_LIBS"
  1812. AC_TRY_LINK([
  1813. $2
  1814. extern "C" $4;
  1815. ],
  1816. [
  1817. $3
  1818. ],
  1819. [ kde_cv_func_$1=yes
  1820. kde_cv_proto_$1=yes ],
  1821. [kde_cv_proto_$1="$1 unavailable"]
  1822. )
  1823. LIBS=$kde_safe_libs
  1824. AC_LANG_RESTORE
  1825. fi
  1826. ])
  1827. AC_MSG_RESULT($kde_cv_proto_$1)
  1828. if test "x$kde_cv_func_$1" = xyes; then
  1829. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1830. $6
  1831. fi
  1832. if test "x$kde_cv_proto_$1" = xno; then
  1833. AC_DEFINE(HAVE_$5_PROTO, 1,
  1834. [Define if you have the $1 prototype])
  1835. fi
  1836. AH_VERBATIM([_HAVE_$5_PROTO],
  1837. [
  1838. #if !defined(HAVE_$5_PROTO)
  1839. #ifdef __cplusplus
  1840. extern "C" {
  1841. #endif
  1842. $4;
  1843. #ifdef __cplusplus
  1844. }
  1845. #endif
  1846. #endif
  1847. ])
  1848. ])
  1849. AC_DEFUN([AC_CHECK_SETENV],
  1850. [
  1851. KDE_CHECK_FUNC_EXT(setenv, [
  1852. #include <stdlib.h>
  1853. ],
  1854. [setenv("VAR", "VALUE", 1);],
  1855. [int setenv (const char *, const char *, int)],
  1856. [SETENV])
  1857. ])
  1858. AC_DEFUN([AC_CHECK_UNSETENV],
  1859. [
  1860. KDE_CHECK_FUNC_EXT(unsetenv, [
  1861. #include <stdlib.h>
  1862. ],
  1863. [unsetenv("VAR");],
  1864. [void unsetenv (const char *)],
  1865. [UNSETENV])
  1866. ])
  1867. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  1868. [
  1869. KDE_CHECK_FUNC_EXT(getdomainname, [
  1870. #include <stdlib.h>
  1871. #include <unistd.h>
  1872. #include <netdb.h>
  1873. ],
  1874. [
  1875. char buffer[200];
  1876. getdomainname(buffer, 200);
  1877. ],
  1878. [#include <sys/types.h>
  1879. int getdomainname (char *, size_t)],
  1880. [GETDOMAINNAME])
  1881. ])
  1882. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  1883. [
  1884. KDE_CHECK_FUNC_EXT(gethostname, [
  1885. #include <stdlib.h>
  1886. #include <unistd.h>
  1887. ],
  1888. [
  1889. char buffer[200];
  1890. gethostname(buffer, 200);
  1891. ],
  1892. [int gethostname (char *, unsigned int)],
  1893. [GETHOSTNAME])
  1894. ])
  1895. AC_DEFUN([AC_CHECK_USLEEP],
  1896. [
  1897. KDE_CHECK_FUNC_EXT(usleep, [
  1898. #include <unistd.h>
  1899. ],
  1900. [
  1901. usleep(200);
  1902. ],
  1903. [int usleep (unsigned int)],
  1904. [USLEEP])
  1905. ])
  1906. AC_DEFUN([AC_CHECK_RANDOM],
  1907. [
  1908. KDE_CHECK_FUNC_EXT(random, [
  1909. #include <stdlib.h>
  1910. ],
  1911. [
  1912. random();
  1913. ],
  1914. [long int random(void)],
  1915. [RANDOM])
  1916. KDE_CHECK_FUNC_EXT(srandom, [
  1917. #include <stdlib.h>
  1918. ],
  1919. [
  1920. srandom(27);
  1921. ],
  1922. [void srandom(unsigned int)],
  1923. [SRANDOM])
  1924. ])
  1925. AC_DEFUN([AC_CHECK_INITGROUPS],
  1926. [
  1927. KDE_CHECK_FUNC_EXT(initgroups, [
  1928. #include <sys/types.h>
  1929. #include <unistd.h>
  1930. #include <grp.h>
  1931. ],
  1932. [
  1933. char buffer[200];
  1934. initgroups(buffer, 27);
  1935. ],
  1936. [int initgroups(const char *, gid_t)],
  1937. [INITGROUPS])
  1938. ])
  1939. AC_DEFUN([AC_CHECK_MKSTEMPS],
  1940. [
  1941. KDE_CHECK_FUNC_EXT(mkstemps, [
  1942. #include <stdlib.h>
  1943. #include <unistd.h>
  1944. ],
  1945. [
  1946. mkstemps("/tmp/aaaXXXXXX", 6);
  1947. ],
  1948. [int mkstemps(char *, int)],
  1949. [MKSTEMPS])
  1950. ])
  1951. AC_DEFUN([AC_CHECK_MKSTEMP],
  1952. [
  1953. KDE_CHECK_FUNC_EXT(mkstemp, [
  1954. #include <stdlib.h>
  1955. #include <unistd.h>
  1956. ],
  1957. [
  1958. mkstemp("/tmp/aaaXXXXXX");
  1959. ],
  1960. [int mkstemp(char *)],
  1961. [MKSTEMP])
  1962. ])
  1963. AC_DEFUN([AC_CHECK_MKDTEMP],
  1964. [
  1965. KDE_CHECK_FUNC_EXT(mkdtemp, [
  1966. #include <stdlib.h>
  1967. #include <unistd.h>
  1968. ],
  1969. [
  1970. mkdtemp("/tmp/aaaXXXXXX");
  1971. ],
  1972. [char *mkdtemp(char *)],
  1973. [MKDTEMP])
  1974. ])
  1975. AC_DEFUN([AC_CHECK_RES_INIT],
  1976. [
  1977. AC_MSG_CHECKING([if res_init needs -lresolv])
  1978. kde_libs_safe="$LIBS"
  1979. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  1980. AC_TRY_LINK(
  1981. [
  1982. #include <sys/types.h>
  1983. #include <netinet/in.h>
  1984. #include <arpa/nameser.h>
  1985. #include <resolv.h>
  1986. ],
  1987. [
  1988. res_init();
  1989. ],
  1990. [
  1991. LIBRESOLV="-lresolv"
  1992. AC_MSG_RESULT(yes)
  1993. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  1994. ],
  1995. [ AC_MSG_RESULT(no) ]
  1996. )
  1997. LIBS=$kde_libs_safe
  1998. AC_SUBST(LIBRESOLV)
  1999. KDE_CHECK_FUNC_EXT(res_init,
  2000. [
  2001. #include <sys/types.h>
  2002. #include <netinet/in.h>
  2003. #include <arpa/nameser.h>
  2004. #include <resolv.h>
  2005. ],
  2006. [res_init()],
  2007. [int res_init(void)],
  2008. [RES_INIT])
  2009. ])
  2010. AC_DEFUN([AC_CHECK_STRLCPY],
  2011. [
  2012. KDE_CHECK_FUNC_EXT(strlcpy, [
  2013. #include <string.h>
  2014. ],
  2015. [ char buf[20];
  2016. strlcpy(buf, "TDE function test", sizeof(buf));
  2017. ],
  2018. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2019. [STRLCPY])
  2020. ])
  2021. AC_DEFUN([AC_CHECK_STRLCAT],
  2022. [
  2023. KDE_CHECK_FUNC_EXT(strlcat, [
  2024. #include <string.h>
  2025. ],
  2026. [ char buf[20];
  2027. buf[0]='\0';
  2028. strlcat(buf, "TDE function test", sizeof(buf));
  2029. ],
  2030. [unsigned long strlcat(char*, const char*, unsigned long)],
  2031. [STRLCAT])
  2032. ])
  2033. AC_DEFUN([AC_CHECK_RES_QUERY],
  2034. [
  2035. KDE_CHECK_FUNC_EXT(res_query, [
  2036. #include <sys/types.h>
  2037. #include <netinet/in.h>
  2038. #include <arpa/nameser.h>
  2039. #include <resolv.h>
  2040. #include <netdb.h>
  2041. ],
  2042. [
  2043. res_query(NULL, 0, 0, NULL, 0);
  2044. ],
  2045. [int res_query(const char *, int, int, unsigned char *, int)],
  2046. [RES_QUERY])
  2047. ])
  2048. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2049. [
  2050. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2051. #include <sys/types.h>
  2052. #include <netinet/in.h>
  2053. #include <arpa/nameser.h>
  2054. #include <resolv.h>
  2055. ],
  2056. [
  2057. dn_skipname (NULL, NULL);
  2058. ],
  2059. [int dn_skipname (unsigned char *, unsigned char *)],
  2060. [DN_SKIPNAME])
  2061. ])
  2062. AC_DEFUN([AC_FIND_GIF],
  2063. [AC_MSG_CHECKING([for giflib])
  2064. AC_CACHE_VAL(ac_cv_lib_gif,
  2065. [ac_save_LIBS="$LIBS"
  2066. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  2067. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2068. else
  2069. LIBS="$all_libraries -lgif"
  2070. fi
  2071. AC_TRY_LINK(dnl
  2072. [
  2073. #ifdef __cplusplus
  2074. extern "C" {
  2075. #endif
  2076. int GifLastError(void);
  2077. #ifdef __cplusplus
  2078. }
  2079. #endif
  2080. /* We use char because int might match the return type of a gcc2
  2081. builtin and then its argument prototype would still apply. */
  2082. ],
  2083. [return GifLastError();],
  2084. eval "ac_cv_lib_gif=yes",
  2085. eval "ac_cv_lib_gif=no")
  2086. LIBS="$ac_save_LIBS"
  2087. ])dnl
  2088. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2089. AC_MSG_RESULT(yes)
  2090. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2091. else
  2092. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2093. fi
  2094. ])
  2095. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2096. [
  2097. AC_MSG_CHECKING([for libjpeg$2])
  2098. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2099. [
  2100. ac_save_LIBS="$LIBS"
  2101. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2102. ac_save_CFLAGS="$CFLAGS"
  2103. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2104. AC_TRY_LINK(
  2105. [
  2106. #ifdef __cplusplus
  2107. extern "C" {
  2108. #endif
  2109. void jpeg_CreateDecompress();
  2110. #ifdef __cplusplus
  2111. }
  2112. #endif
  2113. ],
  2114. [jpeg_CreateDecompress();],
  2115. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2116. eval "ac_cv_lib_jpeg_$1=no")
  2117. LIBS="$ac_save_LIBS"
  2118. CFLAGS="$ac_save_CFLAGS"
  2119. ])
  2120. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2121. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2122. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2123. else
  2124. AC_MSG_RESULT(no)
  2125. $3
  2126. fi
  2127. ])
  2128. AC_DEFUN([AC_FIND_JPEG],
  2129. [
  2130. dnl first look for libraries
  2131. KDE_FIND_JPEG_HELPER(6b, 6b,
  2132. KDE_FIND_JPEG_HELPER(normal, [],
  2133. [
  2134. LIBJPEG=
  2135. ]
  2136. )
  2137. )
  2138. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2139. dnl requires system dependent includes loaded before it)
  2140. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2141. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2142. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2143. dnl if headers _and_ libraries are missing, this is no error, and we
  2144. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2145. dnl if only one is missing, it means a configuration error, but we still
  2146. dnl only warn
  2147. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2148. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2149. else
  2150. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2151. AC_MSG_WARN([
  2152. There is an installation error in jpeg support. You seem to have only one
  2153. of either the headers _or_ the libraries installed. You may need to either
  2154. provide correct --with-extra-... options, or the development package of
  2155. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2156. Disabling JPEG support.
  2157. ])
  2158. else
  2159. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2160. fi
  2161. jpeg_incdir=
  2162. LIBJPEG=
  2163. fi
  2164. AC_SUBST(LIBJPEG)
  2165. AH_VERBATIM(_AC_CHECK_JPEG,
  2166. [/*
  2167. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2168. * headers and I'm too lazy to write a configure test as long as only
  2169. * unixware is related
  2170. */
  2171. #ifdef _UNIXWARE
  2172. #define HAVE_BOOLEAN
  2173. #endif
  2174. ])
  2175. ])
  2176. AC_DEFUN([KDE_CHECK_TQT],
  2177. [
  2178. AC_MSG_CHECKING([if TQt is available])
  2179. AC_CACHE_VAL(kde_cv_tqt,
  2180. [
  2181. AC_LANG_SAVE
  2182. AC_LANG_CPLUSPLUS
  2183. ac_save_LIBS="$LIBS"
  2184. LIBS="$all_libraries $USER_LDFLAGS $LIBTQT -ltqt"
  2185. ac_save_CXXFLAGS="$CXXFLAGS"
  2186. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2187. if test "$kde_tqtver" -gt "2"; then
  2188. AC_TRY_LINK(
  2189. [#include <tqtimer.h>],
  2190. [
  2191. TQTimer *test_timer(0);
  2192. test_timer->start(1000);],
  2193. eval "kde_cv_tqt=no",
  2194. eval "kde_cv_tqt=yes")
  2195. fi
  2196. LIBS="$ac_save_LIBS"
  2197. CXXFLAGS="$ac_save_CXXFLAGS"
  2198. AC_LANG_RESTORE
  2199. ])
  2200. if eval "test ! \"`echo $kde_cv_tqt`\" = no"; then
  2201. AC_MSG_RESULT(no)
  2202. dnl AC_MSG_ERROR([You are attempting to compile Trinity without the Trinity TQt Interface installed. Please install libtqtinterface-dev and try again!])
  2203. AC_MSG_WARN([You are attempting to compile Trinity without the Trinity TQt Interface installed. Please install libtqtinterface-dev and try again!])
  2204. TQTMOC="\$PATH=\$PATH:\$(srcdir)/ tmoc"
  2205. LIBTQT_LDFLAGS="-ltqt"
  2206. AC_SUBST(LIBTQT_LDFLAGS)
  2207. tqtlib="$tqtlib $LIBTQT_LDFLAGS"
  2208. else
  2209. AC_MSG_RESULT(yes)
  2210. LIBTQT_LDFLAGS="-ltqt"
  2211. AC_SUBST(LIBTQT_LDFLAGS)
  2212. dnl all_libraries="$all_libraries $LIBTQT_LDFLAGS"
  2213. TQT_LDFLAGS="$TQT_LDFLAGS $LIBTQT_LDFLAGS"
  2214. AC_SUBST(TQT_LDFLAGS)
  2215. tqtlib="$tqtlib $LIBTQT_LDFLAGS"
  2216. LIBTQT_CXXFLAGS="-include tqt.h"
  2217. all_includes="$all_includes $LIBTQT_CXXFLAGS"
  2218. TQT_INCLUDES="$TQT_INCLUDES $LIBTQT_CXXFLAGS"
  2219. KDE_FIND_PATH(tmoc, TQTMOC, [$tqt_bindirs], [KDE_TQTMOC_ERROR_MESSAGE])
  2220. AC_SUBST(TQTMOC)
  2221. KDE_FIND_PATH(dcopidl, TQTDCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  2222. KDE_FIND_PATH(dcopidl2cpp, TQTDCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  2223. if test "$build_arts" '!=' "no"; then
  2224. KDE_FIND_PATH(mcopidl, TQTMCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  2225. fi
  2226. KDE_FIND_PATH(dcopidlng, TQTDCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  2227. AC_SUBST(TQTDCOPIDL)
  2228. AC_SUBST(TQTMCOPIDL)
  2229. AC_SUBST(TQTDCOPIDLNG)
  2230. AC_SUBST(TQTDCOPIDL2CPP)
  2231. fi
  2232. ])
  2233. AC_DEFUN([KDE_CHECK_TQT_JPEG],
  2234. [
  2235. if test -n "$LIBJPEG"; then
  2236. AC_MSG_CHECKING([if TQt needs $LIBJPEG])
  2237. AC_CACHE_VAL(kde_cv_tqt_jpeg,
  2238. [
  2239. AC_LANG_SAVE
  2240. AC_LANG_CPLUSPLUS
  2241. ac_save_LIBS="$LIBS"
  2242. LIBS="$all_libraries $USER_LDFLAGS $LIBTQT"
  2243. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2244. ac_save_CXXFLAGS="$CXXFLAGS"
  2245. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2246. if test "$kde_tqtver" = "3"; then
  2247. if $PKG_CONFIG --exists tqt-mt ; then
  2248. AC_TRY_LINK(
  2249. [#include <tqapplication.h>],
  2250. [
  2251. int argc;
  2252. char** argv;
  2253. TQApplication app(argc, argv);],
  2254. eval "kde_cv_tqt_jpeg=no",
  2255. eval "kde_cv_tqt_jpeg=yes")
  2256. fi
  2257. fi
  2258. LIBS="$ac_save_LIBS"
  2259. CXXFLAGS="$ac_save_CXXFLAGS"
  2260. AC_LANG_RESTORE
  2261. fi
  2262. ])
  2263. if eval "test ! \"`echo $kde_cv_tqt_jpeg`\" = no"; then
  2264. AC_MSG_RESULT(yes)
  2265. LIBJPEG_TQT='$(LIBJPEG)'
  2266. else
  2267. AC_MSG_RESULT(no)
  2268. LIBJPEG_TQT=
  2269. fi
  2270. ])
  2271. AC_DEFUN([AC_FIND_ZLIB],
  2272. [
  2273. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2274. AC_MSG_CHECKING([for libz])
  2275. AC_CACHE_VAL(ac_cv_lib_z,
  2276. [
  2277. kde_save_LIBS="$LIBS"
  2278. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2279. kde_save_CFLAGS="$CFLAGS"
  2280. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2281. AC_TRY_LINK(dnl
  2282. [
  2283. #include<zlib.h>
  2284. #include<string.h>
  2285. ],
  2286. [
  2287. char buf[42];
  2288. gzFile f = (gzFile) 0;
  2289. /* this would segfault.. but we only link, don't run */
  2290. (void) gzgets(f, buf, sizeof(buf));
  2291. return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
  2292. ],
  2293. eval "ac_cv_lib_z='-lz'",
  2294. eval "ac_cv_lib_z=no")
  2295. LIBS="$kde_save_LIBS"
  2296. CFLAGS="$kde_save_CFLAGS"
  2297. ])dnl
  2298. if test ! "$ac_cv_lib_z" = no; then
  2299. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2300. LIBZ="$ac_cv_lib_z"
  2301. AC_MSG_RESULT($ac_cv_lib_z)
  2302. else
  2303. AC_MSG_ERROR(not found.
  2304. Possibly configure picks up an outdated version
  2305. installed by XFree86. Remove it from your system.
  2306. Check your installation and look into config.log)
  2307. LIBZ=""
  2308. fi
  2309. AC_SUBST(LIBZ)
  2310. ])
  2311. AC_DEFUN([KDE_TRY_TIFFLIB],
  2312. [
  2313. AC_MSG_CHECKING([for libtiff $1])
  2314. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2315. [
  2316. AC_LANG_SAVE
  2317. AC_LANG_CPLUSPLUS
  2318. kde_save_LIBS="$LIBS"
  2319. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  2320. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2321. else
  2322. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2323. fi
  2324. kde_save_CXXFLAGS="$CXXFLAGS"
  2325. kde_save_LDFLAGS="$LDFLAGS"
  2326. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2327. LDFLAGS="$LDFLAGS -ltqt"
  2328. AC_TRY_LINK(dnl
  2329. [
  2330. #include<tiffio.h>
  2331. ],
  2332. [return (TIFFOpen( "", "r") == 0); ],
  2333. [
  2334. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2335. ], [
  2336. kde_cv_libtiff_$1=no
  2337. ])
  2338. LIBS="$kde_save_LIBS"
  2339. CXXFLAGS="$kde_save_CXXFLAGS"
  2340. LDFLAGS="$kde_save_LDFLAGS"
  2341. AC_LANG_RESTORE
  2342. ])
  2343. if test "$kde_cv_libtiff_$1" = "no"; then
  2344. AC_MSG_RESULT(no)
  2345. LIBTIFF=""
  2346. $3
  2347. else
  2348. LIBTIFF="$kde_cv_libtiff_$1"
  2349. AC_MSG_RESULT(yes)
  2350. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2351. $2
  2352. fi
  2353. ])
  2354. AC_DEFUN([AC_FIND_TIFF],
  2355. [
  2356. AC_REQUIRE([K_PATH_X])
  2357. AC_REQUIRE([AC_FIND_ZLIB])
  2358. AC_REQUIRE([AC_FIND_JPEG])
  2359. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2360. KDE_TRY_TIFFLIB(tiff, [],
  2361. KDE_TRY_TIFFLIB(tiff34))
  2362. AC_SUBST(LIBTIFF)
  2363. ])
  2364. AC_DEFUN([KDE_FIND_LIBEXR],
  2365. [
  2366. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2367. AC_REQUIRE([AC_FIND_ZLIB])
  2368. AC_CACHE_VAL(ac_cv_libexr,
  2369. [
  2370. if test -z "$PKG_CONFIG"; then
  2371. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2372. fi
  2373. AC_MSG_CHECKING([for OpenEXR libraries])
  2374. if test "$PKG_CONFIG" = "no" ; then
  2375. AC_MSG_RESULT(no)
  2376. echo "*** The pkg-config script could not be found. Make sure it is"
  2377. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2378. echo "*** to the full path to pkg-config."
  2379. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2380. else
  2381. if ! $PKG_CONFIG --exists OpenEXR ; then
  2382. AC_MSG_RESULT(no)
  2383. EXRSTATUS=no
  2384. else
  2385. if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
  2386. AC_MSG_RESULT(no)
  2387. EXRSTATUS=old
  2388. else
  2389. kde_save_LIBS="$LIBS"
  2390. LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
  2391. AC_LANG_SAVE
  2392. AC_LANG_CPLUSPLUS
  2393. kde_save_CXXFLAGS="$CXXFLAGS"
  2394. kde_save_LDFLAGS="$LDFLAGS"
  2395. LDFLAGS="$LFLAGS -ltqt"
  2396. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2397. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2398. AC_TRY_LINK(dnl
  2399. [
  2400. #include <ImfRgbaFile.h>
  2401. ],
  2402. [
  2403. using namespace Imf;
  2404. RgbaInputFile file ("dummy");
  2405. return 0;
  2406. ],
  2407. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2408. eval "ac_cv_libexr=no"
  2409. )
  2410. LIBS="$kde_save_LIBS"
  2411. CXXFLAGS="$kde_save_CXXFLAGS"
  2412. LDFLAGS="$kde_save_LDFLAGS"
  2413. AC_LANG_RESTORE
  2414. ])dnl
  2415. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2416. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2417. LIB_EXR="$ac_cv_libexr"
  2418. AC_MSG_RESULT($ac_cv_libexr)
  2419. else
  2420. AC_MSG_RESULT(no)
  2421. LIB_EXR=""
  2422. fi
  2423. fi
  2424. fi
  2425. fi
  2426. AC_SUBST(LIB_EXR)
  2427. AC_SUBST(EXR_FLAGS)
  2428. ])
  2429. AC_DEFUN([AC_FIND_PNG],
  2430. [
  2431. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2432. AC_REQUIRE([AC_FIND_ZLIB])
  2433. AC_MSG_CHECKING([for libpng])
  2434. AC_CACHE_VAL(ac_cv_lib_png,
  2435. [
  2436. kde_save_LIBS="$LIBS"
  2437. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  2438. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2439. else
  2440. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2441. fi
  2442. kde_save_CFLAGS="$CFLAGS"
  2443. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2444. AC_TRY_LINK(dnl
  2445. [
  2446. #include<png.h>
  2447. ],
  2448. [
  2449. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2450. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2451. return( png_ptr != 0 );
  2452. ],
  2453. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2454. eval "ac_cv_lib_png=no"
  2455. )
  2456. LIBS="$kde_save_LIBS"
  2457. CFLAGS="$kde_save_CFLAGS"
  2458. ])dnl
  2459. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2460. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2461. LIBPNG="$ac_cv_lib_png"
  2462. AC_SUBST(LIBPNG)
  2463. AC_MSG_RESULT($ac_cv_lib_png)
  2464. else
  2465. AC_MSG_RESULT(no)
  2466. LIBPNG=""
  2467. AC_SUBST(LIBPNG)
  2468. fi
  2469. ])
  2470. AC_DEFUN([AC_FIND_JASPER],
  2471. [
  2472. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2473. AC_REQUIRE([AC_FIND_JPEG])
  2474. AC_MSG_CHECKING([for jasper])
  2475. AC_CACHE_VAL(ac_cv_jasper,
  2476. [
  2477. kde_save_LIBS="$LIBS"
  2478. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2479. kde_save_CFLAGS="$CFLAGS"
  2480. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2481. AC_TRY_LINK(dnl
  2482. [
  2483. #include<jasper/jasper.h>
  2484. ],
  2485. [
  2486. return( jas_init() );
  2487. ],
  2488. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2489. eval "ac_cv_jasper=no"
  2490. )
  2491. LIBS="$kde_save_LIBS"
  2492. CFLAGS="$kde_save_CFLAGS"
  2493. ])dnl
  2494. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2495. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2496. LIB_JASPER="$ac_cv_jasper"
  2497. AC_MSG_RESULT($ac_cv_jasper)
  2498. else
  2499. AC_MSG_RESULT(no)
  2500. LIB_JASPER=""
  2501. fi
  2502. AC_SUBST(LIB_JASPER)
  2503. ])
  2504. AC_DEFUN([AC_CHECK_BOOL],
  2505. [
  2506. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2507. ])
  2508. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2509. [
  2510. AC_MSG_CHECKING([whether $CXX supports -$1])
  2511. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2512. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2513. [
  2514. AC_LANG_SAVE
  2515. AC_LANG_CPLUSPLUS
  2516. save_CXXFLAGS="$CXXFLAGS"
  2517. CXXFLAGS="$CXXFLAGS -$1"
  2518. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2519. CXXFLAGS="$save_CXXFLAGS"
  2520. AC_LANG_RESTORE
  2521. ])
  2522. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2523. AC_MSG_RESULT(yes)
  2524. :
  2525. $2
  2526. else
  2527. AC_MSG_RESULT(no)
  2528. :
  2529. $3
  2530. fi
  2531. ])
  2532. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2533. [
  2534. AC_MSG_CHECKING([whether $CC supports -$1])
  2535. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2536. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2537. [
  2538. AC_LANG_SAVE
  2539. AC_LANG_C
  2540. save_CFLAGS="$CFLAGS"
  2541. CFLAGS="$CFLAGS -$1"
  2542. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2543. CFLAGS="$save_CFLAGS"
  2544. AC_LANG_RESTORE
  2545. ])
  2546. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2547. AC_MSG_RESULT(yes)
  2548. :
  2549. $2
  2550. else
  2551. AC_MSG_RESULT(no)
  2552. :
  2553. $3
  2554. fi
  2555. ])
  2556. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2557. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2558. dnl it's all white-space separated
  2559. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2560. [ __val=$$1
  2561. __forbid=" $2 "
  2562. if test -n "$__val"; then
  2563. __new=""
  2564. ac_save_IFS=$IFS
  2565. IFS=" "
  2566. for i in $__val; do
  2567. case "$__forbid" in
  2568. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2569. *) # Careful to not add spaces, where there were none, because otherwise
  2570. # libtool gets confused, if we change e.g. CXX
  2571. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2572. esac
  2573. done
  2574. IFS=$ac_save_IFS
  2575. $1=$__new
  2576. fi
  2577. ])
  2578. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2579. [
  2580. AC_MSG_CHECKING([whether $CC is blacklisted])
  2581. dnl In theory we have tu run this test against $CC and $CXX
  2582. dnl in C and in C++ mode, because its perfectly legal for
  2583. dnl the user to mix compiler versions, since C has a defined
  2584. dnl ABI.
  2585. dnl
  2586. dnl For now, we assume the user is not on crack.
  2587. AC_TRY_COMPILE([
  2588. #ifdef __GNUC__
  2589. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  2590. choke me
  2591. #endif
  2592. #endif
  2593. ], ,
  2594. kde_bad_compiler=no,
  2595. kde_bad_compiler=yes
  2596. )
  2597. AC_MSG_RESULT($kde_bad_compiler)
  2598. if test "$kde_bad_compiler" = "yes"; then
  2599. AC_MSG_ERROR([
  2600. This particular compiler version is blacklisted because it
  2601. is known to miscompile KDE. Please use a newer version, or
  2602. if that is not yet available, choose an older version.
  2603. Please do not report a bug or bother us reporting this
  2604. configure error. We know about it, and we introduced
  2605. it by intention to avoid untraceable bugs or crashes in KDE.
  2606. ])
  2607. fi
  2608. ])
  2609. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  2610. [
  2611. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  2612. kde_cv_opt_noinline_match,
  2613. [
  2614. kde_cv_opt_noinline_match=irrelevant
  2615. dnl if we don't use both -O2 and -fno-inline, this check is moot
  2616. if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
  2617. && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
  2618. ac_cflags_save="$CFLAGS"
  2619. CFLAGS="$CFLAGS -D_USE_GNU"
  2620. AC_TRY_LINK([
  2621. #include <string.h>
  2622. ], [ const char *pt, *et;
  2623. 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 , ";," )); }) ;
  2624. ],
  2625. kde_cv_opt_noinline_match=yes,
  2626. kde_cv_opt_noinline_match=no
  2627. )
  2628. CFLAGS="$ac_cflags_save"
  2629. fi
  2630. ])
  2631. ])
  2632. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2633. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2634. [dnl
  2635. if test "x$kde_use_tqt_emb" != "xyes"; then
  2636. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2637. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2638. else
  2639. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2640. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2641. fi
  2642. ])
  2643. AC_DEFUN([AC_CHECK_COMPILERS],
  2644. [
  2645. AC_ARG_ENABLE(debug,
  2646. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2647. [
  2648. case $enableval in
  2649. yes)
  2650. kde_use_debug_code="yes"
  2651. kde_use_debug_define=no
  2652. ;;
  2653. full)
  2654. kde_use_debug_code="full"
  2655. kde_use_debug_define=no
  2656. ;;
  2657. *)
  2658. kde_use_debug_code="no"
  2659. kde_use_debug_define=yes
  2660. ;;
  2661. esac
  2662. ],
  2663. [kde_use_debug_code="no"
  2664. kde_use_debug_define=no
  2665. ])
  2666. dnl Just for configure --help
  2667. AC_ARG_ENABLE(dummyoption,
  2668. AC_HELP_STRING([--disable-debug],
  2669. [disables debug output and debug symbols [default=no]]),
  2670. [],[])
  2671. AC_ARG_ENABLE(strict,
  2672. AC_HELP_STRING([--enable-strict],
  2673. [compiles with strict compiler options (may not work!)]),
  2674. [
  2675. if test $enableval = "no"; then
  2676. kde_use_strict_options="no"
  2677. else
  2678. kde_use_strict_options="yes"
  2679. fi
  2680. ], [kde_use_strict_options="no"])
  2681. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2682. [
  2683. if test $enableval = "no"; then
  2684. kde_use_warnings="no"
  2685. else
  2686. kde_use_warnings="yes"
  2687. fi
  2688. ], [kde_use_warnings="yes"])
  2689. dnl enable warnings for debug build
  2690. if test "$kde_use_debug_code" != "no"; then
  2691. kde_use_warnings=yes
  2692. fi
  2693. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2694. [kde_use_profiling=$enableval],
  2695. [kde_use_profiling="no"]
  2696. )
  2697. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2698. CFLAGS=" $CFLAGS"
  2699. AC_PROG_CC
  2700. AC_PROG_CPP
  2701. AC_C_BIGENDIAN
  2702. if test "$GCC" = "yes"; then
  2703. if test "$kde_use_debug_code" != "no"; then
  2704. if test $kde_use_debug_code = "full"; then
  2705. CFLAGS="-g3 -fno-inline $CFLAGS"
  2706. else
  2707. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  2708. fi
  2709. else
  2710. CFLAGS="-O2 $CFLAGS"
  2711. fi
  2712. fi
  2713. if test "$kde_use_debug_define" = "yes"; then
  2714. CFLAGS="-DNDEBUG $CFLAGS"
  2715. fi
  2716. case "$host" in
  2717. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2718. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2719. esac
  2720. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2721. LDFLAGS=""
  2722. fi
  2723. CXXFLAGS=" $CXXFLAGS"
  2724. AC_PROG_CXX
  2725. KDE_CHECK_FOR_BAD_COMPILER
  2726. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2727. if test "$kde_use_debug_code" != "no"; then
  2728. if test "$CXX" = "KCC"; then
  2729. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2730. else
  2731. if test "$kde_use_debug_code" = "full"; then
  2732. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2733. else
  2734. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  2735. fi
  2736. fi
  2737. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2738. dnl convenience compiler flags
  2739. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2740. AC_SUBST(WOVERLOADED_VIRTUAL)
  2741. else
  2742. if test "$CXX" = "KCC"; then
  2743. CXXFLAGS="+K3 $CXXFLAGS"
  2744. else
  2745. CXXFLAGS="-O2 $CXXFLAGS"
  2746. fi
  2747. fi
  2748. fi
  2749. if test "$kde_use_debug_define" = "yes"; then
  2750. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2751. fi
  2752. if test "$kde_use_profiling" = "yes"; then
  2753. KDE_CHECK_COMPILER_FLAG(pg,
  2754. [
  2755. CFLAGS="-pg $CFLAGS"
  2756. CXXFLAGS="-pg $CXXFLAGS"
  2757. ])
  2758. fi
  2759. if test "$kde_use_warnings" = "yes"; then
  2760. if test "$GCC" = "yes"; then
  2761. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  2762. case $host in
  2763. *-*-linux-gnu)
  2764. CFLAGS="-W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_DEFAULT_SOURCE $CFLAGS"
  2765. CXXFLAGS="-ansi -D_DEFAULT_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
  2766. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2767. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2768. ;;
  2769. esac
  2770. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2771. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2772. dnl ### FIXME: revert for TDE 4
  2773. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  2774. fi
  2775. fi
  2776. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2777. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2778. fi
  2779. AC_ARG_ENABLE(pch,
  2780. AC_HELP_STRING([--enable-pch],
  2781. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2782. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2783. HAVE_GCC_VISIBILITY=0
  2784. AC_SUBST([HAVE_GCC_VISIBILITY])
  2785. if test "$GXX" = "yes"; then
  2786. gcc_no_reorder_blocks=NO
  2787. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  2788. if test $kde_use_debug_code != "no" && \
  2789. test $kde_use_debug_code != "full" && \
  2790. test "YES" = "$gcc_no_reorder_blocks" ; then
  2791. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  2792. CFLAGS="$CFLAGS -fno-reorder-blocks"
  2793. fi
  2794. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2795. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2796. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2797. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2798. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2799. if test "$kde_use_pch" = "yes"; then
  2800. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2801. echo >conftest.h
  2802. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2803. kde_gcc_supports_pch=yes
  2804. AC_MSG_RESULT(yes)
  2805. else
  2806. kde_gcc_supports_pch=no
  2807. AC_MSG_RESULT(no)
  2808. fi
  2809. if test "$kde_gcc_supports_pch" = "yes"; then
  2810. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2811. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2812. kde_gcc_supports_pch=yes
  2813. AC_MSG_RESULT(yes)
  2814. else
  2815. kde_gcc_supports_pch=no
  2816. AC_MSG_RESULT(no)
  2817. fi
  2818. fi
  2819. rm -f conftest.h conftest.h.gch
  2820. fi
  2821. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  2822. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  2823. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  2824. fi
  2825. fi
  2826. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2827. if test "$CXX" = "KCC"; then
  2828. dnl unfortunately we currently cannot disable exception support in KCC
  2829. dnl because doing so is binary incompatible and TQt by default links with exceptions :-(
  2830. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2831. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2832. if test "$kde_use_pch" = "yes"; then
  2833. dnl TODO: support --pch-dir!
  2834. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2835. dnl the below works (but the dir must exist), but it's
  2836. dnl useless for a whole package.
  2837. dnl The are precompiled headers for each source file, so when compiling
  2838. dnl from scratch, it doesn't make a difference, and they take up
  2839. dnl around ~5Mb _per_ sourcefile.
  2840. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2841. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2842. fi
  2843. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2844. dnl all implementations that are defined inside the class {} declaration.
  2845. dnl because of templates-compatibility with broken gcc compilers, this
  2846. dnl can cause excessive inlining. This flag limits it to a sane level
  2847. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2848. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2849. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2850. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2851. dnl Some source files are shared between multiple executables
  2852. dnl (or libraries) and some of those need template instantiations.
  2853. dnl In that case KCC needs to compile those sources with
  2854. dnl --one_instantiation_per_object. To make it easy for us we compile
  2855. dnl _all_ objects with that flag (--one_per is a shorthand).
  2856. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2857. fi
  2858. AC_SUBST(USE_EXCEPTIONS)
  2859. dnl obsolete macro - provided to keep things going
  2860. USE_RTTI=
  2861. AC_SUBST(USE_RTTI)
  2862. case "$host" in
  2863. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2864. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2865. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2866. *-*-solaris*)
  2867. if test "$GXX" = yes; then
  2868. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2869. if test ! -f $libstdcpp; then
  2870. 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])
  2871. fi
  2872. fi
  2873. ;;
  2874. esac
  2875. AC_VALIDIFY_CXXFLAGS
  2876. AC_PROG_CXXCPP
  2877. if test "$GCC" = yes; then
  2878. NOOPT_CFLAGS=-O0
  2879. fi
  2880. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2881. AC_ARG_ENABLE(coverage,
  2882. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2883. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2884. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2885. ac_coverage_linker="-lgcc"
  2886. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2887. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2888. ac_coverage_linker=""
  2889. else
  2890. AC_MSG_ERROR([coverage with your compiler is not supported])
  2891. fi
  2892. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2893. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2894. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2895. ])
  2896. AC_SUBST(NOOPT_CXXFLAGS)
  2897. AC_SUBST(NOOPT_CFLAGS)
  2898. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2899. KDE_CHECK_NEW_LDFLAGS
  2900. KDE_CHECK_FINAL
  2901. KDE_CHECK_CLOSURE
  2902. KDE_CHECK_NMCHECK
  2903. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2904. ])
  2905. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2906. [
  2907. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2908. [
  2909. AC_LANG_SAVE
  2910. AC_LANG_CPLUSPLUS
  2911. safe_CXXFLAGS=$CXXFLAGS
  2912. safe_LDFLAGS=$LDFLAGS
  2913. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2914. LDFLAGS="$LDFLAGS -shared -fPIC"
  2915. AC_TRY_LINK(
  2916. [
  2917. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2918. #include <string>
  2919. int some_function( void ) __attribute__ ((visibility("default")));
  2920. int some_function( void )
  2921. {
  2922. std::string s("blafasel");
  2923. return 0;
  2924. }
  2925. ], [/* elvis is alive */],
  2926. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  2927. CXXFLAGS=$safe_CXXFLAGS
  2928. LDFLAGS=$safe_LDFLAGS
  2929. AC_LANG_RESTORE
  2930. ]
  2931. )
  2932. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  2933. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  2934. fi
  2935. ]
  2936. )
  2937. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  2938. [
  2939. AC_BEFORE([AC_PATH_TQT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
  2940. AC_MSG_CHECKING([grepping for visibility push/pop in headers])
  2941. if test "x$GXX" = "xyes"; then
  2942. AC_LANG_SAVE
  2943. AC_LANG_CPLUSPLUS
  2944. AC_EGREP_CPP(
  2945. [GCC visibility push],
  2946. [ #include <exception>
  2947. ],
  2948. [
  2949. AC_MSG_RESULT(yes)
  2950. kde_stdc_visibility_patched=yes ],
  2951. [
  2952. AC_MSG_RESULT(no)
  2953. AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
  2954. visibility support. Disabling -fvisibility=hidden])
  2955. kde_stdc_visibility_patched=no ])
  2956. AC_LANG_RESTORE
  2957. kde_have_gcc_visibility=no
  2958. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  2959. [
  2960. kde_have_gcc_visibility=yes
  2961. dnl the whole toolchain is just a mess, gcc is just too buggy
  2962. dnl to handle STL with visibility enabled. Lets reconsider
  2963. dnl when gcc 4.2 is out or when things get fixed in the compiler.
  2964. dnl Contact mueller@kde.org for details.
  2965. AC_ARG_ENABLE(gcc-hidden-visibility,
  2966. AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
  2967. [kde_have_gcc_visibility=$enableval],
  2968. [kde_have_gcc_visibility=no])
  2969. AC_CACHE_CHECK([if TQt is patched for -fvisibility], kde_cv_val_tqt_gcc_visibility_patched,
  2970. [
  2971. AC_LANG_SAVE
  2972. AC_LANG_CPLUSPLUS
  2973. safe_CXXFLAGS=$CXXFLAGS
  2974. CXXFLAGS="$CXXFLAGS $all_includes"
  2975. if test "$kde_tqtver" = "3"; then
  2976. if $PKG_CONFIG --exists tqt-mt ; then
  2977. AC_TRY_COMPILE(
  2978. [
  2979. #include <tqglobal.h>
  2980. #if Q_EXPORT - 0 != 0
  2981. /* if this compiles, then Q_EXPORT is undefined */
  2982. /* if Q_EXPORT is nonempty, this will break compilation */
  2983. #endif
  2984. ], [/* elvis is alive */],
  2985. kde_cv_val_tqt_gcc_visibility_patched=no, kde_cv_val_tqt_gcc_visibility_patched=yes)
  2986. fi
  2987. fi
  2988. CXXFLAGS=$safe_CXXFLAGS
  2989. AC_LANG_RESTORE
  2990. ]
  2991. )
  2992. if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_tqt_gcc_visibility_patched = "xyes"; then
  2993. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  2994. KDE_CHECK_VISIBILITY_GCC_BUG
  2995. HAVE_GCC_VISIBILITY=1
  2996. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  2997. fi
  2998. ])
  2999. fi
  3000. ])
  3001. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  3002. [
  3003. [A]M_DEPENDENCIES(CC)
  3004. [A]M_DEPENDENCIES(CXX)
  3005. ])
  3006. dnl just a wrapper to clean up configure.in
  3007. AC_DEFUN([KDE_PROG_LIBTOOL],
  3008. [
  3009. AC_REQUIRE([AC_CHECK_COMPILERS])
  3010. AC_REQUIRE([AC_ENABLE_SHARED])
  3011. AC_REQUIRE([AC_ENABLE_STATIC])
  3012. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  3013. AC_REQUIRE([KDE_CHECK_LIB64])
  3014. AC_OBJEXT
  3015. AC_EXEEXT
  3016. AM_PROG_LIBTOOL
  3017. AC_LIBTOOL_CXX
  3018. # LIBTOOL_SHELL="/bin/sh ./libtool"
  3019. LIBTOOL_SHELL="libtool"
  3020. # LIBTOOL="$LIBTOOL --silent"
  3021. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  3022. AC_SUBST(KDE_PLUGIN)
  3023. # This hack ensures that libtool creates shared libs for tdeunittest plugins. By default check_LTLIBRARIES makes static libs.
  3024. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
  3025. AC_SUBST(KDE_CHECK_PLUGIN)
  3026. # we patch configure quite some so we better keep that consistent for incremental runs
  3027. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  3028. ])
  3029. AC_DEFUN([KDE_CHECK_LIB64],
  3030. [
  3031. AC_ARG_ENABLE(libsuffix,
  3032. AC_HELP_STRING([--enable-libsuffix],
  3033. [/lib directory suffix (64,32,none,auto[=default])]),
  3034. tdelibsuff=$enableval, tdelibsuff="auto")
  3035. if test "$tdelibsuff" = "auto"; then
  3036. cat > conftest.c << EOF
  3037. #include <stdio.h>
  3038. int main() {
  3039. return 0;
  3040. }
  3041. EOF
  3042. tdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
  3043. s,.*/lib\([[^\/]]*\)/.*,\1,
  3044. p
  3045. }'`
  3046. rm -rf conftest.*
  3047. fi
  3048. if test "$tdelibsuff" = "no" || test "$tdelibsuff" = "none"; then
  3049. tdelibsuff=
  3050. fi
  3051. if test -z "$tdelibsuff"; then
  3052. AC_MSG_RESULT([not using lib directory suffix])
  3053. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  3054. else
  3055. if test "$libdir" = '${exec_prefix}/lib'; then
  3056. libdir="$libdir${tdelibsuff}"
  3057. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  3058. fi
  3059. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${tdelibsuff}"], Suffix for lib directories)
  3060. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  3061. fi
  3062. ])
  3063. AC_DEFUN([KDE_CHECK_TYPES],
  3064. [ AC_CHECK_SIZEOF(int, 4)dnl
  3065. AC_CHECK_SIZEOF(short)dnl
  3066. AC_CHECK_SIZEOF(long, 4)dnl
  3067. AC_CHECK_SIZEOF(char *, 4)dnl
  3068. ])dnl
  3069. dnl Not used - kept for compat only?
  3070. AC_DEFUN([KDE_DO_IT_ALL],
  3071. [
  3072. AC_CANONICAL_SYSTEM
  3073. AC_ARG_PROGRAM
  3074. AM_INIT_AUTOMAKE($1, $2)
  3075. AM_DISABLE_LIBRARIES
  3076. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  3077. AC_CHECK_COMPILERS
  3078. KDE_PROG_LIBTOOL
  3079. AM_KDE_WITH_NLS
  3080. AC_PATH_KDE
  3081. ])
  3082. AC_DEFUN([AC_CHECK_RPATH],
  3083. [
  3084. AC_MSG_CHECKING(for rpath)
  3085. AC_ARG_ENABLE(rpath,
  3086. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  3087. USE_RPATH=$enableval, USE_RPATH=yes)
  3088. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  3089. KDE_RPATH="-R \$(libdir)"
  3090. if test "$kde_libraries" != "$libdir"; then
  3091. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  3092. fi
  3093. if test -n "$tqt_libraries"; then
  3094. KDE_RPATH="$KDE_RPATH -R \$(tqt_libraries)"
  3095. fi
  3096. dnl $x_libraries is set to /usr/lib in case
  3097. if test -n "$X_LDFLAGS"; then
  3098. X_RPATH="-R \$(x_libraries)"
  3099. KDE_RPATH="$KDE_RPATH $X_RPATH"
  3100. fi
  3101. if test -n "$KDE_EXTRA_RPATH"; then
  3102. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  3103. fi
  3104. fi
  3105. AC_SUBST(KDE_EXTRA_RPATH)
  3106. AC_SUBST(KDE_RPATH)
  3107. AC_SUBST(X_RPATH)
  3108. AC_MSG_RESULT($USE_RPATH)
  3109. ])
  3110. dnl Check for the type of the third argument of getsockname
  3111. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3112. [
  3113. AC_MSG_CHECKING(for socklen_t)
  3114. AC_CACHE_VAL(kde_cv_socklen_t,
  3115. [
  3116. AC_LANG_PUSH(C++)
  3117. kde_cv_socklen_t=no
  3118. AC_TRY_COMPILE([
  3119. #include <sys/types.h>
  3120. #include <sys/socket.h>
  3121. ],
  3122. [
  3123. socklen_t len;
  3124. getpeername(0,0,&len);
  3125. ],
  3126. [
  3127. kde_cv_socklen_t=yes
  3128. kde_cv_socklen_t_equiv=socklen_t
  3129. ])
  3130. AC_LANG_POP(C++)
  3131. ])
  3132. AC_MSG_RESULT($kde_cv_socklen_t)
  3133. if test $kde_cv_socklen_t = no; then
  3134. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3135. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3136. [
  3137. kde_cv_socklen_t_equiv=int
  3138. AC_LANG_PUSH(C++)
  3139. for t in int size_t unsigned long "unsigned long"; do
  3140. AC_TRY_COMPILE([
  3141. #include <sys/types.h>
  3142. #include <sys/socket.h>
  3143. ],
  3144. [
  3145. $t len;
  3146. getpeername(0,0,&len);
  3147. ],
  3148. [
  3149. kde_cv_socklen_t_equiv="$t"
  3150. break
  3151. ])
  3152. done
  3153. AC_LANG_POP(C++)
  3154. ])
  3155. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3156. fi
  3157. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3158. [type to use in place of socklen_t if not defined])
  3159. ])
  3160. dnl This is a merge of some macros out of the gettext aclocal.m4
  3161. dnl since we don't need anything, I took the things we need
  3162. dnl the copyright for them is:
  3163. dnl >
  3164. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3165. dnl This Makefile.in is free software; the Free Software Foundation
  3166. dnl gives unlimited permission to copy and/or distribute it,
  3167. dnl with or without modifications, as long as this notice is preserved.
  3168. dnl This program is distributed in the hope that it will be useful,
  3169. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3170. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3171. dnl PARTICULAR PURPOSE.
  3172. dnl >
  3173. dnl for this file it is relicensed under LGPL
  3174. AC_DEFUN([AM_KDE_WITH_NLS],
  3175. [
  3176. dnl If we use NLS figure out what method
  3177. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3178. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3179. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3180. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3181. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3182. GMSGFMT=":"
  3183. fi
  3184. MSGFMT=$GMSGFMT
  3185. AC_SUBST(GMSGFMT)
  3186. AC_SUBST(MSGFMT)
  3187. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3188. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3189. dnl Test whether we really found GNU xgettext.
  3190. if test "$XGETTEXT" != ":"; then
  3191. dnl If it is no GNU xgettext we define it as : so that the
  3192. dnl Makefiles still can work.
  3193. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3194. : ;
  3195. else
  3196. AC_MSG_RESULT(
  3197. [found xgettext programs is not GNU xgettext; ignore it])
  3198. XGETTEXT=":"
  3199. fi
  3200. fi
  3201. AC_SUBST(XGETTEXT)
  3202. ])
  3203. # Search path for a program which passes the given test.
  3204. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3205. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3206. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3207. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3208. [# Extract the first word of "$2", so it can be a program name with args.
  3209. set dummy $2; ac_word=[$]2
  3210. AC_MSG_CHECKING([for $ac_word])
  3211. AC_CACHE_VAL(ac_cv_path_$1,
  3212. [case "[$]$1" in
  3213. /*)
  3214. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3215. ;;
  3216. *)
  3217. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3218. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3219. test -z "$ac_dir" && ac_dir=.
  3220. if test -f $ac_dir/$ac_word; then
  3221. if [$3]; then
  3222. ac_cv_path_$1="$ac_dir/$ac_word"
  3223. break
  3224. fi
  3225. fi
  3226. done
  3227. IFS="$ac_save_ifs"
  3228. dnl If no 4th arg is given, leave the cache variable unset,
  3229. dnl so AC_PATH_PROGS will keep looking.
  3230. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3231. ])dnl
  3232. ;;
  3233. esac])dnl
  3234. $1="$ac_cv_path_$1"
  3235. if test -n "[$]$1"; then
  3236. AC_MSG_RESULT([$]$1)
  3237. else
  3238. AC_MSG_RESULT(no)
  3239. fi
  3240. AC_SUBST($1)dnl
  3241. ])
  3242. # Check whether LC_MESSAGES is available in <locale.h>.
  3243. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3244. AC_DEFUN([AM_LC_MESSAGES],
  3245. [if test $ac_cv_header_locale_h = yes; then
  3246. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3247. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3248. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3249. if test $am_cv_val_LC_MESSAGES = yes; then
  3250. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3251. fi
  3252. fi])
  3253. dnl From Jim Meyering.
  3254. dnl FIXME: migrate into libit.
  3255. AC_DEFUN([AM_FUNC_OBSTACK],
  3256. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3257. [AC_TRY_LINK([#include "obstack.h"],
  3258. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3259. am_cv_func_obstack=yes,
  3260. am_cv_func_obstack=no)])
  3261. if test $am_cv_func_obstack = yes; then
  3262. AC_DEFINE(HAVE_OBSTACK)
  3263. else
  3264. LIBOBJS="$LIBOBJS obstack.o"
  3265. fi
  3266. ])
  3267. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3268. dnl FIXME: Migrate into libit
  3269. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3270. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3271. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3272. am_cv_lib_error_at_line=yes,
  3273. am_cv_lib_error_at_line=no)])
  3274. if test $am_cv_lib_error_at_line = no; then
  3275. LIBOBJS="$LIBOBJS error.o"
  3276. fi
  3277. AC_SUBST(LIBOBJS)dnl
  3278. ])
  3279. # Macro to add for using GNU gettext.
  3280. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3281. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3282. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3283. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3284. AC_REQUIRE([AC_HEADER_STDC])dnl
  3285. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3286. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3287. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3288. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3289. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3290. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3291. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3292. __argz_count __argz_stringify __argz_next])
  3293. AC_MSG_CHECKING(for stpcpy)
  3294. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3295. [
  3296. kde_safe_cxxflags=$CXXFLAGS
  3297. CXXFLAGS="-Werror"
  3298. AC_LANG_SAVE
  3299. AC_LANG_CPLUSPLUS
  3300. AC_TRY_COMPILE([
  3301. #include <string.h>
  3302. ],
  3303. [
  3304. char buffer[200];
  3305. stpcpy(buffer, buffer);
  3306. ],
  3307. kde_cv_func_stpcpy=yes,
  3308. kde_cv_func_stpcpy=no)
  3309. AC_LANG_RESTORE
  3310. CXXFLAGS=$kde_safe_cxxflags
  3311. ])
  3312. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3313. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3314. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3315. fi
  3316. AM_LC_MESSAGES
  3317. if test "x$CATOBJEXT" != "x"; then
  3318. if test "x$ALL_LINGUAS" = "x"; then
  3319. LINGUAS=
  3320. else
  3321. AC_MSG_CHECKING(for catalogs to be installed)
  3322. NEW_LINGUAS=
  3323. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3324. case "$ALL_LINGUAS" in
  3325. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3326. esac
  3327. done
  3328. LINGUAS=$NEW_LINGUAS
  3329. AC_MSG_RESULT($LINGUAS)
  3330. fi
  3331. dnl Construct list of names of catalog files to be constructed.
  3332. if test -n "$LINGUAS"; then
  3333. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3334. fi
  3335. fi
  3336. ])
  3337. AC_DEFUN([AC_HAVE_XPM],
  3338. [AC_REQUIRE_CPP()dnl
  3339. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3340. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3341. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3342. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3343. xpm_test=$withval, xpm_test="yes")
  3344. if test "x$xpm_test" = xno; then
  3345. ac_cv_have_xpm=no
  3346. else
  3347. AC_MSG_CHECKING(for XPM)
  3348. AC_CACHE_VAL(ac_cv_have_xpm,
  3349. [
  3350. ac_save_ldflags="$LDFLAGS"
  3351. ac_save_cflags="$CFLAGS"
  3352. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  3353. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3354. else
  3355. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3356. fi
  3357. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3358. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3359. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3360. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3361. LDFLAGS="$ac_save_ldflags"
  3362. CFLAGS="$ac_save_cflags"
  3363. ])dnl
  3364. if test "$ac_cv_have_xpm" = no; then
  3365. AC_MSG_RESULT(no)
  3366. XPM_LDFLAGS=""
  3367. XPMINC=""
  3368. $2
  3369. else
  3370. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3371. if test "$XPM_LDFLAGS" = ""; then
  3372. XPMLIB='-lXpm $(LIB_X11)'
  3373. else
  3374. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3375. fi
  3376. if test "$XPM_INCLUDE" = ""; then
  3377. XPMINC=""
  3378. else
  3379. XPMINC="-I$XPM_INCLUDE"
  3380. fi
  3381. AC_MSG_RESULT(yes)
  3382. $1
  3383. fi
  3384. fi
  3385. AC_SUBST(XPMINC)
  3386. AC_SUBST(XPMLIB)
  3387. ])
  3388. AC_DEFUN([AC_HAVE_DPMS],
  3389. [AC_REQUIRE_CPP()dnl
  3390. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3391. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3392. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3393. DPMS_LIB=
  3394. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3395. dpms_test=$withval, dpms_test="yes")
  3396. if test "x$dpms_test" = xno; then
  3397. ac_cv_have_dpms=no
  3398. else
  3399. AC_MSG_CHECKING(for DPMS)
  3400. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3401. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3402. AC_CACHE_VAL(ac_cv_have_dpms,
  3403. [
  3404. if test "x$kde_use_tqt_emb" = "xyes" || test "x$kde_use_tqt_mac" = "xyes"; then
  3405. AC_MSG_RESULT(no)
  3406. ac_cv_have_dpms="no"
  3407. else
  3408. ac_save_ldflags="$LDFLAGS"
  3409. ac_save_cflags="$CFLAGS"
  3410. ac_save_libs="$LIBS"
  3411. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3412. LIBS="-lX11 -lXext $LIBSOCKET"
  3413. CFLAGS="$CFLAGS $X_INCLUDES"
  3414. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3415. AC_TRY_LINK([
  3416. #include <X11/Xproto.h>
  3417. #include <X11/X.h>
  3418. #include <X11/Xlib.h>
  3419. #include <X11/extensions/dpms.h>
  3420. int foo_test_dpms()
  3421. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3422. ac_cv_have_dpms="yes", [
  3423. LIBS="-lXdpms $LIBS"
  3424. AC_TRY_LINK([
  3425. #include <X11/Xproto.h>
  3426. #include <X11/X.h>
  3427. #include <X11/Xlib.h>
  3428. #include <X11/extensions/dpms.h>
  3429. int foo_test_dpms()
  3430. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3431. [
  3432. ac_cv_have_dpms="-lXdpms"
  3433. ],ac_cv_have_dpms="no")
  3434. ])
  3435. LDFLAGS="$ac_save_ldflags"
  3436. CFLAGS="$ac_save_cflags"
  3437. LIBS="$ac_save_libs"
  3438. fi
  3439. ])dnl
  3440. if test "$ac_cv_have_dpms" = no; then
  3441. AC_MSG_RESULT(no)
  3442. DPMS_LDFLAGS=""
  3443. DPMSINC=""
  3444. $2
  3445. else
  3446. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3447. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3448. DPMS_LIB="-lXdpms"
  3449. fi
  3450. if test "$DPMS_LDFLAGS" = ""; then
  3451. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3452. else
  3453. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3454. fi
  3455. if test "$DPMS_INCLUDE" = ""; then
  3456. DPMSINC=""
  3457. else
  3458. DPMSINC="-I$DPMS_INCLUDE"
  3459. fi
  3460. AC_MSG_RESULT(yes)
  3461. $1
  3462. fi
  3463. fi
  3464. ac_save_cflags="$CFLAGS"
  3465. CFLAGS="$CFLAGS $X_INCLUDES"
  3466. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3467. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3468. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3469. AC_CHECK_DECL(DPMSCapable,
  3470. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3471. [#include <X11/Xlib.h>
  3472. #include <X11/extensions/dpms.h>])
  3473. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3474. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3475. AC_CHECK_DECL(DPMSInfo,
  3476. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3477. [#include <X11/Xlib.h>
  3478. #include <X11/extensions/dpms.h>])
  3479. CFLAGS="$ac_save_cflags"
  3480. AC_SUBST(DPMSINC)
  3481. AC_SUBST(DPMSLIB)
  3482. ])
  3483. AC_DEFUN([AC_HAVE_GL],
  3484. [AC_REQUIRE_CPP()dnl
  3485. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3486. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3487. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3488. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3489. gl_test=$withval, gl_test="yes")
  3490. if test "x$kde_use_tqt_emb" = "xyes"; then
  3491. # GL and TQt Embedded is a no-go for now.
  3492. ac_cv_have_gl=no
  3493. elif test "x$gl_test" = xno; then
  3494. ac_cv_have_gl=no
  3495. else
  3496. AC_MSG_CHECKING(for GL)
  3497. AC_CACHE_VAL(ac_cv_have_gl,
  3498. [
  3499. AC_LANG_SAVE
  3500. AC_LANG_CPLUSPLUS
  3501. ac_save_ldflags=$LDFLAGS
  3502. ac_save_cxxflags=$CXXFLAGS
  3503. ac_save_libs=$LIBS
  3504. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3505. LIBS="$LIBS -L/usr/lib/mesa -lGL -lGLU"
  3506. test "x$kde_use_tqt_mac" != xyes && test "x$kde_use_tqt_emb" != xyes && LIBS="$LIBS -lX11"
  3507. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3508. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3509. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3510. AC_TRY_LINK([#include <GL/gl.h>
  3511. #include <GL/glu.h>
  3512. ], [],
  3513. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3514. AC_LANG_RESTORE
  3515. LDFLAGS=$ac_save_ldflags
  3516. CXXFLAGS=$ac_save_cxxflags
  3517. LIBS=$ac_save_libs
  3518. ])dnl
  3519. if test "$ac_cv_have_gl" = "no"; then
  3520. AC_MSG_RESULT(no)
  3521. GL_LDFLAGS=""
  3522. GLINC=""
  3523. $2
  3524. else
  3525. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3526. if test "$GL_LDFLAGS" = ""; then
  3527. GLLIB='-L/usr/lib/mesa -lGLU -lGL $(LIB_X11)'
  3528. else
  3529. GLLIB="$GL_LDFLAGS -L/usr/lib/mesa -lGLU -lGL "'$(LIB_X11)'
  3530. fi
  3531. if test "$GL_INCLUDE" = ""; then
  3532. GLINC=""
  3533. else
  3534. GLINC="-I$GL_INCLUDE"
  3535. fi
  3536. AC_MSG_RESULT($ac_cv_have_gl)
  3537. $1
  3538. fi
  3539. fi
  3540. AC_SUBST(GLINC)
  3541. AC_SUBST(GLLIB)
  3542. ])
  3543. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3544. AC_DEFUN([KDE_PAM], [
  3545. AC_REQUIRE([KDE_CHECK_LIBDL])
  3546. want_pam=
  3547. AC_ARG_WITH(pam,
  3548. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3549. [ if test "x$withval" = "xyes"; then
  3550. want_pam=yes
  3551. pam_service=tde
  3552. elif test "x$withval" = "xno"; then
  3553. want_pam=no
  3554. else
  3555. want_pam=yes
  3556. pam_service=$withval
  3557. fi
  3558. ], [ pam_service=tde ])
  3559. use_pam=
  3560. PAMLIBS=
  3561. if test "x$want_pam" != xno; then
  3562. AC_CHECK_LIB(pam, pam_start, [
  3563. AC_CHECK_HEADER(security/pam_appl.h,
  3564. [ pam_header=security/pam_appl.h ],
  3565. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3566. [ pam_header=pam/pam_appl.h ],
  3567. [
  3568. AC_MSG_WARN([PAM detected, but no headers found!
  3569. Make sure you have the necessary development packages installed.])
  3570. ]
  3571. )
  3572. ]
  3573. )
  3574. ], , $LIBDL)
  3575. if test -z "$pam_header"; then
  3576. if test "x$want_pam" = xyes; then
  3577. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3578. fi
  3579. else
  3580. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3581. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3582. use_pam=yes
  3583. dnl darwin claims to be something special
  3584. if test "$pam_header" = "pam/pam_appl.h"; then
  3585. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3586. fi
  3587. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3588. AC_MSG_CHECKING(for const pam_message)
  3589. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3590. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3591. [AC_MSG_RESULT([const: Linux-type PAM])],
  3592. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3593. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3594. )],
  3595. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3596. fi
  3597. fi
  3598. AC_SUBST(PAMLIBS)
  3599. ])
  3600. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3601. AC_DEFUN([DEF_PAM_SERVICE], [
  3602. AC_ARG_WITH($1-pam,
  3603. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3604. [ if test "x$use_pam" = xyes; then
  3605. $3_PAM_SERVICE=$withval
  3606. else
  3607. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3608. You may want to enforce it by using --with-pam.])
  3609. fi
  3610. ],
  3611. [ if test "x$use_pam" = xyes; then
  3612. $3_PAM_SERVICE="$pam_service"
  3613. fi
  3614. ])
  3615. if test -n "$$3_PAM_SERVICE"; then
  3616. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3617. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3618. fi
  3619. AC_SUBST($3_PAM_SERVICE)
  3620. ])
  3621. AC_DEFUN([KDE_SHADOWPASSWD], [
  3622. AC_REQUIRE([KDE_PAM])
  3623. AC_CHECK_LIB(shadow, getspent,
  3624. [ LIBSHADOW="-lshadow"
  3625. ac_use_shadow=yes
  3626. ],
  3627. [ dnl for UnixWare
  3628. AC_CHECK_LIB(gen, getspent,
  3629. [ LIBGEN="-lgen"
  3630. ac_use_shadow=yes
  3631. ],
  3632. [ AC_CHECK_FUNC(getspent,
  3633. [ ac_use_shadow=yes ],
  3634. [ ac_use_shadow=no ])
  3635. ])
  3636. ])
  3637. AC_SUBST(LIBSHADOW)
  3638. AC_SUBST(LIBGEN)
  3639. AC_MSG_CHECKING([for shadow passwords])
  3640. AC_ARG_WITH(shadow,
  3641. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3642. [ if test "x$withval" != "xno"; then
  3643. use_shadow=yes
  3644. else
  3645. use_shadow=no
  3646. fi
  3647. ], [
  3648. use_shadow="$ac_use_shadow"
  3649. ])
  3650. if test "x$use_shadow" = xyes; then
  3651. AC_MSG_RESULT(yes)
  3652. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3653. else
  3654. AC_MSG_RESULT(no)
  3655. LIBSHADOW=
  3656. LIBGEN=
  3657. fi
  3658. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3659. dnl this still applies, if we could use it indirectly through pam.
  3660. if test "x$use_shadow" = xyes ||
  3661. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3662. case $host in
  3663. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3664. SETUIDFLAGS="-m 4755 -o root";;
  3665. *)
  3666. SETUIDFLAGS="-m 4755";;
  3667. esac
  3668. fi
  3669. AC_SUBST(SETUIDFLAGS)
  3670. ])
  3671. AC_DEFUN([KDE_PASSWDLIBS], [
  3672. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3673. AC_REQUIRE([KDE_PAM])
  3674. AC_REQUIRE([KDE_SHADOWPASSWD])
  3675. if test "x$use_pam" = "xyes"; then
  3676. PASSWDLIBS="$PAMLIBS"
  3677. else
  3678. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3679. fi
  3680. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3681. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3682. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3683. dnl may need to read /etc/master.passwd).
  3684. case $host in
  3685. *-*-freebsd*)
  3686. SETUIDFLAGS="-m 4755 -o root"
  3687. ;;
  3688. *)
  3689. ;;
  3690. esac
  3691. AC_SUBST(PASSWDLIBS)
  3692. ])
  3693. AC_DEFUN([KDE_CHECK_LIBDL],
  3694. [
  3695. AC_CHECK_LIB(dl, dlopen, [
  3696. LIBDL="-ldl"
  3697. ac_cv_have_dlfcn=yes
  3698. ])
  3699. AC_CHECK_LIB(dld, shl_unload, [
  3700. LIBDL="-ldld"
  3701. ac_cv_have_shload=yes
  3702. ])
  3703. AC_SUBST(LIBDL)
  3704. ])
  3705. AC_DEFUN([KDE_CHECK_DLOPEN],
  3706. [
  3707. KDE_CHECK_LIBDL
  3708. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3709. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3710. ac_cv_have_dlfcn=no
  3711. fi
  3712. if test "$ac_cv_header_dl_h" = "no"; then
  3713. ac_cv_have_shload=no
  3714. fi
  3715. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3716. dnl (MM)
  3717. AC_ARG_ENABLE(dlopen,
  3718. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3719. enable_dlopen=$enableval,
  3720. enable_dlopen=yes)
  3721. # override the user's opinion, if we know it better ;)
  3722. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3723. enable_dlopen=no
  3724. fi
  3725. if test "$ac_cv_have_dlfcn" = "yes"; then
  3726. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3727. fi
  3728. if test "$ac_cv_have_shload" = "yes"; then
  3729. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3730. fi
  3731. if test "$enable_dlopen" = no ; then
  3732. test -n "$1" && eval $1
  3733. else
  3734. test -n "$2" && eval $2
  3735. fi
  3736. ])
  3737. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3738. [
  3739. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3740. KDE_PROG_LIBTOOL
  3741. AC_MSG_CHECKING([dynamic loading])
  3742. eval "`egrep '^build_libtool_libs=' libtool`"
  3743. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3744. dynamic_loading=yes
  3745. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3746. else
  3747. dynamic_loading=no
  3748. fi
  3749. AC_MSG_RESULT($dynamic_loading)
  3750. if test "$dynamic_loading" = "yes"; then
  3751. $1
  3752. else
  3753. $2
  3754. fi
  3755. ])
  3756. AC_DEFUN([KDE_ADD_INCLUDES],
  3757. [
  3758. if test -z "$1"; then
  3759. test_include="Pix.h"
  3760. else
  3761. test_include="$1"
  3762. fi
  3763. AC_MSG_CHECKING([for libg++ ($test_include)])
  3764. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3765. [
  3766. kde_cv_libgpp_includes=no
  3767. for ac_dir in \
  3768. \
  3769. /usr/include/g++ \
  3770. /usr/include \
  3771. /usr/unsupported/include \
  3772. /opt/include \
  3773. $extra_include \
  3774. ; \
  3775. do
  3776. if test -r "$ac_dir/$test_include"; then
  3777. kde_cv_libgpp_includes=$ac_dir
  3778. break
  3779. fi
  3780. done
  3781. ])
  3782. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3783. if test "$kde_cv_libgpp_includes" != "no"; then
  3784. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3785. fi
  3786. ])
  3787. ])
  3788. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3789. [
  3790. dnl This code is here specifically to handle the
  3791. dnl various flavors of threading library on FreeBSD
  3792. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3793. dnl There may be an environment PTHREAD_LIBS that
  3794. dnl specifies what to use; otherwise, search for it.
  3795. dnl -pthread is special cased and unsets LIBPTHREAD
  3796. dnl below if found.
  3797. LIBPTHREAD=""
  3798. if test -n "$PTHREAD_LIBS"; then
  3799. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3800. LIBPTHREAD="PTHREAD"
  3801. else
  3802. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3803. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3804. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3805. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3806. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3807. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3808. fi
  3809. fi
  3810. dnl Is this test really needed, in the face of the Tru64 test below?
  3811. if test -z "$LIBPTHREAD"; then
  3812. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3813. fi
  3814. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3815. if test -z "$LIBPTHREAD" ; then
  3816. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3817. kde_safe_libs=$LIBS
  3818. LIBS="$LIBS -lpthread"
  3819. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3820. AC_MSG_RESULT(yes)
  3821. LIBPTHREAD="-lpthread"],[
  3822. AC_MSG_RESULT(no)])
  3823. LIBS=$kde_safe_libs
  3824. fi
  3825. dnl Un-special-case for FreeBSD.
  3826. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3827. LIBPTHREAD=""
  3828. fi
  3829. AC_SUBST(LIBPTHREAD)
  3830. ])
  3831. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3832. [
  3833. USE_THREADS=""
  3834. if test -z "$LIBPTHREAD"; then
  3835. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3836. fi
  3837. AH_VERBATIM(__svr_define, [
  3838. #if defined(__SVR4) && !defined(__svr4__)
  3839. #define __svr4__ 1
  3840. #endif
  3841. ])
  3842. case $host_os in
  3843. solaris*)
  3844. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3845. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3846. ;;
  3847. freebsd*)
  3848. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3849. ;;
  3850. aix*)
  3851. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3852. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3853. ;;
  3854. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3855. if test "$CXX" = "KCC"; then
  3856. CXXFLAGS="$CXXFLAGS --thread_safe"
  3857. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3858. fi
  3859. ;;
  3860. *)
  3861. ;;
  3862. esac
  3863. AC_SUBST(USE_THREADS)
  3864. AC_SUBST(LIBPTHREAD)
  3865. ])
  3866. AC_DEFUN([KDE_CHECK_THREADING],
  3867. [
  3868. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3869. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3870. dnl default is yes if libpthread is found and no if no libpthread is available
  3871. if test -z "$LIBPTHREAD"; then
  3872. if test -z "$USE_THREADS"; then
  3873. kde_check_threading_default=no
  3874. else
  3875. kde_check_threading_default=yes
  3876. fi
  3877. else
  3878. kde_check_threading_default=yes
  3879. fi
  3880. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3881. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3882. if test "x$kde_use_threading" = "xyes"; then
  3883. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3884. fi
  3885. ])
  3886. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3887. [
  3888. if test "$kde_python_link_found" = no; then
  3889. if test "$1" = normal; then
  3890. AC_MSG_CHECKING(if a Python application links)
  3891. else
  3892. AC_MSG_CHECKING(if Python depends on $2)
  3893. fi
  3894. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3895. [
  3896. kde_save_cflags="$CFLAGS"
  3897. CFLAGS="$CFLAGS $PYTHONINC"
  3898. kde_save_libs="$LIBS"
  3899. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3900. kde_save_ldflags="$LDFLAGS"
  3901. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3902. AC_TRY_LINK(
  3903. [
  3904. #include <Python.h>
  3905. ],[
  3906. PySys_SetArgv(1, 0);
  3907. ],
  3908. [kde_cv_try_link_python_$1=yes],
  3909. [kde_cv_try_link_python_$1=no]
  3910. )
  3911. CFLAGS="$kde_save_cflags"
  3912. LIBS="$kde_save_libs"
  3913. LDFLAGS="$kde_save_ldflags"
  3914. ])
  3915. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3916. AC_MSG_RESULT(yes)
  3917. kde_python_link_found=yes
  3918. if test ! "$1" = normal; then
  3919. LIBPYTHON="$LIBPYTHON $2"
  3920. fi
  3921. $3
  3922. else
  3923. AC_MSG_RESULT(no)
  3924. $4
  3925. fi
  3926. fi
  3927. ])
  3928. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3929. [
  3930. AC_MSG_CHECKING([for Python directory])
  3931. AC_CACHE_VAL(kde_cv_pythondir,
  3932. [
  3933. if test -z "$PYTHONDIR"; then
  3934. kde_cv_pythondir=/usr/local
  3935. else
  3936. kde_cv_pythondir="$PYTHONDIR"
  3937. fi
  3938. ])
  3939. AC_ARG_WITH(pythondir,
  3940. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3941. [
  3942. ac_python_dir=$withval
  3943. ], ac_python_dir=$kde_cv_pythondir
  3944. )
  3945. AC_MSG_RESULT($ac_python_dir)
  3946. ])
  3947. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  3948. [
  3949. AC_REQUIRE([KDE_CHECK_LIBDL])
  3950. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3951. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3952. if test -z "$1"; then
  3953. version="1.5"
  3954. else
  3955. version="$1"
  3956. fi
  3957. AC_MSG_CHECKING([for Python$version])
  3958. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  3959. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  3960. if test ! -r $python_incdir/Python.h; then
  3961. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  3962. python_incdir=$python_incdir/python$version
  3963. if test ! -r $python_incdir/Python.h; then
  3964. python_incdir=no
  3965. fi
  3966. fi
  3967. PYTHONINC=-I$python_incdir
  3968. python_multiarch_libdirs="`find /usr/lib/ -maxdepth 1 -type d | xargs echo`"
  3969. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $python_multiarch_libdirs $kde_extra_libs"
  3970. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  3971. if test ! -r $python_libdir/libpython$version.so; then
  3972. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  3973. if test ! -r $python_libdir/libpython$version.a; then
  3974. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  3975. python_libdir=$python_libdir/python$version/config
  3976. if test ! -r $python_libdir/libpython$version.a; then
  3977. python_libdir=no
  3978. fi
  3979. fi
  3980. fi
  3981. PYTHONLIB=-L$python_libdir
  3982. kde_orig_LIBPYTHON=$LIBPYTHON
  3983. if test -z "$LIBPYTHON"; then
  3984. LIBPYTHON=-lpython$version
  3985. fi
  3986. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  3987. python_moddir=$python_moddir/python$version
  3988. if test ! -r $python_moddir/copy.py; then
  3989. python_moddir=no
  3990. fi
  3991. PYTHONMODDIR=$python_moddir
  3992. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  3993. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  3994. LIBPYTHON=$kde_orig_LIBPYTHON
  3995. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  3996. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  3997. $2
  3998. else
  3999. dnl Note: this test is very weak
  4000. kde_python_link_found=no
  4001. KDE_TRY_LINK_PYTHON(normal)
  4002. KDE_TRY_LINK_PYTHON(m, -lm)
  4003. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4004. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4005. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4006. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4007. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4008. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4009. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4010. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4011. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4012. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4013. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4014. [AC_MSG_WARN([it seems, Python depends on another library.
  4015. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4016. and contact the authors to let them know about this problem])
  4017. ])
  4018. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4019. AC_SUBST(PYTHONINC)
  4020. AC_SUBST(PYTHONLIB)
  4021. AC_SUBST(LIBPYTHON)
  4022. AC_SUBST(PYTHONMODDIR)
  4023. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4024. fi
  4025. ])
  4026. AC_DEFUN([KDE_CHECK_PYTHON],
  4027. [
  4028. KDE_CHECK_PYTHON_INTERN("2.7",
  4029. [KDE_CHECK_PYTHON_INTERN("2.6",
  4030. [KDE_CHECK_PYTHON_INTERN("2.5",
  4031. [KDE_CHECK_PYTHON_INTERN("2.4",
  4032. [KDE_CHECK_PYTHON_INTERN("2.3",
  4033. [KDE_CHECK_PYTHON_INTERN("2.2",
  4034. [KDE_CHECK_PYTHON_INTERN("2.1",
  4035. [KDE_CHECK_PYTHON_INTERN("2.0",
  4036. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4037. ])
  4038. ])
  4039. ])
  4040. ])
  4041. ])
  4042. ])
  4043. ])
  4044. ])
  4045. AC_DEFUN([KDE_CHECK_STL],
  4046. [
  4047. AC_LANG_SAVE
  4048. AC_LANG_CPLUSPLUS
  4049. ac_save_CXXFLAGS="$CXXFLAGS"
  4050. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4051. if test -z "$tqt_includes"; then
  4052. CXXFLAGS="$CXXFLAGS"
  4053. else
  4054. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  4055. fi
  4056. AC_MSG_CHECKING([if C++ programs can be compiled])
  4057. AC_CACHE_VAL(kde_cv_stl_works,
  4058. [
  4059. AC_TRY_COMPILE([
  4060. #include <string>
  4061. using namespace std;
  4062. ],[
  4063. string astring="Hallo Welt.";
  4064. astring.erase(0, 6); // now astring is "Welt"
  4065. return 0;
  4066. ], kde_cv_stl_works=yes,
  4067. kde_cv_stl_works=no)
  4068. ])
  4069. AC_MSG_RESULT($kde_cv_stl_works)
  4070. if test "$kde_cv_stl_works" = "yes"; then
  4071. # back compatible
  4072. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4073. else
  4074. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4075. Check config.log for details - if you're using a Linux distribution you might miss
  4076. a package named similar to libstdc++-dev.])
  4077. fi
  4078. CXXFLAGS="$ac_save_CXXFLAGS"
  4079. AC_LANG_RESTORE
  4080. ])
  4081. AC_DEFUN([AC_FIND_QIMGIO],
  4082. [AC_REQUIRE([AC_FIND_JPEG])
  4083. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4084. AC_MSG_CHECKING([for qimgio])
  4085. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4086. [
  4087. AC_LANG_SAVE
  4088. AC_LANG_CPLUSPLUS
  4089. ac_save_LIBS="$LIBS"
  4090. ac_save_CXXFLAGS="$CXXFLAGS"
  4091. if test "$kde_tqtver" = "3"; then
  4092. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBTQT"
  4093. CXXFLAGS="$CXXFLAGS -I$tqt_incdir $all_includes"
  4094. if $PKG_CONFIG --exists tqt-mt ; then
  4095. AC_TRY_RUN(dnl
  4096. [
  4097. #include <tqimageio.h>
  4098. #include <tqstring.h>
  4099. int main() {
  4100. TQString t = "hallo";
  4101. t.fill('t');
  4102. qInitImageIO();
  4103. }
  4104. ],
  4105. ac_cv_lib_qimgio=yes,
  4106. ac_cv_lib_qimgio=no,
  4107. ac_cv_lib_qimgio=no)
  4108. fi
  4109. fi
  4110. LIBS="$ac_save_LIBS"
  4111. CXXFLAGS="$ac_save_CXXFLAGS"
  4112. AC_LANG_RESTORE
  4113. ])dnl
  4114. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4115. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4116. AC_MSG_RESULT(yes)
  4117. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the TQt extension qimgio available])
  4118. AC_SUBST(LIBQIMGIO)
  4119. else
  4120. AC_MSG_RESULT(not found)
  4121. fi
  4122. ])
  4123. AC_DEFUN([KDE_CHECK_HONORS_SOCKET_PERMS],
  4124. [
  4125. AC_MSG_CHECKING([if underlying system honors socket permissions])
  4126. AC_CACHE_VAL(ac_cv_honors_socket_perms,
  4127. [
  4128. AC_LANG_SAVE
  4129. AC_LANG_C
  4130. ac_save_LIBS="$LIBS"
  4131. ac_save_CPPFLAGS="$CPPFLAGS"
  4132. LIBS="$all_libraries"
  4133. CPPFLAGS="$CPPFLAGS $all_includes"
  4134. AC_TRY_RUN(dnl
  4135. [
  4136. #include <sys/socket.h>
  4137. #include <sys/un.h>
  4138. #include <sys/stat.h>
  4139. #include <sys/types.h>
  4140. #include <string.h>
  4141. #include <unistd.h>
  4142. #include <errno.h>
  4143. int main()
  4144. {
  4145. int fd, fd2;
  4146. struct sockaddr_un sa;
  4147. if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
  4148. return 2;
  4149. sa.sun_family = AF_UNIX;
  4150. strcpy(sa.sun_path, "testsock");
  4151. unlink(sa.sun_path);
  4152. if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)))
  4153. return 2;
  4154. chmod(sa.sun_path, 0);
  4155. setuid(getuid() + 1000);
  4156. if ((fd2 = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
  4157. return 2;
  4158. connect(fd2, (struct sockaddr *)&sa, sizeof(sa));
  4159. return errno != EACCES;
  4160. }
  4161. ],
  4162. ac_cv_honors_socket_perms=yes,
  4163. ac_cv_honors_socket_perms=no,
  4164. ac_cv_honors_socket_perms=no)
  4165. LIBS="$ac_save_LIBS"
  4166. CPPFLAGS="$ac_save_CPPFLAGS"
  4167. AC_LANG_RESTORE
  4168. ])dnl
  4169. if eval "test \"`echo $ac_cv_honors_socket_perms`\" = yes"; then
  4170. AC_MSG_RESULT(yes)
  4171. AC_DEFINE_UNQUOTED(HONORS_SOCKET_PERMS, 1, [Defined if the underlying system honors socket permissions])
  4172. else
  4173. AC_MSG_RESULT(no)
  4174. fi
  4175. ])
  4176. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4177. [
  4178. AC_PROVIDE([AM_ENABLE_STATIC])
  4179. AC_PROVIDE([AM_ENABLE_SHARED])
  4180. enable_static=no
  4181. enable_shared=yes
  4182. ])
  4183. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4184. [
  4185. AC_MSG_CHECKING([for utmp file])
  4186. AC_CACHE_VAL(kde_cv_utmp_file,
  4187. [
  4188. kde_cv_utmp_file=no
  4189. for ac_file in \
  4190. \
  4191. /var/run/utmp \
  4192. /var/adm/utmp \
  4193. /etc/utmp \
  4194. ; \
  4195. do
  4196. if test -r "$ac_file"; then
  4197. kde_cv_utmp_file=$ac_file
  4198. break
  4199. fi
  4200. done
  4201. ])
  4202. if test "$kde_cv_utmp_file" != "no"; then
  4203. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4204. $1
  4205. AC_MSG_RESULT($kde_cv_utmp_file)
  4206. else
  4207. $2
  4208. AC_MSG_RESULT([non found])
  4209. fi
  4210. ])
  4211. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4212. [
  4213. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4214. TOPSUBDIRS=""
  4215. if test ! -s $srcdir/subdirs; then
  4216. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4217. files=`cd $srcdir && ls -1`
  4218. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4219. for i in $dirs; do
  4220. echo $i >> $srcdir/subdirs
  4221. done
  4222. fi
  4223. ac_topsubdirs=
  4224. if test -s $srcdir/inst-apps; then
  4225. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4226. elif test -s $srcdir/subdirs; then
  4227. ac_topsubdirs="`cat $srcdir/subdirs`"
  4228. fi
  4229. for i in $ac_topsubdirs; do
  4230. AC_MSG_CHECKING([if $i should be compiled])
  4231. if test -d $srcdir/$i; then
  4232. install_it="yes"
  4233. for j in $DO_NOT_COMPILE; do
  4234. if test $i = $j; then
  4235. install_it="no"
  4236. fi
  4237. done
  4238. else
  4239. install_it="no"
  4240. fi
  4241. AC_MSG_RESULT($install_it)
  4242. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4243. if test $install_it = "yes"; then
  4244. TOPSUBDIRS="$TOPSUBDIRS $i"
  4245. eval "$vari""_SUBDIR_included=yes"
  4246. else
  4247. eval "$vari""_SUBDIR_included=no"
  4248. fi
  4249. done
  4250. AC_SUBST(TOPSUBDIRS)
  4251. ])
  4252. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4253. [
  4254. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4255. AC_LANG_SAVE
  4256. AC_LANG_CPLUSPLUS
  4257. AC_TRY_COMPILE([
  4258. ],
  4259. [
  4260. namespace Foo {
  4261. extern int i;
  4262. namespace Bar {
  4263. extern int i;
  4264. }
  4265. }
  4266. int Foo::i = 0;
  4267. int Foo::Bar::i = 1;
  4268. ],[
  4269. AC_MSG_RESULT(yes)
  4270. AC_DEFINE(HAVE_NAMESPACES)
  4271. ], [
  4272. AC_MSG_RESULT(no)
  4273. ])
  4274. AC_LANG_RESTORE
  4275. ])
  4276. dnl ------------------------------------------------------------------------
  4277. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4278. dnl ------------------------------------------------------------------------
  4279. dnl
  4280. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4281. [
  4282. AC_MSG_CHECKING(for S_ISSOCK)
  4283. AC_CACHE_VAL(ac_cv_have_s_issock,
  4284. [
  4285. AC_TRY_LINK(
  4286. [
  4287. #include <sys/stat.h>
  4288. ],
  4289. [
  4290. struct stat buff;
  4291. int b = S_ISSOCK( buff.st_mode );
  4292. ],
  4293. ac_cv_have_s_issock=yes,
  4294. ac_cv_have_s_issock=no)
  4295. ])
  4296. AC_MSG_RESULT($ac_cv_have_s_issock)
  4297. if test "$ac_cv_have_s_issock" = "yes"; then
  4298. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4299. fi
  4300. AH_VERBATIM(_ISSOCK,
  4301. [
  4302. #ifndef HAVE_S_ISSOCK
  4303. #define HAVE_S_ISSOCK
  4304. #define S_ISSOCK(mode) (1==0)
  4305. #endif
  4306. ])
  4307. ])
  4308. dnl ------------------------------------------------------------------------
  4309. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4310. dnl ------------------------------------------------------------------------
  4311. dnl
  4312. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4313. [
  4314. AC_MSG_CHECKING(for MAXPATHLEN)
  4315. AC_CACHE_VAL(ac_cv_maxpathlen,
  4316. [
  4317. cat > conftest.$ac_ext <<EOF
  4318. #ifdef STDC_HEADERS
  4319. # include <stdlib.h>
  4320. #endif
  4321. #include <stdio.h>
  4322. #include <sys/param.h>
  4323. #ifndef MAXPATHLEN
  4324. #define MAXPATHLEN 1024
  4325. #endif
  4326. KDE_HELLO MAXPATHLEN
  4327. EOF
  4328. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4329. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4330. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4331. else
  4332. ac_cv_maxpathlen=1024
  4333. fi
  4334. rm conftest.*
  4335. ])
  4336. AC_MSG_RESULT($ac_cv_maxpathlen)
  4337. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4338. ])
  4339. AC_DEFUN([KDE_CHECK_HEADER],
  4340. [
  4341. kde_safe_cppflags=$CPPFLAGS
  4342. CPPFLAGS="$CPPFLAGS $all_includes -I$kde_incdir/tde -I/usr/include/tqt"
  4343. AC_LANG_SAVE
  4344. AC_LANG_CPLUSPLUS
  4345. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4346. AC_LANG_RESTORE
  4347. CPPFLAGS=$kde_safe_cppflags
  4348. ])
  4349. AC_DEFUN([KDE_CHECK_HEADERS],
  4350. [
  4351. AH_CHECK_HEADERS_TDE([$1])
  4352. AC_LANG_SAVE
  4353. kde_safe_cppflags=$CPPFLAGS
  4354. CPPFLAGS="$CPPFLAGS $all_includes -I$kde_incdir/tde -I/usr/include/tqt"
  4355. AC_LANG_CPLUSPLUS
  4356. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4357. CPPFLAGS=$kde_safe_cppflags
  4358. AC_LANG_RESTORE
  4359. ])
  4360. AC_DEFUN([KDE_FAST_CONFIGURE],
  4361. [
  4362. dnl makes configure fast (needs perl)
  4363. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4364. with_fast_perl=$enableval, with_fast_perl=yes)
  4365. ])
  4366. AC_DEFUN([KDE_CONF_FILES],
  4367. [
  4368. val=
  4369. if test -f $srcdir/configure.files ; then
  4370. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4371. fi
  4372. CONF_FILES=
  4373. if test -n "$val" ; then
  4374. for i in $val ; do
  4375. CONF_FILES="$CONF_FILES $i"
  4376. done
  4377. fi
  4378. AC_SUBST(CONF_FILES)
  4379. ])dnl
  4380. dnl This sets the prefix, for arts and tdelibs
  4381. dnl Do NOT use in any other module.
  4382. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4383. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4384. [
  4385. unset CDPATH
  4386. dnl make $TDEDIR the default for the installation
  4387. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4388. if test "x$prefix" = "xNONE"; then
  4389. prefix=$ac_default_prefix
  4390. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4391. fi
  4392. # And delete superfluous '/' to make compares easier
  4393. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4394. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4395. kde_libs_prefix='$(prefix)'
  4396. kde_libs_htmldir='$(kde_htmldir)'
  4397. AC_SUBST(kde_libs_prefix)
  4398. AC_SUBST(kde_libs_htmldir)
  4399. KDE_FAST_CONFIGURE
  4400. KDE_CONF_FILES
  4401. ])
  4402. AC_DEFUN([KDE_SET_PREFIX],
  4403. [
  4404. unset CDPATH
  4405. dnl We can't give real code to that macro, only a value.
  4406. dnl It only matters for --help, since we set the prefix in this function anyway.
  4407. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4408. KDE_SET_DEFAULT_BINDIRS
  4409. if test "x$prefix" = "xNONE"; then
  4410. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4411. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4412. else
  4413. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4414. kde_save_PATH="$PATH"
  4415. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4416. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4417. PATH="$kde_save_PATH"
  4418. fi
  4419. kde_libs_prefix=`$KDECONFIG --prefix`
  4420. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4421. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4422. This means it has been moved since you installed it.
  4423. This won't work. Please recompile tdelibs for the new prefix.
  4424. ])
  4425. fi
  4426. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4427. AC_MSG_CHECKING([where to install])
  4428. if test "x$prefix" = "xNONE"; then
  4429. prefix=$kde_libs_prefix
  4430. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4431. else
  4432. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4433. given_prefix=$prefix
  4434. AC_MSG_RESULT([$prefix (as requested)])
  4435. fi
  4436. # And delete superfluous '/' to make compares easier
  4437. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4438. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4439. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4440. AC_SUBST(KDECONFIG)
  4441. AC_SUBST(kde_libs_prefix)
  4442. AC_SUBST(kde_libs_htmldir)
  4443. KDE_FAST_CONFIGURE
  4444. KDE_CONF_FILES
  4445. ])
  4446. pushdef([AC_PROG_INSTALL],
  4447. [
  4448. dnl our own version, testing for a -p flag
  4449. popdef([AC_PROG_INSTALL])
  4450. dnl as AC_PROG_INSTALL works as it works we first have
  4451. dnl to save if the user didn't specify INSTALL, as the
  4452. dnl autoconf one overwrites INSTALL and we have no chance to find
  4453. dnl out afterwards
  4454. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4455. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4456. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4457. AC_PROG_INSTALL
  4458. if test -z "$kde_save_INSTALL_given" ; then
  4459. # OK, user hasn't given any INSTALL, autoconf found one for us
  4460. # now we test, if it supports the -p flag
  4461. AC_MSG_CHECKING(for -p flag to install)
  4462. rm -f confinst.$$.* > /dev/null 2>&1
  4463. echo "Testtest" > confinst.$$.orig
  4464. ac_res=no
  4465. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4466. if test -f confinst.$$.new ; then
  4467. # OK, -p seems to do no harm to install
  4468. INSTALL="${INSTALL} -p"
  4469. ac_res=yes
  4470. fi
  4471. fi
  4472. rm -f confinst.$$.*
  4473. AC_MSG_RESULT($ac_res)
  4474. fi
  4475. dnl the following tries to resolve some signs and wonders coming up
  4476. dnl with different autoconf/automake versions
  4477. dnl e.g.:
  4478. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4479. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4480. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4481. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4482. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4483. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4484. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4485. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4486. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4487. dnl *sometimes TDE does not use the install-@DIR@PROGRAM targets from
  4488. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4489. dnl and so does not see the -s flag in automake > 1.4
  4490. dnl to clean up that mess we:
  4491. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4492. dnl which cleans KDE's program with automake > 1.4;
  4493. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4494. dnl with automake<=1.4
  4495. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4496. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4497. dnl
  4498. dnl And to all this comes, that I even can't write in comments variable
  4499. dnl names used by automake, because it is so stupid to think I wanted to
  4500. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4501. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4502. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4503. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4504. fi
  4505. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4506. INSTALL_SCRIPT='${INSTALL}'
  4507. fi
  4508. ])dnl
  4509. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4510. [AC_LANG_CPLUSPLUS
  4511. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4512. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4513. ])
  4514. pushdef([AC_LANG_CPLUSPLUS],
  4515. [popdef([AC_LANG_CPLUSPLUS])
  4516. KDE_LANG_CPLUSPLUS
  4517. ])
  4518. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4519. [
  4520. AC_MSG_CHECKING(for long long)
  4521. AC_CACHE_VAL(kde_cv_c_long_long,
  4522. [
  4523. AC_LANG_SAVE
  4524. AC_LANG_CPLUSPLUS
  4525. AC_TRY_LINK([], [
  4526. long long foo = 0;
  4527. foo = foo+1;
  4528. ],
  4529. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4530. AC_LANG_RESTORE
  4531. ])
  4532. AC_MSG_RESULT($kde_cv_c_long_long)
  4533. if test "$kde_cv_c_long_long" = yes; then
  4534. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4535. fi
  4536. ])
  4537. AC_DEFUN([KDE_CHECK_LIB],
  4538. [
  4539. kde_save_LDFLAGS="$LDFLAGS"
  4540. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4541. kde_save_LIBS="$LIBS"
  4542. LDFLAGS="$LDFLAGS $all_libraries -ltqt"
  4543. case $host_os in
  4544. aix*) LDFLAGS="-brtl $LDFLAGS"
  4545. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4546. ;;
  4547. esac
  4548. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4549. LDFLAGS="$kde_save_LDFLAGS"
  4550. LIBS="$kde_save_LIBS"
  4551. ])
  4552. AC_DEFUN([KDE_JAVA_PREFIX],
  4553. [
  4554. dir=`dirname "$1"`
  4555. base=`basename "$1"`
  4556. list=`ls -1 $dir 2> /dev/null`
  4557. for entry in $list; do
  4558. if test -d $dir/$entry/bin; then
  4559. case $entry in
  4560. $base)
  4561. javadirs="$javadirs $dir/$entry/bin"
  4562. ;;
  4563. esac
  4564. elif test -d $dir/$entry/jre/bin; then
  4565. case $entry in
  4566. $base)
  4567. javadirs="$javadirs $dir/$entry/jre/bin"
  4568. ;;
  4569. esac
  4570. fi
  4571. done
  4572. ])
  4573. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4574. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4575. [
  4576. AC_ARG_WITH(java,
  4577. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4578. [ ac_java_dir=$withval
  4579. ], ac_java_dir=""
  4580. )
  4581. AC_MSG_CHECKING([for Java])
  4582. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4583. if test "x$ac_java_dir" = "xno"; then
  4584. kde_java_bindir=no
  4585. kde_java_includedir=no
  4586. kde_java_libjvmdir=no
  4587. kde_java_libgcjdir=no
  4588. kde_java_libhpidir=no
  4589. else
  4590. if test "x$ac_java_dir" = "x"; then
  4591. dnl No option set -> collect list of candidate paths
  4592. if test -n "$JAVA_HOME"; then
  4593. KDE_JAVA_PREFIX($JAVA_HOME)
  4594. fi
  4595. KDE_JAVA_PREFIX(/usr/j2se)
  4596. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4597. KDE_JAVA_PREFIX(/usr/j*dk*)
  4598. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4599. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4600. KDE_JAVA_PREFIX(/usr/lib/java*)
  4601. KDE_JAVA_PREFIX(/usr/java*)
  4602. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4603. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4604. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4605. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4606. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4607. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4608. KDE_JAVA_PREFIX(/opt/java*)
  4609. kde_cv_path="NONE"
  4610. kde_save_IFS=$IFS
  4611. IFS=':'
  4612. for dir in $PATH; do
  4613. if test -d "$dir"; then
  4614. javadirs="$javadirs $dir"
  4615. fi
  4616. done
  4617. IFS=$kde_save_IFS
  4618. jredirs=
  4619. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4620. for dir in $javadirs; do
  4621. dnl Check for the java executable
  4622. if test -x "$dir/java"; then
  4623. sane_path=$(cd $dir; /bin/pwd)
  4624. dnl And also check for a libjvm.so somewhere under there
  4625. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4626. if test "$sane_path" != "/usr/bin"; then
  4627. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4628. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4629. jredirs="$jredirs $dir"
  4630. fi
  4631. fi
  4632. done
  4633. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4634. JAVAC=
  4635. JAVA=
  4636. kde_java_bindir=no
  4637. for dir in $jredirs; do
  4638. JAVA="$dir/java"
  4639. kde_java_bindir=$dir
  4640. if test -x "$dir/javac"; then
  4641. JAVAC="$dir/javac"
  4642. break
  4643. fi
  4644. done
  4645. if test -n "$JAVAC"; then
  4646. dnl this substitution might not work - well, we test for jni.h below
  4647. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4648. else
  4649. kde_java_includedir=no
  4650. fi
  4651. else
  4652. dnl config option set
  4653. kde_java_bindir=$ac_java_dir/bin
  4654. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4655. kde_java_includedir=no
  4656. else
  4657. kde_java_includedir=$ac_java_dir/include
  4658. fi
  4659. fi
  4660. fi
  4661. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4662. if test "x$kde_java_bindir" != "xno"; then
  4663. dnl Look for libjvm.so
  4664. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4665. dnl Look for libgcj.so
  4666. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4667. dnl Look for libhpi.so and avoid green threads
  4668. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4669. dnl Now check everything's fine under there
  4670. dnl the include dir is our flag for having the JDK
  4671. if test -d "$kde_java_includedir"; then
  4672. if test ! -x "$kde_java_bindir/javac"; then
  4673. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4674. fi
  4675. kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
  4676. if test -n "$kde_javac_h"; then
  4677. if test ! -x "$kde_java_bindir/javah"; then
  4678. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4679. fi
  4680. fi
  4681. if test ! -x "$kde_java_bindir/jar"; then
  4682. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4683. fi
  4684. if test ! -r "$kde_java_includedir/jni.h"; then
  4685. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4686. fi
  4687. jni_includes="-I$kde_java_includedir"
  4688. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4689. dnl and under linux here..
  4690. dnl not needed for gcj
  4691. if test "x$kde_java_libgcjdir" = "x"; then
  4692. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4693. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4694. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4695. fi
  4696. else
  4697. JAVAC=
  4698. jni_includes=
  4699. fi
  4700. if test "x$kde_java_libgcjdir" = "x"; then
  4701. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4702. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4703. fi
  4704. else
  4705. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4706. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4707. fi
  4708. fi
  4709. if test ! -x "$kde_java_bindir/java"; then
  4710. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4711. fi
  4712. dnl not needed for gcj compile
  4713. if test -n "$jni_includes"; then
  4714. dnl Check for JNI version
  4715. AC_LANG_SAVE
  4716. AC_LANG_CPLUSPLUS
  4717. ac_cxxflags_safe="$CXXFLAGS"
  4718. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4719. AC_TRY_COMPILE([
  4720. #include <jni.h>
  4721. ],
  4722. [
  4723. #ifndef JNI_VERSION_1_2
  4724. Syntax Error
  4725. #endif
  4726. ],[ kde_jni_works=yes ],
  4727. [ kde_jni_works=no ])
  4728. if test $kde_jni_works = no; then
  4729. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4730. You need to have Java Development Kit (JDK) version 1.2.
  4731. Use --with-java to specify another location.
  4732. Use --without-java to configure without java support.
  4733. Or download a newer JDK and try again.
  4734. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4735. fi
  4736. CXXFLAGS="$ac_cxxflags_safe"
  4737. AC_LANG_RESTORE
  4738. dnl All tests ok, inform and subst the variables
  4739. JAVAC=$kde_java_bindir/javac
  4740. JAVAH=$kde_java_bindir/javah
  4741. JAR=$kde_java_bindir/jar
  4742. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4743. if test "x$kde_java_libgcjdir" = "x"; then
  4744. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4745. JVMLIBS="-L$kde_java_libjvmdir -ljvm"
  4746. else
  4747. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4748. fi
  4749. else
  4750. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4751. fi
  4752. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4753. else
  4754. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4755. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4756. fi
  4757. elif test -d "/Library/Java/Home"; then
  4758. kde_java_bindir="/Library/Java/Home/bin"
  4759. jni_includes="-I/Library/Java/Home/include"
  4760. JAVAC=$kde_java_bindir/javac
  4761. JAVAH=$kde_java_bindir/javah
  4762. JAR=$kde_java_bindir/jar
  4763. JVMLIBS="-Wl,-framework,JavaVM"
  4764. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4765. AC_MSG_RESULT([Apple Java Framework])
  4766. else
  4767. AC_MSG_RESULT([none found])
  4768. fi
  4769. AC_MSG_CHECKING([if Java is >= 8])
  4770. JAVA8=false
  4771. if test -x "$kde_java_bindir/javac"; then
  4772. kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
  4773. if test -z "$kde_javac_h"; then
  4774. JAVA8=true
  4775. JAVAH=
  4776. fi
  4777. fi
  4778. if $JAVA8; then
  4779. AC_MSG_RESULT(yes)
  4780. else
  4781. AC_MSG_RESULT(no)
  4782. fi
  4783. AC_SUBST(JAVAC)
  4784. AC_SUBST(JAVA8)
  4785. AC_SUBST(JAVAH)
  4786. AC_SUBST(JAR)
  4787. AC_SUBST(JVMLIBS)
  4788. AC_SUBST(jni_includes)
  4789. # for backward compat
  4790. kde_cv_java_includedir=$kde_java_includedir
  4791. kde_cv_java_bindir=$kde_java_bindir
  4792. ])
  4793. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4794. dnl When the argument list becomes big, as in TDE for AC_OUTPUT in
  4795. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4796. dnl it. (matz@kde.org)
  4797. m4_define([mm_foreach],
  4798. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4799. m4_define([mm_car], [[$1]])
  4800. m4_define([mm_car2], [[$@]])
  4801. m4_define([_mm_foreach],
  4802. [m4_if(m4_quote($2), [], [],
  4803. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4804. mm_car2(m4_shift($2)),
  4805. [$3])])])
  4806. m4_define([AC_FOREACH],
  4807. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4808. # AH_CHECK_HEADERS_TDE(HEADER-FILE...)
  4809. # --------------------------------
  4810. m4_define([AH_CHECK_HEADERS_TDE],
  4811. [m4_foreach_w([AC_Header], [$1],
  4812. [AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([AC_Header])),
  4813. [Define to 1 if you have the <]m4_defn([AC_Header])[> header file.])])])
  4814. AC_DEFUN([KDE_NEED_FLEX],
  4815. [
  4816. kde_libs_safe=$LIBS
  4817. LIBS="$LIBS $USER_LDFLAGS"
  4818. AM_PROG_LEX
  4819. LIBS=$kde_libs_safe
  4820. if test -z "$LEXLIB"; then
  4821. AC_MSG_ERROR([You need to have flex installed.])
  4822. fi
  4823. AC_SUBST(LEXLIB)
  4824. ])
  4825. AC_DEFUN([AC_PATH_TQTOPIA],
  4826. [
  4827. dnl TODO: use AC_CACHE_VAL
  4828. if test -z "$1"; then
  4829. tqtopia_minver_maj=1
  4830. tqtopia_minver_min=5
  4831. tqtopia_minver_pat=0
  4832. else
  4833. tqtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4834. tqtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4835. tqtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4836. fi
  4837. tqtopia_minver="$tqtopia_minver_maj$tqtopia_minver_min$tqtopia_minver_pat"
  4838. tqtopia_minverstr="$tqtopia_minver_maj.$tqtopia_minver_min.$tqtopia_minver_pat"
  4839. AC_REQUIRE([AC_PATH_TQT])
  4840. AC_MSG_CHECKING([for TQtopia])
  4841. LIB_TQTOPIA="-lqpe"
  4842. AC_SUBST(LIB_TQTOPIA)
  4843. kde_tqtopia_dirs="$QPEDIR /opt/TQtopia"
  4844. ac_tqtopia_incdir=NO
  4845. AC_ARG_WITH(tqtopia-dir,
  4846. AC_HELP_STRING([--with-tqtopia-dir=DIR],[where the root of TQtopia is installed]),
  4847. [ ac_tqtopia_incdir="$withval"/include] )
  4848. tqtopia_incdirs=""
  4849. for dir in $kde_tqtopia_dirs; do
  4850. tqtopia_incdirs="$tqtopia_incdirs $dir/include"
  4851. done
  4852. if test ! "$ac_tqtopia_incdir" = "NO"; then
  4853. tqtopia_incdirs="$ac_tqtopia_incdir $tqtopia_incdirs"
  4854. fi
  4855. tqtopia_incdir=""
  4856. AC_FIND_FILE(qpe/qpeapplication.h, $tqtopia_incdirs, tqtopia_incdir)
  4857. ac_tqtopia_incdir="$tqtopia_incdir"
  4858. if test -z "$tqtopia_incdir"; then
  4859. AC_MSG_ERROR([Cannot find TQtopia headers. Please check your installation.])
  4860. fi
  4861. tqtopia_ver_maj=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4862. tqtopia_ver_min=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4863. tqtopia_ver_pat=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4864. tqtopia_ver="$tqtopia_ver_maj$tqtopia_ver_min$tqtopia_ver_pat"
  4865. tqtopia_verstr="$tqtopia_ver_maj.$tqtopia_ver_min.$tqtopia_ver_pat"
  4866. if test "$tqtopia_ver" -lt "$tqtopia_minver"; then
  4867. AC_MSG_ERROR([found TQtopia version $tqtopia_verstr but version $tqtopia_minverstr
  4868. is required.])
  4869. fi
  4870. AC_LANG_SAVE
  4871. AC_LANG_CPLUSPLUS
  4872. ac_cxxflags_safe="$CXXFLAGS"
  4873. ac_ldflags_safe="$LDFLAGS"
  4874. ac_libs_safe="$LIBS"
  4875. CXXFLAGS="$CXXFLAGS -I$tqtopia_incdir $all_includes"
  4876. LDFLAGS="$LDFLAGS $TQT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4877. LIBS="$LIBS $LIB_TQTOPIA $LIBTQT"
  4878. cat > conftest.$ac_ext <<EOF
  4879. #include "confdefs.h"
  4880. #include <qpe/qpeapplication.h>
  4881. #include <qpe/version.h>
  4882. int main( int argc, char **argv )
  4883. {
  4884. QPEApplication app( argc, argv );
  4885. return 0;
  4886. }
  4887. EOF
  4888. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4889. rm -f conftest*
  4890. else
  4891. rm -f conftest*
  4892. AC_MSG_ERROR([Cannot link small TQtopia Application. For more details look at
  4893. the end of config.log])
  4894. fi
  4895. CXXFLAGS="$ac_cxxflags_safe"
  4896. LDFLAGS="$ac_ldflags_safe"
  4897. LIBS="$ac_libs_safe"
  4898. AC_LANG_RESTORE
  4899. TQTOPIA_INCLUDES="-I$tqtopia_incdir"
  4900. AC_SUBST(TQTOPIA_INCLUDES)
  4901. AC_MSG_RESULT([found version $tqtopia_verstr with headers at $tqtopia_incdir])
  4902. ])
  4903. AC_DEFUN([KDE_INIT_DOXYGEN],
  4904. [
  4905. AC_MSG_CHECKING([for TQt docs])
  4906. kde_tqtdir=
  4907. if test "${with_tqt_dir+set}" = set; then
  4908. kde_tqtdir="$with_tqt_dir"
  4909. fi
  4910. AC_FIND_FILE(qsql.html, [ $kde_tqtdir/doc/html $TQTDIR/doc/html /usr/share/doc/packages/tqt3/html /usr/lib/tqt3/doc /usr/lib/tqt3/doc/html /usr/doc/tqt3/html /usr/doc/tqt3 /usr/share/doc/tqt3-doc /usr/share/tqt3/doc/html /usr/X11R6/share/doc/tqt/html ], TQTDOCDIR)
  4911. AC_MSG_RESULT($TQTDOCDIR)
  4912. AC_SUBST(TQTDOCDIR)
  4913. KDE_FIND_PATH(dot, DOT, [], [])
  4914. if test -n "$DOT"; then
  4915. KDE_HAVE_DOT="YES"
  4916. else
  4917. KDE_HAVE_DOT="NO"
  4918. fi
  4919. AC_SUBST(KDE_HAVE_DOT)
  4920. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4921. AC_SUBST(DOXYGEN)
  4922. DOXYGEN_PROJECT_NAME="$1"
  4923. DOXYGEN_PROJECT_NUMBER="$2"
  4924. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4925. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4926. KDE_HAS_DOXYGEN=no
  4927. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $TQTDOCDIR/qsql.html; then
  4928. KDE_HAS_DOXYGEN=yes
  4929. fi
  4930. AC_SUBST(KDE_HAS_DOXYGEN)
  4931. ])
  4932. AC_DEFUN([AC_FIND_BZIP2],
  4933. [
  4934. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4935. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4936. [
  4937. AC_LANG_SAVE
  4938. AC_LANG_CPLUSPLUS
  4939. kde_save_LIBS="$LIBS"
  4940. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4941. kde_save_CXXFLAGS="$CXXFLAGS"
  4942. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4943. AC_TRY_LINK(dnl
  4944. [
  4945. #define BZ_NO_STDIO
  4946. #include<bzlib.h>
  4947. ],
  4948. [ bz_stream s; (void) bzDecompress(&s); ],
  4949. eval "ac_cv_lib_bzip2='-lbz2'",
  4950. eval "ac_cv_lib_bzip2=no")
  4951. LIBS="$kde_save_LIBS"
  4952. CXXFLAGS="$kde_save_CXXFLAGS"
  4953. AC_LANG_RESTORE
  4954. ])dnl
  4955. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4956. if test ! "$ac_cv_lib_bzip2" = no; then
  4957. BZIP2DIR=bzip2
  4958. LIBBZ2="$ac_cv_lib_bzip2"
  4959. AC_SUBST(LIBBZ2)
  4960. else
  4961. cxx_shared_flag=
  4962. ld_shared_flag=
  4963. KDE_CHECK_COMPILER_FLAG(shared, [
  4964. ld_shared_flag="-shared"
  4965. ])
  4966. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4967. cxx_shared_flag="-fPIC"
  4968. ])
  4969. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4970. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4971. [
  4972. AC_LANG_SAVE
  4973. AC_LANG_CPLUSPLUS
  4974. kde_save_LIBS="$LIBS"
  4975. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4976. kde_save_CXXFLAGS="$CXXFLAGS"
  4977. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4978. AC_TRY_LINK(dnl
  4979. [
  4980. #define BZ_NO_STDIO
  4981. #include<bzlib.h>
  4982. ],
  4983. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4984. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4985. eval "ac_cv_lib_bzip2_prefix=no")
  4986. LIBS="$kde_save_LIBS"
  4987. CXXFLAGS="$kde_save_CXXFLAGS"
  4988. AC_LANG_RESTORE
  4989. ])dnl
  4990. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4991. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4992. BZIP2DIR=bzip2
  4993. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4994. AC_SUBST(LIBBZ2)
  4995. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4996. dnl else, we just ignore this
  4997. fi
  4998. fi
  4999. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  5000. ])
  5001. dnl ------------------------------------------------------------------------
  5002. dnl Try to find the SSL headers and libraries.
  5003. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  5004. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  5005. dnl ------------------------------------------------------------------------
  5006. dnl
  5007. AC_DEFUN([KDE_CHECK_SSL],
  5008. [
  5009. LIBSSL="-lssl -lcrypto"
  5010. AC_REQUIRE([KDE_CHECK_LIB64])
  5011. ac_ssl_includes=NO ac_ssl_libraries=NO
  5012. ssl_libraries=""
  5013. ssl_includes=""
  5014. AC_ARG_WITH(ssl-dir,
  5015. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  5016. [ ac_ssl_includes="$withval"/include
  5017. ac_ssl_libraries="$withval"/lib$tdelibsuff
  5018. ])
  5019. want_ssl=yes
  5020. AC_ARG_WITH(ssl,
  5021. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  5022. [want_ssl=$withval])
  5023. if test $want_ssl = yes; then
  5024. AC_MSG_CHECKING(for OpenSSL)
  5025. AC_CACHE_VAL(ac_cv_have_ssl,
  5026. [#try to guess OpenSSL locations
  5027. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  5028. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  5029. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  5030. ac_ssl_includes="$ssl_incdir"
  5031. ssl_libdirs="/usr/lib$tdelibsuff /usr/local/lib$tdelibsuff /usr/ssl/lib$tdelibsuff /usr/local/ssl/lib$tdelibsuff $libdir $prefix/lib$tdelibsuff $exec_prefix/lib$tdelibsuff $kde_extra_libs"
  5032. if test ! "$ac_ssl_libraries" = "NO"; then
  5033. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  5034. fi
  5035. test=NONE
  5036. ssl_libdir=NONE
  5037. for dir in $ssl_libdirs; do
  5038. try="ls -1 $dir/libssl*"
  5039. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  5040. done
  5041. ac_ssl_libraries="$ssl_libdir"
  5042. ac_ldflags_safe="$LDFLAGS"
  5043. ac_libs_safe="$LIBS"
  5044. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  5045. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  5046. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  5047. ac_ssl_rsaref="yes"
  5048. ,
  5049. ac_ssl_rsaref="no"
  5050. )
  5051. LDFLAGS="$ac_ldflags_safe"
  5052. LIBS="$ac_libs_safe"
  5053. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5054. have_ssl=no
  5055. else
  5056. have_ssl=yes;
  5057. fi
  5058. ])
  5059. eval "$ac_cv_have_ssl"
  5060. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5061. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5062. AC_MSG_RESULT($ac_ssl_rsaref)
  5063. AC_MSG_CHECKING([for easter eggs])
  5064. AC_MSG_RESULT([none found])
  5065. else
  5066. have_ssl=no
  5067. fi
  5068. if test "$have_ssl" = yes; then
  5069. AC_MSG_CHECKING(for OpenSSL version)
  5070. dnl Check for SSL version
  5071. AC_CACHE_VAL(ac_cv_ssl_version,
  5072. [
  5073. cat >conftest.$ac_ext <<EOF
  5074. #include <openssl/opensslv.h>
  5075. #include <stdio.h>
  5076. int main() {
  5077. #ifndef OPENSSL_VERSION_NUMBER
  5078. printf("ssl_version=\\"error\\"\n");
  5079. #else
  5080. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5081. printf("ssl_version=\\"old\\"\n");
  5082. else
  5083. printf("ssl_version=\\"ok\\"\n");
  5084. #endif
  5085. return (0);
  5086. }
  5087. EOF
  5088. ac_save_CPPFLAGS=$CPPFLAGS
  5089. if test "$ac_ssl_includes" != "/usr/include"; then
  5090. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5091. fi
  5092. if AC_TRY_EVAL(ac_link); then
  5093. if eval `./conftest 2>&5`; then
  5094. if test $ssl_version = error; then
  5095. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5096. else
  5097. if test $ssl_version = old; then
  5098. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5099. have_ssl=no
  5100. fi
  5101. fi
  5102. ac_cv_ssl_version="ssl_version=$ssl_version"
  5103. else
  5104. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5105. Check config.log, and if you can't figure it out, send a mail to
  5106. David Faure <faure@kde.org>, attaching your config.log])
  5107. fi
  5108. else
  5109. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5110. Check config.log, and if you can't figure it out, send a mail to
  5111. David Faure <faure@kde.org>, attaching your config.log])
  5112. fi
  5113. CPPFLAGS=$ac_save_CPPFLAGS
  5114. ])
  5115. eval "$ac_cv_ssl_version"
  5116. AC_MSG_RESULT($ssl_version)
  5117. fi
  5118. if test "$have_ssl" != yes; then
  5119. LIBSSL="";
  5120. else
  5121. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5122. ac_cv_have_ssl="have_ssl=yes \
  5123. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5124. ssl_libraries="$ac_ssl_libraries"
  5125. ssl_includes="$ac_ssl_includes"
  5126. if test "$ac_ssl_rsaref" = yes; then
  5127. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5128. fi
  5129. if test $ssl_version = "old"; then
  5130. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5131. fi
  5132. fi
  5133. SSL_INCLUDES=
  5134. if test "$ssl_includes" = "/usr/include"; then
  5135. if test -f /usr/kerberos/include/krb5.h; then
  5136. SSL_INCLUDES="-I/usr/kerberos/include"
  5137. fi
  5138. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5139. SSL_INCLUDES="-I$ssl_includes"
  5140. fi
  5141. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5142. SSL_LDFLAGS=""
  5143. else
  5144. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5145. fi
  5146. AC_SUBST(SSL_INCLUDES)
  5147. AC_SUBST(SSL_LDFLAGS)
  5148. AC_SUBST(LIBSSL)
  5149. ])
  5150. AC_DEFUN([KDE_CHECK_STRLCPY],
  5151. [
  5152. AC_REQUIRE([AC_CHECK_STRLCAT])
  5153. AC_REQUIRE([AC_CHECK_STRLCPY])
  5154. AC_CHECK_SIZEOF(size_t)
  5155. AC_CHECK_SIZEOF(unsigned long)
  5156. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5157. AC_TRY_COMPILE(,[
  5158. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5159. choke me
  5160. #endif
  5161. ],AC_MSG_RESULT([yes]),[
  5162. AC_MSG_RESULT(no)
  5163. AC_MSG_ERROR([
  5164. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5165. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5166. ])
  5167. ])
  5168. ])
  5169. AC_DEFUN([KDE_CHECK_BINUTILS],
  5170. [
  5171. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5172. kde_save_LDFLAGS="$LDFLAGS"
  5173. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5174. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5175. AC_TRY_LINK([int foo;],
  5176. [
  5177. #ifdef __INTEL_COMPILER
  5178. icc apparently does not support libtools version-info and version-script
  5179. at the same time. Dunno where the bug is, but until somebody figured out,
  5180. better disable the optional version scripts.
  5181. #endif
  5182. foo = 42;
  5183. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5184. LDFLAGS="$kde_save_LDFLAGS"
  5185. rm -f conftest.map
  5186. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5187. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5188. AC_MSG_RESULT($kde_supports_versionmaps)
  5189. ])
  5190. AC_DEFUN([AM_PROG_OBJC],[
  5191. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5192. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5193. if test "x${OBJCFLAGS-unset}" = xunset; then
  5194. OBJCFLAGS="-g -O2"
  5195. fi
  5196. AC_SUBST(OBJCFLAGS)
  5197. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5198. ])
  5199. AC_DEFUN([KDE_CHECK_PERL],
  5200. [
  5201. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5202. AC_MSG_ERROR([No Perl found in your $PATH.
  5203. We need perl to generate some code.])
  5204. ])
  5205. AC_SUBST(PERL)
  5206. ])
  5207. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5208. [
  5209. AC_SYS_LARGEFILE
  5210. if test "$ac_cv_sys_file_offset_bits" != no; then
  5211. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5212. fi
  5213. if test "x$ac_cv_sys_large_files" != "xno"; then
  5214. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5215. fi
  5216. ])
  5217. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5218. dnl which allows to search for libs that get installed into the TDE prefix.
  5219. dnl
  5220. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5221. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5222. dnl also defines KSTUFF_PKG_ERRORS on error
  5223. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5224. PKG_CONFIG_PATH="$prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5225. if test "$prefix" != "$kde_libs_prefix"; then
  5226. PKG_CONFIG_PATH="$kde_libs_prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5227. fi
  5228. export PKG_CONFIG_PATH
  5229. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5230. ])
  5231. dnl Check for PIE support in the compiler and linker
  5232. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5233. [
  5234. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5235. [
  5236. AC_LANG_SAVE
  5237. AC_LANG_CPLUSPLUS
  5238. safe_CXXFLAGS=$CXXFLAGS
  5239. safe_LDFLAGS=$LDFLAGS
  5240. CXXFLAGS="$CXXFLAGS -fPIE"
  5241. LDFLAGS="$LDFLAGS -pie"
  5242. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5243. CXXFLAGS=$safe_CXXFLAGS
  5244. LDFLAGS=$safe_LDFLAGS
  5245. AC_LANG_RESTORE
  5246. ])
  5247. AC_MSG_CHECKING(if enabling -pie/fPIE support)
  5248. AC_ARG_ENABLE(pie,
  5249. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5250. [kde_has_pie_support=$enableval],
  5251. [kde_has_pie_support=detect])
  5252. if test "$kde_has_pie_support" = "detect"; then
  5253. kde_has_pie_support=$kde_cv_val_pie_support
  5254. fi
  5255. AC_MSG_RESULT([$kde_has_pie_support])
  5256. KDE_USE_FPIE=""
  5257. KDE_USE_PIE=""
  5258. AC_SUBST([KDE_USE_FPIE])
  5259. AC_SUBST([KDE_USE_PIE])
  5260. if test "$kde_has_pie_support" = "yes"; then
  5261. KDE_USE_FPIE="-fPIE"
  5262. KDE_USE_PIE="-pie"
  5263. fi
  5264. ])
  5265. dnl
  5266. dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  5267. dnl
  5268. AC_DEFUN([AM_PATH_CPPUNIT],
  5269. [
  5270. AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
  5271. cppunit_config_prefix="$withval", cppunit_config_prefix="")
  5272. AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
  5273. cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
  5274. AC_MSG_CHECKING(if CPPUNIT tests should be built (default=yes))
  5275. AC_ARG_ENABLE(cppunit,
  5276. [ --disable-cppunit Do not try to build with CPPUNIT tests],,
  5277. enable_cppunit=yes)
  5278. AC_MSG_RESULT($enable_cppunit)
  5279. if test "x$enable_cppunit" = "xyes"; then
  5280. AC_MSG_CHECKING(if unit-tests requiring an online connection should be built (default=no))
  5281. AC_ARG_ENABLE(online_tests,
  5282. [ --enable-online-tests Include online tests with CPPUNIT tests],,
  5283. enable_online_tests=no)
  5284. AC_MSG_RESULT($enable_online_tests)
  5285. cppunit_version_min=$1
  5286. if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists cppunit; then
  5287. PKG_CHECK_MODULES(CPPUNIT, [cppunit >= $cppunit_version_min],,
  5288. [
  5289. AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built)
  5290. no_cppunit=yes
  5291. ])
  5292. else
  5293. if test x$cppunit_config_exec_prefix != x ; then
  5294. cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
  5295. if test x${CPPUNIT_CONFIG+set} != xset ; then
  5296. CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
  5297. fi
  5298. fi
  5299. if test x$cppunit_config_prefix != x ; then
  5300. cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
  5301. if test x${CPPUNIT_CONFIG+set} != xset ; then
  5302. CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
  5303. fi
  5304. fi
  5305. AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
  5306. AC_MSG_CHECKING(for CPPUNIT - version >= $cppunit_version_min)
  5307. no_cppunit=""
  5308. if test "$CPPUNIT_CONFIG" = "no" ; then
  5309. AC_MSG_RESULT(no)
  5310. AC_MSG_WARN(Unable to locate cppunit-config. Tests will not be built)
  5311. no_cppunit=yes
  5312. else
  5313. CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
  5314. CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
  5315. cppunit_version=`$CPPUNIT_CONFIG --version`
  5316. cppunit_major_version=`echo $cppunit_version | \
  5317. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  5318. cppunit_minor_version=`echo $cppunit_version | \
  5319. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  5320. cppunit_micro_version=`echo $cppunit_version | \
  5321. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  5322. cppunit_major_min=`echo $cppunit_version_min | \
  5323. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  5324. cppunit_minor_min=`echo $cppunit_version_min | \
  5325. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  5326. cppunit_micro_min=`echo $cppunit_version_min | \
  5327. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  5328. cppunit_version_proper=`expr \
  5329. $cppunit_major_version \> $cppunit_major_min \| \
  5330. $cppunit_major_version \= $cppunit_major_min \& \
  5331. $cppunit_minor_version \> $cppunit_minor_min \| \
  5332. $cppunit_major_version \= $cppunit_major_min \& \
  5333. $cppunit_minor_version \= $cppunit_minor_min \& \
  5334. $cppunit_micro_version \>= $cppunit_micro_min `
  5335. if test "$cppunit_version_proper" = "1" ; then
  5336. AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
  5337. else
  5338. AC_MSG_RESULT(no)
  5339. AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built)
  5340. no_cppunit=yes
  5341. fi
  5342. fi
  5343. fi
  5344. else
  5345. no_cppunit=user
  5346. fi
  5347. if test "x$no_cppunit" = x ; then
  5348. ifelse([$2], , :, [$2])
  5349. if test "x$enable_online_tests" = "xyes"; then
  5350. AC_DEFINE_UNQUOTED(PERFORM_ONLINE_UNITTESTS, 1, [Define if unit tests requiring online access should be compiled])
  5351. fi
  5352. else
  5353. CPPUNIT_CFLAGS=""
  5354. CPPUNIT_LIBS=""
  5355. ifelse([$3], , :, [$3])
  5356. fi
  5357. AC_SUBST(CPPUNIT_CFLAGS)
  5358. AC_SUBST(CPPUNIT_LIBS)
  5359. ])
  5360. dnl
  5361. dnl AM_KDE_MIN_VERSION(MIN-VERSION-MAJOR, MIN-VERSION-MINOR, MIN-VERSION-MICRO)
  5362. dnl
  5363. AC_DEFUN([AM_KDE_MIN_VERSION],
  5364. [
  5365. AC_MSG_CHECKING([if minimum TDE version is available])
  5366. AC_LANG_SAVE
  5367. AC_LANG_CPLUSPLUS
  5368. save_CXXFLAGS=$CXXFLAGS
  5369. CXXFLAGS="$CXXFLAGS -I$srcdir $all_includes"
  5370. AC_TRY_COMPILE([
  5371. #include "kdecompat.h"
  5372. #if !( KDE_IS_VERSION( $1, $2, $3 ) )
  5373. #error TDE version does not meet KMyMoney minimum requirement
  5374. #endif
  5375. ], [], AC_MSG_RESULT(yes), AC_MSG_ERROR(no)
  5376. )
  5377. CXXFLAGS=$save_CXXFLAGS
  5378. AC_LANG_RESTORE
  5379. ])
  5380. AC_DEFUN([AC_GLIB_2],
  5381. [
  5382. AC_MSG_CHECKING([for glib == 2.0])
  5383. GLIB2_LIBS=`$PKG_CONFIG --libs glib-2.0`
  5384. GLIB2_CFLAGS="`$PKG_CONFIG --cflags glib-2.0`"
  5385. if test -z "$GLIB2_LIBS"; then
  5386. AC_MSG_RESULT(no);
  5387. DO_NOT_COMPILE="$DO_NOT_COMPILE mozilla"
  5388. else
  5389. AC_MSG_RESULT([cflags $GLIB2_CFLAGS]);
  5390. AC_SUBST(GLIB2_CFLAGS)
  5391. AC_SUBST(GLIB2_LIBS)
  5392. fi
  5393. ])
  5394. AC_DEFUN([AC_GTK_2],
  5395. [
  5396. AC_MSG_CHECKING([for gtk == 2.0])
  5397. GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
  5398. GTK2_CFLAGS="`$PKG_CONFIG --cflags gtk+-2.0`"
  5399. if test -z "$GTK2_LIBS"; then
  5400. AC_MSG_RESULT(no);
  5401. DO_NOT_COMPILE="$DO_NOT_COMPILE mozilla"
  5402. else
  5403. AC_MSG_RESULT([cflags $GTK2_CFLAGS]);
  5404. AC_SUBST(GTK2_CFLAGS)
  5405. AC_SUBST(GTK2_LIBS)
  5406. fi
  5407. ])
  5408. AC_DEFUN([AC_TAGCOLL2],
  5409. [
  5410. AC_MSG_CHECKING([for libtagcoll2])
  5411. TAGCOLL2_LIBS=`$PKG_CONFIG --libs libtagcoll2`
  5412. TAGCOLL2_CFLAGS="`$PKG_CONFIG --cflags libtagcoll2`"
  5413. if test -z "$TAGCOLL2_LIBS"; then
  5414. AC_MSG_RESULT(no);
  5415. else
  5416. AC_MSG_RESULT([cflags $TAGCOLL2_CFLAGS]);
  5417. AC_SUBST(TAGCOLL2_CFLAGS)
  5418. AC_SUBST(TAGCOLL2_LIBS)
  5419. fi
  5420. ])
  5421. AC_DEFUN([AC_LIBOFX],
  5422. [
  5423. AC_MSG_CHECKING(if the OFX importer plugin is desired)
  5424. AC_ARG_ENABLE(ofxplugin,
  5425. AC_HELP_STRING([--enable-ofxplugin],[enable OFX importer plugin (default=auto)]),
  5426. [enable_ofxplugin="$enableval"],
  5427. [enable_ofxplugin="auto"])
  5428. AC_MSG_RESULT($enable_ofxplugin)
  5429. AC_MSG_CHECKING(if OFX direct connect is desired)
  5430. AC_ARG_ENABLE(ofxbanking,
  5431. AC_HELP_STRING([--enable-ofxbanking],[enable OFX direct connect (default=auto)]),
  5432. [enable_ofxbanking="$enableval"],
  5433. [enable_ofxbanking="auto"])
  5434. AC_MSG_RESULT($enable_ofxbanking)
  5435. # make sure we include the plugin even if not mentioned explicitly
  5436. if test "$enable_ofxbanking" != "no" -a "$enable_ofxplugin" != "yes"; then
  5437. enable_ofxplugin=$enable_ofxbanking
  5438. fi
  5439. if test "$enable_ofxplugin" != "no" -o "$enable_ofxbanking" != "no"; then
  5440. ac_save_CFLAGS="$CFLAGS"
  5441. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  5442. AC_CHECK_HEADER([OpenSP/macros.h],
  5443. [],
  5444. [
  5445. if test "$enable_ofxplugin" != "auto" -o "$enable_ofxbanking" != "auto"; then
  5446. AC_MSG_ERROR([cannot find OpenSP headers. Please ensure you have OpenSP installed.])
  5447. fi
  5448. AC_MSG_RESULT([cannot find OpenSP headers. Skipping OFX support])
  5449. enable_ofxbanking=no
  5450. enable_ofxplugin=no
  5451. ])
  5452. if test "$enable_ofxplugin" != "no"; then
  5453. CFLAGS="$ac_save_CFLAGS"
  5454. PKG_CHECK_MODULES(OFX,libofx >= 0.8.2)
  5455. fi
  5456. fi
  5457. if test "$enable_ofxplugin" != "no"; then
  5458. OFX_IMPORTERPLUGIN="ofximport"
  5459. enable_ofxplugin=yes
  5460. fi
  5461. if test "$enable_ofxbanking" != "no"; then
  5462. enable_ofxbanking=yes
  5463. fi
  5464. AM_CONDITIONAL(OFXBANKING, test "$enable_ofxbanking" != "no" )
  5465. AC_SUBST(OFX_LIBS)
  5466. AC_SUBST(OFX_IMPORTERPLUGIN)
  5467. ])
  5468. dnl
  5469. dnl check the memory leakage checker option
  5470. dnl if enabled or disabled, directly controlled
  5471. dnl if not given, follows --enable-debug and if
  5472. dnl debugging support is turned on, the memory
  5473. dnl leakage checker is turned on also
  5474. dnl
  5475. dnl Need AC_CHECK_COMPILERS to be run before
  5476. AC_DEFUN([AC_MEMORY_LEAK_CHECK], [
  5477. AC_ARG_ENABLE(
  5478. leak-check,
  5479. AC_HELP_STRING([--enable-leak-check],[enable memory leak checker (default=no)]),
  5480. use_memory_leak_check=$enableval,use_memory_leak_check=no)
  5481. if test "x$use_memory_leak_check" != "xno"; then
  5482. CPPFLAGS="$CPPFLAGS -D_CHECK_MEMORY"
  5483. fi
  5484. if test "x$kde_use_debug_code" != "xno"; then
  5485. CPPFLAGS="$CPPFLAGS -DKMM_DEBUG=1"
  5486. else
  5487. CPPFLAGS="$CPPFLAGS -DKMM_DEBUG=0"
  5488. fi
  5489. ])
  5490. dnl
  5491. dnl check the pdf generation option
  5492. dnl if enabled or disabled, directly controlled
  5493. dnl
  5494. AC_DEFUN([AC_PDF_GENERATION], [
  5495. AC_MSG_CHECKING(if the PDF document generation is desired)
  5496. AC_ARG_ENABLE( pdf-docs,
  5497. [ --enable-pdf-docs enable generation of PDF documents (default=auto)],
  5498. enable_pdfdocs="$enableval",
  5499. enable_pdfdocs="auto")
  5500. AC_MSG_RESULT($enable_pdfdocs)
  5501. if test "x$enable_pdfdocs" != "xno"; then
  5502. AC_CHECK_PROG(found_recode, recode, yes, no)
  5503. AC_CHECK_PROG(found_html2ps, html2ps, yes, no)
  5504. AC_CHECK_PROG(found_ps2pdf, ps2pdf, yes, no)
  5505. if test "x$found_recode" != "xyes" && "x$found_html2ps" != "xyes" && "x$found_ps2pdf" != "xyes"; then
  5506. if test "x$enable_pdfdocs" = "xyes"; then
  5507. AC_MSG_ERROR(At least one of the tools for PDF generation is missing)
  5508. fi
  5509. enable_pdfdocs="no"
  5510. else
  5511. enable_pdfdocs="yes"
  5512. fi
  5513. fi
  5514. AM_CONDITIONAL(GENERATE_PDF, test "x$enable_pdfdocs" = "xyes")
  5515. ])
  5516. dnl Macro to check for KDChart include and library files
  5517. dnl Availability of KDChart defaults to 'no'
  5518. AC_DEFUN([AC_TQTDESIGNER_SUPPORT],
  5519. [
  5520. AC_MSG_CHECKING([if library for TQt-Designer widgets should be installed])
  5521. AC_ARG_ENABLE(tqtdesigner,
  5522. AC_HELP_STRING([--enable-tqtdesigner],[Install KMyMoney specific widget library for TQt-Designer (default=no)]),
  5523. [
  5524. enable_tqtdesigner="$enableval"
  5525. AC_MSG_RESULT($enable_tqtdesigner)
  5526. ],
  5527. [
  5528. enable_tqtdesigner="no"
  5529. AC_MSG_RESULT($enable_tqtdesigner)
  5530. ])
  5531. AM_CONDITIONAL(INSTALL_TQTDESIGNER_SUPPORT, test "$enable_tqtdesigner" = "yes")
  5532. ])
  5533. # sqlite3.m4
  5534. # ----------
  5535. #
  5536. # Copyright 2008 by Thomas Baumgart
  5537. #
  5538. # License: See file COPYING
  5539. #
  5540. # Checks for the necessity to build our own tqt-sqlite3 support library
  5541. # and the presence of the sqlite3 development headers.
  5542. #
  5543. # Supports the following options:
  5544. #
  5545. # --enable-sqlite3
  5546. # --disable-sqlite3
  5547. #
  5548. # If none of them is present, the detection is automatic. If the development
  5549. # headers are not found for automatic detection, the generation will be
  5550. # disabled w/o error. If --enable-sqlite3 is provided in the same stage,
  5551. # an error is given if the sqlite3 development files are not installed.
  5552. #
  5553. # The following variables are provided via AC_SUBST:
  5554. #
  5555. # SQLITE3 - contains the subdirectory to visit for compilation
  5556. # LIBSQLITE3 - contains the full pathname for the TQt plugin driver
  5557. AC_DEFUN([AC_SQLITE3], [
  5558. AC_MSG_CHECKING(if the SQLITE3 support is desired)
  5559. AC_ARG_ENABLE(sqlite3,
  5560. AC_HELP_STRING([--enable-sqlite3],[build SQLITE3 support library (default=auto)]),
  5561. enable_sqlite3="$enableval",
  5562. enable_sqlite3="auto")
  5563. AC_MSG_RESULT($enable_sqlite3)
  5564. if test ! $enable_sqlite3 = no; then
  5565. # determine name and path of sqlite3 plugin library
  5566. tqtlib=""
  5567. if test ! "lib${tdelibsuff}" = "lib"; then
  5568. tqtlib=".lib64"
  5569. fi
  5570. if test x$TQTDIR = x; then
  5571. TQTDIR=`dirname $MOC`
  5572. TQTDIR=${TQTDIR%/bin}
  5573. fi
  5574. if test "$PKG_CONFIG" != "no" ; then
  5575. if $PKG_CONFIG --exists tqt-mt ; then
  5576. tqt_plugins_dir="`pkg-config --variable=pluginsdir tqt-mt`"
  5577. fi
  5578. fi
  5579. if test "x$tqt_plugins_dir" = "x"; then
  5580. tqt_plugins_dir=${TQTDIR}/plugins
  5581. fi
  5582. LIBSQLITE3=${tqt_plugins_dir}/sqldrivers/libqsqlite3${tqtlib}.so
  5583. # do the checks
  5584. if test $enable_sqlite3 = auto; then
  5585. AC_MSG_CHECKING(if the SQLITE3 support is already present)
  5586. if test ! -e ${LIBSQLITE3}; then
  5587. result=no
  5588. else
  5589. # add check for local tqt-sqlite3 directory here
  5590. result=yes
  5591. enable_sqlite3=no
  5592. # in case a previous run unpacked the SQLITE3 support stuff
  5593. # it is pretty sure that we have build the existing support
  5594. # if that's the case, we just enable it again
  5595. if test -d tqt-sqlite3-0.2; then
  5596. enable_sqlite3=auto
  5597. fi
  5598. fi
  5599. AC_MSG_RESULT($result)
  5600. fi
  5601. # we only need to check for the headers in case we need to build
  5602. if test ! $enable_sqlite3 = no; then
  5603. # now check for the presence of SQLITE libraries
  5604. AC_CHECK_HEADER([sqlite3.h], [enable_sqlite3=yes],
  5605. [
  5606. if test $enable_sqlite3 = auto; then
  5607. enable_sqlite3=no
  5608. else
  5609. AC_MSG_ERROR(SQLITE development files not found)
  5610. fi
  5611. ])
  5612. fi
  5613. fi
  5614. if test $enable_sqlite3 = yes; then
  5615. AC_MSG_CHECKING(if the environment variable TQTDIR is set)
  5616. if test x$TQTDIR = x; then
  5617. AC_MSG_ERROR(TQTDIR not set)
  5618. fi
  5619. AC_MSG_RESULT($TQTDIR)
  5620. ac_qmake=${TQTDIR}/bin/qmake
  5621. AC_ARG_WITH(qmake,
  5622. AC_HELP_STRING([--with-qmake=PATH],[which version of QMake to use ]),
  5623. [ ac_qmake="$withval" ])
  5624. fi
  5625. if test $enable_sqlite3 = yes; then
  5626. rm -rf tqt-sqlite3-0.2
  5627. gunzip -c `dirname -- ${0}`/23011-tqt-sqlite3-0.2.tar.gz | tar -xf -
  5628. cd tqt-sqlite3-0.2
  5629. ${ac_qmake} QMAKE=${ac_qmake}
  5630. SQLITE3=tqt-sqlite3-0.2
  5631. sed -i s/^install:.*$// Makefile
  5632. sed -i s/^uninstall:.*$// Makefile
  5633. # create the targets required for 'make distcheck' and 'make [un]install'
  5634. cat >> Makefile <<EOF
  5635. dvi:
  5636. check:
  5637. installcheck:
  5638. distuninstallcheck:
  5639. dist:
  5640. distcleancheck:
  5641. # for installation and de-installation we need to take care
  5642. # of the _inst case which is caused by running 'make distcheck'
  5643. install:
  5644. if test ! x$SQLITE3 = x; then \
  5645. if test "x\$(DESTDIR)" = "x" -a "${prefix:0-5}" = "_inst"; then \
  5646. /bin/sh ../$ac_aux_dir/mkinstalldirs \`dirname ${prefix}${LIBSQLITE3}\`; \
  5647. ${INSTALL} sqldrivers/libqsqlite3.so ${prefix}${LIBSQLITE3}; \
  5648. chmod 755 ${prefix}${LIBSQLITE3}; \
  5649. else \
  5650. /bin/sh ../$ac_aux_dir/mkinstalldirs \`dirname \$(DESTDIR)${LIBSQLITE3}\`; \
  5651. ${INSTALL} sqldrivers/libqsqlite3.so \$(DESTDIR)${LIBSQLITE3}; \
  5652. chmod 755 \$(DESTDIR)${LIBSQLITE3}; \
  5653. fi \
  5654. fi
  5655. uninstall:
  5656. if test ! x$SQLITE3 = x; then \
  5657. if test "x\$(DESTDIR)" = "x" -a "${prefix:0-5}" = "_inst"; then \
  5658. rm -rf ${prefix}${LIBSQLITE3}; \
  5659. else \
  5660. rm -rf \$(DESTDIR)${LIBSQLITE3}; \
  5661. fi \
  5662. fi
  5663. EOF
  5664. cd ..
  5665. AC_SUBST(SQLITE3)
  5666. AC_SUBST(LIBSQLITE3)
  5667. fi
  5668. ])