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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452
  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. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3160. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3161. ])
  3162. dnl This is a merge of some macros out of the gettext aclocal.m4
  3163. dnl since we don't need anything, I took the things we need
  3164. dnl the copyright for them is:
  3165. dnl >
  3166. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3167. dnl This Makefile.in is free software; the Free Software Foundation
  3168. dnl gives unlimited permission to copy and/or distribute it,
  3169. dnl with or without modifications, as long as this notice is preserved.
  3170. dnl This program is distributed in the hope that it will be useful,
  3171. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3172. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3173. dnl PARTICULAR PURPOSE.
  3174. dnl >
  3175. dnl for this file it is relicensed under LGPL
  3176. AC_DEFUN([AM_KDE_WITH_NLS],
  3177. [
  3178. dnl If we use NLS figure out what method
  3179. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3180. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3181. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3182. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3183. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3184. GMSGFMT=":"
  3185. fi
  3186. MSGFMT=$GMSGFMT
  3187. AC_SUBST(GMSGFMT)
  3188. AC_SUBST(MSGFMT)
  3189. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3190. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3191. dnl Test whether we really found GNU xgettext.
  3192. if test "$XGETTEXT" != ":"; then
  3193. dnl If it is no GNU xgettext we define it as : so that the
  3194. dnl Makefiles still can work.
  3195. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3196. : ;
  3197. else
  3198. AC_MSG_RESULT(
  3199. [found xgettext programs is not GNU xgettext; ignore it])
  3200. XGETTEXT=":"
  3201. fi
  3202. fi
  3203. AC_SUBST(XGETTEXT)
  3204. ])
  3205. # Search path for a program which passes the given test.
  3206. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3207. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3208. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3209. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3210. [# Extract the first word of "$2", so it can be a program name with args.
  3211. set dummy $2; ac_word=[$]2
  3212. AC_MSG_CHECKING([for $ac_word])
  3213. AC_CACHE_VAL(ac_cv_path_$1,
  3214. [case "[$]$1" in
  3215. /*)
  3216. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3217. ;;
  3218. *)
  3219. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3220. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3221. test -z "$ac_dir" && ac_dir=.
  3222. if test -f $ac_dir/$ac_word; then
  3223. if [$3]; then
  3224. ac_cv_path_$1="$ac_dir/$ac_word"
  3225. break
  3226. fi
  3227. fi
  3228. done
  3229. IFS="$ac_save_ifs"
  3230. dnl If no 4th arg is given, leave the cache variable unset,
  3231. dnl so AC_PATH_PROGS will keep looking.
  3232. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3233. ])dnl
  3234. ;;
  3235. esac])dnl
  3236. $1="$ac_cv_path_$1"
  3237. if test -n "[$]$1"; then
  3238. AC_MSG_RESULT([$]$1)
  3239. else
  3240. AC_MSG_RESULT(no)
  3241. fi
  3242. AC_SUBST($1)dnl
  3243. ])
  3244. # Check whether LC_MESSAGES is available in <locale.h>.
  3245. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3246. AC_DEFUN([AM_LC_MESSAGES],
  3247. [if test $ac_cv_header_locale_h = yes; then
  3248. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3249. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3250. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3251. if test $am_cv_val_LC_MESSAGES = yes; then
  3252. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3253. fi
  3254. fi])
  3255. dnl From Jim Meyering.
  3256. dnl FIXME: migrate into libit.
  3257. AC_DEFUN([AM_FUNC_OBSTACK],
  3258. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3259. [AC_TRY_LINK([#include "obstack.h"],
  3260. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3261. am_cv_func_obstack=yes,
  3262. am_cv_func_obstack=no)])
  3263. if test $am_cv_func_obstack = yes; then
  3264. AC_DEFINE(HAVE_OBSTACK)
  3265. else
  3266. LIBOBJS="$LIBOBJS obstack.o"
  3267. fi
  3268. ])
  3269. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3270. dnl FIXME: Migrate into libit
  3271. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3272. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3273. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3274. am_cv_lib_error_at_line=yes,
  3275. am_cv_lib_error_at_line=no)])
  3276. if test $am_cv_lib_error_at_line = no; then
  3277. LIBOBJS="$LIBOBJS error.o"
  3278. fi
  3279. AC_SUBST(LIBOBJS)dnl
  3280. ])
  3281. # Macro to add for using GNU gettext.
  3282. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3283. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3284. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3285. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3286. AC_REQUIRE([AC_HEADER_STDC])dnl
  3287. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3288. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3289. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3290. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3291. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3292. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3293. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3294. __argz_count __argz_stringify __argz_next])
  3295. AC_MSG_CHECKING(for stpcpy)
  3296. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3297. [
  3298. kde_safe_cxxflags=$CXXFLAGS
  3299. CXXFLAGS="-Werror"
  3300. AC_LANG_SAVE
  3301. AC_LANG_CPLUSPLUS
  3302. AC_TRY_COMPILE([
  3303. #include <string.h>
  3304. ],
  3305. [
  3306. char buffer[200];
  3307. stpcpy(buffer, buffer);
  3308. ],
  3309. kde_cv_func_stpcpy=yes,
  3310. kde_cv_func_stpcpy=no)
  3311. AC_LANG_RESTORE
  3312. CXXFLAGS=$kde_safe_cxxflags
  3313. ])
  3314. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3315. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3316. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3317. fi
  3318. AM_LC_MESSAGES
  3319. if test "x$CATOBJEXT" != "x"; then
  3320. if test "x$ALL_LINGUAS" = "x"; then
  3321. LINGUAS=
  3322. else
  3323. AC_MSG_CHECKING(for catalogs to be installed)
  3324. NEW_LINGUAS=
  3325. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3326. case "$ALL_LINGUAS" in
  3327. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3328. esac
  3329. done
  3330. LINGUAS=$NEW_LINGUAS
  3331. AC_MSG_RESULT($LINGUAS)
  3332. fi
  3333. dnl Construct list of names of catalog files to be constructed.
  3334. if test -n "$LINGUAS"; then
  3335. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3336. fi
  3337. fi
  3338. ])
  3339. AC_DEFUN([AC_HAVE_XPM],
  3340. [AC_REQUIRE_CPP()dnl
  3341. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3342. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3343. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3344. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3345. xpm_test=$withval, xpm_test="yes")
  3346. if test "x$xpm_test" = xno; then
  3347. ac_cv_have_xpm=no
  3348. else
  3349. AC_MSG_CHECKING(for XPM)
  3350. AC_CACHE_VAL(ac_cv_have_xpm,
  3351. [
  3352. ac_save_ldflags="$LDFLAGS"
  3353. ac_save_cflags="$CFLAGS"
  3354. if test "x$kde_use_tqt_emb" != "xyes" && test "x$kde_use_tqt_mac" != "xyes"; then
  3355. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3356. else
  3357. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3358. fi
  3359. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3360. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3361. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3362. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3363. LDFLAGS="$ac_save_ldflags"
  3364. CFLAGS="$ac_save_cflags"
  3365. ])dnl
  3366. if test "$ac_cv_have_xpm" = no; then
  3367. AC_MSG_RESULT(no)
  3368. XPM_LDFLAGS=""
  3369. XPMINC=""
  3370. $2
  3371. else
  3372. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3373. if test "$XPM_LDFLAGS" = ""; then
  3374. XPMLIB='-lXpm $(LIB_X11)'
  3375. else
  3376. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3377. fi
  3378. if test "$XPM_INCLUDE" = ""; then
  3379. XPMINC=""
  3380. else
  3381. XPMINC="-I$XPM_INCLUDE"
  3382. fi
  3383. AC_MSG_RESULT(yes)
  3384. $1
  3385. fi
  3386. fi
  3387. AC_SUBST(XPMINC)
  3388. AC_SUBST(XPMLIB)
  3389. ])
  3390. AC_DEFUN([AC_HAVE_DPMS],
  3391. [AC_REQUIRE_CPP()dnl
  3392. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3393. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3394. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3395. DPMS_LIB=
  3396. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3397. dpms_test=$withval, dpms_test="yes")
  3398. if test "x$dpms_test" = xno; then
  3399. ac_cv_have_dpms=no
  3400. else
  3401. AC_MSG_CHECKING(for DPMS)
  3402. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3403. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3404. AC_CACHE_VAL(ac_cv_have_dpms,
  3405. [
  3406. if test "x$kde_use_tqt_emb" = "xyes" || test "x$kde_use_tqt_mac" = "xyes"; then
  3407. AC_MSG_RESULT(no)
  3408. ac_cv_have_dpms="no"
  3409. else
  3410. ac_save_ldflags="$LDFLAGS"
  3411. ac_save_cflags="$CFLAGS"
  3412. ac_save_libs="$LIBS"
  3413. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3414. LIBS="-lX11 -lXext $LIBSOCKET"
  3415. CFLAGS="$CFLAGS $X_INCLUDES"
  3416. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3417. AC_TRY_LINK([
  3418. #include <X11/Xproto.h>
  3419. #include <X11/X.h>
  3420. #include <X11/Xlib.h>
  3421. #include <X11/extensions/dpms.h>
  3422. int foo_test_dpms()
  3423. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3424. ac_cv_have_dpms="yes", [
  3425. LIBS="-lXdpms $LIBS"
  3426. AC_TRY_LINK([
  3427. #include <X11/Xproto.h>
  3428. #include <X11/X.h>
  3429. #include <X11/Xlib.h>
  3430. #include <X11/extensions/dpms.h>
  3431. int foo_test_dpms()
  3432. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3433. [
  3434. ac_cv_have_dpms="-lXdpms"
  3435. ],ac_cv_have_dpms="no")
  3436. ])
  3437. LDFLAGS="$ac_save_ldflags"
  3438. CFLAGS="$ac_save_cflags"
  3439. LIBS="$ac_save_libs"
  3440. fi
  3441. ])dnl
  3442. if test "$ac_cv_have_dpms" = no; then
  3443. AC_MSG_RESULT(no)
  3444. DPMS_LDFLAGS=""
  3445. DPMSINC=""
  3446. $2
  3447. else
  3448. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3449. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3450. DPMS_LIB="-lXdpms"
  3451. fi
  3452. if test "$DPMS_LDFLAGS" = ""; then
  3453. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3454. else
  3455. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3456. fi
  3457. if test "$DPMS_INCLUDE" = ""; then
  3458. DPMSINC=""
  3459. else
  3460. DPMSINC="-I$DPMS_INCLUDE"
  3461. fi
  3462. AC_MSG_RESULT(yes)
  3463. $1
  3464. fi
  3465. fi
  3466. ac_save_cflags="$CFLAGS"
  3467. CFLAGS="$CFLAGS $X_INCLUDES"
  3468. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3469. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3470. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3471. AC_CHECK_DECL(DPMSCapable,
  3472. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3473. [#include <X11/Xlib.h>
  3474. #include <X11/extensions/dpms.h>])
  3475. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3476. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3477. AC_CHECK_DECL(DPMSInfo,
  3478. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3479. [#include <X11/Xlib.h>
  3480. #include <X11/extensions/dpms.h>])
  3481. CFLAGS="$ac_save_cflags"
  3482. AC_SUBST(DPMSINC)
  3483. AC_SUBST(DPMSLIB)
  3484. ])
  3485. AC_DEFUN([AC_HAVE_GL],
  3486. [AC_REQUIRE_CPP()dnl
  3487. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3488. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3489. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3490. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3491. gl_test=$withval, gl_test="yes")
  3492. if test "x$kde_use_tqt_emb" = "xyes"; then
  3493. # GL and TQt Embedded is a no-go for now.
  3494. ac_cv_have_gl=no
  3495. elif test "x$gl_test" = xno; then
  3496. ac_cv_have_gl=no
  3497. else
  3498. AC_MSG_CHECKING(for GL)
  3499. AC_CACHE_VAL(ac_cv_have_gl,
  3500. [
  3501. AC_LANG_SAVE
  3502. AC_LANG_CPLUSPLUS
  3503. ac_save_ldflags=$LDFLAGS
  3504. ac_save_cxxflags=$CXXFLAGS
  3505. ac_save_libs=$LIBS
  3506. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3507. LIBS="$LIBS -L/usr/lib/mesa -lGL -lGLU"
  3508. test "x$kde_use_tqt_mac" != xyes && test "x$kde_use_tqt_emb" != xyes && LIBS="$LIBS -lX11"
  3509. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3510. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3511. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3512. AC_TRY_LINK([#include <GL/gl.h>
  3513. #include <GL/glu.h>
  3514. ], [],
  3515. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3516. AC_LANG_RESTORE
  3517. LDFLAGS=$ac_save_ldflags
  3518. CXXFLAGS=$ac_save_cxxflags
  3519. LIBS=$ac_save_libs
  3520. ])dnl
  3521. if test "$ac_cv_have_gl" = "no"; then
  3522. AC_MSG_RESULT(no)
  3523. GL_LDFLAGS=""
  3524. GLINC=""
  3525. $2
  3526. else
  3527. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3528. if test "$GL_LDFLAGS" = ""; then
  3529. GLLIB='-L/usr/lib/mesa -lGLU -lGL $(LIB_X11)'
  3530. else
  3531. GLLIB="$GL_LDFLAGS -L/usr/lib/mesa -lGLU -lGL "'$(LIB_X11)'
  3532. fi
  3533. if test "$GL_INCLUDE" = ""; then
  3534. GLINC=""
  3535. else
  3536. GLINC="-I$GL_INCLUDE"
  3537. fi
  3538. AC_MSG_RESULT($ac_cv_have_gl)
  3539. $1
  3540. fi
  3541. fi
  3542. AC_SUBST(GLINC)
  3543. AC_SUBST(GLLIB)
  3544. ])
  3545. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3546. AC_DEFUN([KDE_PAM], [
  3547. AC_REQUIRE([KDE_CHECK_LIBDL])
  3548. want_pam=
  3549. AC_ARG_WITH(pam,
  3550. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3551. [ if test "x$withval" = "xyes"; then
  3552. want_pam=yes
  3553. pam_service=tde
  3554. elif test "x$withval" = "xno"; then
  3555. want_pam=no
  3556. else
  3557. want_pam=yes
  3558. pam_service=$withval
  3559. fi
  3560. ], [ pam_service=tde ])
  3561. use_pam=
  3562. PAMLIBS=
  3563. if test "x$want_pam" != xno; then
  3564. AC_CHECK_LIB(pam, pam_start, [
  3565. AC_CHECK_HEADER(security/pam_appl.h,
  3566. [ pam_header=security/pam_appl.h ],
  3567. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3568. [ pam_header=pam/pam_appl.h ],
  3569. [
  3570. AC_MSG_WARN([PAM detected, but no headers found!
  3571. Make sure you have the necessary development packages installed.])
  3572. ]
  3573. )
  3574. ]
  3575. )
  3576. ], , $LIBDL)
  3577. if test -z "$pam_header"; then
  3578. if test "x$want_pam" = xyes; then
  3579. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3580. fi
  3581. else
  3582. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3583. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3584. use_pam=yes
  3585. dnl darwin claims to be something special
  3586. if test "$pam_header" = "pam/pam_appl.h"; then
  3587. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3588. fi
  3589. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3590. AC_MSG_CHECKING(for const pam_message)
  3591. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3592. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3593. [AC_MSG_RESULT([const: Linux-type PAM])],
  3594. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3595. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3596. )],
  3597. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3598. fi
  3599. fi
  3600. AC_SUBST(PAMLIBS)
  3601. ])
  3602. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3603. AC_DEFUN([DEF_PAM_SERVICE], [
  3604. AC_ARG_WITH($1-pam,
  3605. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3606. [ if test "x$use_pam" = xyes; then
  3607. $3_PAM_SERVICE=$withval
  3608. else
  3609. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3610. You may want to enforce it by using --with-pam.])
  3611. fi
  3612. ],
  3613. [ if test "x$use_pam" = xyes; then
  3614. $3_PAM_SERVICE="$pam_service"
  3615. fi
  3616. ])
  3617. if test -n "$$3_PAM_SERVICE"; then
  3618. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3619. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3620. fi
  3621. AC_SUBST($3_PAM_SERVICE)
  3622. ])
  3623. AC_DEFUN([KDE_SHADOWPASSWD], [
  3624. AC_REQUIRE([KDE_PAM])
  3625. AC_CHECK_LIB(shadow, getspent,
  3626. [ LIBSHADOW="-lshadow"
  3627. ac_use_shadow=yes
  3628. ],
  3629. [ dnl for UnixWare
  3630. AC_CHECK_LIB(gen, getspent,
  3631. [ LIBGEN="-lgen"
  3632. ac_use_shadow=yes
  3633. ],
  3634. [ AC_CHECK_FUNC(getspent,
  3635. [ ac_use_shadow=yes ],
  3636. [ ac_use_shadow=no ])
  3637. ])
  3638. ])
  3639. AC_SUBST(LIBSHADOW)
  3640. AC_SUBST(LIBGEN)
  3641. AC_MSG_CHECKING([for shadow passwords])
  3642. AC_ARG_WITH(shadow,
  3643. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3644. [ if test "x$withval" != "xno"; then
  3645. use_shadow=yes
  3646. else
  3647. use_shadow=no
  3648. fi
  3649. ], [
  3650. use_shadow="$ac_use_shadow"
  3651. ])
  3652. if test "x$use_shadow" = xyes; then
  3653. AC_MSG_RESULT(yes)
  3654. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3655. else
  3656. AC_MSG_RESULT(no)
  3657. LIBSHADOW=
  3658. LIBGEN=
  3659. fi
  3660. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3661. dnl this still applies, if we could use it indirectly through pam.
  3662. if test "x$use_shadow" = xyes ||
  3663. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3664. case $host in
  3665. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3666. SETUIDFLAGS="-m 4755 -o root";;
  3667. *)
  3668. SETUIDFLAGS="-m 4755";;
  3669. esac
  3670. fi
  3671. AC_SUBST(SETUIDFLAGS)
  3672. ])
  3673. AC_DEFUN([KDE_PASSWDLIBS], [
  3674. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3675. AC_REQUIRE([KDE_PAM])
  3676. AC_REQUIRE([KDE_SHADOWPASSWD])
  3677. if test "x$use_pam" = "xyes"; then
  3678. PASSWDLIBS="$PAMLIBS"
  3679. else
  3680. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3681. fi
  3682. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3683. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3684. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3685. dnl may need to read /etc/master.passwd).
  3686. case $host in
  3687. *-*-freebsd*)
  3688. SETUIDFLAGS="-m 4755 -o root"
  3689. ;;
  3690. *)
  3691. ;;
  3692. esac
  3693. AC_SUBST(PASSWDLIBS)
  3694. ])
  3695. AC_DEFUN([KDE_CHECK_LIBDL],
  3696. [
  3697. AC_CHECK_LIB(dl, dlopen, [
  3698. LIBDL="-ldl"
  3699. ac_cv_have_dlfcn=yes
  3700. ])
  3701. AC_CHECK_LIB(dld, shl_unload, [
  3702. LIBDL="-ldld"
  3703. ac_cv_have_shload=yes
  3704. ])
  3705. AC_SUBST(LIBDL)
  3706. ])
  3707. AC_DEFUN([KDE_CHECK_DLOPEN],
  3708. [
  3709. KDE_CHECK_LIBDL
  3710. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3711. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3712. ac_cv_have_dlfcn=no
  3713. fi
  3714. if test "$ac_cv_header_dl_h" = "no"; then
  3715. ac_cv_have_shload=no
  3716. fi
  3717. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3718. dnl (MM)
  3719. AC_ARG_ENABLE(dlopen,
  3720. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3721. enable_dlopen=$enableval,
  3722. enable_dlopen=yes)
  3723. # override the user's opinion, if we know it better ;)
  3724. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3725. enable_dlopen=no
  3726. fi
  3727. if test "$ac_cv_have_dlfcn" = "yes"; then
  3728. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3729. fi
  3730. if test "$ac_cv_have_shload" = "yes"; then
  3731. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3732. fi
  3733. if test "$enable_dlopen" = no ; then
  3734. test -n "$1" && eval $1
  3735. else
  3736. test -n "$2" && eval $2
  3737. fi
  3738. ])
  3739. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3740. [
  3741. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3742. KDE_PROG_LIBTOOL
  3743. AC_MSG_CHECKING([dynamic loading])
  3744. eval "`egrep '^build_libtool_libs=' libtool`"
  3745. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3746. dynamic_loading=yes
  3747. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3748. else
  3749. dynamic_loading=no
  3750. fi
  3751. AC_MSG_RESULT($dynamic_loading)
  3752. if test "$dynamic_loading" = "yes"; then
  3753. $1
  3754. else
  3755. $2
  3756. fi
  3757. ])
  3758. AC_DEFUN([KDE_ADD_INCLUDES],
  3759. [
  3760. if test -z "$1"; then
  3761. test_include="Pix.h"
  3762. else
  3763. test_include="$1"
  3764. fi
  3765. AC_MSG_CHECKING([for libg++ ($test_include)])
  3766. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3767. [
  3768. kde_cv_libgpp_includes=no
  3769. for ac_dir in \
  3770. \
  3771. /usr/include/g++ \
  3772. /usr/include \
  3773. /usr/unsupported/include \
  3774. /opt/include \
  3775. $extra_include \
  3776. ; \
  3777. do
  3778. if test -r "$ac_dir/$test_include"; then
  3779. kde_cv_libgpp_includes=$ac_dir
  3780. break
  3781. fi
  3782. done
  3783. ])
  3784. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3785. if test "$kde_cv_libgpp_includes" != "no"; then
  3786. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3787. fi
  3788. ])
  3789. ])
  3790. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3791. [
  3792. dnl This code is here specifically to handle the
  3793. dnl various flavors of threading library on FreeBSD
  3794. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3795. dnl There may be an environment PTHREAD_LIBS that
  3796. dnl specifies what to use; otherwise, search for it.
  3797. dnl -pthread is special cased and unsets LIBPTHREAD
  3798. dnl below if found.
  3799. LIBPTHREAD=""
  3800. if test -n "$PTHREAD_LIBS"; then
  3801. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3802. LIBPTHREAD="PTHREAD"
  3803. else
  3804. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3805. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3806. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3807. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3808. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3809. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3810. fi
  3811. fi
  3812. dnl Is this test really needed, in the face of the Tru64 test below?
  3813. if test -z "$LIBPTHREAD"; then
  3814. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3815. fi
  3816. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3817. if test -z "$LIBPTHREAD" ; then
  3818. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3819. kde_safe_libs=$LIBS
  3820. LIBS="$LIBS -lpthread"
  3821. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3822. AC_MSG_RESULT(yes)
  3823. LIBPTHREAD="-lpthread"],[
  3824. AC_MSG_RESULT(no)])
  3825. LIBS=$kde_safe_libs
  3826. fi
  3827. dnl Un-special-case for FreeBSD.
  3828. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3829. LIBPTHREAD=""
  3830. fi
  3831. AC_SUBST(LIBPTHREAD)
  3832. ])
  3833. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3834. [
  3835. USE_THREADS=""
  3836. if test -z "$LIBPTHREAD"; then
  3837. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3838. fi
  3839. AH_VERBATIM(__svr_define, [
  3840. #if defined(__SVR4) && !defined(__svr4__)
  3841. #define __svr4__ 1
  3842. #endif
  3843. ])
  3844. case $host_os in
  3845. solaris*)
  3846. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3847. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3848. ;;
  3849. freebsd*)
  3850. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3851. ;;
  3852. aix*)
  3853. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3854. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3855. ;;
  3856. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3857. if test "$CXX" = "KCC"; then
  3858. CXXFLAGS="$CXXFLAGS --thread_safe"
  3859. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3860. fi
  3861. ;;
  3862. *)
  3863. ;;
  3864. esac
  3865. AC_SUBST(USE_THREADS)
  3866. AC_SUBST(LIBPTHREAD)
  3867. ])
  3868. AC_DEFUN([KDE_CHECK_THREADING],
  3869. [
  3870. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3871. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3872. dnl default is yes if libpthread is found and no if no libpthread is available
  3873. if test -z "$LIBPTHREAD"; then
  3874. if test -z "$USE_THREADS"; then
  3875. kde_check_threading_default=no
  3876. else
  3877. kde_check_threading_default=yes
  3878. fi
  3879. else
  3880. kde_check_threading_default=yes
  3881. fi
  3882. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3883. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3884. if test "x$kde_use_threading" = "xyes"; then
  3885. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3886. fi
  3887. ])
  3888. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3889. [
  3890. if test "$kde_python_link_found" = no; then
  3891. if test "$1" = normal; then
  3892. AC_MSG_CHECKING(if a Python application links)
  3893. else
  3894. AC_MSG_CHECKING(if Python depends on $2)
  3895. fi
  3896. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3897. [
  3898. kde_save_cflags="$CFLAGS"
  3899. CFLAGS="$CFLAGS $PYTHONINC"
  3900. kde_save_libs="$LIBS"
  3901. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3902. kde_save_ldflags="$LDFLAGS"
  3903. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3904. AC_TRY_LINK(
  3905. [
  3906. #include <Python.h>
  3907. ],[
  3908. PySys_SetArgv(1, 0);
  3909. ],
  3910. [kde_cv_try_link_python_$1=yes],
  3911. [kde_cv_try_link_python_$1=no]
  3912. )
  3913. CFLAGS="$kde_save_cflags"
  3914. LIBS="$kde_save_libs"
  3915. LDFLAGS="$kde_save_ldflags"
  3916. ])
  3917. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3918. AC_MSG_RESULT(yes)
  3919. kde_python_link_found=yes
  3920. if test ! "$1" = normal; then
  3921. LIBPYTHON="$LIBPYTHON $2"
  3922. fi
  3923. $3
  3924. else
  3925. AC_MSG_RESULT(no)
  3926. $4
  3927. fi
  3928. fi
  3929. ])
  3930. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3931. [
  3932. AC_MSG_CHECKING([for Python directory])
  3933. AC_CACHE_VAL(kde_cv_pythondir,
  3934. [
  3935. if test -z "$PYTHONDIR"; then
  3936. kde_cv_pythondir=/usr/local
  3937. else
  3938. kde_cv_pythondir="$PYTHONDIR"
  3939. fi
  3940. ])
  3941. AC_ARG_WITH(pythondir,
  3942. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3943. [
  3944. ac_python_dir=$withval
  3945. ], ac_python_dir=$kde_cv_pythondir
  3946. )
  3947. AC_MSG_RESULT($ac_python_dir)
  3948. ])
  3949. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  3950. [
  3951. AC_REQUIRE([KDE_CHECK_LIBDL])
  3952. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3953. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3954. if test -z "$1"; then
  3955. version="1.5"
  3956. else
  3957. version="$1"
  3958. fi
  3959. AC_MSG_CHECKING([for Python$version])
  3960. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  3961. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  3962. if test ! -r $python_incdir/Python.h; then
  3963. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  3964. python_incdir=$python_incdir/python$version
  3965. if test ! -r $python_incdir/Python.h; then
  3966. python_incdir=no
  3967. fi
  3968. fi
  3969. PYTHONINC=-I$python_incdir
  3970. python_multiarch_libdirs="`find /usr/lib/ -maxdepth 1 -type d | xargs echo`"
  3971. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $python_multiarch_libdirs $kde_extra_libs"
  3972. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  3973. if test ! -r $python_libdir/libpython$version.so; then
  3974. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  3975. if test ! -r $python_libdir/libpython$version.a; then
  3976. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  3977. python_libdir=$python_libdir/python$version/config
  3978. if test ! -r $python_libdir/libpython$version.a; then
  3979. python_libdir=no
  3980. fi
  3981. fi
  3982. fi
  3983. PYTHONLIB=-L$python_libdir
  3984. kde_orig_LIBPYTHON=$LIBPYTHON
  3985. if test -z "$LIBPYTHON"; then
  3986. LIBPYTHON=-lpython$version
  3987. fi
  3988. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  3989. python_moddir=$python_moddir/python$version
  3990. if test ! -r $python_moddir/copy.py; then
  3991. python_moddir=no
  3992. fi
  3993. PYTHONMODDIR=$python_moddir
  3994. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  3995. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  3996. LIBPYTHON=$kde_orig_LIBPYTHON
  3997. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  3998. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  3999. $2
  4000. else
  4001. dnl Note: this test is very weak
  4002. kde_python_link_found=no
  4003. KDE_TRY_LINK_PYTHON(normal)
  4004. KDE_TRY_LINK_PYTHON(m, -lm)
  4005. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4006. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4007. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4008. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4009. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4010. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4011. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4012. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4013. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4014. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4015. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4016. [AC_MSG_WARN([it seems, Python depends on another library.
  4017. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4018. and contact the authors to let them know about this problem])
  4019. ])
  4020. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4021. AC_SUBST(PYTHONINC)
  4022. AC_SUBST(PYTHONLIB)
  4023. AC_SUBST(LIBPYTHON)
  4024. AC_SUBST(PYTHONMODDIR)
  4025. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4026. fi
  4027. ])
  4028. AC_DEFUN([KDE_CHECK_PYTHON],
  4029. [
  4030. KDE_CHECK_PYTHON_INTERN("2.7",
  4031. [KDE_CHECK_PYTHON_INTERN("2.6",
  4032. [KDE_CHECK_PYTHON_INTERN("2.5",
  4033. [KDE_CHECK_PYTHON_INTERN("2.4",
  4034. [KDE_CHECK_PYTHON_INTERN("2.3",
  4035. [KDE_CHECK_PYTHON_INTERN("2.2",
  4036. [KDE_CHECK_PYTHON_INTERN("2.1",
  4037. [KDE_CHECK_PYTHON_INTERN("2.0",
  4038. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4039. ])
  4040. ])
  4041. ])
  4042. ])
  4043. ])
  4044. ])
  4045. ])
  4046. ])
  4047. AC_DEFUN([KDE_CHECK_STL],
  4048. [
  4049. AC_LANG_SAVE
  4050. AC_LANG_CPLUSPLUS
  4051. ac_save_CXXFLAGS="$CXXFLAGS"
  4052. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4053. if test -z "$tqt_includes"; then
  4054. CXXFLAGS="$CXXFLAGS"
  4055. else
  4056. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  4057. fi
  4058. AC_MSG_CHECKING([if C++ programs can be compiled])
  4059. AC_CACHE_VAL(kde_cv_stl_works,
  4060. [
  4061. AC_TRY_COMPILE([
  4062. #include <string>
  4063. using namespace std;
  4064. ],[
  4065. string astring="Hallo Welt.";
  4066. astring.erase(0, 6); // now astring is "Welt"
  4067. return 0;
  4068. ], kde_cv_stl_works=yes,
  4069. kde_cv_stl_works=no)
  4070. ])
  4071. AC_MSG_RESULT($kde_cv_stl_works)
  4072. if test "$kde_cv_stl_works" = "yes"; then
  4073. # back compatible
  4074. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4075. else
  4076. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4077. Check config.log for details - if you're using a Linux distribution you might miss
  4078. a package named similar to libstdc++-dev.])
  4079. fi
  4080. CXXFLAGS="$ac_save_CXXFLAGS"
  4081. AC_LANG_RESTORE
  4082. ])
  4083. AC_DEFUN([AC_FIND_QIMGIO],
  4084. [AC_REQUIRE([AC_FIND_JPEG])
  4085. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4086. AC_MSG_CHECKING([for qimgio])
  4087. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4088. [
  4089. AC_LANG_SAVE
  4090. AC_LANG_CPLUSPLUS
  4091. ac_save_LIBS="$LIBS"
  4092. ac_save_CXXFLAGS="$CXXFLAGS"
  4093. if test "$kde_tqtver" = "3"; then
  4094. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBTQT"
  4095. CXXFLAGS="$CXXFLAGS -I$tqt_incdir $all_includes"
  4096. if $PKG_CONFIG --exists tqt-mt ; then
  4097. AC_TRY_RUN(dnl
  4098. [
  4099. #include <tqimageio.h>
  4100. #include <tqstring.h>
  4101. int main() {
  4102. TQString t = "hallo";
  4103. t.fill('t');
  4104. qInitImageIO();
  4105. }
  4106. ],
  4107. ac_cv_lib_qimgio=yes,
  4108. ac_cv_lib_qimgio=no,
  4109. ac_cv_lib_qimgio=no)
  4110. fi
  4111. fi
  4112. LIBS="$ac_save_LIBS"
  4113. CXXFLAGS="$ac_save_CXXFLAGS"
  4114. AC_LANG_RESTORE
  4115. ])dnl
  4116. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4117. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4118. AC_MSG_RESULT(yes)
  4119. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the TQt extension qimgio available])
  4120. AC_SUBST(LIBQIMGIO)
  4121. else
  4122. AC_MSG_RESULT(not found)
  4123. fi
  4124. ])
  4125. AC_DEFUN([KDE_CHECK_HONORS_SOCKET_PERMS],
  4126. [
  4127. AC_MSG_CHECKING([if underlying system honors socket permissions])
  4128. AC_CACHE_VAL(ac_cv_honors_socket_perms,
  4129. [
  4130. AC_LANG_SAVE
  4131. AC_LANG_C
  4132. ac_save_LIBS="$LIBS"
  4133. ac_save_CPPFLAGS="$CPPFLAGS"
  4134. LIBS="$all_libraries"
  4135. CPPFLAGS="$CPPFLAGS $all_includes"
  4136. AC_TRY_RUN(dnl
  4137. [
  4138. #include <sys/socket.h>
  4139. #include <sys/un.h>
  4140. #include <sys/stat.h>
  4141. #include <sys/types.h>
  4142. #include <string.h>
  4143. #include <unistd.h>
  4144. #include <errno.h>
  4145. int main()
  4146. {
  4147. int fd, fd2;
  4148. struct sockaddr_un sa;
  4149. if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
  4150. return 2;
  4151. sa.sun_family = AF_UNIX;
  4152. strcpy(sa.sun_path, "testsock");
  4153. unlink(sa.sun_path);
  4154. if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)))
  4155. return 2;
  4156. chmod(sa.sun_path, 0);
  4157. setuid(getuid() + 1000);
  4158. if ((fd2 = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
  4159. return 2;
  4160. connect(fd2, (struct sockaddr *)&sa, sizeof(sa));
  4161. return errno != EACCES;
  4162. }
  4163. ],
  4164. ac_cv_honors_socket_perms=yes,
  4165. ac_cv_honors_socket_perms=no,
  4166. ac_cv_honors_socket_perms=no)
  4167. LIBS="$ac_save_LIBS"
  4168. CPPFLAGS="$ac_save_CPPFLAGS"
  4169. AC_LANG_RESTORE
  4170. ])dnl
  4171. if eval "test \"`echo $ac_cv_honors_socket_perms`\" = yes"; then
  4172. AC_MSG_RESULT(yes)
  4173. AC_DEFINE_UNQUOTED(HONORS_SOCKET_PERMS, 1, [Defined if the underlying system honors socket permissions])
  4174. else
  4175. AC_MSG_RESULT(no)
  4176. fi
  4177. ])
  4178. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4179. [
  4180. AC_PROVIDE([AM_ENABLE_STATIC])
  4181. AC_PROVIDE([AM_ENABLE_SHARED])
  4182. enable_static=no
  4183. enable_shared=yes
  4184. ])
  4185. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4186. [
  4187. AC_MSG_CHECKING([for utmp file])
  4188. AC_CACHE_VAL(kde_cv_utmp_file,
  4189. [
  4190. kde_cv_utmp_file=no
  4191. for ac_file in \
  4192. \
  4193. /var/run/utmp \
  4194. /var/adm/utmp \
  4195. /etc/utmp \
  4196. ; \
  4197. do
  4198. if test -r "$ac_file"; then
  4199. kde_cv_utmp_file=$ac_file
  4200. break
  4201. fi
  4202. done
  4203. ])
  4204. if test "$kde_cv_utmp_file" != "no"; then
  4205. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4206. $1
  4207. AC_MSG_RESULT($kde_cv_utmp_file)
  4208. else
  4209. $2
  4210. AC_MSG_RESULT([non found])
  4211. fi
  4212. ])
  4213. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4214. [
  4215. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4216. TOPSUBDIRS=""
  4217. if test ! -s $srcdir/subdirs; then
  4218. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4219. files=`cd $srcdir && ls -1`
  4220. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4221. for i in $dirs; do
  4222. echo $i >> $srcdir/subdirs
  4223. done
  4224. fi
  4225. ac_topsubdirs=
  4226. if test -s $srcdir/inst-apps; then
  4227. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4228. elif test -s $srcdir/subdirs; then
  4229. ac_topsubdirs="`cat $srcdir/subdirs`"
  4230. fi
  4231. for i in $ac_topsubdirs; do
  4232. AC_MSG_CHECKING([if $i should be compiled])
  4233. if test -d $srcdir/$i; then
  4234. install_it="yes"
  4235. for j in $DO_NOT_COMPILE; do
  4236. if test $i = $j; then
  4237. install_it="no"
  4238. fi
  4239. done
  4240. else
  4241. install_it="no"
  4242. fi
  4243. AC_MSG_RESULT($install_it)
  4244. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4245. if test $install_it = "yes"; then
  4246. TOPSUBDIRS="$TOPSUBDIRS $i"
  4247. eval "$vari""_SUBDIR_included=yes"
  4248. else
  4249. eval "$vari""_SUBDIR_included=no"
  4250. fi
  4251. done
  4252. AC_SUBST(TOPSUBDIRS)
  4253. ])
  4254. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4255. [
  4256. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4257. AC_LANG_SAVE
  4258. AC_LANG_CPLUSPLUS
  4259. AC_TRY_COMPILE([
  4260. ],
  4261. [
  4262. namespace Foo {
  4263. extern int i;
  4264. namespace Bar {
  4265. extern int i;
  4266. }
  4267. }
  4268. int Foo::i = 0;
  4269. int Foo::Bar::i = 1;
  4270. ],[
  4271. AC_MSG_RESULT(yes)
  4272. AC_DEFINE(HAVE_NAMESPACES)
  4273. ], [
  4274. AC_MSG_RESULT(no)
  4275. ])
  4276. AC_LANG_RESTORE
  4277. ])
  4278. dnl ------------------------------------------------------------------------
  4279. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4280. dnl ------------------------------------------------------------------------
  4281. dnl
  4282. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4283. [
  4284. AC_MSG_CHECKING(for S_ISSOCK)
  4285. AC_CACHE_VAL(ac_cv_have_s_issock,
  4286. [
  4287. AC_TRY_LINK(
  4288. [
  4289. #include <sys/stat.h>
  4290. ],
  4291. [
  4292. struct stat buff;
  4293. int b = S_ISSOCK( buff.st_mode );
  4294. ],
  4295. ac_cv_have_s_issock=yes,
  4296. ac_cv_have_s_issock=no)
  4297. ])
  4298. AC_MSG_RESULT($ac_cv_have_s_issock)
  4299. if test "$ac_cv_have_s_issock" = "yes"; then
  4300. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4301. fi
  4302. AH_VERBATIM(_ISSOCK,
  4303. [
  4304. #ifndef HAVE_S_ISSOCK
  4305. #define HAVE_S_ISSOCK
  4306. #define S_ISSOCK(mode) (1==0)
  4307. #endif
  4308. ])
  4309. ])
  4310. dnl ------------------------------------------------------------------------
  4311. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4312. dnl ------------------------------------------------------------------------
  4313. dnl
  4314. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4315. [
  4316. AC_MSG_CHECKING(for MAXPATHLEN)
  4317. AC_CACHE_VAL(ac_cv_maxpathlen,
  4318. [
  4319. cat > conftest.$ac_ext <<EOF
  4320. #ifdef STDC_HEADERS
  4321. # include <stdlib.h>
  4322. #endif
  4323. #include <stdio.h>
  4324. #include <sys/param.h>
  4325. #ifndef MAXPATHLEN
  4326. #define MAXPATHLEN 1024
  4327. #endif
  4328. KDE_HELLO MAXPATHLEN
  4329. EOF
  4330. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4331. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4332. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4333. else
  4334. ac_cv_maxpathlen=1024
  4335. fi
  4336. rm conftest.*
  4337. ])
  4338. AC_MSG_RESULT($ac_cv_maxpathlen)
  4339. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4340. ])
  4341. AC_DEFUN([KDE_CHECK_HEADER],
  4342. [
  4343. kde_safe_cppflags=$CPPFLAGS
  4344. CPPFLAGS="$CPPFLAGS $all_includes -I$kde_incdir/tde -I/usr/include/tqt"
  4345. AC_LANG_SAVE
  4346. AC_LANG_CPLUSPLUS
  4347. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4348. AC_LANG_RESTORE
  4349. CPPFLAGS=$kde_safe_cppflags
  4350. ])
  4351. AC_DEFUN([KDE_CHECK_HEADERS],
  4352. [
  4353. AH_CHECK_HEADERS_TDE([$1])
  4354. AC_LANG_SAVE
  4355. kde_safe_cppflags=$CPPFLAGS
  4356. CPPFLAGS="$CPPFLAGS $all_includes -I$kde_incdir/tde -I/usr/include/tqt"
  4357. AC_LANG_CPLUSPLUS
  4358. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4359. CPPFLAGS=$kde_safe_cppflags
  4360. AC_LANG_RESTORE
  4361. ])
  4362. AC_DEFUN([KDE_FAST_CONFIGURE],
  4363. [
  4364. dnl makes configure fast (needs perl)
  4365. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4366. with_fast_perl=$enableval, with_fast_perl=yes)
  4367. ])
  4368. AC_DEFUN([KDE_CONF_FILES],
  4369. [
  4370. val=
  4371. if test -f $srcdir/configure.files ; then
  4372. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4373. fi
  4374. CONF_FILES=
  4375. if test -n "$val" ; then
  4376. for i in $val ; do
  4377. CONF_FILES="$CONF_FILES $i"
  4378. done
  4379. fi
  4380. AC_SUBST(CONF_FILES)
  4381. ])dnl
  4382. dnl This sets the prefix, for arts and tdelibs
  4383. dnl Do NOT use in any other module.
  4384. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4385. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4386. [
  4387. unset CDPATH
  4388. dnl make $TDEDIR the default for the installation
  4389. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4390. if test "x$prefix" = "xNONE"; then
  4391. prefix=$ac_default_prefix
  4392. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4393. fi
  4394. # And delete superfluous '/' to make compares easier
  4395. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4396. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4397. kde_libs_prefix='$(prefix)'
  4398. kde_libs_htmldir='$(kde_htmldir)'
  4399. AC_SUBST(kde_libs_prefix)
  4400. AC_SUBST(kde_libs_htmldir)
  4401. KDE_FAST_CONFIGURE
  4402. KDE_CONF_FILES
  4403. ])
  4404. AC_DEFUN([KDE_SET_PREFIX],
  4405. [
  4406. unset CDPATH
  4407. dnl We can't give real code to that macro, only a value.
  4408. dnl It only matters for --help, since we set the prefix in this function anyway.
  4409. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4410. KDE_SET_DEFAULT_BINDIRS
  4411. if test "x$prefix" = "xNONE"; then
  4412. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4413. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4414. else
  4415. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4416. kde_save_PATH="$PATH"
  4417. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4418. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4419. PATH="$kde_save_PATH"
  4420. fi
  4421. kde_libs_prefix=`$KDECONFIG --prefix`
  4422. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4423. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4424. This means it has been moved since you installed it.
  4425. This won't work. Please recompile tdelibs for the new prefix.
  4426. ])
  4427. fi
  4428. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4429. AC_MSG_CHECKING([where to install])
  4430. if test "x$prefix" = "xNONE"; then
  4431. prefix=$kde_libs_prefix
  4432. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4433. else
  4434. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4435. given_prefix=$prefix
  4436. AC_MSG_RESULT([$prefix (as requested)])
  4437. fi
  4438. # And delete superfluous '/' to make compares easier
  4439. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4440. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4441. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4442. AC_SUBST(KDECONFIG)
  4443. AC_SUBST(kde_libs_prefix)
  4444. AC_SUBST(kde_libs_htmldir)
  4445. KDE_FAST_CONFIGURE
  4446. KDE_CONF_FILES
  4447. ])
  4448. pushdef([AC_PROG_INSTALL],
  4449. [
  4450. dnl our own version, testing for a -p flag
  4451. popdef([AC_PROG_INSTALL])
  4452. dnl as AC_PROG_INSTALL works as it works we first have
  4453. dnl to save if the user didn't specify INSTALL, as the
  4454. dnl autoconf one overwrites INSTALL and we have no chance to find
  4455. dnl out afterwards
  4456. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4457. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4458. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4459. AC_PROG_INSTALL
  4460. if test -z "$kde_save_INSTALL_given" ; then
  4461. # OK, user hasn't given any INSTALL, autoconf found one for us
  4462. # now we test, if it supports the -p flag
  4463. AC_MSG_CHECKING(for -p flag to install)
  4464. rm -f confinst.$$.* > /dev/null 2>&1
  4465. echo "Testtest" > confinst.$$.orig
  4466. ac_res=no
  4467. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4468. if test -f confinst.$$.new ; then
  4469. # OK, -p seems to do no harm to install
  4470. INSTALL="${INSTALL} -p"
  4471. ac_res=yes
  4472. fi
  4473. fi
  4474. rm -f confinst.$$.*
  4475. AC_MSG_RESULT($ac_res)
  4476. fi
  4477. dnl the following tries to resolve some signs and wonders coming up
  4478. dnl with different autoconf/automake versions
  4479. dnl e.g.:
  4480. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4481. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4482. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4483. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4484. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4485. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4486. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4487. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4488. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4489. dnl *sometimes TDE does not use the install-@DIR@PROGRAM targets from
  4490. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4491. dnl and so does not see the -s flag in automake > 1.4
  4492. dnl to clean up that mess we:
  4493. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4494. dnl which cleans KDE's program with automake > 1.4;
  4495. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4496. dnl with automake<=1.4
  4497. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4498. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4499. dnl
  4500. dnl And to all this comes, that I even can't write in comments variable
  4501. dnl names used by automake, because it is so stupid to think I wanted to
  4502. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4503. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4504. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4505. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4506. fi
  4507. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4508. INSTALL_SCRIPT='${INSTALL}'
  4509. fi
  4510. ])dnl
  4511. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4512. [AC_LANG_CPLUSPLUS
  4513. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4514. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4515. ])
  4516. pushdef([AC_LANG_CPLUSPLUS],
  4517. [popdef([AC_LANG_CPLUSPLUS])
  4518. KDE_LANG_CPLUSPLUS
  4519. ])
  4520. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4521. [
  4522. AC_MSG_CHECKING(for long long)
  4523. AC_CACHE_VAL(kde_cv_c_long_long,
  4524. [
  4525. AC_LANG_SAVE
  4526. AC_LANG_CPLUSPLUS
  4527. AC_TRY_LINK([], [
  4528. long long foo = 0;
  4529. foo = foo+1;
  4530. ],
  4531. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4532. AC_LANG_RESTORE
  4533. ])
  4534. AC_MSG_RESULT($kde_cv_c_long_long)
  4535. if test "$kde_cv_c_long_long" = yes; then
  4536. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4537. fi
  4538. ])
  4539. AC_DEFUN([KDE_CHECK_LIB],
  4540. [
  4541. kde_save_LDFLAGS="$LDFLAGS"
  4542. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4543. kde_save_LIBS="$LIBS"
  4544. LDFLAGS="$LDFLAGS $all_libraries -ltqt"
  4545. case $host_os in
  4546. aix*) LDFLAGS="-brtl $LDFLAGS"
  4547. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4548. ;;
  4549. esac
  4550. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4551. LDFLAGS="$kde_save_LDFLAGS"
  4552. LIBS="$kde_save_LIBS"
  4553. ])
  4554. AC_DEFUN([KDE_JAVA_PREFIX],
  4555. [
  4556. dir=`dirname "$1"`
  4557. base=`basename "$1"`
  4558. list=`ls -1 $dir 2> /dev/null`
  4559. for entry in $list; do
  4560. if test -d $dir/$entry/bin; then
  4561. case $entry in
  4562. $base)
  4563. javadirs="$javadirs $dir/$entry/bin"
  4564. ;;
  4565. esac
  4566. elif test -d $dir/$entry/jre/bin; then
  4567. case $entry in
  4568. $base)
  4569. javadirs="$javadirs $dir/$entry/jre/bin"
  4570. ;;
  4571. esac
  4572. fi
  4573. done
  4574. ])
  4575. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4576. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4577. [
  4578. AC_ARG_WITH(java,
  4579. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4580. [ ac_java_dir=$withval
  4581. ], ac_java_dir=""
  4582. )
  4583. AC_MSG_CHECKING([for Java])
  4584. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4585. if test "x$ac_java_dir" = "xno"; then
  4586. kde_java_bindir=no
  4587. kde_java_includedir=no
  4588. kde_java_libjvmdir=no
  4589. kde_java_libgcjdir=no
  4590. kde_java_libhpidir=no
  4591. else
  4592. if test "x$ac_java_dir" = "x"; then
  4593. dnl No option set -> collect list of candidate paths
  4594. if test -n "$JAVA_HOME"; then
  4595. KDE_JAVA_PREFIX($JAVA_HOME)
  4596. fi
  4597. KDE_JAVA_PREFIX(/usr/j2se)
  4598. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4599. KDE_JAVA_PREFIX(/usr/j*dk*)
  4600. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4601. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4602. KDE_JAVA_PREFIX(/usr/lib/java*)
  4603. KDE_JAVA_PREFIX(/usr/java*)
  4604. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4605. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4606. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4607. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4608. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4609. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4610. KDE_JAVA_PREFIX(/opt/java*)
  4611. kde_cv_path="NONE"
  4612. kde_save_IFS=$IFS
  4613. IFS=':'
  4614. for dir in $PATH; do
  4615. if test -d "$dir"; then
  4616. javadirs="$javadirs $dir"
  4617. fi
  4618. done
  4619. IFS=$kde_save_IFS
  4620. jredirs=
  4621. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4622. for dir in $javadirs; do
  4623. dnl Check for the java executable
  4624. if test -x "$dir/java"; then
  4625. sane_path=$(cd $dir; /bin/pwd)
  4626. dnl And also check for a libjvm.so somewhere under there
  4627. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4628. if test "$sane_path" != "/usr/bin"; then
  4629. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4630. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4631. jredirs="$jredirs $dir"
  4632. fi
  4633. fi
  4634. done
  4635. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4636. JAVAC=
  4637. JAVA=
  4638. kde_java_bindir=no
  4639. for dir in $jredirs; do
  4640. JAVA="$dir/java"
  4641. kde_java_bindir=$dir
  4642. if test -x "$dir/javac"; then
  4643. JAVAC="$dir/javac"
  4644. break
  4645. fi
  4646. done
  4647. if test -n "$JAVAC"; then
  4648. dnl this substitution might not work - well, we test for jni.h below
  4649. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4650. else
  4651. kde_java_includedir=no
  4652. fi
  4653. else
  4654. dnl config option set
  4655. kde_java_bindir=$ac_java_dir/bin
  4656. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4657. kde_java_includedir=no
  4658. else
  4659. kde_java_includedir=$ac_java_dir/include
  4660. fi
  4661. fi
  4662. fi
  4663. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4664. if test "x$kde_java_bindir" != "xno"; then
  4665. dnl Look for libjvm.so
  4666. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4667. dnl Look for libgcj.so
  4668. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4669. dnl Look for libhpi.so and avoid green threads
  4670. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4671. dnl Now check everything's fine under there
  4672. dnl the include dir is our flag for having the JDK
  4673. if test -d "$kde_java_includedir"; then
  4674. if test ! -x "$kde_java_bindir/javac"; then
  4675. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4676. fi
  4677. kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
  4678. if test -n "$kde_javac_h"; then
  4679. if test ! -x "$kde_java_bindir/javah"; then
  4680. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4681. fi
  4682. fi
  4683. if test ! -x "$kde_java_bindir/jar"; then
  4684. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4685. fi
  4686. if test ! -r "$kde_java_includedir/jni.h"; then
  4687. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4688. fi
  4689. jni_includes="-I$kde_java_includedir"
  4690. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4691. dnl and under linux here..
  4692. dnl not needed for gcj
  4693. if test "x$kde_java_libgcjdir" = "x"; then
  4694. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4695. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4696. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4697. fi
  4698. else
  4699. JAVAC=
  4700. jni_includes=
  4701. fi
  4702. if test "x$kde_java_libgcjdir" = "x"; then
  4703. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4704. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4705. fi
  4706. else
  4707. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4708. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4709. fi
  4710. fi
  4711. if test ! -x "$kde_java_bindir/java"; then
  4712. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4713. fi
  4714. dnl not needed for gcj compile
  4715. if test -n "$jni_includes"; then
  4716. dnl Check for JNI version
  4717. AC_LANG_SAVE
  4718. AC_LANG_CPLUSPLUS
  4719. ac_cxxflags_safe="$CXXFLAGS"
  4720. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4721. AC_TRY_COMPILE([
  4722. #include <jni.h>
  4723. ],
  4724. [
  4725. #ifndef JNI_VERSION_1_2
  4726. Syntax Error
  4727. #endif
  4728. ],[ kde_jni_works=yes ],
  4729. [ kde_jni_works=no ])
  4730. if test $kde_jni_works = no; then
  4731. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4732. You need to have Java Development Kit (JDK) version 1.2.
  4733. Use --with-java to specify another location.
  4734. Use --without-java to configure without java support.
  4735. Or download a newer JDK and try again.
  4736. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4737. fi
  4738. CXXFLAGS="$ac_cxxflags_safe"
  4739. AC_LANG_RESTORE
  4740. dnl All tests ok, inform and subst the variables
  4741. JAVAC=$kde_java_bindir/javac
  4742. JAVAH=$kde_java_bindir/javah
  4743. JAR=$kde_java_bindir/jar
  4744. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4745. if test "x$kde_java_libgcjdir" = "x"; then
  4746. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4747. JVMLIBS="-L$kde_java_libjvmdir -ljvm"
  4748. else
  4749. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4750. fi
  4751. else
  4752. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4753. fi
  4754. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4755. else
  4756. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4757. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4758. fi
  4759. elif test -d "/Library/Java/Home"; then
  4760. kde_java_bindir="/Library/Java/Home/bin"
  4761. jni_includes="-I/Library/Java/Home/include"
  4762. JAVAC=$kde_java_bindir/javac
  4763. JAVAH=$kde_java_bindir/javah
  4764. JAR=$kde_java_bindir/jar
  4765. JVMLIBS="-Wl,-framework,JavaVM"
  4766. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4767. AC_MSG_RESULT([Apple Java Framework])
  4768. else
  4769. AC_MSG_RESULT([none found])
  4770. fi
  4771. AC_MSG_CHECKING([if Java is >= 8])
  4772. JAVA8=false
  4773. if test -x "$kde_java_bindir/javac"; then
  4774. kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
  4775. if test -z "$kde_javac_h"; then
  4776. JAVA8=true
  4777. JAVAH=
  4778. fi
  4779. fi
  4780. if $JAVA8; then
  4781. AC_MSG_RESULT(yes)
  4782. else
  4783. AC_MSG_RESULT(no)
  4784. fi
  4785. AC_SUBST(JAVAC)
  4786. AC_SUBST(JAVA8)
  4787. AC_SUBST(JAVAH)
  4788. AC_SUBST(JAR)
  4789. AC_SUBST(JVMLIBS)
  4790. AC_SUBST(jni_includes)
  4791. # for backward compat
  4792. kde_cv_java_includedir=$kde_java_includedir
  4793. kde_cv_java_bindir=$kde_java_bindir
  4794. ])
  4795. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4796. dnl When the argument list becomes big, as in TDE for AC_OUTPUT in
  4797. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4798. dnl it. (matz@kde.org)
  4799. m4_define([mm_foreach],
  4800. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4801. m4_define([mm_car], [[$1]])
  4802. m4_define([mm_car2], [[$@]])
  4803. m4_define([_mm_foreach],
  4804. [m4_if(m4_quote($2), [], [],
  4805. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4806. mm_car2(m4_shift($2)),
  4807. [$3])])])
  4808. m4_define([AC_FOREACH],
  4809. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4810. # AH_CHECK_HEADERS_TDE(HEADER-FILE...)
  4811. # --------------------------------
  4812. m4_define([AH_CHECK_HEADERS_TDE],
  4813. [m4_foreach_w([AC_Header], [$1],
  4814. [AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([AC_Header])),
  4815. [Define to 1 if you have the <]m4_defn([AC_Header])[> header file.])])])
  4816. AC_DEFUN([KDE_NEED_FLEX],
  4817. [
  4818. kde_libs_safe=$LIBS
  4819. LIBS="$LIBS $USER_LDFLAGS"
  4820. AM_PROG_LEX
  4821. LIBS=$kde_libs_safe
  4822. if test -z "$LEXLIB"; then
  4823. AC_MSG_ERROR([You need to have flex installed.])
  4824. fi
  4825. AC_SUBST(LEXLIB)
  4826. ])
  4827. AC_DEFUN([AC_PATH_TQTOPIA],
  4828. [
  4829. dnl TODO: use AC_CACHE_VAL
  4830. if test -z "$1"; then
  4831. tqtopia_minver_maj=1
  4832. tqtopia_minver_min=5
  4833. tqtopia_minver_pat=0
  4834. else
  4835. tqtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4836. tqtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4837. tqtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4838. fi
  4839. tqtopia_minver="$tqtopia_minver_maj$tqtopia_minver_min$tqtopia_minver_pat"
  4840. tqtopia_minverstr="$tqtopia_minver_maj.$tqtopia_minver_min.$tqtopia_minver_pat"
  4841. AC_REQUIRE([AC_PATH_TQT])
  4842. AC_MSG_CHECKING([for TQtopia])
  4843. LIB_TQTOPIA="-lqpe"
  4844. AC_SUBST(LIB_TQTOPIA)
  4845. kde_tqtopia_dirs="$QPEDIR /opt/TQtopia"
  4846. ac_tqtopia_incdir=NO
  4847. AC_ARG_WITH(tqtopia-dir,
  4848. AC_HELP_STRING([--with-tqtopia-dir=DIR],[where the root of TQtopia is installed]),
  4849. [ ac_tqtopia_incdir="$withval"/include] )
  4850. tqtopia_incdirs=""
  4851. for dir in $kde_tqtopia_dirs; do
  4852. tqtopia_incdirs="$tqtopia_incdirs $dir/include"
  4853. done
  4854. if test ! "$ac_tqtopia_incdir" = "NO"; then
  4855. tqtopia_incdirs="$ac_tqtopia_incdir $tqtopia_incdirs"
  4856. fi
  4857. tqtopia_incdir=""
  4858. AC_FIND_FILE(qpe/qpeapplication.h, $tqtopia_incdirs, tqtopia_incdir)
  4859. ac_tqtopia_incdir="$tqtopia_incdir"
  4860. if test -z "$tqtopia_incdir"; then
  4861. AC_MSG_ERROR([Cannot find TQtopia headers. Please check your installation.])
  4862. fi
  4863. tqtopia_ver_maj=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4864. tqtopia_ver_min=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4865. tqtopia_ver_pat=`cat $tqtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4866. tqtopia_ver="$tqtopia_ver_maj$tqtopia_ver_min$tqtopia_ver_pat"
  4867. tqtopia_verstr="$tqtopia_ver_maj.$tqtopia_ver_min.$tqtopia_ver_pat"
  4868. if test "$tqtopia_ver" -lt "$tqtopia_minver"; then
  4869. AC_MSG_ERROR([found TQtopia version $tqtopia_verstr but version $tqtopia_minverstr
  4870. is required.])
  4871. fi
  4872. AC_LANG_SAVE
  4873. AC_LANG_CPLUSPLUS
  4874. ac_cxxflags_safe="$CXXFLAGS"
  4875. ac_ldflags_safe="$LDFLAGS"
  4876. ac_libs_safe="$LIBS"
  4877. CXXFLAGS="$CXXFLAGS -I$tqtopia_incdir $all_includes"
  4878. LDFLAGS="$LDFLAGS $TQT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4879. LIBS="$LIBS $LIB_TQTOPIA $LIBTQT"
  4880. cat > conftest.$ac_ext <<EOF
  4881. #include "confdefs.h"
  4882. #include <qpe/qpeapplication.h>
  4883. #include <qpe/version.h>
  4884. int main( int argc, char **argv )
  4885. {
  4886. QPEApplication app( argc, argv );
  4887. return 0;
  4888. }
  4889. EOF
  4890. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4891. rm -f conftest*
  4892. else
  4893. rm -f conftest*
  4894. AC_MSG_ERROR([Cannot link small TQtopia Application. For more details look at
  4895. the end of config.log])
  4896. fi
  4897. CXXFLAGS="$ac_cxxflags_safe"
  4898. LDFLAGS="$ac_ldflags_safe"
  4899. LIBS="$ac_libs_safe"
  4900. AC_LANG_RESTORE
  4901. TQTOPIA_INCLUDES="-I$tqtopia_incdir"
  4902. AC_SUBST(TQTOPIA_INCLUDES)
  4903. AC_MSG_RESULT([found version $tqtopia_verstr with headers at $tqtopia_incdir])
  4904. ])
  4905. AC_DEFUN([KDE_INIT_DOXYGEN],
  4906. [
  4907. AC_MSG_CHECKING([for TQt docs])
  4908. kde_tqtdir=
  4909. if test "${with_tqt_dir+set}" = set; then
  4910. kde_tqtdir="$with_tqt_dir"
  4911. fi
  4912. 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)
  4913. AC_MSG_RESULT($TQTDOCDIR)
  4914. AC_SUBST(TQTDOCDIR)
  4915. KDE_FIND_PATH(dot, DOT, [], [])
  4916. if test -n "$DOT"; then
  4917. KDE_HAVE_DOT="YES"
  4918. else
  4919. KDE_HAVE_DOT="NO"
  4920. fi
  4921. AC_SUBST(KDE_HAVE_DOT)
  4922. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4923. AC_SUBST(DOXYGEN)
  4924. DOXYGEN_PROJECT_NAME="$1"
  4925. DOXYGEN_PROJECT_NUMBER="$2"
  4926. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4927. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4928. KDE_HAS_DOXYGEN=no
  4929. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $TQTDOCDIR/qsql.html; then
  4930. KDE_HAS_DOXYGEN=yes
  4931. fi
  4932. AC_SUBST(KDE_HAS_DOXYGEN)
  4933. ])
  4934. AC_DEFUN([AC_FIND_BZIP2],
  4935. [
  4936. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4937. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4938. [
  4939. AC_LANG_SAVE
  4940. AC_LANG_CPLUSPLUS
  4941. kde_save_LIBS="$LIBS"
  4942. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4943. kde_save_CXXFLAGS="$CXXFLAGS"
  4944. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4945. AC_TRY_LINK(dnl
  4946. [
  4947. #define BZ_NO_STDIO
  4948. #include<bzlib.h>
  4949. ],
  4950. [ bz_stream s; (void) bzDecompress(&s); ],
  4951. eval "ac_cv_lib_bzip2='-lbz2'",
  4952. eval "ac_cv_lib_bzip2=no")
  4953. LIBS="$kde_save_LIBS"
  4954. CXXFLAGS="$kde_save_CXXFLAGS"
  4955. AC_LANG_RESTORE
  4956. ])dnl
  4957. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4958. if test ! "$ac_cv_lib_bzip2" = no; then
  4959. BZIP2DIR=bzip2
  4960. LIBBZ2="$ac_cv_lib_bzip2"
  4961. AC_SUBST(LIBBZ2)
  4962. else
  4963. cxx_shared_flag=
  4964. ld_shared_flag=
  4965. KDE_CHECK_COMPILER_FLAG(shared, [
  4966. ld_shared_flag="-shared"
  4967. ])
  4968. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4969. cxx_shared_flag="-fPIC"
  4970. ])
  4971. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4972. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4973. [
  4974. AC_LANG_SAVE
  4975. AC_LANG_CPLUSPLUS
  4976. kde_save_LIBS="$LIBS"
  4977. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4978. kde_save_CXXFLAGS="$CXXFLAGS"
  4979. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4980. AC_TRY_LINK(dnl
  4981. [
  4982. #define BZ_NO_STDIO
  4983. #include<bzlib.h>
  4984. ],
  4985. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4986. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4987. eval "ac_cv_lib_bzip2_prefix=no")
  4988. LIBS="$kde_save_LIBS"
  4989. CXXFLAGS="$kde_save_CXXFLAGS"
  4990. AC_LANG_RESTORE
  4991. ])dnl
  4992. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4993. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4994. BZIP2DIR=bzip2
  4995. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4996. AC_SUBST(LIBBZ2)
  4997. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4998. dnl else, we just ignore this
  4999. fi
  5000. fi
  5001. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  5002. ])
  5003. dnl ------------------------------------------------------------------------
  5004. dnl Try to find the SSL headers and libraries.
  5005. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  5006. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  5007. dnl ------------------------------------------------------------------------
  5008. dnl
  5009. AC_DEFUN([KDE_CHECK_SSL],
  5010. [
  5011. LIBSSL="-lssl -lcrypto"
  5012. AC_REQUIRE([KDE_CHECK_LIB64])
  5013. ac_ssl_includes=NO ac_ssl_libraries=NO
  5014. ssl_libraries=""
  5015. ssl_includes=""
  5016. AC_ARG_WITH(ssl-dir,
  5017. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  5018. [ ac_ssl_includes="$withval"/include
  5019. ac_ssl_libraries="$withval"/lib$tdelibsuff
  5020. ])
  5021. want_ssl=yes
  5022. AC_ARG_WITH(ssl,
  5023. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  5024. [want_ssl=$withval])
  5025. if test $want_ssl = yes; then
  5026. AC_MSG_CHECKING(for OpenSSL)
  5027. AC_CACHE_VAL(ac_cv_have_ssl,
  5028. [#try to guess OpenSSL locations
  5029. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  5030. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  5031. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  5032. ac_ssl_includes="$ssl_incdir"
  5033. 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"
  5034. if test ! "$ac_ssl_libraries" = "NO"; then
  5035. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  5036. fi
  5037. test=NONE
  5038. ssl_libdir=NONE
  5039. for dir in $ssl_libdirs; do
  5040. try="ls -1 $dir/libssl*"
  5041. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  5042. done
  5043. ac_ssl_libraries="$ssl_libdir"
  5044. ac_ldflags_safe="$LDFLAGS"
  5045. ac_libs_safe="$LIBS"
  5046. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  5047. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  5048. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  5049. ac_ssl_rsaref="yes"
  5050. ,
  5051. ac_ssl_rsaref="no"
  5052. )
  5053. LDFLAGS="$ac_ldflags_safe"
  5054. LIBS="$ac_libs_safe"
  5055. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5056. have_ssl=no
  5057. else
  5058. have_ssl=yes;
  5059. fi
  5060. ])
  5061. eval "$ac_cv_have_ssl"
  5062. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5063. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5064. AC_MSG_RESULT($ac_ssl_rsaref)
  5065. AC_MSG_CHECKING([for easter eggs])
  5066. AC_MSG_RESULT([none found])
  5067. else
  5068. have_ssl=no
  5069. fi
  5070. if test "$have_ssl" = yes; then
  5071. AC_MSG_CHECKING(for OpenSSL version)
  5072. dnl Check for SSL version
  5073. AC_CACHE_VAL(ac_cv_ssl_version,
  5074. [
  5075. cat >conftest.$ac_ext <<EOF
  5076. #include <openssl/opensslv.h>
  5077. #include <stdio.h>
  5078. int main() {
  5079. #ifndef OPENSSL_VERSION_NUMBER
  5080. printf("ssl_version=\\"error\\"\n");
  5081. #else
  5082. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5083. printf("ssl_version=\\"old\\"\n");
  5084. else
  5085. printf("ssl_version=\\"ok\\"\n");
  5086. #endif
  5087. return (0);
  5088. }
  5089. EOF
  5090. ac_save_CPPFLAGS=$CPPFLAGS
  5091. if test "$ac_ssl_includes" != "/usr/include"; then
  5092. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5093. fi
  5094. if AC_TRY_EVAL(ac_link); then
  5095. if eval `./conftest 2>&5`; then
  5096. if test $ssl_version = error; then
  5097. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5098. else
  5099. if test $ssl_version = old; then
  5100. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5101. have_ssl=no
  5102. fi
  5103. fi
  5104. ac_cv_ssl_version="ssl_version=$ssl_version"
  5105. else
  5106. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5107. Check config.log, and if you can't figure it out, send a mail to
  5108. David Faure <faure@kde.org>, attaching your config.log])
  5109. fi
  5110. else
  5111. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5112. Check config.log, and if you can't figure it out, send a mail to
  5113. David Faure <faure@kde.org>, attaching your config.log])
  5114. fi
  5115. CPPFLAGS=$ac_save_CPPFLAGS
  5116. ])
  5117. eval "$ac_cv_ssl_version"
  5118. AC_MSG_RESULT($ssl_version)
  5119. fi
  5120. if test "$have_ssl" != yes; then
  5121. LIBSSL="";
  5122. else
  5123. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5124. ac_cv_have_ssl="have_ssl=yes \
  5125. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5126. ssl_libraries="$ac_ssl_libraries"
  5127. ssl_includes="$ac_ssl_includes"
  5128. if test "$ac_ssl_rsaref" = yes; then
  5129. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5130. fi
  5131. if test $ssl_version = "old"; then
  5132. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5133. fi
  5134. fi
  5135. SSL_INCLUDES=
  5136. if test "$ssl_includes" = "/usr/include"; then
  5137. if test -f /usr/kerberos/include/krb5.h; then
  5138. SSL_INCLUDES="-I/usr/kerberos/include"
  5139. fi
  5140. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5141. SSL_INCLUDES="-I$ssl_includes"
  5142. fi
  5143. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5144. SSL_LDFLAGS=""
  5145. else
  5146. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5147. fi
  5148. AC_SUBST(SSL_INCLUDES)
  5149. AC_SUBST(SSL_LDFLAGS)
  5150. AC_SUBST(LIBSSL)
  5151. ])
  5152. AC_DEFUN([KDE_CHECK_STRLCPY],
  5153. [
  5154. AC_REQUIRE([AC_CHECK_STRLCAT])
  5155. AC_REQUIRE([AC_CHECK_STRLCPY])
  5156. AC_CHECK_SIZEOF(size_t)
  5157. AC_CHECK_SIZEOF(unsigned long)
  5158. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5159. AC_TRY_COMPILE(,[
  5160. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5161. choke me
  5162. #endif
  5163. ],AC_MSG_RESULT([yes]),[
  5164. AC_MSG_RESULT(no)
  5165. AC_MSG_ERROR([
  5166. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5167. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5168. ])
  5169. ])
  5170. ])
  5171. AC_DEFUN([KDE_CHECK_BINUTILS],
  5172. [
  5173. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5174. kde_save_LDFLAGS="$LDFLAGS"
  5175. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5176. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5177. AC_TRY_LINK([int foo;],
  5178. [
  5179. #ifdef __INTEL_COMPILER
  5180. icc apparently does not support libtools version-info and version-script
  5181. at the same time. Dunno where the bug is, but until somebody figured out,
  5182. better disable the optional version scripts.
  5183. #endif
  5184. foo = 42;
  5185. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5186. LDFLAGS="$kde_save_LDFLAGS"
  5187. rm -f conftest.map
  5188. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5189. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5190. AC_MSG_RESULT($kde_supports_versionmaps)
  5191. ])
  5192. AC_DEFUN([AM_PROG_OBJC],[
  5193. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5194. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5195. if test "x${OBJCFLAGS-unset}" = xunset; then
  5196. OBJCFLAGS="-g -O2"
  5197. fi
  5198. AC_SUBST(OBJCFLAGS)
  5199. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5200. ])
  5201. AC_DEFUN([KDE_CHECK_PERL],
  5202. [
  5203. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5204. AC_MSG_ERROR([No Perl found in your $PATH.
  5205. We need perl to generate some code.])
  5206. ])
  5207. AC_SUBST(PERL)
  5208. ])
  5209. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5210. [
  5211. AC_SYS_LARGEFILE
  5212. if test "$ac_cv_sys_file_offset_bits" != no; then
  5213. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5214. fi
  5215. if test "x$ac_cv_sys_large_files" != "xno"; then
  5216. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5217. fi
  5218. ])
  5219. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5220. dnl which allows to search for libs that get installed into the TDE prefix.
  5221. dnl
  5222. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5223. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5224. dnl also defines KSTUFF_PKG_ERRORS on error
  5225. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5226. PKG_CONFIG_PATH="$prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5227. if test "$prefix" != "$kde_libs_prefix"; then
  5228. PKG_CONFIG_PATH="$kde_libs_prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5229. fi
  5230. export PKG_CONFIG_PATH
  5231. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5232. ])
  5233. dnl Check for PIE support in the compiler and linker
  5234. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5235. [
  5236. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5237. [
  5238. AC_LANG_SAVE
  5239. AC_LANG_CPLUSPLUS
  5240. safe_CXXFLAGS=$CXXFLAGS
  5241. safe_LDFLAGS=$LDFLAGS
  5242. CXXFLAGS="$CXXFLAGS -fPIE"
  5243. LDFLAGS="$LDFLAGS -pie"
  5244. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5245. CXXFLAGS=$safe_CXXFLAGS
  5246. LDFLAGS=$safe_LDFLAGS
  5247. AC_LANG_RESTORE
  5248. ])
  5249. AC_MSG_CHECKING(if enabling -pie/fPIE support)
  5250. AC_ARG_ENABLE(pie,
  5251. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5252. [kde_has_pie_support=$enableval],
  5253. [kde_has_pie_support=detect])
  5254. if test "$kde_has_pie_support" = "detect"; then
  5255. kde_has_pie_support=$kde_cv_val_pie_support
  5256. fi
  5257. AC_MSG_RESULT([$kde_has_pie_support])
  5258. KDE_USE_FPIE=""
  5259. KDE_USE_PIE=""
  5260. AC_SUBST([KDE_USE_FPIE])
  5261. AC_SUBST([KDE_USE_PIE])
  5262. if test "$kde_has_pie_support" = "yes"; then
  5263. KDE_USE_FPIE="-fPIE"
  5264. KDE_USE_PIE="-pie"
  5265. fi
  5266. ])
  5267. dnl
  5268. dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  5269. dnl
  5270. AC_DEFUN([AM_PATH_CPPUNIT],
  5271. [
  5272. AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
  5273. cppunit_config_prefix="$withval", cppunit_config_prefix="")
  5274. AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
  5275. cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
  5276. AC_MSG_CHECKING(if CPPUNIT tests should be built (default=yes))
  5277. AC_ARG_ENABLE(cppunit,
  5278. [ --disable-cppunit Do not try to build with CPPUNIT tests],,
  5279. enable_cppunit=yes)
  5280. AC_MSG_RESULT($enable_cppunit)
  5281. if test "x$enable_cppunit" = "xyes"; then
  5282. AC_MSG_CHECKING(if unit-tests requiring an online connection should be built (default=no))
  5283. AC_ARG_ENABLE(online_tests,
  5284. [ --enable-online-tests Include online tests with CPPUNIT tests],,
  5285. enable_online_tests=no)
  5286. AC_MSG_RESULT($enable_online_tests)
  5287. cppunit_version_min=$1
  5288. if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists cppunit; then
  5289. PKG_CHECK_MODULES(CPPUNIT, [cppunit >= $cppunit_version_min],,
  5290. [
  5291. AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built)
  5292. no_cppunit=yes
  5293. ])
  5294. else
  5295. if test x$cppunit_config_exec_prefix != x ; then
  5296. cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
  5297. if test x${CPPUNIT_CONFIG+set} != xset ; then
  5298. CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
  5299. fi
  5300. fi
  5301. if test x$cppunit_config_prefix != x ; then
  5302. cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
  5303. if test x${CPPUNIT_CONFIG+set} != xset ; then
  5304. CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
  5305. fi
  5306. fi
  5307. AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
  5308. AC_MSG_CHECKING(for CPPUNIT - version >= $cppunit_version_min)
  5309. no_cppunit=""
  5310. if test "$CPPUNIT_CONFIG" = "no" ; then
  5311. AC_MSG_RESULT(no)
  5312. AC_MSG_WARN(Unable to locate cppunit-config. Tests will not be built)
  5313. no_cppunit=yes
  5314. else
  5315. CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
  5316. CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
  5317. cppunit_version=`$CPPUNIT_CONFIG --version`
  5318. cppunit_major_version=`echo $cppunit_version | \
  5319. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  5320. cppunit_minor_version=`echo $cppunit_version | \
  5321. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  5322. cppunit_micro_version=`echo $cppunit_version | \
  5323. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  5324. cppunit_major_min=`echo $cppunit_version_min | \
  5325. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  5326. cppunit_minor_min=`echo $cppunit_version_min | \
  5327. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  5328. cppunit_micro_min=`echo $cppunit_version_min | \
  5329. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  5330. cppunit_version_proper=`expr \
  5331. $cppunit_major_version \> $cppunit_major_min \| \
  5332. $cppunit_major_version \= $cppunit_major_min \& \
  5333. $cppunit_minor_version \> $cppunit_minor_min \| \
  5334. $cppunit_major_version \= $cppunit_major_min \& \
  5335. $cppunit_minor_version \= $cppunit_minor_min \& \
  5336. $cppunit_micro_version \>= $cppunit_micro_min `
  5337. if test "$cppunit_version_proper" = "1" ; then
  5338. AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
  5339. else
  5340. AC_MSG_RESULT(no)
  5341. AC_MSG_WARN(Minimum version of CPPUNIT couldn't be found. Tests will not be built)
  5342. no_cppunit=yes
  5343. fi
  5344. fi
  5345. fi
  5346. else
  5347. no_cppunit=user
  5348. fi
  5349. if test "x$no_cppunit" = x ; then
  5350. ifelse([$2], , :, [$2])
  5351. if test "x$enable_online_tests" = "xyes"; then
  5352. AC_DEFINE_UNQUOTED(PERFORM_ONLINE_UNITTESTS, 1, [Define if unit tests requiring online access should be compiled])
  5353. fi
  5354. else
  5355. CPPUNIT_CFLAGS=""
  5356. CPPUNIT_LIBS=""
  5357. ifelse([$3], , :, [$3])
  5358. fi
  5359. AC_SUBST(CPPUNIT_CFLAGS)
  5360. AC_SUBST(CPPUNIT_LIBS)
  5361. ])
  5362. dnl
  5363. dnl AM_KDE_MIN_VERSION(MIN-VERSION-MAJOR, MIN-VERSION-MINOR, MIN-VERSION-MICRO)
  5364. dnl
  5365. AC_DEFUN([AM_KDE_MIN_VERSION],
  5366. [
  5367. AC_MSG_CHECKING([if minimum TDE version is available])
  5368. AC_LANG_SAVE
  5369. AC_LANG_CPLUSPLUS
  5370. save_CXXFLAGS=$CXXFLAGS
  5371. CXXFLAGS="$CXXFLAGS -I$srcdir $all_includes"
  5372. AC_TRY_COMPILE([
  5373. #include "kdecompat.h"
  5374. #if !( KDE_IS_VERSION( $1, $2, $3 ) )
  5375. #error TDE version does not meet KMyMoney minimum requirement
  5376. #endif
  5377. ], [], AC_MSG_RESULT(yes), AC_MSG_ERROR(no)
  5378. )
  5379. CXXFLAGS=$save_CXXFLAGS
  5380. AC_LANG_RESTORE
  5381. ])
  5382. AC_DEFUN([AC_GLIB_2],
  5383. [
  5384. AC_MSG_CHECKING([for glib == 2.0])
  5385. GLIB2_LIBS=`$PKG_CONFIG --libs glib-2.0`
  5386. GLIB2_CFLAGS="`$PKG_CONFIG --cflags glib-2.0`"
  5387. if test -z "$GLIB2_LIBS"; then
  5388. AC_MSG_RESULT(no);
  5389. DO_NOT_COMPILE="$DO_NOT_COMPILE mozilla"
  5390. else
  5391. AC_MSG_RESULT([cflags $GLIB2_CFLAGS]);
  5392. AC_SUBST(GLIB2_CFLAGS)
  5393. AC_SUBST(GLIB2_LIBS)
  5394. fi
  5395. ])
  5396. AC_DEFUN([AC_GTK_2],
  5397. [
  5398. AC_MSG_CHECKING([for gtk == 2.0])
  5399. GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
  5400. GTK2_CFLAGS="`$PKG_CONFIG --cflags gtk+-2.0`"
  5401. if test -z "$GTK2_LIBS"; then
  5402. AC_MSG_RESULT(no);
  5403. DO_NOT_COMPILE="$DO_NOT_COMPILE mozilla"
  5404. else
  5405. AC_MSG_RESULT([cflags $GTK2_CFLAGS]);
  5406. AC_SUBST(GTK2_CFLAGS)
  5407. AC_SUBST(GTK2_LIBS)
  5408. fi
  5409. ])
  5410. AC_DEFUN([AC_TAGCOLL2],
  5411. [
  5412. AC_MSG_CHECKING([for libtagcoll2])
  5413. TAGCOLL2_LIBS=`$PKG_CONFIG --libs libtagcoll2`
  5414. TAGCOLL2_CFLAGS="`$PKG_CONFIG --cflags libtagcoll2`"
  5415. if test -z "$TAGCOLL2_LIBS"; then
  5416. AC_MSG_RESULT(no);
  5417. else
  5418. AC_MSG_RESULT([cflags $TAGCOLL2_CFLAGS]);
  5419. AC_SUBST(TAGCOLL2_CFLAGS)
  5420. AC_SUBST(TAGCOLL2_LIBS)
  5421. fi
  5422. ])
  5423. AC_DEFUN([AC_LIBOFX],
  5424. [
  5425. AC_MSG_CHECKING(if the OFX importer plugin is desired)
  5426. AC_ARG_ENABLE(ofxplugin,
  5427. AC_HELP_STRING([--enable-ofxplugin],[enable OFX importer plugin (default=auto)]),
  5428. [enable_ofxplugin="$enableval"],
  5429. [enable_ofxplugin="auto"])
  5430. AC_MSG_RESULT($enable_ofxplugin)
  5431. AC_MSG_CHECKING(if OFX direct connect is desired)
  5432. AC_ARG_ENABLE(ofxbanking,
  5433. AC_HELP_STRING([--enable-ofxbanking],[enable OFX direct connect (default=auto)]),
  5434. [enable_ofxbanking="$enableval"],
  5435. [enable_ofxbanking="auto"])
  5436. AC_MSG_RESULT($enable_ofxbanking)
  5437. # make sure we include the plugin even if not mentioned explicitly
  5438. if test "$enable_ofxbanking" != "no" -a "$enable_ofxplugin" != "yes"; then
  5439. enable_ofxplugin=$enable_ofxbanking
  5440. fi
  5441. if test "$enable_ofxplugin" != "no" -o "$enable_ofxbanking" != "no"; then
  5442. ac_save_CFLAGS="$CFLAGS"
  5443. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  5444. AC_CHECK_HEADER([OpenSP/macros.h],
  5445. [],
  5446. [
  5447. if test "$enable_ofxplugin" != "auto" -o "$enable_ofxbanking" != "auto"; then
  5448. AC_MSG_ERROR([cannot find OpenSP headers. Please ensure you have OpenSP installed.])
  5449. fi
  5450. AC_MSG_RESULT([cannot find OpenSP headers. Skipping OFX support])
  5451. enable_ofxbanking=no
  5452. enable_ofxplugin=no
  5453. ])
  5454. if test "$enable_ofxplugin" != "no"; then
  5455. CFLAGS="$ac_save_CFLAGS"
  5456. PKG_CHECK_MODULES(OFX,libofx >= 0.8.2)
  5457. fi
  5458. fi
  5459. if test "$enable_ofxplugin" != "no"; then
  5460. OFX_IMPORTERPLUGIN="ofximport"
  5461. enable_ofxplugin=yes
  5462. fi
  5463. if test "$enable_ofxbanking" != "no"; then
  5464. enable_ofxbanking=yes
  5465. fi
  5466. AM_CONDITIONAL(OFXBANKING, test "$enable_ofxbanking" != "no" )
  5467. AC_SUBST(OFX_LIBS)
  5468. AC_SUBST(OFX_IMPORTERPLUGIN)
  5469. ])
  5470. dnl
  5471. dnl check the memory leakage checker option
  5472. dnl if enabled or disabled, directly controlled
  5473. dnl if not given, follows --enable-debug and if
  5474. dnl debugging support is turned on, the memory
  5475. dnl leakage checker is turned on also
  5476. dnl
  5477. dnl Need AC_CHECK_COMPILERS to be run before
  5478. AC_DEFUN([AC_MEMORY_LEAK_CHECK], [
  5479. AC_ARG_ENABLE(
  5480. leak-check,
  5481. AC_HELP_STRING([--enable-leak-check],[enable memory leak checker (default=no)]),
  5482. use_memory_leak_check=$enableval,use_memory_leak_check=no)
  5483. if test "x$use_memory_leak_check" != "xno"; then
  5484. CPPFLAGS="$CPPFLAGS -D_CHECK_MEMORY"
  5485. fi
  5486. if test "x$kde_use_debug_code" != "xno"; then
  5487. CPPFLAGS="$CPPFLAGS -DKMM_DEBUG=1"
  5488. else
  5489. CPPFLAGS="$CPPFLAGS -DKMM_DEBUG=0"
  5490. fi
  5491. ])
  5492. dnl
  5493. dnl check the pdf generation option
  5494. dnl if enabled or disabled, directly controlled
  5495. dnl
  5496. AC_DEFUN([AC_PDF_GENERATION], [
  5497. AC_MSG_CHECKING(if the PDF document generation is desired)
  5498. AC_ARG_ENABLE( pdf-docs,
  5499. [ --enable-pdf-docs enable generation of PDF documents (default=auto)],
  5500. enable_pdfdocs="$enableval",
  5501. enable_pdfdocs="auto")
  5502. AC_MSG_RESULT($enable_pdfdocs)
  5503. if test "x$enable_pdfdocs" != "xno"; then
  5504. AC_CHECK_PROG(found_recode, recode, yes, no)
  5505. AC_CHECK_PROG(found_html2ps, html2ps, yes, no)
  5506. AC_CHECK_PROG(found_ps2pdf, ps2pdf, yes, no)
  5507. if test "x$found_recode" != "xyes" && "x$found_html2ps" != "xyes" && "x$found_ps2pdf" != "xyes"; then
  5508. if test "x$enable_pdfdocs" = "xyes"; then
  5509. AC_MSG_ERROR(At least one of the tools for PDF generation is missing)
  5510. fi
  5511. enable_pdfdocs="no"
  5512. else
  5513. enable_pdfdocs="yes"
  5514. fi
  5515. fi
  5516. AM_CONDITIONAL(GENERATE_PDF, test "x$enable_pdfdocs" = "xyes")
  5517. ])
  5518. dnl Macro to check for KDChart include and library files
  5519. dnl Availability of KDChart defaults to 'no'
  5520. AC_DEFUN([AC_TQTDESIGNER_SUPPORT],
  5521. [
  5522. AC_MSG_CHECKING([if library for TQt-Designer widgets should be installed])
  5523. AC_ARG_ENABLE(tqtdesigner,
  5524. AC_HELP_STRING([--enable-tqtdesigner],[Install KMyMoney specific widget library for TQt-Designer (default=no)]),
  5525. [
  5526. enable_tqtdesigner="$enableval"
  5527. AC_MSG_RESULT($enable_tqtdesigner)
  5528. ],
  5529. [
  5530. enable_tqtdesigner="no"
  5531. AC_MSG_RESULT($enable_tqtdesigner)
  5532. ])
  5533. AM_CONDITIONAL(INSTALL_TQTDESIGNER_SUPPORT, test "$enable_tqtdesigner" = "yes")
  5534. ])
  5535. # sqlite3.m4
  5536. # ----------
  5537. #
  5538. # Copyright 2008 by Thomas Baumgart
  5539. #
  5540. # License: See file COPYING
  5541. #
  5542. # Checks for the necessity to build our own tqt-sqlite3 support library
  5543. # and the presence of the sqlite3 development headers.
  5544. #
  5545. # Supports the following options:
  5546. #
  5547. # --enable-sqlite3
  5548. # --disable-sqlite3
  5549. #
  5550. # If none of them is present, the detection is automatic. If the development
  5551. # headers are not found for automatic detection, the generation will be
  5552. # disabled w/o error. If --enable-sqlite3 is provided in the same stage,
  5553. # an error is given if the sqlite3 development files are not installed.
  5554. #
  5555. # The following variables are provided via AC_SUBST:
  5556. #
  5557. # SQLITE3 - contains the subdirectory to visit for compilation
  5558. # LIBSQLITE3 - contains the full pathname for the TQt plugin driver
  5559. AC_DEFUN([AC_SQLITE3], [
  5560. AC_MSG_CHECKING(if the SQLITE3 support is desired)
  5561. AC_ARG_ENABLE(sqlite3,
  5562. AC_HELP_STRING([--enable-sqlite3],[build SQLITE3 support library (default=auto)]),
  5563. enable_sqlite3="$enableval",
  5564. enable_sqlite3="auto")
  5565. AC_MSG_RESULT($enable_sqlite3)
  5566. if test ! $enable_sqlite3 = no; then
  5567. # determine name and path of sqlite3 plugin library
  5568. tqtlib=""
  5569. if test ! "lib${tdelibsuff}" = "lib"; then
  5570. tqtlib=".lib64"
  5571. fi
  5572. if test x$TQTDIR = x; then
  5573. TQTDIR=`dirname $MOC`
  5574. TQTDIR=${TQTDIR%/bin}
  5575. fi
  5576. if test "$PKG_CONFIG" != "no" ; then
  5577. if $PKG_CONFIG --exists tqt-mt ; then
  5578. tqt_plugins_dir="`pkg-config --variable=pluginsdir tqt-mt`"
  5579. fi
  5580. fi
  5581. if test "x$tqt_plugins_dir" = "x"; then
  5582. tqt_plugins_dir=${TQTDIR}/plugins
  5583. fi
  5584. LIBSQLITE3=${tqt_plugins_dir}/sqldrivers/libqsqlite3${tqtlib}.so
  5585. # do the checks
  5586. if test $enable_sqlite3 = auto; then
  5587. AC_MSG_CHECKING(if the SQLITE3 support is already present)
  5588. if test ! -e ${LIBSQLITE3}; then
  5589. result=no
  5590. else
  5591. # add check for local tqt-sqlite3 directory here
  5592. result=yes
  5593. enable_sqlite3=no
  5594. # in case a previous run unpacked the SQLITE3 support stuff
  5595. # it is pretty sure that we have build the existing support
  5596. # if that's the case, we just enable it again
  5597. if test -d tqt-sqlite3-0.2; then
  5598. enable_sqlite3=auto
  5599. fi
  5600. fi
  5601. AC_MSG_RESULT($result)
  5602. fi
  5603. # we only need to check for the headers in case we need to build
  5604. if test ! $enable_sqlite3 = no; then
  5605. # now check for the presence of SQLITE libraries
  5606. AC_CHECK_HEADER([sqlite3.h], [enable_sqlite3=yes],
  5607. [
  5608. if test $enable_sqlite3 = auto; then
  5609. enable_sqlite3=no
  5610. else
  5611. AC_MSG_ERROR(SQLITE development files not found)
  5612. fi
  5613. ])
  5614. fi
  5615. fi
  5616. if test $enable_sqlite3 = yes; then
  5617. AC_MSG_CHECKING(if the environment variable TQTDIR is set)
  5618. if test x$TQTDIR = x; then
  5619. AC_MSG_ERROR(TQTDIR not set)
  5620. fi
  5621. AC_MSG_RESULT($TQTDIR)
  5622. ac_qmake=${TQTDIR}/bin/qmake
  5623. AC_ARG_WITH(qmake,
  5624. AC_HELP_STRING([--with-qmake=PATH],[which version of QMake to use ]),
  5625. [ ac_qmake="$withval" ])
  5626. fi
  5627. if test $enable_sqlite3 = yes; then
  5628. rm -rf tqt-sqlite3-0.2
  5629. gunzip -c `dirname -- ${0}`/23011-tqt-sqlite3-0.2.tar.gz | tar -xf -
  5630. cd tqt-sqlite3-0.2
  5631. ${ac_qmake} QMAKE=${ac_qmake}
  5632. SQLITE3=tqt-sqlite3-0.2
  5633. sed -i s/^install:.*$// Makefile
  5634. sed -i s/^uninstall:.*$// Makefile
  5635. # create the targets required for 'make distcheck' and 'make [un]install'
  5636. cat >> Makefile <<EOF
  5637. dvi:
  5638. check:
  5639. installcheck:
  5640. distuninstallcheck:
  5641. dist:
  5642. distcleancheck:
  5643. # for installation and de-installation we need to take care
  5644. # of the _inst case which is caused by running 'make distcheck'
  5645. install:
  5646. if test ! x$SQLITE3 = x; then \
  5647. if test "x\$(DESTDIR)" = "x" -a "${prefix:0-5}" = "_inst"; then \
  5648. /bin/sh ../$ac_aux_dir/mkinstalldirs \`dirname ${prefix}${LIBSQLITE3}\`; \
  5649. ${INSTALL} sqldrivers/libqsqlite3.so ${prefix}${LIBSQLITE3}; \
  5650. chmod 755 ${prefix}${LIBSQLITE3}; \
  5651. else \
  5652. /bin/sh ../$ac_aux_dir/mkinstalldirs \`dirname \$(DESTDIR)${LIBSQLITE3}\`; \
  5653. ${INSTALL} sqldrivers/libqsqlite3.so \$(DESTDIR)${LIBSQLITE3}; \
  5654. chmod 755 \$(DESTDIR)${LIBSQLITE3}; \
  5655. fi \
  5656. fi
  5657. uninstall:
  5658. if test ! x$SQLITE3 = x; then \
  5659. if test "x\$(DESTDIR)" = "x" -a "${prefix:0-5}" = "_inst"; then \
  5660. rm -rf ${prefix}${LIBSQLITE3}; \
  5661. else \
  5662. rm -rf \$(DESTDIR)${LIBSQLITE3}; \
  5663. fi \
  5664. fi
  5665. EOF
  5666. cd ..
  5667. AC_SUBST(SQLITE3)
  5668. AC_SUBST(LIBSQLITE3)
  5669. fi
  5670. ])