krename
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 386KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332
  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([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  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(program-name, variable-name, list-of-dirs,
  163. dnl if-not-found, test-parameter, prepend-path)
  164. dnl
  165. dnl Look for program-name in list-of-dirs+$PATH.
  166. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  167. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  168. dnl test-parameter: if set, the program is executed with this arg,
  169. dnl and only a successful exit code is required.
  170. AC_DEFUN([KDE_FIND_PATH],
  171. [
  172. AC_MSG_CHECKING([for $1])
  173. if test -n "$$2"; then
  174. kde_cv_path="$$2";
  175. else
  176. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  177. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  178. [
  179. kde_cv_path="NONE"
  180. kde_save_IFS=$IFS
  181. IFS=':'
  182. dirs=""
  183. for dir in $PATH; do
  184. dirs="$dirs $dir"
  185. done
  186. if test -z "$6"; then dnl Append dirs in PATH (default)
  187. dirs="$3 $dirs"
  188. else dnl Prepend dirs in PATH (if 6th arg is set)
  189. dirs="$dirs $3"
  190. fi
  191. IFS=$kde_save_IFS
  192. for dir in $dirs; do
  193. if test -x "$dir/$1"; then
  194. if test -n "$5"
  195. then
  196. evalstr="$dir/$1 $5 2>&1 "
  197. if eval $evalstr; then
  198. kde_cv_path="$dir/$1"
  199. break
  200. fi
  201. else
  202. kde_cv_path="$dir/$1"
  203. break
  204. fi
  205. fi
  206. done
  207. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  208. ])
  209. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  210. fi
  211. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  212. AC_MSG_RESULT(not found)
  213. $4
  214. else
  215. AC_MSG_RESULT($kde_cv_path)
  216. $2=$kde_cv_path
  217. fi
  218. ])
  219. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  220. [
  221. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  222. Please check whether you installed Qt correctly.
  223. You need to have a running moc binary.
  224. configure tried to run $ac_cv_path_moc and the test didn't
  225. succeed. If configure shouldn't have tried this one, set
  226. the environment variable MOC to the right one before running
  227. configure.
  228. ])
  229. ])
  230. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  231. [
  232. AC_MSG_WARN([No Qt ui compiler (uic) found!
  233. Please check whether you installed Qt correctly.
  234. You need to have a running uic binary.
  235. configure tried to run $ac_cv_path_uic and the test didn't
  236. succeed. If configure shouldn't have tried this one, set
  237. the environment variable UIC to the right one before running
  238. configure.
  239. ])
  240. ])
  241. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  242. [
  243. AC_MSG_CHECKING([whether uic supports -$1 ])
  244. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  245. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  246. [
  247. cat >conftest.ui <<EOT
  248. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  249. EOT
  250. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  251. if AC_TRY_EVAL(ac_uic_testrun); then
  252. eval "kde_cv_prog_uic_$kde_cache=yes"
  253. else
  254. eval "kde_cv_prog_uic_$kde_cache=no"
  255. fi
  256. rm -f conftest*
  257. ])
  258. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  259. AC_MSG_RESULT([yes])
  260. :
  261. $3
  262. else
  263. AC_MSG_RESULT([no])
  264. :
  265. $4
  266. fi
  267. ])
  268. dnl ------------------------------------------------------------------------
  269. dnl Find the meta object compiler and the ui compiler in the PATH,
  270. dnl in $TQTDIR/bin, and some more usual places
  271. dnl ------------------------------------------------------------------------
  272. dnl
  273. AC_DEFUN([AC_PATH_TQT_MOC_UIC],
  274. [
  275. AC_REQUIRE([KDE_CHECK_PERL])
  276. qt_bindirs=""
  277. for dir in $kde_qt_dirs; do
  278. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  279. done
  280. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  281. if test ! "$ac_qt_bindir" = "NO"; then
  282. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  283. fi
  284. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  285. if test -z "$UIC_NOT_NEEDED"; then
  286. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  287. if test -z "$UIC_PATH" ; then
  288. KDE_UIC_ERROR_MESSAGE
  289. exit 1
  290. else
  291. UIC=$UIC_PATH
  292. if test $kde_qtver = 3; then
  293. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  294. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  295. if test x$ac_uic_supports_libpath = xyes; then
  296. UIC="$UIC -L \$(kde_widgetdir)"
  297. fi
  298. if test x$ac_uic_supports_nounload = xyes; then
  299. UIC="$UIC -nounload"
  300. fi
  301. fi
  302. fi
  303. else
  304. UIC="echo uic not available: "
  305. fi
  306. AC_SUBST(MOC)
  307. AC_SUBST(UIC)
  308. UIC_TR="i18n"
  309. if test $kde_qtver = 3; then
  310. UIC_TR="tr2i18n"
  311. fi
  312. AC_SUBST(UIC_TR)
  313. ])
  314. AC_DEFUN([KDE_1_CHECK_PATHS],
  315. [
  316. KDE_1_CHECK_PATH_HEADERS
  317. KDE_TEST_RPATH=
  318. if test -n "$USE_RPATH"; then
  319. if test -n "$kde_libraries"; then
  320. KDE_TEST_RPATH="-R $kde_libraries"
  321. fi
  322. if test -n "$qt_libraries"; then
  323. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  324. fi
  325. if test -n "$x_libraries"; then
  326. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  327. fi
  328. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  329. fi
  330. AC_MSG_CHECKING([for KDE libraries installed])
  331. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -ltdecore $LIBTQT $KDE_TEST_RPATH 1>&5'
  332. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  333. AC_MSG_RESULT(yes)
  334. else
  335. AC_MSG_ERROR([your system fails at linking a small KDE application!
  336. Check, if your compiler is installed correctly and if you have used the
  337. same compiler to compile Qt and tdelibs as you did use now.
  338. For more details about this problem, look at the end of config.log.])
  339. fi
  340. if eval `TDEDIR= ./conftest 2>&5`; then
  341. kde_result=done
  342. else
  343. kde_result=problems
  344. fi
  345. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  346. kde_have_all_paths=yes
  347. KDE_SET_PATHS($kde_result)
  348. ])
  349. AC_DEFUN([KDE_SET_PATHS],
  350. [
  351. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  352. kde_htmldir=\"$kde_htmldir\" \
  353. kde_appsdir=\"$kde_appsdir\" \
  354. kde_icondir=\"$kde_icondir\" \
  355. kde_sounddir=\"$kde_sounddir\" \
  356. kde_datadir=\"$kde_datadir\" \
  357. kde_locale=\"$kde_locale\" \
  358. kde_cgidir=\"$kde_cgidir\" \
  359. kde_confdir=\"$kde_confdir\" \
  360. kde_kcfgdir=\"$kde_kcfgdir\" \
  361. kde_mimedir=\"$kde_mimedir\" \
  362. kde_toolbardir=\"$kde_toolbardir\" \
  363. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  364. kde_templatesdir=\"$kde_templatesdir\" \
  365. kde_bindir=\"$kde_bindir\" \
  366. kde_servicesdir=\"$kde_servicesdir\" \
  367. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  368. kde_moduledir=\"$kde_moduledir\" \
  369. kde_styledir=\"$kde_styledir\" \
  370. kde_widgetdir=\"$kde_widgetdir\" \
  371. xdg_appsdir=\"$xdg_appsdir\" \
  372. xdg_menudir=\"$xdg_menudir\" \
  373. xdg_directorydir=\"$xdg_directorydir\" \
  374. kde_result=$1"
  375. ])
  376. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  377. [
  378. if test "$1" = "default"; then
  379. if test -z "$kde_htmldir"; then
  380. kde_htmldir='\${datadir}/doc/tde/HTML'
  381. fi
  382. if test -z "$kde_appsdir"; then
  383. kde_appsdir='\${datadir}/applnk'
  384. fi
  385. if test -z "$kde_icondir"; then
  386. kde_icondir='\${datadir}/icons'
  387. fi
  388. if test -z "$kde_sounddir"; then
  389. kde_sounddir='\${datadir}/sounds'
  390. fi
  391. if test -z "$kde_datadir"; then
  392. kde_datadir='\${datadir}/apps'
  393. fi
  394. if test -z "$kde_locale"; then
  395. kde_locale='\${datadir}/locale'
  396. fi
  397. if test -z "$kde_cgidir"; then
  398. kde_cgidir='\${exec_prefix}/cgi-bin'
  399. fi
  400. if test -z "$kde_confdir"; then
  401. kde_confdir='\${datadir}/config'
  402. fi
  403. if test -z "$kde_kcfgdir"; then
  404. kde_kcfgdir='\${datadir}/config.kcfg'
  405. fi
  406. if test -z "$kde_mimedir"; then
  407. kde_mimedir='\${datadir}/mimelnk'
  408. fi
  409. if test -z "$kde_toolbardir"; then
  410. kde_toolbardir='\${datadir}/toolbar'
  411. fi
  412. if test -z "$kde_wallpaperdir"; then
  413. kde_wallpaperdir='\${datadir}/wallpapers'
  414. fi
  415. if test -z "$kde_templatesdir"; then
  416. kde_templatesdir='\${datadir}/templates'
  417. fi
  418. if test -z "$kde_bindir"; then
  419. kde_bindir='\${exec_prefix}/bin'
  420. fi
  421. if test -z "$kde_servicesdir"; then
  422. kde_servicesdir='\${datadir}/services'
  423. fi
  424. if test -z "$kde_servicetypesdir"; then
  425. kde_servicetypesdir='\${datadir}/servicetypes'
  426. fi
  427. if test -z "$kde_moduledir"; then
  428. if test "$kde_qtver" = "2"; then
  429. kde_moduledir='\${libdir}/kde2'
  430. else
  431. kde_moduledir='\${libdir}/trinity'
  432. fi
  433. fi
  434. if test -z "$kde_styledir"; then
  435. kde_styledir='\${libdir}/trinity/plugins/styles'
  436. fi
  437. if test -z "$kde_widgetdir"; then
  438. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  439. fi
  440. if test -z "$xdg_appsdir"; then
  441. xdg_appsdir='\${datadir}/applications/tde'
  442. fi
  443. if test -z "$xdg_menudir"; then
  444. xdg_menudir='\${sysconfdir}/xdg/menus'
  445. fi
  446. if test -z "$xdg_directorydir"; then
  447. xdg_directorydir='\${datadir}/desktop-directories'
  448. fi
  449. KDE_SET_PATHS(defaults)
  450. else
  451. if test $kde_qtver = 1; then
  452. AC_MSG_RESULT([compiling])
  453. KDE_1_CHECK_PATHS
  454. else
  455. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  456. fi
  457. fi
  458. ])
  459. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  460. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  461. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  462. test -z "$kde_datadir" || test -z "$kde_locale" ||
  463. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  464. test -z "$kde_kcfgdir" ||
  465. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  466. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  467. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  468. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  469. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  470. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  471. test "x$kde_have_all_paths" != "xyes"; then
  472. kde_have_all_paths=no
  473. fi
  474. ])
  475. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  476. [
  477. AC_MSG_ERROR([The important program $1 was not found!
  478. Please check whether you installed KDE correctly.
  479. ])
  480. ])
  481. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  482. [
  483. AC_MSG_ERROR([The important program $1 was not found!
  484. Please check whether you installed aRts correctly or use
  485. --without-arts to compile without aRts support (this will remove functionality).
  486. ])
  487. ])
  488. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  489. [
  490. 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"
  491. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  492. if test -n "$TDEDIRS"; then
  493. kde_save_IFS=$IFS
  494. IFS=:
  495. for dir in $TDEDIRS; do
  496. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  497. done
  498. IFS=$kde_save_IFS
  499. fi
  500. ])
  501. AC_DEFUN([KDE_SUBST_PROGRAMS],
  502. [
  503. AC_ARG_WITH(arts,
  504. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  505. [build_arts=$withval],
  506. [build_arts=yes]
  507. )
  508. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  509. if test "$build_arts" = "no"; then
  510. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  511. fi
  512. KDE_SET_DEFAULT_BINDIRS
  513. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  514. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  515. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  516. if test "$build_arts" '!=' "no"; then
  517. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  518. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  519. fi
  520. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  521. trinity2ornewer=1
  522. trinity3ornewer=1
  523. if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
  524. trinity2ornewer=
  525. trinity3ornewer=
  526. else
  527. if test "$kde_qtver" = "3"; then
  528. if test "$kde_qtsubver" -le 1; then
  529. trinity2ornewer=
  530. fi
  531. if test "$kde_qtsubver" -le 2; then
  532. trinity3ornewer=
  533. fi
  534. if test "$KDECONFIG" != "compiled"; then
  535. if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
  536. trinity3ornewer=
  537. fi
  538. fi
  539. fi
  540. fi
  541. if test -n "$trinity2ornewer"; then
  542. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  543. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  544. fi
  545. if test -n "$trinity3ornewer"; then
  546. KDE_FIND_PATH(maketdewidgets, MAKETDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(maketdewidgets)])
  547. AC_SUBST(MAKETDEWIDGETS)
  548. fi
  549. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  550. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  551. kde_sharedirs="$prefix/share /opt/trinity/share /opt/trinity/share /opt/kde/share /usr/share/kde /usr/local/share /usr/share"
  552. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  553. AC_FIND_FILE(apps/ksgmltools2/customization/tde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  554. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  555. KDE_XSL_STYLESHEET=""
  556. else
  557. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/tde-chunk.xsl"
  558. fi
  559. fi
  560. DCOP_DEPENDENCIES='$(DCOPIDL)'
  561. if test -n "$trinity2ornewer"; then
  562. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  563. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  564. AC_SUBST(KCONFIG_COMPILER)
  565. AC_SUBST(KCFG_DEPENDENCIES)
  566. AC_SUBST(DCOPIDLNG)
  567. fi
  568. AC_SUBST(DCOPIDL)
  569. AC_SUBST(DCOPIDL2CPP)
  570. AC_SUBST(DCOP_DEPENDENCIES)
  571. AC_SUBST(MCOPIDL)
  572. AC_SUBST(ARTSCCONFIG)
  573. AC_SUBST(MEINPROC)
  574. AC_SUBST(KDE_XSL_STYLESHEET)
  575. AC_SUBST(XMLLINT)
  576. ])dnl
  577. AC_DEFUN([AC_CREATE_KFSSTND],
  578. [
  579. AC_REQUIRE([AC_CHECK_RPATH])
  580. AC_MSG_CHECKING([for KDE paths])
  581. kde_result=""
  582. kde_cached_paths=yes
  583. AC_CACHE_VAL(kde_cv_all_paths,
  584. [
  585. KDE_SET_DEFAULT_PATHS($1)
  586. kde_cached_paths=no
  587. ])
  588. eval "$kde_cv_all_paths"
  589. KDE_CHECK_PATHS_FOR_COMPLETENESS
  590. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  591. # wrong values were cached, may be, we can set better ones
  592. kde_result=
  593. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  594. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  595. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  596. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  597. kde_have_all_paths=
  598. kde_styledir=
  599. kde_widgetdir=
  600. xdg_appsdir = xdg_menudir= xdg_directorydir=
  601. KDE_SET_DEFAULT_PATHS($1)
  602. eval "$kde_cv_all_paths"
  603. KDE_CHECK_PATHS_FOR_COMPLETENESS
  604. kde_result="$kde_result (cache overridden)"
  605. fi
  606. if test "$kde_have_all_paths" = "no"; then
  607. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  608. Since it had compiled and linked before, it must be a strange problem on your system.
  609. Look at config.log for details. If you are not able to fix this, look at
  610. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  611. (If you're using an egcs version on Linux, you may update binutils!)
  612. ])
  613. else
  614. rm -f conftest*
  615. AC_MSG_RESULT($kde_result)
  616. fi
  617. bindir=$kde_bindir
  618. KDE_SUBST_PROGRAMS
  619. ])
  620. AC_DEFUN([AC_SUBST_KFSSTND],
  621. [
  622. AC_SUBST(kde_htmldir)
  623. AC_SUBST(kde_appsdir)
  624. AC_SUBST(kde_icondir)
  625. AC_SUBST(kde_sounddir)
  626. AC_SUBST(kde_datadir)
  627. AC_SUBST(kde_locale)
  628. AC_SUBST(kde_confdir)
  629. AC_SUBST(kde_kcfgdir)
  630. AC_SUBST(kde_mimedir)
  631. AC_SUBST(kde_wallpaperdir)
  632. AC_SUBST(kde_bindir)
  633. dnl X Desktop Group standards
  634. AC_SUBST(xdg_appsdir)
  635. AC_SUBST(xdg_menudir)
  636. AC_SUBST(xdg_directorydir)
  637. dnl for KDE 2
  638. AC_SUBST(kde_templatesdir)
  639. AC_SUBST(kde_servicesdir)
  640. AC_SUBST(kde_servicetypesdir)
  641. AC_SUBST(kde_moduledir)
  642. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  643. AC_SUBST(kde_styledir)
  644. AC_SUBST(kde_widgetdir)
  645. if test "$kde_qtver" = 1; then
  646. kde_minidir="$kde_icondir/mini"
  647. else
  648. # for KDE 1 - this breaks KDE2 apps using minidir, but
  649. # that's the plan ;-/
  650. kde_minidir="/dev/null"
  651. fi
  652. dnl AC_SUBST(kde_minidir)
  653. dnl AC_SUBST(kde_cgidir)
  654. dnl AC_SUBST(kde_toolbardir)
  655. ])
  656. AC_DEFUN([KDE_MISC_TESTS],
  657. [
  658. dnl Checks for libraries.
  659. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  660. AC_SUBST(LIBUTIL)
  661. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  662. AC_SUBST(LIBCOMPAT)
  663. kde_have_crypt=
  664. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  665. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  666. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  667. You should install libcrypt from another source or configure with PAM
  668. support])
  669. kde_have_crypt=no
  670. ]))
  671. AC_SUBST(LIBCRYPT)
  672. if test $kde_have_crypt = yes; then
  673. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  674. fi
  675. AC_CHECK_SOCKLEN_T
  676. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  677. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  678. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  679. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  680. fi
  681. AC_CHECK_FUNC(inet_ntoa)
  682. if test $ac_cv_func_inet_ntoa = no; then
  683. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  684. fi
  685. AC_CHECK_FUNC(connect)
  686. if test $ac_cv_func_connect = no; then
  687. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  688. $X_EXTRA_LIBS)
  689. fi
  690. AC_CHECK_FUNC(remove)
  691. if test $ac_cv_func_remove = no; then
  692. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  693. fi
  694. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  695. AC_CHECK_FUNC(shmat, ,
  696. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  697. # more headers that need to be explicitly included on darwin
  698. AC_CHECK_HEADERS(sys/types.h stdint.h)
  699. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  700. AC_CHECK_HEADERS(sys/bitypes.h)
  701. # darwin requires a poll emulation library
  702. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  703. # for some image handling on Mac OS X
  704. AC_CHECK_HEADERS(Carbon/Carbon.h)
  705. # CoreAudio framework
  706. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  707. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  708. FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio"
  709. ])
  710. AC_CHECK_RES_INIT
  711. AC_SUBST(LIB_POLL)
  712. AC_SUBST(FRAMEWORK_COREAUDIO)
  713. LIBSOCKET="$X_EXTRA_LIBS"
  714. AC_SUBST(LIBSOCKET)
  715. AC_SUBST(X_EXTRA_LIBS)
  716. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  717. AC_SUBST(LIBUCB)
  718. case $host in dnl this *is* LynxOS specific
  719. *-*-lynxos* )
  720. AC_MSG_CHECKING([LynxOS header file wrappers])
  721. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  722. AC_MSG_RESULT(disabled)
  723. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  724. ;;
  725. esac
  726. KDE_CHECK_TYPES
  727. KDE_CHECK_LIBDL
  728. KDE_CHECK_STRLCPY
  729. KDE_CHECK_PIE_SUPPORT
  730. # darwin needs this to initialize the environment
  731. AC_CHECK_HEADERS(crt_externs.h)
  732. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  733. AH_VERBATIM(_DARWIN_ENVIRON,
  734. [
  735. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  736. # include <sys/time.h>
  737. # include <crt_externs.h>
  738. # define environ (*_NSGetEnviron())
  739. #endif
  740. ])
  741. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  742. [
  743. /*
  744. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  745. * that defines bzero.
  746. */
  747. #if defined(_AIX)
  748. #include <strings.h>
  749. #endif
  750. ])
  751. AC_CHECK_FUNCS([vsnprintf snprintf])
  752. AH_VERBATIM(_TRU64,[
  753. /*
  754. * On HP-UX, the declaration of vsnprintf() is needed every time !
  755. */
  756. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  757. #if __STDC__
  758. #include <stdarg.h>
  759. #include <stdlib.h>
  760. #else
  761. #include <varargs.h>
  762. #endif
  763. #ifdef __cplusplus
  764. extern "C"
  765. #endif
  766. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  767. #ifdef __cplusplus
  768. extern "C"
  769. #endif
  770. int snprintf(char *str, size_t n, char const *fmt, ...);
  771. #endif
  772. ])
  773. ])
  774. dnl ------------------------------------------------------------------------
  775. dnl Find the header files and libraries for X-Windows. Extended the
  776. dnl macro AC_PATH_X
  777. dnl ------------------------------------------------------------------------
  778. dnl
  779. AC_DEFUN([K_PATH_X],
  780. [
  781. AC_REQUIRE([KDE_MISC_TESTS])dnl
  782. AC_REQUIRE([KDE_CHECK_LIB64])
  783. AC_ARG_ENABLE(
  784. embedded,
  785. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  786. kde_use_qt_emb=$enableval,
  787. kde_use_qt_emb=no
  788. )
  789. AC_ARG_ENABLE(
  790. qtopia,
  791. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  792. kde_use_qt_emb_palm=$enableval,
  793. kde_use_qt_emb_palm=no
  794. )
  795. AC_ARG_ENABLE(
  796. mac,
  797. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  798. kde_use_qt_mac=$enableval,
  799. kde_use_qt_mac=no
  800. )
  801. # used to disable x11-specific stuff on special platforms
  802. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  803. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  804. AC_MSG_CHECKING(for X)
  805. AC_CACHE_VAL(kde_cv_have_x,
  806. [# One or both of the vars are not set, and there is no cached value.
  807. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  808. kde_x_includes=NO
  809. else
  810. kde_x_includes=$x_includes
  811. fi
  812. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  813. kde_x_libraries=NO
  814. else
  815. kde_x_libraries=$x_libraries
  816. fi
  817. # below we use the standard autoconf calls
  818. ac_x_libraries=$kde_x_libraries
  819. ac_x_includes=$kde_x_includes
  820. KDE_PATH_X_DIRECT
  821. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  822. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  823. dnl location. The correct location is /usr/lib32 or an undefined value
  824. dnl (the linker is smart enough to pick the correct default library).
  825. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  826. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  827. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  828. dnl x_includes should be left alone.
  829. case "$host" in
  830. mips-sgi-irix6*)
  831. ;;
  832. *-*-solaris*)
  833. ;;
  834. *)
  835. _AC_PATH_X_XMKMF
  836. if test -z "$ac_x_includes"; then
  837. ac_x_includes="."
  838. fi
  839. if test -z "$ac_x_libraries"; then
  840. ac_x_libraries="/usr/lib${tdelibsuff}"
  841. fi
  842. esac
  843. #from now on we use our own again
  844. # when the user already gave --x-includes, we ignore
  845. # what the standard autoconf macros told us.
  846. if test "$kde_x_includes" = NO; then
  847. kde_x_includes=$ac_x_includes
  848. fi
  849. # for --x-libraries too
  850. if test "$kde_x_libraries" = NO; then
  851. kde_x_libraries=$ac_x_libraries
  852. fi
  853. if test "$kde_x_includes" = NO; then
  854. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  855. fi
  856. if test "$kde_x_libraries" = NO; then
  857. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  858. fi
  859. # Record where we found X for the cache.
  860. kde_cv_have_x="have_x=yes \
  861. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  862. ])dnl
  863. eval "$kde_cv_have_x"
  864. if test "$have_x" != yes; then
  865. AC_MSG_RESULT($have_x)
  866. no_x=yes
  867. else
  868. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  869. fi
  870. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  871. X_INCLUDES=""
  872. x_includes="."; dnl better than nothing :-
  873. else
  874. x_includes=$kde_x_includes
  875. X_INCLUDES="-I$x_includes"
  876. fi
  877. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  878. X_LDFLAGS=""
  879. x_libraries="/usr/lib"; dnl better than nothing :-
  880. else
  881. x_libraries=$kde_x_libraries
  882. X_LDFLAGS="-L$x_libraries"
  883. fi
  884. all_includes="$X_INCLUDES"
  885. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  886. # Check for libraries that X11R6 Xt/Xaw programs need.
  887. ac_save_LDFLAGS="$LDFLAGS"
  888. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  889. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  890. # check for ICE first), but we must link in the order -lSM -lICE or
  891. # we get undefined symbols. So assume we have SM if we have ICE.
  892. # These have to be linked with before -lX11, unlike the other
  893. # libraries we check for below, so use a different variable.
  894. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  895. AC_CHECK_LIB(ICE, IceConnectionNumber,
  896. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  897. LDFLAGS="$ac_save_LDFLAGS"
  898. LIB_X11='-lX11 $(LIBSOCKET)'
  899. AC_MSG_CHECKING(for libXext)
  900. AC_CACHE_VAL(kde_cv_have_libXext,
  901. [
  902. kde_ldflags_safe="$LDFLAGS"
  903. kde_libs_safe="$LIBS"
  904. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  905. LIBS="-lXext -lX11 $LIBSOCKET"
  906. AC_TRY_LINK([
  907. #include <stdio.h>
  908. #ifdef STDC_HEADERS
  909. # include <stdlib.h>
  910. #endif
  911. ],
  912. [
  913. printf("hello Xext\n");
  914. ],
  915. kde_cv_have_libXext=yes,
  916. kde_cv_have_libXext=no
  917. )
  918. LDFLAGS=$kde_ldflags_safe
  919. LIBS=$kde_libs_safe
  920. ])
  921. AC_MSG_RESULT($kde_cv_have_libXext)
  922. if test "$kde_cv_have_libXext" = "no"; then
  923. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  924. can't find it itself, we stop here assuming that make wouldn't find
  925. them either.])
  926. fi
  927. LIB_XEXT="-lXext"
  928. QTE_NORTTI=""
  929. elif test "$kde_use_qt_emb" = "yes"; then
  930. dnl We're using QT Embedded
  931. CPPFLAGS=-DQWS
  932. CXXFLAGS="$CXXFLAGS -fno-rtti"
  933. QTE_NORTTI="-fno-rtti -DQWS"
  934. X_PRE_LIBS=""
  935. LIB_X11=""
  936. LIB_XEXT=""
  937. LIB_XRENDER=""
  938. LIBSM=""
  939. X_INCLUDES=""
  940. X_LDFLAGS=""
  941. x_includes=""
  942. x_libraries=""
  943. elif test "$kde_use_qt_mac" = "yes"; then
  944. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  945. dnl be included to get the information) --Sam
  946. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  947. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  948. X_PRE_LIBS=""
  949. LIB_X11=""
  950. LIB_XEXT=""
  951. LIB_XRENDER=""
  952. LIBSM=""
  953. X_INCLUDES=""
  954. X_LDFLAGS=""
  955. x_includes=""
  956. x_libraries=""
  957. fi
  958. AC_SUBST(X_PRE_LIBS)
  959. AC_SUBST(LIB_X11)
  960. AC_SUBST(LIB_XRENDER)
  961. AC_SUBST(LIBSM)
  962. AC_SUBST(X_INCLUDES)
  963. AC_SUBST(X_LDFLAGS)
  964. AC_SUBST(x_includes)
  965. AC_SUBST(x_libraries)
  966. AC_SUBST(QTE_NORTTI)
  967. AC_SUBST(LIB_XEXT)
  968. ])
  969. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  970. [
  971. AC_REQUIRE([KDE_USE_TQT])
  972. cat > conftest.$ac_ext <<EOF
  973. #include "confdefs.h"
  974. #include <qglobal.h>
  975. #include <qapplication.h>
  976. EOF
  977. if test "$kde_qtver" = "2"; then
  978. cat >> conftest.$ac_ext <<EOF
  979. #include <qevent.h>
  980. #include <qstring.h>
  981. #include <qstyle.h>
  982. EOF
  983. if test $kde_qtsubver -gt 0; then
  984. cat >> conftest.$ac_ext <<EOF
  985. #if TQT_VERSION < 210
  986. #error 1
  987. #endif
  988. EOF
  989. fi
  990. fi
  991. if test "$kde_qtver" = "3"; then
  992. cat >> conftest.$ac_ext <<EOF
  993. #include <qcursor.h>
  994. #include <qstylefactory.h>
  995. #include <private/qucomextra_p.h>
  996. EOF
  997. fi
  998. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  999. cat >> conftest.$ac_ext <<EOF
  1000. #error 1
  1001. #endif
  1002. int main() {
  1003. EOF
  1004. if test "$kde_qtver" = "2"; then
  1005. cat >> conftest.$ac_ext <<EOF
  1006. QStringList *t = new QStringList();
  1007. Q_UNUSED(t);
  1008. EOF
  1009. if test $kde_qtsubver -gt 0; then
  1010. cat >> conftest.$ac_ext <<EOF
  1011. QString s;
  1012. s.setLatin1("Elvis is alive", 14);
  1013. EOF
  1014. fi
  1015. fi
  1016. if test "$kde_qtver" = "3"; then
  1017. cat >> conftest.$ac_ext <<EOF
  1018. (void)QStyleFactory::create(QString::null);
  1019. QCursor c(Qt::WhatsThisCursor);
  1020. EOF
  1021. fi
  1022. cat >> conftest.$ac_ext <<EOF
  1023. return 0;
  1024. }
  1025. EOF
  1026. ])
  1027. AC_DEFUN([KDE_USE_TQT],
  1028. [
  1029. if test -z "$1"; then
  1030. # Current default Qt version: 3.3
  1031. kde_qtver=3
  1032. kde_qtsubver=3
  1033. else
  1034. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1035. # following is the check if subversion isnt found in passed argument
  1036. if test "$kde_qtsubver" = "$1"; then
  1037. kde_qtsubver=1
  1038. fi
  1039. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1040. if test "$kde_qtver" = "1"; then
  1041. kde_qtsubver=42
  1042. fi
  1043. fi
  1044. if test -z "$2"; then
  1045. if test "$kde_qtver" = "2"; then
  1046. if test $kde_qtsubver -gt 0; then
  1047. kde_qt_minversion=">= Qt 2.2.2"
  1048. else
  1049. kde_qt_minversion=">= Qt 2.0.2"
  1050. fi
  1051. fi
  1052. if test "$kde_qtver" = "3"; then
  1053. if test $kde_qtsubver -gt 0; then
  1054. if test $kde_qtsubver -gt 1; then
  1055. if test $kde_qtsubver -gt 2; then
  1056. kde_qt_minversion=">= Qt 3.3 and < 4.0"
  1057. else
  1058. kde_qt_minversion=">= Qt 3.2 and < 4.0"
  1059. fi
  1060. else
  1061. kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
  1062. fi
  1063. else
  1064. kde_qt_minversion=">= Qt 3.0 and < 4.0"
  1065. fi
  1066. fi
  1067. if test "$kde_qtver" = "1"; then
  1068. kde_qt_minversion=">= 1.42 and < 2.0"
  1069. fi
  1070. else
  1071. kde_qt_minversion="$2"
  1072. fi
  1073. if test -z "$3"; then
  1074. if test $kde_qtver = 3; then
  1075. if test $kde_qtsubver -gt 0; then
  1076. kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1077. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1078. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1079. else
  1080. kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1081. fi
  1082. fi
  1083. if test $kde_qtver = 2; then
  1084. if test $kde_qtsubver -gt 0; then
  1085. kde_qt_verstring="TQT_VERSION >= 222"
  1086. else
  1087. kde_qt_verstring="TQT_VERSION >= 200"
  1088. fi
  1089. fi
  1090. if test $kde_qtver = 1; then
  1091. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1092. fi
  1093. else
  1094. kde_qt_verstring="$3"
  1095. fi
  1096. if test $kde_qtver = 4; then
  1097. kde_qt_dirs="$TQTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
  1098. fi
  1099. if test $kde_qtver = 3; then
  1100. kde_qt_dirs="$TQTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
  1101. fi
  1102. if test $kde_qtver = 2; then
  1103. kde_qt_dirs="$TQTDIR /usr/lib/qt2 /usr/lib/qt"
  1104. fi
  1105. if test $kde_qtver = 1; then
  1106. kde_qt_dirs="$TQTDIR /usr/lib/qt"
  1107. fi
  1108. ])
  1109. AC_DEFUN([KDE_CHECK_QT_DIRECT],
  1110. [
  1111. AC_REQUIRE([KDE_USE_TQT])
  1112. AC_MSG_CHECKING([if Qt compiles without flags])
  1113. AC_CACHE_VAL(kde_cv_qt_direct,
  1114. [
  1115. AC_LANG_SAVE
  1116. AC_LANG_CPLUSPLUS
  1117. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1118. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1119. ac_cxxflags_safe="$CXXFLAGS"
  1120. ac_ldflags_safe="$LDFLAGS"
  1121. ac_libs_safe="$LIBS"
  1122. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  1123. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1124. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1125. LIBS="$LIBTQT -lXext -lX11 $LIBSOCKET"
  1126. else
  1127. LIBS="$LIBTQT $LIBSOCKET"
  1128. fi
  1129. LD_LIBRARY_PATH=
  1130. export LD_LIBRARY_PATH
  1131. LIBRARY_PATH=
  1132. export LIBRARY_PATH
  1133. KDE_PRINT_QT_PROGRAM
  1134. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1135. kde_cv_qt_direct="yes"
  1136. else
  1137. kde_cv_qt_direct="no"
  1138. echo "configure: failed program was:" >&AC_FD_CC
  1139. cat conftest.$ac_ext >&AC_FD_CC
  1140. fi
  1141. rm -f conftest*
  1142. CXXFLAGS="$ac_cxxflags_safe"
  1143. LDFLAGS="$ac_ldflags_safe"
  1144. LIBS="$ac_libs_safe"
  1145. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1146. export LD_LIBRARY_PATH
  1147. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1148. export LIBRARY_PATH
  1149. AC_LANG_RESTORE
  1150. ])
  1151. if test "$kde_cv_qt_direct" = "yes"; then
  1152. AC_MSG_RESULT(yes)
  1153. $1
  1154. else
  1155. AC_MSG_RESULT(no)
  1156. $2
  1157. fi
  1158. ])
  1159. dnl ------------------------------------------------------------------------
  1160. dnl Try to find the Qt headers and libraries.
  1161. dnl $(QT_LDFLAGS) will be -Ltqtliblocation (if needed)
  1162. dnl and $(TQT_INCLUDES) will be -Iqthdrlocation (if needed)
  1163. dnl ------------------------------------------------------------------------
  1164. dnl
  1165. AC_DEFUN([AC_PATH_TQT_1_3],
  1166. [
  1167. AC_REQUIRE([K_PATH_X])
  1168. AC_REQUIRE([KDE_USE_TQT])
  1169. AC_REQUIRE([KDE_CHECK_LIB64])
  1170. dnl ------------------------------------------------------------------------
  1171. dnl Add configure flag to enable linking to MT version of Qt library.
  1172. dnl ------------------------------------------------------------------------
  1173. AC_ARG_ENABLE(
  1174. mt,
  1175. AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
  1176. kde_use_qt_mt=$enableval,
  1177. [
  1178. if test $kde_qtver = 3; then
  1179. kde_use_qt_mt=yes
  1180. else
  1181. kde_use_qt_mt=no
  1182. fi
  1183. ]
  1184. )
  1185. USING_QT_MT=""
  1186. dnl ------------------------------------------------------------------------
  1187. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1188. dnl ------------------------------------------------------------------------
  1189. KDE_MT_LDFLAGS=
  1190. KDE_MT_LIBS=
  1191. if test "x$kde_use_qt_mt" = "xyes"; then
  1192. KDE_CHECK_THREADING
  1193. if test "x$kde_use_threading" = "xyes"; then
  1194. CPPFLAGS="$USE_THREADS -DTQT_THREAD_SUPPORT $CPPFLAGS"
  1195. KDE_MT_LDFLAGS="$USE_THREADS"
  1196. KDE_MT_LIBS="$LIBPTHREAD"
  1197. else
  1198. kde_use_qt_mt=no
  1199. fi
  1200. fi
  1201. AC_SUBST(KDE_MT_LDFLAGS)
  1202. AC_SUBST(KDE_MT_LIBS)
  1203. kde_qt_was_given=yes
  1204. dnl ------------------------------------------------------------------------
  1205. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1206. dnl ------------------------------------------------------------------------
  1207. if test -z "$LIBTQT_GLOB"; then
  1208. if test "x$kde_use_qt_emb" = "xyes"; then
  1209. LIBTQT_GLOB="libtqte.*"
  1210. else
  1211. LIBTQT_GLOB="libtqt.*"
  1212. fi
  1213. fi
  1214. dnl ------------------------------------------------------------
  1215. dnl If we got --enable-embedded then adjust the Qt library name.
  1216. dnl ------------------------------------------------------------
  1217. if test "x$kde_use_qt_emb" = "xyes"; then
  1218. tqtlib="qte"
  1219. else
  1220. tqtlib="qt"
  1221. fi
  1222. kde_int_qt="-l$tqtlib"
  1223. if test -z "$LIBQPE"; then
  1224. dnl ------------------------------------------------------------
  1225. dnl If we got --enable-palmtop then add -lqpe to the link line
  1226. dnl ------------------------------------------------------------
  1227. if test "x$kde_use_qt_emb" = "xyes"; then
  1228. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1229. LIB_QPE="-lqpe"
  1230. else
  1231. LIB_QPE=""
  1232. fi
  1233. else
  1234. LIB_QPE=""
  1235. fi
  1236. fi
  1237. dnl ------------------------------------------------------------------------
  1238. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1239. dnl ------------------------------------------------------------------------
  1240. if test "x$kde_use_qt_mt" = "xyes"; then
  1241. LIBTQT="-l$tqtlib-mt"
  1242. kde_int_qt="-l$tqtlib-mt"
  1243. LIBTQT_GLOB="lib$tqtlib-mt.*"
  1244. USING_QT_MT="using -mt"
  1245. else
  1246. LIBTQT="-l$tqtlib"
  1247. fi
  1248. if test $kde_qtver != 1; then
  1249. AC_REQUIRE([AC_FIND_PNG])
  1250. AC_REQUIRE([AC_FIND_JPEG])
  1251. LIBTQT="$LIBTQT $LIBPNG $LIBJPEG"
  1252. fi
  1253. if test $kde_qtver = 3; then
  1254. AC_REQUIRE([KDE_CHECK_LIBDL])
  1255. LIBTQT="$LIBTQT $LIBDL"
  1256. fi
  1257. AC_MSG_CHECKING([for Qt])
  1258. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1259. LIBTQT="$LIBTQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1260. fi
  1261. ac_tqt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1262. qt_libraries=""
  1263. tqt_includes=""
  1264. AC_ARG_WITH(qt-dir,
  1265. AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
  1266. [ ac_tqt_includes="$withval"/include
  1267. ac_qt_libraries="$withval"/lib${tdelibsuff}
  1268. ac_qt_bindir="$withval"/bin
  1269. ])
  1270. AC_ARG_WITH(qt-includes,
  1271. AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
  1272. [
  1273. ac_tqt_includes="$withval"
  1274. ])
  1275. kde_qt_libs_given=no
  1276. AC_ARG_WITH(qt-libraries,
  1277. AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
  1278. [ ac_qt_libraries="$withval"
  1279. kde_qt_libs_given=yes
  1280. ])
  1281. AC_CACHE_VAL(ac_cv_have_qt,
  1282. [#try to guess Qt locations
  1283. qt_incdirs=""
  1284. for dir in $kde_qt_dirs; do
  1285. qt_incdirs="$qt_incdirs $dir/include $dir"
  1286. done
  1287. 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"
  1288. if test ! "$ac_tqt_includes" = "NO"; then
  1289. qt_incdirs="$ac_tqt_includes $qt_incdirs"
  1290. fi
  1291. if test "$kde_qtver" != "1"; then
  1292. kde_qt_header=qstyle.h
  1293. else
  1294. kde_qt_header=qglobal.h
  1295. fi
  1296. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1297. ac_tqt_includes="$qt_incdir"
  1298. qt_libdirs=""
  1299. for dir in $kde_qt_dirs; do
  1300. qt_libdirs="$qt_libdirs $dir/lib${tdelibsuff} $dir"
  1301. done
  1302. qt_libdirs="$TQTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1303. if test ! "$ac_qt_libraries" = "NO"; then
  1304. qt_libdir=$ac_qt_libraries
  1305. else
  1306. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1307. # if the Qt was given, the chance is too big that libtqt.* doesn't exist
  1308. qt_libdir=NONE
  1309. for dir in $qt_libdirs; do
  1310. try="ls -1 $dir/${LIBTQT_GLOB}"
  1311. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1312. done
  1313. fi
  1314. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1315. if test -e "$a"; then
  1316. LIBTQT="$LIBTQT ${kde_int_qt}_incremental"
  1317. break
  1318. fi
  1319. done
  1320. ac_qt_libraries="$qt_libdir"
  1321. AC_LANG_SAVE
  1322. AC_LANG_CPLUSPLUS
  1323. ac_cxxflags_safe="$CXXFLAGS"
  1324. ac_ldflags_safe="$LDFLAGS"
  1325. ac_libs_safe="$LIBS"
  1326. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1327. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1328. LIBS="$LIBS $LIBTQT $KDE_MT_LIBS"
  1329. KDE_PRINT_QT_PROGRAM
  1330. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1331. rm -f conftest*
  1332. else
  1333. echo "configure: failed program was:" >&AC_FD_CC
  1334. cat conftest.$ac_ext >&AC_FD_CC
  1335. ac_qt_libraries="NO"
  1336. fi
  1337. rm -f conftest*
  1338. CXXFLAGS="$ac_cxxflags_safe"
  1339. LDFLAGS="$ac_ldflags_safe"
  1340. LIBS="$ac_libs_safe"
  1341. AC_LANG_RESTORE
  1342. if test "$ac_tqt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1343. ac_cv_have_qt="have_qt=no"
  1344. ac_qt_notfound=""
  1345. missing_qt_mt=""
  1346. if test "$ac_tqt_includes" = NO; then
  1347. if test "$ac_qt_libraries" = NO; then
  1348. ac_qt_notfound="(headers and libraries)";
  1349. else
  1350. ac_qt_notfound="(headers)";
  1351. fi
  1352. else
  1353. if test "x$kde_use_qt_mt" = "xyes"; then
  1354. missing_qt_mt="
  1355. Make sure that you have compiled Qt with thread support!"
  1356. ac_qt_notfound="(library $tqtlib-mt)";
  1357. else
  1358. ac_qt_notfound="(library $tqtlib)";
  1359. fi
  1360. fi
  1361. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1362. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1363. else
  1364. have_qt="yes"
  1365. fi
  1366. ])
  1367. eval "$ac_cv_have_qt"
  1368. if test "$have_qt" != yes; then
  1369. AC_MSG_RESULT([$have_qt]);
  1370. else
  1371. ac_cv_have_qt="have_qt=yes \
  1372. ac_tqt_includes=$ac_tqt_includes ac_qt_libraries=$ac_qt_libraries"
  1373. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_tqt_includes $USING_QT_MT])
  1374. qt_libraries="$ac_qt_libraries"
  1375. tqt_includes="$ac_tqt_includes"
  1376. fi
  1377. if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
  1378. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1379. fi
  1380. AC_SUBST(qt_libraries)
  1381. AC_SUBST(tqt_includes)
  1382. if test "$tqt_includes" = "$x_includes" || test -z "$tqt_includes"; then
  1383. TQT_INCLUDES=""
  1384. else
  1385. TQT_INCLUDES="-I$tqt_includes"
  1386. all_includes="$TQT_INCLUDES $all_includes"
  1387. fi
  1388. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1389. QT_LDFLAGS=""
  1390. else
  1391. QT_LDFLAGS="-L$qt_libraries"
  1392. all_libraries="$QT_LDFLAGS $all_libraries"
  1393. fi
  1394. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1395. AC_SUBST(TQT_INCLUDES)
  1396. AC_SUBST(QT_LDFLAGS)
  1397. AC_PATH_TQT_MOC_UIC
  1398. KDE_CHECK_QT_JPEG
  1399. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1400. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
  1401. else
  1402. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
  1403. fi
  1404. test -z "$KDE_MT_LIBS" || LIB_TQT="$LIB_TQT $KDE_MT_LIBS"
  1405. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1406. if test -e "$a"; then
  1407. LIB_TQT="$LIB_TQT ${kde_int_qt}_incremental"
  1408. break
  1409. fi
  1410. done
  1411. AC_SUBST(LIB_TQT)
  1412. AC_SUBST(LIB_QPE)
  1413. AC_SUBST(kde_qtver)
  1414. ])
  1415. AC_DEFUN([AC_PATH_TQT],
  1416. [
  1417. AC_PATH_TQT_1_3
  1418. ])
  1419. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1420. [
  1421. AC_REQUIRE([AC_PATH_TQT_MOC_UIC])
  1422. if test x$ac_uic_supports_libpath = xyes; then
  1423. AC_MSG_CHECKING([if UIC has KDE plugins available])
  1424. AC_CACHE_VAL(kde_cv_uic_plugins,
  1425. [
  1426. cat > actest.ui << EOF
  1427. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1428. <class>NewConnectionDialog</class>
  1429. <widget class="QDialog">
  1430. <widget class="KLineEdit">
  1431. <property name="name">
  1432. <cstring>testInput</cstring>
  1433. </property>
  1434. </widget>
  1435. </widget>
  1436. </UI>
  1437. EOF
  1438. kde_cv_uic_plugins=no
  1439. kde_line="$UIC_PATH -L $kde_widgetdir"
  1440. if test x$ac_uic_supports_nounload = xyes; then
  1441. kde_line="$kde_line -nounload"
  1442. fi
  1443. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1444. if AC_TRY_EVAL(kde_line); then
  1445. # if you're trying to debug this check and think it's incorrect,
  1446. # better check your installation. The check _is_ correct - your
  1447. # installation is not.
  1448. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1449. kde_cv_uic_plugins=yes
  1450. fi
  1451. fi
  1452. rm -f actest.ui actest.cpp
  1453. ])
  1454. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1455. if test "$kde_cv_uic_plugins" != yes; then
  1456. AC_MSG_ERROR([
  1457. you need to install tdelibs first.
  1458. If you did install tdelibs, then the Qt version that is picked up by
  1459. this configure is not the same version you used to compile tdelibs.
  1460. The Qt Plugin installed by tdelibs is *ONLY* loadable if it is the
  1461. _same Qt version_, compiled with the _same compiler_ and the same Qt
  1462. configuration settings.
  1463. ])
  1464. fi
  1465. fi
  1466. ])
  1467. AC_DEFUN([KDE_CHECK_FINAL],
  1468. [
  1469. AC_ARG_ENABLE(final,
  1470. AC_HELP_STRING([--enable-final],
  1471. [build size optimized apps (experimental - needs lots of memory)]),
  1472. kde_use_final=$enableval, kde_use_final=no)
  1473. if test "x$kde_use_final" = "xyes"; then
  1474. KDE_USE_FINAL_TRUE=""
  1475. KDE_USE_FINAL_FALSE="#"
  1476. else
  1477. KDE_USE_FINAL_TRUE="#"
  1478. KDE_USE_FINAL_FALSE=""
  1479. fi
  1480. AC_SUBST(KDE_USE_FINAL_TRUE)
  1481. AC_SUBST(KDE_USE_FINAL_FALSE)
  1482. ])
  1483. AC_DEFUN([KDE_CHECK_CLOSURE],
  1484. [
  1485. AC_ARG_ENABLE(closure,
  1486. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1487. kde_use_closure=$enableval, kde_use_closure=no)
  1488. KDE_NO_UNDEFINED=""
  1489. if test "x$kde_use_closure" = "xyes"; then
  1490. KDE_USE_CLOSURE_TRUE=""
  1491. KDE_USE_CLOSURE_FALSE="#"
  1492. # CXXFLAGS="$CXXFLAGS $REPO"
  1493. else
  1494. KDE_USE_CLOSURE_TRUE="#"
  1495. KDE_USE_CLOSURE_FALSE=""
  1496. KDE_NO_UNDEFINED=""
  1497. case $host in
  1498. *-*-linux-gnu)
  1499. KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
  1500. [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
  1501. [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
  1502. [KDE_NO_UNDEFINED=""])],
  1503. [KDE_NO_UNDEFINED=""])
  1504. ;;
  1505. esac
  1506. fi
  1507. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1508. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1509. AC_SUBST(KDE_NO_UNDEFINED)
  1510. ])
  1511. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1512. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1513. [
  1514. AC_ARG_ENABLE(new_ldflags,
  1515. AC_HELP_STRING([--enable-new-ldflags],
  1516. [enable the new linker flags]),
  1517. kde_use_new_ldflags=$enableval,
  1518. kde_use_new_ldflags=no)
  1519. LDFLAGS_AS_NEEDED=""
  1520. LDFLAGS_NEW_DTAGS=""
  1521. if test "x$kde_use_new_ldflags" = "xyes"; then
  1522. LDFLAGS_NEW_DTAGS=""
  1523. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1524. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1525. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1526. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1527. fi
  1528. AC_SUBST(LDFLAGS_AS_NEEDED)
  1529. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1530. ])
  1531. AC_DEFUN([KDE_CHECK_NMCHECK],
  1532. [
  1533. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1534. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1535. if test "$kde_use_nmcheck" = "yes"; then
  1536. KDE_USE_NMCHECK_TRUE=""
  1537. KDE_USE_NMCHECK_FALSE="#"
  1538. else
  1539. KDE_USE_NMCHECK_TRUE="#"
  1540. KDE_USE_NMCHECK_FALSE=""
  1541. fi
  1542. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1543. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1544. ])
  1545. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1546. savex=$exec_prefix
  1547. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1548. tmp=$$2
  1549. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1550. exec_prefix=$savex
  1551. ])
  1552. dnl ------------------------------------------------------------------------
  1553. dnl Now, the same with KDE
  1554. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1555. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1556. dnl ------------------------------------------------------------------------
  1557. dnl
  1558. AC_DEFUN([AC_BASE_PATH_KDE],
  1559. [
  1560. AC_REQUIRE([KDE_CHECK_STL])
  1561. AC_REQUIRE([AC_PATH_TQT])dnl
  1562. AC_REQUIRE([KDE_CHECK_LIB64])
  1563. AC_CHECK_RPATH
  1564. AC_MSG_CHECKING([for KDE])
  1565. if test "${prefix}" != NONE; then
  1566. kde_includes=${includedir}
  1567. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1568. kde_libraries=${libdir}
  1569. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1570. else
  1571. ac_kde_includes=
  1572. ac_kde_libraries=
  1573. kde_libraries=""
  1574. kde_includes=""
  1575. fi
  1576. AC_CACHE_VAL(ac_cv_have_kde,
  1577. [#try to guess kde locations
  1578. if test "$kde_qtver" = 1; then
  1579. kde_check_header="ksock.h"
  1580. kde_check_lib="libtdecore.la"
  1581. else
  1582. kde_check_header="ksharedptr.h"
  1583. kde_check_lib="libtdeio.la"
  1584. fi
  1585. if test -z "$1"; then
  1586. kde_incdirs="$kde_libs_prefix/include /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 $tqt_includes"
  1587. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1588. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1589. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1590. ac_kde_includes="$kde_incdir"
  1591. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1592. AC_MSG_ERROR([
  1593. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1594. So, check this please and use another prefix!])
  1595. fi
  1596. kde_libdirs="$kde_libs_prefix/lib${tdelibsuff} /usr/lib/kde/lib${tdelibsuff} /usr/local/kde/lib${tdelibsuff} /usr/kde/lib${tdelibsuff} /usr/lib${tdelibsuff}/kde /usr/lib${tdelibsuff}/trinity /usr/lib${tdelibsuff} /usr/X11R6/lib${tdelibsuff} /usr/local/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/kde/lib${tdelibsuff} /usr/X11R6/kde/lib${tdelibsuff}"
  1597. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1598. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1599. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1600. ac_kde_libraries="$kde_libdir"
  1601. kde_widgetdir=NO
  1602. dnl this might be somewhere else
  1603. AC_FIND_FILE("trinity/plugins/designer/tdewidgets.la", $kde_libdirs, kde_widgetdir)
  1604. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1605. AC_MSG_ERROR([
  1606. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1607. So, check this please and use another prefix!])
  1608. fi
  1609. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/tdewidgets.la"; then
  1610. AC_MSG_ERROR([
  1611. I can't find the designer plugins. These are required and should have been installed
  1612. by tdelibs])
  1613. fi
  1614. if test -n "$kde_widgetdir"; then
  1615. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1616. fi
  1617. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1618. ac_cv_have_kde="have_kde=no"
  1619. else
  1620. ac_cv_have_kde="have_kde=yes \
  1621. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1622. fi
  1623. else dnl test -z $1, e.g. from tdelibs
  1624. ac_cv_have_kde="have_kde=no"
  1625. fi
  1626. ])dnl
  1627. eval "$ac_cv_have_kde"
  1628. if test "$have_kde" != "yes"; then
  1629. if test "${prefix}" = NONE; then
  1630. ac_kde_prefix="$ac_default_prefix"
  1631. else
  1632. ac_kde_prefix="$prefix"
  1633. fi
  1634. if test "$exec_prefix" = NONE; then
  1635. ac_kde_exec_prefix="$ac_kde_prefix"
  1636. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1637. else
  1638. ac_kde_exec_prefix="$exec_prefix"
  1639. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1640. fi
  1641. kde_libraries="${libdir}"
  1642. kde_includes="${includedir}"
  1643. else
  1644. ac_cv_have_kde="have_kde=yes \
  1645. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1646. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1647. kde_libraries="$ac_kde_libraries"
  1648. kde_includes="$ac_kde_includes"
  1649. fi
  1650. AC_SUBST(kde_libraries)
  1651. AC_SUBST(kde_includes)
  1652. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$tqt_includes" || test "$kde_includes" = "/usr/include"; then
  1653. KDE_INCLUDES=""
  1654. else
  1655. KDE_INCLUDES="-I$kde_includes"
  1656. all_includes="$KDE_INCLUDES $all_includes"
  1657. fi
  1658. KDE_DEFAULT_CXXFLAGS="-DTQT_NO_ASCII_CAST -DTQT_NO_STL -DTQT_NO_COMPAT -DTQT_NO_TRANSLATION"
  1659. KDE_LDFLAGS="-L$kde_libraries"
  1660. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1661. all_libraries="$KDE_LDFLAGS $all_libraries"
  1662. fi
  1663. AC_SUBST(KDE_LDFLAGS)
  1664. AC_SUBST(KDE_INCLUDES)
  1665. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1666. all_libraries="$all_libraries $USER_LDFLAGS"
  1667. all_includes="$all_includes $USER_INCLUDES"
  1668. AC_SUBST(all_includes)
  1669. AC_SUBST(all_libraries)
  1670. if test -z "$1"; then
  1671. KDE_CHECK_UIC_PLUGINS
  1672. fi
  1673. ac_kde_libraries="$kde_libdir"
  1674. AC_SUBST(AUTODIRS)
  1675. ])
  1676. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1677. [
  1678. AC_MSG_CHECKING(for extra includes)
  1679. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1680. kde_use_extra_includes="$withval",
  1681. kde_use_extra_includes=NONE
  1682. )
  1683. kde_extra_includes=
  1684. if test -n "$kde_use_extra_includes" && \
  1685. test "$kde_use_extra_includes" != "NONE"; then
  1686. ac_save_ifs=$IFS
  1687. IFS=':'
  1688. for dir in $kde_use_extra_includes; do
  1689. kde_extra_includes="$kde_extra_includes $dir"
  1690. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1691. done
  1692. IFS=$ac_save_ifs
  1693. kde_use_extra_includes="added"
  1694. else
  1695. kde_use_extra_includes="no"
  1696. fi
  1697. AC_SUBST(USER_INCLUDES)
  1698. AC_MSG_RESULT($kde_use_extra_includes)
  1699. kde_extra_libs=
  1700. AC_MSG_CHECKING(for extra libs)
  1701. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1702. kde_use_extra_libs=$withval,
  1703. kde_use_extra_libs=NONE
  1704. )
  1705. if test -n "$kde_use_extra_libs" && \
  1706. test "$kde_use_extra_libs" != "NONE"; then
  1707. ac_save_ifs=$IFS
  1708. IFS=':'
  1709. for dir in $kde_use_extra_libs; do
  1710. kde_extra_libs="$kde_extra_libs $dir"
  1711. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1712. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1713. done
  1714. IFS=$ac_save_ifs
  1715. kde_use_extra_libs="added"
  1716. else
  1717. kde_use_extra_libs="no"
  1718. fi
  1719. AC_SUBST(USER_LDFLAGS)
  1720. AC_MSG_RESULT($kde_use_extra_libs)
  1721. ])
  1722. AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
  1723. [
  1724. AC_MSG_CHECKING([for KDE headers installed])
  1725. AC_LANG_SAVE
  1726. AC_LANG_CPLUSPLUS
  1727. cat > conftest.$ac_ext <<EOF
  1728. #ifdef STDC_HEADERS
  1729. # include <stdlib.h>
  1730. #endif
  1731. #include <stdio.h>
  1732. #include "confdefs.h"
  1733. #include <kapp.h>
  1734. int main() {
  1735. printf("kde_htmldir=\\"%s\\"\n", TDEApplication::kde_htmldir().data());
  1736. printf("kde_appsdir=\\"%s\\"\n", TDEApplication::kde_appsdir().data());
  1737. printf("kde_icondir=\\"%s\\"\n", TDEApplication::kde_icondir().data());
  1738. printf("kde_sounddir=\\"%s\\"\n", TDEApplication::kde_sounddir().data());
  1739. printf("kde_datadir=\\"%s\\"\n", TDEApplication::kde_datadir().data());
  1740. printf("kde_locale=\\"%s\\"\n", TDEApplication::kde_localedir().data());
  1741. printf("kde_cgidir=\\"%s\\"\n", TDEApplication::kde_cgidir().data());
  1742. printf("kde_confdir=\\"%s\\"\n", TDEApplication::kde_configdir().data());
  1743. printf("kde_mimedir=\\"%s\\"\n", TDEApplication::kde_mimedir().data());
  1744. printf("kde_toolbardir=\\"%s\\"\n", TDEApplication::kde_toolbardir().data());
  1745. printf("kde_wallpaperdir=\\"%s\\"\n",
  1746. TDEApplication::kde_wallpaperdir().data());
  1747. printf("kde_bindir=\\"%s\\"\n", TDEApplication::kde_bindir().data());
  1748. printf("kde_partsdir=\\"%s\\"\n", TDEApplication::kde_partsdir().data());
  1749. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1750. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1751. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1752. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1753. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1754. printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
  1755. printf("xdg_menudir=\\"/tmp/dummy\\"\n");
  1756. printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
  1757. printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
  1758. return 0;
  1759. }
  1760. EOF
  1761. ac_save_CPPFLAGS=$CPPFLAGS
  1762. CPPFLAGS="$all_includes $CPPFLAGS"
  1763. if AC_TRY_EVAL(ac_compile); then
  1764. AC_MSG_RESULT(yes)
  1765. else
  1766. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1767. Check, if you installed the KDE header files correctly.
  1768. For more details about this problem, look at the end of config.log.])
  1769. fi
  1770. CPPFLAGS=$ac_save_CPPFLAGS
  1771. AC_LANG_RESTORE
  1772. ])
  1773. AC_DEFUN([KDE_CHECK_KDEQTADDON],
  1774. [
  1775. AC_MSG_CHECKING(for kde-qt-addon)
  1776. AC_CACHE_VAL(kde_cv_have_kdetqtaddon,
  1777. [
  1778. kde_ldflags_safe="$LDFLAGS"
  1779. kde_libs_safe="$LIBS"
  1780. kde_cxxflags_safe="$CXXFLAGS"
  1781. LIBS="-lkde-qt-addon $LIBTQT $LIBS"
  1782. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1783. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1784. AC_TRY_LINK([
  1785. #include <qdom.h>
  1786. ],
  1787. [
  1788. QDomDocument doc;
  1789. ],
  1790. kde_cv_have_kdetqtaddon=yes,
  1791. kde_cv_have_kdetqtaddon=no
  1792. )
  1793. LDFLAGS=$kde_ldflags_safe
  1794. LIBS=$kde_libs_safe
  1795. CXXFLAGS=$kde_cxxflags_safe
  1796. ])
  1797. AC_MSG_RESULT($kde_cv_have_kdetqtaddon)
  1798. if test "$kde_cv_have_kdetqtaddon" = "no"; then
  1799. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1800. It is a separate package (and CVS module) named kde-qt-addon.])
  1801. fi
  1802. ])
  1803. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  1804. [
  1805. AC_REQUIRE([KDE_MISC_TESTS])
  1806. AC_REQUIRE([KDE_CHECK_LIBDL])
  1807. AC_REQUIRE([K_PATH_X])
  1808. if test $kde_qtver = 3; then
  1809. case $host in
  1810. *cygwin*) lib_kded="-ltdeinit_kded" ;;
  1811. *) lib_kded="" ;;
  1812. esac
  1813. AC_SUBST(LIB_KDED, $lib_kded)
  1814. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1815. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1816. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1817. AC_SUBST(LIB_KJS, "-lkjs")
  1818. AC_SUBST(LIB_SMB, "-lsmb")
  1819. AC_SUBST(LIB_KAB, "-lkab")
  1820. AC_SUBST(LIB_TDEABC, "-ltdeabc")
  1821. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1822. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1823. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1824. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1825. AC_SUBST(LIB_TDEUTILS, "-ltdeutils")
  1826. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  1827. AC_SUBST(LIB_TDEIMPROXY, "-ltdeimproxy")
  1828. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  1829. AC_SUBST(LIB_TDEDNSSD, "-ltdednssd")
  1830. AC_SUBST(LIB_TDEUNITTEST, "-ltdeunittest")
  1831. # these are for backward compatibility
  1832. AC_SUBST(LIB_TDESYCOCA, "-ltdeio")
  1833. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  1834. elif test $kde_qtver = 2; then
  1835. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1836. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1837. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1838. AC_SUBST(LIB_TDESYCOCA, "-ltdesycoca")
  1839. AC_SUBST(LIB_SMB, "-lsmb")
  1840. AC_SUBST(LIB_TDEFILE, "-ltdefile")
  1841. AC_SUBST(LIB_KAB, "-lkab")
  1842. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1843. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1844. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1845. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1846. else
  1847. AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_TQT)")
  1848. AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
  1849. AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
  1850. AC_SUBST(LIB_TDEFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
  1851. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
  1852. fi
  1853. ])
  1854. AC_DEFUN([AC_PATH_KDE],
  1855. [
  1856. AC_BASE_PATH_KDE
  1857. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  1858. [
  1859. if test "$enableval" = "no";
  1860. then ac_use_path_checking="default"
  1861. else ac_use_path_checking=""
  1862. fi
  1863. ],
  1864. [
  1865. if test "$kde_qtver" = 1;
  1866. then ac_use_path_checking=""
  1867. else ac_use_path_checking="default"
  1868. fi
  1869. ]
  1870. )
  1871. AC_CREATE_KFSSTND($ac_use_path_checking)
  1872. AC_SUBST_KFSSTND
  1873. KDE_CREATE_LIBS_ALIASES
  1874. ])
  1875. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1876. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  1877. [
  1878. AC_MSG_CHECKING(for $1)
  1879. AC_CACHE_VAL(kde_cv_func_$1,
  1880. [
  1881. AC_LANG_SAVE
  1882. AC_LANG_CPLUSPLUS
  1883. save_CXXFLAGS="$CXXFLAGS"
  1884. kde_safe_LIBS="$LIBS"
  1885. LIBS="$LIBS $X_EXTRA_LIBS"
  1886. if test "$GXX" = "yes"; then
  1887. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1888. fi
  1889. AC_TRY_COMPILE([
  1890. $2
  1891. ],
  1892. [
  1893. $3
  1894. ],
  1895. kde_cv_func_$1=yes,
  1896. kde_cv_func_$1=no)
  1897. CXXFLAGS="$save_CXXFLAGS"
  1898. LIBS="$kde_safe_LIBS"
  1899. AC_LANG_RESTORE
  1900. ])
  1901. AC_MSG_RESULT($kde_cv_func_$1)
  1902. AC_MSG_CHECKING([if $1 needs custom prototype])
  1903. AC_CACHE_VAL(kde_cv_proto_$1,
  1904. [
  1905. if test "x$kde_cv_func_$1" = xyes; then
  1906. kde_cv_proto_$1=no
  1907. else
  1908. case "$1" in
  1909. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1910. kde_cv_proto_$1="yes - in libtdefakes"
  1911. ;;
  1912. *)
  1913. kde_cv_proto_$1=unknown
  1914. ;;
  1915. esac
  1916. fi
  1917. if test "x$kde_cv_proto_$1" = xunknown; then
  1918. AC_LANG_SAVE
  1919. AC_LANG_CPLUSPLUS
  1920. kde_safe_libs=$LIBS
  1921. LIBS="$LIBS $X_EXTRA_LIBS"
  1922. AC_TRY_LINK([
  1923. $2
  1924. extern "C" $4;
  1925. ],
  1926. [
  1927. $3
  1928. ],
  1929. [ kde_cv_func_$1=yes
  1930. kde_cv_proto_$1=yes ],
  1931. [kde_cv_proto_$1="$1 unavailable"]
  1932. )
  1933. LIBS=$kde_safe_libs
  1934. AC_LANG_RESTORE
  1935. fi
  1936. ])
  1937. AC_MSG_RESULT($kde_cv_proto_$1)
  1938. if test "x$kde_cv_func_$1" = xyes; then
  1939. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1940. $6
  1941. fi
  1942. if test "x$kde_cv_proto_$1" = xno; then
  1943. AC_DEFINE(HAVE_$5_PROTO, 1,
  1944. [Define if you have the $1 prototype])
  1945. fi
  1946. AH_VERBATIM([_HAVE_$5_PROTO],
  1947. [
  1948. #if !defined(HAVE_$5_PROTO)
  1949. #ifdef __cplusplus
  1950. extern "C" {
  1951. #endif
  1952. $4;
  1953. #ifdef __cplusplus
  1954. }
  1955. #endif
  1956. #endif
  1957. ])
  1958. ])
  1959. AC_DEFUN([AC_CHECK_SETENV],
  1960. [
  1961. KDE_CHECK_FUNC_EXT(setenv, [
  1962. #include <stdlib.h>
  1963. ],
  1964. [setenv("VAR", "VALUE", 1);],
  1965. [int setenv (const char *, const char *, int)],
  1966. [SETENV])
  1967. ])
  1968. AC_DEFUN([AC_CHECK_UNSETENV],
  1969. [
  1970. KDE_CHECK_FUNC_EXT(unsetenv, [
  1971. #include <stdlib.h>
  1972. ],
  1973. [unsetenv("VAR");],
  1974. [void unsetenv (const char *)],
  1975. [UNSETENV])
  1976. ])
  1977. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  1978. [
  1979. KDE_CHECK_FUNC_EXT(getdomainname, [
  1980. #include <stdlib.h>
  1981. #include <unistd.h>
  1982. #include <netdb.h>
  1983. ],
  1984. [
  1985. char buffer[200];
  1986. getdomainname(buffer, 200);
  1987. ],
  1988. [#include <sys/types.h>
  1989. int getdomainname (char *, size_t)],
  1990. [GETDOMAINNAME])
  1991. ])
  1992. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  1993. [
  1994. KDE_CHECK_FUNC_EXT(gethostname, [
  1995. #include <stdlib.h>
  1996. #include <unistd.h>
  1997. ],
  1998. [
  1999. char buffer[200];
  2000. gethostname(buffer, 200);
  2001. ],
  2002. [int gethostname (char *, unsigned int)],
  2003. [GETHOSTNAME])
  2004. ])
  2005. AC_DEFUN([AC_CHECK_USLEEP],
  2006. [
  2007. KDE_CHECK_FUNC_EXT(usleep, [
  2008. #include <unistd.h>
  2009. ],
  2010. [
  2011. usleep(200);
  2012. ],
  2013. [int usleep (unsigned int)],
  2014. [USLEEP])
  2015. ])
  2016. AC_DEFUN([AC_CHECK_RANDOM],
  2017. [
  2018. KDE_CHECK_FUNC_EXT(random, [
  2019. #include <stdlib.h>
  2020. ],
  2021. [
  2022. random();
  2023. ],
  2024. [long int random(void)],
  2025. [RANDOM])
  2026. KDE_CHECK_FUNC_EXT(srandom, [
  2027. #include <stdlib.h>
  2028. ],
  2029. [
  2030. srandom(27);
  2031. ],
  2032. [void srandom(unsigned int)],
  2033. [SRANDOM])
  2034. ])
  2035. AC_DEFUN([AC_CHECK_INITGROUPS],
  2036. [
  2037. KDE_CHECK_FUNC_EXT(initgroups, [
  2038. #include <sys/types.h>
  2039. #include <unistd.h>
  2040. #include <grp.h>
  2041. ],
  2042. [
  2043. char buffer[200];
  2044. initgroups(buffer, 27);
  2045. ],
  2046. [int initgroups(const char *, gid_t)],
  2047. [INITGROUPS])
  2048. ])
  2049. AC_DEFUN([AC_CHECK_MKSTEMPS],
  2050. [
  2051. KDE_CHECK_FUNC_EXT(mkstemps, [
  2052. #include <stdlib.h>
  2053. #include <unistd.h>
  2054. ],
  2055. [
  2056. mkstemps("/tmp/aaaXXXXXX", 6);
  2057. ],
  2058. [int mkstemps(char *, int)],
  2059. [MKSTEMPS])
  2060. ])
  2061. AC_DEFUN([AC_CHECK_MKSTEMP],
  2062. [
  2063. KDE_CHECK_FUNC_EXT(mkstemp, [
  2064. #include <stdlib.h>
  2065. #include <unistd.h>
  2066. ],
  2067. [
  2068. mkstemp("/tmp/aaaXXXXXX");
  2069. ],
  2070. [int mkstemp(char *)],
  2071. [MKSTEMP])
  2072. ])
  2073. AC_DEFUN([AC_CHECK_MKDTEMP],
  2074. [
  2075. KDE_CHECK_FUNC_EXT(mkdtemp, [
  2076. #include <stdlib.h>
  2077. #include <unistd.h>
  2078. ],
  2079. [
  2080. mkdtemp("/tmp/aaaXXXXXX");
  2081. ],
  2082. [char *mkdtemp(char *)],
  2083. [MKDTEMP])
  2084. ])
  2085. AC_DEFUN([AC_CHECK_RES_INIT],
  2086. [
  2087. AC_MSG_CHECKING([if res_init needs -lresolv])
  2088. kde_libs_safe="$LIBS"
  2089. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  2090. AC_TRY_LINK(
  2091. [
  2092. #include <sys/types.h>
  2093. #include <netinet/in.h>
  2094. #include <arpa/nameser.h>
  2095. #include <resolv.h>
  2096. ],
  2097. [
  2098. res_init();
  2099. ],
  2100. [
  2101. LIBRESOLV="-lresolv"
  2102. AC_MSG_RESULT(yes)
  2103. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  2104. ],
  2105. [ AC_MSG_RESULT(no) ]
  2106. )
  2107. LIBS=$kde_libs_safe
  2108. AC_SUBST(LIBRESOLV)
  2109. KDE_CHECK_FUNC_EXT(res_init,
  2110. [
  2111. #include <sys/types.h>
  2112. #include <netinet/in.h>
  2113. #include <arpa/nameser.h>
  2114. #include <resolv.h>
  2115. ],
  2116. [res_init()],
  2117. [int res_init(void)],
  2118. [RES_INIT])
  2119. ])
  2120. AC_DEFUN([AC_CHECK_STRLCPY],
  2121. [
  2122. KDE_CHECK_FUNC_EXT(strlcpy, [
  2123. #include <string.h>
  2124. ],
  2125. [ char buf[20];
  2126. strlcpy(buf, "KDE function test", sizeof(buf));
  2127. ],
  2128. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2129. [STRLCPY])
  2130. ])
  2131. AC_DEFUN([AC_CHECK_STRLCAT],
  2132. [
  2133. KDE_CHECK_FUNC_EXT(strlcat, [
  2134. #include <string.h>
  2135. ],
  2136. [ char buf[20];
  2137. buf[0]='\0';
  2138. strlcat(buf, "KDE function test", sizeof(buf));
  2139. ],
  2140. [unsigned long strlcat(char*, const char*, unsigned long)],
  2141. [STRLCAT])
  2142. ])
  2143. AC_DEFUN([AC_CHECK_RES_QUERY],
  2144. [
  2145. KDE_CHECK_FUNC_EXT(res_query, [
  2146. #include <sys/types.h>
  2147. #include <netinet/in.h>
  2148. #include <arpa/nameser.h>
  2149. #include <resolv.h>
  2150. #include <netdb.h>
  2151. ],
  2152. [
  2153. res_query(NULL, 0, 0, NULL, 0);
  2154. ],
  2155. [int res_query(const char *, int, int, unsigned char *, int)],
  2156. [RES_QUERY])
  2157. ])
  2158. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2159. [
  2160. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2161. #include <sys/types.h>
  2162. #include <netinet/in.h>
  2163. #include <arpa/nameser.h>
  2164. #include <resolv.h>
  2165. ],
  2166. [
  2167. dn_skipname (NULL, NULL);
  2168. ],
  2169. [int dn_skipname (unsigned char *, unsigned char *)],
  2170. [DN_SKIPNAME])
  2171. ])
  2172. AC_DEFUN([AC_FIND_GIF],
  2173. [AC_MSG_CHECKING([for giflib])
  2174. AC_CACHE_VAL(ac_cv_lib_gif,
  2175. [ac_save_LIBS="$LIBS"
  2176. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2177. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2178. else
  2179. LIBS="$all_libraries -lgif"
  2180. fi
  2181. AC_TRY_LINK(dnl
  2182. [
  2183. #ifdef __cplusplus
  2184. extern "C" {
  2185. #endif
  2186. int GifLastError(void);
  2187. #ifdef __cplusplus
  2188. }
  2189. #endif
  2190. /* We use char because int might match the return type of a gcc2
  2191. builtin and then its argument prototype would still apply. */
  2192. ],
  2193. [return GifLastError();],
  2194. eval "ac_cv_lib_gif=yes",
  2195. eval "ac_cv_lib_gif=no")
  2196. LIBS="$ac_save_LIBS"
  2197. ])dnl
  2198. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2199. AC_MSG_RESULT(yes)
  2200. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2201. else
  2202. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2203. fi
  2204. ])
  2205. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2206. [
  2207. AC_MSG_CHECKING([for libjpeg$2])
  2208. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2209. [
  2210. ac_save_LIBS="$LIBS"
  2211. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2212. ac_save_CFLAGS="$CFLAGS"
  2213. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2214. AC_TRY_LINK(
  2215. [
  2216. #ifdef __cplusplus
  2217. extern "C" {
  2218. #endif
  2219. void jpeg_CreateDecompress();
  2220. #ifdef __cplusplus
  2221. }
  2222. #endif
  2223. ],
  2224. [jpeg_CreateDecompress();],
  2225. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2226. eval "ac_cv_lib_jpeg_$1=no")
  2227. LIBS="$ac_save_LIBS"
  2228. CFLAGS="$ac_save_CFLAGS"
  2229. ])
  2230. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2231. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2232. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2233. else
  2234. AC_MSG_RESULT(no)
  2235. $3
  2236. fi
  2237. ])
  2238. AC_DEFUN([AC_FIND_JPEG],
  2239. [
  2240. dnl first look for libraries
  2241. KDE_FIND_JPEG_HELPER(6b, 6b,
  2242. KDE_FIND_JPEG_HELPER(normal, [],
  2243. [
  2244. LIBJPEG=
  2245. ]
  2246. )
  2247. )
  2248. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2249. dnl requires system dependent includes loaded before it)
  2250. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2251. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2252. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2253. dnl if headers _and_ libraries are missing, this is no error, and we
  2254. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2255. dnl if only one is missing, it means a configuration error, but we still
  2256. dnl only warn
  2257. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2258. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2259. else
  2260. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2261. AC_MSG_WARN([
  2262. There is an installation error in jpeg support. You seem to have only one
  2263. of either the headers _or_ the libraries installed. You may need to either
  2264. provide correct --with-extra-... options, or the development package of
  2265. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2266. Disabling JPEG support.
  2267. ])
  2268. else
  2269. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2270. fi
  2271. jpeg_incdir=
  2272. LIBJPEG=
  2273. fi
  2274. AC_SUBST(LIBJPEG)
  2275. AH_VERBATIM(_AC_CHECK_JPEG,
  2276. [/*
  2277. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2278. * headers and I'm too lazy to write a configure test as long as only
  2279. * unixware is related
  2280. */
  2281. #ifdef _UNIXWARE
  2282. #define HAVE_BOOLEAN
  2283. #endif
  2284. ])
  2285. ])
  2286. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2287. [
  2288. if test -n "$LIBJPEG"; then
  2289. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2290. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2291. [
  2292. AC_LANG_SAVE
  2293. AC_LANG_CPLUSPLUS
  2294. ac_save_LIBS="$LIBS"
  2295. LIBS="$all_libraries $USER_LDFLAGS $LIBTQT"
  2296. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2297. ac_save_CXXFLAGS="$CXXFLAGS"
  2298. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2299. AC_TRY_LINK(
  2300. [#include <qapplication.h>],
  2301. [
  2302. int argc;
  2303. char** argv;
  2304. QApplication app(argc, argv);],
  2305. eval "kde_cv_qt_jpeg=no",
  2306. eval "kde_cv_qt_jpeg=yes")
  2307. LIBS="$ac_save_LIBS"
  2308. CXXFLAGS="$ac_save_CXXFLAGS"
  2309. AC_LANG_RESTORE
  2310. fi
  2311. ])
  2312. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2313. AC_MSG_RESULT(yes)
  2314. LIBJPEG_QT='$(LIBJPEG)'
  2315. else
  2316. AC_MSG_RESULT(no)
  2317. LIBJPEG_QT=
  2318. fi
  2319. ])
  2320. AC_DEFUN([AC_FIND_ZLIB],
  2321. [
  2322. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2323. AC_MSG_CHECKING([for libz])
  2324. AC_CACHE_VAL(ac_cv_lib_z,
  2325. [
  2326. kde_save_LIBS="$LIBS"
  2327. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2328. kde_save_CFLAGS="$CFLAGS"
  2329. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2330. AC_TRY_LINK(dnl
  2331. [
  2332. #include<zlib.h>
  2333. ],
  2334. [
  2335. char buf[42];
  2336. gzFile f = (gzFile) 0;
  2337. /* this would segfault.. but we only link, don't run */
  2338. (void) gzgets(f, buf, sizeof(buf));
  2339. return (zlibVersion() == ZLIB_VERSION);
  2340. ],
  2341. eval "ac_cv_lib_z='-lz'",
  2342. eval "ac_cv_lib_z=no")
  2343. LIBS="$kde_save_LIBS"
  2344. CFLAGS="$kde_save_CFLAGS"
  2345. ])dnl
  2346. if test ! "$ac_cv_lib_z" = no; then
  2347. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2348. LIBZ="$ac_cv_lib_z"
  2349. AC_MSG_RESULT($ac_cv_lib_z)
  2350. else
  2351. AC_MSG_ERROR(not found.
  2352. Possibly configure picks up an outdated version
  2353. installed by XFree86. Remove it from your system.
  2354. Check your installation and look into config.log)
  2355. LIBZ=""
  2356. fi
  2357. AC_SUBST(LIBZ)
  2358. ])
  2359. AC_DEFUN([KDE_TRY_TIFFLIB],
  2360. [
  2361. AC_MSG_CHECKING([for libtiff $1])
  2362. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2363. [
  2364. AC_LANG_SAVE
  2365. AC_LANG_CPLUSPLUS
  2366. kde_save_LIBS="$LIBS"
  2367. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2368. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2369. else
  2370. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2371. fi
  2372. kde_save_CXXFLAGS="$CXXFLAGS"
  2373. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2374. AC_TRY_LINK(dnl
  2375. [
  2376. #include<tiffio.h>
  2377. ],
  2378. [return (TIFFOpen( "", "r") == 0); ],
  2379. [
  2380. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2381. ], [
  2382. kde_cv_libtiff_$1=no
  2383. ])
  2384. LIBS="$kde_save_LIBS"
  2385. CXXFLAGS="$kde_save_CXXFLAGS"
  2386. AC_LANG_RESTORE
  2387. ])
  2388. if test "$kde_cv_libtiff_$1" = "no"; then
  2389. AC_MSG_RESULT(no)
  2390. LIBTIFF=""
  2391. $3
  2392. else
  2393. LIBTIFF="$kde_cv_libtiff_$1"
  2394. AC_MSG_RESULT(yes)
  2395. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2396. $2
  2397. fi
  2398. ])
  2399. AC_DEFUN([AC_FIND_TIFF],
  2400. [
  2401. AC_REQUIRE([K_PATH_X])
  2402. AC_REQUIRE([AC_FIND_ZLIB])
  2403. AC_REQUIRE([AC_FIND_JPEG])
  2404. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2405. KDE_TRY_TIFFLIB(tiff, [],
  2406. KDE_TRY_TIFFLIB(tiff34))
  2407. AC_SUBST(LIBTIFF)
  2408. ])
  2409. AC_DEFUN([KDE_FIND_LIBEXR],
  2410. [
  2411. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2412. AC_REQUIRE([AC_FIND_ZLIB])
  2413. AC_CACHE_VAL(ac_cv_libexr,
  2414. [
  2415. if test -z "$PKG_CONFIG"; then
  2416. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2417. fi
  2418. AC_MSG_CHECKING([for OpenEXR libraries])
  2419. if test "$PKG_CONFIG" = "no" ; then
  2420. AC_MSG_RESULT(no)
  2421. echo "*** The pkg-config script could not be found. Make sure it is"
  2422. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2423. echo "*** to the full path to pkg-config."
  2424. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2425. else
  2426. if !(`$PKG_CONFIG --exists OpenEXR`) ; then
  2427. AC_MSG_RESULT(no)
  2428. EXRSTATUS=no
  2429. else
  2430. if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
  2431. AC_MSG_RESULT(no)
  2432. EXRSTATUS=old
  2433. else
  2434. kde_save_LIBS="$LIBS"
  2435. LIBS="$LIBS $all_libraries $USER_LDFLAGS $LIBZ `pkg-config --libs OpenEXR`"
  2436. AC_LANG_SAVE
  2437. AC_LANG_CPLUSPLUS
  2438. kde_save_CXXFLAGS="$CXXFLAGS"
  2439. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2440. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2441. AC_TRY_LINK(dnl
  2442. [
  2443. #include <ImfRgbaFile.h>
  2444. ],
  2445. [
  2446. using namespace Imf;
  2447. RgbaInputFile file ("dummy");
  2448. return 0;
  2449. ],
  2450. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2451. eval "ac_cv_libexr=no"
  2452. )
  2453. LIBS="$kde_save_LIBS"
  2454. CXXFLAGS="$kde_save_CXXFLAGS"
  2455. AC_LANG_RESTORE
  2456. ])dnl
  2457. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2458. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2459. LIB_EXR="$ac_cv_libexr"
  2460. AC_MSG_RESULT($ac_cv_libexr)
  2461. else
  2462. AC_MSG_RESULT(no)
  2463. LIB_EXR=""
  2464. fi
  2465. fi
  2466. fi
  2467. fi
  2468. AC_SUBST(LIB_EXR)
  2469. AC_SUBST(EXR_FLAGS)
  2470. ])
  2471. AC_DEFUN([AC_FIND_PNG],
  2472. [
  2473. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2474. AC_REQUIRE([AC_FIND_ZLIB])
  2475. AC_MSG_CHECKING([for libpng])
  2476. AC_CACHE_VAL(ac_cv_lib_png,
  2477. [
  2478. kde_save_LIBS="$LIBS"
  2479. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2480. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2481. else
  2482. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2483. fi
  2484. kde_save_CFLAGS="$CFLAGS"
  2485. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2486. AC_TRY_LINK(dnl
  2487. [
  2488. #include<png.h>
  2489. ],
  2490. [
  2491. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2492. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2493. return( png_ptr != 0 );
  2494. ],
  2495. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2496. eval "ac_cv_lib_png=no"
  2497. )
  2498. LIBS="$kde_save_LIBS"
  2499. CFLAGS="$kde_save_CFLAGS"
  2500. ])dnl
  2501. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2502. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2503. LIBPNG="$ac_cv_lib_png"
  2504. AC_SUBST(LIBPNG)
  2505. AC_MSG_RESULT($ac_cv_lib_png)
  2506. else
  2507. AC_MSG_RESULT(no)
  2508. LIBPNG=""
  2509. AC_SUBST(LIBPNG)
  2510. fi
  2511. ])
  2512. AC_DEFUN([AC_FIND_JASPER],
  2513. [
  2514. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2515. AC_REQUIRE([AC_FIND_JPEG])
  2516. AC_MSG_CHECKING([for jasper])
  2517. AC_CACHE_VAL(ac_cv_jasper,
  2518. [
  2519. kde_save_LIBS="$LIBS"
  2520. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2521. kde_save_CFLAGS="$CFLAGS"
  2522. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2523. AC_TRY_LINK(dnl
  2524. [
  2525. #include<jasper/jasper.h>
  2526. ],
  2527. [
  2528. return( jas_init() );
  2529. ],
  2530. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2531. eval "ac_cv_jasper=no"
  2532. )
  2533. LIBS="$kde_save_LIBS"
  2534. CFLAGS="$kde_save_CFLAGS"
  2535. ])dnl
  2536. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2537. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2538. LIB_JASPER="$ac_cv_jasper"
  2539. AC_MSG_RESULT($ac_cv_jasper)
  2540. else
  2541. AC_MSG_RESULT(no)
  2542. LIB_JASPER=""
  2543. fi
  2544. AC_SUBST(LIB_JASPER)
  2545. ])
  2546. AC_DEFUN([AC_CHECK_BOOL],
  2547. [
  2548. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2549. ])
  2550. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2551. [
  2552. AC_MSG_CHECKING([whether $CXX supports -$1])
  2553. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2554. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2555. [
  2556. AC_LANG_SAVE
  2557. AC_LANG_CPLUSPLUS
  2558. save_CXXFLAGS="$CXXFLAGS"
  2559. CXXFLAGS="$CXXFLAGS -$1"
  2560. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2561. CXXFLAGS="$save_CXXFLAGS"
  2562. AC_LANG_RESTORE
  2563. ])
  2564. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2565. AC_MSG_RESULT(yes)
  2566. :
  2567. $2
  2568. else
  2569. AC_MSG_RESULT(no)
  2570. :
  2571. $3
  2572. fi
  2573. ])
  2574. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2575. [
  2576. AC_MSG_CHECKING([whether $CC supports -$1])
  2577. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2578. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2579. [
  2580. AC_LANG_SAVE
  2581. AC_LANG_C
  2582. save_CFLAGS="$CFLAGS"
  2583. CFLAGS="$CFLAGS -$1"
  2584. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2585. CFLAGS="$save_CFLAGS"
  2586. AC_LANG_RESTORE
  2587. ])
  2588. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2589. AC_MSG_RESULT(yes)
  2590. :
  2591. $2
  2592. else
  2593. AC_MSG_RESULT(no)
  2594. :
  2595. $3
  2596. fi
  2597. ])
  2598. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2599. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2600. dnl it's all white-space separated
  2601. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2602. [ __val=$$1
  2603. __forbid=" $2 "
  2604. if test -n "$__val"; then
  2605. __new=""
  2606. ac_save_IFS=$IFS
  2607. IFS=" "
  2608. for i in $__val; do
  2609. case "$__forbid" in
  2610. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2611. *) # Careful to not add spaces, where there were none, because otherwise
  2612. # libtool gets confused, if we change e.g. CXX
  2613. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2614. esac
  2615. done
  2616. IFS=$ac_save_IFS
  2617. $1=$__new
  2618. fi
  2619. ])
  2620. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2621. [
  2622. AC_MSG_CHECKING([whether $CC is blacklisted])
  2623. dnl In theory we have tu run this test against $CC and $CXX
  2624. dnl in C and in C++ mode, because its perfectly legal for
  2625. dnl the user to mix compiler versions, since C has a defined
  2626. dnl ABI.
  2627. dnl
  2628. dnl For now, we assume the user is not on crack.
  2629. AC_TRY_COMPILE([
  2630. #ifdef __GNUC__
  2631. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  2632. choke me
  2633. #endif
  2634. #endif
  2635. ], ,
  2636. kde_bad_compiler=no,
  2637. kde_bad_compiler=yes
  2638. )
  2639. AC_MSG_RESULT($kde_bad_compiler)
  2640. if test "$kde_bad_compiler" = "yes"; then
  2641. AC_MSG_ERROR([
  2642. This particular compiler version is blacklisted because it
  2643. is known to miscompile KDE. Please use a newer version, or
  2644. if that is not yet available, choose an older version.
  2645. Please do not report a bug or bother us reporting this
  2646. configure error. We know about it, and we introduced
  2647. it by intention to avoid untraceable bugs or crashes in KDE.
  2648. ])
  2649. fi
  2650. ])
  2651. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  2652. [
  2653. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  2654. kde_cv_opt_noinline_match,
  2655. [
  2656. kde_cv_opt_noinline_match=irrelevant
  2657. dnl if we don't use both -O2 and -fno-inline, this check is moot
  2658. if echo "$CFLAGS" | grep -qe -O2 \
  2659. && echo "$CFLAGS" | grep -qe -fno-inline ; then
  2660. ac_cflags_save="$CFLAGS"
  2661. CFLAGS="$CFLAGS -D_USE_GNU"
  2662. AC_TRY_LINK([
  2663. #include <string.h>
  2664. ], [ const char *pt, *et;
  2665. et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
  2666. ],
  2667. kde_cv_opt_noinline_match=yes,
  2668. kde_cv_opt_noinline_match=no
  2669. )
  2670. CFLAGS="$ac_cflags_save"
  2671. fi
  2672. ])
  2673. ])
  2674. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2675. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2676. [dnl
  2677. if test "x$kde_use_qt_emb" != "xyes"; then
  2678. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2679. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2680. else
  2681. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2682. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2683. fi
  2684. ])
  2685. AC_DEFUN([AC_CHECK_COMPILERS],
  2686. [
  2687. AC_ARG_ENABLE(debug,
  2688. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2689. [
  2690. case $enableval in
  2691. yes)
  2692. kde_use_debug_code="yes"
  2693. kde_use_debug_define=no
  2694. ;;
  2695. full)
  2696. kde_use_debug_code="full"
  2697. kde_use_debug_define=no
  2698. ;;
  2699. *)
  2700. kde_use_debug_code="no"
  2701. kde_use_debug_define=yes
  2702. ;;
  2703. esac
  2704. ],
  2705. [kde_use_debug_code="no"
  2706. kde_use_debug_define=no
  2707. ])
  2708. dnl Just for configure --help
  2709. AC_ARG_ENABLE(dummyoption,
  2710. AC_HELP_STRING([--disable-debug],
  2711. [disables debug output and debug symbols [default=no]]),
  2712. [],[])
  2713. AC_ARG_ENABLE(strict,
  2714. AC_HELP_STRING([--enable-strict],
  2715. [compiles with strict compiler options (may not work!)]),
  2716. [
  2717. if test $enableval = "no"; then
  2718. kde_use_strict_options="no"
  2719. else
  2720. kde_use_strict_options="yes"
  2721. fi
  2722. ], [kde_use_strict_options="no"])
  2723. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2724. [
  2725. if test $enableval = "no"; then
  2726. kde_use_warnings="no"
  2727. else
  2728. kde_use_warnings="yes"
  2729. fi
  2730. ], [kde_use_warnings="yes"])
  2731. dnl enable warnings for debug build
  2732. if test "$kde_use_debug_code" != "no"; then
  2733. kde_use_warnings=yes
  2734. fi
  2735. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2736. [kde_use_profiling=$enableval],
  2737. [kde_use_profiling="no"]
  2738. )
  2739. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2740. CFLAGS=" $CFLAGS"
  2741. AC_PROG_CC
  2742. AC_PROG_CPP
  2743. if test "$GCC" = "yes"; then
  2744. if test "$kde_use_debug_code" != "no"; then
  2745. if test $kde_use_debug_code = "full"; then
  2746. CFLAGS="-g3 -fno-inline $CFLAGS"
  2747. else
  2748. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  2749. fi
  2750. else
  2751. CFLAGS="-O2 $CFLAGS"
  2752. fi
  2753. fi
  2754. if test "$kde_use_debug_define" = "yes"; then
  2755. CFLAGS="-DNDEBUG $CFLAGS"
  2756. fi
  2757. case "$host" in
  2758. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2759. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2760. esac
  2761. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2762. LDFLAGS=""
  2763. fi
  2764. CXXFLAGS=" $CXXFLAGS"
  2765. AC_PROG_CXX
  2766. KDE_CHECK_FOR_BAD_COMPILER
  2767. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2768. if test "$kde_use_debug_code" != "no"; then
  2769. if test "$CXX" = "KCC"; then
  2770. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2771. else
  2772. if test "$kde_use_debug_code" = "full"; then
  2773. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2774. else
  2775. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  2776. fi
  2777. fi
  2778. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2779. dnl convenience compiler flags
  2780. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2781. AC_SUBST(WOVERLOADED_VIRTUAL)
  2782. else
  2783. if test "$CXX" = "KCC"; then
  2784. CXXFLAGS="+K3 $CXXFLAGS"
  2785. else
  2786. CXXFLAGS="-O2 $CXXFLAGS"
  2787. fi
  2788. fi
  2789. fi
  2790. if test "$kde_use_debug_define" = "yes"; then
  2791. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2792. fi
  2793. if test "$kde_use_profiling" = "yes"; then
  2794. KDE_CHECK_COMPILER_FLAG(pg,
  2795. [
  2796. CFLAGS="-pg $CFLAGS"
  2797. CXXFLAGS="-pg $CXXFLAGS"
  2798. ])
  2799. fi
  2800. if test "$kde_use_warnings" = "yes"; then
  2801. if test "$GCC" = "yes"; then
  2802. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  2803. case $host in
  2804. *-*-linux-gnu)
  2805. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE $CFLAGS"
  2806. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
  2807. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2808. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2809. ;;
  2810. esac
  2811. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2812. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2813. dnl ### FIXME: revert for KDE 4
  2814. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  2815. fi
  2816. fi
  2817. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2818. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2819. fi
  2820. AC_ARG_ENABLE(pch,
  2821. AC_HELP_STRING([--enable-pch],
  2822. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2823. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2824. HAVE_GCC_VISIBILITY=0
  2825. AC_SUBST([HAVE_GCC_VISIBILITY])
  2826. if test "$GXX" = "yes"; then
  2827. gcc_no_reorder_blocks=NO
  2828. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  2829. if test $kde_use_debug_code != "no" && \
  2830. test $kde_use_debug_code != "full" && \
  2831. test "YES" = "$gcc_no_reorder_blocks" ; then
  2832. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  2833. CFLAGS="$CFLAGS -fno-reorder-blocks"
  2834. fi
  2835. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2836. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2837. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2838. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2839. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2840. if test "$kde_use_pch" = "yes"; then
  2841. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2842. echo >conftest.h
  2843. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2844. kde_gcc_supports_pch=yes
  2845. AC_MSG_RESULT(yes)
  2846. else
  2847. kde_gcc_supports_pch=no
  2848. AC_MSG_RESULT(no)
  2849. fi
  2850. if test "$kde_gcc_supports_pch" = "yes"; then
  2851. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2852. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2853. kde_gcc_supports_pch=yes
  2854. AC_MSG_RESULT(yes)
  2855. else
  2856. kde_gcc_supports_pch=no
  2857. AC_MSG_RESULT(no)
  2858. fi
  2859. fi
  2860. rm -f conftest.h conftest.h.gch
  2861. fi
  2862. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  2863. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  2864. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  2865. fi
  2866. fi
  2867. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2868. if test "$CXX" = "KCC"; then
  2869. dnl unfortunately we currently cannot disable exception support in KCC
  2870. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2871. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2872. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2873. if test "$kde_use_pch" = "yes"; then
  2874. dnl TODO: support --pch-dir!
  2875. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2876. dnl the below works (but the dir must exist), but it's
  2877. dnl useless for a whole package.
  2878. dnl The are precompiled headers for each source file, so when compiling
  2879. dnl from scratch, it doesn't make a difference, and they take up
  2880. dnl around ~5Mb _per_ sourcefile.
  2881. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2882. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2883. fi
  2884. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2885. dnl all implementations that are defined inside the class {} declaration.
  2886. dnl because of templates-compatibility with broken gcc compilers, this
  2887. dnl can cause excessive inlining. This flag limits it to a sane level
  2888. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2889. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2890. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2891. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2892. dnl Some source files are shared between multiple executables
  2893. dnl (or libraries) and some of those need template instantiations.
  2894. dnl In that case KCC needs to compile those sources with
  2895. dnl --one_instantiation_per_object. To make it easy for us we compile
  2896. dnl _all_ objects with that flag (--one_per is a shorthand).
  2897. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2898. fi
  2899. AC_SUBST(USE_EXCEPTIONS)
  2900. dnl obsolete macro - provided to keep things going
  2901. USE_RTTI=
  2902. AC_SUBST(USE_RTTI)
  2903. case "$host" in
  2904. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2905. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2906. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2907. *-*-solaris*)
  2908. if test "$GXX" = yes; then
  2909. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2910. if test ! -f $libstdcpp; then
  2911. 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])
  2912. fi
  2913. fi
  2914. ;;
  2915. esac
  2916. AC_VALIDIFY_CXXFLAGS
  2917. AC_PROG_CXXCPP
  2918. if test "$GCC" = yes; then
  2919. NOOPT_CFLAGS=-O0
  2920. fi
  2921. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2922. AC_ARG_ENABLE(coverage,
  2923. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2924. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2925. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2926. ac_coverage_linker="-lgcc"
  2927. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2928. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2929. ac_coverage_linker=""
  2930. else
  2931. AC_MSG_ERROR([coverage with your compiler is not supported])
  2932. fi
  2933. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2934. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2935. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2936. ])
  2937. AC_SUBST(NOOPT_CXXFLAGS)
  2938. AC_SUBST(NOOPT_CFLAGS)
  2939. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2940. KDE_CHECK_NEW_LDFLAGS
  2941. KDE_CHECK_FINAL
  2942. KDE_CHECK_CLOSURE
  2943. KDE_CHECK_NMCHECK
  2944. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2945. ])
  2946. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2947. [
  2948. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2949. [
  2950. AC_LANG_SAVE
  2951. AC_LANG_CPLUSPLUS
  2952. safe_CXXFLAGS=$CXXFLAGS
  2953. safe_LDFLAGS=$LDFLAGS
  2954. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2955. LDFLAGS="$LDFLAGS -shared -fPIC"
  2956. AC_TRY_LINK(
  2957. [
  2958. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2959. #include <string>
  2960. int some_function( void ) __attribute__ ((visibility("default")));
  2961. int some_function( void )
  2962. {
  2963. std::string s("blafasel");
  2964. return 0;
  2965. }
  2966. ], [/* elvis is alive */],
  2967. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  2968. CXXFLAGS=$safe_CXXFLAGS
  2969. LDFLAGS=$safe_LDFLAGS
  2970. AC_LANG_RESTORE
  2971. ]
  2972. )
  2973. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  2974. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  2975. fi
  2976. ]
  2977. )
  2978. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  2979. [
  2980. AC_BEFORE([AC_PATH_TQT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
  2981. AC_MSG_CHECKING([grepping for visibility push/pop in headers])
  2982. if test "x$GXX" = "xyes"; then
  2983. AC_LANG_SAVE
  2984. AC_LANG_CPLUSPLUS
  2985. AC_EGREP_CPP(
  2986. [GCC visibility push],
  2987. [ #include <exception>
  2988. ],
  2989. [
  2990. AC_MSG_RESULT(yes)
  2991. kde_stdc_visibility_patched=yes ],
  2992. [
  2993. AC_MSG_RESULT(no)
  2994. AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
  2995. visibility support. Disabling -fvisibility=hidden])
  2996. kde_stdc_visibility_patched=no ])
  2997. AC_LANG_RESTORE
  2998. kde_have_gcc_visibility=no
  2999. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  3000. [
  3001. kde_have_gcc_visibility=yes
  3002. dnl the whole toolchain is just a mess, gcc is just too buggy
  3003. dnl to handle STL with visibility enabled. Lets reconsider
  3004. dnl when gcc 4.2 is out or when things get fixed in the compiler.
  3005. dnl Contact mueller@kde.org for details.
  3006. AC_ARG_ENABLE(gcc-hidden-visibility,
  3007. AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
  3008. [kde_have_gcc_visibility=$enableval],
  3009. [kde_have_gcc_visibility=no])
  3010. AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
  3011. [
  3012. AC_LANG_SAVE
  3013. AC_LANG_CPLUSPLUS
  3014. safe_CXXFLAGS=$CXXFLAGS
  3015. CXXFLAGS="$CXXFLAGS $all_includes"
  3016. AC_TRY_COMPILE(
  3017. [
  3018. #include <qglobal.h>
  3019. #if Q_EXPORT - 0 != 0
  3020. /* if this compiles, then Q_EXPORT is undefined */
  3021. /* if Q_EXPORT is nonempty, this will break compilation */
  3022. #endif
  3023. ], [/* elvis is alive */],
  3024. kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
  3025. CXXFLAGS=$safe_CXXFLAGS
  3026. AC_LANG_RESTORE
  3027. ]
  3028. )
  3029. if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
  3030. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  3031. KDE_CHECK_VISIBILITY_GCC_BUG
  3032. HAVE_GCC_VISIBILITY=1
  3033. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  3034. fi
  3035. ])
  3036. fi
  3037. ])
  3038. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  3039. [
  3040. [A]M_DEPENDENCIES(CC)
  3041. [A]M_DEPENDENCIES(CXX)
  3042. ])
  3043. dnl just a wrapper to clean up configure.in
  3044. AC_DEFUN([KDE_PROG_LIBTOOL],
  3045. [
  3046. AC_REQUIRE([AC_CHECK_COMPILERS])
  3047. AC_REQUIRE([AC_ENABLE_SHARED])
  3048. AC_REQUIRE([AC_ENABLE_STATIC])
  3049. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  3050. AC_REQUIRE([KDE_CHECK_LIB64])
  3051. AC_OBJEXT
  3052. AC_EXEEXT
  3053. AM_PROG_LIBTOOL
  3054. AC_LIBTOOL_CXX
  3055. LIBTOOL_SHELL="/bin/sh ./libtool"
  3056. # LIBTOOL="$LIBTOOL --silent"
  3057. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  3058. AC_SUBST(KDE_PLUGIN)
  3059. # This hack ensures that libtool creates shared libs for tdeunittest plugins. By default check_LTLIBRARIES makes static libs.
  3060. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
  3061. AC_SUBST(KDE_CHECK_PLUGIN)
  3062. # we patch configure quite some so we better keep that consistent for incremental runs
  3063. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  3064. ])
  3065. AC_DEFUN([KDE_CHECK_LIB64],
  3066. [
  3067. tdelibsuff="$kde_libs_suffix"
  3068. if test -z "$tdelibsuff"; then
  3069. tdelibsuff="auto"
  3070. fi
  3071. AC_ARG_ENABLE(libsuffix,
  3072. AC_HELP_STRING([--enable-libsuffix],
  3073. [/lib directory suffix (64,32,none,auto[=default])]),
  3074. tdelibsuff=$enableval)
  3075. if test "$tdelibsuff" = "auto"; then
  3076. cat > conftest.c << EOF
  3077. #include <stdio.h>
  3078. int main() {
  3079. return 0;
  3080. }
  3081. EOF
  3082. tdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out | grep -E "libc.so"| grep -E -o "/lib[[^\/]]*/" | sed "s/lib//" | sed "s/\/*//g"`
  3083. rm -rf conftest.*
  3084. fi
  3085. if test "$tdelibsuff" = "no"; then
  3086. tdelibsuff=
  3087. fi
  3088. if test -z "$tdelibsuff"; then
  3089. AC_MSG_RESULT([not using lib directory suffix])
  3090. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  3091. else
  3092. if test "$libdir" = '${exec_prefix}/lib'; then
  3093. libdir="$libdir${tdelibsuff}"
  3094. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  3095. fi
  3096. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${tdelibsuff}"], Suffix for lib directories)
  3097. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  3098. fi
  3099. ])
  3100. AC_DEFUN([KDE_CHECK_TYPES],
  3101. [ AC_CHECK_SIZEOF(int, 4)dnl
  3102. AC_CHECK_SIZEOF(short)dnl
  3103. AC_CHECK_SIZEOF(long, 4)dnl
  3104. AC_CHECK_SIZEOF(char *, 4)dnl
  3105. ])dnl
  3106. dnl Not used - kept for compat only?
  3107. AC_DEFUN([KDE_DO_IT_ALL],
  3108. [
  3109. AC_CANONICAL_SYSTEM
  3110. AC_ARG_PROGRAM
  3111. AM_INIT_AUTOMAKE($1, $2)
  3112. AM_DISABLE_LIBRARIES
  3113. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  3114. AC_CHECK_COMPILERS
  3115. KDE_PROG_LIBTOOL
  3116. AM_KDE_WITH_NLS
  3117. AC_PATH_KDE
  3118. ])
  3119. AC_DEFUN([AC_CHECK_RPATH],
  3120. [
  3121. AC_MSG_CHECKING(for rpath)
  3122. AC_ARG_ENABLE(rpath,
  3123. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  3124. USE_RPATH=$enableval, USE_RPATH=yes)
  3125. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  3126. KDE_RPATH="-R \$(libdir)"
  3127. if test "$kde_libraries" != "$libdir"; then
  3128. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  3129. fi
  3130. if test -n "$qt_libraries"; then
  3131. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  3132. fi
  3133. dnl $x_libraries is set to /usr/lib in case
  3134. if test -n "$X_LDFLAGS"; then
  3135. X_RPATH="-R \$(x_libraries)"
  3136. KDE_RPATH="$KDE_RPATH $X_RPATH"
  3137. fi
  3138. if test -n "$KDE_EXTRA_RPATH"; then
  3139. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  3140. fi
  3141. fi
  3142. AC_SUBST(KDE_EXTRA_RPATH)
  3143. AC_SUBST(KDE_RPATH)
  3144. AC_SUBST(X_RPATH)
  3145. AC_MSG_RESULT($USE_RPATH)
  3146. ])
  3147. dnl Check for the type of the third argument of getsockname
  3148. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3149. [
  3150. AC_MSG_CHECKING(for socklen_t)
  3151. AC_CACHE_VAL(kde_cv_socklen_t,
  3152. [
  3153. AC_LANG_PUSH(C++)
  3154. kde_cv_socklen_t=no
  3155. AC_TRY_COMPILE([
  3156. #include <sys/types.h>
  3157. #include <sys/socket.h>
  3158. ],
  3159. [
  3160. socklen_t len;
  3161. getpeername(0,0,&len);
  3162. ],
  3163. [
  3164. kde_cv_socklen_t=yes
  3165. kde_cv_socklen_t_equiv=socklen_t
  3166. ])
  3167. AC_LANG_POP(C++)
  3168. ])
  3169. AC_MSG_RESULT($kde_cv_socklen_t)
  3170. if test $kde_cv_socklen_t = no; then
  3171. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3172. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3173. [
  3174. kde_cv_socklen_t_equiv=int
  3175. AC_LANG_PUSH(C++)
  3176. for t in int size_t unsigned long "unsigned long"; do
  3177. AC_TRY_COMPILE([
  3178. #include <sys/types.h>
  3179. #include <sys/socket.h>
  3180. ],
  3181. [
  3182. $t len;
  3183. getpeername(0,0,&len);
  3184. ],
  3185. [
  3186. kde_cv_socklen_t_equiv="$t"
  3187. break
  3188. ])
  3189. done
  3190. AC_LANG_POP(C++)
  3191. ])
  3192. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3193. fi
  3194. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3195. [type to use in place of socklen_t if not defined])
  3196. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3197. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3198. ])
  3199. dnl This is a merge of some macros out of the gettext aclocal.m4
  3200. dnl since we don't need anything, I took the things we need
  3201. dnl the copyright for them is:
  3202. dnl >
  3203. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3204. dnl This Makefile.in is free software; the Free Software Foundation
  3205. dnl gives unlimited permission to copy and/or distribute it,
  3206. dnl with or without modifications, as long as this notice is preserved.
  3207. dnl This program is distributed in the hope that it will be useful,
  3208. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3209. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3210. dnl PARTICULAR PURPOSE.
  3211. dnl >
  3212. dnl for this file it is relicensed under LGPL
  3213. AC_DEFUN([AM_KDE_WITH_NLS],
  3214. [
  3215. dnl If we use NLS figure out what method
  3216. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3217. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3218. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3219. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3220. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3221. GMSGFMT=":"
  3222. fi
  3223. MSGFMT=$GMSGFMT
  3224. AC_SUBST(GMSGFMT)
  3225. AC_SUBST(MSGFMT)
  3226. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3227. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3228. dnl Test whether we really found GNU xgettext.
  3229. if test "$XGETTEXT" != ":"; then
  3230. dnl If it is no GNU xgettext we define it as : so that the
  3231. dnl Makefiles still can work.
  3232. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3233. : ;
  3234. else
  3235. AC_MSG_RESULT(
  3236. [found xgettext programs is not GNU xgettext; ignore it])
  3237. XGETTEXT=":"
  3238. fi
  3239. fi
  3240. AC_SUBST(XGETTEXT)
  3241. ])
  3242. # Search path for a program which passes the given test.
  3243. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3244. # serial 1
  3245. # Stephan Kulow: I appended a _KDE against name conflicts
  3246. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3247. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3248. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3249. [# Extract the first word of "$2", so it can be a program name with args.
  3250. set dummy $2; ac_word=[$]2
  3251. AC_MSG_CHECKING([for $ac_word])
  3252. AC_CACHE_VAL(ac_cv_path_$1,
  3253. [case "[$]$1" in
  3254. /*)
  3255. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3256. ;;
  3257. *)
  3258. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3259. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3260. test -z "$ac_dir" && ac_dir=.
  3261. if test -f $ac_dir/$ac_word; then
  3262. if [$3]; then
  3263. ac_cv_path_$1="$ac_dir/$ac_word"
  3264. break
  3265. fi
  3266. fi
  3267. done
  3268. IFS="$ac_save_ifs"
  3269. dnl If no 4th arg is given, leave the cache variable unset,
  3270. dnl so AC_PATH_PROGS will keep looking.
  3271. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3272. ])dnl
  3273. ;;
  3274. esac])dnl
  3275. $1="$ac_cv_path_$1"
  3276. if test -n "[$]$1"; then
  3277. AC_MSG_RESULT([$]$1)
  3278. else
  3279. AC_MSG_RESULT(no)
  3280. fi
  3281. AC_SUBST($1)dnl
  3282. ])
  3283. # Check whether LC_MESSAGES is available in <locale.h>.
  3284. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3285. # serial 1
  3286. AC_DEFUN([AM_LC_MESSAGES],
  3287. [if test $ac_cv_header_locale_h = yes; then
  3288. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3289. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3290. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3291. if test $am_cv_val_LC_MESSAGES = yes; then
  3292. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3293. fi
  3294. fi])
  3295. dnl From Jim Meyering.
  3296. dnl FIXME: migrate into libit.
  3297. AC_DEFUN([AM_FUNC_OBSTACK],
  3298. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3299. [AC_TRY_LINK([#include "obstack.h"],
  3300. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3301. am_cv_func_obstack=yes,
  3302. am_cv_func_obstack=no)])
  3303. if test $am_cv_func_obstack = yes; then
  3304. AC_DEFINE(HAVE_OBSTACK)
  3305. else
  3306. LIBOBJS="$LIBOBJS obstack.o"
  3307. fi
  3308. ])
  3309. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3310. dnl FIXME: Migrate into libit
  3311. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3312. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3313. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3314. am_cv_lib_error_at_line=yes,
  3315. am_cv_lib_error_at_line=no)])
  3316. if test $am_cv_lib_error_at_line = no; then
  3317. LIBOBJS="$LIBOBJS error.o"
  3318. fi
  3319. AC_SUBST(LIBOBJS)dnl
  3320. ])
  3321. # Macro to add for using GNU gettext.
  3322. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3323. # serial 1
  3324. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  3325. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3326. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3327. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3328. AC_REQUIRE([AC_HEADER_STDC])dnl
  3329. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3330. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3331. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3332. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3333. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3334. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3335. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3336. __argz_count __argz_stringify __argz_next])
  3337. AC_MSG_CHECKING(for stpcpy)
  3338. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3339. [
  3340. kde_safe_cxxflags=$CXXFLAGS
  3341. CXXFLAGS="-Werror"
  3342. AC_LANG_SAVE
  3343. AC_LANG_CPLUSPLUS
  3344. AC_TRY_COMPILE([
  3345. #include <string.h>
  3346. ],
  3347. [
  3348. char buffer[200];
  3349. stpcpy(buffer, buffer);
  3350. ],
  3351. kde_cv_func_stpcpy=yes,
  3352. kde_cv_func_stpcpy=no)
  3353. AC_LANG_RESTORE
  3354. CXXFLAGS=$kde_safe_cxxflags
  3355. ])
  3356. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3357. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3358. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3359. fi
  3360. AM_LC_MESSAGES
  3361. if test "x$CATOBJEXT" != "x"; then
  3362. if test "x$ALL_LINGUAS" = "x"; then
  3363. LINGUAS=
  3364. else
  3365. AC_MSG_CHECKING(for catalogs to be installed)
  3366. NEW_LINGUAS=
  3367. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3368. case "$ALL_LINGUAS" in
  3369. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3370. esac
  3371. done
  3372. LINGUAS=$NEW_LINGUAS
  3373. AC_MSG_RESULT($LINGUAS)
  3374. fi
  3375. dnl Construct list of names of catalog files to be constructed.
  3376. if test -n "$LINGUAS"; then
  3377. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3378. fi
  3379. fi
  3380. ])
  3381. AC_DEFUN([AC_HAVE_XPM],
  3382. [AC_REQUIRE_CPP()dnl
  3383. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3384. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3385. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3386. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3387. xpm_test=$withval, xpm_test="yes")
  3388. if test "x$xpm_test" = xno; then
  3389. ac_cv_have_xpm=no
  3390. else
  3391. AC_MSG_CHECKING(for XPM)
  3392. AC_CACHE_VAL(ac_cv_have_xpm,
  3393. [
  3394. ac_save_ldflags="$LDFLAGS"
  3395. ac_save_cflags="$CFLAGS"
  3396. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  3397. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3398. else
  3399. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3400. fi
  3401. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3402. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3403. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3404. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3405. LDFLAGS="$ac_save_ldflags"
  3406. CFLAGS="$ac_save_cflags"
  3407. ])dnl
  3408. if test "$ac_cv_have_xpm" = no; then
  3409. AC_MSG_RESULT(no)
  3410. XPM_LDFLAGS=""
  3411. XPMINC=""
  3412. $2
  3413. else
  3414. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3415. if test "$XPM_LDFLAGS" = ""; then
  3416. XPMLIB='-lXpm $(LIB_X11)'
  3417. else
  3418. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3419. fi
  3420. if test "$XPM_INCLUDE" = ""; then
  3421. XPMINC=""
  3422. else
  3423. XPMINC="-I$XPM_INCLUDE"
  3424. fi
  3425. AC_MSG_RESULT(yes)
  3426. $1
  3427. fi
  3428. fi
  3429. AC_SUBST(XPMINC)
  3430. AC_SUBST(XPMLIB)
  3431. ])
  3432. AC_DEFUN([AC_HAVE_DPMS],
  3433. [AC_REQUIRE_CPP()dnl
  3434. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3435. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3436. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3437. DPMS_LIB=
  3438. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3439. dpms_test=$withval, dpms_test="yes")
  3440. if test "x$dpms_test" = xno; then
  3441. ac_cv_have_dpms=no
  3442. else
  3443. AC_MSG_CHECKING(for DPMS)
  3444. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3445. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3446. AC_CACHE_VAL(ac_cv_have_dpms,
  3447. [
  3448. if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
  3449. AC_MSG_RESULT(no)
  3450. ac_cv_have_dpms="no"
  3451. else
  3452. ac_save_ldflags="$LDFLAGS"
  3453. ac_save_cflags="$CFLAGS"
  3454. ac_save_libs="$LIBS"
  3455. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3456. LIBS="-lX11 -lXext $LIBSOCKET"
  3457. CFLAGS="$CFLAGS $X_INCLUDES"
  3458. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3459. AC_TRY_LINK([
  3460. #include <X11/Xproto.h>
  3461. #include <X11/X.h>
  3462. #include <X11/Xlib.h>
  3463. #include <X11/extensions/dpms.h>
  3464. int foo_test_dpms()
  3465. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3466. ac_cv_have_dpms="yes", [
  3467. LIBS="-lXdpms $LIBS"
  3468. AC_TRY_LINK([
  3469. #include <X11/Xproto.h>
  3470. #include <X11/X.h>
  3471. #include <X11/Xlib.h>
  3472. #include <X11/extensions/dpms.h>
  3473. int foo_test_dpms()
  3474. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3475. [
  3476. ac_cv_have_dpms="-lXdpms"
  3477. ],ac_cv_have_dpms="no")
  3478. ])
  3479. LDFLAGS="$ac_save_ldflags"
  3480. CFLAGS="$ac_save_cflags"
  3481. LIBS="$ac_save_libs"
  3482. fi
  3483. ])dnl
  3484. if test "$ac_cv_have_dpms" = no; then
  3485. AC_MSG_RESULT(no)
  3486. DPMS_LDFLAGS=""
  3487. DPMSINC=""
  3488. $2
  3489. else
  3490. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3491. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3492. DPMS_LIB="-lXdpms"
  3493. fi
  3494. if test "$DPMS_LDFLAGS" = ""; then
  3495. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3496. else
  3497. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3498. fi
  3499. if test "$DPMS_INCLUDE" = ""; then
  3500. DPMSINC=""
  3501. else
  3502. DPMSINC="-I$DPMS_INCLUDE"
  3503. fi
  3504. AC_MSG_RESULT(yes)
  3505. $1
  3506. fi
  3507. fi
  3508. ac_save_cflags="$CFLAGS"
  3509. CFLAGS="$CFLAGS $X_INCLUDES"
  3510. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3511. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3512. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3513. AC_CHECK_DECL(DPMSCapable,
  3514. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3515. [#include <X11/Xlib.h>
  3516. #include <X11/extensions/dpms.h>])
  3517. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3518. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3519. AC_CHECK_DECL(DPMSInfo,
  3520. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3521. [#include <X11/Xlib.h>
  3522. #include <X11/extensions/dpms.h>])
  3523. CFLAGS="$ac_save_cflags"
  3524. AC_SUBST(DPMSINC)
  3525. AC_SUBST(DPMSLIB)
  3526. ])
  3527. AC_DEFUN([AC_HAVE_GL],
  3528. [AC_REQUIRE_CPP()dnl
  3529. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3530. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3531. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3532. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3533. gl_test=$withval, gl_test="yes")
  3534. if test "x$kde_use_qt_emb" = "xyes"; then
  3535. # GL and Qt Embedded is a no-go for now.
  3536. ac_cv_have_gl=no
  3537. elif test "x$gl_test" = xno; then
  3538. ac_cv_have_gl=no
  3539. else
  3540. AC_MSG_CHECKING(for GL)
  3541. AC_CACHE_VAL(ac_cv_have_gl,
  3542. [
  3543. AC_LANG_SAVE
  3544. AC_LANG_CPLUSPLUS
  3545. ac_save_ldflags=$LDFLAGS
  3546. ac_save_cxxflags=$CXXFLAGS
  3547. ac_save_libs=$LIBS
  3548. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3549. LIBS="$LIBS -lGL -lGLU"
  3550. test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
  3551. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3552. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3553. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3554. AC_TRY_LINK([#include <GL/gl.h>
  3555. #include <GL/glu.h>
  3556. ], [],
  3557. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3558. AC_LANG_RESTORE
  3559. LDFLAGS=$ac_save_ldflags
  3560. CXXFLAGS=$ac_save_cxxflags
  3561. LIBS=$ac_save_libs
  3562. ])dnl
  3563. if test "$ac_cv_have_gl" = "no"; then
  3564. AC_MSG_RESULT(no)
  3565. GL_LDFLAGS=""
  3566. GLINC=""
  3567. $2
  3568. else
  3569. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3570. if test "$GL_LDFLAGS" = ""; then
  3571. GLLIB='-lGLU -lGL $(LIB_X11)'
  3572. else
  3573. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3574. fi
  3575. if test "$GL_INCLUDE" = ""; then
  3576. GLINC=""
  3577. else
  3578. GLINC="-I$GL_INCLUDE"
  3579. fi
  3580. AC_MSG_RESULT($ac_cv_have_gl)
  3581. $1
  3582. fi
  3583. fi
  3584. AC_SUBST(GLINC)
  3585. AC_SUBST(GLLIB)
  3586. ])
  3587. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3588. AC_DEFUN([KDE_PAM], [
  3589. AC_REQUIRE([KDE_CHECK_LIBDL])
  3590. want_pam=
  3591. AC_ARG_WITH(pam,
  3592. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3593. [ if test "x$withval" = "xyes"; then
  3594. want_pam=yes
  3595. pam_service=kde
  3596. elif test "x$withval" = "xno"; then
  3597. want_pam=no
  3598. else
  3599. want_pam=yes
  3600. pam_service=$withval
  3601. fi
  3602. ], [ pam_service=kde ])
  3603. use_pam=
  3604. PAMLIBS=
  3605. if test "x$want_pam" != xno; then
  3606. AC_CHECK_LIB(pam, pam_start, [
  3607. AC_CHECK_HEADER(security/pam_appl.h,
  3608. [ pam_header=security/pam_appl.h ],
  3609. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3610. [ pam_header=pam/pam_appl.h ],
  3611. [
  3612. AC_MSG_WARN([PAM detected, but no headers found!
  3613. Make sure you have the necessary development packages installed.])
  3614. ]
  3615. )
  3616. ]
  3617. )
  3618. ], , $LIBDL)
  3619. if test -z "$pam_header"; then
  3620. if test "x$want_pam" = xyes; then
  3621. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3622. fi
  3623. else
  3624. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3625. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3626. use_pam=yes
  3627. dnl darwin claims to be something special
  3628. if test "$pam_header" = "pam/pam_appl.h"; then
  3629. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3630. fi
  3631. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3632. AC_MSG_CHECKING(for const pam_message)
  3633. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3634. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3635. [AC_MSG_RESULT([const: Linux-type PAM])],
  3636. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3637. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3638. )],
  3639. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3640. fi
  3641. fi
  3642. AC_SUBST(PAMLIBS)
  3643. ])
  3644. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3645. AC_DEFUN([DEF_PAM_SERVICE], [
  3646. AC_ARG_WITH($1-pam,
  3647. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3648. [ if test "x$use_pam" = xyes; then
  3649. $3_PAM_SERVICE=$withval
  3650. else
  3651. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3652. You may want to enforce it by using --with-pam.])
  3653. fi
  3654. ],
  3655. [ if test "x$use_pam" = xyes; then
  3656. $3_PAM_SERVICE="$pam_service"
  3657. fi
  3658. ])
  3659. if test -n "$$3_PAM_SERVICE"; then
  3660. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3661. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3662. fi
  3663. AC_SUBST($3_PAM_SERVICE)
  3664. ])
  3665. AC_DEFUN([KDE_SHADOWPASSWD], [
  3666. AC_REQUIRE([KDE_PAM])
  3667. AC_CHECK_LIB(shadow, getspent,
  3668. [ LIBSHADOW="-lshadow"
  3669. ac_use_shadow=yes
  3670. ],
  3671. [ dnl for UnixWare
  3672. AC_CHECK_LIB(gen, getspent,
  3673. [ LIBGEN="-lgen"
  3674. ac_use_shadow=yes
  3675. ],
  3676. [ AC_CHECK_FUNC(getspent,
  3677. [ ac_use_shadow=yes ],
  3678. [ ac_use_shadow=no ])
  3679. ])
  3680. ])
  3681. AC_SUBST(LIBSHADOW)
  3682. AC_SUBST(LIBGEN)
  3683. AC_MSG_CHECKING([for shadow passwords])
  3684. AC_ARG_WITH(shadow,
  3685. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3686. [ if test "x$withval" != "xno"; then
  3687. use_shadow=yes
  3688. else
  3689. use_shadow=no
  3690. fi
  3691. ], [
  3692. use_shadow="$ac_use_shadow"
  3693. ])
  3694. if test "x$use_shadow" = xyes; then
  3695. AC_MSG_RESULT(yes)
  3696. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3697. else
  3698. AC_MSG_RESULT(no)
  3699. LIBSHADOW=
  3700. LIBGEN=
  3701. fi
  3702. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3703. dnl this still applies, if we could use it indirectly through pam.
  3704. if test "x$use_shadow" = xyes ||
  3705. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3706. case $host in
  3707. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3708. SETUIDFLAGS="-m 4755 -o root";;
  3709. *)
  3710. SETUIDFLAGS="-m 4755";;
  3711. esac
  3712. fi
  3713. AC_SUBST(SETUIDFLAGS)
  3714. ])
  3715. AC_DEFUN([KDE_PASSWDLIBS], [
  3716. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3717. AC_REQUIRE([KDE_PAM])
  3718. AC_REQUIRE([KDE_SHADOWPASSWD])
  3719. if test "x$use_pam" = "xyes"; then
  3720. PASSWDLIBS="$PAMLIBS"
  3721. else
  3722. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3723. fi
  3724. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3725. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3726. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3727. dnl may need to read /etc/master.passwd).
  3728. case $host in
  3729. *-*-freebsd*)
  3730. SETUIDFLAGS="-m 4755 -o root"
  3731. ;;
  3732. *)
  3733. ;;
  3734. esac
  3735. AC_SUBST(PASSWDLIBS)
  3736. ])
  3737. AC_DEFUN([KDE_CHECK_LIBDL],
  3738. [
  3739. AC_CHECK_LIB(dl, dlopen, [
  3740. LIBDL="-ldl"
  3741. ac_cv_have_dlfcn=yes
  3742. ])
  3743. AC_CHECK_LIB(dld, shl_unload, [
  3744. LIBDL="-ldld"
  3745. ac_cv_have_shload=yes
  3746. ])
  3747. AC_SUBST(LIBDL)
  3748. ])
  3749. AC_DEFUN([KDE_CHECK_DLOPEN],
  3750. [
  3751. KDE_CHECK_LIBDL
  3752. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3753. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3754. ac_cv_have_dlfcn=no
  3755. fi
  3756. if test "$ac_cv_header_dl_h" = "no"; then
  3757. ac_cv_have_shload=no
  3758. fi
  3759. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3760. dnl (MM)
  3761. AC_ARG_ENABLE(dlopen,
  3762. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3763. enable_dlopen=$enableval,
  3764. enable_dlopen=yes)
  3765. # override the user's opinion, if we know it better ;)
  3766. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3767. enable_dlopen=no
  3768. fi
  3769. if test "$ac_cv_have_dlfcn" = "yes"; then
  3770. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3771. fi
  3772. if test "$ac_cv_have_shload" = "yes"; then
  3773. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3774. fi
  3775. if test "$enable_dlopen" = no ; then
  3776. test -n "$1" && eval $1
  3777. else
  3778. test -n "$2" && eval $2
  3779. fi
  3780. ])
  3781. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3782. [
  3783. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3784. KDE_PROG_LIBTOOL
  3785. AC_MSG_CHECKING([dynamic loading])
  3786. eval "`egrep '^build_libtool_libs=' libtool`"
  3787. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3788. dynamic_loading=yes
  3789. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3790. else
  3791. dynamic_loading=no
  3792. fi
  3793. AC_MSG_RESULT($dynamic_loading)
  3794. if test "$dynamic_loading" = "yes"; then
  3795. $1
  3796. else
  3797. $2
  3798. fi
  3799. ])
  3800. AC_DEFUN([KDE_ADD_INCLUDES],
  3801. [
  3802. if test -z "$1"; then
  3803. test_include="Pix.h"
  3804. else
  3805. test_include="$1"
  3806. fi
  3807. AC_MSG_CHECKING([for libg++ ($test_include)])
  3808. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3809. [
  3810. kde_cv_libgpp_includes=no
  3811. for ac_dir in \
  3812. \
  3813. /usr/include/g++ \
  3814. /usr/include \
  3815. /usr/unsupported/include \
  3816. /opt/include \
  3817. $extra_include \
  3818. ; \
  3819. do
  3820. if test -r "$ac_dir/$test_include"; then
  3821. kde_cv_libgpp_includes=$ac_dir
  3822. break
  3823. fi
  3824. done
  3825. ])
  3826. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3827. if test "$kde_cv_libgpp_includes" != "no"; then
  3828. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3829. fi
  3830. ])
  3831. ])
  3832. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3833. [
  3834. dnl This code is here specifically to handle the
  3835. dnl various flavors of threading library on FreeBSD
  3836. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3837. dnl There may be an environment PTHREAD_LIBS that
  3838. dnl specifies what to use; otherwise, search for it.
  3839. dnl -pthread is special cased and unsets LIBPTHREAD
  3840. dnl below if found.
  3841. LIBPTHREAD=""
  3842. if test -n "$PTHREAD_LIBS"; then
  3843. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3844. LIBPTHREAD="PTHREAD"
  3845. else
  3846. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3847. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3848. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3849. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3850. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3851. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3852. fi
  3853. fi
  3854. dnl Is this test really needed, in the face of the Tru64 test below?
  3855. if test -z "$LIBPTHREAD"; then
  3856. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3857. fi
  3858. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3859. if test -z "$LIBPTHREAD" ; then
  3860. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3861. kde_safe_libs=$LIBS
  3862. LIBS="$LIBS -lpthread"
  3863. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3864. AC_MSG_RESULT(yes)
  3865. LIBPTHREAD="-lpthread"],[
  3866. AC_MSG_RESULT(no)])
  3867. LIBS=$kde_safe_libs
  3868. fi
  3869. dnl Un-special-case for FreeBSD.
  3870. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3871. LIBPTHREAD=""
  3872. fi
  3873. AC_SUBST(LIBPTHREAD)
  3874. ])
  3875. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3876. [
  3877. USE_THREADS=""
  3878. if test -z "$LIBPTHREAD"; then
  3879. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3880. fi
  3881. AH_VERBATIM(__svr_define, [
  3882. #if defined(__SVR4) && !defined(__svr4__)
  3883. #define __svr4__ 1
  3884. #endif
  3885. ])
  3886. case $host_os in
  3887. solaris*)
  3888. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3889. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3890. ;;
  3891. freebsd*)
  3892. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3893. ;;
  3894. aix*)
  3895. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3896. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3897. ;;
  3898. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3899. if test "$CXX" = "KCC"; then
  3900. CXXFLAGS="$CXXFLAGS --thread_safe"
  3901. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3902. fi
  3903. ;;
  3904. *)
  3905. ;;
  3906. esac
  3907. AC_SUBST(USE_THREADS)
  3908. AC_SUBST(LIBPTHREAD)
  3909. ])
  3910. AC_DEFUN([KDE_CHECK_THREADING],
  3911. [
  3912. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3913. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3914. dnl default is yes if libpthread is found and no if no libpthread is available
  3915. if test -z "$LIBPTHREAD"; then
  3916. if test -z "$USE_THREADS"; then
  3917. kde_check_threading_default=no
  3918. else
  3919. kde_check_threading_default=yes
  3920. fi
  3921. else
  3922. kde_check_threading_default=yes
  3923. fi
  3924. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3925. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3926. if test "x$kde_use_threading" = "xyes"; then
  3927. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3928. fi
  3929. ])
  3930. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3931. [
  3932. if test "$kde_python_link_found" = no; then
  3933. if test "$1" = normal; then
  3934. AC_MSG_CHECKING(if a Python application links)
  3935. else
  3936. AC_MSG_CHECKING(if Python depends on $2)
  3937. fi
  3938. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3939. [
  3940. kde_save_cflags="$CFLAGS"
  3941. CFLAGS="$CFLAGS $PYTHONINC"
  3942. kde_save_libs="$LIBS"
  3943. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3944. kde_save_ldflags="$LDFLAGS"
  3945. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3946. AC_TRY_LINK(
  3947. [
  3948. #include <Python.h>
  3949. ],[
  3950. PySys_SetArgv(1, 0);
  3951. ],
  3952. [kde_cv_try_link_python_$1=yes],
  3953. [kde_cv_try_link_python_$1=no]
  3954. )
  3955. CFLAGS="$kde_save_cflags"
  3956. LIBS="$kde_save_libs"
  3957. LDFLAGS="$kde_save_ldflags"
  3958. ])
  3959. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3960. AC_MSG_RESULT(yes)
  3961. kde_python_link_found=yes
  3962. if test ! "$1" = normal; then
  3963. LIBPYTHON="$LIBPYTHON $2"
  3964. fi
  3965. $3
  3966. else
  3967. AC_MSG_RESULT(no)
  3968. $4
  3969. fi
  3970. fi
  3971. ])
  3972. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3973. [
  3974. AC_MSG_CHECKING([for Python directory])
  3975. AC_CACHE_VAL(kde_cv_pythondir,
  3976. [
  3977. if test -z "$PYTHONDIR"; then
  3978. kde_cv_pythondir=/usr/local
  3979. else
  3980. kde_cv_pythondir="$PYTHONDIR"
  3981. fi
  3982. ])
  3983. AC_ARG_WITH(pythondir,
  3984. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3985. [
  3986. ac_python_dir=$withval
  3987. ], ac_python_dir=$kde_cv_pythondir
  3988. )
  3989. AC_MSG_RESULT($ac_python_dir)
  3990. ])
  3991. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  3992. [
  3993. AC_REQUIRE([KDE_CHECK_LIBDL])
  3994. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3995. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3996. if test -z "$1"; then
  3997. version="1.5"
  3998. else
  3999. version="$1"
  4000. fi
  4001. AC_MSG_CHECKING([for Python$version])
  4002. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  4003. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  4004. if test ! -r $python_incdir/Python.h; then
  4005. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  4006. python_incdir=$python_incdir/python$version
  4007. if test ! -r $python_incdir/Python.h; then
  4008. python_incdir=no
  4009. fi
  4010. fi
  4011. PYTHONINC=-I$python_incdir
  4012. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $kde_extra_libs"
  4013. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  4014. if test ! -r $python_libdir/libpython$version.so; then
  4015. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  4016. if test ! -r $python_libdir/libpython$version.a; then
  4017. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  4018. python_libdir=$python_libdir/python$version/config
  4019. if test ! -r $python_libdir/libpython$version.a; then
  4020. python_libdir=no
  4021. fi
  4022. fi
  4023. fi
  4024. PYTHONLIB=-L$python_libdir
  4025. kde_orig_LIBPYTHON=$LIBPYTHON
  4026. if test -z "$LIBPYTHON"; then
  4027. LIBPYTHON=-lpython$version
  4028. fi
  4029. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  4030. python_moddir=$python_moddir/python$version
  4031. if test ! -r $python_moddir/copy.py; then
  4032. python_moddir=no
  4033. fi
  4034. PYTHONMODDIR=$python_moddir
  4035. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  4036. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  4037. LIBPYTHON=$kde_orig_LIBPYTHON
  4038. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  4039. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  4040. $2
  4041. else
  4042. dnl Note: this test is very weak
  4043. kde_python_link_found=no
  4044. KDE_TRY_LINK_PYTHON(normal)
  4045. KDE_TRY_LINK_PYTHON(m, -lm)
  4046. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4047. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4048. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4049. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4050. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4051. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4052. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4053. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4054. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4055. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4056. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4057. [AC_MSG_WARN([it seems, Python depends on another library.
  4058. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4059. and contact the authors to let them know about this problem])
  4060. ])
  4061. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4062. AC_SUBST(PYTHONINC)
  4063. AC_SUBST(PYTHONLIB)
  4064. AC_SUBST(LIBPYTHON)
  4065. AC_SUBST(PYTHONMODDIR)
  4066. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4067. fi
  4068. ])
  4069. AC_DEFUN([KDE_CHECK_PYTHON],
  4070. [
  4071. KDE_CHECK_PYTHON_INTERN("2.4",
  4072. [KDE_CHECK_PYTHON_INTERN("2.3",
  4073. [KDE_CHECK_PYTHON_INTERN("2.2",
  4074. [KDE_CHECK_PYTHON_INTERN("2.1",
  4075. [KDE_CHECK_PYTHON_INTERN("2.0",
  4076. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4077. ])
  4078. ])
  4079. ])
  4080. ])
  4081. ])
  4082. AC_DEFUN([KDE_CHECK_STL],
  4083. [
  4084. AC_LANG_SAVE
  4085. AC_LANG_CPLUSPLUS
  4086. ac_save_CXXFLAGS="$CXXFLAGS"
  4087. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4088. AC_MSG_CHECKING([if C++ programs can be compiled])
  4089. AC_CACHE_VAL(kde_cv_stl_works,
  4090. [
  4091. AC_TRY_COMPILE([
  4092. #include <string>
  4093. using namespace std;
  4094. ],[
  4095. string astring="Hallo Welt.";
  4096. astring.erase(0, 6); // now astring is "Welt"
  4097. return 0;
  4098. ], kde_cv_stl_works=yes,
  4099. kde_cv_stl_works=no)
  4100. ])
  4101. AC_MSG_RESULT($kde_cv_stl_works)
  4102. if test "$kde_cv_stl_works" = "yes"; then
  4103. # back compatible
  4104. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4105. else
  4106. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4107. Check config.log for details - if you're using a Linux distribution you might miss
  4108. a package named similar to libstdc++-dev.])
  4109. fi
  4110. CXXFLAGS="$ac_save_CXXFLAGS"
  4111. AC_LANG_RESTORE
  4112. ])
  4113. AC_DEFUN([AC_FIND_QIMGIO],
  4114. [AC_REQUIRE([AC_FIND_JPEG])
  4115. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4116. AC_MSG_CHECKING([for qimgio])
  4117. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4118. [
  4119. AC_LANG_SAVE
  4120. AC_LANG_CPLUSPLUS
  4121. ac_save_LIBS="$LIBS"
  4122. ac_save_CXXFLAGS="$CXXFLAGS"
  4123. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBTQT"
  4124. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  4125. AC_TRY_RUN(dnl
  4126. [
  4127. #include <qimageio.h>
  4128. #include <qstring.h>
  4129. int main() {
  4130. QString t = "hallo";
  4131. t.fill('t');
  4132. qInitImageIO();
  4133. }
  4134. ],
  4135. ac_cv_lib_qimgio=yes,
  4136. ac_cv_lib_qimgio=no,
  4137. ac_cv_lib_qimgio=no)
  4138. LIBS="$ac_save_LIBS"
  4139. CXXFLAGS="$ac_save_CXXFLAGS"
  4140. AC_LANG_RESTORE
  4141. ])dnl
  4142. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4143. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4144. AC_MSG_RESULT(yes)
  4145. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  4146. AC_SUBST(LIBQIMGIO)
  4147. else
  4148. AC_MSG_RESULT(not found)
  4149. fi
  4150. ])
  4151. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4152. [
  4153. AC_PROVIDE([AM_ENABLE_STATIC])
  4154. AC_PROVIDE([AM_ENABLE_SHARED])
  4155. enable_static=no
  4156. enable_shared=yes
  4157. ])
  4158. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4159. [
  4160. AC_MSG_CHECKING([for utmp file])
  4161. AC_CACHE_VAL(kde_cv_utmp_file,
  4162. [
  4163. kde_cv_utmp_file=no
  4164. for ac_file in \
  4165. \
  4166. /var/run/utmp \
  4167. /var/adm/utmp \
  4168. /etc/utmp \
  4169. ; \
  4170. do
  4171. if test -r "$ac_file"; then
  4172. kde_cv_utmp_file=$ac_file
  4173. break
  4174. fi
  4175. done
  4176. ])
  4177. if test "$kde_cv_utmp_file" != "no"; then
  4178. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4179. $1
  4180. AC_MSG_RESULT($kde_cv_utmp_file)
  4181. else
  4182. $2
  4183. AC_MSG_RESULT([non found])
  4184. fi
  4185. ])
  4186. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4187. [
  4188. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4189. TOPSUBDIRS=""
  4190. if test ! -s $srcdir/subdirs; then
  4191. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4192. files=`cd $srcdir && ls -1`
  4193. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4194. for i in $dirs; do
  4195. echo $i >> $srcdir/subdirs
  4196. done
  4197. fi
  4198. ac_topsubdirs=
  4199. if test -s $srcdir/inst-apps; then
  4200. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4201. elif test -s $srcdir/subdirs; then
  4202. ac_topsubdirs="`cat $srcdir/subdirs`"
  4203. fi
  4204. for i in $ac_topsubdirs; do
  4205. AC_MSG_CHECKING([if $i should be compiled])
  4206. if test -d $srcdir/$i; then
  4207. install_it="yes"
  4208. for j in $DO_NOT_COMPILE; do
  4209. if test $i = $j; then
  4210. install_it="no"
  4211. fi
  4212. done
  4213. else
  4214. install_it="no"
  4215. fi
  4216. AC_MSG_RESULT($install_it)
  4217. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4218. if test $install_it = "yes"; then
  4219. TOPSUBDIRS="$TOPSUBDIRS $i"
  4220. eval "$vari""_SUBDIR_included=yes"
  4221. else
  4222. eval "$vari""_SUBDIR_included=no"
  4223. fi
  4224. done
  4225. AC_SUBST(TOPSUBDIRS)
  4226. ])
  4227. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4228. [
  4229. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4230. AC_LANG_SAVE
  4231. AC_LANG_CPLUSPLUS
  4232. AC_TRY_COMPILE([
  4233. ],
  4234. [
  4235. namespace Foo {
  4236. extern int i;
  4237. namespace Bar {
  4238. extern int i;
  4239. }
  4240. }
  4241. int Foo::i = 0;
  4242. int Foo::Bar::i = 1;
  4243. ],[
  4244. AC_MSG_RESULT(yes)
  4245. AC_DEFINE(HAVE_NAMESPACES)
  4246. ], [
  4247. AC_MSG_RESULT(no)
  4248. ])
  4249. AC_LANG_RESTORE
  4250. ])
  4251. dnl ------------------------------------------------------------------------
  4252. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4253. dnl ------------------------------------------------------------------------
  4254. dnl
  4255. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4256. [
  4257. AC_MSG_CHECKING(for S_ISSOCK)
  4258. AC_CACHE_VAL(ac_cv_have_s_issock,
  4259. [
  4260. AC_TRY_LINK(
  4261. [
  4262. #include <sys/stat.h>
  4263. ],
  4264. [
  4265. struct stat buff;
  4266. int b = S_ISSOCK( buff.st_mode );
  4267. ],
  4268. ac_cv_have_s_issock=yes,
  4269. ac_cv_have_s_issock=no)
  4270. ])
  4271. AC_MSG_RESULT($ac_cv_have_s_issock)
  4272. if test "$ac_cv_have_s_issock" = "yes"; then
  4273. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4274. fi
  4275. AH_VERBATIM(_ISSOCK,
  4276. [
  4277. #ifndef HAVE_S_ISSOCK
  4278. #define HAVE_S_ISSOCK
  4279. #define S_ISSOCK(mode) (1==0)
  4280. #endif
  4281. ])
  4282. ])
  4283. dnl ------------------------------------------------------------------------
  4284. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4285. dnl ------------------------------------------------------------------------
  4286. dnl
  4287. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4288. [
  4289. AC_MSG_CHECKING(for MAXPATHLEN)
  4290. AC_CACHE_VAL(ac_cv_maxpathlen,
  4291. [
  4292. cat > conftest.$ac_ext <<EOF
  4293. #ifdef STDC_HEADERS
  4294. # include <stdlib.h>
  4295. #endif
  4296. #include <stdio.h>
  4297. #include <sys/param.h>
  4298. #ifndef MAXPATHLEN
  4299. #define MAXPATHLEN 1024
  4300. #endif
  4301. KDE_HELLO MAXPATHLEN
  4302. EOF
  4303. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4304. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4305. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4306. else
  4307. ac_cv_maxpathlen=1024
  4308. fi
  4309. rm conftest.*
  4310. ])
  4311. AC_MSG_RESULT($ac_cv_maxpathlen)
  4312. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4313. ])
  4314. AC_DEFUN([KDE_CHECK_HEADER],
  4315. [
  4316. kde_safe_cppflags=$CPPFLAGS
  4317. CPPFLAGS="$CPPFLAGS $all_includes"
  4318. AC_LANG_SAVE
  4319. AC_LANG_CPLUSPLUS
  4320. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4321. AC_LANG_RESTORE
  4322. CPPFLAGS=$kde_safe_cppflags
  4323. ])
  4324. AC_DEFUN([KDE_CHECK_HEADERS],
  4325. [
  4326. AH_CHECK_HEADERS([$1])
  4327. AC_LANG_SAVE
  4328. kde_safe_cppflags=$CPPFLAGS
  4329. CPPFLAGS="$CPPFLAGS $all_includes"
  4330. AC_LANG_CPLUSPLUS
  4331. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4332. CPPFLAGS=$kde_safe_cppflags
  4333. AC_LANG_RESTORE
  4334. ])
  4335. AC_DEFUN([KDE_FAST_CONFIGURE],
  4336. [
  4337. dnl makes configure fast (needs perl)
  4338. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4339. with_fast_perl=$enableval, with_fast_perl=yes)
  4340. ])
  4341. AC_DEFUN([KDE_CONF_FILES],
  4342. [
  4343. val=
  4344. if test -f $srcdir/configure.files ; then
  4345. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4346. fi
  4347. CONF_FILES=
  4348. if test -n "$val" ; then
  4349. for i in $val ; do
  4350. CONF_FILES="$CONF_FILES $i"
  4351. done
  4352. fi
  4353. AC_SUBST(CONF_FILES)
  4354. ])dnl
  4355. dnl This sets the prefix, for arts and tdelibs
  4356. dnl Do NOT use in any other module.
  4357. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4358. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4359. [
  4360. unset CDPATH
  4361. dnl make $TDEDIR the default for the installation
  4362. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4363. if test "x$prefix" = "xNONE"; then
  4364. prefix=$ac_default_prefix
  4365. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4366. fi
  4367. # And delete superfluous '/' to make compares easier
  4368. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4369. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4370. kde_libs_prefix='$(prefix)'
  4371. kde_libs_htmldir='$(kde_htmldir)'
  4372. AC_SUBST(kde_libs_prefix)
  4373. AC_SUBST(kde_libs_htmldir)
  4374. KDE_FAST_CONFIGURE
  4375. KDE_CONF_FILES
  4376. ])
  4377. AC_DEFUN([KDE_SET_PREFIX],
  4378. [
  4379. unset CDPATH
  4380. dnl We can't give real code to that macro, only a value.
  4381. dnl It only matters for --help, since we set the prefix in this function anyway.
  4382. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4383. KDE_SET_DEFAULT_BINDIRS
  4384. if test "x$prefix" = "xNONE"; then
  4385. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4386. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4387. else
  4388. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4389. kde_save_PATH="$PATH"
  4390. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4391. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4392. PATH="$kde_save_PATH"
  4393. fi
  4394. kde_libs_prefix=`$KDECONFIG --prefix`
  4395. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4396. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4397. This means it has been moved since you installed it.
  4398. This won't work. Please recompile tdelibs for the new prefix.
  4399. ])
  4400. fi
  4401. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4402. kde_libs_suffix=`$KDECONFIG --libsuffix`
  4403. AC_MSG_CHECKING([where to install])
  4404. if test "x$prefix" = "xNONE"; then
  4405. prefix=$kde_libs_prefix
  4406. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4407. else
  4408. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4409. given_prefix=$prefix
  4410. AC_MSG_RESULT([$prefix (as requested)])
  4411. fi
  4412. # And delete superfluous '/' to make compares easier
  4413. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4414. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4415. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4416. AC_SUBST(KDECONFIG)
  4417. AC_SUBST(kde_libs_prefix)
  4418. AC_SUBST(kde_libs_htmldir)
  4419. KDE_FAST_CONFIGURE
  4420. KDE_CONF_FILES
  4421. ])
  4422. pushdef([AC_PROG_INSTALL],
  4423. [
  4424. dnl our own version, testing for a -p flag
  4425. popdef([AC_PROG_INSTALL])
  4426. dnl as AC_PROG_INSTALL works as it works we first have
  4427. dnl to save if the user didn't specify INSTALL, as the
  4428. dnl autoconf one overwrites INSTALL and we have no chance to find
  4429. dnl out afterwards
  4430. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4431. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4432. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4433. AC_PROG_INSTALL
  4434. if test -z "$kde_save_INSTALL_given" ; then
  4435. # OK, user hasn't given any INSTALL, autoconf found one for us
  4436. # now we test, if it supports the -p flag
  4437. AC_MSG_CHECKING(for -p flag to install)
  4438. rm -f confinst.$$.* > /dev/null 2>&1
  4439. echo "Testtest" > confinst.$$.orig
  4440. ac_res=no
  4441. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4442. if test -f confinst.$$.new ; then
  4443. # OK, -p seems to do no harm to install
  4444. INSTALL="${INSTALL} -p"
  4445. ac_res=yes
  4446. fi
  4447. fi
  4448. rm -f confinst.$$.*
  4449. AC_MSG_RESULT($ac_res)
  4450. fi
  4451. dnl the following tries to resolve some signs and wonders coming up
  4452. dnl with different autoconf/automake versions
  4453. dnl e.g.:
  4454. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4455. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4456. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4457. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4458. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4459. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4460. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4461. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4462. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4463. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4464. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4465. dnl and so does not see the -s flag in automake > 1.4
  4466. dnl to clean up that mess we:
  4467. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4468. dnl which cleans KDE's program with automake > 1.4;
  4469. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4470. dnl with automake<=1.4
  4471. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4472. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4473. dnl
  4474. dnl And to all this comes, that I even can't write in comments variable
  4475. dnl names used by automake, because it is so stupid to think I wanted to
  4476. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4477. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4478. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4479. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4480. fi
  4481. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4482. INSTALL_SCRIPT='${INSTALL}'
  4483. fi
  4484. ])dnl
  4485. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4486. [AC_LANG_CPLUSPLUS
  4487. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4488. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4489. ])
  4490. pushdef([AC_LANG_CPLUSPLUS],
  4491. [popdef([AC_LANG_CPLUSPLUS])
  4492. KDE_LANG_CPLUSPLUS
  4493. ])
  4494. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4495. [
  4496. AC_MSG_CHECKING(for long long)
  4497. AC_CACHE_VAL(kde_cv_c_long_long,
  4498. [
  4499. AC_LANG_SAVE
  4500. AC_LANG_CPLUSPLUS
  4501. AC_TRY_LINK([], [
  4502. long long foo = 0;
  4503. foo = foo+1;
  4504. ],
  4505. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4506. AC_LANG_RESTORE
  4507. ])
  4508. AC_MSG_RESULT($kde_cv_c_long_long)
  4509. if test "$kde_cv_c_long_long" = yes; then
  4510. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4511. fi
  4512. ])
  4513. AC_DEFUN([KDE_CHECK_LIB],
  4514. [
  4515. kde_save_LDFLAGS="$LDFLAGS"
  4516. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4517. kde_save_LIBS="$LIBS"
  4518. LDFLAGS="$LDFLAGS $all_libraries"
  4519. case $host_os in
  4520. aix*) LDFLAGS="-brtl $LDFLAGS"
  4521. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4522. ;;
  4523. esac
  4524. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4525. LDFLAGS="$kde_save_LDFLAGS"
  4526. LIBS="$kde_save_LIBS"
  4527. ])
  4528. AC_DEFUN([KDE_JAVA_PREFIX],
  4529. [
  4530. dir=`dirname "$1"`
  4531. base=`basename "$1"`
  4532. list=`ls -1 $dir 2> /dev/null`
  4533. for entry in $list; do
  4534. if test -d $dir/$entry/bin; then
  4535. case $entry in
  4536. $base)
  4537. javadirs="$javadirs $dir/$entry/bin"
  4538. ;;
  4539. esac
  4540. elif test -d $dir/$entry/jre/bin; then
  4541. case $entry in
  4542. $base)
  4543. javadirs="$javadirs $dir/$entry/jre/bin"
  4544. ;;
  4545. esac
  4546. fi
  4547. done
  4548. ])
  4549. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4550. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4551. [
  4552. AC_ARG_WITH(java,
  4553. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4554. [ ac_java_dir=$withval
  4555. ], ac_java_dir=""
  4556. )
  4557. AC_MSG_CHECKING([for Java])
  4558. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4559. if test "x$ac_java_dir" = "xno"; then
  4560. kde_java_bindir=no
  4561. kde_java_includedir=no
  4562. kde_java_libjvmdir=no
  4563. kde_java_libgcjdir=no
  4564. kde_java_libhpidir=no
  4565. else
  4566. if test "x$ac_java_dir" = "x"; then
  4567. dnl No option set -> collect list of candidate paths
  4568. if test -n "$JAVA_HOME"; then
  4569. KDE_JAVA_PREFIX($JAVA_HOME)
  4570. fi
  4571. KDE_JAVA_PREFIX(/usr/j2se)
  4572. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4573. KDE_JAVA_PREFIX(/usr/j*dk*)
  4574. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4575. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4576. KDE_JAVA_PREFIX(/usr/lib/java*)
  4577. KDE_JAVA_PREFIX(/usr/java*)
  4578. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4579. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4580. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4581. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4582. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4583. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4584. KDE_JAVA_PREFIX(/opt/java*)
  4585. kde_cv_path="NONE"
  4586. kde_save_IFS=$IFS
  4587. IFS=':'
  4588. for dir in $PATH; do
  4589. if test -d "$dir"; then
  4590. javadirs="$javadirs $dir"
  4591. fi
  4592. done
  4593. IFS=$kde_save_IFS
  4594. jredirs=
  4595. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4596. for dir in $javadirs; do
  4597. dnl Check for the java executable
  4598. if test -x "$dir/java"; then
  4599. dnl And also check for a libjvm.so somewhere under there
  4600. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4601. if test "$dir" != "/usr/bin"; then
  4602. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4603. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4604. jredirs="$jredirs $dir"
  4605. fi
  4606. fi
  4607. done
  4608. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4609. JAVAC=
  4610. JAVA=
  4611. kde_java_bindir=no
  4612. for dir in $jredirs; do
  4613. JAVA="$dir/java"
  4614. kde_java_bindir=$dir
  4615. if test -x "$dir/javac"; then
  4616. JAVAC="$dir/javac"
  4617. break
  4618. fi
  4619. done
  4620. if test -n "$JAVAC"; then
  4621. dnl this substitution might not work - well, we test for jni.h below
  4622. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4623. else
  4624. kde_java_includedir=no
  4625. fi
  4626. else
  4627. dnl config option set
  4628. kde_java_bindir=$ac_java_dir/bin
  4629. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4630. kde_java_includedir=no
  4631. else
  4632. kde_java_includedir=$ac_java_dir/include
  4633. fi
  4634. fi
  4635. fi
  4636. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4637. if test "x$kde_java_bindir" != "xno"; then
  4638. dnl Look for libjvm.so
  4639. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4640. dnl Look for libgcj.so
  4641. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4642. dnl Look for libhpi.so and avoid green threads
  4643. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4644. dnl Now check everything's fine under there
  4645. dnl the include dir is our flag for having the JDK
  4646. if test -d "$kde_java_includedir"; then
  4647. if test ! -x "$kde_java_bindir/javac"; then
  4648. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4649. fi
  4650. if test ! -x "$kde_java_bindir/javah"; then
  4651. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4652. fi
  4653. if test ! -x "$kde_java_bindir/jar"; then
  4654. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4655. fi
  4656. if test ! -r "$kde_java_includedir/jni.h"; then
  4657. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4658. fi
  4659. jni_includes="-I$kde_java_includedir"
  4660. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4661. dnl and under linux here..
  4662. dnl not needed for gcj
  4663. if test "x$kde_java_libgcjdir" = "x"; then
  4664. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4665. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4666. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4667. fi
  4668. else
  4669. JAVAC=
  4670. jni_includes=
  4671. fi
  4672. if test "x$kde_java_libgcjdir" = "x"; then
  4673. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4674. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4675. fi
  4676. else
  4677. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4678. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4679. fi
  4680. fi
  4681. if test ! -x "$kde_java_bindir/java"; then
  4682. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4683. fi
  4684. dnl not needed for gcj compile
  4685. if test "x$kde_java_libgcjdir" = "x"; then
  4686. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4687. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4688. fi
  4689. fi
  4690. if test -n "$jni_includes"; then
  4691. dnl Check for JNI version
  4692. AC_LANG_SAVE
  4693. AC_LANG_CPLUSPLUS
  4694. ac_cxxflags_safe="$CXXFLAGS"
  4695. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4696. AC_TRY_COMPILE([
  4697. #include <jni.h>
  4698. ],
  4699. [
  4700. #ifndef JNI_VERSION_1_2
  4701. Syntax Error
  4702. #endif
  4703. ],[ kde_jni_works=yes ],
  4704. [ kde_jni_works=no ])
  4705. if test $kde_jni_works = no; then
  4706. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4707. You need to have Java Development Kit (JDK) version 1.2.
  4708. Use --with-java to specify another location.
  4709. Use --without-java to configure without java support.
  4710. Or download a newer JDK and try again.
  4711. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4712. fi
  4713. CXXFLAGS="$ac_cxxflags_safe"
  4714. AC_LANG_RESTORE
  4715. dnl All tests ok, inform and subst the variables
  4716. JAVAC=$kde_java_bindir/javac
  4717. JAVAH=$kde_java_bindir/javah
  4718. JAR=$kde_java_bindir/jar
  4719. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4720. if test "x$kde_java_libgcjdir" = "x"; then
  4721. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4722. else
  4723. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4724. fi
  4725. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4726. else
  4727. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4728. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4729. fi
  4730. elif test -d "/Library/Java/Home"; then
  4731. kde_java_bindir="/Library/Java/Home/bin"
  4732. jni_includes="-I/Library/Java/Home/include"
  4733. JAVAC=$kde_java_bindir/javac
  4734. JAVAH=$kde_java_bindir/javah
  4735. JAR=$kde_java_bindir/jar
  4736. JVMLIBS="-Xlinker -framework -Xlinker JavaVM"
  4737. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4738. AC_MSG_RESULT([Apple Java Framework])
  4739. else
  4740. AC_MSG_RESULT([none found])
  4741. fi
  4742. AC_SUBST(JAVAC)
  4743. AC_SUBST(JAVAH)
  4744. AC_SUBST(JAR)
  4745. AC_SUBST(JVMLIBS)
  4746. AC_SUBST(jni_includes)
  4747. # for backward compat
  4748. kde_cv_java_includedir=$kde_java_includedir
  4749. kde_cv_java_bindir=$kde_java_bindir
  4750. ])
  4751. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4752. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4753. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4754. dnl it. (matz@kde.org)
  4755. m4_define([mm_foreach],
  4756. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4757. m4_define([mm_car], [[$1]])
  4758. m4_define([mm_car2], [[$@]])
  4759. m4_define([_mm_foreach],
  4760. [m4_if(m4_quote($2), [], [],
  4761. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4762. mm_car2(m4_shift($2)),
  4763. [$3])])])
  4764. m4_define([AC_FOREACH],
  4765. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4766. AC_DEFUN([KDE_NEED_FLEX],
  4767. [
  4768. kde_libs_safe=$LIBS
  4769. LIBS="$LIBS $USER_LDFLAGS"
  4770. AM_PROG_LEX
  4771. LIBS=$kde_libs_safe
  4772. if test -z "$LEXLIB"; then
  4773. AC_MSG_ERROR([You need to have flex installed.])
  4774. fi
  4775. AC_SUBST(LEXLIB)
  4776. ])
  4777. AC_DEFUN([AC_PATH_TQTOPIA],
  4778. [
  4779. dnl TODO: use AC_CACHE_VAL
  4780. if test -z "$1"; then
  4781. qtopia_minver_maj=1
  4782. qtopia_minver_min=5
  4783. qtopia_minver_pat=0
  4784. else
  4785. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4786. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4787. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4788. fi
  4789. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4790. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4791. AC_REQUIRE([AC_PATH_TQT])
  4792. AC_MSG_CHECKING([for Qtopia])
  4793. LIB_TQTOPIA="-lqpe"
  4794. AC_SUBST(LIB_TQTOPIA)
  4795. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4796. ac_qtopia_incdir=NO
  4797. AC_ARG_WITH(qtopia-dir,
  4798. AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
  4799. [ ac_qtopia_incdir="$withval"/include] )
  4800. qtopia_incdirs=""
  4801. for dir in $kde_qtopia_dirs; do
  4802. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4803. done
  4804. if test ! "$ac_qtopia_incdir" = "NO"; then
  4805. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4806. fi
  4807. qtopia_incdir=""
  4808. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4809. ac_qtopia_incdir="$qtopia_incdir"
  4810. if test -z "$qtopia_incdir"; then
  4811. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4812. fi
  4813. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4814. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4815. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4816. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4817. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4818. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4819. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4820. is required.])
  4821. fi
  4822. AC_LANG_SAVE
  4823. AC_LANG_CPLUSPLUS
  4824. ac_cxxflags_safe="$CXXFLAGS"
  4825. ac_ldflags_safe="$LDFLAGS"
  4826. ac_libs_safe="$LIBS"
  4827. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4828. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4829. LIBS="$LIBS $LIB_TQTOPIA $LIBTQT"
  4830. cat > conftest.$ac_ext <<EOF
  4831. #include "confdefs.h"
  4832. #include <qpe/qpeapplication.h>
  4833. #include <qpe/version.h>
  4834. int main( int argc, char **argv )
  4835. {
  4836. QPEApplication app( argc, argv );
  4837. return 0;
  4838. }
  4839. EOF
  4840. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4841. rm -f conftest*
  4842. else
  4843. rm -f conftest*
  4844. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4845. the end of config.log])
  4846. fi
  4847. CXXFLAGS="$ac_cxxflags_safe"
  4848. LDFLAGS="$ac_ldflags_safe"
  4849. LIBS="$ac_libs_safe"
  4850. AC_LANG_RESTORE
  4851. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4852. AC_SUBST(QTOPIA_INCLUDES)
  4853. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4854. ])
  4855. AC_DEFUN([KDE_INIT_DOXYGEN],
  4856. [
  4857. AC_MSG_CHECKING([for Qt docs])
  4858. kde_qtdir=
  4859. if test "${with_qt_dir+set}" = set; then
  4860. kde_qtdir="$with_qt_dir"
  4861. fi
  4862. AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $TQTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], TQTDOCDIR)
  4863. AC_MSG_RESULT($TQTDOCDIR)
  4864. AC_SUBST(TQTDOCDIR)
  4865. KDE_FIND_PATH(dot, DOT, [], [])
  4866. if test -n "$DOT"; then
  4867. KDE_HAVE_DOT="YES"
  4868. else
  4869. KDE_HAVE_DOT="NO"
  4870. fi
  4871. AC_SUBST(KDE_HAVE_DOT)
  4872. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4873. AC_SUBST(DOXYGEN)
  4874. DOXYGEN_PROJECT_NAME="$1"
  4875. DOXYGEN_PROJECT_NUMBER="$2"
  4876. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4877. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4878. KDE_HAS_DOXYGEN=no
  4879. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $TQTDOCDIR/qsql.html; then
  4880. KDE_HAS_DOXYGEN=yes
  4881. fi
  4882. AC_SUBST(KDE_HAS_DOXYGEN)
  4883. ])
  4884. AC_DEFUN([AC_FIND_BZIP2],
  4885. [
  4886. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4887. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4888. [
  4889. AC_LANG_SAVE
  4890. AC_LANG_CPLUSPLUS
  4891. kde_save_LIBS="$LIBS"
  4892. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4893. kde_save_CXXFLAGS="$CXXFLAGS"
  4894. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4895. AC_TRY_LINK(dnl
  4896. [
  4897. #define BZ_NO_STDIO
  4898. #include<bzlib.h>
  4899. ],
  4900. [ bz_stream s; (void) bzDecompress(&s); ],
  4901. eval "ac_cv_lib_bzip2='-lbz2'",
  4902. eval "ac_cv_lib_bzip2=no")
  4903. LIBS="$kde_save_LIBS"
  4904. CXXFLAGS="$kde_save_CXXFLAGS"
  4905. AC_LANG_RESTORE
  4906. ])dnl
  4907. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4908. if test ! "$ac_cv_lib_bzip2" = no; then
  4909. BZIP2DIR=bzip2
  4910. LIBBZ2="$ac_cv_lib_bzip2"
  4911. AC_SUBST(LIBBZ2)
  4912. else
  4913. cxx_shared_flag=
  4914. ld_shared_flag=
  4915. KDE_CHECK_COMPILER_FLAG(shared, [
  4916. ld_shared_flag="-shared"
  4917. ])
  4918. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4919. cxx_shared_flag="-fPIC"
  4920. ])
  4921. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4922. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4923. [
  4924. AC_LANG_SAVE
  4925. AC_LANG_CPLUSPLUS
  4926. kde_save_LIBS="$LIBS"
  4927. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4928. kde_save_CXXFLAGS="$CXXFLAGS"
  4929. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4930. AC_TRY_LINK(dnl
  4931. [
  4932. #define BZ_NO_STDIO
  4933. #include<bzlib.h>
  4934. ],
  4935. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4936. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4937. eval "ac_cv_lib_bzip2_prefix=no")
  4938. LIBS="$kde_save_LIBS"
  4939. CXXFLAGS="$kde_save_CXXFLAGS"
  4940. AC_LANG_RESTORE
  4941. ])dnl
  4942. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4943. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4944. BZIP2DIR=bzip2
  4945. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4946. AC_SUBST(LIBBZ2)
  4947. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4948. dnl else, we just ignore this
  4949. fi
  4950. fi
  4951. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4952. ])
  4953. dnl ------------------------------------------------------------------------
  4954. dnl Try to find the SSL headers and libraries.
  4955. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4956. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4957. dnl ------------------------------------------------------------------------
  4958. dnl
  4959. AC_DEFUN([KDE_CHECK_SSL],
  4960. [
  4961. LIBSSL="-lssl -lcrypto"
  4962. AC_REQUIRE([KDE_CHECK_LIB64])
  4963. ac_ssl_includes=NO ac_ssl_libraries=NO
  4964. ssl_libraries=""
  4965. ssl_includes=""
  4966. AC_ARG_WITH(ssl-dir,
  4967. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  4968. [ ac_ssl_includes="$withval"/include
  4969. ac_ssl_libraries="$withval"/lib$tdelibsuff
  4970. ])
  4971. want_ssl=yes
  4972. AC_ARG_WITH(ssl,
  4973. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  4974. [want_ssl=$withval])
  4975. if test $want_ssl = yes; then
  4976. AC_MSG_CHECKING(for OpenSSL)
  4977. AC_CACHE_VAL(ac_cv_have_ssl,
  4978. [#try to guess OpenSSL locations
  4979. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  4980. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  4981. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  4982. ac_ssl_includes="$ssl_incdir"
  4983. ssl_libdirs="/usr/lib$tdelibsuff /usr/local/lib$tdelibsuff /usr/ssl/lib$tdelibsuff /usr/local/ssl/lib$tdelibsuff $libdir $prefix/lib$tdelibsuff $exec_prefix/lib$tdelibsuff $kde_extra_libs"
  4984. if test ! "$ac_ssl_libraries" = "NO"; then
  4985. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  4986. fi
  4987. test=NONE
  4988. ssl_libdir=NONE
  4989. for dir in $ssl_libdirs; do
  4990. try="ls -1 $dir/libssl*"
  4991. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  4992. done
  4993. ac_ssl_libraries="$ssl_libdir"
  4994. ac_ldflags_safe="$LDFLAGS"
  4995. ac_libs_safe="$LIBS"
  4996. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  4997. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  4998. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  4999. ac_ssl_rsaref="yes"
  5000. ,
  5001. ac_ssl_rsaref="no"
  5002. )
  5003. LDFLAGS="$ac_ldflags_safe"
  5004. LIBS="$ac_libs_safe"
  5005. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5006. have_ssl=no
  5007. else
  5008. have_ssl=yes;
  5009. fi
  5010. ])
  5011. eval "$ac_cv_have_ssl"
  5012. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5013. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5014. AC_MSG_RESULT($ac_ssl_rsaref)
  5015. AC_MSG_CHECKING([for easter eggs])
  5016. AC_MSG_RESULT([none found])
  5017. else
  5018. have_ssl=no
  5019. fi
  5020. if test "$have_ssl" = yes; then
  5021. AC_MSG_CHECKING(for OpenSSL version)
  5022. dnl Check for SSL version
  5023. AC_CACHE_VAL(ac_cv_ssl_version,
  5024. [
  5025. cat >conftest.$ac_ext <<EOF
  5026. #include <openssl/opensslv.h>
  5027. #include <stdio.h>
  5028. int main() {
  5029. #ifndef OPENSSL_VERSION_NUMBER
  5030. printf("ssl_version=\\"error\\"\n");
  5031. #else
  5032. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5033. printf("ssl_version=\\"old\\"\n");
  5034. else
  5035. printf("ssl_version=\\"ok\\"\n");
  5036. #endif
  5037. return (0);
  5038. }
  5039. EOF
  5040. ac_save_CPPFLAGS=$CPPFLAGS
  5041. if test "$ac_ssl_includes" != "/usr/include"; then
  5042. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5043. fi
  5044. if AC_TRY_EVAL(ac_link); then
  5045. if eval `./conftest 2>&5`; then
  5046. if test $ssl_version = error; then
  5047. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5048. else
  5049. if test $ssl_version = old; then
  5050. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5051. have_ssl=no
  5052. fi
  5053. fi
  5054. ac_cv_ssl_version="ssl_version=$ssl_version"
  5055. else
  5056. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5057. Check config.log, and if you can't figure it out, send a mail to
  5058. David Faure <faure@kde.org>, attaching your config.log])
  5059. fi
  5060. else
  5061. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5062. Check config.log, and if you can't figure it out, send a mail to
  5063. David Faure <faure@kde.org>, attaching your config.log])
  5064. fi
  5065. CPPFLAGS=$ac_save_CPPFLAGS
  5066. ])
  5067. eval "$ac_cv_ssl_version"
  5068. AC_MSG_RESULT($ssl_version)
  5069. fi
  5070. if test "$have_ssl" != yes; then
  5071. LIBSSL="";
  5072. else
  5073. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5074. ac_cv_have_ssl="have_ssl=yes \
  5075. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5076. ssl_libraries="$ac_ssl_libraries"
  5077. ssl_includes="$ac_ssl_includes"
  5078. if test "$ac_ssl_rsaref" = yes; then
  5079. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5080. fi
  5081. if test $ssl_version = "old"; then
  5082. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5083. fi
  5084. fi
  5085. SSL_INCLUDES=
  5086. if test "$ssl_includes" = "/usr/include"; then
  5087. if test -f /usr/kerberos/include/krb5.h; then
  5088. SSL_INCLUDES="-I/usr/kerberos/include"
  5089. fi
  5090. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5091. SSL_INCLUDES="-I$ssl_includes"
  5092. fi
  5093. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5094. SSL_LDFLAGS=""
  5095. else
  5096. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5097. fi
  5098. AC_SUBST(SSL_INCLUDES)
  5099. AC_SUBST(SSL_LDFLAGS)
  5100. AC_SUBST(LIBSSL)
  5101. ])
  5102. AC_DEFUN([KDE_CHECK_STRLCPY],
  5103. [
  5104. AC_REQUIRE([AC_CHECK_STRLCAT])
  5105. AC_REQUIRE([AC_CHECK_STRLCPY])
  5106. AC_CHECK_SIZEOF(size_t)
  5107. AC_CHECK_SIZEOF(unsigned long)
  5108. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5109. AC_TRY_COMPILE(,[
  5110. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5111. choke me
  5112. #endif
  5113. ],AC_MSG_RESULT([yes]),[
  5114. AC_MSG_RESULT(no)
  5115. AC_MSG_ERROR([
  5116. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5117. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5118. ])
  5119. ])
  5120. ])
  5121. AC_DEFUN([KDE_CHECK_BINUTILS],
  5122. [
  5123. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5124. kde_save_LDFLAGS="$LDFLAGS"
  5125. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5126. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5127. AC_TRY_LINK([int foo;],
  5128. [
  5129. #ifdef __INTEL_COMPILER
  5130. icc apparently does not support libtools version-info and version-script
  5131. at the same time. Dunno where the bug is, but until somebody figured out,
  5132. better disable the optional version scripts.
  5133. #endif
  5134. foo = 42;
  5135. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5136. LDFLAGS="$kde_save_LDFLAGS"
  5137. rm -f conftest.map
  5138. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5139. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5140. AC_MSG_RESULT($kde_supports_versionmaps)
  5141. ])
  5142. AC_DEFUN([AM_PROG_OBJC],[
  5143. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5144. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5145. if test "x${OBJCFLAGS-unset}" = xunset; then
  5146. OBJCFLAGS="-g -O2"
  5147. fi
  5148. AC_SUBST(OBJCFLAGS)
  5149. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5150. ])
  5151. AC_DEFUN([KDE_CHECK_PERL],
  5152. [
  5153. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5154. AC_MSG_ERROR([No Perl found in your $PATH.
  5155. We need perl to generate some code.])
  5156. ])
  5157. AC_SUBST(PERL)
  5158. ])
  5159. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5160. [
  5161. AC_SYS_LARGEFILE
  5162. if test "$ac_cv_sys_file_offset_bits" != no; then
  5163. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5164. fi
  5165. if test "x$ac_cv_sys_large_files" != "xno"; then
  5166. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5167. fi
  5168. ])
  5169. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5170. dnl which allows to search for libs that get installed into the KDE prefix.
  5171. dnl
  5172. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5173. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5174. dnl also defines KSTUFF_PKG_ERRORS on error
  5175. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5176. PKG_CONFIG_PATH="$prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5177. if test "$prefix" != "$kde_libs_prefix"; then
  5178. PKG_CONFIG_PATH="$kde_libs_prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5179. fi
  5180. export PKG_CONFIG_PATH
  5181. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5182. ])
  5183. dnl Check for PIE support in the compiler and linker
  5184. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5185. [
  5186. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5187. [
  5188. AC_LANG_SAVE
  5189. AC_LANG_CPLUSPLUS
  5190. safe_CXXFLAGS=$CXXFLAGS
  5191. safe_LDFLAGS=$LDFLAGS
  5192. CXXFLAGS="$CXXFLAGS -fpie"
  5193. LDFLAGS="$LDFLAGS -pie"
  5194. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5195. CXXFLAGS=$safe_CXXFLAGS
  5196. LDFLAGS=$safe_LDFLAGS
  5197. AC_LANG_RESTORE
  5198. ])
  5199. AC_MSG_CHECKING(if enabling -pie/fpie support)
  5200. AC_ARG_ENABLE(pie,
  5201. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5202. [kde_has_pie_support=$enableval],
  5203. [kde_has_pie_support=detect])
  5204. if test "$kde_has_pie_support" = "detect"; then
  5205. kde_has_pie_support=$kde_cv_val_pie_support
  5206. fi
  5207. AC_MSG_RESULT([$kde_has_pie_support])
  5208. KDE_USE_FPIE=""
  5209. KDE_USE_PIE=""
  5210. AC_SUBST([KDE_USE_FPIE])
  5211. AC_SUBST([KDE_USE_PIE])
  5212. if test "$kde_has_pie_support" = "yes"; then
  5213. KDE_USE_FPIE="-fpie"
  5214. KDE_USE_PIE="-pie"
  5215. fi
  5216. ])
  5217. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  5218. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
  5219. ## Free Software Foundation, Inc.
  5220. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5221. ##
  5222. ## This file is free software; the Free Software Foundation gives
  5223. ## unlimited permission to copy and/or distribute it, with or without
  5224. ## modifications, as long as this notice is preserved.
  5225. # serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
  5226. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  5227. # -----------------------------------------------------------
  5228. # If this macro is not defined by Autoconf, define it here.
  5229. m4_ifdef([AC_PROVIDE_IFELSE],
  5230. [],
  5231. [m4_define([AC_PROVIDE_IFELSE],
  5232. [m4_ifdef([AC_PROVIDE_$1],
  5233. [$2], [$3])])])
  5234. # AC_PROG_LIBTOOL
  5235. # ---------------
  5236. AC_DEFUN([AC_PROG_LIBTOOL],
  5237. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  5238. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  5239. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  5240. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  5241. [AC_LIBTOOL_CXX],
  5242. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  5243. ])])
  5244. dnl And a similar setup for Fortran 77 support
  5245. AC_PROVIDE_IFELSE([AC_PROG_F77],
  5246. [AC_LIBTOOL_F77],
  5247. [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
  5248. ])])
  5249. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  5250. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  5251. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  5252. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  5253. [AC_LIBTOOL_GCJ],
  5254. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  5255. [AC_LIBTOOL_GCJ],
  5256. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  5257. [AC_LIBTOOL_GCJ],
  5258. [ifdef([AC_PROG_GCJ],
  5259. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5260. ifdef([A][M_PROG_GCJ],
  5261. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5262. ifdef([LT_AC_PROG_GCJ],
  5263. [define([LT_AC_PROG_GCJ],
  5264. defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
  5265. ])])# AC_PROG_LIBTOOL
  5266. # _AC_PROG_LIBTOOL
  5267. # ----------------
  5268. AC_DEFUN([_AC_PROG_LIBTOOL],
  5269. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  5270. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  5271. AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
  5272. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  5273. # This can be used to rebuild libtool when needed
  5274. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  5275. # Always use our own libtool.
  5276. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  5277. AC_SUBST(LIBTOOL)dnl
  5278. # Prevent multiple expansion
  5279. define([AC_PROG_LIBTOOL], [])
  5280. ])# _AC_PROG_LIBTOOL
  5281. # AC_LIBTOOL_SETUP
  5282. # ----------------
  5283. AC_DEFUN([AC_LIBTOOL_SETUP],
  5284. [AC_PREREQ(2.50)dnl
  5285. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  5286. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  5287. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  5288. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  5289. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  5290. AC_REQUIRE([AC_PROG_CC])dnl
  5291. AC_REQUIRE([AC_PROG_LD])dnl
  5292. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  5293. AC_REQUIRE([AC_PROG_NM])dnl
  5294. AC_REQUIRE([AC_PROG_LN_S])dnl
  5295. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  5296. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  5297. AC_REQUIRE([AC_OBJEXT])dnl
  5298. AC_REQUIRE([AC_EXEEXT])dnl
  5299. dnl
  5300. AC_LIBTOOL_SYS_MAX_CMD_LEN
  5301. AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  5302. AC_LIBTOOL_OBJDIR
  5303. AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5304. _LT_AC_PROG_ECHO_BACKSLASH
  5305. case $host_os in
  5306. aix3*)
  5307. # AIX sometimes has problems with the GCC collect2 program. For some
  5308. # reason, if we set the COLLECT_NAMES environment variable, the problems
  5309. # vanish in a puff of smoke.
  5310. if test "X${COLLECT_NAMES+set}" != Xset; then
  5311. COLLECT_NAMES=
  5312. export COLLECT_NAMES
  5313. fi
  5314. ;;
  5315. esac
  5316. # Sed substitution that helps us do robust quoting. It backslashifies
  5317. # metacharacters that are still active within double-quoted strings.
  5318. Xsed='sed -e 1s/^X//'
  5319. [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
  5320. # Same as above, but do not quote variable references.
  5321. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
  5322. # Sed substitution to delay expansion of an escaped shell variable in a
  5323. # double_quote_subst'ed string.
  5324. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  5325. # Sed substitution to avoid accidental globbing in evaled expressions
  5326. no_glob_subst='s/\*/\\\*/g'
  5327. # Constants:
  5328. rm="rm -f"
  5329. # Global variables:
  5330. default_ofile=libtool
  5331. can_build_shared=yes
  5332. # All known linkers require a `.a' archive for static linking (except MSVC,
  5333. # which needs '.lib').
  5334. libext=a
  5335. ltmain="$ac_aux_dir/ltmain.sh"
  5336. ofile="$default_ofile"
  5337. with_gnu_ld="$lt_cv_prog_gnu_ld"
  5338. AC_CHECK_TOOL(AR, ar, false)
  5339. AC_CHECK_TOOL(RANLIB, ranlib, :)
  5340. AC_CHECK_TOOL(STRIP, strip, :)
  5341. old_CC="$CC"
  5342. old_CFLAGS="$CFLAGS"
  5343. # Set sane defaults for various variables
  5344. test -z "$AR" && AR=ar
  5345. test -z "$AR_FLAGS" && AR_FLAGS=cru
  5346. test -z "$AS" && AS=as
  5347. test -z "$CC" && CC=cc
  5348. test -z "$LTCC" && LTCC=$CC
  5349. test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
  5350. test -z "$DLLTOOL" && DLLTOOL=dlltool
  5351. test -z "$LD" && LD=ld
  5352. test -z "$LN_S" && LN_S="ln -s"
  5353. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  5354. test -z "$NM" && NM=nm
  5355. test -z "$SED" && SED=sed
  5356. test -z "$OBJDUMP" && OBJDUMP=objdump
  5357. test -z "$RANLIB" && RANLIB=:
  5358. test -z "$STRIP" && STRIP=:
  5359. test -z "$ac_objext" && ac_objext=o
  5360. # Determine commands to create old-style static archives.
  5361. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  5362. old_postinstall_cmds='chmod 644 $oldlib'
  5363. old_postuninstall_cmds=
  5364. if test -n "$RANLIB"; then
  5365. case $host_os in
  5366. openbsd*)
  5367. old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
  5368. ;;
  5369. *)
  5370. old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
  5371. ;;
  5372. esac
  5373. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  5374. fi
  5375. _LT_CC_BASENAME([$compiler])
  5376. # Only perform the check for file, if the check method requires it
  5377. case $deplibs_check_method in
  5378. file_magic*)
  5379. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  5380. AC_PATH_MAGIC
  5381. fi
  5382. ;;
  5383. esac
  5384. AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  5385. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5386. enable_win32_dll=yes, enable_win32_dll=no)
  5387. AC_ARG_ENABLE([libtool-lock],
  5388. [AC_HELP_STRING([--disable-libtool-lock],
  5389. [avoid locking (might break parallel builds)])])
  5390. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5391. AC_ARG_WITH([pic],
  5392. [AC_HELP_STRING([--with-pic],
  5393. [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  5394. [pic_mode="$withval"],
  5395. [pic_mode=default])
  5396. test -z "$pic_mode" && pic_mode=default
  5397. # Use C for the default configuration in the libtool script
  5398. tagname=
  5399. AC_LIBTOOL_LANG_C_CONFIG
  5400. _LT_AC_TAGCONFIG
  5401. ])# AC_LIBTOOL_SETUP
  5402. # _LT_AC_SYS_COMPILER
  5403. # -------------------
  5404. AC_DEFUN([_LT_AC_SYS_COMPILER],
  5405. [AC_REQUIRE([AC_PROG_CC])dnl
  5406. # If no C compiler was specified, use CC.
  5407. LTCC=${LTCC-"$CC"}
  5408. # If no C compiler flags were specified, use CFLAGS.
  5409. LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
  5410. # Allow CC to be a program name with arguments.
  5411. compiler=$CC
  5412. ])# _LT_AC_SYS_COMPILER
  5413. # _LT_CC_BASENAME(CC)
  5414. # -------------------
  5415. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  5416. AC_DEFUN([_LT_CC_BASENAME],
  5417. [for cc_temp in $1""; do
  5418. case $cc_temp in
  5419. compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
  5420. distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
  5421. \-*) ;;
  5422. *) break;;
  5423. esac
  5424. done
  5425. cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
  5426. ])
  5427. # _LT_COMPILER_BOILERPLATE
  5428. # ------------------------
  5429. # Check for compiler boilerplate output or warnings with
  5430. # the simple compiler test code.
  5431. AC_DEFUN([_LT_COMPILER_BOILERPLATE],
  5432. [ac_outfile=conftest.$ac_objext
  5433. printf "$lt_simple_compile_test_code" >conftest.$ac_ext
  5434. eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
  5435. _lt_compiler_boilerplate=`cat conftest.err`
  5436. $rm conftest*
  5437. ])# _LT_COMPILER_BOILERPLATE
  5438. # _LT_LINKER_BOILERPLATE
  5439. # ----------------------
  5440. # Check for linker boilerplate output or warnings with
  5441. # the simple link test code.
  5442. AC_DEFUN([_LT_LINKER_BOILERPLATE],
  5443. [ac_outfile=conftest.$ac_objext
  5444. printf "$lt_simple_link_test_code" >conftest.$ac_ext
  5445. eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
  5446. _lt_linker_boilerplate=`cat conftest.err`
  5447. $rm conftest*
  5448. ])# _LT_LINKER_BOILERPLATE
  5449. # _LT_AC_SYS_LIBPATH_AIX
  5450. # ----------------------
  5451. # Links a minimal program and checks the executable
  5452. # for the system default hardcoded library path. In most cases,
  5453. # this is /usr/lib:/lib, but when the MPI compilers are used
  5454. # the location of the communication and MPI libs are included too.
  5455. # If we don't find anything, use the default library path according
  5456. # to the aix ld manual.
  5457. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
  5458. [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  5459. aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5460. }'`
  5461. # Check for a 64-bit object if we didn't find anything.
  5462. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5463. }'`; fi],[])
  5464. if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  5465. ])# _LT_AC_SYS_LIBPATH_AIX
  5466. # _LT_AC_SHELL_INIT(ARG)
  5467. # ----------------------
  5468. AC_DEFUN([_LT_AC_SHELL_INIT],
  5469. [ifdef([AC_DIVERSION_NOTICE],
  5470. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  5471. [AC_DIVERT_PUSH(NOTICE)])
  5472. $1
  5473. AC_DIVERT_POP
  5474. ])# _LT_AC_SHELL_INIT
  5475. # _LT_AC_PROG_ECHO_BACKSLASH
  5476. # --------------------------
  5477. # Add some code to the start of the generated configure script which
  5478. # will find an echo command which doesn't interpret backslashes.
  5479. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  5480. [_LT_AC_SHELL_INIT([
  5481. # Check that we are running under the correct shell.
  5482. SHELL=${CONFIG_SHELL-/bin/sh}
  5483. case X$ECHO in
  5484. X*--fallback-echo)
  5485. # Remove one level of quotation (which was required for Make).
  5486. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  5487. ;;
  5488. esac
  5489. echo=${ECHO-echo}
  5490. if test "X[$]1" = X--no-reexec; then
  5491. # Discard the --no-reexec flag, and continue.
  5492. shift
  5493. elif test "X[$]1" = X--fallback-echo; then
  5494. # Avoid inline document here, it may be left over
  5495. :
  5496. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
  5497. # Yippee, $echo works!
  5498. :
  5499. else
  5500. # Restart under the correct shell.
  5501. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5502. fi
  5503. if test "X[$]1" = X--fallback-echo; then
  5504. # used as fallback echo
  5505. shift
  5506. cat <<EOF
  5507. [$]*
  5508. EOF
  5509. exit 0
  5510. fi
  5511. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5512. # if CDPATH is set.
  5513. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5514. if test -z "$ECHO"; then
  5515. if test "X${echo_test_string+set}" != Xset; then
  5516. # find a string as large as possible, as long as the shell can cope with it
  5517. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  5518. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  5519. if (echo_test_string=`eval $cmd`) 2>/dev/null &&
  5520. echo_test_string=`eval $cmd` &&
  5521. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  5522. then
  5523. break
  5524. fi
  5525. done
  5526. fi
  5527. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5528. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5529. test "X$echo_testing_string" = "X$echo_test_string"; then
  5530. :
  5531. else
  5532. # The Solaris, AIX, and Digital Unix default echo programs unquote
  5533. # backslashes. This makes it impossible to quote backslashes using
  5534. # echo "$something" | sed 's/\\/\\\\/g'
  5535. #
  5536. # So, first we look for a working echo in the user's PATH.
  5537. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  5538. for dir in $PATH /usr/ucb; do
  5539. IFS="$lt_save_ifs"
  5540. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  5541. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  5542. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  5543. test "X$echo_testing_string" = "X$echo_test_string"; then
  5544. echo="$dir/echo"
  5545. break
  5546. fi
  5547. done
  5548. IFS="$lt_save_ifs"
  5549. if test "X$echo" = Xecho; then
  5550. # We didn't find a better echo, so look for alternatives.
  5551. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  5552. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  5553. test "X$echo_testing_string" = "X$echo_test_string"; then
  5554. # This shell has a builtin print -r that does the trick.
  5555. echo='print -r'
  5556. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  5557. test "X$CONFIG_SHELL" != X/bin/ksh; then
  5558. # If we have ksh, try running configure again with it.
  5559. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  5560. export ORIGINAL_CONFIG_SHELL
  5561. CONFIG_SHELL=/bin/ksh
  5562. export CONFIG_SHELL
  5563. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5564. else
  5565. # Try using printf.
  5566. echo='printf %s\n'
  5567. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5568. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5569. test "X$echo_testing_string" = "X$echo_test_string"; then
  5570. # Cool, printf works
  5571. :
  5572. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5573. test "X$echo_testing_string" = 'X\t' &&
  5574. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5575. test "X$echo_testing_string" = "X$echo_test_string"; then
  5576. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  5577. export CONFIG_SHELL
  5578. SHELL="$CONFIG_SHELL"
  5579. export SHELL
  5580. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5581. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5582. test "X$echo_testing_string" = 'X\t' &&
  5583. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5584. test "X$echo_testing_string" = "X$echo_test_string"; then
  5585. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5586. else
  5587. # maybe with a smaller string...
  5588. prev=:
  5589. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  5590. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  5591. then
  5592. break
  5593. fi
  5594. prev="$cmd"
  5595. done
  5596. if test "$prev" != 'sed 50q "[$]0"'; then
  5597. echo_test_string=`eval $prev`
  5598. export echo_test_string
  5599. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  5600. else
  5601. # Oops. We lost completely, so just stick with echo.
  5602. echo=echo
  5603. fi
  5604. fi
  5605. fi
  5606. fi
  5607. fi
  5608. fi
  5609. # Copy echo and quote the copy suitably for passing to libtool from
  5610. # the Makefile, instead of quoting the original, which is used later.
  5611. ECHO=$echo
  5612. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  5613. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  5614. fi
  5615. AC_SUBST(ECHO)
  5616. ])])# _LT_AC_PROG_ECHO_BACKSLASH
  5617. # _LT_AC_LOCK
  5618. # -----------
  5619. AC_DEFUN([_LT_AC_LOCK],
  5620. [AC_ARG_ENABLE([libtool-lock],
  5621. [AC_HELP_STRING([--disable-libtool-lock],
  5622. [avoid locking (might break parallel builds)])])
  5623. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5624. # Some flags need to be propagated to the compiler or linker for good
  5625. # libtool support.
  5626. case $host in
  5627. ia64-*-hpux*)
  5628. # Find out which ABI we are using.
  5629. echo 'int i;' > conftest.$ac_ext
  5630. if AC_TRY_EVAL(ac_compile); then
  5631. case `/usr/bin/file conftest.$ac_objext` in
  5632. *ELF-32*)
  5633. HPUX_IA64_MODE="32"
  5634. ;;
  5635. *ELF-64*)
  5636. HPUX_IA64_MODE="64"
  5637. ;;
  5638. esac
  5639. fi
  5640. rm -rf conftest*
  5641. ;;
  5642. *-*-irix6*)
  5643. # Find out which ABI we are using.
  5644. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  5645. if AC_TRY_EVAL(ac_compile); then
  5646. if test "$lt_cv_prog_gnu_ld" = yes; then
  5647. case `/usr/bin/file conftest.$ac_objext` in
  5648. *32-bit*)
  5649. LD="${LD-ld} -melf32bsmip"
  5650. ;;
  5651. *N32*)
  5652. LD="${LD-ld} -melf32bmipn32"
  5653. ;;
  5654. *64-bit*)
  5655. LD="${LD-ld} -melf64bmip"
  5656. ;;
  5657. esac
  5658. else
  5659. case `/usr/bin/file conftest.$ac_objext` in
  5660. *32-bit*)
  5661. LD="${LD-ld} -32"
  5662. ;;
  5663. *N32*)
  5664. LD="${LD-ld} -n32"
  5665. ;;
  5666. *64-bit*)
  5667. LD="${LD-ld} -64"
  5668. ;;
  5669. esac
  5670. fi
  5671. fi
  5672. rm -rf conftest*
  5673. ;;
  5674. x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  5675. # Find out which ABI we are using.
  5676. echo 'int i;' > conftest.$ac_ext
  5677. if AC_TRY_EVAL(ac_compile); then
  5678. case `/usr/bin/file conftest.o` in
  5679. *32-bit*)
  5680. case $host in
  5681. x86_64-*linux*)
  5682. LD="${LD-ld} -m elf_i386"
  5683. ;;
  5684. ppc64-*linux*|powerpc64-*linux*)
  5685. LD="${LD-ld} -m elf32ppclinux"
  5686. ;;
  5687. s390x-*linux*)
  5688. LD="${LD-ld} -m elf_s390"
  5689. ;;
  5690. sparc64-*linux*)
  5691. LD="${LD-ld} -m elf32_sparc"
  5692. ;;
  5693. esac
  5694. ;;
  5695. *64-bit*)
  5696. case $host in
  5697. x86_64-*linux*)
  5698. LD="${LD-ld} -m elf_x86_64"
  5699. ;;
  5700. ppc*-*linux*|powerpc*-*linux*)
  5701. LD="${LD-ld} -m elf64ppc"
  5702. ;;
  5703. s390*-*linux*)
  5704. LD="${LD-ld} -m elf64_s390"
  5705. ;;
  5706. sparc*-*linux*)
  5707. LD="${LD-ld} -m elf64_sparc"
  5708. ;;
  5709. esac
  5710. ;;
  5711. esac
  5712. fi
  5713. rm -rf conftest*
  5714. ;;
  5715. *-*-sco3.2v5*)
  5716. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  5717. SAVE_CFLAGS="$CFLAGS"
  5718. CFLAGS="$CFLAGS -belf"
  5719. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  5720. [AC_LANG_PUSH(C)
  5721. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  5722. AC_LANG_POP])
  5723. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  5724. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  5725. CFLAGS="$SAVE_CFLAGS"
  5726. fi
  5727. ;;
  5728. sparc*-*solaris*)
  5729. # Find out which ABI we are using.
  5730. echo 'int i;' > conftest.$ac_ext
  5731. if AC_TRY_EVAL(ac_compile); then
  5732. case `/usr/bin/file conftest.o` in
  5733. *64-bit*)
  5734. case $lt_cv_prog_gnu_ld in
  5735. yes*) LD="${LD-ld} -m elf64_sparc" ;;
  5736. *) LD="${LD-ld} -64" ;;
  5737. esac
  5738. ;;
  5739. esac
  5740. fi
  5741. rm -rf conftest*
  5742. ;;
  5743. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5744. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  5745. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  5746. AC_CHECK_TOOL(AS, as, false)
  5747. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  5748. ;;
  5749. ])
  5750. esac
  5751. need_locks="$enable_libtool_lock"
  5752. ])# _LT_AC_LOCK
  5753. # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5754. # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  5755. # ----------------------------------------------------------------
  5756. # Check whether the given compiler option works
  5757. AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
  5758. [AC_REQUIRE([LT_AC_PROG_SED])
  5759. AC_CACHE_CHECK([$1], [$2],
  5760. [$2=no
  5761. ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  5762. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  5763. lt_compiler_flag="$3"
  5764. # Insert the option either (1) after the last *FLAGS variable, or
  5765. # (2) before a word containing "conftest.", or (3) at the end.
  5766. # Note that $ac_compile itself does not contain backslashes and begins
  5767. # with a dollar sign (not a hyphen), so the echo should work correctly.
  5768. # The option is referenced via a variable to avoid confusing sed.
  5769. lt_compile=`echo "$ac_compile" | $SED \
  5770. -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  5771. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  5772. -e 's:$: $lt_compiler_flag:'`
  5773. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  5774. (eval "$lt_compile" 2>conftest.err)
  5775. ac_status=$?
  5776. cat conftest.err >&AS_MESSAGE_LOG_FD
  5777. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5778. if (exit $ac_status) && test -s "$ac_outfile"; then
  5779. # The compiler can only warn and ignore the option if not recognized
  5780. # So say no if there are warnings other than the usual output.
  5781. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  5782. $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  5783. if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  5784. $2=yes
  5785. fi
  5786. fi
  5787. $rm conftest*
  5788. ])
  5789. if test x"[$]$2" = xyes; then
  5790. ifelse([$5], , :, [$5])
  5791. else
  5792. ifelse([$6], , :, [$6])
  5793. fi
  5794. ])# AC_LIBTOOL_COMPILER_OPTION
  5795. # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5796. # [ACTION-SUCCESS], [ACTION-FAILURE])
  5797. # ------------------------------------------------------------
  5798. # Check whether the given compiler option works
  5799. AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
  5800. [AC_CACHE_CHECK([$1], [$2],
  5801. [$2=no
  5802. save_LDFLAGS="$LDFLAGS"
  5803. LDFLAGS="$LDFLAGS $3"
  5804. printf "$lt_simple_link_test_code" > conftest.$ac_ext
  5805. if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  5806. # The linker can only warn and ignore the option if not recognized
  5807. # So say no if there are warnings
  5808. if test -s conftest.err; then
  5809. # Append any errors to the config.log.
  5810. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5811. $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
  5812. $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  5813. if diff conftest.exp conftest.er2 >/dev/null; then
  5814. $2=yes
  5815. fi
  5816. else
  5817. $2=yes
  5818. fi
  5819. fi
  5820. $rm conftest*
  5821. LDFLAGS="$save_LDFLAGS"
  5822. ])
  5823. if test x"[$]$2" = xyes; then
  5824. ifelse([$4], , :, [$4])
  5825. else
  5826. ifelse([$5], , :, [$5])
  5827. fi
  5828. ])# AC_LIBTOOL_LINKER_OPTION
  5829. # AC_LIBTOOL_SYS_MAX_CMD_LEN
  5830. # --------------------------
  5831. AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
  5832. [# find the maximum length of command line arguments
  5833. AC_MSG_CHECKING([the maximum length of command line arguments])
  5834. AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  5835. i=0
  5836. teststring="ABCD"
  5837. case $build_os in
  5838. msdosdjgpp*)
  5839. # On DJGPP, this test can blow up pretty badly due to problems in libc
  5840. # (any single argument exceeding 2000 bytes causes a buffer overrun
  5841. # during glob expansion). Even if it were fixed, the result of this
  5842. # check would be larger than it should be.
  5843. lt_cv_sys_max_cmd_len=12288; # 12K is about right
  5844. ;;
  5845. gnu*)
  5846. # Under GNU Hurd, this test is not required because there is
  5847. # no limit to the length of command line arguments.
  5848. # Libtool will interpret -1 as no limit whatsoever
  5849. lt_cv_sys_max_cmd_len=-1;
  5850. ;;
  5851. cygwin* | mingw*)
  5852. # On Win9x/ME, this test blows up -- it succeeds, but takes
  5853. # about 5 minutes as the teststring grows exponentially.
  5854. # Worse, since 9x/ME are not pre-emptively multitasking,
  5855. # you end up with a "frozen" computer, even though with patience
  5856. # the test eventually succeeds (with a max line length of 256k).
  5857. # Instead, let's just punt: use the minimum linelength reported by
  5858. # all of the supported platforms: 8192 (on NT/2K/XP).
  5859. lt_cv_sys_max_cmd_len=8192;
  5860. ;;
  5861. amigaos*)
  5862. # On AmigaOS with pdksh, this test takes hours, literally.
  5863. # So we just punt and use a minimum line length of 8192.
  5864. lt_cv_sys_max_cmd_len=8192;
  5865. ;;
  5866. netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  5867. # This has been around since 386BSD, at least. Likely further.
  5868. if test -x /sbin/sysctl; then
  5869. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  5870. elif test -x /usr/sbin/sysctl; then
  5871. lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
  5872. else
  5873. lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
  5874. fi
  5875. # And add a safety zone
  5876. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  5877. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  5878. ;;
  5879. interix*)
  5880. # We know the value 262144 and hardcode it with a safety zone (like BSD)
  5881. lt_cv_sys_max_cmd_len=196608
  5882. ;;
  5883. osf*)
  5884. # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
  5885. # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
  5886. # nice to cause kernel panics so lets avoid the loop below.
  5887. # First set a reasonable default.
  5888. lt_cv_sys_max_cmd_len=16384
  5889. #
  5890. if test -x /sbin/sysconfig; then
  5891. case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
  5892. *1*) lt_cv_sys_max_cmd_len=-1 ;;
  5893. esac
  5894. fi
  5895. ;;
  5896. sco3.2v5*)
  5897. lt_cv_sys_max_cmd_len=102400
  5898. ;;
  5899. sysv5* | sco5v6* | sysv4.2uw2*)
  5900. kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
  5901. if test -n "$kargmax"; then
  5902. lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
  5903. else
  5904. lt_cv_sys_max_cmd_len=32768
  5905. fi
  5906. ;;
  5907. *)
  5908. # If test is not a shell built-in, we'll probably end up computing a
  5909. # maximum length that is only half of the actual maximum length, but
  5910. # we can't tell.
  5911. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
  5912. while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
  5913. = "XX$teststring") >/dev/null 2>&1 &&
  5914. new_result=`expr "X$teststring" : ".*" 2>&1` &&
  5915. lt_cv_sys_max_cmd_len=$new_result &&
  5916. test $i != 17 # 1/2 MB should be enough
  5917. do
  5918. i=`expr $i + 1`
  5919. teststring=$teststring$teststring
  5920. done
  5921. teststring=
  5922. # Add a significant safety factor because C++ compilers can tack on massive
  5923. # amounts of additional arguments before passing them to the linker.
  5924. # It appears as though 1/2 is a usable value.
  5925. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  5926. ;;
  5927. esac
  5928. ])
  5929. if test -n $lt_cv_sys_max_cmd_len ; then
  5930. AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  5931. else
  5932. AC_MSG_RESULT(none)
  5933. fi
  5934. ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  5935. # _LT_AC_CHECK_DLFCN
  5936. # ------------------
  5937. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  5938. [AC_CHECK_HEADERS(dlfcn.h)dnl
  5939. ])# _LT_AC_CHECK_DLFCN
  5940. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  5941. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  5942. # ---------------------------------------------------------------------
  5943. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  5944. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5945. if test "$cross_compiling" = yes; then :
  5946. [$4]
  5947. else
  5948. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  5949. lt_status=$lt_dlunknown
  5950. cat > conftest.$ac_ext <<EOF
  5951. [#line __oline__ "configure"
  5952. #include "confdefs.h"
  5953. #if HAVE_DLFCN_H
  5954. #include <dlfcn.h>
  5955. #endif
  5956. #include <stdio.h>
  5957. #ifdef RTLD_GLOBAL
  5958. # define LT_DLGLOBAL RTLD_GLOBAL
  5959. #else
  5960. # ifdef DL_GLOBAL
  5961. # define LT_DLGLOBAL DL_GLOBAL
  5962. # else
  5963. # define LT_DLGLOBAL 0
  5964. # endif
  5965. #endif
  5966. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  5967. find out it does not work in some platform. */
  5968. #ifndef LT_DLLAZY_OR_NOW
  5969. # ifdef RTLD_LAZY
  5970. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  5971. # else
  5972. # ifdef DL_LAZY
  5973. # define LT_DLLAZY_OR_NOW DL_LAZY
  5974. # else
  5975. # ifdef RTLD_NOW
  5976. # define LT_DLLAZY_OR_NOW RTLD_NOW
  5977. # else
  5978. # ifdef DL_NOW
  5979. # define LT_DLLAZY_OR_NOW DL_NOW
  5980. # else
  5981. # define LT_DLLAZY_OR_NOW 0
  5982. # endif
  5983. # endif
  5984. # endif
  5985. # endif
  5986. #endif
  5987. #ifdef __cplusplus
  5988. extern "C" void exit (int);
  5989. #endif
  5990. void fnord() { int i=42;}
  5991. int main ()
  5992. {
  5993. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  5994. int status = $lt_dlunknown;
  5995. if (self)
  5996. {
  5997. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  5998. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  5999. /* dlclose (self); */
  6000. }
  6001. else
  6002. puts (dlerror ());
  6003. exit (status);
  6004. }]
  6005. EOF
  6006. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  6007. (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
  6008. lt_status=$?
  6009. case x$lt_status in
  6010. x$lt_dlno_uscore) $1 ;;
  6011. x$lt_dlneed_uscore) $2 ;;
  6012. x$lt_dlunknown|x*) $3 ;;
  6013. esac
  6014. else :
  6015. # compilation failed
  6016. $3
  6017. fi
  6018. fi
  6019. rm -fr conftest*
  6020. ])# _LT_AC_TRY_DLOPEN_SELF
  6021. # AC_LIBTOOL_DLOPEN_SELF
  6022. # ----------------------
  6023. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  6024. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  6025. if test "x$enable_dlopen" != xyes; then
  6026. enable_dlopen=unknown
  6027. enable_dlopen_self=unknown
  6028. enable_dlopen_self_static=unknown
  6029. else
  6030. lt_cv_dlopen=no
  6031. lt_cv_dlopen_libs=
  6032. case $host_os in
  6033. beos*)
  6034. lt_cv_dlopen="load_add_on"
  6035. lt_cv_dlopen_libs=
  6036. lt_cv_dlopen_self=yes
  6037. ;;
  6038. mingw* | pw32*)
  6039. lt_cv_dlopen="LoadLibrary"
  6040. lt_cv_dlopen_libs=
  6041. ;;
  6042. cygwin*)
  6043. lt_cv_dlopen="dlopen"
  6044. lt_cv_dlopen_libs=
  6045. ;;
  6046. darwin*)
  6047. # if libdl is installed we need to link against it
  6048. AC_CHECK_LIB([dl], [dlopen],
  6049. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  6050. lt_cv_dlopen="dyld"
  6051. lt_cv_dlopen_libs=
  6052. lt_cv_dlopen_self=yes
  6053. ])
  6054. ;;
  6055. *)
  6056. AC_CHECK_FUNC([shl_load],
  6057. [lt_cv_dlopen="shl_load"],
  6058. [AC_CHECK_LIB([dld], [shl_load],
  6059. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  6060. [AC_CHECK_FUNC([dlopen],
  6061. [lt_cv_dlopen="dlopen"],
  6062. [AC_CHECK_LIB([dl], [dlopen],
  6063. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  6064. [AC_CHECK_LIB([svld], [dlopen],
  6065. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  6066. [AC_CHECK_LIB([dld], [dld_link],
  6067. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  6068. ])
  6069. ])
  6070. ])
  6071. ])
  6072. ])
  6073. ;;
  6074. esac
  6075. if test "x$lt_cv_dlopen" != xno; then
  6076. enable_dlopen=yes
  6077. else
  6078. enable_dlopen=no
  6079. fi
  6080. case $lt_cv_dlopen in
  6081. dlopen)
  6082. save_CPPFLAGS="$CPPFLAGS"
  6083. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  6084. save_LDFLAGS="$LDFLAGS"
  6085. wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  6086. save_LIBS="$LIBS"
  6087. LIBS="$lt_cv_dlopen_libs $LIBS"
  6088. AC_CACHE_CHECK([whether a program can dlopen itself],
  6089. lt_cv_dlopen_self, [dnl
  6090. _LT_AC_TRY_DLOPEN_SELF(
  6091. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  6092. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  6093. ])
  6094. if test "x$lt_cv_dlopen_self" = xyes; then
  6095. wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
  6096. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  6097. lt_cv_dlopen_self_static, [dnl
  6098. _LT_AC_TRY_DLOPEN_SELF(
  6099. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  6100. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  6101. ])
  6102. fi
  6103. CPPFLAGS="$save_CPPFLAGS"
  6104. LDFLAGS="$save_LDFLAGS"
  6105. LIBS="$save_LIBS"
  6106. ;;
  6107. esac
  6108. case $lt_cv_dlopen_self in
  6109. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6110. *) enable_dlopen_self=unknown ;;
  6111. esac
  6112. case $lt_cv_dlopen_self_static in
  6113. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6114. *) enable_dlopen_self_static=unknown ;;
  6115. esac
  6116. fi
  6117. ])# AC_LIBTOOL_DLOPEN_SELF
  6118. # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
  6119. # ---------------------------------
  6120. # Check to see if options -c and -o are simultaneously supported by compiler
  6121. AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
  6122. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  6123. AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  6124. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  6125. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  6126. $rm -r conftest 2>/dev/null
  6127. mkdir conftest
  6128. cd conftest
  6129. mkdir out
  6130. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  6131. lt_compiler_flag="-o out/conftest2.$ac_objext"
  6132. # Insert the option either (1) after the last *FLAGS variable, or
  6133. # (2) before a word containing "conftest.", or (3) at the end.
  6134. # Note that $ac_compile itself does not contain backslashes and begins
  6135. # with a dollar sign (not a hyphen), so the echo should work correctly.
  6136. lt_compile=`echo "$ac_compile" | $SED \
  6137. -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6138. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  6139. -e 's:$: $lt_compiler_flag:'`
  6140. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  6141. (eval "$lt_compile" 2>out/conftest.err)
  6142. ac_status=$?
  6143. cat out/conftest.err >&AS_MESSAGE_LOG_FD
  6144. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  6145. if (exit $ac_status) && test -s out/conftest2.$ac_objext
  6146. then
  6147. # The compiler can only warn and ignore the option if not recognized
  6148. # So say no if there are warnings
  6149. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  6150. $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  6151. if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
  6152. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  6153. fi
  6154. fi
  6155. chmod u+w . 2>&AS_MESSAGE_LOG_FD
  6156. $rm conftest*
  6157. # SGI C++ compiler will create directory out/ii_files/ for
  6158. # template instantiation
  6159. test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
  6160. $rm out/* && rmdir out
  6161. cd ..
  6162. rmdir conftest
  6163. $rm conftest*
  6164. ])
  6165. ])# AC_LIBTOOL_PROG_CC_C_O
  6166. # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
  6167. # -----------------------------------------
  6168. # Check to see if we can do hard links to lock some files if needed
  6169. AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
  6170. [AC_REQUIRE([_LT_AC_LOCK])dnl
  6171. hard_links="nottested"
  6172. if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  6173. # do not overwrite the value of need_locks provided by the user
  6174. AC_MSG_CHECKING([if we can lock with hard links])
  6175. hard_links=yes
  6176. $rm conftest*
  6177. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6178. touch conftest.a
  6179. ln conftest.a conftest.b 2>&5 || hard_links=no
  6180. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6181. AC_MSG_RESULT([$hard_links])
  6182. if test "$hard_links" = no; then
  6183. AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  6184. need_locks=warn
  6185. fi
  6186. else
  6187. need_locks=no
  6188. fi
  6189. ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  6190. # AC_LIBTOOL_OBJDIR
  6191. # -----------------
  6192. AC_DEFUN([AC_LIBTOOL_OBJDIR],
  6193. [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  6194. [rm -f .libs 2>/dev/null
  6195. mkdir .libs 2>/dev/null
  6196. if test -d .libs; then
  6197. lt_cv_objdir=.libs
  6198. else
  6199. # MS-DOS does not allow filenames that begin with a dot.
  6200. lt_cv_objdir=_libs
  6201. fi
  6202. rmdir .libs 2>/dev/null])
  6203. objdir=$lt_cv_objdir
  6204. ])# AC_LIBTOOL_OBJDIR
  6205. # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
  6206. # ----------------------------------------------
  6207. # Check hardcoding attributes.
  6208. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  6209. [AC_MSG_CHECKING([how to hardcode library paths into programs])
  6210. _LT_AC_TAGVAR(hardcode_action, $1)=
  6211. if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
  6212. test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
  6213. test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
  6214. # We can hardcode non-existant directories.
  6215. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  6216. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  6217. # have to relink, otherwise we might link with an installed library
  6218. # when we should be linking with a yet-to-be-installed one
  6219. ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  6220. test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  6221. # Linking always hardcodes the temporary library directory.
  6222. _LT_AC_TAGVAR(hardcode_action, $1)=relink
  6223. else
  6224. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  6225. _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  6226. fi
  6227. else
  6228. # We cannot hardcode anything, or else we can only hardcode existing
  6229. # directories.
  6230. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  6231. fi
  6232. AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  6233. if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  6234. # Fast installation is not supported
  6235. enable_fast_install=no
  6236. elif test "$shlibpath_overrides_runpath" = yes ||
  6237. test "$enable_shared" = no; then
  6238. # Fast installation is not necessary
  6239. enable_fast_install=needless
  6240. fi
  6241. ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  6242. # AC_LIBTOOL_SYS_LIB_STRIP
  6243. # ------------------------
  6244. AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
  6245. [striplib=
  6246. old_striplib=
  6247. AC_MSG_CHECKING([whether stripping libraries is possible])
  6248. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  6249. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  6250. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  6251. AC_MSG_RESULT([yes])
  6252. else
  6253. # FIXME - insert some real tests, host_os isn't really good enough
  6254. case $host_os in
  6255. darwin*)
  6256. if test -n "$STRIP" ; then
  6257. striplib="$STRIP -x"
  6258. AC_MSG_RESULT([yes])
  6259. else
  6260. AC_MSG_RESULT([no])
  6261. fi
  6262. ;;
  6263. *)
  6264. AC_MSG_RESULT([no])
  6265. ;;
  6266. esac
  6267. fi
  6268. ])# AC_LIBTOOL_SYS_LIB_STRIP
  6269. # AC_LIBTOOL_SYS_DYNAMIC_LINKER
  6270. # -----------------------------
  6271. # PORTME Fill in your ld.so characteristics
  6272. AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
  6273. [AC_MSG_CHECKING([dynamic linker characteristics])
  6274. library_names_spec=
  6275. libname_spec='lib$name'
  6276. soname_spec=
  6277. shrext_cmds=".so"
  6278. postinstall_cmds=
  6279. postuninstall_cmds=
  6280. finish_cmds=
  6281. finish_eval=
  6282. shlibpath_var=
  6283. shlibpath_overrides_runpath=unknown
  6284. version_type=none
  6285. dynamic_linker="$host_os ld.so"
  6286. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  6287. if test "$GCC" = yes; then
  6288. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  6289. if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
  6290. # if the path contains ";" then we assume it to be the separator
  6291. # otherwise default to the standard path separator (i.e. ":") - it is
  6292. # assumed that no part of a normal pathname contains ";" but that should
  6293. # okay in the real world where ";" in dirpaths is itself problematic.
  6294. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  6295. else
  6296. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  6297. fi
  6298. else
  6299. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  6300. fi
  6301. need_lib_prefix=unknown
  6302. hardcode_into_libs=no
  6303. # when you set need_version to no, make sure it does not cause -set_version
  6304. # flags to be left without arguments
  6305. need_version=unknown
  6306. case $host_os in
  6307. aix3*)
  6308. version_type=linux
  6309. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
  6310. shlibpath_var=LIBPATH
  6311. # AIX 3 has no versioning support, so we append a major version to the name.
  6312. soname_spec='${libname}${release}${shared_ext}$major'
  6313. ;;
  6314. aix4* | aix5*)
  6315. version_type=linux
  6316. need_lib_prefix=no
  6317. need_version=no
  6318. hardcode_into_libs=yes
  6319. if test "$host_cpu" = ia64; then
  6320. # AIX 5 supports IA64
  6321. library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
  6322. shlibpath_var=LD_LIBRARY_PATH
  6323. else
  6324. # With GCC up to 2.95.x, collect2 would create an import file
  6325. # for dependence libraries. The import file would start with
  6326. # the line `#! .'. This would cause the generated library to
  6327. # depend on `.', always an invalid library. This was fixed in
  6328. # development snapshots of GCC prior to 3.0.
  6329. case $host_os in
  6330. aix4 | aix4.[[01]] | aix4.[[01]].*)
  6331. if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  6332. echo ' yes '
  6333. echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  6334. :
  6335. else
  6336. can_build_shared=no
  6337. fi
  6338. ;;
  6339. esac
  6340. # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
  6341. # soname into executable. Probably we can add versioning support to
  6342. # collect2, so additional links can be useful in future.
  6343. if test "$aix_use_runtimelinking" = yes; then
  6344. # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  6345. # instead of lib<name>.a to let people know that these are not
  6346. # typical AIX shared libraries.
  6347. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6348. else
  6349. # We preserve .a as extension for shared libraries through AIX4.2
  6350. # and later when we are not doing run time linking.
  6351. library_names_spec='${libname}${release}.a $libname.a'
  6352. soname_spec='${libname}${release}${shared_ext}$major'
  6353. fi
  6354. shlibpath_var=LIBPATH
  6355. fi
  6356. ;;
  6357. amigaos*)
  6358. library_names_spec='$libname.ixlibrary $libname.a'
  6359. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  6360. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
  6361. ;;
  6362. beos*)
  6363. library_names_spec='${libname}${shared_ext}'
  6364. dynamic_linker="$host_os ld.so"
  6365. shlibpath_var=LIBRARY_PATH
  6366. ;;
  6367. bsdi[[45]]*)
  6368. version_type=linux
  6369. need_version=no
  6370. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6371. soname_spec='${libname}${release}${shared_ext}$major'
  6372. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  6373. shlibpath_var=LD_LIBRARY_PATH
  6374. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  6375. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  6376. # the default ld.so.conf also contains /usr/contrib/lib and
  6377. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  6378. # libtool to hard-code these into programs
  6379. ;;
  6380. cygwin* | mingw* | pw32*)
  6381. version_type=windows
  6382. shrext_cmds=".dll"
  6383. need_version=no
  6384. need_lib_prefix=no
  6385. case $GCC,$host_os in
  6386. yes,cygwin* | yes,mingw* | yes,pw32*)
  6387. library_names_spec='$libname.dll.a'
  6388. # DLL is installed to $(libdir)/../bin by postinstall_cmds
  6389. postinstall_cmds='base_file=`basename \${file}`~
  6390. dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
  6391. dldir=$destdir/`dirname \$dlpath`~
  6392. test -d \$dldir || mkdir -p \$dldir~
  6393. $install_prog $dir/$dlname \$dldir/$dlname~
  6394. chmod a+x \$dldir/$dlname'
  6395. postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  6396. dlpath=$dir/\$dldll~
  6397. $rm \$dlpath'
  6398. shlibpath_overrides_runpath=yes
  6399. case $host_os in
  6400. cygwin*)
  6401. # Cygwin DLLs use 'cyg' prefix rather than 'lib'
  6402. soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6403. sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
  6404. ;;
  6405. mingw*)
  6406. # MinGW DLLs use traditional 'lib' prefix
  6407. soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6408. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  6409. if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
  6410. # It is most probably a Windows format PATH printed by
  6411. # mingw gcc, but we are running on Cygwin. Gcc prints its search
  6412. # path with ; separators, and with drive letters. We can handle the
  6413. # drive letters (cygwin fileutils understands them), so leave them,
  6414. # especially as we might pass files found there to a mingw objdump,
  6415. # which wouldn't understand a cygwinified path. Ahh.
  6416. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  6417. else
  6418. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  6419. fi
  6420. ;;
  6421. pw32*)
  6422. # pw32 DLLs use 'pw' prefix rather than 'lib'
  6423. library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6424. ;;
  6425. esac
  6426. ;;
  6427. *)
  6428. library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
  6429. ;;
  6430. esac
  6431. dynamic_linker='Win32 ld.exe'
  6432. # FIXME: first we should search . and the directory the executable is in
  6433. shlibpath_var=PATH
  6434. ;;
  6435. darwin* | rhapsody*)
  6436. dynamic_linker="$host_os dyld"
  6437. version_type=darwin
  6438. need_lib_prefix=no
  6439. need_version=no
  6440. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  6441. soname_spec='${libname}${release}${major}$shared_ext'
  6442. shlibpath_overrides_runpath=yes
  6443. shlibpath_var=DYLD_LIBRARY_PATH
  6444. shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
  6445. # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
  6446. if test "$GCC" = yes; then
  6447. sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
  6448. else
  6449. sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
  6450. fi
  6451. sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  6452. ;;
  6453. dgux*)
  6454. version_type=linux
  6455. need_lib_prefix=no
  6456. need_version=no
  6457. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
  6458. soname_spec='${libname}${release}${shared_ext}$major'
  6459. shlibpath_var=LD_LIBRARY_PATH
  6460. ;;
  6461. freebsd1*)
  6462. dynamic_linker=no
  6463. ;;
  6464. freebsd* | dragonfly*)
  6465. # DragonFly does not have aout. When/if they implement a new
  6466. # versioning mechanism, adjust this.
  6467. if test -x /usr/bin/objformat; then
  6468. objformat=`/usr/bin/objformat`
  6469. else
  6470. case $host_os in
  6471. freebsd[[123]]*) objformat=aout ;;
  6472. *) objformat=elf ;;
  6473. esac
  6474. fi
  6475. version_type=freebsd-$objformat
  6476. case $version_type in
  6477. freebsd-elf*)
  6478. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  6479. need_version=no
  6480. need_lib_prefix=no
  6481. ;;
  6482. freebsd-*)
  6483. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
  6484. need_version=yes
  6485. ;;
  6486. esac
  6487. shlibpath_var=LD_LIBRARY_PATH
  6488. case $host_os in
  6489. freebsd2*)
  6490. shlibpath_overrides_runpath=yes
  6491. ;;
  6492. freebsd3.[[01]]* | freebsdelf3.[[01]]*)
  6493. shlibpath_overrides_runpath=yes
  6494. hardcode_into_libs=yes
  6495. ;;
  6496. freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
  6497. freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
  6498. shlibpath_overrides_runpath=no
  6499. hardcode_into_libs=yes
  6500. ;;
  6501. freebsd*) # from 4.6 on
  6502. shlibpath_overrides_runpath=yes
  6503. hardcode_into_libs=yes
  6504. ;;
  6505. esac
  6506. ;;
  6507. gnu*)
  6508. version_type=linux
  6509. need_lib_prefix=no
  6510. need_version=no
  6511. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  6512. soname_spec='${libname}${release}${shared_ext}$major'
  6513. shlibpath_var=LD_LIBRARY_PATH
  6514. hardcode_into_libs=yes
  6515. ;;
  6516. hpux9* | hpux10* | hpux11*)
  6517. # Give a soname corresponding to the major version so that dld.sl refuses to
  6518. # link against other versions.
  6519. version_type=sunos
  6520. need_lib_prefix=no
  6521. need_version=no
  6522. case $host_cpu in
  6523. ia64*)
  6524. shrext_cmds='.so'
  6525. hardcode_into_libs=yes
  6526. dynamic_linker="$host_os dld.so"
  6527. shlibpath_var=LD_LIBRARY_PATH
  6528. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6529. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6530. soname_spec='${libname}${release}${shared_ext}$major'
  6531. if test "X$HPUX_IA64_MODE" = X32; then
  6532. sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  6533. else
  6534. sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  6535. fi
  6536. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6537. ;;
  6538. hppa*64*)
  6539. shrext_cmds='.sl'
  6540. hardcode_into_libs=yes
  6541. dynamic_linker="$host_os dld.sl"
  6542. shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
  6543. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6544. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6545. soname_spec='${libname}${release}${shared_ext}$major'
  6546. sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
  6547. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6548. ;;
  6549. *)
  6550. shrext_cmds='.sl'
  6551. dynamic_linker="$host_os dld.sl"
  6552. shlibpath_var=SHLIB_PATH
  6553. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  6554. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6555. soname_spec='${libname}${release}${shared_ext}$major'
  6556. ;;
  6557. esac
  6558. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6559. postinstall_cmds='chmod 555 $lib'
  6560. ;;
  6561. interix3*)
  6562. version_type=linux
  6563. need_lib_prefix=no
  6564. need_version=no
  6565. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6566. soname_spec='${libname}${release}${shared_ext}$major'
  6567. dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
  6568. shlibpath_var=LD_LIBRARY_PATH
  6569. shlibpath_overrides_runpath=no
  6570. hardcode_into_libs=yes
  6571. ;;
  6572. irix5* | irix6* | nonstopux*)
  6573. case $host_os in
  6574. nonstopux*) version_type=nonstopux ;;
  6575. *)
  6576. if test "$lt_cv_prog_gnu_ld" = yes; then
  6577. version_type=linux
  6578. else
  6579. version_type=irix
  6580. fi ;;
  6581. esac
  6582. need_lib_prefix=no
  6583. need_version=no
  6584. soname_spec='${libname}${release}${shared_ext}$major'
  6585. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
  6586. case $host_os in
  6587. irix5* | nonstopux*)
  6588. libsuff= shlibsuff=
  6589. ;;
  6590. *)
  6591. case $LD in # libtool.m4 will add one of these switches to LD
  6592. *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
  6593. libsuff= shlibsuff= libmagic=32-bit;;
  6594. *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
  6595. libsuff=32 shlibsuff=N32 libmagic=N32;;
  6596. *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
  6597. libsuff=64 shlibsuff=64 libmagic=64-bit;;
  6598. *) libsuff= shlibsuff= libmagic=never-match;;
  6599. esac
  6600. ;;
  6601. esac
  6602. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  6603. shlibpath_overrides_runpath=no
  6604. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  6605. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  6606. hardcode_into_libs=yes
  6607. ;;
  6608. # No shared lib support for Linux oldld, aout, or coff.
  6609. linux*oldld* | linux*aout* | linux*coff*)
  6610. dynamic_linker=no
  6611. ;;
  6612. # This must be Linux ELF.
  6613. linux* | k*bsd*-gnu)
  6614. version_type=linux
  6615. need_lib_prefix=no
  6616. need_version=no
  6617. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6618. soname_spec='${libname}${release}${shared_ext}$major'
  6619. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  6620. shlibpath_var=LD_LIBRARY_PATH
  6621. shlibpath_overrides_runpath=no
  6622. # This implies no fast_install, which is unacceptable.
  6623. # Some rework will be needed to allow for fast_install
  6624. # before this can be enabled.
  6625. hardcode_into_libs=yes
  6626. # Append ld.so.conf contents to the search path
  6627. if test -f /etc/ld.so.conf; then
  6628. lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
  6629. sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
  6630. fi
  6631. # We used to test for /lib/ld.so.1 and disable shared libraries on
  6632. # powerpc, because MkLinux only supported shared libraries with the
  6633. # GNU dynamic linker. Since this was broken with cross compilers,
  6634. # most powerpc-linux boxes support dynamic linking these days and
  6635. # people can always --disable-shared, the test was removed, and we
  6636. # assume the GNU/Linux dynamic linker is in use.
  6637. dynamic_linker='GNU/Linux ld.so'
  6638. ;;
  6639. netbsdelf*-gnu)
  6640. version_type=linux
  6641. need_lib_prefix=no
  6642. need_version=no
  6643. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6644. soname_spec='${libname}${release}${shared_ext}$major'
  6645. shlibpath_var=LD_LIBRARY_PATH
  6646. shlibpath_overrides_runpath=no
  6647. hardcode_into_libs=yes
  6648. dynamic_linker='NetBSD ld.elf_so'
  6649. ;;
  6650. netbsd*)
  6651. version_type=sunos
  6652. need_lib_prefix=no
  6653. need_version=no
  6654. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  6655. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6656. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6657. dynamic_linker='NetBSD (a.out) ld.so'
  6658. else
  6659. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6660. soname_spec='${libname}${release}${shared_ext}$major'
  6661. dynamic_linker='NetBSD ld.elf_so'
  6662. fi
  6663. shlibpath_var=LD_LIBRARY_PATH
  6664. shlibpath_overrides_runpath=yes
  6665. hardcode_into_libs=yes
  6666. ;;
  6667. newsos6)
  6668. version_type=linux
  6669. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6670. shlibpath_var=LD_LIBRARY_PATH
  6671. shlibpath_overrides_runpath=yes
  6672. ;;
  6673. nto-qnx*)
  6674. version_type=linux
  6675. need_lib_prefix=no
  6676. need_version=no
  6677. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6678. soname_spec='${libname}${release}${shared_ext}$major'
  6679. shlibpath_var=LD_LIBRARY_PATH
  6680. shlibpath_overrides_runpath=yes
  6681. ;;
  6682. openbsd*)
  6683. version_type=sunos
  6684. sys_lib_dlsearch_path_spec="/usr/lib"
  6685. need_lib_prefix=no
  6686. # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
  6687. case $host_os in
  6688. openbsd3.3 | openbsd3.3.*) need_version=yes ;;
  6689. *) need_version=no ;;
  6690. esac
  6691. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6692. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6693. shlibpath_var=LD_LIBRARY_PATH
  6694. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  6695. case $host_os in
  6696. openbsd2.[[89]] | openbsd2.[[89]].*)
  6697. shlibpath_overrides_runpath=no
  6698. ;;
  6699. *)
  6700. shlibpath_overrides_runpath=yes
  6701. ;;
  6702. esac
  6703. else
  6704. shlibpath_overrides_runpath=yes
  6705. fi
  6706. ;;
  6707. os2*)
  6708. libname_spec='$name'
  6709. shrext_cmds=".dll"
  6710. need_lib_prefix=no
  6711. library_names_spec='$libname${shared_ext} $libname.a'
  6712. dynamic_linker='OS/2 ld.exe'
  6713. shlibpath_var=LIBPATH
  6714. ;;
  6715. osf3* | osf4* | osf5*)
  6716. version_type=osf
  6717. need_lib_prefix=no
  6718. need_version=no
  6719. soname_spec='${libname}${release}${shared_ext}$major'
  6720. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6721. shlibpath_var=LD_LIBRARY_PATH
  6722. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  6723. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  6724. ;;
  6725. solaris*)
  6726. version_type=linux
  6727. need_lib_prefix=no
  6728. need_version=no
  6729. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6730. soname_spec='${libname}${release}${shared_ext}$major'
  6731. shlibpath_var=LD_LIBRARY_PATH
  6732. shlibpath_overrides_runpath=yes
  6733. hardcode_into_libs=yes
  6734. # ldd complains unless libraries are executable
  6735. postinstall_cmds='chmod +x $lib'
  6736. ;;
  6737. sunos4*)
  6738. version_type=sunos
  6739. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6740. finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  6741. shlibpath_var=LD_LIBRARY_PATH
  6742. shlibpath_overrides_runpath=yes
  6743. if test "$with_gnu_ld" = yes; then
  6744. need_lib_prefix=no
  6745. fi
  6746. need_version=yes
  6747. ;;
  6748. sysv4 | sysv4.3*)
  6749. version_type=linux
  6750. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6751. soname_spec='${libname}${release}${shared_ext}$major'
  6752. shlibpath_var=LD_LIBRARY_PATH
  6753. case $host_vendor in
  6754. sni)
  6755. shlibpath_overrides_runpath=no
  6756. need_lib_prefix=no
  6757. export_dynamic_flag_spec='${wl}-Blargedynsym'
  6758. runpath_var=LD_RUN_PATH
  6759. ;;
  6760. siemens)
  6761. need_lib_prefix=no
  6762. ;;
  6763. motorola)
  6764. need_lib_prefix=no
  6765. need_version=no
  6766. shlibpath_overrides_runpath=no
  6767. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  6768. ;;
  6769. esac
  6770. ;;
  6771. sysv4*MP*)
  6772. if test -d /usr/nec ;then
  6773. version_type=linux
  6774. library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
  6775. soname_spec='$libname${shared_ext}.$major'
  6776. shlibpath_var=LD_LIBRARY_PATH
  6777. fi
  6778. ;;
  6779. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  6780. version_type=freebsd-elf
  6781. need_lib_prefix=no
  6782. need_version=no
  6783. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  6784. soname_spec='${libname}${release}${shared_ext}$major'
  6785. shlibpath_var=LD_LIBRARY_PATH
  6786. hardcode_into_libs=yes
  6787. if test "$with_gnu_ld" = yes; then
  6788. sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
  6789. shlibpath_overrides_runpath=no
  6790. else
  6791. sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
  6792. shlibpath_overrides_runpath=yes
  6793. case $host_os in
  6794. sco3.2v5*)
  6795. sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
  6796. ;;
  6797. esac
  6798. fi
  6799. sys_lib_dlsearch_path_spec='/usr/lib'
  6800. ;;
  6801. uts4*)
  6802. version_type=linux
  6803. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6804. soname_spec='${libname}${release}${shared_ext}$major'
  6805. shlibpath_var=LD_LIBRARY_PATH
  6806. ;;
  6807. *)
  6808. dynamic_linker=no
  6809. ;;
  6810. esac
  6811. AC_MSG_RESULT([$dynamic_linker])
  6812. test "$dynamic_linker" = no && can_build_shared=no
  6813. variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  6814. if test "$GCC" = yes; then
  6815. variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  6816. fi
  6817. ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
  6818. # _LT_AC_TAGCONFIG
  6819. # ----------------
  6820. AC_DEFUN([_LT_AC_TAGCONFIG],
  6821. [AC_ARG_WITH([tags],
  6822. [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
  6823. [include additional configurations @<:@automatic@:>@])],
  6824. [tagnames="$withval"])
  6825. if test -f "$ltmain" && test -n "$tagnames"; then
  6826. if test ! -f "${ofile}"; then
  6827. AC_MSG_WARN([output file `$ofile' does not exist])
  6828. fi
  6829. if test -z "$LTCC"; then
  6830. eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
  6831. if test -z "$LTCC"; then
  6832. AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
  6833. else
  6834. AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
  6835. fi
  6836. fi
  6837. if test -z "$LTCFLAGS"; then
  6838. eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
  6839. fi
  6840. # Extract list of available tagged configurations in $ofile.
  6841. # Note that this assumes the entire list is on one line.
  6842. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
  6843. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6844. for tagname in $tagnames; do
  6845. IFS="$lt_save_ifs"
  6846. # Check whether tagname contains only valid characters
  6847. case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
  6848. "") ;;
  6849. *) AC_MSG_ERROR([invalid tag name: $tagname])
  6850. ;;
  6851. esac
  6852. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
  6853. then
  6854. AC_MSG_ERROR([tag name \"$tagname\" already exists])
  6855. fi
  6856. # Update the list of available tags.
  6857. if test -n "$tagname"; then
  6858. echo appending configuration tag \"$tagname\" to $ofile
  6859. case $tagname in
  6860. CXX)
  6861. if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  6862. ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  6863. (test "X$CXX" != "Xg++"))) ; then
  6864. AC_LIBTOOL_LANG_CXX_CONFIG
  6865. else
  6866. tagname=""
  6867. fi
  6868. ;;
  6869. F77)
  6870. if test -n "$F77" && test "X$F77" != "Xno"; then
  6871. AC_LIBTOOL_LANG_F77_CONFIG
  6872. else
  6873. tagname=""
  6874. fi
  6875. ;;
  6876. GCJ)
  6877. if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
  6878. AC_LIBTOOL_LANG_GCJ_CONFIG
  6879. else
  6880. tagname=""
  6881. fi
  6882. ;;
  6883. RC)
  6884. AC_LIBTOOL_LANG_RC_CONFIG
  6885. ;;
  6886. *)
  6887. AC_MSG_ERROR([Unsupported tag name: $tagname])
  6888. ;;
  6889. esac
  6890. # Append the new tag name to the list of available tags.
  6891. if test -n "$tagname" ; then
  6892. available_tags="$available_tags $tagname"
  6893. fi
  6894. fi
  6895. done
  6896. IFS="$lt_save_ifs"
  6897. # Now substitute the updated list of available tags.
  6898. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
  6899. mv "${ofile}T" "$ofile"
  6900. chmod +x "$ofile"
  6901. else
  6902. rm -f "${ofile}T"
  6903. AC_MSG_ERROR([unable to update list of available tagged configurations.])
  6904. fi
  6905. fi
  6906. ])# _LT_AC_TAGCONFIG
  6907. # AC_LIBTOOL_DLOPEN
  6908. # -----------------
  6909. # enable checks for dlopen support
  6910. AC_DEFUN([AC_LIBTOOL_DLOPEN],
  6911. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
  6912. ])# AC_LIBTOOL_DLOPEN
  6913. # AC_LIBTOOL_WIN32_DLL
  6914. # --------------------
  6915. # declare package support for building win32 DLLs
  6916. AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
  6917. [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
  6918. ])# AC_LIBTOOL_WIN32_DLL
  6919. # AC_ENABLE_SHARED([DEFAULT])
  6920. # ---------------------------
  6921. # implement the --enable-shared flag
  6922. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6923. AC_DEFUN([AC_ENABLE_SHARED],
  6924. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  6925. AC_ARG_ENABLE([shared],
  6926. [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
  6927. [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
  6928. [p=${PACKAGE-default}
  6929. case $enableval in
  6930. yes) enable_shared=yes ;;
  6931. no) enable_shared=no ;;
  6932. *)
  6933. enable_shared=no
  6934. # Look at the argument we got. We use all the common list separators.
  6935. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6936. for pkg in $enableval; do
  6937. IFS="$lt_save_ifs"
  6938. if test "X$pkg" = "X$p"; then
  6939. enable_shared=yes
  6940. fi
  6941. done
  6942. IFS="$lt_save_ifs"
  6943. ;;
  6944. esac],
  6945. [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
  6946. ])# AC_ENABLE_SHARED
  6947. # AC_DISABLE_SHARED
  6948. # -----------------
  6949. # set the default shared flag to --disable-shared
  6950. AC_DEFUN([AC_DISABLE_SHARED],
  6951. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6952. AC_ENABLE_SHARED(no)
  6953. ])# AC_DISABLE_SHARED
  6954. # AC_ENABLE_STATIC([DEFAULT])
  6955. # ---------------------------
  6956. # implement the --enable-static flag
  6957. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6958. AC_DEFUN([AC_ENABLE_STATIC],
  6959. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  6960. AC_ARG_ENABLE([static],
  6961. [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
  6962. [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
  6963. [p=${PACKAGE-default}
  6964. case $enableval in
  6965. yes) enable_static=yes ;;
  6966. no) enable_static=no ;;
  6967. *)
  6968. enable_static=no
  6969. # Look at the argument we got. We use all the common list separators.
  6970. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6971. for pkg in $enableval; do
  6972. IFS="$lt_save_ifs"
  6973. if test "X$pkg" = "X$p"; then
  6974. enable_static=yes
  6975. fi
  6976. done
  6977. IFS="$lt_save_ifs"
  6978. ;;
  6979. esac],
  6980. [enable_static=]AC_ENABLE_STATIC_DEFAULT)
  6981. ])# AC_ENABLE_STATIC
  6982. # AC_DISABLE_STATIC
  6983. # -----------------
  6984. # set the default static flag to --disable-static
  6985. AC_DEFUN([AC_DISABLE_STATIC],
  6986. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6987. AC_ENABLE_STATIC(no)
  6988. ])# AC_DISABLE_STATIC
  6989. # AC_ENABLE_FAST_INSTALL([DEFAULT])
  6990. # ---------------------------------
  6991. # implement the --enable-fast-install flag
  6992. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6993. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  6994. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  6995. AC_ARG_ENABLE([fast-install],
  6996. [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
  6997. [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
  6998. [p=${PACKAGE-default}
  6999. case $enableval in
  7000. yes) enable_fast_install=yes ;;
  7001. no) enable_fast_install=no ;;
  7002. *)
  7003. enable_fast_install=no
  7004. # Look at the argument we got. We use all the common list separators.
  7005. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  7006. for pkg in $enableval; do
  7007. IFS="$lt_save_ifs"
  7008. if test "X$pkg" = "X$p"; then
  7009. enable_fast_install=yes
  7010. fi
  7011. done
  7012. IFS="$lt_save_ifs"
  7013. ;;
  7014. esac],
  7015. [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
  7016. ])# AC_ENABLE_FAST_INSTALL
  7017. # AC_DISABLE_FAST_INSTALL
  7018. # -----------------------
  7019. # set the default to --disable-fast-install
  7020. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  7021. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7022. AC_ENABLE_FAST_INSTALL(no)
  7023. ])# AC_DISABLE_FAST_INSTALL
  7024. # AC_LIBTOOL_PICMODE([MODE])
  7025. # --------------------------
  7026. # implement the --with-pic flag
  7027. # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
  7028. AC_DEFUN([AC_LIBTOOL_PICMODE],
  7029. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7030. pic_mode=ifelse($#,1,$1,default)
  7031. ])# AC_LIBTOOL_PICMODE
  7032. # AC_PROG_EGREP
  7033. # -------------
  7034. # This is predefined starting with Autoconf 2.54, so this conditional
  7035. # definition can be removed once we require Autoconf 2.54 or later.
  7036. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
  7037. [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
  7038. [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
  7039. then ac_cv_prog_egrep='grep -E'
  7040. else ac_cv_prog_egrep='egrep'
  7041. fi])
  7042. EGREP=$ac_cv_prog_egrep
  7043. AC_SUBST([EGREP])
  7044. ])])
  7045. # AC_PATH_TOOL_PREFIX
  7046. # -------------------
  7047. # find a file program which can recognise shared library
  7048. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  7049. [AC_REQUIRE([AC_PROG_EGREP])dnl
  7050. AC_MSG_CHECKING([for $1])
  7051. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  7052. [case $MAGIC_CMD in
  7053. [[\\/*] | ?:[\\/]*])
  7054. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  7055. ;;
  7056. *)
  7057. lt_save_MAGIC_CMD="$MAGIC_CMD"
  7058. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7059. dnl $ac_dummy forces splitting on constant user-supplied paths.
  7060. dnl POSIX.2 word splitting is done only on the output of word expansions,
  7061. dnl not every word. This closes a longstanding sh security hole.
  7062. ac_dummy="ifelse([$2], , $PATH, [$2])"
  7063. for ac_dir in $ac_dummy; do
  7064. IFS="$lt_save_ifs"
  7065. test -z "$ac_dir" && ac_dir=.
  7066. if test -f $ac_dir/$1; then
  7067. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  7068. if test -n "$file_magic_test_file"; then
  7069. case $deplibs_check_method in
  7070. "file_magic "*)
  7071. file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
  7072. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  7073. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  7074. $EGREP "$file_magic_regex" > /dev/null; then
  7075. :
  7076. else
  7077. cat <<EOF 1>&2
  7078. *** Warning: the command libtool uses to detect shared libraries,
  7079. *** $file_magic_cmd, produces output that libtool cannot recognize.
  7080. *** The result is that libtool may fail to recognize shared libraries
  7081. *** as such. This will affect the creation of libtool libraries that
  7082. *** depend on shared libraries, but programs linked with such libtool
  7083. *** libraries will work regardless of this problem. Nevertheless, you
  7084. *** may want to report the problem to your system manager and/or to
  7085. *** bug-libtool@gnu.org
  7086. EOF
  7087. fi ;;
  7088. esac
  7089. fi
  7090. break
  7091. fi
  7092. done
  7093. IFS="$lt_save_ifs"
  7094. MAGIC_CMD="$lt_save_MAGIC_CMD"
  7095. ;;
  7096. esac])
  7097. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  7098. if test -n "$MAGIC_CMD"; then
  7099. AC_MSG_RESULT($MAGIC_CMD)
  7100. else
  7101. AC_MSG_RESULT(no)
  7102. fi
  7103. ])# AC_PATH_TOOL_PREFIX
  7104. # AC_PATH_MAGIC
  7105. # -------------
  7106. # find a file program which can recognise a shared library
  7107. AC_DEFUN([AC_PATH_MAGIC],
  7108. [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
  7109. if test -z "$lt_cv_path_MAGIC_CMD"; then
  7110. if test -n "$ac_tool_prefix"; then
  7111. AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
  7112. else
  7113. MAGIC_CMD=:
  7114. fi
  7115. fi
  7116. ])# AC_PATH_MAGIC
  7117. # AC_PROG_LD
  7118. # ----------
  7119. # find the pathname to the GNU or non-GNU linker
  7120. AC_DEFUN([AC_PROG_LD],
  7121. [AC_ARG_WITH([gnu-ld],
  7122. [AC_HELP_STRING([--with-gnu-ld],
  7123. [assume the C compiler uses GNU ld @<:@default=no@:>@])],
  7124. [test "$withval" = no || with_gnu_ld=yes],
  7125. [with_gnu_ld=no])
  7126. AC_REQUIRE([LT_AC_PROG_SED])dnl
  7127. AC_REQUIRE([AC_PROG_CC])dnl
  7128. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7129. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  7130. ac_prog=ld
  7131. if test "$GCC" = yes; then
  7132. # Check if gcc -print-prog-name=ld gives a path.
  7133. AC_MSG_CHECKING([for ld used by $CC])
  7134. case $host in
  7135. *-*-mingw*)
  7136. # gcc leaves a trailing carriage return which upsets mingw
  7137. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  7138. *)
  7139. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  7140. esac
  7141. case $ac_prog in
  7142. # Accept absolute paths.
  7143. [[\\/]]* | ?:[[\\/]]*)
  7144. re_direlt='/[[^/]][[^/]]*/\.\./'
  7145. # Canonicalize the pathname of ld
  7146. ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
  7147. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  7148. ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
  7149. done
  7150. test -z "$LD" && LD="$ac_prog"
  7151. ;;
  7152. "")
  7153. # If it fails, then pretend we aren't using GCC.
  7154. ac_prog=ld
  7155. ;;
  7156. *)
  7157. # If it is relative, then search for the first ld in PATH.
  7158. with_gnu_ld=unknown
  7159. ;;
  7160. esac
  7161. elif test "$with_gnu_ld" = yes; then
  7162. AC_MSG_CHECKING([for GNU ld])
  7163. else
  7164. AC_MSG_CHECKING([for non-GNU ld])
  7165. fi
  7166. AC_CACHE_VAL(lt_cv_path_LD,
  7167. [if test -z "$LD"; then
  7168. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7169. for ac_dir in $PATH; do
  7170. IFS="$lt_save_ifs"
  7171. test -z "$ac_dir" && ac_dir=.
  7172. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  7173. lt_cv_path_LD="$ac_dir/$ac_prog"
  7174. # Check to see if the program is GNU ld. I'd rather use --version,
  7175. # but apparently some variants of GNU ld only accept -v.
  7176. # Break only if it was the GNU/non-GNU ld that we prefer.
  7177. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
  7178. *GNU* | *'with BFD'*)
  7179. test "$with_gnu_ld" != no && break
  7180. ;;
  7181. *)
  7182. test "$with_gnu_ld" != yes && break
  7183. ;;
  7184. esac
  7185. fi
  7186. done
  7187. IFS="$lt_save_ifs"
  7188. else
  7189. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  7190. fi])
  7191. LD="$lt_cv_path_LD"
  7192. if test -n "$LD"; then
  7193. AC_MSG_RESULT($LD)
  7194. else
  7195. AC_MSG_RESULT(no)
  7196. fi
  7197. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  7198. AC_PROG_LD_GNU
  7199. ])# AC_PROG_LD
  7200. # AC_PROG_LD_GNU
  7201. # --------------
  7202. AC_DEFUN([AC_PROG_LD_GNU],
  7203. [AC_REQUIRE([AC_PROG_EGREP])dnl
  7204. AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  7205. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
  7206. case `$LD -v 2>&1 </dev/null` in
  7207. *GNU* | *'with BFD'*)
  7208. lt_cv_prog_gnu_ld=yes
  7209. ;;
  7210. *)
  7211. lt_cv_prog_gnu_ld=no
  7212. ;;
  7213. esac])
  7214. with_gnu_ld=$lt_cv_prog_gnu_ld
  7215. ])# AC_PROG_LD_GNU
  7216. # AC_PROG_LD_RELOAD_FLAG
  7217. # ----------------------
  7218. # find reload flag for linker
  7219. # -- PORTME Some linkers may need a different reload flag.
  7220. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  7221. [AC_CACHE_CHECK([for $LD option to reload object files],
  7222. lt_cv_ld_reload_flag,
  7223. [lt_cv_ld_reload_flag='-r'])
  7224. reload_flag=$lt_cv_ld_reload_flag
  7225. case $reload_flag in
  7226. "" | " "*) ;;
  7227. *) reload_flag=" $reload_flag" ;;
  7228. esac
  7229. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  7230. case $host_os in
  7231. darwin*)
  7232. if test "$GCC" = yes; then
  7233. reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
  7234. else
  7235. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  7236. fi
  7237. ;;
  7238. esac
  7239. ])# AC_PROG_LD_RELOAD_FLAG
  7240. # AC_DEPLIBS_CHECK_METHOD
  7241. # -----------------------
  7242. # how to check for library dependencies
  7243. # -- PORTME fill in with the dynamic library characteristics
  7244. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  7245. [AC_CACHE_CHECK([how to recognise dependent libraries],
  7246. lt_cv_deplibs_check_method,
  7247. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  7248. lt_cv_file_magic_test_file=
  7249. lt_cv_deplibs_check_method='unknown'
  7250. # Need to set the preceding variable on all platforms that support
  7251. # interlibrary dependencies.
  7252. # 'none' -- dependencies not supported.
  7253. # `unknown' -- same as none, but documents that we really don't know.
  7254. # 'pass_all' -- all dependencies passed with no checks.
  7255. # 'test_compile' -- check by making test program.
  7256. # 'file_magic [[regex]]' -- check by looking for files in library path
  7257. # which responds to the $file_magic_cmd with a given extended regex.
  7258. # If you have `file' or equivalent on your system and you're not sure
  7259. # whether `pass_all' will *always* work, you probably want this one.
  7260. case $host_os in
  7261. aix4* | aix5*)
  7262. lt_cv_deplibs_check_method=pass_all
  7263. ;;
  7264. beos*)
  7265. lt_cv_deplibs_check_method=pass_all
  7266. ;;
  7267. bsdi[[45]]*)
  7268. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
  7269. lt_cv_file_magic_cmd='/usr/bin/file -L'
  7270. lt_cv_file_magic_test_file=/shlib/libc.so
  7271. ;;
  7272. cygwin*)
  7273. # func_win32_libid is a shell function defined in ltmain.sh
  7274. lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
  7275. lt_cv_file_magic_cmd='func_win32_libid'
  7276. ;;
  7277. mingw* | pw32*)
  7278. # Base MSYS/MinGW do not provide the 'file' command needed by
  7279. # func_win32_libid shell function, so use a weaker test based on 'objdump'.
  7280. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  7281. lt_cv_file_magic_cmd='$OBJDUMP -f'
  7282. ;;
  7283. darwin* | rhapsody*)
  7284. lt_cv_deplibs_check_method=pass_all
  7285. ;;
  7286. freebsd* | dragonfly*)
  7287. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  7288. case $host_cpu in
  7289. i*86 )
  7290. # Not sure whether the presence of OpenBSD here was a mistake.
  7291. # Let's accept both of them until this is cleared up.
  7292. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
  7293. lt_cv_file_magic_cmd=/usr/bin/file
  7294. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  7295. ;;
  7296. esac
  7297. else
  7298. lt_cv_deplibs_check_method=pass_all
  7299. fi
  7300. ;;
  7301. gnu*)
  7302. lt_cv_deplibs_check_method=pass_all
  7303. ;;
  7304. hpux10.20* | hpux11*)
  7305. lt_cv_file_magic_cmd=/usr/bin/file
  7306. case $host_cpu in
  7307. ia64*)
  7308. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
  7309. lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  7310. ;;
  7311. hppa*64*)
  7312. [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
  7313. lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
  7314. ;;
  7315. *)
  7316. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
  7317. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  7318. ;;
  7319. esac
  7320. ;;
  7321. interix3*)
  7322. # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
  7323. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
  7324. ;;
  7325. irix5* | irix6* | nonstopux*)
  7326. case $LD in
  7327. *-32|*"-32 ") libmagic=32-bit;;
  7328. *-n32|*"-n32 ") libmagic=N32;;
  7329. *-64|*"-64 ") libmagic=64-bit;;
  7330. *) libmagic=never-match;;
  7331. esac
  7332. lt_cv_deplibs_check_method=pass_all
  7333. ;;
  7334. # This must be Linux ELF.
  7335. linux* | k*bsd*-gnu)
  7336. lt_cv_deplibs_check_method=pass_all
  7337. ;;
  7338. netbsd* | netbsdelf*-gnu)
  7339. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  7340. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  7341. else
  7342. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
  7343. fi
  7344. ;;
  7345. newos6*)
  7346. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  7347. lt_cv_file_magic_cmd=/usr/bin/file
  7348. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  7349. ;;
  7350. nto-qnx*)
  7351. lt_cv_deplibs_check_method=unknown
  7352. ;;
  7353. openbsd*)
  7354. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  7355. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
  7356. else
  7357. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  7358. fi
  7359. ;;
  7360. osf3* | osf4* | osf5*)
  7361. lt_cv_deplibs_check_method=pass_all
  7362. ;;
  7363. solaris*)
  7364. lt_cv_deplibs_check_method=pass_all
  7365. ;;
  7366. sysv4 | sysv4.3*)
  7367. case $host_vendor in
  7368. motorola)
  7369. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
  7370. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  7371. ;;
  7372. ncr)
  7373. lt_cv_deplibs_check_method=pass_all
  7374. ;;
  7375. sequent)
  7376. lt_cv_file_magic_cmd='/bin/file'
  7377. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
  7378. ;;
  7379. sni)
  7380. lt_cv_file_magic_cmd='/bin/file'
  7381. lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
  7382. lt_cv_file_magic_test_file=/lib/libc.so
  7383. ;;
  7384. siemens)
  7385. lt_cv_deplibs_check_method=pass_all
  7386. ;;
  7387. pc)
  7388. lt_cv_deplibs_check_method=pass_all
  7389. ;;
  7390. esac
  7391. ;;
  7392. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  7393. lt_cv_deplibs_check_method=pass_all
  7394. ;;
  7395. esac
  7396. ])
  7397. file_magic_cmd=$lt_cv_file_magic_cmd
  7398. deplibs_check_method=$lt_cv_deplibs_check_method
  7399. test -z "$deplibs_check_method" && deplibs_check_method=unknown
  7400. ])# AC_DEPLIBS_CHECK_METHOD
  7401. # AC_PROG_NM
  7402. # ----------
  7403. # find the pathname to a BSD-compatible name lister
  7404. AC_DEFUN([AC_PROG_NM],
  7405. [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
  7406. [if test -n "$NM"; then
  7407. # Let the user override the test.
  7408. lt_cv_path_NM="$NM"
  7409. else
  7410. lt_nm_to_check="${ac_tool_prefix}nm"
  7411. if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
  7412. lt_nm_to_check="$lt_nm_to_check nm"
  7413. fi
  7414. for lt_tmp_nm in $lt_nm_to_check; do
  7415. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7416. for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
  7417. IFS="$lt_save_ifs"
  7418. test -z "$ac_dir" && ac_dir=.
  7419. tmp_nm="$ac_dir/$lt_tmp_nm"
  7420. if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
  7421. # Check to see if the nm accepts a BSD-compat flag.
  7422. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  7423. # nm: unknown option "B" ignored
  7424. # Tru64's nm complains that /dev/null is an invalid object file
  7425. case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
  7426. */dev/null* | *'Invalid file or object type'*)
  7427. lt_cv_path_NM="$tmp_nm -B"
  7428. break
  7429. ;;
  7430. *)
  7431. case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
  7432. */dev/null*)
  7433. lt_cv_path_NM="$tmp_nm -p"
  7434. break
  7435. ;;
  7436. *)
  7437. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  7438. continue # so that we can try to find one that supports BSD flags
  7439. ;;
  7440. esac
  7441. ;;
  7442. esac
  7443. fi
  7444. done
  7445. IFS="$lt_save_ifs"
  7446. done
  7447. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  7448. fi])
  7449. NM="$lt_cv_path_NM"
  7450. ])# AC_PROG_NM
  7451. # AC_CHECK_LIBM
  7452. # -------------
  7453. # check for math library
  7454. AC_DEFUN([AC_CHECK_LIBM],
  7455. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7456. LIBM=
  7457. case $host in
  7458. *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
  7459. # These system don't have libm, or don't need it
  7460. ;;
  7461. *-ncr-sysv4.3*)
  7462. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  7463. AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
  7464. ;;
  7465. *)
  7466. AC_CHECK_LIB(m, cos, LIBM="-lm")
  7467. ;;
  7468. esac
  7469. ])# AC_CHECK_LIBM
  7470. # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
  7471. # -----------------------------------
  7472. # sets LIBLTDL to the link flags for the libltdl convenience library and
  7473. # LTDLINCL to the include flags for the libltdl header and adds
  7474. # --enable-ltdl-convenience to the configure arguments. Note that
  7475. # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
  7476. # it is assumed to be `libltdl'. LIBLTDL will be prefixed with
  7477. # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
  7478. # (note the single quotes!). If your package is not flat and you're not
  7479. # using automake, define top_builddir and top_srcdir appropriately in
  7480. # the Makefiles.
  7481. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  7482. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7483. case $enable_ltdl_convenience in
  7484. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  7485. "") enable_ltdl_convenience=yes
  7486. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  7487. esac
  7488. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  7489. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  7490. # For backwards non-gettext consistent compatibility...
  7491. INCLTDL="$LTDLINCL"
  7492. ])# AC_LIBLTDL_CONVENIENCE
  7493. # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
  7494. # -----------------------------------
  7495. # sets LIBLTDL to the link flags for the libltdl installable library and
  7496. # LTDLINCL to the include flags for the libltdl header and adds
  7497. # --enable-ltdl-install to the configure arguments. Note that
  7498. # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
  7499. # and an installed libltdl is not found, it is assumed to be `libltdl'.
  7500. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
  7501. # '${top_srcdir}/' (note the single quotes!). If your package is not
  7502. # flat and you're not using automake, define top_builddir and top_srcdir
  7503. # appropriately in the Makefiles.
  7504. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  7505. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  7506. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7507. AC_CHECK_LIB(ltdl, lt_dlinit,
  7508. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  7509. [if test x"$enable_ltdl_install" = xno; then
  7510. AC_MSG_WARN([libltdl not installed, but installation disabled])
  7511. else
  7512. enable_ltdl_install=yes
  7513. fi
  7514. ])
  7515. if test x"$enable_ltdl_install" = x"yes"; then
  7516. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  7517. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  7518. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  7519. else
  7520. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  7521. LIBLTDL="-lltdl"
  7522. LTDLINCL=
  7523. fi
  7524. # For backwards non-gettext consistent compatibility...
  7525. INCLTDL="$LTDLINCL"
  7526. ])# AC_LIBLTDL_INSTALLABLE
  7527. # AC_LIBTOOL_CXX
  7528. # --------------
  7529. # enable support for C++ libraries
  7530. AC_DEFUN([AC_LIBTOOL_CXX],
  7531. [AC_REQUIRE([_LT_AC_LANG_CXX])
  7532. ])# AC_LIBTOOL_CXX
  7533. # _LT_AC_LANG_CXX
  7534. # ---------------
  7535. AC_DEFUN([_LT_AC_LANG_CXX],
  7536. [AC_REQUIRE([AC_PROG_CXX])
  7537. AC_REQUIRE([_LT_AC_PROG_CXXCPP])
  7538. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
  7539. ])# _LT_AC_LANG_CXX
  7540. # _LT_AC_PROG_CXXCPP
  7541. # ------------------
  7542. AC_DEFUN([_LT_AC_PROG_CXXCPP],
  7543. [
  7544. AC_REQUIRE([AC_PROG_CXX])
  7545. if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  7546. ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  7547. (test "X$CXX" != "Xg++"))) ; then
  7548. AC_PROG_CXXCPP
  7549. fi
  7550. ])# _LT_AC_PROG_CXXCPP
  7551. # AC_LIBTOOL_F77
  7552. # --------------
  7553. # enable support for Fortran 77 libraries
  7554. AC_DEFUN([AC_LIBTOOL_F77],
  7555. [AC_REQUIRE([_LT_AC_LANG_F77])
  7556. ])# AC_LIBTOOL_F77
  7557. # _LT_AC_LANG_F77
  7558. # ---------------
  7559. AC_DEFUN([_LT_AC_LANG_F77],
  7560. [AC_REQUIRE([AC_PROG_F77])
  7561. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
  7562. ])# _LT_AC_LANG_F77
  7563. # AC_LIBTOOL_GCJ
  7564. # --------------
  7565. # enable support for GCJ libraries
  7566. AC_DEFUN([AC_LIBTOOL_GCJ],
  7567. [AC_REQUIRE([_LT_AC_LANG_GCJ])
  7568. ])# AC_LIBTOOL_GCJ
  7569. # _LT_AC_LANG_GCJ
  7570. # ---------------
  7571. AC_DEFUN([_LT_AC_LANG_GCJ],
  7572. [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
  7573. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
  7574. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
  7575. [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
  7576. [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
  7577. [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
  7578. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
  7579. ])# _LT_AC_LANG_GCJ
  7580. # AC_LIBTOOL_RC
  7581. # -------------
  7582. # enable support for Windows resource files
  7583. AC_DEFUN([AC_LIBTOOL_RC],
  7584. [AC_REQUIRE([LT_AC_PROG_RC])
  7585. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
  7586. ])# AC_LIBTOOL_RC
  7587. # AC_LIBTOOL_LANG_C_CONFIG
  7588. # ------------------------
  7589. # Ensure that the configuration vars for the C compiler are
  7590. # suitably defined. Those variables are subsequently used by
  7591. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7592. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
  7593. AC_DEFUN([_LT_AC_LANG_C_CONFIG],
  7594. [lt_save_CC="$CC"
  7595. AC_LANG_PUSH(C)
  7596. # Source file extension for C test sources.
  7597. ac_ext=c
  7598. # Object file extension for compiled C test sources.
  7599. objext=o
  7600. _LT_AC_TAGVAR(objext, $1)=$objext
  7601. # Code to be used in simple compile tests
  7602. lt_simple_compile_test_code="int some_variable = 0;\n"
  7603. # Code to be used in simple link tests
  7604. lt_simple_link_test_code='int main(){return(0);}\n'
  7605. _LT_AC_SYS_COMPILER
  7606. # save warnings/boilerplate of simple test code
  7607. _LT_COMPILER_BOILERPLATE
  7608. _LT_LINKER_BOILERPLATE
  7609. ## CAVEAT EMPTOR:
  7610. ## There is no encapsulation within the following macros, do not change
  7611. ## the running order or otherwise move them around unless you know exactly
  7612. ## what you are doing...
  7613. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  7614. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  7615. AC_LIBTOOL_PROG_CC_C_O($1)
  7616. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  7617. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  7618. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  7619. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  7620. AC_LIBTOOL_SYS_LIB_STRIP
  7621. AC_LIBTOOL_DLOPEN_SELF
  7622. # Report which library types will actually be built
  7623. AC_MSG_CHECKING([if libtool supports shared libraries])
  7624. AC_MSG_RESULT([$can_build_shared])
  7625. AC_MSG_CHECKING([whether to build shared libraries])
  7626. test "$can_build_shared" = "no" && enable_shared=no
  7627. # On AIX, shared libraries and static libraries use the same namespace, and
  7628. # are all built from PIC.
  7629. case $host_os in
  7630. aix3*)
  7631. test "$enable_shared" = yes && enable_static=no
  7632. if test -n "$RANLIB"; then
  7633. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  7634. postinstall_cmds='$RANLIB $lib'
  7635. fi
  7636. ;;
  7637. aix4* | aix5*)
  7638. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  7639. test "$enable_shared" = yes && enable_static=no
  7640. fi
  7641. ;;
  7642. esac
  7643. AC_MSG_RESULT([$enable_shared])
  7644. AC_MSG_CHECKING([whether to build static libraries])
  7645. # Make sure either enable_shared or enable_static is yes.
  7646. test "$enable_shared" = yes || enable_static=yes
  7647. AC_MSG_RESULT([$enable_static])
  7648. AC_LIBTOOL_CONFIG($1)
  7649. AC_LANG_POP
  7650. CC="$lt_save_CC"
  7651. ])# AC_LIBTOOL_LANG_C_CONFIG
  7652. # AC_LIBTOOL_LANG_CXX_CONFIG
  7653. # --------------------------
  7654. # Ensure that the configuration vars for the C compiler are
  7655. # suitably defined. Those variables are subsequently used by
  7656. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7657. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
  7658. AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
  7659. [AC_LANG_PUSH(C++)
  7660. AC_REQUIRE([AC_PROG_CXX])
  7661. AC_REQUIRE([_LT_AC_PROG_CXXCPP])
  7662. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7663. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  7664. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  7665. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  7666. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  7667. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  7668. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  7669. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  7670. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  7671. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  7672. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  7673. _LT_AC_TAGVAR(hardcode_automatic, $1)=no
  7674. _LT_AC_TAGVAR(module_cmds, $1)=
  7675. _LT_AC_TAGVAR(module_expsym_cmds, $1)=
  7676. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  7677. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  7678. _LT_AC_TAGVAR(no_undefined_flag, $1)=
  7679. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  7680. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  7681. # Dependencies to place before and after the object being linked:
  7682. _LT_AC_TAGVAR(predep_objects, $1)=
  7683. _LT_AC_TAGVAR(postdep_objects, $1)=
  7684. _LT_AC_TAGVAR(predeps, $1)=
  7685. _LT_AC_TAGVAR(postdeps, $1)=
  7686. _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
  7687. # Source file extension for C++ test sources.
  7688. ac_ext=cpp
  7689. # Object file extension for compiled C++ test sources.
  7690. objext=o
  7691. _LT_AC_TAGVAR(objext, $1)=$objext
  7692. # Code to be used in simple compile tests
  7693. lt_simple_compile_test_code="int some_variable = 0;\n"
  7694. # Code to be used in simple link tests
  7695. lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
  7696. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7697. _LT_AC_SYS_COMPILER
  7698. # save warnings/boilerplate of simple test code
  7699. _LT_COMPILER_BOILERPLATE
  7700. _LT_LINKER_BOILERPLATE
  7701. # Allow CC to be a program name with arguments.
  7702. lt_save_CC=$CC
  7703. lt_save_LD=$LD
  7704. lt_save_GCC=$GCC
  7705. GCC=$GXX
  7706. lt_save_with_gnu_ld=$with_gnu_ld
  7707. lt_save_path_LD=$lt_cv_path_LD
  7708. if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
  7709. lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
  7710. else
  7711. $as_unset lt_cv_prog_gnu_ld
  7712. fi
  7713. if test -n "${lt_cv_path_LDCXX+set}"; then
  7714. lt_cv_path_LD=$lt_cv_path_LDCXX
  7715. else
  7716. $as_unset lt_cv_path_LD
  7717. fi
  7718. test -z "${LDCXX+set}" || LD=$LDCXX
  7719. CC=${CXX-"c++"}
  7720. compiler=$CC
  7721. _LT_AC_TAGVAR(compiler, $1)=$CC
  7722. _LT_CC_BASENAME([$compiler])
  7723. # We don't want -fno-exception wen compiling C++ code, so set the
  7724. # no_builtin_flag separately
  7725. if test "$GXX" = yes; then
  7726. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  7727. else
  7728. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  7729. fi
  7730. if test "$GXX" = yes; then
  7731. # Set up default GNU C++ configuration
  7732. AC_PROG_LD
  7733. # Check if GNU C++ uses GNU ld as the underlying linker, since the
  7734. # archiving commands below assume that GNU ld is being used.
  7735. if test "$with_gnu_ld" = yes; then
  7736. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  7737. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  7738. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  7739. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  7740. # If archive_cmds runs LD, not CC, wlarc should be empty
  7741. # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  7742. # investigate it a little bit more. (MM)
  7743. wlarc='${wl}'
  7744. # ancient GNU ld didn't support --whole-archive et. al.
  7745. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
  7746. grep 'no-whole-archive' > /dev/null; then
  7747. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  7748. else
  7749. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  7750. fi
  7751. else
  7752. with_gnu_ld=no
  7753. wlarc=
  7754. # A generic and very simple default shared library creation
  7755. # command for GNU C++ for the case where it uses the native
  7756. # linker, instead of GNU ld. If possible, this setting should
  7757. # overridden to take advantage of the native linker features on
  7758. # the platform it is being used on.
  7759. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  7760. fi
  7761. # Commands to make compiler produce verbose output that lists
  7762. # what "hidden" libraries, object files and flags are used when
  7763. # linking a shared library.
  7764. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  7765. else
  7766. GXX=no
  7767. with_gnu_ld=no
  7768. wlarc=
  7769. fi
  7770. # PORTME: fill in a description of your system's C++ link characteristics
  7771. AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  7772. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  7773. case $host_os in
  7774. aix3*)
  7775. # FIXME: insert proper C++ library support
  7776. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7777. ;;
  7778. aix4* | aix5*)
  7779. if test "$host_cpu" = ia64; then
  7780. # On IA64, the linker does run time linking by default, so we don't
  7781. # have to do anything special.
  7782. aix_use_runtimelinking=no
  7783. exp_sym_flag='-Bexport'
  7784. no_entry_flag=""
  7785. else
  7786. aix_use_runtimelinking=no
  7787. # Test if we are trying to use run time linking or normal
  7788. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  7789. # need to do runtime linking.
  7790. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
  7791. for ld_flag in $LDFLAGS; do
  7792. case $ld_flag in
  7793. *-brtl*)
  7794. aix_use_runtimelinking=yes
  7795. break
  7796. ;;
  7797. esac
  7798. done
  7799. ;;
  7800. esac
  7801. exp_sym_flag='-bexport'
  7802. no_entry_flag='-bnoentry'
  7803. fi
  7804. # When large executables or shared objects are built, AIX ld can
  7805. # have problems creating the table of contents. If linking a library
  7806. # or program results in "error TOC overflow" add -mminimal-toc to
  7807. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  7808. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  7809. _LT_AC_TAGVAR(archive_cmds, $1)=''
  7810. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  7811. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  7812. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7813. if test "$GXX" = yes; then
  7814. case $host_os in aix4.[[012]]|aix4.[[012]].*)
  7815. # We only want to do this on AIX 4.2 and lower, the check
  7816. # below for broken collect2 doesn't work under 4.3+
  7817. collect2name=`${CC} -print-prog-name=collect2`
  7818. if test -f "$collect2name" && \
  7819. strings "$collect2name" | grep resolve_lib_name >/dev/null
  7820. then
  7821. # We have reworked collect2
  7822. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  7823. else
  7824. # We have old collect2
  7825. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  7826. # It fails to find uninstalled libraries when the uninstalled
  7827. # path is not listed in the libpath. Setting hardcode_minus_L
  7828. # to unsupported forces relinking
  7829. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  7830. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  7831. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  7832. fi
  7833. ;;
  7834. esac
  7835. shared_flag='-shared'
  7836. if test "$aix_use_runtimelinking" = yes; then
  7837. shared_flag="$shared_flag "'${wl}-G'
  7838. fi
  7839. else
  7840. # not using gcc
  7841. if test "$host_cpu" = ia64; then
  7842. # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  7843. # chokes on -Wl,-G. The following line is correct:
  7844. shared_flag='-G'
  7845. else
  7846. if test "$aix_use_runtimelinking" = yes; then
  7847. shared_flag='${wl}-G'
  7848. else
  7849. shared_flag='${wl}-bM:SRE'
  7850. fi
  7851. fi
  7852. fi
  7853. # It seems that -bexpall does not export symbols beginning with
  7854. # underscore (_), so it is better to generate a list of symbols to export.
  7855. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  7856. if test "$aix_use_runtimelinking" = yes; then
  7857. # Warning - without using the other runtime loading flags (-brtl),
  7858. # -berok will link without error, but may produce a broken library.
  7859. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
  7860. # Determine the default libpath from the value encoded in an empty executable.
  7861. _LT_AC_SYS_LIBPATH_AIX
  7862. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  7863. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  7864. else
  7865. if test "$host_cpu" = ia64; then
  7866. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  7867. _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  7868. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  7869. else
  7870. # Determine the default libpath from the value encoded in an empty executable.
  7871. _LT_AC_SYS_LIBPATH_AIX
  7872. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  7873. # Warning - without using the other run time loading flags,
  7874. # -berok will link without error, but may produce a broken library.
  7875. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  7876. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  7877. # Exported symbols can be pulled into shared objects from archives
  7878. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  7879. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  7880. # This is similar to how AIX traditionally builds its shared libraries.
  7881. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  7882. fi
  7883. fi
  7884. ;;
  7885. beos*)
  7886. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  7887. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  7888. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  7889. # support --undefined. This deserves some investigation. FIXME
  7890. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  7891. else
  7892. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7893. fi
  7894. ;;
  7895. chorus*)
  7896. case $cc_basename in
  7897. *)
  7898. # FIXME: insert proper C++ library support
  7899. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7900. ;;
  7901. esac
  7902. ;;
  7903. cygwin* | mingw* | pw32*)
  7904. # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  7905. # as there is no search path for DLLs.
  7906. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  7907. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  7908. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  7909. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  7910. if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  7911. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  7912. # If the export-symbols file already is a .def file (1st line
  7913. # is EXPORTS), use it as is; otherwise, prepend...
  7914. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  7915. cp $export_symbols $output_objdir/$soname.def;
  7916. else
  7917. echo EXPORTS > $output_objdir/$soname.def;
  7918. cat $export_symbols >> $output_objdir/$soname.def;
  7919. fi~
  7920. $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  7921. else
  7922. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7923. fi
  7924. ;;
  7925. darwin* | rhapsody*)
  7926. case $host_os in
  7927. rhapsody* | darwin1.[[012]])
  7928. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
  7929. ;;
  7930. *) # Darwin 1.3 on
  7931. if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
  7932. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  7933. else
  7934. case ${MACOSX_DEPLOYMENT_TARGET} in
  7935. 10.[[012]])
  7936. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  7937. ;;
  7938. 10.*)
  7939. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
  7940. ;;
  7941. esac
  7942. fi
  7943. ;;
  7944. esac
  7945. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7946. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  7947. _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
  7948. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  7949. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
  7950. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7951. if test "$GXX" = yes ; then
  7952. lt_int_apple_cc_single_mod=no
  7953. output_verbose_link_cmd='echo'
  7954. if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
  7955. lt_int_apple_cc_single_mod=yes
  7956. fi
  7957. if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  7958. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  7959. else
  7960. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  7961. fi
  7962. _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  7963. # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
  7964. if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  7965. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7966. else
  7967. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7968. fi
  7969. _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7970. else
  7971. case $cc_basename in
  7972. xlc*)
  7973. output_verbose_link_cmd='echo'
  7974. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
  7975. _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  7976. # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
  7977. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7978. _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7979. ;;
  7980. *)
  7981. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7982. ;;
  7983. esac
  7984. fi
  7985. ;;
  7986. dgux*)
  7987. case $cc_basename in
  7988. ec++*)
  7989. # FIXME: insert proper C++ library support
  7990. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7991. ;;
  7992. ghcx*)
  7993. # Green Hills C++ Compiler
  7994. # FIXME: insert proper C++ library support
  7995. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7996. ;;
  7997. *)
  7998. # FIXME: insert proper C++ library support
  7999. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8000. ;;
  8001. esac
  8002. ;;
  8003. freebsd[[12]]*)
  8004. # C++ shared libraries reported to be fairly broken before switch to ELF
  8005. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8006. ;;
  8007. freebsd-elf*)
  8008. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8009. ;;
  8010. freebsd* | dragonfly*)
  8011. # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  8012. # conventions
  8013. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  8014. ;;
  8015. gnu*)
  8016. ;;
  8017. hpux9*)
  8018. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  8019. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8020. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8021. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8022. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  8023. # but as the default
  8024. # location of the library.
  8025. case $cc_basename in
  8026. CC*)
  8027. # FIXME: insert proper C++ library support
  8028. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8029. ;;
  8030. aCC*)
  8031. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8032. # Commands to make compiler produce verbose output that lists
  8033. # what "hidden" libraries, object files and flags are used when
  8034. # linking a shared library.
  8035. #
  8036. # There doesn't appear to be a way to prevent this compiler from
  8037. # explicitly linking system object files so we need to strip them
  8038. # from the output so that they don't get included in the library
  8039. # dependencies.
  8040. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8041. ;;
  8042. *)
  8043. if test "$GXX" = yes; then
  8044. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8045. else
  8046. # FIXME: insert proper C++ library support
  8047. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8048. fi
  8049. ;;
  8050. esac
  8051. ;;
  8052. hpux10*|hpux11*)
  8053. if test $with_gnu_ld = no; then
  8054. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  8055. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8056. case $host_cpu in
  8057. hppa*64*|ia64*)
  8058. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
  8059. ;;
  8060. *)
  8061. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8062. ;;
  8063. esac
  8064. fi
  8065. case $host_cpu in
  8066. hppa*64*|ia64*)
  8067. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8068. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8069. ;;
  8070. *)
  8071. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8072. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  8073. # but as the default
  8074. # location of the library.
  8075. ;;
  8076. esac
  8077. case $cc_basename in
  8078. CC*)
  8079. # FIXME: insert proper C++ library support
  8080. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8081. ;;
  8082. aCC*)
  8083. case $host_cpu in
  8084. hppa*64*)
  8085. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8086. ;;
  8087. ia64*)
  8088. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8089. ;;
  8090. *)
  8091. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8092. ;;
  8093. esac
  8094. # Commands to make compiler produce verbose output that lists
  8095. # what "hidden" libraries, object files and flags are used when
  8096. # linking a shared library.
  8097. #
  8098. # There doesn't appear to be a way to prevent this compiler from
  8099. # explicitly linking system object files so we need to strip them
  8100. # from the output so that they don't get included in the library
  8101. # dependencies.
  8102. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8103. ;;
  8104. *)
  8105. if test "$GXX" = yes; then
  8106. if test $with_gnu_ld = no; then
  8107. case $host_cpu in
  8108. hppa*64*)
  8109. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8110. ;;
  8111. ia64*)
  8112. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8113. ;;
  8114. *)
  8115. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8116. ;;
  8117. esac
  8118. fi
  8119. else
  8120. # FIXME: insert proper C++ library support
  8121. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8122. fi
  8123. ;;
  8124. esac
  8125. ;;
  8126. interix3*)
  8127. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8128. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8129. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8130. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8131. # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  8132. # Instead, shared libraries are loaded at an image base (0x10000000 by
  8133. # default) and relocated if they conflict, which is a slow very memory
  8134. # consuming and fragmenting process. To avoid this, we pick a random,
  8135. # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  8136. # time. Moving up from 0x10000000 also allows more sbrk(2) space.
  8137. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  8138. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  8139. ;;
  8140. irix5* | irix6*)
  8141. case $cc_basename in
  8142. CC*)
  8143. # SGI C++
  8144. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8145. # Archives containing C++ object files must be created using
  8146. # "CC -ar", where "CC" is the IRIX C++ compiler. This is
  8147. # necessary to make sure instantiated templates are included
  8148. # in the archive.
  8149. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
  8150. ;;
  8151. *)
  8152. if test "$GXX" = yes; then
  8153. if test "$with_gnu_ld" = no; then
  8154. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8155. else
  8156. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  8157. fi
  8158. fi
  8159. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8160. ;;
  8161. esac
  8162. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8163. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8164. ;;
  8165. linux* | k*bsd*-gnu)
  8166. case $cc_basename in
  8167. KCC*)
  8168. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8169. # KCC will only create a shared library if the output file
  8170. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8171. # to its proper name (with version) after linking.
  8172. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8173. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  8174. # Commands to make compiler produce verbose output that lists
  8175. # what "hidden" libraries, object files and flags are used when
  8176. # linking a shared library.
  8177. #
  8178. # There doesn't appear to be a way to prevent this compiler from
  8179. # explicitly linking system object files so we need to strip them
  8180. # from the output so that they don't get included in the library
  8181. # dependencies.
  8182. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8183. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
  8184. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8185. # Archives containing C++ object files must be created using
  8186. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  8187. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  8188. ;;
  8189. icpc*)
  8190. # Intel C++
  8191. with_gnu_ld=yes
  8192. # version 8.0 and above of icpc choke on multiply defined symbols
  8193. # if we add $predep_objects and $postdep_objects, however 7.1 and
  8194. # earlier do not add the objects themselves.
  8195. case `$CC -V 2>&1` in
  8196. *"Version 7."*)
  8197. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8198. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8199. ;;
  8200. *) # Version 8.0 or newer
  8201. tmp_idyn=
  8202. case $host_cpu in
  8203. ia64*) tmp_idyn=' -i_dynamic';;
  8204. esac
  8205. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8206. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8207. ;;
  8208. esac
  8209. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8210. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8211. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8212. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  8213. ;;
  8214. pgCC*)
  8215. # Portland Group C++ compiler
  8216. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  8217. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  8218. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  8219. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8220. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
  8221. ;;
  8222. cxx*)
  8223. # Compaq C++
  8224. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8225. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
  8226. runpath_var=LD_RUN_PATH
  8227. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  8228. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8229. # Commands to make compiler produce verbose output that lists
  8230. # what "hidden" libraries, object files and flags are used when
  8231. # linking a shared library.
  8232. #
  8233. # There doesn't appear to be a way to prevent this compiler from
  8234. # explicitly linking system object files so we need to strip them
  8235. # from the output so that they don't get included in the library
  8236. # dependencies.
  8237. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8238. ;;
  8239. esac
  8240. ;;
  8241. lynxos*)
  8242. # FIXME: insert proper C++ library support
  8243. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8244. ;;
  8245. m88k*)
  8246. # FIXME: insert proper C++ library support
  8247. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8248. ;;
  8249. mvs*)
  8250. case $cc_basename in
  8251. cxx*)
  8252. # FIXME: insert proper C++ library support
  8253. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8254. ;;
  8255. *)
  8256. # FIXME: insert proper C++ library support
  8257. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8258. ;;
  8259. esac
  8260. ;;
  8261. netbsd* | netbsdelf*-gnu)
  8262. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  8263. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
  8264. wlarc=
  8265. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8266. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8267. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8268. fi
  8269. # Workaround some broken pre-1.5 toolchains
  8270. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
  8271. ;;
  8272. openbsd2*)
  8273. # C++ shared libraries are fairly broken
  8274. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8275. ;;
  8276. openbsd*)
  8277. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8278. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8279. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  8280. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8281. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  8282. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
  8283. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8284. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  8285. fi
  8286. output_verbose_link_cmd='echo'
  8287. ;;
  8288. osf3*)
  8289. case $cc_basename in
  8290. KCC*)
  8291. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8292. # KCC will only create a shared library if the output file
  8293. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8294. # to its proper name (with version) after linking.
  8295. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8296. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8297. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8298. # Archives containing C++ object files must be created using
  8299. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  8300. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  8301. ;;
  8302. RCC*)
  8303. # Rational C++ 2.4.1
  8304. # FIXME: insert proper C++ library support
  8305. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8306. ;;
  8307. cxx*)
  8308. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8309. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8310. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8311. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8312. # Commands to make compiler produce verbose output that lists
  8313. # what "hidden" libraries, object files and flags are used when
  8314. # linking a shared library.
  8315. #
  8316. # There doesn't appear to be a way to prevent this compiler from
  8317. # explicitly linking system object files so we need to strip them
  8318. # from the output so that they don't get included in the library
  8319. # dependencies.
  8320. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8321. ;;
  8322. *)
  8323. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8324. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8325. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8326. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8327. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8328. # Commands to make compiler produce verbose output that lists
  8329. # what "hidden" libraries, object files and flags are used when
  8330. # linking a shared library.
  8331. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  8332. else
  8333. # FIXME: insert proper C++ library support
  8334. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8335. fi
  8336. ;;
  8337. esac
  8338. ;;
  8339. osf4* | osf5*)
  8340. case $cc_basename in
  8341. KCC*)
  8342. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8343. # KCC will only create a shared library if the output file
  8344. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8345. # to its proper name (with version) after linking.
  8346. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8347. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8348. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8349. # Archives containing C++ object files must be created using
  8350. # the KAI C++ compiler.
  8351. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
  8352. ;;
  8353. RCC*)
  8354. # Rational C++ 2.4.1
  8355. # FIXME: insert proper C++ library support
  8356. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8357. ;;
  8358. cxx*)
  8359. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  8360. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8361. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
  8362. echo "-hidden">> $lib.exp~
  8363. $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
  8364. $rm $lib.exp'
  8365. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  8366. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8367. # Commands to make compiler produce verbose output that lists
  8368. # what "hidden" libraries, object files and flags are used when
  8369. # linking a shared library.
  8370. #
  8371. # There doesn't appear to be a way to prevent this compiler from
  8372. # explicitly linking system object files so we need to strip them
  8373. # from the output so that they don't get included in the library
  8374. # dependencies.
  8375. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8376. ;;
  8377. *)
  8378. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8379. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8380. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8381. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8382. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8383. # Commands to make compiler produce verbose output that lists
  8384. # what "hidden" libraries, object files and flags are used when
  8385. # linking a shared library.
  8386. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  8387. else
  8388. # FIXME: insert proper C++ library support
  8389. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8390. fi
  8391. ;;
  8392. esac
  8393. ;;
  8394. psos*)
  8395. # FIXME: insert proper C++ library support
  8396. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8397. ;;
  8398. sunos4*)
  8399. case $cc_basename in
  8400. CC*)
  8401. # Sun C++ 4.x
  8402. # FIXME: insert proper C++ library support
  8403. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8404. ;;
  8405. lcc*)
  8406. # Lucid
  8407. # FIXME: insert proper C++ library support
  8408. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8409. ;;
  8410. *)
  8411. # FIXME: insert proper C++ library support
  8412. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8413. ;;
  8414. esac
  8415. ;;
  8416. solaris*)
  8417. case $cc_basename in
  8418. CC*)
  8419. # Sun C++ 4.2, 5.x and Centerline C++
  8420. _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
  8421. _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  8422. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8423. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8424. $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8425. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8426. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8427. case $host_os in
  8428. solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  8429. *)
  8430. # The C++ compiler is used as linker so we must use $wl
  8431. # flag to pass the commands to the underlying system
  8432. # linker. We must also pass each convience library through
  8433. # to the system linker between allextract/defaultextract.
  8434. # The C++ compiler will combine linker options so we
  8435. # cannot just pass the convience library names through
  8436. # without $wl.
  8437. # Supported since Solaris 2.6 (maybe 2.5.1?)
  8438. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
  8439. ;;
  8440. esac
  8441. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8442. output_verbose_link_cmd='echo'
  8443. # Archives containing C++ object files must be created using
  8444. # "CC -xar", where "CC" is the Sun C++ compiler. This is
  8445. # necessary to make sure instantiated templates are included
  8446. # in the archive.
  8447. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  8448. ;;
  8449. gcx*)
  8450. # Green Hills C++ Compiler
  8451. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8452. # The C++ compiler must be used to create the archive.
  8453. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  8454. ;;
  8455. *)
  8456. # GNU C++ compiler with Solaris linker
  8457. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8458. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
  8459. if $CC --version | grep -v '^2\.7' > /dev/null; then
  8460. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8461. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8462. $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8463. # Commands to make compiler produce verbose output that lists
  8464. # what "hidden" libraries, object files and flags are used when
  8465. # linking a shared library.
  8466. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
  8467. else
  8468. # g++ 2.7 appears to require `-G' NOT `-shared' on this
  8469. # platform.
  8470. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8471. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8472. $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8473. # Commands to make compiler produce verbose output that lists
  8474. # what "hidden" libraries, object files and flags are used when
  8475. # linking a shared library.
  8476. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
  8477. fi
  8478. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
  8479. fi
  8480. ;;
  8481. esac
  8482. ;;
  8483. sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  8484. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  8485. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8486. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8487. runpath_var='LD_RUN_PATH'
  8488. case $cc_basename in
  8489. CC*)
  8490. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8491. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8492. ;;
  8493. *)
  8494. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8495. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8496. ;;
  8497. esac
  8498. ;;
  8499. sysv5* | sco3.2v5* | sco5v6*)
  8500. # Note: We can NOT use -z defs as we might desire, because we do not
  8501. # link with -lc, and that would cause any symbols used from libc to
  8502. # always be unresolved, which means just about no library would
  8503. # ever link correctly. If we're not using GNU ld we use -z text
  8504. # though, which does catch some bad symbols but isn't as heavy-handed
  8505. # as -z defs.
  8506. # For security reasons, it is highly recommended that you always
  8507. # use absolute paths for naming shared libraries, and exclude the
  8508. # DT_RUNPATH tag from executables and libraries. But doing so
  8509. # requires that you compile everything twice, which is a pain.
  8510. # So that behaviour is only enabled if SCOABSPATH is set to a
  8511. # non-empty value in the environment. Most likely only useful for
  8512. # creating official distributions of packages.
  8513. # This is a hack until libtool officially supports absolute path
  8514. # names for shared libraries.
  8515. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  8516. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  8517. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8518. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8519. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
  8520. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  8521. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8522. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  8523. runpath_var='LD_RUN_PATH'
  8524. case $cc_basename in
  8525. CC*)
  8526. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8527. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8528. ;;
  8529. *)
  8530. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8531. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8532. ;;
  8533. esac
  8534. ;;
  8535. tandem*)
  8536. case $cc_basename in
  8537. NCC*)
  8538. # NonStop-UX NCC 3.20
  8539. # FIXME: insert proper C++ library support
  8540. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8541. ;;
  8542. *)
  8543. # FIXME: insert proper C++ library support
  8544. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8545. ;;
  8546. esac
  8547. ;;
  8548. vxworks*)
  8549. # FIXME: insert proper C++ library support
  8550. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8551. ;;
  8552. *)
  8553. # FIXME: insert proper C++ library support
  8554. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8555. ;;
  8556. esac
  8557. AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
  8558. test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  8559. _LT_AC_TAGVAR(GCC, $1)="$GXX"
  8560. _LT_AC_TAGVAR(LD, $1)="$LD"
  8561. ## CAVEAT EMPTOR:
  8562. ## There is no encapsulation within the following macros, do not change
  8563. ## the running order or otherwise move them around unless you know exactly
  8564. ## what you are doing...
  8565. AC_LIBTOOL_POSTDEP_PREDEP($1)
  8566. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8567. AC_LIBTOOL_PROG_CC_C_O($1)
  8568. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8569. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8570. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8571. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8572. AC_LIBTOOL_CONFIG($1)
  8573. AC_LANG_POP
  8574. CC=$lt_save_CC
  8575. LDCXX=$LD
  8576. LD=$lt_save_LD
  8577. GCC=$lt_save_GCC
  8578. with_gnu_ldcxx=$with_gnu_ld
  8579. with_gnu_ld=$lt_save_with_gnu_ld
  8580. lt_cv_path_LDCXX=$lt_cv_path_LD
  8581. lt_cv_path_LD=$lt_save_path_LD
  8582. lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
  8583. lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
  8584. ])# AC_LIBTOOL_LANG_CXX_CONFIG
  8585. # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
  8586. # ------------------------------------
  8587. # Figure out "hidden" library dependencies from verbose
  8588. # compiler output when linking a shared library.
  8589. # Parse the compiler output and extract the necessary
  8590. # objects, libraries and library flags.
  8591. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
  8592. dnl we can't use the lt_simple_compile_test_code here,
  8593. dnl because it contains code intended for an executable,
  8594. dnl not a library. It's possible we should let each
  8595. dnl tag define a new lt_????_link_test_code variable,
  8596. dnl but it's only used here...
  8597. ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
  8598. int a;
  8599. void foo (void) { a = 0; }
  8600. EOF
  8601. ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
  8602. class Foo
  8603. {
  8604. public:
  8605. Foo (void) { a = 0; }
  8606. private:
  8607. int a;
  8608. };
  8609. EOF
  8610. ],[$1],[F77],[cat > conftest.$ac_ext <<EOF
  8611. subroutine foo
  8612. implicit none
  8613. integer*4 a
  8614. a=0
  8615. return
  8616. end
  8617. EOF
  8618. ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
  8619. public class foo {
  8620. private int a;
  8621. public void bar (void) {
  8622. a = 0;
  8623. }
  8624. };
  8625. EOF
  8626. ])
  8627. dnl Parse the compiler output and extract the necessary
  8628. dnl objects, libraries and library flags.
  8629. if AC_TRY_EVAL(ac_compile); then
  8630. # Parse the compiler output and extract the necessary
  8631. # objects, libraries and library flags.
  8632. # Sentinel used to keep track of whether or not we are before
  8633. # the conftest object file.
  8634. pre_test_object_deps_done=no
  8635. # The `*' in the case matches for architectures that use `case' in
  8636. # $output_verbose_cmd can trigger glob expansion during the loop
  8637. # eval without this substitution.
  8638. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
  8639. for p in `eval $output_verbose_link_cmd`; do
  8640. case $p in
  8641. -L* | -R* | -l*)
  8642. # Some compilers place space between "-{L,R}" and the path.
  8643. # Remove the space.
  8644. if test $p = "-L" \
  8645. || test $p = "-R"; then
  8646. prev=$p
  8647. continue
  8648. else
  8649. prev=
  8650. fi
  8651. if test "$pre_test_object_deps_done" = no; then
  8652. case $p in
  8653. -L* | -R*)
  8654. # Internal compiler library paths should come after those
  8655. # provided the user. The postdeps already come after the
  8656. # user supplied libs so there is no need to process them.
  8657. if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
  8658. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
  8659. else
  8660. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
  8661. fi
  8662. ;;
  8663. # The "-l" case would never come before the object being
  8664. # linked, so don't bother handling this case.
  8665. esac
  8666. else
  8667. if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
  8668. _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
  8669. else
  8670. _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
  8671. fi
  8672. fi
  8673. ;;
  8674. *.$objext)
  8675. # This assumes that the test object file only shows up
  8676. # once in the compiler output.
  8677. if test "$p" = "conftest.$objext"; then
  8678. pre_test_object_deps_done=yes
  8679. continue
  8680. fi
  8681. if test "$pre_test_object_deps_done" = no; then
  8682. if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
  8683. _LT_AC_TAGVAR(predep_objects, $1)="$p"
  8684. else
  8685. _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
  8686. fi
  8687. else
  8688. if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
  8689. _LT_AC_TAGVAR(postdep_objects, $1)="$p"
  8690. else
  8691. _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
  8692. fi
  8693. fi
  8694. ;;
  8695. *) ;; # Ignore the rest.
  8696. esac
  8697. done
  8698. # Clean up.
  8699. rm -f a.out a.exe
  8700. else
  8701. echo "libtool.m4: error: problem compiling $1 test program"
  8702. fi
  8703. $rm -f confest.$objext
  8704. # PORTME: override above test on systems where it is broken
  8705. ifelse([$1],[CXX],
  8706. [case $host_os in
  8707. interix3*)
  8708. # Interix 3.5 installs completely hosed .la files for C++, so rather than
  8709. # hack all around it, let's just trust "g++" to DTRT.
  8710. _LT_AC_TAGVAR(predep_objects,$1)=
  8711. _LT_AC_TAGVAR(postdep_objects,$1)=
  8712. _LT_AC_TAGVAR(postdeps,$1)=
  8713. ;;
  8714. solaris*)
  8715. case $cc_basename in
  8716. CC*)
  8717. # Adding this requires a known-good setup of shared libraries for
  8718. # Sun compiler versions before 5.6, else PIC objects from an old
  8719. # archive will be linked into the output, leading to subtle bugs.
  8720. _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
  8721. ;;
  8722. esac
  8723. ;;
  8724. esac
  8725. ])
  8726. case " $_LT_AC_TAGVAR(postdeps, $1) " in
  8727. *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
  8728. esac
  8729. ])# AC_LIBTOOL_POSTDEP_PREDEP
  8730. # AC_LIBTOOL_LANG_F77_CONFIG
  8731. # --------------------------
  8732. # Ensure that the configuration vars for the C compiler are
  8733. # suitably defined. Those variables are subsequently used by
  8734. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8735. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
  8736. AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
  8737. [AC_REQUIRE([AC_PROG_F77])
  8738. AC_LANG_PUSH(Fortran 77)
  8739. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8740. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  8741. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  8742. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  8743. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  8744. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8745. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  8746. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  8747. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  8748. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  8749. _LT_AC_TAGVAR(hardcode_automatic, $1)=no
  8750. _LT_AC_TAGVAR(module_cmds, $1)=
  8751. _LT_AC_TAGVAR(module_expsym_cmds, $1)=
  8752. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  8753. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  8754. _LT_AC_TAGVAR(no_undefined_flag, $1)=
  8755. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  8756. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  8757. # Source file extension for f77 test sources.
  8758. ac_ext=f
  8759. # Object file extension for compiled f77 test sources.
  8760. objext=o
  8761. _LT_AC_TAGVAR(objext, $1)=$objext
  8762. # Code to be used in simple compile tests
  8763. lt_simple_compile_test_code=" subroutine t\n return\n end\n"
  8764. # Code to be used in simple link tests
  8765. lt_simple_link_test_code=" program t\n end\n"
  8766. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8767. _LT_AC_SYS_COMPILER
  8768. # save warnings/boilerplate of simple test code
  8769. _LT_COMPILER_BOILERPLATE
  8770. _LT_LINKER_BOILERPLATE
  8771. # Allow CC to be a program name with arguments.
  8772. lt_save_CC="$CC"
  8773. CC=${F77-"f77"}
  8774. compiler=$CC
  8775. _LT_AC_TAGVAR(compiler, $1)=$CC
  8776. _LT_CC_BASENAME([$compiler])
  8777. AC_MSG_CHECKING([if libtool supports shared libraries])
  8778. AC_MSG_RESULT([$can_build_shared])
  8779. AC_MSG_CHECKING([whether to build shared libraries])
  8780. test "$can_build_shared" = "no" && enable_shared=no
  8781. # On AIX, shared libraries and static libraries use the same namespace, and
  8782. # are all built from PIC.
  8783. case $host_os in
  8784. aix3*)
  8785. test "$enable_shared" = yes && enable_static=no
  8786. if test -n "$RANLIB"; then
  8787. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  8788. postinstall_cmds='$RANLIB $lib'
  8789. fi
  8790. ;;
  8791. aix4* | aix5*)
  8792. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  8793. test "$enable_shared" = yes && enable_static=no
  8794. fi
  8795. ;;
  8796. esac
  8797. AC_MSG_RESULT([$enable_shared])
  8798. AC_MSG_CHECKING([whether to build static libraries])
  8799. # Make sure either enable_shared or enable_static is yes.
  8800. test "$enable_shared" = yes || enable_static=yes
  8801. AC_MSG_RESULT([$enable_static])
  8802. _LT_AC_TAGVAR(GCC, $1)="$G77"
  8803. _LT_AC_TAGVAR(LD, $1)="$LD"
  8804. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8805. AC_LIBTOOL_PROG_CC_C_O($1)
  8806. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8807. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8808. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8809. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8810. AC_LIBTOOL_CONFIG($1)
  8811. AC_LANG_POP
  8812. CC="$lt_save_CC"
  8813. ])# AC_LIBTOOL_LANG_F77_CONFIG
  8814. # AC_LIBTOOL_LANG_GCJ_CONFIG
  8815. # --------------------------
  8816. # Ensure that the configuration vars for the C compiler are
  8817. # suitably defined. Those variables are subsequently used by
  8818. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8819. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
  8820. AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
  8821. [AC_LANG_SAVE
  8822. # Source file extension for Java test sources.
  8823. ac_ext=java
  8824. # Object file extension for compiled Java test sources.
  8825. objext=o
  8826. _LT_AC_TAGVAR(objext, $1)=$objext
  8827. # Code to be used in simple compile tests
  8828. lt_simple_compile_test_code="class foo {}\n"
  8829. # Code to be used in simple link tests
  8830. lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
  8831. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8832. _LT_AC_SYS_COMPILER
  8833. # save warnings/boilerplate of simple test code
  8834. _LT_COMPILER_BOILERPLATE
  8835. _LT_LINKER_BOILERPLATE
  8836. # Allow CC to be a program name with arguments.
  8837. lt_save_CC="$CC"
  8838. CC=${GCJ-"gcj"}
  8839. compiler=$CC
  8840. _LT_AC_TAGVAR(compiler, $1)=$CC
  8841. _LT_CC_BASENAME([$compiler])
  8842. # GCJ did not exist at the time GCC didn't implicitly link libc in.
  8843. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8844. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  8845. ## CAVEAT EMPTOR:
  8846. ## There is no encapsulation within the following macros, do not change
  8847. ## the running order or otherwise move them around unless you know exactly
  8848. ## what you are doing...
  8849. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  8850. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8851. AC_LIBTOOL_PROG_CC_C_O($1)
  8852. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8853. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8854. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8855. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8856. AC_LIBTOOL_CONFIG($1)
  8857. AC_LANG_RESTORE
  8858. CC="$lt_save_CC"
  8859. ])# AC_LIBTOOL_LANG_GCJ_CONFIG
  8860. # AC_LIBTOOL_LANG_RC_CONFIG
  8861. # -------------------------
  8862. # Ensure that the configuration vars for the Windows resource compiler are
  8863. # suitably defined. Those variables are subsequently used by
  8864. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8865. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
  8866. AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
  8867. [AC_LANG_SAVE
  8868. # Source file extension for RC test sources.
  8869. ac_ext=rc
  8870. # Object file extension for compiled RC test sources.
  8871. objext=o
  8872. _LT_AC_TAGVAR(objext, $1)=$objext
  8873. # Code to be used in simple compile tests
  8874. lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
  8875. # Code to be used in simple link tests
  8876. lt_simple_link_test_code="$lt_simple_compile_test_code"
  8877. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8878. _LT_AC_SYS_COMPILER
  8879. # save warnings/boilerplate of simple test code
  8880. _LT_COMPILER_BOILERPLATE
  8881. _LT_LINKER_BOILERPLATE
  8882. # Allow CC to be a program name with arguments.
  8883. lt_save_CC="$CC"
  8884. CC=${RC-"windres"}
  8885. compiler=$CC
  8886. _LT_AC_TAGVAR(compiler, $1)=$CC
  8887. _LT_CC_BASENAME([$compiler])
  8888. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  8889. AC_LIBTOOL_CONFIG($1)
  8890. AC_LANG_RESTORE
  8891. CC="$lt_save_CC"
  8892. ])# AC_LIBTOOL_LANG_RC_CONFIG
  8893. # AC_LIBTOOL_CONFIG([TAGNAME])
  8894. # ----------------------------
  8895. # If TAGNAME is not passed, then create an initial libtool script
  8896. # with a default configuration from the untagged config vars. Otherwise
  8897. # add code to config.status for appending the configuration named by
  8898. # TAGNAME from the matching tagged config vars.
  8899. AC_DEFUN([AC_LIBTOOL_CONFIG],
  8900. [# The else clause should only fire when bootstrapping the
  8901. # libtool distribution, otherwise you forgot to ship ltmain.sh
  8902. # with your package, and you will get complaints that there are
  8903. # no rules to generate ltmain.sh.
  8904. if test -f "$ltmain"; then
  8905. # See if we are running on zsh, and set the options which allow our commands through
  8906. # without removal of \ escapes.
  8907. if test -n "${ZSH_VERSION+set}" ; then
  8908. setopt NO_GLOB_SUBST
  8909. fi
  8910. # Now quote all the things that may contain metacharacters while being
  8911. # careful not to overquote the AC_SUBSTed values. We take copies of the
  8912. # variables and quote the copies for generation of the libtool script.
  8913. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
  8914. SED SHELL STRIP \
  8915. libname_spec library_names_spec soname_spec extract_expsyms_cmds \
  8916. old_striplib striplib file_magic_cmd finish_cmds finish_eval \
  8917. deplibs_check_method reload_flag reload_cmds need_locks \
  8918. lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
  8919. lt_cv_sys_global_symbol_to_c_name_address \
  8920. sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  8921. old_postinstall_cmds old_postuninstall_cmds \
  8922. _LT_AC_TAGVAR(compiler, $1) \
  8923. _LT_AC_TAGVAR(CC, $1) \
  8924. _LT_AC