configure.in 149 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550
  1. dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
  2. dnl vi: set tabstop=4 shiftwidth=4 expandtab:
  3. dnl ***** BEGIN LICENSE BLOCK *****
  4. dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. dnl
  6. dnl The contents of this file are subject to the Mozilla Public License Version
  7. dnl 1.1 (the "License"); you may not use this file except in compliance with
  8. dnl the License. You may obtain a copy of the License at
  9. dnl http://www.mozilla.org/MPL/
  10. dnl
  11. dnl Software distributed under the License is distributed on an "AS IS" basis,
  12. dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. dnl for the specific language governing rights and limitations under the
  14. dnl License.
  15. dnl
  16. dnl The Original Code is this file as it was released upon August 6, 1998.
  17. dnl
  18. dnl The Initial Developer of the Original Code is
  19. dnl Christopher Seawood.
  20. dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
  21. dnl the Initial Developer. All Rights Reserved.
  22. dnl
  23. dnl Contributor(s):
  24. dnl Jamie Zawinski <jwz@jwz.org>
  25. dnl gettimeofday args check
  26. dnl Christopher Blizzard <blizzard@appliedtheory.com>
  27. dnl gnomefe update & enable-pthreads
  28. dnl Ramiro Estrugo <ramiro@netscape.com>
  29. dnl X11 makedepend support
  30. dnl Insure support.
  31. dnl Henry Sobotka <sobotka@axess.com>
  32. dnl OS/2 support
  33. dnl Dan Mosedale <dmose@mozilla.org>
  34. dnl LDAP support
  35. dnl Seth Spitzer <sspitzer@netscape.com>
  36. dnl xpctools support
  37. dnl Benjamin Smedberg <benjamin@smedbergs.us>
  38. dnl Howard Chu <hyc@symas.com>
  39. dnl MSYS support
  40. dnl Mark Mentovai <mark@moxienet.com>:
  41. dnl Mac OS X 10.4 support
  42. dnl Giorgio Maone <g.maone@informaction.com>
  43. dnl MSVC l10n compatible version check
  44. dnl Ben Turner <mozilla@songbirdnest.com>
  45. dnl
  46. dnl Alternatively, the contents of this file may be used under the terms of
  47. dnl either the GNU General Public License Version 2 or later (the "GPL"), or
  48. dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  49. dnl in which case the provisions of the GPL or the LGPL are applicable instead
  50. dnl of those above. If you wish to allow use of your version of this file only
  51. dnl under the terms of either the GPL or the LGPL, and not to allow others to
  52. dnl use your version of this file under the terms of the MPL, indicate your
  53. dnl decision by deleting the provisions above and replace them with the notice
  54. dnl and other provisions required by the GPL or the LGPL. If you do not delete
  55. dnl the provisions above, a recipient may use your version of this file under
  56. dnl the terms of any one of the MPL, the GPL or the LGPL.
  57. dnl
  58. dnl ***** END LICENSE BLOCK *****
  59. dnl Process this file with autoconf to produce a configure script.
  60. dnl ========================================================
  61. AC_PREREQ(2.13)
  62. AC_INIT(config/config.mk)
  63. AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
  64. AC_CANONICAL_SYSTEM
  65. TARGET_CPU="${target_cpu}"
  66. TARGET_VENDOR="${target_vendor}"
  67. TARGET_OS="${target_os}"
  68. dnl ========================================================
  69. dnl =
  70. dnl = Don't change the following two lines. Doing so breaks:
  71. dnl =
  72. dnl = CFLAGS="-foo" ./configure
  73. dnl =
  74. dnl ========================================================
  75. CFLAGS="${CFLAGS=}"
  76. CPPFLAGS="${CPPFLAGS=}"
  77. CXXFLAGS="${CXXFLAGS=}"
  78. LDFLAGS="${LDFLAGS=}"
  79. HOST_CFLAGS="${HOST_CFLAGS=}"
  80. HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
  81. HOST_LDFLAGS="${HOST_LDFLAGS=}"
  82. dnl ========================================================
  83. dnl = Preserve certain environment flags passed to configure
  84. dnl = We want sub projects to receive the same flags
  85. dnl = untainted by this configure script
  86. dnl ========================================================
  87. _SUBDIR_CC="$CC"
  88. _SUBDIR_CXX="$CXX"
  89. _SUBDIR_CFLAGS="$CFLAGS"
  90. _SUBDIR_CPPFLAGS="$CPPFLAGS"
  91. _SUBDIR_CXXFLAGS="$CXXFLAGS"
  92. _SUBDIR_LDFLAGS="$LDFLAGS"
  93. _SUBDIR_HOST_CC="$HOST_CC"
  94. _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
  95. _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
  96. _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
  97. _SUBDIR_CONFIG_ARGS="$ac_configure_args"
  98. dnl Set the version number of the libs included with mozilla
  99. dnl ========================================================
  100. NSPR_VERSION=4
  101. dnl Set the minimum version of toolkit libs used by mozilla
  102. dnl ========================================================
  103. PERL_VERSION=5.006
  104. PYTHON_VERSION=2.4
  105. WINDRES_VERSION=2.14.90
  106. W32API_VERSION=3.8
  107. MSMANIFEST_TOOL=
  108. dnl Set various checks
  109. dnl ========================================================
  110. AC_PROG_AWK
  111. dnl Do not allow a separate objdir build if a srcdir build exists.
  112. dnl ==============================================================
  113. _topsrcdir=`cd \`dirname $0\`; pwd`
  114. _objdir=`pwd`
  115. if test "$_topsrcdir" == "$_objdir"; then
  116. AC_MSG_ERROR([Please use a separate objdir instead of configuring directly in the source directory.])
  117. fi
  118. MOZ_BUILD_ROOT=`pwd`
  119. dnl Default to MSVC for win32
  120. dnl ==============================================================
  121. if test -z "$CROSS_COMPILE"; then
  122. case "$target" in
  123. *-cygwin*|*-mingw*|*-msvc*|*-mks*)
  124. if test -z "$CC"; then CC=cl; fi
  125. if test -z "$CXX"; then CXX=cl; fi
  126. if test -z "$CPP"; then CPP="cl -E -nologo"; fi
  127. if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
  128. if test -z "$LD"; then LD=link; fi
  129. if test -z "$AS"; then AS=ml; fi
  130. if test -z "$MIDL"; then MIDL=midl; fi
  131. ;;
  132. esac
  133. fi
  134. dnl Check for Perl first -- needed for win32 SDK checks
  135. MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
  136. if test -z "$PERL" || test "$PERL" = ":"; then
  137. AC_MSG_ERROR([perl not found in \$PATH])
  138. fi
  139. dnl ========================================================
  140. dnl Checks for compilers.
  141. dnl ========================================================
  142. dnl Set CROSS_COMPILE in the environment when running configure
  143. dnl to use the cross-compile setup for now
  144. dnl ========================================================
  145. dnl Do some special WinCE toolchain stuff
  146. case "$target" in
  147. *wince)
  148. MOZ_ARG_WITH_STRING(wince-sdk,
  149. [ --with-wince-sdk=WINCE_SDK_DIR
  150. The path to the Windows CE SDK],
  151. WINCE_SDK_DIR=$withval)
  152. MOZ_ARG_WITH_STRING(ogles-sdk,
  153. [ --with-ogles-sdk=OGLES_SDK_DIR
  154. The path to the OGLES SDK],
  155. OGLES_SDK_DIR=$withval)
  156. dnl Default to Windows Mobile components enabled
  157. WINCE_WINDOWS_MOBILE=1
  158. MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
  159. [ --disable-windows-mobile-components
  160. Disable Windows Mobile specific components from CE build],
  161. WINCE_WINDOWS_MOBILE=,
  162. WINCE_WINDOWS_MOBILE=1)
  163. if test "$WINCE_WINDOWS_MOBILE"; then
  164. AC_DEFINE(WINCE_WINDOWS_MOBILE)
  165. fi
  166. AC_DEFINE(WINCE)
  167. export WINCE=1
  168. echo -----------------------------------------------------------------------------
  169. echo Building Windows CE Shunt Library and Tool Chain
  170. echo Using SDK in:
  171. echo $WINCE_SDK_DIR
  172. ac_exeext=.exe
  173. _pwdw=`pwd -W`
  174. _pwd=`pwd`
  175. make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$_topsrcdir" OBJDIR="$_pwdw" -C $srcdir/build/wince/tools
  176. CC="$_pwd/dist/sdk/bin/arm-wince-gcc"
  177. CXX="$_pwd/dist/sdk/bin/arm-wince-gcc"
  178. CPP="$_pwd/dist/sdk/bin/arm-wince-gcc -E -nologo"
  179. CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
  180. LD="$_pwd/dist/sdk/bin/arm-wince-link"
  181. AR="$_pwd/dist/sdk/bin/arm-wince-lib"
  182. AS="$_pwd/dist/sdk/bin/arm-wince-as"
  183. RC="$_pwd/dist/sdk/bin/arm-wince-res"
  184. echo -----------------------------------------------------------------------------
  185. ;;
  186. esac
  187. if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
  188. echo "cross compiling from $host to $target"
  189. cross_compiling=yes
  190. _SAVE_CC="$CC"
  191. _SAVE_CFLAGS="$CFLAGS"
  192. _SAVE_LDFLAGS="$LDFLAGS"
  193. AC_MSG_CHECKING([for host c compiler])
  194. AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
  195. if test -z "$HOST_CC"; then
  196. AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
  197. fi
  198. AC_MSG_RESULT([$HOST_CC])
  199. AC_MSG_CHECKING([for host c++ compiler])
  200. AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
  201. if test -z "$HOST_CXX"; then
  202. AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
  203. fi
  204. AC_MSG_RESULT([$HOST_CXX])
  205. if test -z "$HOST_CFLAGS"; then
  206. HOST_CFLAGS="$CFLAGS"
  207. fi
  208. if test -z "$HOST_CXXFLAGS"; then
  209. HOST_CXXFLAGS="$CXXFLAGS"
  210. fi
  211. if test -z "$HOST_LDFLAGS"; then
  212. HOST_LDFLAGS="$LDFLAGS"
  213. fi
  214. AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
  215. AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
  216. CC="$HOST_CC"
  217. CFLAGS="$HOST_CFLAGS"
  218. LDFLAGS="$HOST_LDFLAGS"
  219. AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
  220. AC_TRY_COMPILE([], [return(0);],
  221. [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
  222. AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
  223. CC="$HOST_CXX"
  224. CFLAGS="$HOST_CXXFLAGS"
  225. AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
  226. AC_TRY_COMPILE([], [return(0);],
  227. [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
  228. AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
  229. CC=$_SAVE_CC
  230. CFLAGS=$_SAVE_CFLAGS
  231. LDFLAGS=$_SAVE_LDFLAGS
  232. case "$build:$target" in
  233. powerpc-apple-darwin8*:i?86-apple-darwin*)
  234. dnl The Darwin cross compiler doesn't necessarily point itself at a
  235. dnl root that has libraries for the proper architecture, it defaults
  236. dnl to the system root. The libraries in the system root on current
  237. dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
  238. dnl checks will fail. Fake a working SDK in that case.
  239. _SAVE_CFLAGS=$CFLAGS
  240. _SAVE_CXXFLAGS=$CXXLAGS
  241. CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
  242. CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
  243. ;;
  244. esac
  245. AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
  246. unset ac_cv_prog_CC
  247. AC_PROG_CC
  248. AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
  249. unset ac_cv_prog_CXX
  250. AC_PROG_CXX
  251. case "$build:$target" in
  252. powerpc-apple-darwin8*:i?86-apple-darwin*)
  253. dnl Revert the changes made above. From this point on, the target
  254. dnl compiler will never be used without applying the SDK to CFLAGS
  255. dnl (see --with-macos-sdk below).
  256. CFLAGS=$_SAVE_CFLAGS
  257. CXXFLAGS=$_SAVE_CXXFLAGS
  258. ;;
  259. esac
  260. AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
  261. AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
  262. MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
  263. AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
  264. AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
  265. AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
  266. AC_DEFINE(CROSS_COMPILE)
  267. else
  268. AC_PROG_CC
  269. AC_PROG_CXX
  270. AC_PROG_RANLIB
  271. MOZ_PATH_PROGS(AS, $AS as, $CC)
  272. AC_CHECK_PROGS(AR, ar, :)
  273. AC_CHECK_PROGS(LD, ld, :)
  274. AC_CHECK_PROGS(STRIP, strip, :)
  275. AC_CHECK_PROGS(WINDRES, windres, :)
  276. if test -z "$HOST_CC"; then
  277. HOST_CC="$CC"
  278. fi
  279. if test -z "$HOST_CFLAGS"; then
  280. HOST_CFLAGS="$CFLAGS"
  281. fi
  282. if test -z "$HOST_CXX"; then
  283. HOST_CXX="$CXX"
  284. fi
  285. if test -z "$HOST_CXXFLAGS"; then
  286. HOST_CXXFLAGS="$CXXFLAGS"
  287. fi
  288. if test -z "$HOST_LDFLAGS"; then
  289. HOST_LDFLAGS="$LDFLAGS"
  290. fi
  291. if test -z "$HOST_RANLIB"; then
  292. HOST_RANLIB="$RANLIB"
  293. fi
  294. if test -z "$HOST_AR"; then
  295. HOST_AR="$AR"
  296. fi
  297. fi
  298. GNU_AS=
  299. GNU_LD=
  300. GNU_CC=
  301. GNU_CXX=
  302. CC_VERSION='N/A'
  303. CXX_VERSION='N/A'
  304. if test "$GCC" = "yes"; then
  305. GNU_CC=1
  306. CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
  307. fi
  308. if test "$GXX" = "yes"; then
  309. GNU_CXX=1
  310. CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
  311. fi
  312. if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
  313. GNU_AS=1
  314. fi
  315. if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
  316. GNU_LD=1
  317. fi
  318. if test "$GNU_CC"; then
  319. if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
  320. GCC_USE_GNU_LD=1
  321. fi
  322. fi
  323. INTEL_CC=
  324. INTEL_CXX=
  325. if test "$GCC" = yes; then
  326. if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
  327. INTEL_CC=1
  328. fi
  329. fi
  330. if test "$GXX" = yes; then
  331. if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
  332. INTEL_CXX=1
  333. fi
  334. fi
  335. dnl Special win32 checks
  336. dnl ========================================================
  337. case "$target" in
  338. *-wince)
  339. WINVER=500
  340. ;;
  341. *)
  342. if test -n "$GNU_CC"; then
  343. WINVER=501
  344. else
  345. WINVER=500
  346. fi
  347. ;;
  348. esac
  349. dnl Target the Windows Vista SDK by default
  350. WINSDK_TARGETVER=600
  351. MOZ_ARG_WITH_STRING(windows-version,
  352. [ --with-windows-version=WINSDK_TARGETVER
  353. Highest Windows version to target using this SDK
  354. 502: Windows Server 2003
  355. 600: Windows Vista
  356. 601: Windows 7],
  357. WINSDK_TARGETVER=$withval)
  358. case "$WINSDK_TARGETVER" in
  359. 502|600|601)
  360. MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
  361. ;;
  362. *)
  363. AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
  364. ;;
  365. esac
  366. case "$target" in
  367. *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
  368. if test "$GCC" != "yes"; then
  369. # Check to see if we are really running in a msvc environemnt
  370. _WIN32_MSVC=1
  371. AC_CHECK_PROGS(MIDL, midl)
  372. # Make sure compilers are valid
  373. CFLAGS="$CFLAGS -TC -nologo"
  374. CXXFLAGS="$CXXFLAGS -TP -nologo"
  375. AC_LANG_SAVE
  376. AC_LANG_C
  377. AC_TRY_COMPILE([#include <stdio.h>],
  378. [ printf("Hello World\n"); ],,
  379. AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
  380. AC_LANG_CPLUSPLUS
  381. AC_TRY_COMPILE([#include <new.h>],
  382. [ unsigned *test = new unsigned(42); ],,
  383. AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
  384. AC_LANG_RESTORE
  385. changequote(,)
  386. _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
  387. changequote([,])
  388. # Determine compiler version
  389. CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
  390. _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
  391. _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
  392. _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
  393. _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
  394. _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
  395. CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
  396. _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
  397. if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
  398. AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
  399. fi
  400. if test "$_CC_MAJOR_VERSION" = "12"; then
  401. _CC_SUITE=6
  402. elif test "$_CC_MAJOR_VERSION" = "13"; then
  403. _CC_SUITE=7
  404. elif test "$_CC_MAJOR_VERSION" = "14"; then
  405. _CC_SUITE=8
  406. _MSVS_VERSION=2005
  407. dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
  408. dnl so be very specific here!
  409. dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
  410. if test $_CC_RELEASE -gt 50727; then
  411. _USE_DYNAMICBASE=1
  412. elif test $_CC_BUILD -ge 762; then
  413. _USE_DYNAMICBASE=1
  414. fi
  415. AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
  416. AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
  417. elif test "$_CC_MAJOR_VERSION" = "15"; then
  418. _CC_SUITE=9
  419. _MSVS_VERSION=2008
  420. LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
  421. _USE_DYNAMICBASE=1
  422. AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
  423. AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
  424. elif test "$_CC_MAJOR_VERSION" = "16"; then
  425. _CC_SUITE=10
  426. _MSVS_VERSION=2010
  427. AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
  428. AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
  429. elif test "$_CC_MAJOR_VERSION" = "17"; then
  430. _CC_SUITE=11
  431. _MSVS_VERSION=2012
  432. AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
  433. AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
  434. else
  435. AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
  436. fi
  437. _MOZ_RTTI_FLAGS_ON='-GR'
  438. _MOZ_RTTI_FLAGS_OFF='-GR-'
  439. if test -n "$WIN32_REDIST_DIR"; then
  440. WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
  441. fi
  442. # bug #249782
  443. # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
  444. if test "$_CC_SUITE" -ge "8"; then
  445. changequote(,)
  446. _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
  447. changequote([,])
  448. MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
  449. if test -n "$MSMT_TOOL"; then
  450. MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
  451. if test -z "$MSMANIFEST_TOOL_VERSION"; then
  452. AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
  453. fi
  454. MSMANIFEST_TOOL=1
  455. unset MSMT_TOOL
  456. else
  457. AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
  458. fi
  459. fi
  460. # Check linker version
  461. _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
  462. _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
  463. if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
  464. AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
  465. fi
  466. INCREMENTAL_LINKER=1
  467. # Check midl version
  468. _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
  469. _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
  470. _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
  471. _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
  472. # Add flags if necessary
  473. AC_MSG_CHECKING([for midl flags])
  474. case "$target" in
  475. i*86-*)
  476. if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
  477. # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
  478. # MIDL version 7.00.0500 or later has no problem.
  479. MIDL_FLAGS="${MIDL_FLAGS} -env win32"
  480. AC_MSG_RESULT([need -env win32])
  481. else
  482. AC_MSG_RESULT([none needed])
  483. fi
  484. ;;
  485. *)
  486. AC_MSG_RESULT([none needed])
  487. ;;
  488. esac
  489. # Identify which version of the SDK we're building with
  490. # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
  491. # from there
  492. AC_CHECK_HEADERS([winsdkver.h])
  493. if test "$ac_cv_header_winsdkver_h" = "yes"; then
  494. # Get the highest _WIN32_WINNT and NTDDI versions supported
  495. # Take the higher of the two
  496. # This is done because the Windows 7 beta SDK reports its
  497. # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
  498. AC_CACHE_CHECK(for highest Windows version supported by this SDK,
  499. ac_cv_winsdk_maxver,
  500. [cat > conftest.h <<EOF
  501. #include <winsdkver.h>
  502. #include <sdkddkver.h>
  503. #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
  504. #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
  505. #else
  506. #define WINSDK_MAXVER NTDDI_MAXVER
  507. #endif
  508. WINSDK_MAXVER
  509. EOF
  510. ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
  511. rm -f conftest.h
  512. ])
  513. MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
  514. else
  515. # The Vista SDK is the only one to have sdkddkver.h but not
  516. # WinSDKVer.h
  517. AC_CHECK_HEADERS([sdkddkver.h])
  518. if test "$ac_cv_header_sdkddkver_h" = "yes"; then
  519. MOZ_WINSDK_MAXVER=0x06000000
  520. else
  521. # Assume the Server 2003 Platform SDK
  522. MOZ_WINSDK_MAXVER=0x05020000
  523. fi
  524. fi
  525. unset _MSVC_VER_FILTER
  526. else
  527. # Check w32api version
  528. _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
  529. _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
  530. AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
  531. AC_TRY_COMPILE([#include <w32api.h>],
  532. #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
  533. (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
  534. __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
  535. #error "test failed."
  536. #endif
  537. , [ res=yes ], [ res=no ])
  538. AC_MSG_RESULT([$res])
  539. if test "$res" != "yes"; then
  540. AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
  541. fi
  542. # Check windres version
  543. AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
  544. _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
  545. AC_MSG_RESULT([$_WINDRES_VERSION])
  546. _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
  547. _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
  548. _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
  549. WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
  550. WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
  551. WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
  552. if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
  553. "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
  554. "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
  555. "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
  556. "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
  557. "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
  558. then
  559. AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
  560. fi
  561. # Server 2003 is the highest version supported
  562. MOZ_WINSDK_MAXVER=0x05020000
  563. fi # !GNU_CC
  564. AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
  565. AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
  566. # Require OS features provided by IE 5.0
  567. AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
  568. # If the maximum version supported by this SDK is lower than the target
  569. # version, error out
  570. AC_MSG_CHECKING([for Windows SDK being recent enough])
  571. if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
  572. AC_MSG_RESULT("yes")
  573. else
  574. AC_MSG_RESULT("no")
  575. AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
  576. fi
  577. AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
  578. # Definitions matching sdkddkver.h
  579. AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
  580. AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
  581. AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
  582. ;;
  583. esac
  584. dnl Test breaks icc on OS/2 && MSVC
  585. if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
  586. AC_PROG_CC_C_O
  587. if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
  588. USING_HCC=1
  589. _OLDCC=$CC
  590. _OLDCXX=$CXX
  591. CC="${srcdir}/build/hcc '$CC'"
  592. CXX="${srcdir}/build/hcpp '$CXX'"
  593. fi
  594. fi
  595. AC_PROG_CPP
  596. AC_PROG_CXXCPP
  597. if test -n "$_WIN32_MSVC"; then
  598. SKIP_PATH_CHECKS=1
  599. SKIP_COMPILER_CHECKS=1
  600. SKIP_LIBRARY_CHECKS=1
  601. # Since we're skipping compiler and library checks, hard-code
  602. # some facts here.
  603. case "$target" in
  604. *-wince)
  605. ;;
  606. *)
  607. AC_DEFINE(HAVE_IO_H)
  608. AC_DEFINE(HAVE_SETBUF)
  609. AC_DEFINE(HAVE_ISATTY)
  610. ;;
  611. esac
  612. fi
  613. AC_SUBST(MIDL_FLAGS)
  614. AC_SUBST(_MSC_VER)
  615. AC_SUBST(GNU_AS)
  616. AC_SUBST(GNU_LD)
  617. AC_SUBST(GNU_CC)
  618. AC_SUBST(GNU_CXX)
  619. AC_SUBST(INTEL_CC)
  620. AC_SUBST(INTEL_CXX)
  621. dnl ========================================================
  622. dnl Checks for programs.
  623. dnl ========================================================
  624. AC_PROG_INSTALL
  625. AC_PROG_LN_S
  626. if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
  627. AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
  628. _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
  629. _perl_res=$?
  630. AC_MSG_RESULT([$_perl_version])
  631. if test "$_perl_res" != 0; then
  632. AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
  633. fi
  634. fi
  635. AC_MSG_CHECKING([for full perl installation])
  636. _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
  637. _perl_res=$?
  638. if test "$_perl_res" != 0; then
  639. AC_MSG_RESULT([no])
  640. AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
  641. else
  642. AC_MSG_RESULT([yes])
  643. fi
  644. MOZ_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
  645. if test -z "$PYTHON"; then
  646. AC_MSG_ERROR([python was not found in \$PATH])
  647. fi
  648. NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
  649. AC_SUBST(NSINSTALL_BIN)
  650. MOZ_PATH_PROG(DOXYGEN, doxygen, :)
  651. MOZ_PATH_PROG(WHOAMI, whoami, :)
  652. MOZ_PATH_PROG(AUTOCONF, autoconf, :)
  653. MOZ_PATH_PROG(UNZIP, unzip, :)
  654. MOZ_PATH_PROGS(ZIP, zip)
  655. if test -z "$ZIP" || test "$ZIP" = ":"; then
  656. AC_MSG_ERROR([zip not found in \$PATH])
  657. fi
  658. MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
  659. MOZ_PATH_PROG(XARGS, xargs)
  660. if test -z "$XARGS" || test "$XARGS" = ":"; then
  661. AC_MSG_ERROR([xargs not found in \$PATH .])
  662. fi
  663. dnl ========================================================
  664. dnl = Mac OS X toolchain support
  665. dnl ========================================================
  666. case "$target_os" in
  667. darwin*)
  668. dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
  669. dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
  670. dnl the environment and includedir purposes (when using an SDK, below),
  671. dnl but remember the full version number for the libdir (SDK).
  672. changequote(,)
  673. GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
  674. GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
  675. changequote([,])
  676. if test "$GCC_VERSION_FULL" = "4.0.0" ; then
  677. dnl Bug 280479, but this keeps popping up in bug 292530 too because
  678. dnl 4.0.0/4061 is the default compiler in Tiger.
  679. changequote(,)
  680. GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
  681. changequote([,])
  682. if test "$GCC_BUILD" = "4061" ; then
  683. AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
  684. This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
  685. from building Mozilla. Upgrade to Xcode 2.1 or later.])
  686. fi
  687. fi
  688. dnl xcodebuild needs GCC_VERSION defined in the environment, since it
  689. dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
  690. dnl /usr/bin/g(cc|++)-$GCC_VERSION.
  691. MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
  692. case "$PBBUILD" in
  693. *xcodebuild*)
  694. changequote(,)
  695. XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
  696. changequote([,])
  697. if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
  698. HAS_XCODE_2_1=1;
  699. fi
  700. ;;
  701. esac
  702. dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
  703. dnl it has moved into /usr/bin.
  704. MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
  705. ;;
  706. esac
  707. AC_SUBST(GCC_VERSION)
  708. AC_SUBST(XCODEBUILD_VERSION)
  709. AC_SUBST(HAS_XCODE_2_1)
  710. dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
  711. dnl that a universal binary is being produced.
  712. AC_SUBST(UNIVERSAL_BINARY)
  713. dnl ========================================================
  714. dnl Check for MacOS deployment target version
  715. dnl ========================================================
  716. MOZ_ARG_ENABLE_STRING(macos-target,
  717. [ --enable-macos-target=VER (default=10.4)
  718. Set the minimum MacOS version needed at runtime],
  719. [_MACOSX_DEPLOYMENT_TARGET=$enableval])
  720. case "$target" in
  721. *-darwin*)
  722. if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
  723. dnl Use the specified value
  724. export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
  725. AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
  726. elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
  727. dnl No value specified on the command line or in the environment,
  728. dnl use architecture minimum.
  729. case "${target_cpu}" in
  730. x86_64)
  731. export MACOSX_DEPLOYMENT_TARGET=10.5
  732. ;;
  733. *)
  734. export MACOSX_DEPLOYMENT_TARGET=10.4
  735. ;;
  736. esac
  737. fi
  738. ;;
  739. esac
  740. AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
  741. dnl ========================================================
  742. dnl = Mac OS X SDK support
  743. dnl ========================================================
  744. MACOS_SDK_DIR=
  745. NEXT_ROOT=
  746. MOZ_ARG_WITH_STRING(macos-sdk,
  747. [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
  748. MACOS_SDK_DIR=$withval)
  749. dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
  750. dnl NEXT_ROOT will be set and exported only if it's needed.
  751. AC_SUBST(MACOS_SDK_DIR)
  752. AC_SUBST(NEXT_ROOT)
  753. if test "$MACOS_SDK_DIR"; then
  754. dnl Sync this section with the ones in NSPR and NSS.
  755. if test ! -d "$MACOS_SDK_DIR"; then
  756. AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
  757. specify a valid SDK. SDKs are installed when the optional cross-development
  758. tools are selected during the Xcode/Developer Tools installation.])
  759. fi
  760. GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
  761. if test "$GCC_VERSION_MAJOR" -lt "4" ; then
  762. SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include -F${MACOS_SDK_DIR}/System/Library/Frameworks"
  763. if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
  764. SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
  765. fi
  766. SDK_CXX_INCLUDE="-I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward"
  767. CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
  768. CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
  769. dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
  770. CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
  771. CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
  772. dnl ld support for -syslibroot is compiler-agnostic, but only available
  773. dnl on Tiger. Although it's possible to switch on the build host's
  774. dnl OS release to use ld -syslibroot when available, ld -syslibroot will
  775. dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
  776. dnl set because both the compiler and linker use it.
  777. LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib $LIBS"
  778. export NEXT_ROOT=$MACOS_SDK_DIR
  779. if test -n "$CROSS_COMPILE" ; then
  780. dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
  781. dnl the build host. HOST_CXX is presently unused.
  782. HOST_CC="NEXT_ROOT= $HOST_CC"
  783. HOST_CXX="NEXT_ROOT= $HOST_CXX"
  784. fi
  785. else
  786. dnl gcc >= 4.0 uses different paths than above, but knows how to find
  787. dnl them itself.
  788. CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
  789. CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
  790. dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
  791. CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
  792. CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
  793. if test "$GCC_VERSION_FULL" = "4.0.0" ; then
  794. dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
  795. dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
  796. dnl be ignored and cause warnings when -syslibroot is specified.
  797. dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
  798. dnl the -isysroot it receives, so this is only needed with 4.0.0.
  799. LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
  800. fi
  801. fi
  802. AC_LANG_SAVE
  803. AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
  804. AC_LANG_CPLUSPLUS
  805. AC_TRY_COMPILE([#include <new>
  806. int main() { return 0; }],
  807. result=yes,
  808. result=no)
  809. AC_LANG_RESTORE
  810. AC_MSG_RESULT($result)
  811. if test "$result" = "no" ; then
  812. AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
  813. fi
  814. fi
  815. dnl Be sure the make we use is GNU make.
  816. dnl on win32, gmake.exe is the generally the wrong version
  817. if test -n "$MAKE"; then
  818. if test `echo $MAKE | grep -c make.py` != 1; then
  819. NOT_PYMAKE=$MAKE
  820. fi
  821. fi
  822. case "$host_os" in
  823. cygwin*|mingw*|mks*|msvc*)
  824. MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
  825. ;;
  826. *)
  827. MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
  828. ;;
  829. esac
  830. if test "$GMAKE" = ":"; then
  831. AC_MSG_ERROR([GNU make not found])
  832. fi
  833. AC_SUBST(GMAKE)
  834. AC_PATH_XTRA
  835. dnl ========================================================
  836. dnl set the defaults first
  837. dnl ========================================================
  838. AS_BIN=$AS
  839. AR_FLAGS='cr $@'
  840. AR_LIST='$(AR) t'
  841. AR_EXTRACT='$(AR) x'
  842. AR_DELETE='$(AR) d'
  843. AS='$(CC)'
  844. AS_DASH_C_FLAG='-c'
  845. DLL_PREFIX=lib
  846. LIB_PREFIX=lib
  847. DLL_SUFFIX=.so
  848. OBJ_SUFFIX=o
  849. LIB_SUFFIX=a
  850. ASM_SUFFIX=s
  851. IMPORT_LIB_SUFFIX=
  852. TARGET_MD_ARCH=unix
  853. DIRENT_INO=d_ino
  854. WIN_TOP_SRC=
  855. MOZ_USER_DIR=".mozilla"
  856. HOST_AR='$(AR)'
  857. HOST_AR_FLAGS='$(AR_FLAGS)'
  858. if test -n "$CROSS_COMPILE"; then
  859. OS_TARGET="${target_os}"
  860. OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
  861. OS_RELEASE=
  862. case "${target_os}" in
  863. linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
  864. kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
  865. solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
  866. mingw*) OS_ARCH=WINNT ;;
  867. wince*) OS_ARCH=WINCE ;;
  868. darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
  869. esac
  870. else
  871. OS_TARGET=`uname -s`
  872. OS_ARCH=`uname -s | sed -e 's|/|_|g'`
  873. OS_RELEASE=`uname -r`
  874. fi
  875. # Before this used `uname -m` when not cross compiling
  876. # but that breaks when you have a 64 bit kernel with a 32 bit userland.
  877. OS_TEST="${target_cpu}"
  878. _COMPILER_PREFIX=
  879. HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
  880. MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
  881. MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
  882. if test "$OS_ARCH" = "Darwin"; then
  883. DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/bin/XUL -L$(LIBXUL_DIST)/bin -lxpcom_core -lmozalloc'
  884. XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/bin -lmozalloc'
  885. LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)'
  886. else
  887. DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxul -lxpcom_core -lmozalloc'
  888. XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxul -L$(LIBXUL_DIST)/bin -lmozalloc'
  889. LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)'
  890. fi
  891. XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
  892. XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
  893. MOZ_FS_LAYOUT=unix
  894. MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
  895. USE_DEPENDENT_LIBS=1
  896. #######################################################################
  897. # Master "Core Components" macros for getting the OS target #
  898. #######################################################################
  899. #
  900. # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
  901. # cross-compilation.
  902. #
  903. #
  904. # Define and override various archtecture-specific variables, including
  905. # HOST_OS_ARCH
  906. # OS_ARCH
  907. # OS_TEST
  908. # OS_TARGET
  909. # OS_RELEASE
  910. # OS_MINOR_RELEASE
  911. #
  912. case "$HOST_OS_ARCH" in
  913. cygwin*|mingw*|mks*|msvc*)
  914. HOST_OS_ARCH=WINNT
  915. ;;
  916. linux*)
  917. HOST_OS_ARCH=Linux
  918. ;;
  919. solaris*)
  920. HOST_OS_ARCH=SunOS
  921. SOLARIS_SUNPRO_CC=
  922. SOLARIS_SUNPRO_CXX=
  923. if test -z "$GNU_CC"; then
  924. if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
  925. SOLARIS_SUNPRO_CC=1
  926. fi
  927. fi
  928. if test -z "$GNU_CXX"; then
  929. if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
  930. SOLARIS_SUNPRO_CXX=1
  931. fi
  932. fi
  933. AC_SUBST(SOLARIS_SUNPRO_CC)
  934. AC_SUBST(SOLARIS_SUNPRO_CXX)
  935. ;;
  936. BSD_386)
  937. HOST_OS_ARCH=BSD
  938. ;;
  939. dgux)
  940. HOST_OS_ARCH=DGUX
  941. ;;
  942. IRIX64)
  943. HOST_OS_ARCH=IRIX
  944. ;;
  945. UNIX_SV)
  946. if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
  947. HOST_OS_ARCH=NCR
  948. else
  949. HOST_OS_ARCH=UNIXWARE
  950. fi
  951. ;;
  952. ncr)
  953. HOST_OS_ARCH=NCR
  954. ;;
  955. UNIX_SYSTEM_V)
  956. HOST_OS_ARCH=NEC
  957. ;;
  958. OSF1)
  959. ;;
  960. *OpenVMS*)
  961. HOST_OS_ARCH=OpenVMS
  962. ;;
  963. OS_2)
  964. HOST_OS_ARCH=OS2
  965. ;;
  966. QNX)
  967. ;;
  968. SCO_SV)
  969. HOST_OS_ARCH=SCOOS
  970. ;;
  971. SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
  972. HOST_OS_ARCH=SINIX
  973. ;;
  974. UnixWare)
  975. HOST_OS_ARCH=UNIXWARE
  976. ;;
  977. esac
  978. case "$OS_ARCH" in
  979. WINNT)
  980. OS_TEST=`uname -p`
  981. ;;
  982. Windows_NT)
  983. #
  984. # If uname -s returns "Windows_NT", we assume that we are using
  985. # the uname.exe in MKS toolkit.
  986. #
  987. # The -r option of MKS uname only returns the major version number.
  988. # So we need to use its -v option to get the minor version number.
  989. # Moreover, it doesn't have the -p option, so we need to use uname -m.
  990. #
  991. OS_ARCH=WINNT
  992. OS_TARGET=WINNT
  993. OS_MINOR_RELEASE=`uname -v`
  994. if test "$OS_MINOR_RELEASE" = "00"; then
  995. OS_MINOR_RELEASE=0
  996. fi
  997. OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
  998. ;;
  999. CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
  1000. #
  1001. # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
  1002. # the uname.exe in the Cygwin tools.
  1003. # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
  1004. # If uname -s returns "CYGWIN32/NT", we assume that we are using
  1005. # the uname.exe in the GNU-Win32 tools.
  1006. # If uname -s returns MINGW32_NT-5.1, we assume that we are using
  1007. # the uname.exe in the MSYS tools.
  1008. #
  1009. OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
  1010. OS_ARCH=WINNT
  1011. OS_TARGET=WINNT
  1012. ;;
  1013. AIX)
  1014. OS_RELEASE=`uname -v`.`uname -r`
  1015. OS_TEST=${target_cpu}
  1016. ;;
  1017. BSD_386)
  1018. OS_ARCH=BSD
  1019. ;;
  1020. dgux)
  1021. OS_ARCH=DGUX
  1022. ;;
  1023. IRIX64)
  1024. OS_ARCH=IRIX
  1025. ;;
  1026. UNIX_SV)
  1027. if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
  1028. OS_ARCH=NCR
  1029. else
  1030. OS_ARCH=UNIXWARE
  1031. OS_RELEASE=`uname -v`
  1032. fi
  1033. ;;
  1034. ncr)
  1035. OS_ARCH=NCR
  1036. ;;
  1037. UNIX_SYSTEM_V)
  1038. OS_ARCH=NEC
  1039. ;;
  1040. OSF1)
  1041. case `uname -v` in
  1042. 148)
  1043. OS_RELEASE=V3.2C
  1044. ;;
  1045. 564)
  1046. OS_RELEASE=V4.0B
  1047. ;;
  1048. 878)
  1049. OS_RELEASE=V4.0D
  1050. ;;
  1051. esac
  1052. ;;
  1053. *OpenVMS*)
  1054. OS_ARCH=OpenVMS
  1055. OS_RELEASE=`uname -v`
  1056. OS_TEST=`uname -p`
  1057. ;;
  1058. OS_2)
  1059. OS_ARCH=OS2
  1060. OS_TARGET=OS2
  1061. OS_RELEASE=`uname -v`
  1062. ;;
  1063. QNX)
  1064. if test "$OS_TARGET" != "NTO"; then
  1065. changequote(,)
  1066. OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
  1067. changequote([,])
  1068. fi
  1069. OS_TEST=x86
  1070. ;;
  1071. SCO_SV)
  1072. OS_ARCH=SCOOS
  1073. OS_RELEASE=5.0
  1074. ;;
  1075. SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
  1076. OS_ARCH=SINIX
  1077. OS_TEST=`uname -p`
  1078. ;;
  1079. UnixWare)
  1080. OS_ARCH=UNIXWARE
  1081. OS_RELEASE=`uname -v`
  1082. ;;
  1083. WINCE)
  1084. OS_ARCH=WINCE
  1085. OS_TARGET=WINCE
  1086. ;;
  1087. Darwin)
  1088. case "${target_cpu}" in
  1089. powerpc*)
  1090. OS_TEST=ppc
  1091. ;;
  1092. i*86*)
  1093. OS_TEST=i386
  1094. ;;
  1095. x86_64)
  1096. OS_TEST=x86_64
  1097. ;;
  1098. *)
  1099. if test -z "$CROSS_COMPILE" ; then
  1100. OS_TEST=`uname -p`
  1101. fi
  1102. ;;
  1103. esac
  1104. ;;
  1105. esac
  1106. if test "$OS_ARCH" = "NCR"; then
  1107. changequote(,)
  1108. OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
  1109. changequote([,])
  1110. fi
  1111. # Only set CPU_ARCH if we recognize the value of OS_TEST
  1112. case "$OS_TEST" in
  1113. *86 | i86pc)
  1114. CPU_ARCH=x86
  1115. ;;
  1116. powerpc* | ppc | rs6000)
  1117. CPU_ARCH=ppc
  1118. ;;
  1119. Alpha | alpha | ALPHA)
  1120. CPU_ARCH=Alpha
  1121. ;;
  1122. hppa* | parisc)
  1123. CPU_ARCH=hppa
  1124. ;;
  1125. sun4u | sparc*)
  1126. CPU_ARCH=sparc
  1127. ;;
  1128. x86_64 | ia64)
  1129. CPU_ARCH="$OS_TEST"
  1130. ;;
  1131. arm)
  1132. if test "$OS_TARGET" == "WINCE"; then
  1133. CPU_ARCH="$OS_TEST"
  1134. fi
  1135. ;;
  1136. esac
  1137. if test -z "$OS_TARGET"; then
  1138. OS_TARGET=$OS_ARCH
  1139. fi
  1140. OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
  1141. dnl ========================================================
  1142. dnl GNU specific defaults
  1143. dnl ========================================================
  1144. if test "$GNU_CC"; then
  1145. # FIXME: Let us build with strict aliasing. bug 414641.
  1146. CFLAGS="$CFLAGS -fno-strict-aliasing"
  1147. CXXFLAGS="$CXXFLAGS -fno-exceptions"
  1148. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
  1149. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
  1150. DSO_LDOPTS='-shared'
  1151. if test "$GCC_USE_GNU_LD"; then
  1152. # Don't allow undefined symbols in libraries
  1153. DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
  1154. fi
  1155. WARNINGS_AS_ERRORS='-Werror'
  1156. DSO_CFLAGS=''
  1157. DSO_PIC_CFLAGS='-fPIC'
  1158. ASFLAGS="$ASFLAGS -fPIC"
  1159. _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
  1160. _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
  1161. # Turn on GNU specific features
  1162. # -Wall - turn on all warnings
  1163. # -pedantic - make compiler warn about non-ANSI stuff, and
  1164. # be a little bit stricter
  1165. # Warnings slamm took out for now (these were giving more noise than help):
  1166. # -Wbad-function-cast - warns when casting a function to a new return type
  1167. # -Wshadow - removed because it generates more noise than help --pete
  1168. _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
  1169. if test -z "$INTEL_CC"; then
  1170. # Don't use -Wcast-align with ICC
  1171. case "$CPU_ARCH" in
  1172. # And don't use it on hppa, ia64, sparc, since it's noisy there
  1173. hppa | ia64 | sparc)
  1174. ;;
  1175. *)
  1176. _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
  1177. ;;
  1178. esac
  1179. fi
  1180. dnl Turn pedantic on but disable the warnings for long long
  1181. _PEDANTIC=1
  1182. if test -z "$INTEL_CC"; then
  1183. _IGNORE_LONG_LONG_WARNINGS=1
  1184. _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
  1185. else
  1186. _IGNORE_LONG_LONG_WARNINGS=
  1187. fi
  1188. _DEFINES_CFLAGS='-include $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT'
  1189. _USE_CPP_INCLUDE_FLAG=1
  1190. elif test "$SOLARIS_SUNPRO_CC"; then
  1191. MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
  1192. MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
  1193. DSO_LDOPTS='-shared'
  1194. if test "$GNU_LD"; then
  1195. # Don't allow undefined symbols in libraries
  1196. DSO_LDOPTS="$DSO_LDOPTS -z defs"
  1197. fi
  1198. DSO_CFLAGS=''
  1199. if test "$CPU_ARCH" = "sparc"; then
  1200. # for Sun Studio on Solaris/SPARC
  1201. DSO_PIC_CFLAGS='-xcode=pic32'
  1202. else
  1203. DSO_PIC_CFLAGS='-KPIC'
  1204. fi
  1205. _DEFINES_CFLAGS='$(ACDEFINES) -FI $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT'
  1206. else
  1207. MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
  1208. MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
  1209. DSO_LDOPTS='-shared'
  1210. if test "$GNU_LD"; then
  1211. # Don't allow undefined symbols in libraries
  1212. DSO_LDOPTS="$DSO_LDOPTS -z defs"
  1213. fi
  1214. DSO_CFLAGS=''
  1215. DSO_PIC_CFLAGS='-KPIC'
  1216. _DEFINES_CFLAGS='$(ACDEFINES) -FI $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT'
  1217. fi
  1218. if test "$GNU_CXX"; then
  1219. # FIXME: Let us build with strict aliasing. bug 414641.
  1220. CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
  1221. # Turn on GNU specific features
  1222. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
  1223. if test -z "$INTEL_CC"; then
  1224. # Don't use -Wcast-align with ICC
  1225. case "$CPU_ARCH" in
  1226. # And don't use it on hppa, ia64, sparc, since it's noisy there
  1227. hppa | ia64 | sparc)
  1228. ;;
  1229. *)
  1230. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
  1231. ;;
  1232. esac
  1233. fi
  1234. _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(LIBXUL_DIST)/include/mozilla-config.h'
  1235. _USE_CPP_INCLUDE_FLAG=1
  1236. AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
  1237. ac_has_wno_invalid_offsetof,
  1238. [
  1239. AC_LANG_SAVE
  1240. AC_LANG_CPLUSPLUS
  1241. _SAVE_CXXFLAGS="$CXXFLAGS"
  1242. CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
  1243. AC_TRY_COMPILE([],
  1244. [return(0);],
  1245. ac_has_wno_invalid_offsetof="yes",
  1246. ac_has_wno_invalid_offsetof="no")
  1247. CXXFLAGS="$_SAVE_CXXFLAGS"
  1248. AC_LANG_RESTORE
  1249. ])
  1250. if test "$ac_has_wno_invalid_offsetof" = "yes"; then
  1251. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
  1252. fi
  1253. else
  1254. _DEFINES_CXXFLAGS='-FI $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT $(ACDEFINES)'
  1255. fi
  1256. dnl gcc can come with its own linker so it is better to use the pass-thru calls
  1257. dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
  1258. dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
  1259. dnl normal behavior.
  1260. dnl ========================================================
  1261. MKSHLIB_FORCE_ALL=
  1262. MKSHLIB_UNFORCE_ALL=
  1263. if test "$GNU_CC"; then
  1264. AC_MSG_CHECKING(whether ld has archive extraction flags)
  1265. AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
  1266. [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
  1267. ac_cv_mkshlib_force_and_unforce="no"
  1268. exec 3<&0 <<LOOP_INPUT
  1269. force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
  1270. force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
  1271. force="-Wl,-all"; unforce="-Wl,-none"
  1272. LOOP_INPUT
  1273. while read line
  1274. do
  1275. eval $line
  1276. LDFLAGS=$force
  1277. LIBS=$unforce
  1278. AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
  1279. done
  1280. exec 0<&3 3<&-
  1281. LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
  1282. ])
  1283. if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
  1284. AC_MSG_RESULT(no)
  1285. else
  1286. AC_MSG_RESULT(yes)
  1287. eval $ac_cv_mkshlib_force_and_unforce
  1288. MKSHLIB_FORCE_ALL=$force
  1289. MKSHLIB_UNFORCE_ALL=$unforce
  1290. fi
  1291. fi # GNU_CC
  1292. dnl =================================================================
  1293. dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
  1294. dnl which is bad when cross compiling.
  1295. dnl =================================================================
  1296. configure_static_assert_macros='
  1297. #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
  1298. #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
  1299. #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
  1300. '
  1301. dnl test that the macros actually work:
  1302. AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
  1303. AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
  1304. [AC_LANG_SAVE
  1305. AC_LANG_C
  1306. ac_cv_static_assertion_macros_work="yes"
  1307. AC_TRY_COMPILE([$configure_static_assert_macros],
  1308. [CONFIGURE_STATIC_ASSERT(1)],
  1309. ,
  1310. ac_cv_static_assertion_macros_work="no")
  1311. AC_TRY_COMPILE([$configure_static_assert_macros],
  1312. [CONFIGURE_STATIC_ASSERT(0)],
  1313. ac_cv_static_assertion_macros_work="no",
  1314. )
  1315. AC_LANG_CPLUSPLUS
  1316. AC_TRY_COMPILE([$configure_static_assert_macros],
  1317. [CONFIGURE_STATIC_ASSERT(1)],
  1318. ,
  1319. ac_cv_static_assertion_macros_work="no")
  1320. AC_TRY_COMPILE([$configure_static_assert_macros],
  1321. [CONFIGURE_STATIC_ASSERT(0)],
  1322. ac_cv_static_assertion_macros_work="no",
  1323. )
  1324. AC_LANG_RESTORE
  1325. ])
  1326. AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
  1327. if test "$ac_cv_static_assertion_macros_work" = "no"; then
  1328. AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
  1329. fi
  1330. dnl ========================================================
  1331. dnl Checking for 64-bit OS
  1332. dnl ========================================================
  1333. AC_LANG_SAVE
  1334. AC_LANG_C
  1335. AC_MSG_CHECKING(for 64-bit OS)
  1336. AC_TRY_COMPILE([$configure_static_assert_macros],
  1337. [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
  1338. result="yes", result="no")
  1339. AC_MSG_RESULT("$result")
  1340. if test "$result" = "yes"; then
  1341. AC_DEFINE(HAVE_64BIT_OS)
  1342. HAVE_64BIT_OS=1
  1343. fi
  1344. AC_SUBST(HAVE_64BIT_OS)
  1345. AC_LANG_RESTORE
  1346. dnl ========================================================
  1347. dnl Enable high-memory support on OS/2 by default.
  1348. dnl ========================================================
  1349. MOZ_OS2_HIGH_MEMORY=1
  1350. MOZ_ARG_DISABLE_BOOL(os2-high-mem,
  1351. [ --disable-os2-high-mem Disable high-memory support on OS/2],
  1352. MOZ_OS2_HIGH_MEMORY=,
  1353. MOZ_OS2_HIGH_MEMORY=1 )
  1354. AC_SUBST(MOZ_OS2_HIGH_MEMORY)
  1355. dnl ========================================================
  1356. dnl System overrides of the defaults for host
  1357. dnl ========================================================
  1358. case "$host" in
  1359. *-beos*)
  1360. HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
  1361. HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
  1362. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
  1363. ;;
  1364. *cygwin*|*mingw*|*mks*|*msvc*|*wince)
  1365. # we need Python 2.5 on Windows
  1366. PYTHON_VERSION=2.5
  1367. if test -n "$_WIN32_MSVC"; then
  1368. HOST_AR=lib
  1369. HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
  1370. HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
  1371. HOST_RANLIB='echo ranlib'
  1372. else
  1373. HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
  1374. fi
  1375. HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
  1376. HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
  1377. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
  1378. HOST_BIN_SUFFIX=.exe
  1379. case "$host" in
  1380. *cygwin*)
  1381. AC_MSG_ERROR([Building on cygwin is no longer supported, use MozillaBuild (MSYS)])
  1382. ;;
  1383. esac
  1384. ;;
  1385. *-darwin*)
  1386. HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
  1387. HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
  1388. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
  1389. MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
  1390. ;;
  1391. *-linux*|*-kfreebsd*-gnu)
  1392. HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
  1393. HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
  1394. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
  1395. ;;
  1396. *os2*)
  1397. HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
  1398. HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
  1399. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
  1400. HOST_BIN_SUFFIX=.exe
  1401. MOZ_FIX_LINK_PATHS=
  1402. ;;
  1403. *-osf*)
  1404. HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
  1405. HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
  1406. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
  1407. ;;
  1408. *)
  1409. HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
  1410. HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
  1411. ;;
  1412. esac
  1413. dnl We require version 2.4 or newer of Python to build,
  1414. dnl and 2.5 or newer on Windows.
  1415. AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
  1416. changequote(,)
  1417. $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
  1418. _python_res=$?
  1419. changequote([,])
  1420. if test "$_python_res" != 0; then
  1421. AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
  1422. fi
  1423. AC_MSG_RESULT([yes])
  1424. dnl ========================================================
  1425. dnl System overrides of the defaults for target
  1426. dnl ========================================================
  1427. case "$target" in
  1428. *-aix*)
  1429. AC_DEFINE(AIX)
  1430. if test ! "$GNU_CC"; then
  1431. if test ! "$HAVE_64BIT_OS"; then
  1432. # Compiling with Visual Age C++ object model compat is the
  1433. # default. To compile with object model ibm, add
  1434. # AIX_OBJMODEL=ibm to .mozconfig.
  1435. if test "$AIX_OBJMODEL" = "ibm"; then
  1436. CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
  1437. else
  1438. AIX_OBJMODEL=compat
  1439. fi
  1440. else
  1441. AIX_OBJMODEL=compat
  1442. fi
  1443. AC_SUBST(AIX_OBJMODEL)
  1444. DSO_LDOPTS='-qmkshrobj=1'
  1445. DSO_CFLAGS='-qflag=w:w'
  1446. DSO_PIC_CFLAGS=
  1447. LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
  1448. AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
  1449. MOZ_FIX_LINK_PATHS=
  1450. MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
  1451. MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1452. AC_LANG_SAVE
  1453. AC_LANG_CPLUSPLUS
  1454. AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
  1455. AC_TRY_COMPILE([],
  1456. [#if (__IBMCPP__ < 600)
  1457. #error "Bad compiler"
  1458. #endif],
  1459. _BAD_COMPILER=,_BAD_COMPILER=1)
  1460. if test -n "$_BAD_COMPILER"; then
  1461. AC_MSG_RESULT([no])
  1462. AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
  1463. else
  1464. AC_MSG_RESULT([yes])
  1465. fi
  1466. AC_LANG_RESTORE
  1467. TARGET_COMPILER_ABI="ibmc"
  1468. CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
  1469. CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
  1470. fi
  1471. case "${target_os}" in
  1472. aix4.1*)
  1473. DLL_SUFFIX='_shr.a'
  1474. ;;
  1475. esac
  1476. AC_CHECK_HEADERS(sys/inttypes.h)
  1477. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  1478. ;;
  1479. *-beos*)
  1480. no_x=yes
  1481. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
  1482. DSO_LDOPTS='-nostart'
  1483. TK_LIBS='-lbe -lroot'
  1484. LIBS="$LIBS -lbe"
  1485. AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
  1486. AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
  1487. _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
  1488. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
  1489. _MOZ_USE_RTTI=1
  1490. USE_DEPENDENT_LIBS=
  1491. MOZ_USER_DIR="Mozilla"
  1492. ;;
  1493. *-bsdi*)
  1494. dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
  1495. _PEDANTIC=
  1496. _IGNORE_LONG_LONG_WARNINGS=
  1497. case $OS_RELEASE in
  1498. 4.*|5.*)
  1499. STRIP="$STRIP -d"
  1500. ;;
  1501. *)
  1502. DSO_CFLAGS=''
  1503. DSO_LDOPTS='-r'
  1504. _WARNINGS_CFLAGS="-Wall"
  1505. _WARNINGS_CXXFLAGS="-Wall"
  1506. # The test above doesn't work properly, at least on 3.1.
  1507. MKSHLIB_FORCE_ALL=''
  1508. MKSHLIB_UNFORCE_ALL=''
  1509. ;;
  1510. esac
  1511. ;;
  1512. *-darwin*)
  1513. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1514. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1515. MOZ_OPTIMIZE_FLAGS="-O3"
  1516. _PEDANTIC=
  1517. CFLAGS="$CFLAGS -fpascal-strings -fno-common"
  1518. CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
  1519. DLL_SUFFIX=".dylib"
  1520. DSO_LDOPTS=''
  1521. STRIP="$STRIP -x -S"
  1522. MOZ_ENABLE_POSTSCRIPT=
  1523. TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
  1524. # The ExceptionHandling framework is needed for Objective-C exception
  1525. # logging code in nsObjCExceptions.h. Currently we only use that in debug
  1526. # builds.
  1527. MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
  1528. dnl DTrace and -dead_strip don't interact well. See bug 403132.
  1529. dnl ===================================================================
  1530. if test "x$enable_dtrace" = "xyes"; then
  1531. echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
  1532. else
  1533. dnl check for the presence of the -dead_strip linker flag
  1534. AC_MSG_CHECKING([for -dead_strip option to ld])
  1535. _SAVE_LDFLAGS=$LDFLAGS
  1536. LDFLAGS="$LDFLAGS -Wl,-dead_strip"
  1537. AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
  1538. if test -n "$_HAVE_DEAD_STRIP" ; then
  1539. AC_MSG_RESULT([yes])
  1540. MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
  1541. else
  1542. AC_MSG_RESULT([no])
  1543. fi
  1544. LDFLAGS=$_SAVE_LDFLAGS
  1545. fi
  1546. ;;
  1547. *-freebsd*)
  1548. if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
  1549. DLL_SUFFIX=".so.1.0"
  1550. DSO_LDOPTS="-shared"
  1551. fi
  1552. if test ! "$GNU_CC"; then
  1553. DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
  1554. fi
  1555. # Can't have force w/o an unforce.
  1556. # # Hack for FreeBSD 2.2
  1557. # if test -z "$MKSHLIB_FORCE_ALL"; then
  1558. # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
  1559. # MKSHLIB_UNFORCE_ALL=''
  1560. # fi
  1561. ;;
  1562. *-hpux*)
  1563. DLL_SUFFIX=".sl"
  1564. if test ! "$GNU_CC"; then
  1565. DSO_LDOPTS='-b -Wl,+s'
  1566. DSO_CFLAGS=""
  1567. DSO_PIC_CFLAGS="+Z"
  1568. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
  1569. MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
  1570. CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
  1571. else
  1572. DSO_LDOPTS='-b -E +s'
  1573. MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
  1574. MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
  1575. fi
  1576. MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
  1577. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  1578. ;;
  1579. *-irix5*)
  1580. AC_DEFINE(IRIX)
  1581. DSO_LDOPTS='-elf -shared'
  1582. if test "$GNU_CC"; then
  1583. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1584. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1585. MKSHLIB_FORCE_ALL='-Wl,-all'
  1586. MKSHLIB_UNFORCE_ALL='-Wl,-none'
  1587. CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
  1588. else
  1589. MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
  1590. MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
  1591. MKSHLIB_FORCE_ALL='-all'
  1592. MKSHLIB_UNFORCE_ALL='-none'
  1593. fi
  1594. ;;
  1595. *-irix6*)
  1596. AC_DEFINE(IRIX)
  1597. dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
  1598. dnl compile and link using -n32
  1599. USE_N32=1
  1600. TARGET_COMPILER_ABI=n32
  1601. DSO_LDOPTS='-elf -shared'
  1602. MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1603. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1604. if test "$GNU_CC"; then
  1605. MKSHLIB_FORCE_ALL='-Wl,-all'
  1606. MKSHLIB_UNFORCE_ALL='-Wl,-none'
  1607. _WARNINGS_CFLAGS="-Wall"
  1608. _WARNINGS_CXXFLAGS="-Wall"
  1609. CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
  1610. else
  1611. MKSHLIB_FORCE_ALL='-all'
  1612. MKSHLIB_UNFORCE_ALL='-none'
  1613. AR_LIST="$AR t"
  1614. AR_EXTRACT="$AR x"
  1615. AR_DELETE="$AR d"
  1616. AR='$(CXX) -ar'
  1617. AR_FLAGS='-o $@'
  1618. CFLAGS="$CFLAGS -woff 3262 -G 4"
  1619. CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
  1620. if test -n "$USE_N32"; then
  1621. ASFLAGS="$ASFLAGS -n32"
  1622. CFLAGS="$CFLAGS -n32"
  1623. CXXFLAGS="$CXXFLAGS -n32"
  1624. LDFLAGS="$LDFLAGS -n32"
  1625. fi
  1626. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  1627. AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
  1628. MOZ_FIX_LINK_PATHS=
  1629. fi
  1630. if test -z "$GNU_CXX"; then
  1631. MIPSPRO_CXX=1
  1632. fi
  1633. ;;
  1634. *-*linux*)
  1635. # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
  1636. # Similarly for GNU_CXX and INTEL_CXX.
  1637. if test "$INTEL_CC" || test "$INTEL_CXX"; then
  1638. # -Os has been broken on Intel's C/C++ compilers for quite a
  1639. # while; Intel recommends against using it.
  1640. MOZ_OPTIMIZE_FLAGS="-O2"
  1641. MOZ_DEBUG_FLAGS="-g -fno-inline"
  1642. elif test "$GNU_CC" || test "$GNU_CXX"; then
  1643. GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
  1644. case $GCC_VERSION in
  1645. 4.1.*|4.2.*)
  1646. # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
  1647. MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
  1648. esac
  1649. MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
  1650. MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
  1651. # and that combo is not yet good at
  1652. # debugging inlined functions (even
  1653. # when using DWARF2 as the debugging
  1654. # format)
  1655. fi
  1656. TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
  1657. MOZ_MEMORY=1
  1658. case "${target_cpu}" in
  1659. alpha*)
  1660. CFLAGS="$CFLAGS -mieee"
  1661. CXXFLAGS="$CXXFLAGS -mieee"
  1662. ;;
  1663. i*86)
  1664. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
  1665. ;;
  1666. mips*)
  1667. MOZ_DEBUG_FLAGS="-g" # We want inlining
  1668. ;;
  1669. esac
  1670. ;;
  1671. *-wince*)
  1672. TARGET_COMPILER_ABI=msvc
  1673. MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
  1674. AR_LIST="$AR -list"
  1675. AR_EXTRACT="$AR -extract"
  1676. AR_DELETE="$AR d"
  1677. AR_FLAGS='-OUT:"$@"'
  1678. if test "$AS_BIN"; then
  1679. AS="$AS_BIN"
  1680. fi
  1681. DSO_CFLAGS=
  1682. DSO_PIC_CFLAGS=
  1683. DLL_SUFFIX=.dll
  1684. BIN_SUFFIX='.exe'
  1685. if test -z "$RC"; then
  1686. RC=rc.exe
  1687. fi
  1688. # certain versions of cygwin's makedepend barf on the
  1689. # #include <string> vs -I./dist/include/string issue so don't use it
  1690. SYSTEM_MAKEDEPEND=
  1691. HOST_CC=cl
  1692. HOST_CXX=cl
  1693. HOST_LD=link
  1694. HOST_AR='lib -OUT:$@'
  1695. HOST_RANLIB='echo ranlib'
  1696. HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
  1697. WARNINGS_AS_ERRORS='-WX'
  1698. MOZ_OPTIMIZE_FLAGS='-Ox'
  1699. AR_FLAGS='-NOLOGO -OUT:"$@"'
  1700. ASM_SUFFIX=asm
  1701. CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
  1702. CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
  1703. DLL_PREFIX=
  1704. DOXYGEN=:
  1705. DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
  1706. DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
  1707. GARBAGE=
  1708. IMPORT_LIB_SUFFIX=lib
  1709. LIBS="$LIBS"
  1710. LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
  1711. LIB_PREFIX=
  1712. LIB_SUFFIX=lib
  1713. MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
  1714. MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
  1715. MKSHLIB_FORCE_ALL=
  1716. MKSHLIB_UNFORCE_ALL=
  1717. MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
  1718. MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
  1719. MOZ_DEBUG_FLAGS='-Zi'
  1720. MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
  1721. MOZ_FIX_LINK_PATHS=
  1722. MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
  1723. OBJ_SUFFIX=obj
  1724. RANLIB='echo not_ranlib'
  1725. STRIP='echo not_strip'
  1726. TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
  1727. UNZIP=unzip
  1728. XARGS=xargs
  1729. XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
  1730. ZIP=zip
  1731. MOZ_TREE_FREETYPE=1
  1732. AC_DEFINE(HAVE_SNPRINTF)
  1733. AC_DEFINE(_WINDOWS)
  1734. AC_DEFINE(_WIN32)
  1735. AC_DEFINE(WIN32)
  1736. AC_DEFINE(XP_WIN)
  1737. AC_DEFINE(XP_WIN32)
  1738. AC_DEFINE(HW_THREADS)
  1739. AC_DEFINE(STDC_HEADERS)
  1740. AC_DEFINE(NEW_H, <new>)
  1741. AC_DEFINE(WIN32_LEAN_AND_MEAN)
  1742. AC_DEFINE(HAVE_LOCALTIME_R)
  1743. TARGET_MD_ARCH=win32
  1744. BIN_SUFFIX='.exe'
  1745. USE_SHORT_LIBNAME=1
  1746. MOZ_ENABLE_POSTSCRIPT=
  1747. MOZ_USER_DIR="Mozilla"
  1748. # Sanity check for WINCE_WINDOWS_MOBILE
  1749. # XXX disabled until we can fix the mobile tinderbox
  1750. ##if test "$WINCE_WINDOWS_MOBILE"; then
  1751. ## AC_CHECK_HEADER(tpcshell.h, [],
  1752. ## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
  1753. ##fi
  1754. ;;
  1755. *-mingw*|*-cygwin*|*-msvc*|*-mks*)
  1756. DSO_CFLAGS=
  1757. DSO_PIC_CFLAGS=
  1758. DLL_SUFFIX=.dll
  1759. RC=rc.exe
  1760. # certain versions of cygwin's makedepend barf on the
  1761. # #include <string> vs -I./dist/include/string issue so don't use it
  1762. SYSTEM_MAKEDEPEND=
  1763. if test -n "$GNU_CC"; then
  1764. CC="$CC -mno-cygwin"
  1765. CXX="$CXX -mno-cygwin"
  1766. CPP="$CPP -mno-cygwin"
  1767. CFLAGS="$CFLAGS -mms-bitfields"
  1768. CXXFLAGS="$CXXFLAGS -mms-bitfields"
  1769. DSO_LDOPTS='-shared'
  1770. MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
  1771. MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
  1772. RC='$(WINDRES)'
  1773. # Use temp file for windres (bug 213281)
  1774. RCFLAGS='-O coff --use-temp-file'
  1775. # mingw doesn't require kernel32, user32, and advapi32 explicitly
  1776. LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
  1777. MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
  1778. MOZ_FIX_LINK_PATHS=
  1779. DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxul -lxpcom_core -lmozalloc'
  1780. XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxul -L$(LIBXUL_DIST)/lib -lmozalloc'
  1781. DLL_PREFIX=
  1782. IMPORT_LIB_SUFFIX=dll.a
  1783. else
  1784. TARGET_COMPILER_ABI=msvc
  1785. HOST_CC='$(CC)'
  1786. HOST_CXX='$(CXX)'
  1787. HOST_LD='$(LD)'
  1788. AR='lib -NOLOGO -OUT:"$@"'
  1789. AR_FLAGS=
  1790. RANLIB='echo not_ranlib'
  1791. STRIP='echo not_strip'
  1792. XARGS=xargs
  1793. ZIP=zip
  1794. UNZIP=unzip
  1795. DOXYGEN=:
  1796. GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
  1797. OBJ_SUFFIX=obj
  1798. LIB_SUFFIX=lib
  1799. DLL_PREFIX=
  1800. LIB_PREFIX=
  1801. IMPORT_LIB_SUFFIX=lib
  1802. MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
  1803. MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
  1804. MKSHLIB_FORCE_ALL=
  1805. MKSHLIB_UNFORCE_ALL=
  1806. DSO_LDOPTS='-SUBSYSTEM:WINDOWS -DEBUG'
  1807. CFLAGS="$CFLAGS -Zi -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
  1808. CXXFLAGS="$CXXFLAGS -Zi -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
  1809. LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
  1810. MOZ_DEBUG_FLAGS='-Zi'
  1811. MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
  1812. WARNINGS_AS_ERRORS='-WX'
  1813. MOZ_OPTIMIZE_FLAGS='-O1'
  1814. MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
  1815. MOZ_FIX_LINK_PATHS=
  1816. DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
  1817. XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
  1818. LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
  1819. MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
  1820. if test $_MSC_VER -ge 1400; then
  1821. LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
  1822. dnl For profile-guided optimization
  1823. PROFILE_GEN_CFLAGS="-GL"
  1824. PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
  1825. dnl XXX: PGO builds can fail with warnings treated as errors,
  1826. dnl specifically "no profile data available" appears to be
  1827. dnl treated as an error sometimes. This might be a consequence
  1828. dnl of using WARNINGS_AS_ERRORS in some modules, combined
  1829. dnl with the linker doing most of the work in the whole-program
  1830. dnl optimization/PGO case. I think it's probably a compiler bug,
  1831. dnl but we work around it here.
  1832. PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
  1833. dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
  1834. dnl Probably also a compiler bug, but what can you do?
  1835. PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
  1836. if test -n "$_USE_DYNAMICBASE"; then
  1837. LDFLAGS="$LDFLAGS -DYNAMICBASE"
  1838. fi
  1839. fi
  1840. fi
  1841. AC_DEFINE(HAVE_SNPRINTF)
  1842. AC_DEFINE(_WINDOWS)
  1843. AC_DEFINE(_WIN32)
  1844. AC_DEFINE(WIN32)
  1845. AC_DEFINE(XP_WIN)
  1846. AC_DEFINE(XP_WIN32)
  1847. AC_DEFINE(HW_THREADS)
  1848. AC_DEFINE(STDC_HEADERS)
  1849. AC_DEFINE(NEW_H, <new>)
  1850. AC_DEFINE(WIN32_LEAN_AND_MEAN)
  1851. TARGET_MD_ARCH=win32
  1852. BIN_SUFFIX='.exe'
  1853. USE_SHORT_LIBNAME=1
  1854. MOZ_ENABLE_POSTSCRIPT=
  1855. MOZ_USER_DIR="Mozilla"
  1856. dnl Hardcode to win95 for now - cls
  1857. TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
  1858. dnl set NO_X11 defines here as the general check is skipped on win32
  1859. no_x=yes
  1860. AC_DEFINE(NO_X11)
  1861. dnl MinGW/MSYS doesn't provide or need cygpath
  1862. case "$host" in
  1863. *-mingw*)
  1864. CYGPATH_W=echo
  1865. CYGPATH_S=cat
  1866. MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
  1867. ;;
  1868. *-cygwin*|*-msvc*|*-mks*)
  1869. CYGPATH_W="cygpath -a -w"
  1870. CYGPATH_S="sed -e s|\\\\|/|g"
  1871. MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
  1872. ;;
  1873. esac
  1874. case "$host" in
  1875. *-mingw*|*-cygwin*|*-msvc*|*-mks*)
  1876. if test -z "$MOZ_TOOLS"; then
  1877. AC_MSG_ERROR([MOZ_TOOLS is not set])
  1878. fi
  1879. MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
  1880. if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
  1881. AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
  1882. fi
  1883. MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
  1884. if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
  1885. AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
  1886. fi
  1887. MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
  1888. ;;
  1889. *) # else cross-compiling
  1890. ;;
  1891. esac
  1892. case "$host_os" in
  1893. cygwin*|msvc*|mks*)
  1894. AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
  1895. ;;
  1896. *)
  1897. AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
  1898. AC_LANG_SAVE
  1899. AC_LANG_CPLUSPLUS
  1900. AC_CHECK_HEADERS(atlbase.h wpcapi.h)
  1901. AC_LANG_RESTORE
  1902. ;;
  1903. esac
  1904. case "$target" in
  1905. i*86-*)
  1906. AC_DEFINE(_X86_)
  1907. ;;
  1908. alpha-*)
  1909. AC_DEFINE(_ALPHA_)
  1910. ;;
  1911. mips-*)
  1912. AC_DEFINE(_MIPS_)
  1913. ;;
  1914. *)
  1915. AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
  1916. ;;
  1917. esac
  1918. ;;
  1919. *-netbsd*)
  1920. DSO_CFLAGS=''
  1921. CFLAGS="$CFLAGS -Dunix"
  1922. CXXFLAGS="$CXXFLAGS -Dunix"
  1923. if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
  1924. DLL_SUFFIX=".so"
  1925. DSO_PIC_CFLAGS='-fPIC -DPIC'
  1926. DSO_LDOPTS='-shared'
  1927. BIN_FLAGS='-Wl,--export-dynamic'
  1928. else
  1929. DSO_PIC_CFLAGS='-fPIC -DPIC'
  1930. DLL_SUFFIX=".so.1.0"
  1931. DSO_LDOPTS='-shared'
  1932. fi
  1933. # This will fail on a.out systems prior to 1.5.1_ALPHA.
  1934. MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
  1935. MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
  1936. if test "$LIBRUNPATH"; then
  1937. DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
  1938. fi
  1939. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
  1940. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
  1941. ;;
  1942. *-nto*)
  1943. AC_DEFINE(NTO)
  1944. AC_DEFINE(_QNX_SOURCE)
  1945. AC_DEFINE(_i386)
  1946. OS_TARGET=NTO
  1947. WARNINGS_AS_ERRORS=''
  1948. MOZ_OPTIMIZE_FLAGS="-O"
  1949. MOZ_DEBUG_FLAGS="-gstabs"
  1950. _PEDANTIC=
  1951. LIBS="$LIBS -lsocket -lstdc++"
  1952. _DEFINES_CFLAGS='-Wp,-include -Wp,$(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
  1953. _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(LIBXUL_DIST)/include/mozilla-config.h -D_POSIX_C_SOURCE=199506'
  1954. if test "$with_x" != "yes"
  1955. then
  1956. TK_CFLAGS='-I/usr/include/photon'
  1957. TK_LIBS='-lph'
  1958. fi
  1959. case "${target_cpu}" in
  1960. ppc*)
  1961. AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
  1962. ;;
  1963. esac
  1964. case "${host_cpu}" in
  1965. i*86)
  1966. USE_ELF_DYNSTR_GC=1
  1967. ;;
  1968. esac
  1969. ;;
  1970. *-openbsd*)
  1971. DLL_SUFFIX=".so.1.0"
  1972. DSO_CFLAGS=''
  1973. DSO_PIC_CFLAGS='-fPIC'
  1974. DSO_LDOPTS='-shared -fPIC'
  1975. if test "$LIBRUNPATH"; then
  1976. DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
  1977. fi
  1978. ;;
  1979. *-openvms*)
  1980. AC_DEFINE(NO_PW_GECOS)
  1981. AC_DEFINE(NO_UDSOCK)
  1982. AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
  1983. MKSHLIB_FORCE_ALL='-all'
  1984. MKSHLIB_UNFORCE_ALL='-none'
  1985. AS='as'
  1986. AS_DASH_C_FLAG='-Wc/names=as_is'
  1987. AR_FLAGS='c $@'
  1988. DSO_LDOPTS='-shared -auto_symvec'
  1989. DSO_PIC_CFLAGS=
  1990. MOZ_DEBUG_LDFLAGS='-g'
  1991. COMPAQ_CXX=1
  1992. CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
  1993. CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
  1994. ;;
  1995. *-os2*)
  1996. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1997. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
  1998. AC_DEFINE(OS2)
  1999. AC_DEFINE(XP_OS2)
  2000. AC_DEFINE(OS2EMX_PLAIN_CHAR)
  2001. AC_DEFINE(TCPV40HDRS)
  2002. USE_SHORT_LIBNAME=1
  2003. DLL_PREFIX=
  2004. LIB_PREFIX=
  2005. LIB_SUFFIX=lib
  2006. BIN_SUFFIX=".exe"
  2007. DLL_SUFFIX=".dll"
  2008. IMPORT_LIB_SUFFIX=lib
  2009. DSO_PIC_CFLAGS=
  2010. AR=emxomfar
  2011. AR_FLAGS='r $@'
  2012. CFLAGS="$CFLAGS -Zomf"
  2013. CXXFLAGS="$CXXFLAGS -Zomf"
  2014. DSO_LDOPTS='-Zdll'
  2015. BIN_FLAGS='-Zlinker /ST:0x100000'
  2016. IMPLIB='emximp -o'
  2017. FILTER='emxexp -o'
  2018. LDFLAGS='-Zmap'
  2019. WARNINGS_AS_ERRORS='-Werror'
  2020. MOZ_DEBUG_FLAGS="-g -fno-inline"
  2021. MOZ_OPTIMIZE_FLAGS="-O2"
  2022. MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
  2023. DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
  2024. LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
  2025. TARGET_MD_ARCH=os2
  2026. MOZ_ENABLE_POSTSCRIPT=
  2027. RC=rc.exe
  2028. RCFLAGS='-n'
  2029. MOZ_USER_DIR="Mozilla"
  2030. if test "$MOZTOOLS"; then
  2031. MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
  2032. else
  2033. AC_MSG_ERROR([MOZTOOLS is not set])
  2034. fi
  2035. if test -n "$MOZ_OS2_HIGH_MEMORY"; then
  2036. DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
  2037. LDFLAGS="$LDFLAGS -Zhigh-mem"
  2038. MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
  2039. AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
  2040. fi
  2041. # GCC for OS/2 currently predefines these, but we don't want them
  2042. _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
  2043. _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
  2044. AC_CACHE_CHECK(for __declspec(dllexport),
  2045. ac_os2_declspec,
  2046. [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
  2047. [return 0;],
  2048. ac_os2_declspec="yes",
  2049. ac_os2_declspec="no")])
  2050. if test "$ac_os2_declspec" = "yes"; then
  2051. FILTER='true'
  2052. MOZ_OS2_USE_DECLSPEC='1'
  2053. fi
  2054. ;;
  2055. alpha*-*-osf*)
  2056. if test "$GNU_CC"; then
  2057. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
  2058. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
  2059. else
  2060. MOZ_DEBUG_FLAGS='-g'
  2061. ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
  2062. CFLAGS="$CFLAGS -ieee"
  2063. CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
  2064. DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
  2065. DSO_CFLAGS=
  2066. DSO_PIC_CFLAGS=
  2067. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
  2068. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
  2069. MKSHLIB_FORCE_ALL='-all'
  2070. MKSHLIB_UNFORCE_ALL='-none'
  2071. dnl Might fix the libxpcom.so breakage on this platform as well....
  2072. AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
  2073. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  2074. fi
  2075. if test -z "$GNU_CXX"; then
  2076. COMPAQ_CXX=1
  2077. fi
  2078. AC_DEFINE(NEED_USLEEP_PROTOTYPE)
  2079. ;;
  2080. *-qnx*)
  2081. DIRENT_INO=d_stat.st_ino
  2082. dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
  2083. AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
  2084. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  2085. dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
  2086. AC_DEFINE(STDC_HEADERS)
  2087. if test "$no_x" = "yes"; then
  2088. TK_CFLAGS='-I/usr/nto/include/photon'
  2089. TK_LIBS='-lphoton -lphrender'
  2090. fi
  2091. ;;
  2092. *-sco*)
  2093. AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
  2094. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  2095. CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
  2096. if test ! "$GNU_CC"; then
  2097. DSO_LDOPTS='-G'
  2098. fi
  2099. ;;
  2100. dnl the qsort routine under solaris is faulty
  2101. *-solaris*)
  2102. AC_DEFINE(SOLARIS)
  2103. TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
  2104. SYSTEM_MAKEDEPEND=
  2105. # $ORIGIN/.. is for shared libraries under components/ to locate shared
  2106. # libraries one level up (e.g. libnspr4.so)
  2107. LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
  2108. MOZ_MEMORY=1
  2109. if test "$SOLARIS_SUNPRO_CC"; then
  2110. LIBS="-lCrun -lCstd $LIBS"
  2111. NS_USE_NATIVE=1
  2112. MOZ_FIX_LINK_PATHS=
  2113. AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  2114. CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
  2115. CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
  2116. LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
  2117. if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
  2118. _SAVE_LDFLAGS=$LDFLAGS
  2119. LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
  2120. AC_TRY_LINK([#include <stdio.h>],
  2121. [printf("Hello World\n");],
  2122. ,
  2123. [LDFLAGS=$_SAVE_LDFLAGS])
  2124. fi
  2125. WARNINGS_AS_ERRORS='-Werror'
  2126. MOZ_OPTIMIZE_FLAGS="-xO4"
  2127. MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
  2128. MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
  2129. MKSHLIB_FORCE_ALL='-z allextract'
  2130. MKSHLIB_UNFORCE_ALL='-z defaultextract'
  2131. DSO_LDOPTS='-G -z muldefs'
  2132. AR_LIST="$AR t"
  2133. AR_EXTRACT="$AR x"
  2134. AR_DELETE="$AR d"
  2135. AR='$(CXX) -xar'
  2136. AR_FLAGS='-o $@'
  2137. AS='/usr/ccs/bin/as'
  2138. ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
  2139. AS_DASH_C_FLAG=''
  2140. TARGET_COMPILER_ABI="sunc"
  2141. CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
  2142. CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
  2143. AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
  2144. AC_LANG_SAVE
  2145. AC_LANG_CPLUSPLUS
  2146. AC_TRY_COMPILE([],
  2147. [#if (__SUNPRO_CC < 0x590)
  2148. #error "Denied"
  2149. #endif],
  2150. _BAD_COMPILER=,_BAD_COMPILER=1)
  2151. if test -n "$_BAD_COMPILER"; then
  2152. _res="no"
  2153. AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
  2154. else
  2155. _res="yes"
  2156. fi
  2157. AC_MSG_RESULT([$_res])
  2158. AC_LANG_RESTORE
  2159. else
  2160. ASFLAGS="$ASFLAGS -fPIC"
  2161. DSO_LDOPTS='-G'
  2162. _WARNINGS_CFLAGS=''
  2163. _WARNINGS_CXXFLAGS=''
  2164. if test "$OS_RELEASE" = "5.3"; then
  2165. AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
  2166. fi
  2167. fi
  2168. if test "$OS_RELEASE" = "5.5.1"; then
  2169. AC_DEFINE(NEED_USLEEP_PROTOTYPE)
  2170. fi
  2171. ;;
  2172. *-sunos*)
  2173. DSO_LDOPTS='-Bdynamic'
  2174. MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
  2175. MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
  2176. AC_DEFINE(SUNOS4)
  2177. AC_DEFINE(SPRINTF_RETURNS_STRING)
  2178. case "$(target_os)" in
  2179. sunos4.1*)
  2180. DLL_SUFFIX='.so.1.0'
  2181. ;;
  2182. esac
  2183. ;;
  2184. *-sysv4.2uw7*)
  2185. NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
  2186. ;;
  2187. *-os2*)
  2188. HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
  2189. ;;
  2190. esac
  2191. dnl Only one oddball right now (QNX), but this gives us flexibility
  2192. dnl if any other platforms need to override this in the future.
  2193. AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
  2194. dnl ========================================================
  2195. dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
  2196. dnl by now will not have any way to link most binaries (tests
  2197. dnl as well as viewer, apprunner, etc.), because some symbols
  2198. dnl will be left out of the "composite" .so's by ld as unneeded.
  2199. dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
  2200. dnl they can link in the static libs that provide the missing
  2201. dnl symbols.
  2202. dnl ========================================================
  2203. NO_LD_ARCHIVE_FLAGS=
  2204. if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
  2205. NO_LD_ARCHIVE_FLAGS=1
  2206. fi
  2207. case "$target" in
  2208. *-os2*)
  2209. NO_LD_ARCHIVE_FLAGS=
  2210. ;;
  2211. *-aix4.3*|*-aix5*)
  2212. NO_LD_ARCHIVE_FLAGS=
  2213. ;;
  2214. *-openvms*)
  2215. NO_LD_ARCHIVE_FLAGS=
  2216. ;;
  2217. *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
  2218. if test -z "$GNU_CC"; then
  2219. NO_LD_ARCHIVE_FLAGS=
  2220. fi
  2221. ;;
  2222. esac
  2223. AC_SUBST(NO_LD_ARCHIVE_FLAGS)
  2224. dnl ========================================================
  2225. dnl = Flags to strip unused symbols from .so components
  2226. dnl ========================================================
  2227. case "$target" in
  2228. *-linux*|*-kfreebsd*-gnu)
  2229. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
  2230. ;;
  2231. *-solaris*)
  2232. if test -z "$GNU_CC"; then
  2233. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
  2234. else
  2235. if test -z "$GCC_USE_GNU_LD"; then
  2236. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
  2237. else
  2238. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
  2239. fi
  2240. fi
  2241. ;;
  2242. *-nto*)
  2243. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
  2244. ;;
  2245. *-darwin*)
  2246. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
  2247. ;;
  2248. *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
  2249. if test -n "$GNU_CC"; then
  2250. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
  2251. fi
  2252. ;;
  2253. esac
  2254. if test -z "$SKIP_COMPILER_CHECKS"; then
  2255. dnl Checks for typedefs, structures, and compiler characteristics.
  2256. dnl ========================================================
  2257. AC_LANG_C
  2258. AC_HEADER_STDC
  2259. AC_C_CONST
  2260. AC_TYPE_MODE_T
  2261. AC_TYPE_OFF_T
  2262. AC_TYPE_PID_T
  2263. AC_TYPE_SIZE_T
  2264. AC_STRUCT_ST_BLKSIZE
  2265. AC_MSG_CHECKING(for siginfo_t)
  2266. AC_CACHE_VAL(ac_cv_siginfo_t,
  2267. [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
  2268. #include <signal.h>],
  2269. [siginfo_t* info;],
  2270. [ac_cv_siginfo_t=true],
  2271. [ac_cv_siginfo_t=false])])
  2272. if test "$ac_cv_siginfo_t" = true ; then
  2273. AC_DEFINE(HAVE_SIGINFO_T)
  2274. AC_MSG_RESULT(yes)
  2275. else
  2276. AC_MSG_RESULT(no)
  2277. fi
  2278. dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
  2279. dnl ========================================================
  2280. AC_MSG_CHECKING(for int16_t)
  2281. AC_CACHE_VAL(ac_cv_int16_t,
  2282. [AC_TRY_COMPILE([#include <stdio.h>
  2283. #include <sys/types.h>],
  2284. [int16_t foo = 0;],
  2285. [ac_cv_int16_t=true],
  2286. [ac_cv_int16_t=false])])
  2287. if test "$ac_cv_int16_t" = true ; then
  2288. AC_DEFINE(HAVE_INT16_T)
  2289. AC_MSG_RESULT(yes)
  2290. else
  2291. AC_MSG_RESULT(no)
  2292. fi
  2293. AC_MSG_CHECKING(for int32_t)
  2294. AC_CACHE_VAL(ac_cv_int32_t,
  2295. [AC_TRY_COMPILE([#include <stdio.h>
  2296. #include <sys/types.h>],
  2297. [int32_t foo = 0;],
  2298. [ac_cv_int32_t=true],
  2299. [ac_cv_int32_t=false])])
  2300. if test "$ac_cv_int32_t" = true ; then
  2301. AC_DEFINE(HAVE_INT32_T)
  2302. AC_MSG_RESULT(yes)
  2303. else
  2304. AC_MSG_RESULT(no)
  2305. fi
  2306. AC_MSG_CHECKING(for int64_t)
  2307. AC_CACHE_VAL(ac_cv_int64_t,
  2308. [AC_TRY_COMPILE([#include <stdio.h>
  2309. #include <sys/types.h>],
  2310. [int64_t foo = 0;],
  2311. [ac_cv_int64_t=true],
  2312. [ac_cv_int64_t=false])])
  2313. if test "$ac_cv_int64_t" = true ; then
  2314. AC_DEFINE(HAVE_INT64_T)
  2315. AC_MSG_RESULT(yes)
  2316. else
  2317. AC_MSG_RESULT(no)
  2318. fi
  2319. AC_MSG_CHECKING(for int64)
  2320. AC_CACHE_VAL(ac_cv_int64,
  2321. [AC_TRY_COMPILE([#include <stdio.h>
  2322. #include <sys/types.h>],
  2323. [int64 foo = 0;],
  2324. [ac_cv_int64=true],
  2325. [ac_cv_int64=false])])
  2326. if test "$ac_cv_int64" = true ; then
  2327. AC_DEFINE(HAVE_INT64)
  2328. AC_MSG_RESULT(yes)
  2329. else
  2330. AC_MSG_RESULT(no)
  2331. fi
  2332. AC_MSG_CHECKING(for uint)
  2333. AC_CACHE_VAL(ac_cv_uint,
  2334. [AC_TRY_COMPILE([#include <stdio.h>
  2335. #include <sys/types.h>],
  2336. [uint foo = 0;],
  2337. [ac_cv_uint=true],
  2338. [ac_cv_uint=false])])
  2339. if test "$ac_cv_uint" = true ; then
  2340. AC_DEFINE(HAVE_UINT)
  2341. AC_MSG_RESULT(yes)
  2342. else
  2343. AC_MSG_RESULT(no)
  2344. fi
  2345. AC_MSG_CHECKING(for uint_t)
  2346. AC_CACHE_VAL(ac_cv_uint_t,
  2347. [AC_TRY_COMPILE([#include <stdio.h>
  2348. #include <sys/types.h>],
  2349. [uint_t foo = 0;],
  2350. [ac_cv_uint_t=true],
  2351. [ac_cv_uint_t=false])])
  2352. if test "$ac_cv_uint_t" = true ; then
  2353. AC_DEFINE(HAVE_UINT_T)
  2354. AC_MSG_RESULT(yes)
  2355. else
  2356. AC_MSG_RESULT(no)
  2357. fi
  2358. AC_MSG_CHECKING(for uint16_t)
  2359. AC_CACHE_VAL(ac_cv_uint16_t,
  2360. [AC_TRY_COMPILE([#include <stdio.h>
  2361. #include <sys/types.h>],
  2362. [uint16_t foo = 0;],
  2363. [ac_cv_uint16_t=true],
  2364. [ac_cv_uint16_t=false])])
  2365. if test "$ac_cv_uint16_t" = true ; then
  2366. AC_DEFINE(HAVE_UINT16_T)
  2367. AC_MSG_RESULT(yes)
  2368. else
  2369. AC_MSG_RESULT(no)
  2370. fi
  2371. dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
  2372. dnl are defined when compiling C++ but not C. Since the result of this
  2373. dnl test is used only in C++, do it in C++.
  2374. AC_LANG_CPLUSPLUS
  2375. AC_MSG_CHECKING(for uname.domainname)
  2376. AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
  2377. [AC_TRY_COMPILE([#include <sys/utsname.h>],
  2378. [ struct utsname *res; char *domain;
  2379. (void)uname(res); if (res != 0) { domain = res->domainname; } ],
  2380. [ac_cv_have_uname_domainname_field=true],
  2381. [ac_cv_have_uname_domainname_field=false])])
  2382. if test "$ac_cv_have_uname_domainname_field" = "true"; then
  2383. AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
  2384. AC_MSG_RESULT(yes)
  2385. else
  2386. AC_MSG_RESULT(no)
  2387. fi
  2388. AC_MSG_CHECKING(for uname.__domainname)
  2389. AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
  2390. [AC_TRY_COMPILE([#include <sys/utsname.h>],
  2391. [ struct utsname *res; char *domain;
  2392. (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
  2393. [ac_cv_have_uname_us_domainname_field=true],
  2394. [ac_cv_have_uname_us_domainname_field=false])])
  2395. if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
  2396. AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
  2397. AC_MSG_RESULT(yes)
  2398. else
  2399. AC_MSG_RESULT(no)
  2400. fi
  2401. AC_LANG_C
  2402. dnl Check for .hidden assembler directive and visibility attribute.
  2403. dnl Borrowed from glibc configure.in
  2404. dnl ===============================================================
  2405. if test "$GNU_CC"; then
  2406. AC_CACHE_CHECK(for visibility(hidden) attribute,
  2407. ac_cv_visibility_hidden,
  2408. [cat > conftest.c <<EOF
  2409. int foo __attribute__ ((visibility ("hidden"))) = 1;
  2410. EOF
  2411. ac_cv_visibility_hidden=no
  2412. if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
  2413. if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
  2414. ac_cv_visibility_hidden=yes
  2415. fi
  2416. fi
  2417. rm -f conftest.[cs]
  2418. ])
  2419. if test "$ac_cv_visibility_hidden" = "yes"; then
  2420. AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
  2421. AC_CACHE_CHECK(for visibility(default) attribute,
  2422. ac_cv_visibility_default,
  2423. [cat > conftest.c <<EOF
  2424. int foo __attribute__ ((visibility ("default"))) = 1;
  2425. EOF
  2426. ac_cv_visibility_default=no
  2427. if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
  2428. if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
  2429. ac_cv_visibility_default=yes
  2430. fi
  2431. fi
  2432. rm -f conftest.[cs]
  2433. ])
  2434. if test "$ac_cv_visibility_default" = "yes"; then
  2435. AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
  2436. AC_CACHE_CHECK(for visibility pragma support,
  2437. ac_cv_visibility_pragma,
  2438. [cat > conftest.c <<EOF
  2439. #pragma GCC visibility push(hidden)
  2440. int foo_hidden = 1;
  2441. #pragma GCC visibility push(default)
  2442. int foo_default = 1;
  2443. EOF
  2444. ac_cv_visibility_pragma=no
  2445. if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
  2446. if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
  2447. if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
  2448. ac_cv_visibility_pragma=yes
  2449. fi
  2450. fi
  2451. fi
  2452. rm -f conftest.[cs]
  2453. ])
  2454. if test "$ac_cv_visibility_pragma" = "yes"; then
  2455. AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
  2456. ac_cv_have_visibility_class_bug,
  2457. [cat > conftest.c <<EOF
  2458. #pragma GCC visibility push(hidden)
  2459. struct __attribute__ ((visibility ("default"))) TestStruct {
  2460. static void Init();
  2461. };
  2462. __attribute__ ((visibility ("default"))) void TestFunc() {
  2463. TestStruct::Init();
  2464. }
  2465. EOF
  2466. ac_cv_have_visibility_class_bug=no
  2467. if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
  2468. ac_cv_have_visibility_class_bug=yes
  2469. else
  2470. if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
  2471. ac_cv_have_visibility_class_bug=yes
  2472. fi
  2473. fi
  2474. rm -rf conftest.{c,S}
  2475. ])
  2476. AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
  2477. ac_cv_have_visibility_builtin_bug,
  2478. [cat > conftest.c <<EOF
  2479. #pragma GCC visibility push(hidden)
  2480. #pragma GCC visibility push(default)
  2481. #include <string.h>
  2482. #pragma GCC visibility pop
  2483. __attribute__ ((visibility ("default"))) void Func() {
  2484. char c[[100]];
  2485. memset(c, 0, sizeof(c));
  2486. }
  2487. EOF
  2488. ac_cv_have_visibility_builtin_bug=no
  2489. if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
  2490. ac_cv_have_visibility_builtin_bug=yes
  2491. else
  2492. if test `grep -c "@PLT" conftest.S` = 0; then
  2493. ac_cv_visibility_builtin_bug=yes
  2494. fi
  2495. fi
  2496. rm -f conftest.{c,S}
  2497. ])
  2498. if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
  2499. "$ac_cv_have_visibility_class_bug" = "no"; then
  2500. VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
  2501. WRAP_SYSTEM_INCLUDES=1
  2502. else
  2503. VISIBILITY_FLAGS='-fvisibility=hidden'
  2504. fi # have visibility pragma bug
  2505. fi # have visibility pragma
  2506. fi # have visibility(default) attribute
  2507. fi # have visibility(hidden) attribute
  2508. fi # GNU_CC
  2509. # visibility hidden flag for Sun Studio on Solaris
  2510. if test "$SOLARIS_SUNPRO_CC"; then
  2511. VISIBILITY_FLAGS='-xldscope=hidden'
  2512. fi # Sun Studio on Solaris
  2513. AC_SUBST(WRAP_SYSTEM_INCLUDES)
  2514. AC_SUBST(VISIBILITY_FLAGS)
  2515. dnl Checks for header files.
  2516. dnl ========================================================
  2517. AC_HEADER_DIRENT
  2518. case "$target_os" in
  2519. freebsd*)
  2520. # for stuff like -lXshm
  2521. CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
  2522. ;;
  2523. esac
  2524. AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
  2525. AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
  2526. AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
  2527. AC_CHECK_HEADERS(malloc.h)
  2528. AC_CHECK_HEADERS(X11/XKBlib.h)
  2529. AC_CHECK_HEADERS(io.h)
  2530. dnl These are all the places some variant of statfs can be hiding.
  2531. AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
  2532. dnl Quota support
  2533. AC_CHECK_HEADERS(sys/quota.h)
  2534. dnl Try for MMX support
  2535. dnl NB - later gcc versions require -mmmx for this header to be successfully
  2536. dnl included (or another option which implies it, such as -march=pentium-mmx)
  2537. AC_CHECK_HEADERS(mmintrin.h)
  2538. dnl Check whether the compiler supports the new-style C++ standard
  2539. dnl library headers (i.e. <new>) or needs the old "new.h"
  2540. AC_LANG_CPLUSPLUS
  2541. NEW_H=new.h
  2542. AC_CHECK_HEADER(new, [NEW_H=new])
  2543. AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
  2544. AC_LANG_C
  2545. AC_ARG_ENABLE(dtrace,
  2546. [ --enable-dtrace build with dtrace support if available (default=no)],
  2547. [enable_dtrace="yes"],)
  2548. if test "x$enable_dtrace" = "xyes"; then
  2549. AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
  2550. if test -n "$HAVE_DTRACE"; then
  2551. AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
  2552. else
  2553. AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
  2554. fi
  2555. fi
  2556. AC_SUBST(HAVE_DTRACE)
  2557. case $target in
  2558. *-aix4.3*|*-aix5*)
  2559. ;;
  2560. *)
  2561. AC_CHECK_HEADERS(sys/cdefs.h)
  2562. ;;
  2563. esac
  2564. dnl Checks for libraries.
  2565. dnl ========================================================
  2566. case $target in
  2567. *-hpux11.*)
  2568. ;;
  2569. *)
  2570. AC_CHECK_LIB(c_r, gethostbyname_r)
  2571. ;;
  2572. esac
  2573. dnl We don't want to link with libdl even if it's present on OS X, since
  2574. dnl it's not used and not part of the default installation.
  2575. dnl The same goes for BeOS.
  2576. dnl We don't want to link against libm or libpthread on Darwin since
  2577. dnl they both are just symlinks to libSystem and explicitly linking
  2578. dnl against libSystem causes issues when debugging (see bug 299601).
  2579. case $target in
  2580. *-darwin*)
  2581. ;;
  2582. *-beos*)
  2583. ;;
  2584. *)
  2585. AC_CHECK_LIB(m, atan)
  2586. AC_CHECK_LIB(dl, dlopen,
  2587. AC_CHECK_HEADER(dlfcn.h,
  2588. LIBS="-ldl $LIBS"
  2589. AC_DEFINE(HAVE_LIBDL)))
  2590. ;;
  2591. esac
  2592. _SAVE_CFLAGS="$CFLAGS"
  2593. CFLAGS="$CFLAGS -D_GNU_SOURCE"
  2594. AC_CHECK_FUNCS(dladdr)
  2595. CFLAGS="$_SAVE_CFLAGS"
  2596. if test ! "$GNU_CXX"; then
  2597. case $target in
  2598. *-aix*)
  2599. AC_CHECK_LIB(C_r, demangle)
  2600. ;;
  2601. *)
  2602. AC_CHECK_LIB(C, demangle)
  2603. ;;
  2604. esac
  2605. fi
  2606. AC_CHECK_LIB(socket, socket)
  2607. dnl ========================================================
  2608. dnl See if mmap sees writes
  2609. dnl For cross compiling, just define it as no, which is a safe default
  2610. dnl ========================================================
  2611. AC_MSG_CHECKING(whether mmap() sees write()s)
  2612. changequote(,)
  2613. mmap_test_prog='
  2614. #include <stdlib.h>
  2615. #include <unistd.h>
  2616. #include <sys/mman.h>
  2617. #include <sys/types.h>
  2618. #include <sys/stat.h>
  2619. #include <fcntl.h>
  2620. char fname[] = "conftest.file";
  2621. char zbuff[1024]; /* Fractional page is probably worst case */
  2622. int main() {
  2623. char *map;
  2624. int fd;
  2625. int i;
  2626. unlink(fname);
  2627. fd = open(fname, O_RDWR | O_CREAT, 0660);
  2628. if(fd<0) return 1;
  2629. unlink(fname);
  2630. write(fd, zbuff, sizeof(zbuff));
  2631. lseek(fd, 0, SEEK_SET);
  2632. map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
  2633. if(map==(char*)-1) return 2;
  2634. for(i=0; fname[i]; i++) {
  2635. int rc = write(fd, &fname[i], 1);
  2636. if(map[i]!=fname[i]) return 4;
  2637. }
  2638. return 0;
  2639. }
  2640. '
  2641. changequote([,])
  2642. AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
  2643. AC_MSG_RESULT("$result")
  2644. if test "$result" = "no"; then
  2645. AC_DEFINE(MMAP_MISSES_WRITES)
  2646. fi
  2647. dnl Checks for library functions.
  2648. dnl ========================================================
  2649. AC_PROG_GCC_TRADITIONAL
  2650. AC_FUNC_MEMCMP
  2651. AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
  2652. AC_CHECK_FUNCS(flockfile getpagesize)
  2653. AC_CHECK_FUNCS(localtime_r strtok_r)
  2654. dnl check for wcrtomb/mbrtowc
  2655. dnl =======================================================================
  2656. if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
  2657. AC_LANG_SAVE
  2658. AC_LANG_CPLUSPLUS
  2659. AC_CACHE_CHECK(for wcrtomb,
  2660. ac_cv_have_wcrtomb,
  2661. [AC_TRY_LINK([#include <wchar.h>],
  2662. [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
  2663. ac_cv_have_wcrtomb="yes",
  2664. ac_cv_have_wcrtomb="no")])
  2665. if test "$ac_cv_have_wcrtomb" = "yes"; then
  2666. AC_DEFINE(HAVE_WCRTOMB)
  2667. fi
  2668. AC_CACHE_CHECK(for mbrtowc,
  2669. ac_cv_have_mbrtowc,
  2670. [AC_TRY_LINK([#include <wchar.h>],
  2671. [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
  2672. ac_cv_have_mbrtowc="yes",
  2673. ac_cv_have_mbrtowc="no")])
  2674. if test "$ac_cv_have_mbrtowc" = "yes"; then
  2675. AC_DEFINE(HAVE_MBRTOWC)
  2676. fi
  2677. AC_LANG_RESTORE
  2678. fi
  2679. AC_CACHE_CHECK(
  2680. [for res_ninit()],
  2681. ac_cv_func_res_ninit,
  2682. [AC_TRY_LINK([
  2683. #ifdef linux
  2684. #define _BSD_SOURCE 1
  2685. #endif
  2686. #include <resolv.h>
  2687. ],
  2688. [int foo = res_ninit(&_res);],
  2689. [ac_cv_func_res_ninit=yes],
  2690. [ac_cv_func_res_ninit=no])
  2691. ])
  2692. if test "$ac_cv_func_res_ninit" = "yes"; then
  2693. AC_DEFINE(HAVE_RES_NINIT)
  2694. dnl must add the link line we do something as foolish as this... dougt
  2695. dnl else
  2696. dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
  2697. dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
  2698. fi
  2699. AC_LANG_CPLUSPLUS
  2700. AC_CACHE_CHECK(
  2701. [for gnu_get_libc_version()],
  2702. ac_cv_func_gnu_get_libc_version,
  2703. [AC_TRY_LINK([
  2704. #ifdef HAVE_GNU_LIBC_VERSION_H
  2705. #include <gnu/libc-version.h>
  2706. #endif
  2707. ],
  2708. [const char *glibc_version = gnu_get_libc_version();],
  2709. [ac_cv_func_gnu_get_libc_version=yes],
  2710. [ac_cv_func_gnu_get_libc_version=no]
  2711. )]
  2712. )
  2713. if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
  2714. AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
  2715. fi
  2716. case $target_os in
  2717. os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
  2718. ;;
  2719. *)
  2720. AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
  2721. AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
  2722. AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
  2723. _SAVE_LIBS=$LIBS
  2724. LIBS="$LIBS $_ICONV_LIBS"
  2725. AC_CACHE_CHECK(
  2726. [for iconv()],
  2727. ac_cv_func_iconv,
  2728. [AC_TRY_LINK([
  2729. #include <stdlib.h>
  2730. #include <iconv.h>
  2731. ],
  2732. [
  2733. iconv_t h = iconv_open("", "");
  2734. iconv(h, NULL, NULL, NULL, NULL);
  2735. iconv_close(h);
  2736. ],
  2737. [ac_cv_func_iconv=yes],
  2738. [ac_cv_func_iconv=no]
  2739. )]
  2740. )
  2741. if test "$ac_cv_func_iconv" = "yes"; then
  2742. AC_DEFINE(HAVE_ICONV)
  2743. DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
  2744. LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
  2745. LIBICONV="$_ICONV_LIBS"
  2746. AC_CACHE_CHECK(
  2747. [for iconv() with const input],
  2748. ac_cv_func_const_iconv,
  2749. [AC_TRY_COMPILE([
  2750. #include <stdlib.h>
  2751. #include <iconv.h>
  2752. ],
  2753. [
  2754. const char *input = "testing";
  2755. iconv_t h = iconv_open("", "");
  2756. iconv(h, &input, NULL, NULL, NULL);
  2757. iconv_close(h);
  2758. ],
  2759. [ac_cv_func_const_iconv=yes],
  2760. [ac_cv_func_const_iconv=no]
  2761. )]
  2762. )
  2763. if test "$ac_cv_func_const_iconv" = "yes"; then
  2764. AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
  2765. fi
  2766. fi
  2767. LIBS=$_SAVE_LIBS
  2768. ;;
  2769. esac
  2770. AM_LANGINFO_CODESET
  2771. AC_LANG_C
  2772. dnl **********************
  2773. dnl *** va_copy checks ***
  2774. dnl **********************
  2775. dnl we currently check for all three va_copy possibilities, so we get
  2776. dnl all results in config.log for bug reports.
  2777. AC_MSG_CHECKING(for an implementation of va_copy())
  2778. AC_CACHE_VAL(ac_cv_va_copy,[
  2779. AC_TRY_RUN([
  2780. #include <stdarg.h>
  2781. void f (int i, ...) {
  2782. va_list args1, args2;
  2783. va_start (args1, i);
  2784. va_copy (args2, args1);
  2785. if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
  2786. exit (1);
  2787. va_end (args1); va_end (args2);
  2788. }
  2789. int main() { f (0, 42); return 0; }],
  2790. ac_cv_va_copy=yes,
  2791. ac_cv_va_copy=no,
  2792. ac_cv_va_copy=no
  2793. )
  2794. ])
  2795. AC_MSG_RESULT($ac_cv_va_copy)
  2796. AC_MSG_CHECKING(for an implementation of __va_copy())
  2797. AC_CACHE_VAL(ac_cv___va_copy,[
  2798. AC_TRY_RUN([
  2799. #include <stdarg.h>
  2800. void f (int i, ...) {
  2801. va_list args1, args2;
  2802. va_start (args1, i);
  2803. __va_copy (args2, args1);
  2804. if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
  2805. exit (1);
  2806. va_end (args1); va_end (args2);
  2807. }
  2808. int main() { f (0, 42); return 0; }],
  2809. ac_cv___va_copy=yes,
  2810. ac_cv___va_copy=no,
  2811. ac_cv___va_copy=no
  2812. )
  2813. ])
  2814. AC_MSG_RESULT($ac_cv___va_copy)
  2815. AC_MSG_CHECKING(whether va_lists can be copied by value)
  2816. AC_CACHE_VAL(ac_cv_va_val_copy,[
  2817. AC_TRY_RUN([
  2818. #include <stdarg.h>
  2819. void f (int i, ...) {
  2820. va_list args1, args2;
  2821. va_start (args1, i);
  2822. args2 = args1;
  2823. if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
  2824. exit (1);
  2825. va_end (args1); va_end (args2);
  2826. }
  2827. int main() { f (0, 42); return 0; }],
  2828. ac_cv_va_val_copy=yes,
  2829. ac_cv_va_val_copy=no,
  2830. ac_cv_va_val_copy=yes
  2831. )
  2832. ])
  2833. if test "x$ac_cv_va_copy" = "xyes"; then
  2834. AC_DEFINE(VA_COPY, va_copy)
  2835. AC_DEFINE(HAVE_VA_COPY)
  2836. elif test "x$ac_cv___va_copy" = "xyes"; then
  2837. AC_DEFINE(VA_COPY, __va_copy)
  2838. AC_DEFINE(HAVE_VA_COPY)
  2839. fi
  2840. if test "x$ac_cv_va_val_copy" = "xno"; then
  2841. AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
  2842. fi
  2843. AC_MSG_RESULT($ac_cv_va_val_copy)
  2844. dnl Check for dll-challenged libc's.
  2845. dnl This check is apparently only needed for Linux.
  2846. case "$target" in
  2847. *-linux*)
  2848. dnl ===================================================================
  2849. _curdir=`pwd`
  2850. export _curdir
  2851. rm -rf conftest* _conftest
  2852. mkdir _conftest
  2853. cat >> conftest.C <<\EOF
  2854. #include <stdio.h>
  2855. #include <link.h>
  2856. #include <dlfcn.h>
  2857. #ifdef _dl_loaded
  2858. void __dump_link_map(void) {
  2859. struct link_map *map = _dl_loaded;
  2860. while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
  2861. }
  2862. int main() {
  2863. dlopen("./conftest1.so",RTLD_LAZY);
  2864. dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
  2865. dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
  2866. dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
  2867. __dump_link_map();
  2868. }
  2869. #else
  2870. /* _dl_loaded isn't defined, so this should be either a libc5 (glibc1) system, or a glibc2 system that doesn't have the multiple load bug (i.e., RH6.0).*/
  2871. int main() { printf("./conftest1.so\n"); }
  2872. #endif
  2873. EOF
  2874. $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
  2875. cat >> conftest1.C <<\EOF
  2876. #include <stdio.h>
  2877. void foo(void) {printf("foo in dll called\n");}
  2878. EOF
  2879. ${CXX-g++} -fPIC -c -g conftest1.C
  2880. ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
  2881. ${CXX-g++} -g conftest.C -o conftest -ldl
  2882. cp -f conftest1.so conftest _conftest
  2883. cd _conftest
  2884. if test `./conftest | grep conftest1.so | wc -l` -gt 1
  2885. then
  2886. echo
  2887. echo "*** Your libc has a bug that can result in loading the same dynamic"
  2888. echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
  2889. echo "*** or later. However, if you choose not to upgrade, the only effect"
  2890. echo "*** will be excessive memory usage at runtime."
  2891. echo
  2892. fi
  2893. cd ${_curdir}
  2894. rm -rf conftest* _conftest
  2895. dnl ===================================================================
  2896. ;;
  2897. esac
  2898. /dnl ========================================================
  2899. dnl Put your C++ language/feature checks below
  2900. dnl ========================================================
  2901. AC_LANG_CPLUSPLUS
  2902. HAVE_GCC3_ABI=
  2903. if test "$GNU_CC"; then
  2904. AC_CACHE_CHECK(for gcc 3.0 ABI,
  2905. ac_cv_gcc_three_abi,
  2906. [AC_TRY_COMPILE([],
  2907. [
  2908. #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
  2909. return 0;
  2910. #else
  2911. #error Not gcc3.
  2912. #endif
  2913. ],
  2914. ac_cv_gcc_three_abi="yes",
  2915. ac_cv_gcc_three_abi="no")])
  2916. if test "$ac_cv_gcc_three_abi" = "yes"; then
  2917. TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
  2918. HAVE_GCC3_ABI=1
  2919. else
  2920. TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
  2921. fi
  2922. fi
  2923. AC_SUBST(HAVE_GCC3_ABI)
  2924. AC_CACHE_CHECK(for C++ \"explicit\" keyword,
  2925. ac_cv_cpp_explicit,
  2926. [AC_TRY_COMPILE(class X {
  2927. public: explicit X(int i) : i_(i) {}
  2928. private: int i_;
  2929. };,
  2930. X x(3);,
  2931. ac_cv_cpp_explicit=yes,
  2932. ac_cv_cpp_explicit=no)])
  2933. if test "$ac_cv_cpp_explicit" = yes ; then
  2934. AC_DEFINE(HAVE_CPP_EXPLICIT)
  2935. fi
  2936. AC_CACHE_CHECK(for C++ \"typename\" keyword,
  2937. ac_cv_cpp_typename,
  2938. [AC_TRY_COMPILE(class param {
  2939. public:
  2940. typedef unsigned long num_type;
  2941. };
  2942. template <class T> class tplt {
  2943. public:
  2944. typedef typename T::num_type t_num_type;
  2945. t_num_type foo(typename T::num_type num) {
  2946. return num;
  2947. }
  2948. };,
  2949. tplt<param> A;
  2950. A.foo(0);,
  2951. ac_cv_cpp_typename=yes,
  2952. ac_cv_cpp_typename=no)])
  2953. if test "$ac_cv_cpp_typename" = yes ; then
  2954. AC_DEFINE(HAVE_CPP_TYPENAME)
  2955. fi
  2956. dnl Check for support of modern template specialization syntax
  2957. dnl Test code and requirement from scc@netscape.com.
  2958. dnl Autoconf cut-and-paste job by waterson@netscape.com
  2959. AC_CACHE_CHECK(for modern C++ template specialization syntax support,
  2960. ac_cv_cpp_modern_specialize_template_syntax,
  2961. [AC_TRY_COMPILE(template <class T> struct X { int a; };
  2962. class Y {};
  2963. template <> struct X<Y> { double a; };,
  2964. X<int> int_x;
  2965. X<Y> y_x;,
  2966. ac_cv_cpp_modern_specialize_template_syntax=yes,
  2967. ac_cv_cpp_modern_specialize_template_syntax=no)])
  2968. if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
  2969. AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
  2970. fi
  2971. dnl Some compilers support only full specialization, and some don't.
  2972. AC_CACHE_CHECK(whether partial template specialization works,
  2973. ac_cv_cpp_partial_specialization,
  2974. [AC_TRY_COMPILE(template <class T> class Foo {};
  2975. template <class T> class Foo<T*> {};,
  2976. return 0;,
  2977. ac_cv_cpp_partial_specialization=yes,
  2978. ac_cv_cpp_partial_specialization=no)])
  2979. if test "$ac_cv_cpp_partial_specialization" = yes ; then
  2980. AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
  2981. fi
  2982. dnl Some compilers have limited support for operators with templates;
  2983. dnl specifically, it is necessary to define derived operators when a base
  2984. dnl class's operator declaration should suffice.
  2985. AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
  2986. ac_cv_need_derived_template_operators,
  2987. [AC_TRY_COMPILE([template <class T> class Base { };
  2988. template <class T>
  2989. Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
  2990. template <class T> class Derived : public Base<T> { };],
  2991. [Derived<char> a, b;
  2992. Base<char> c = a + b;
  2993. return 0;],
  2994. ac_cv_need_derived_template_operators=no,
  2995. ac_cv_need_derived_template_operators=yes)])
  2996. if test "$ac_cv_need_derived_template_operators" = yes ; then
  2997. AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
  2998. fi
  2999. dnl Some compilers have trouble detecting that a template class
  3000. dnl that derives from another template is actually an instance
  3001. dnl of the base class. This test checks for that.
  3002. AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
  3003. ac_cv_need_cpp_template_cast_to_base,
  3004. [AC_TRY_COMPILE([template <class T> class Base { };
  3005. template <class T> class Derived : public Base<T> { };
  3006. template <class T> int foo(const Base<T>&) { return 0; }],
  3007. [Derived<char> bar; return foo(bar);],
  3008. ac_cv_need_cpp_template_cast_to_base=no,
  3009. ac_cv_need_cpp_template_cast_to_base=yes)])
  3010. if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
  3011. AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
  3012. fi
  3013. dnl Some compilers have trouble resolving the ambiguity between two
  3014. dnl functions whose arguments differ only by cv-qualifications.
  3015. AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
  3016. ac_cv_can_resolve_const_ambiguity,
  3017. [AC_TRY_COMPILE([
  3018. template <class T> class ptrClass {
  3019. public: T* ptr;
  3020. };
  3021. template <class T> T* a(ptrClass<T> *arg) {
  3022. return arg->ptr;
  3023. }
  3024. template <class T>
  3025. const T* a(const ptrClass<T> *arg) {
  3026. return arg->ptr;
  3027. }
  3028. ],
  3029. [ ptrClass<int> i;
  3030. a(&i); ],
  3031. ac_cv_can_resolve_const_ambiguity=yes,
  3032. ac_cv_can_resolve_const_ambiguity=no)])
  3033. if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
  3034. AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
  3035. fi
  3036. dnl
  3037. dnl We don't do exceptions on unix. The only reason this used to be here
  3038. dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
  3039. dnl exceptions. But, we turn exceptions off by default and this test breaks.
  3040. dnl So im commenting this out until someone writes some artificial
  3041. dnl intelligence to detect not only if the compiler has exceptions, but if
  3042. dnl they are enabled as well.
  3043. dnl
  3044. dnl AC_CACHE_CHECK(for C++ \"exceptions\",
  3045. dnl ac_cv_cpp_exceptions,
  3046. dnl [AC_TRY_COMPILE(class X { public: X() {} };
  3047. dnl static void F() { throw X(); },
  3048. dnl try { F(); } catch(X & e) { },
  3049. dnl ac_cv_cpp_exceptions=yes,
  3050. dnl ac_cv_cpp_exceptions=no)])
  3051. dnl if test $ac_cv_cpp_exceptions = yes ; then
  3052. dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
  3053. dnl fi
  3054. dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
  3055. dnl supports it well enough to allow us to use it to change access, but not
  3056. dnl to resolve ambiguity. The next two tests determine how well the |using|
  3057. dnl keyword is supported.
  3058. dnl
  3059. dnl Check to see if we can change access with |using|. Test both a
  3060. dnl legal and an illegal example.
  3061. AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
  3062. ac_cv_cpp_access_changing_using2,
  3063. [AC_TRY_COMPILE(
  3064. class A { protected: int foo() { return 0; } };
  3065. class B : public A { public: using A::foo; };,
  3066. B b; return b.foo();,
  3067. [AC_TRY_COMPILE(
  3068. class A { public: int foo() { return 1; } };
  3069. class B : public A { private: using A::foo; };,
  3070. B b; return b.foo();,
  3071. ac_cv_cpp_access_changing_using2=no,
  3072. ac_cv_cpp_access_changing_using2=yes)],
  3073. ac_cv_cpp_access_changing_using2=no)])
  3074. if test "$ac_cv_cpp_access_changing_using2" = yes ; then
  3075. AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
  3076. fi
  3077. dnl Check to see if we can resolve ambiguity with |using|.
  3078. AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
  3079. ac_cv_cpp_ambiguity_resolving_using,
  3080. [AC_TRY_COMPILE(class X {
  3081. public: int go(const X&) {return 3;}
  3082. int jo(const X&) {return 3;}
  3083. };
  3084. class Y : public X {
  3085. public: int go(int) {return 2;}
  3086. int jo(int) {return 2;}
  3087. using X::jo;
  3088. private: using X::go;
  3089. };,
  3090. X x; Y y; y.jo(x);,
  3091. ac_cv_cpp_ambiguity_resolving_using=yes,
  3092. ac_cv_cpp_ambiguity_resolving_using=no)])
  3093. if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
  3094. AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
  3095. fi
  3096. dnl Check to see if the |std| namespace is supported. If so, we'll want
  3097. dnl to qualify any standard library calls with "std::" to ensure that
  3098. dnl those functions can be resolved.
  3099. AC_CACHE_CHECK(for \"std::\" namespace,
  3100. ac_cv_cpp_namespace_std,
  3101. [AC_TRY_COMPILE([#include <algorithm>],
  3102. [return std::min(0, 1);],
  3103. ac_cv_cpp_namespace_std=yes,
  3104. ac_cv_cpp_namespace_std=no)])
  3105. if test "$ac_cv_cpp_namespace_std" = yes ; then
  3106. AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
  3107. fi
  3108. dnl Older compilers are overly ambitious with respect to using the standard
  3109. dnl template library's |operator!=()| when |operator==()| is defined. In
  3110. dnl which case, defining |operator!=()| in addition to |operator==()| causes
  3111. dnl ambiguity at compile-time. This test checks for that case.
  3112. AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
  3113. ac_cv_cpp_unambiguous_std_notequal,
  3114. [AC_TRY_COMPILE([#include <algorithm>
  3115. struct T1 {};
  3116. int operator==(const T1&, const T1&) { return 0; }
  3117. int operator!=(const T1&, const T1&) { return 0; }],
  3118. [T1 a,b; return a != b;],
  3119. ac_cv_cpp_unambiguous_std_notequal=unambiguous,
  3120. ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
  3121. if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
  3122. AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
  3123. fi
  3124. AC_CACHE_CHECK(for C++ reinterpret_cast,
  3125. ac_cv_cpp_reinterpret_cast,
  3126. [AC_TRY_COMPILE(struct X { int i; };
  3127. struct Y { int i; };,
  3128. X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
  3129. ac_cv_cpp_reinterpret_cast=yes,
  3130. ac_cv_cpp_reinterpret_cast=no)])
  3131. if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
  3132. AC_DEFINE(HAVE_CPP_NEW_CASTS)
  3133. fi
  3134. dnl See if a dynamic_cast to void* gives the most derived object.
  3135. AC_CACHE_CHECK(for C++ dynamic_cast to void*,
  3136. ac_cv_cpp_dynamic_cast_void_ptr,
  3137. [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
  3138. class Y { int j; public: virtual ~Y() { } };
  3139. class Z : public X, public Y { int k; };
  3140. int main() {
  3141. Z mdo;
  3142. X *subx = (X*)&mdo;
  3143. Y *suby = (Y*)&mdo;
  3144. return !((((void*)&mdo != (void*)subx) &&
  3145. ((void*)&mdo == dynamic_cast<void*>(subx))) ||
  3146. (((void*)&mdo != (void*)suby) &&
  3147. ((void*)&mdo == dynamic_cast<void*>(suby))));
  3148. }],
  3149. ac_cv_cpp_dynamic_cast_void_ptr=yes,
  3150. ac_cv_cpp_dynamic_cast_void_ptr=no,
  3151. ac_cv_cpp_dynamic_cast_void_ptr=no)])
  3152. if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
  3153. AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
  3154. fi
  3155. dnl note that this one is reversed - if the test fails, then
  3156. dnl we require implementations of unused virtual methods. Which
  3157. dnl really blows because it means we'll have useless vtable
  3158. dnl bloat.
  3159. AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
  3160. ac_cv_cpp_unused_required,
  3161. [AC_TRY_LINK(class X {private: virtual void never_called();};,
  3162. X x;,
  3163. ac_cv_cpp_unused_required=no,
  3164. ac_cv_cpp_unused_required=yes)])
  3165. if test "$ac_cv_cpp_unused_required" = yes ; then
  3166. AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
  3167. fi
  3168. dnl Some compilers have trouble comparing a constant reference to a templatized
  3169. dnl class to zero, and require an explicit operator==() to be defined that takes
  3170. dnl an int. This test separates the strong from the weak.
  3171. AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
  3172. ac_cv_trouble_comparing_to_zero,
  3173. [AC_TRY_COMPILE([#include <algorithm>
  3174. template <class T> class Foo {};
  3175. class T2;
  3176. template <class T> int operator==(const T2*, const T&) { return 0; }
  3177. template <class T> int operator!=(const T2*, const T&) { return 0; }],
  3178. [Foo<int> f; return (0 != f);],
  3179. ac_cv_trouble_comparing_to_zero=no,
  3180. ac_cv_trouble_comparing_to_zero=yes)])
  3181. if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
  3182. AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
  3183. fi
  3184. dnl End of C++ language/feature checks
  3185. AC_LANG_C
  3186. dnl ========================================================
  3187. dnl = Internationalization checks
  3188. dnl ========================================================
  3189. dnl
  3190. dnl Internationalization and Locale support is different
  3191. dnl on various UNIX platforms. Checks for specific i18n
  3192. dnl features go here.
  3193. dnl check for LC_MESSAGES
  3194. AC_CACHE_CHECK(for LC_MESSAGES,
  3195. ac_cv_i18n_lc_messages,
  3196. [AC_TRY_COMPILE([#include <locale.h>],
  3197. [int category = LC_MESSAGES;],
  3198. ac_cv_i18n_lc_messages=yes,
  3199. ac_cv_i18n_lc_messages=no)])
  3200. if test "$ac_cv_i18n_lc_messages" = yes; then
  3201. AC_DEFINE(HAVE_I18N_LC_MESSAGES)
  3202. fi
  3203. fi # SKIP_COMPILER_CHECKS
  3204. TARGET_XPCOM_ABI=
  3205. if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
  3206. TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
  3207. fi
  3208. dnl Mozilla specific options
  3209. dnl ========================================================
  3210. dnl The macros used for command line options
  3211. dnl are defined in build/autoconf/altoptions.m4.
  3212. dnl =========================================================
  3213. dnl = Chrome format
  3214. dnl =========================================================
  3215. MOZ_ARG_ENABLE_STRING([chrome-format],
  3216. [ --enable-chrome-format=jar|flat|both|symlink
  3217. Select FORMAT of chrome files (default=jar)],
  3218. MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
  3219. if test -z "$MOZ_CHROME_FILE_FORMAT"; then
  3220. MOZ_CHROME_FILE_FORMAT=jar
  3221. fi
  3222. if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
  3223. test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
  3224. test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
  3225. test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
  3226. AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
  3227. fi
  3228. dnl ========================================================
  3229. dnl =
  3230. dnl = Check for external package dependencies
  3231. dnl =
  3232. dnl ========================================================
  3233. MOZ_ARG_HEADER(External Packages)
  3234. MOZ_ENABLE_LIBXUL=
  3235. MOZ_ARG_WITH_STRING(libxul-sdk,
  3236. [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
  3237. LIBXUL_SDK_DIR=$withval)
  3238. if test "$LIBXUL_SDK_DIR" = "yes" -o -z "$LIBXUL_SDK_DIR" -o "$LIBXUL_SDK_DIR" == "no"; then
  3239. AC_MSG_ERROR([--with-libxul-sdk must specify a path])
  3240. else
  3241. LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
  3242. if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
  3243. AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
  3244. fi
  3245. MOZ_ENABLE_LIBXUL=1
  3246. fi
  3247. AC_SUBST(LIBXUL_SDK)
  3248. LIBXUL_DIST="$LIBXUL_SDK"
  3249. AC_SUBST(LIBXUL_DIST)
  3250. dnl ========================================================
  3251. dnl = If NSPR was not detected in the system,
  3252. dnl = use the one in the source tree (mozilla/nsprpub)
  3253. dnl ========================================================
  3254. MOZ_ARG_WITH_BOOL(system-nspr,
  3255. [ --with-system-nspr Use system installed NSPR],
  3256. _USE_SYSTEM_NSPR=1 )
  3257. if test -n "$_USE_SYSTEM_NSPR"; then
  3258. AM_PATH_NSPR(4.8.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
  3259. fi
  3260. if test -n "$MOZ_NATIVE_NSPR"; then
  3261. _SAVE_CFLAGS=$CFLAGS
  3262. CFLAGS="$CFLAGS $NSPR_CFLAGS"
  3263. AC_TRY_COMPILE([#include "prlog.h"],
  3264. [#ifndef PR_STATIC_ASSERT
  3265. #error PR_STATIC_ASSERT not defined
  3266. #endif],
  3267. [MOZ_NATIVE_NSPR=1],
  3268. AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
  3269. CFLAGS=$_SAVE_CFLAGS
  3270. else
  3271. if test "$OS_ARCH" = "WINCE"; then
  3272. NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
  3273. NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
  3274. elif test "$OS_ARCH" = "WINNT"; then
  3275. NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
  3276. if test -n "$GNU_CC"; then
  3277. NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
  3278. else
  3279. NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
  3280. fi
  3281. else
  3282. NSPR_CFLAGS='`$(LIBXUL_SDK)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
  3283. NSPR_LIBS='`$(LIBXUL_SDK)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
  3284. fi
  3285. fi
  3286. dnl ========================================================
  3287. dnl =
  3288. dnl = Application
  3289. dnl =
  3290. dnl ========================================================
  3291. MOZ_ARG_HEADER(Application)
  3292. ENABLE_TESTS=1
  3293. MOZ_PYTHON=
  3294. MOZ_PYTHON_DEBUG_SUFFIX=
  3295. MOZ_PYTHON_DLL_SUFFIX=
  3296. MOZ_PYTHON_INCLUDES=
  3297. MOZ_PYTHON_LIBS=
  3298. MOZ_PYTHON_PREFIX=
  3299. MOZ_PYTHON_VER=
  3300. MOZ_PYTHON_VER_DOTTED=
  3301. AC_MSG_CHECKING([for tar archiver])
  3302. AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
  3303. if test -z "$TAR"; then
  3304. AC_MSG_ERROR([no tar archiver found in \$PATH])
  3305. fi
  3306. AC_MSG_RESULT([$TAR])
  3307. AC_SUBST(TAR)
  3308. AC_MSG_CHECKING([for wget])
  3309. AC_CHECK_PROGS(WGET, wget, "")
  3310. AC_MSG_RESULT([$WGET])
  3311. AC_SUBST(WGET)
  3312. dnl ========================================================
  3313. dnl build the tests by default
  3314. dnl ========================================================
  3315. MOZ_ARG_DISABLE_BOOL(tests,
  3316. [ --disable-tests Do not build test libraries & programs],
  3317. ENABLE_TESTS=,
  3318. ENABLE_TESTS=1 )
  3319. dnl ========================================================
  3320. dnl =
  3321. dnl = Debugging Options
  3322. dnl =
  3323. dnl ========================================================
  3324. MOZ_ARG_HEADER(Debugging and Optimizations)
  3325. dnl ========================================================
  3326. dnl = Disable building with debug info.
  3327. dnl = Debugging is OFF by default
  3328. dnl ========================================================
  3329. if test -z "$MOZ_DEBUG_FLAGS"
  3330. then
  3331. case "$target" in
  3332. *-irix*)
  3333. if test "$GNU_CC"; then
  3334. GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
  3335. case "$GCC_VERSION" in
  3336. 2.95.*)
  3337. MOZ_DEBUG_FLAGS=""
  3338. ;;
  3339. *)
  3340. MOZ_DEBUG_FLAGS="-g"
  3341. ;;
  3342. esac
  3343. else
  3344. MOZ_DEBUG_FLAGS="-g"
  3345. fi
  3346. ;;
  3347. *)
  3348. MOZ_DEBUG_FLAGS="-g"
  3349. ;;
  3350. esac
  3351. fi
  3352. MOZ_ARG_ENABLE_STRING(debug,
  3353. [ --enable-debug[=DBG] Enable building with developer debug info
  3354. (Using compiler flags DBG)],
  3355. [ if test "$enableval" != "no"; then
  3356. MOZ_DEBUG=1
  3357. if test -n "$enableval" && test "$enableval" != "yes"; then
  3358. MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
  3359. fi
  3360. else
  3361. MOZ_DEBUG=
  3362. fi ],
  3363. MOZ_DEBUG=)
  3364. MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
  3365. case "${target_os}" in
  3366. beos*)
  3367. MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
  3368. ;;
  3369. msvc*|mks*|cygwin*|mingw*|os2*|wince*)
  3370. MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
  3371. ;;
  3372. *)
  3373. MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
  3374. ;;
  3375. esac
  3376. MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
  3377. MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
  3378. if test -n "$MOZ_DEBUG"; then
  3379. AC_MSG_CHECKING([for valid debug flags])
  3380. _SAVE_CFLAGS=$CFLAGS
  3381. CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
  3382. AC_TRY_COMPILE([#include <stdio.h>],
  3383. [printf("Hello World\n");],
  3384. _results=yes,
  3385. _results=no)
  3386. AC_MSG_RESULT([$_results])
  3387. if test "$_results" = "no"; then
  3388. AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
  3389. fi
  3390. CFLAGS=$_SAVE_CFLAGS
  3391. fi
  3392. dnl ========================================================
  3393. dnl = Enable code optimization. ON by default.
  3394. dnl ========================================================
  3395. if test -z "$MOZ_OPTIMIZE_FLAGS"; then
  3396. MOZ_OPTIMIZE_FLAGS="-O"
  3397. fi
  3398. MOZ_ARG_ENABLE_STRING(optimize,
  3399. [ --disable-optimize Disable compiler optimization
  3400. --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
  3401. [ if test "$enableval" != "no"; then
  3402. MOZ_OPTIMIZE=1
  3403. if test -n "$enableval" && test "$enableval" != "yes"; then
  3404. MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
  3405. MOZ_OPTIMIZE=2
  3406. fi
  3407. else
  3408. MOZ_OPTIMIZE=
  3409. fi ], MOZ_OPTIMIZE=1)
  3410. if test -n "$MOZ_OPTIMIZE"; then
  3411. AC_MSG_CHECKING([for valid optimization flags])
  3412. _SAVE_CFLAGS=$CFLAGS
  3413. CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
  3414. AC_TRY_COMPILE([#include <stdio.h>],
  3415. [printf("Hello World\n");],
  3416. _results=yes,
  3417. _results=no)
  3418. AC_MSG_RESULT([$_results])
  3419. if test "$_results" = "no"; then
  3420. AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
  3421. fi
  3422. CFLAGS=$_SAVE_CFLAGS
  3423. fi
  3424. AC_SUBST(MOZ_OPTIMIZE)
  3425. AC_SUBST(MOZ_OPTIMIZE_FLAGS)
  3426. AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
  3427. AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
  3428. dnl ========================================================
  3429. dnl = dnl This will enable logging of addref, release, ctor, dtor.
  3430. dnl ========================================================
  3431. _ENABLE_LOGREFCNT=42
  3432. MOZ_ARG_ENABLE_BOOL(logrefcnt,
  3433. [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
  3434. _ENABLE_LOGREFCNT=1,
  3435. _ENABLE_LOGREFCNT= )
  3436. if test "$_ENABLE_LOGREFCNT" = "1"; then
  3437. AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
  3438. elif test -z "$_ENABLE_LOGREFCNT"; then
  3439. AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
  3440. fi
  3441. dnl ========================================================
  3442. dnl =
  3443. dnl = Misc. Options
  3444. dnl =
  3445. dnl ========================================================
  3446. MOZ_ARG_HEADER(Misc. Options)
  3447. dnl ========================================================
  3448. dnl update xterm title
  3449. dnl ========================================================
  3450. MOZ_ARG_ENABLE_BOOL(xterm-updates,
  3451. [ --enable-xterm-updates Update XTERM titles with current command.],
  3452. MOZ_UPDATE_XTERM=1,
  3453. MOZ_UPDATE_XTERM= )
  3454. if test -z "$SKIP_COMPILER_CHECKS"; then
  3455. dnl ========================================================
  3456. dnl =
  3457. dnl = Compiler Options
  3458. dnl =
  3459. dnl ========================================================
  3460. MOZ_ARG_HEADER(Compiler Options)
  3461. dnl ========================================================
  3462. dnl Check for gcc -pipe support
  3463. dnl ========================================================
  3464. AC_MSG_CHECKING([for gcc -pipe support])
  3465. if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
  3466. echo '#include <stdio.h>' > dummy-hello.c
  3467. echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
  3468. ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
  3469. cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
  3470. if test $? = 0; then
  3471. _res_as_stdin="yes"
  3472. else
  3473. _res_as_stdin="no"
  3474. fi
  3475. if test "$_res_as_stdin" = "yes"; then
  3476. _SAVE_CFLAGS=$CFLAGS
  3477. CFLAGS="$CFLAGS -pipe"
  3478. AC_TRY_COMPILE( [ #include <stdio.h> ],
  3479. [printf("Hello World\n");],
  3480. [_res_gcc_pipe="yes"],
  3481. [_res_gcc_pipe="no"] )
  3482. CFLAGS=$_SAVE_CFLAGS
  3483. fi
  3484. if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
  3485. _res="yes";
  3486. CFLAGS="$CFLAGS -pipe"
  3487. CXXFLAGS="$CXXFLAGS -pipe"
  3488. else
  3489. _res="no"
  3490. fi
  3491. rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
  3492. AC_MSG_RESULT([$_res])
  3493. else
  3494. AC_MSG_RESULT([no])
  3495. fi
  3496. dnl pass -Wno-long-long to the compiler
  3497. MOZ_ARG_ENABLE_BOOL(long-long-warning,
  3498. [ --enable-long-long-warning
  3499. Warn about use of non-ANSI long long type],
  3500. _IGNORE_LONG_LONG_WARNINGS=,
  3501. _IGNORE_LONG_LONG_WARNINGS=1)
  3502. if test "$_IGNORE_LONG_LONG_WARNINGS"; then
  3503. _SAVE_CFLAGS="$CFLAGS"
  3504. CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
  3505. AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
  3506. AC_TRY_COMPILE([], [return(0);],
  3507. [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
  3508. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
  3509. result="yes" ], result="no")
  3510. AC_MSG_RESULT([$result])
  3511. CFLAGS="$_SAVE_CFLAGS"
  3512. fi
  3513. dnl ========================================================
  3514. dnl Profile guided optimization
  3515. dnl ========================================================
  3516. dnl Test for profiling options
  3517. dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
  3518. dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
  3519. dnl Provide a switch to disable PGO even when called via profiledbuild.
  3520. MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
  3521. [ --disable-profile-guided-optimization
  3522. Don't build with PGO even if called via make profiledbuild],
  3523. MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
  3524. MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
  3525. AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
  3526. _SAVE_CFLAGS="$CFLAGS"
  3527. CFLAGS="$CFLAGS -fprofile-generate"
  3528. AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
  3529. AC_TRY_COMPILE([], [return 0;],
  3530. [ PROFILE_GEN_CFLAGS="-fprofile-generate"
  3531. result="yes" ], result="no")
  3532. AC_MSG_RESULT([$result])
  3533. if test $result = "yes"; then
  3534. PROFILE_GEN_LDFLAGS="-fprofile-generate"
  3535. PROFILE_USE_CFLAGS="-fprofile-use"
  3536. PROFILE_USE_LDFLAGS="-fprofile-use"
  3537. else
  3538. CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
  3539. AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
  3540. AC_TRY_COMPILE([], [return 0;],
  3541. [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
  3542. result="yes" ], result="no")
  3543. AC_MSG_RESULT([$result])
  3544. if test $result = "yes"; then
  3545. PROFILE_USE_CFLAGS="-fbranch-probabilities"
  3546. fi
  3547. # don't really care, this is an old GCC
  3548. PROFILE_GEN_LDFLAGS=
  3549. PROFILE_USE_LDFLAGS=
  3550. fi
  3551. CFLAGS="$_SAVE_CFLAGS"
  3552. if test -n "$INTEL_CC"; then
  3553. PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
  3554. PROFILE_GEN_LDFLAGS=
  3555. PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
  3556. PROFILE_USE_LDFLAGS=
  3557. fi
  3558. dnl Sun Studio on Solaris
  3559. if test "$SOLARIS_SUNPRO_CC"; then
  3560. PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
  3561. PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
  3562. if test "$CPU_ARCH" != "sparc"; then
  3563. PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
  3564. PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
  3565. else
  3566. PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
  3567. PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
  3568. fi
  3569. fi
  3570. AC_SUBST(PROFILE_GEN_CFLAGS)
  3571. AC_SUBST(PROFILE_GEN_LDFLAGS)
  3572. AC_SUBST(PROFILE_USE_CFLAGS)
  3573. AC_SUBST(PROFILE_USE_LDFLAGS)
  3574. AC_LANG_CPLUSPLUS
  3575. dnl ========================================================
  3576. dnl Test for -pedantic bustage
  3577. dnl ========================================================
  3578. MOZ_ARG_DISABLE_BOOL(pedantic,
  3579. [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
  3580. _PEDANTIC= )
  3581. if test "$_PEDANTIC"; then
  3582. _SAVE_CXXFLAGS=$CXXFLAGS
  3583. CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
  3584. AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
  3585. AC_TRY_COMPILE([$configure_static_assert_macros],
  3586. [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
  3587. result="no", result="yes" )
  3588. AC_MSG_RESULT([$result])
  3589. CXXFLAGS="$_SAVE_CXXFLAGS"
  3590. case "$result" in
  3591. no)
  3592. _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
  3593. _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
  3594. ;;
  3595. yes)
  3596. AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
  3597. ;;
  3598. esac
  3599. fi
  3600. dnl ========================================================
  3601. dnl Test for correct temporary object destruction order
  3602. dnl ========================================================
  3603. dnl We want to make sure the compiler follows the C++ spec here as
  3604. dnl xpcom and the string classes depend on it (bug 235381).
  3605. AC_MSG_CHECKING([for correct temporary object destruction order])
  3606. AC_TRY_RUN([ class A {
  3607. public: A(int& x) : mValue(x) {}
  3608. ~A() { mValue--; }
  3609. operator char**() { return 0; }
  3610. private: int& mValue;
  3611. };
  3612. void func(char **arg) {}
  3613. int m=2;
  3614. void test() {
  3615. func(A(m));
  3616. if (m==1) m = 0;
  3617. }
  3618. int main() {
  3619. test();
  3620. return(m);
  3621. }
  3622. ],
  3623. result="yes", result="no", result="maybe")
  3624. AC_MSG_RESULT([$result])
  3625. if test "$result" = "no"; then
  3626. AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
  3627. fi
  3628. dnl ========================================================
  3629. dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
  3630. dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
  3631. dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
  3632. dnl ========================================================
  3633. _SAVE_CXXFLAGS=$CXXFLAGS
  3634. CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
  3635. AC_CACHE_CHECK(for correct overload resolution with const and templates,
  3636. ac_nscap_nonconst_opeq_bug,
  3637. [AC_TRY_COMPILE([
  3638. template <class T>
  3639. class Pointer
  3640. {
  3641. public:
  3642. T* myPtr;
  3643. };
  3644. template <class T, class U>
  3645. int operator==(const Pointer<T>& rhs, U* lhs)
  3646. {
  3647. return rhs.myPtr == lhs;
  3648. }
  3649. template <class T, class U>
  3650. int operator==(const Pointer<T>& rhs, const U* lhs)
  3651. {
  3652. return rhs.myPtr == lhs;
  3653. }
  3654. ],
  3655. [
  3656. Pointer<int> foo;
  3657. const int* bar;
  3658. return foo == bar;
  3659. ],
  3660. ac_nscap_nonconst_opeq_bug="no",
  3661. ac_nscap_nonconst_opeq_bug="yes")])
  3662. CXXFLAGS="$_SAVE_CXXFLAGS"
  3663. if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
  3664. AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
  3665. fi
  3666. fi # SKIP_COMPILER_CHECKS
  3667. dnl ========================================================
  3668. dnl C++ rtti
  3669. dnl Should be smarter and check that the compiler does indeed have rtti
  3670. dnl ========================================================
  3671. MOZ_ARG_ENABLE_BOOL(cpp-rtti,
  3672. [ --enable-cpp-rtti Enable C++ RTTI ],
  3673. [ _MOZ_USE_RTTI=1 ],
  3674. [ _MOZ_USE_RTTI= ])
  3675. if test "$_MOZ_USE_RTTI"; then
  3676. _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
  3677. else
  3678. _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
  3679. fi
  3680. AC_SUBST(_MOZ_RTTI_FLAGS_ON)
  3681. dnl Check whether we can use gcc's c++0x mode
  3682. AC_LANG_CPLUSPLUS
  3683. if test "$GNU_CXX"; then
  3684. _SAVE_CXXFLAGS=$CXXFLAGS
  3685. CXXFLAGS="$CXXFLAGS -std=gnu++0x"
  3686. if test -z "$_MOZ_USE_RTTI"; then
  3687. CXXFLAGS="$CXXFLAGS $_MOZ_RTTI_FLAGS"
  3688. AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
  3689. ac_cv_cxx0x_headers_bug,
  3690. [AC_TRY_COMPILE([#include <memory>], [],
  3691. ac_cv_cxx0x_headers_bug="no",
  3692. ac_cv_cxx0x_headers_bug="yes")])
  3693. CXXFLAGS="$_SAVE_CXXFLAGS"
  3694. if test "$ac_cv_cxx0x_headers_bug" = "no"; then
  3695. CXXFLAGS="$CXXFLAGS -std=gnu++0x"
  3696. fi
  3697. fi
  3698. fi
  3699. dnl Check for usable char16_t (2 bytes, unsigned)
  3700. dnl (we might not need the unsignedness check anymore)
  3701. AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
  3702. ac_cv_have_usable_char16_t,
  3703. [AC_TRY_COMPILE([$configure_static_assert_macros],
  3704. [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
  3705. CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
  3706. CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
  3707. CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
  3708. CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
  3709. ac_cv_have_usable_char16_t="yes",
  3710. ac_cv_have_usable_char16_t="no")])
  3711. if test "$ac_cv_have_usable_char16_t" = "yes"; then
  3712. AC_DEFINE(HAVE_CPP_CHAR16_T)
  3713. HAVE_CPP_CHAR16_T=1
  3714. fi
  3715. dnl Check for usable wchar_t (2 bytes, unsigned)
  3716. dnl (we really don't need the unsignedness check anymore)
  3717. dnl ========================================================
  3718. AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
  3719. ac_cv_have_usable_wchar_v2,
  3720. [AC_TRY_COMPILE([#include <stddef.h>
  3721. $configure_static_assert_macros],
  3722. [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
  3723. CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
  3724. ac_cv_have_usable_wchar_v2="yes",
  3725. ac_cv_have_usable_wchar_v2="no")])
  3726. if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
  3727. AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
  3728. HAVE_CPP_2BYTE_WCHAR_T=1
  3729. elif test "$ac_cv_have_usable_char16_t" != "yes"; then
  3730. dnl This is really gcc-only
  3731. dnl Do this test using CXX only since some versions of gcc
  3732. dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
  3733. dnl only have short-wchar support for c++.
  3734. dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
  3735. _SAVE_CXXFLAGS=$CXXFLAGS
  3736. CXXFLAGS="$CXXFLAGS -fshort-wchar"
  3737. AC_CACHE_CHECK(for compiler -fshort-wchar option,
  3738. ac_cv_have_usable_wchar_option_v2,
  3739. [AC_TRY_LINK([#include <stddef.h>
  3740. $configure_static_assert_macros],
  3741. [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
  3742. CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
  3743. ac_cv_have_usable_wchar_option_v2="yes",
  3744. ac_cv_have_usable_wchar_option_v2="no")])
  3745. if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
  3746. AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
  3747. HAVE_CPP_2BYTE_WCHAR_T=1
  3748. WCHAR_CFLAGS="-fshort-wchar"
  3749. else
  3750. CXXFLAGS=$_SAVE_CXXFLAGS
  3751. fi
  3752. fi
  3753. dnl ========================================================
  3754. dnl =
  3755. dnl = Build depencency options
  3756. dnl =
  3757. dnl ========================================================
  3758. MOZ_ARG_HEADER(Build dependencies)
  3759. dnl ========================================================
  3760. dnl = Do not auto generate dependency info
  3761. dnl ========================================================
  3762. MOZ_AUTO_DEPS=1
  3763. MOZ_ARG_DISABLE_BOOL(auto-deps,
  3764. [ --disable-auto-deps Do not automatically generate dependency info],
  3765. MOZ_AUTO_DEPS=,
  3766. MOZ_AUTO_DEPS=1)
  3767. if test -n "$MOZ_AUTO_DEPS"; then
  3768. dnl ========================================================
  3769. dnl = Use mkdepend instead of $CC -MD for dependency generation
  3770. dnl ========================================================
  3771. _cpp_md_flag=
  3772. MOZ_ARG_DISABLE_BOOL(md,
  3773. [ --disable-md Do not use compiler-based dependencies ],
  3774. [_cpp_md_flag=],
  3775. [_cpp_md_flag=1],
  3776. [dnl Default is to turn on -MD if using GNU-compatible compilers
  3777. if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
  3778. _cpp_md_flag=1
  3779. fi
  3780. dnl Default is to use -xM if using Sun Studio on Solaris
  3781. if test "$SOLARIS_SUNPRO_CC"; then
  3782. _cpp_md_flag=1
  3783. fi])
  3784. if test "$_cpp_md_flag"; then
  3785. COMPILER_DEPEND=1
  3786. if test "$OS_ARCH" = "OpenVMS"; then
  3787. _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
  3788. else
  3789. _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
  3790. fi
  3791. dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
  3792. if test "$SOLARIS_SUNPRO_CC"; then
  3793. _DEPEND_CFLAGS=
  3794. fi
  3795. else
  3796. COMPILER_DEPEND=
  3797. _USE_CPP_INCLUDE_FLAG=
  3798. _DEFINES_CFLAGS='$(ACDEFINES) -FI $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT'
  3799. _DEFINES_CXXFLAGS='$(ACDEFINES) -FI $(LIBXUL_DIST)/include/mozilla-config.h -DMOZILLA_CLIENT'
  3800. fi
  3801. fi # MOZ_AUTO_DEPS
  3802. MDDEPDIR='.deps'
  3803. AC_SUBST(MOZ_AUTO_DEPS)
  3804. AC_SUBST(COMPILER_DEPEND)
  3805. AC_SUBST(MDDEPDIR)
  3806. dnl ==================================
  3807. dnl The meat of PyXPCOM configuration
  3808. dnl ==================================
  3809. dnl Allow PYTHON to point to the Python interpreter to use
  3810. dnl (note that it must be the python executable - which we
  3811. dnl run to locate the relevant paths etc)
  3812. dnl If not set, we use whatever Python we can find.
  3813. MOZ_PYTHON=$PYTHON
  3814. dnl Ask Python what its version number is
  3815. changequote(,)
  3816. MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
  3817. MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
  3818. changequote([,])
  3819. dnl Ask for the Python "prefix" (ie, home/source dir)
  3820. MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
  3821. dnl Setup the include and library directories.
  3822. if test "$OS_ARCH" = "WINNT"; then
  3823. MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
  3824. dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
  3825. dnl Binary trees have "include" for .h, and "libs" for .lib
  3826. dnl We add 'em both - along with quotes, to handle spaces.
  3827. MOZ_PYTHON_DLL_SUFFIX=.pyd
  3828. MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
  3829. MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
  3830. else
  3831. dnl Non-Windows include and libs
  3832. MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
  3833. MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
  3834. dnl Check for dynamic Python lib
  3835. dnl - A static Python is no good - multiple dynamic libraries (xpcom
  3836. dnl - core, xpcom loader, etc) all need to share Python.
  3837. dnl - Python 2.3's std --enable-shared configure option will
  3838. dnl create a libpython2.3.so.1.0. We should first try this
  3839. dnl dotted versioned .so file because this is the one that
  3840. dnl the PyXPCOM build mechanics tries to link to.
  3841. dnl XXX Should find a better way than hardcoding "1.0".
  3842. dnl - Python developement tree dir layouts are NOT allowed here
  3843. dnl because the PyXPCOM build just dies on it later anyway.
  3844. dnl - Fixes to the above by Python/*nix knowledgable people welcome!
  3845. if test -n "$MOZ_PYTHON_LIBDIR"; then
  3846. MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_LIBDIR -lpython$MOZ_PYTHON_VER_DOTTED"
  3847. elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
  3848. MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
  3849. elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
  3850. MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
  3851. elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
  3852. MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
  3853. elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
  3854. dnl Don't Python development tree directory layout.
  3855. MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
  3856. AC_MSG_ERROR([The Python at $MOZ_PYTHON_PREFIX looks like a dev tree. The PyXPCOM build cannot handle this yet. You must 'make install' Python and use the installed tree.])
  3857. elif test "$OS_ARCH" = "Darwin"; then
  3858. dnl We do Darwin last, so if a custom non-framework build of
  3859. dnl python is used on OSX, then it will be picked up first by
  3860. dnl the logic above.
  3861. if test "$MOZ_PYTHON_PREFIX" != "${MOZ_PYTHON_PREFIX/Python.framework/}"; then
  3862. MOZ_PYTHON_LIBS="-F${MOZ_PYTHON_PREFIX%/Python.framework/*}"
  3863. fi
  3864. MOZ_PYTHON_LIBS="${MOZ_PYTHON_LIBS} -framework Python"
  3865. else
  3866. AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
  3867. fi
  3868. if test "$OS_ARCH" = "Linux"; then
  3869. MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
  3870. fi
  3871. fi
  3872. dnl Handle "_d" on Windows
  3873. if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
  3874. MOZ_PYTHON_DEBUG_SUFFIX="_d"
  3875. else
  3876. MOZ_PYTHON_DEBUG_SUFFIX=
  3877. fi
  3878. AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
  3879. dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
  3880. dnl command-line, but not yet
  3881. AC_SUBST(MOZ_PYTHON)
  3882. AC_SUBST(MOZ_PYTHON_PREFIX)
  3883. AC_SUBST(MOZ_PYTHON_INCLUDES)
  3884. AC_SUBST(MOZ_PYTHON_LIBS)
  3885. AC_SUBST(MOZ_PYTHON_VER)
  3886. AC_SUBST(MOZ_PYTHON_VER_DOTTED)
  3887. AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
  3888. AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
  3889. dnl ========================================================
  3890. if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
  3891. MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
  3892. fi
  3893. dnl ========================================================
  3894. dnl =
  3895. dnl = Maintainer debug option (no --enable equivalent)
  3896. dnl =
  3897. dnl ========================================================
  3898. AC_SUBST(AR)
  3899. AC_SUBST(AR_FLAGS)
  3900. AC_SUBST(AR_LIST)
  3901. AC_SUBST(AR_EXTRACT)
  3902. AC_SUBST(AR_DELETE)
  3903. AC_SUBST(AS)
  3904. AC_SUBST(ASFLAGS)
  3905. AC_SUBST(AS_DASH_C_FLAG)
  3906. AC_SUBST(LD)
  3907. AC_SUBST(RC)
  3908. AC_SUBST(RCFLAGS)
  3909. AC_SUBST(WINDRES)
  3910. AC_SUBST(USE_SHORT_LIBNAME)
  3911. AC_SUBST(IMPLIB)
  3912. AC_SUBST(FILTER)
  3913. AC_SUBST(BIN_FLAGS)
  3914. AC_SUBST(NS_USE_NATIVE)
  3915. AC_SUBST(MOZ_UPDATE_XTERM)
  3916. AC_SUBST(MOZ_JS_LIBS)
  3917. AC_SUBST(MOZ_DEBUG)
  3918. AC_SUBST(MOZ_PROFILE_MODULES)
  3919. AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
  3920. AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
  3921. AC_SUBST(MOZ_DEBUG_FLAGS)
  3922. AC_SUBST(MOZ_DEBUG_LDFLAGS)
  3923. AC_SUBST(WARNINGS_AS_ERRORS)
  3924. AC_SUBST(MOZ_LOG_REFCNT)
  3925. AC_SUBST(JAR)
  3926. AC_SUBST(ENABLE_TESTS)
  3927. AC_SUBST(USE_ELF_DYNSTR_GC)
  3928. AC_SUBST(INCREMENTAL_LINKER)
  3929. AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
  3930. AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
  3931. AC_SUBST(MOZ_FIX_LINK_PATHS)
  3932. AC_SUBST(XPCOM_LIBS)
  3933. AC_SUBST(XPCOM_FROZEN_LDOPTS)
  3934. AC_SUBST(XPCOM_GLUE_LDOPTS)
  3935. AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
  3936. AC_SUBST(USE_DEPENDENT_LIBS)
  3937. AC_SUBST(MOZ_BUILD_ROOT)
  3938. AC_SUBST(MOZ_OS2_TOOLS)
  3939. AC_SUBST(MOZ_OS2_USE_DECLSPEC)
  3940. AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
  3941. AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
  3942. AC_SUBST(MOZ_PKG_SPECIAL)
  3943. dnl win32 options
  3944. AC_SUBST(MOZ_DEBUG_SYMBOLS)
  3945. AC_SUBST(MOZ_MAPINFO)
  3946. AC_SUBST(MOZ_BROWSE_INFO)
  3947. AC_SUBST(MOZ_TOOLS_DIR)
  3948. AC_SUBST(AS_PERL)
  3949. AC_SUBST(PYTHON)
  3950. AC_SUBST(WINCE)
  3951. AC_SUBST(WINCE_SDK_DIR)
  3952. AC_SUBST(WINCE_WINDOWS_MOBILE)
  3953. dnl Echo the CFLAGS to remove extra whitespace.
  3954. CFLAGS=`echo \
  3955. $_WARNINGS_CFLAGS \
  3956. $CFLAGS`
  3957. CXXFLAGS=`echo \
  3958. $_MOZ_RTTI_FLAGS \
  3959. $_MOZ_EXCEPTIONS_FLAGS \
  3960. $_WARNINGS_CXXFLAGS \
  3961. $CXXFLAGS`
  3962. COMPILE_CFLAGS=`echo \
  3963. $_DEFINES_CFLAGS \
  3964. $_DEPEND_CFLAGS \
  3965. $COMPILE_CFLAGS`
  3966. COMPILE_CXXFLAGS=`echo \
  3967. $_DEFINES_CXXFLAGS \
  3968. $_DEPEND_CFLAGS \
  3969. $COMPILE_CXXFLAGS`
  3970. AC_SUBST(SYSTEM_MAKEDEPEND)
  3971. AC_SUBST(NSPR_CFLAGS)
  3972. AC_SUBST(NSPR_LIBS)
  3973. AC_SUBST(MOZ_NATIVE_NSPR)
  3974. AC_SUBST(CFLAGS)
  3975. AC_SUBST(CXXFLAGS)
  3976. AC_SUBST(CPPFLAGS)
  3977. AC_SUBST(COMPILE_CFLAGS)
  3978. AC_SUBST(COMPILE_CXXFLAGS)
  3979. AC_SUBST(LDFLAGS)
  3980. AC_SUBST(LIBS)
  3981. AC_SUBST(CROSS_COMPILE)
  3982. AC_SUBST(WCHAR_CFLAGS)
  3983. AC_SUBST(HOST_CC)
  3984. AC_SUBST(HOST_CXX)
  3985. AC_SUBST(HOST_CFLAGS)
  3986. AC_SUBST(HOST_CXXFLAGS)
  3987. AC_SUBST(HOST_OPTIMIZE_FLAGS)
  3988. AC_SUBST(HOST_AR)
  3989. AC_SUBST(HOST_AR_FLAGS)
  3990. AC_SUBST(HOST_LD)
  3991. AC_SUBST(HOST_RANLIB)
  3992. AC_SUBST(HOST_NSPR_MDCPUCFG)
  3993. AC_SUBST(HOST_BIN_SUFFIX)
  3994. AC_SUBST(HOST_OS_ARCH)
  3995. AC_SUBST(TARGET_CPU)
  3996. AC_SUBST(TARGET_VENDOR)
  3997. AC_SUBST(TARGET_OS)
  3998. AC_SUBST(TARGET_NSPR_MDCPUCFG)
  3999. AC_SUBST(TARGET_MD_ARCH)
  4000. AC_SUBST(TARGET_XPCOM_ABI)
  4001. AC_SUBST(OS_TARGET)
  4002. AC_SUBST(OS_ARCH)
  4003. AC_SUBST(OS_RELEASE)
  4004. AC_SUBST(OS_TEST)
  4005. AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
  4006. AC_SUBST(MOZ_CHROME_FILE_FORMAT)
  4007. AC_SUBST(WRAP_MALLOC_CFLAGS)
  4008. AC_SUBST(WRAP_MALLOC_LIB)
  4009. AC_SUBST(MKSHLIB)
  4010. AC_SUBST(MKCSHLIB)
  4011. AC_SUBST(MKSHLIB_FORCE_ALL)
  4012. AC_SUBST(MKSHLIB_UNFORCE_ALL)
  4013. AC_SUBST(DSO_CFLAGS)
  4014. AC_SUBST(DSO_PIC_CFLAGS)
  4015. AC_SUBST(DSO_LDOPTS)
  4016. AC_SUBST(LIB_PREFIX)
  4017. AC_SUBST(DLL_PREFIX)
  4018. AC_SUBST(DLL_SUFFIX)
  4019. AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
  4020. AC_SUBST(LIB_SUFFIX)
  4021. AC_SUBST(OBJ_SUFFIX)
  4022. AC_SUBST(BIN_SUFFIX)
  4023. AC_SUBST(ASM_SUFFIX)
  4024. AC_SUBST(IMPORT_LIB_SUFFIX)
  4025. AC_SUBST(USE_N32)
  4026. AC_SUBST(CC_VERSION)
  4027. AC_SUBST(CXX_VERSION)
  4028. AC_SUBST(MSMANIFEST_TOOL)
  4029. if test "$USING_HCC"; then
  4030. CC='${topsrcdir}/build/hcc'
  4031. CC="$CC '$_OLDCC'"
  4032. CXX='${topsrcdir}/build/hcpp'
  4033. CXX="$CXX '$_OLDCXX'"
  4034. AC_SUBST(CC)
  4035. AC_SUBST(CXX)
  4036. fi
  4037. dnl Set various defines and substitutions
  4038. dnl ========================================================
  4039. if test "$OS_ARCH" = "BeOS"; then
  4040. AC_DEFINE(XP_BEOS)
  4041. MOZ_MOVEMAIL=1
  4042. elif test "$OS_ARCH" = "Darwin"; then
  4043. AC_DEFINE(XP_UNIX)
  4044. AC_DEFINE(UNIX_ASYNC_DNS)
  4045. MOZ_MOVEMAIL=1
  4046. elif test "$OS_ARCH" = "OpenVMS"; then
  4047. AC_DEFINE(XP_UNIX)
  4048. elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
  4049. AC_DEFINE(XP_UNIX)
  4050. AC_DEFINE(UNIX_ASYNC_DNS)
  4051. MOZ_MOVEMAIL=1
  4052. fi
  4053. dnl ========================================================
  4054. dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
  4055. dnl ========================================================
  4056. case "$host_os" in
  4057. mingw*)
  4058. WIN_TOP_SRC=`cd $srcdir; pwd -W`
  4059. ;;
  4060. esac
  4061. AC_SUBST(WIN_TOP_SRC)
  4062. AC_SUBST(ac_configure_args)
  4063. ##
  4064. ## Had to add this defines hack for the Windows build - ToddW.
  4065. ##
  4066. # Save the defines header file before autoconf removes it.
  4067. # (Do not add AC_DEFINE calls after this line.)
  4068. _CONFIG_TMP=confdefs-tmp.h
  4069. _CONFIG_DEFS_H=mozilla-config.h
  4070. cat > $_CONFIG_TMP <<\EOF
  4071. /* List of defines generated by configure. Included with preprocessor flag,
  4072. * -include, to avoid long list of -D defines on the compile command-line.
  4073. * Do not edit.
  4074. */
  4075. #ifndef _MOZILLA_CONFIG_H_
  4076. #define _MOZILLA_CONFIG_H_
  4077. EOF
  4078. _EGREP_PATTERN='^#define ('
  4079. if test -n "$_NON_GLOBAL_ACDEFINES"; then
  4080. for f in $_NON_GLOBAL_ACDEFINES; do
  4081. _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
  4082. done
  4083. fi
  4084. _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
  4085. sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
  4086. cat >> $_CONFIG_TMP <<\EOF
  4087. #endif /* _MOZILLA_CONFIG_H_ */
  4088. EOF
  4089. # Only write mozilla-config.h when something changes (or it doesn't exist)
  4090. if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
  4091. rm $_CONFIG_TMP
  4092. else
  4093. AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
  4094. mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
  4095. echo ==== $_CONFIG_DEFS_H =================================
  4096. cat $_CONFIG_DEFS_H
  4097. fi
  4098. dnl Probably shouldn't call this manually but we always want the output of DEFS
  4099. rm -f confdefs.h.save
  4100. mv confdefs.h confdefs.h.save
  4101. egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
  4102. AC_OUTPUT_MAKE_DEFS()
  4103. MOZ_DEFINES=$DEFS
  4104. AC_SUBST(MOZ_DEFINES)
  4105. rm -f confdefs.h
  4106. mv confdefs.h.save confdefs.h
  4107. AC_OUTPUT([
  4108. config/autoconf.mk
  4109. Makefile
  4110. xpcom/Makefile
  4111. xpcom/src/Makefile
  4112. xpcom/src/loader/Makefile
  4113. xpcom/src/module/Makefile
  4114. xpcom/components/Makefile
  4115. xpcom/test/Makefile
  4116. xpcom/test/test_component/Makefile
  4117. ])