KnowIt – tool for managing notes
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 345KB

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