configure 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610
  1. #!/bin/sh
  2. ### WARNING: this file contains embedded tabs. Do not run untabify on this file.
  3. # Configuration script
  4. # Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001,
  5. # 2002 Free Software Foundation, Inc.
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. # This file was originally written by K. Richard Pixley.
  20. #
  21. # Shell script to create proper links to machine-dependent files in
  22. # preparation for compilation.
  23. #
  24. # If configure succeeds, it leaves its status in config.status.
  25. # If configure fails after disturbing the status quo,
  26. # config.status is removed.
  27. #
  28. export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
  29. remove=rm
  30. hard_link=ln
  31. symbolic_link='ln -s'
  32. #for Test
  33. #remove="echo rm"
  34. #hard_link="echo ln"
  35. #symbolic_link="echo ln -s"
  36. # clear some things potentially inherited from environment.
  37. Makefile=Makefile
  38. Makefile_in=Makefile.in
  39. arguments=
  40. build_alias=
  41. cache_file=config.cache
  42. cache_file_option=
  43. configdirs=
  44. extraconfigdirs=
  45. diroptions=
  46. enable_threads=no
  47. enable_shared=no
  48. enable_libstdcxx_v3=yes
  49. exec_prefix=
  50. exec_prefixoption=
  51. fatal=
  52. floating_point=default
  53. gas=default
  54. gcc_version=
  55. gcc_version_trigger=
  56. host_alias=NOHOST
  57. host_makefile_frag=
  58. moveifchange=
  59. norecursion=
  60. other_options=
  61. package_makefile_frag=
  62. package_makefile_rules_frag=
  63. prefix=/usr/local
  64. progname=
  65. program_prefix=
  66. program_prefixoption=
  67. program_suffix=
  68. program_suffixoption=
  69. program_transform_name=
  70. program_transform_nameoption=
  71. redirect=
  72. removing=
  73. site=
  74. site_makefile_frag=
  75. site_option=
  76. srcdir=
  77. srctrigger=
  78. subdirs=
  79. target_alias=NOTARGET
  80. target_makefile_frag=
  81. undefs=NOUNDEFS
  82. version="$Revision: 1.49 $"
  83. x11=default
  84. bindir='${exec_prefix}/bin'
  85. sbindir='${exec_prefix}/sbin'
  86. libexecdir='${exec_prefix}/libexec'
  87. datadir='${prefix}/share'
  88. sysconfdir='${prefix}/etc'
  89. sharedstatedir='${prefix}/com'
  90. localstatedir='${prefix}/var'
  91. libdir='${exec_prefix}/lib'
  92. includedir='${prefix}/include'
  93. oldincludedir='/usr/include'
  94. infodir='${prefix}/info'
  95. mandir='${prefix}/man'
  96. ### we might need to use some other shell than /bin/sh for running subshells
  97. ### If we are on Windows, search for the shell. This will permit people
  98. ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
  99. ### without also having to set CONFIG_SHELL. This code will work when
  100. ### using bash, which sets OSTYPE.
  101. case "${OSTYPE}" in
  102. *win32*)
  103. if [ x${CONFIG_SHELL} = x ]; then
  104. if [ ! -f /bin/sh ]; then
  105. if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then
  106. CONFIG_SHELL=${SHELL}
  107. export CONFIG_SHELL
  108. else
  109. for prog in sh sh.exe bash bash.exe; do
  110. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  111. for dir in $PATH; do
  112. test -z "$dir" && dir=.
  113. if test -f $dir/$prog; then
  114. CONFIG_SHELL=$dir/$prog
  115. export CONFIG_SHELL
  116. break
  117. fi
  118. done
  119. IFS="$save_ifs"
  120. test -n "${CONFIG_SHELL}" && break
  121. done
  122. fi
  123. fi
  124. fi
  125. ;;
  126. esac
  127. config_shell=${CONFIG_SHELL-/bin/sh}
  128. NO_EDIT="This file was generated automatically by configure. Do not edit."
  129. ## this is a little touchy and won't always work, but...
  130. ##
  131. ## if the argv[0] starts with a slash then it is an absolute name that can (and
  132. ## must) be used as is.
  133. ##
  134. ## otherwise, if argv[0] has no slash in it, we can assume that it is on the
  135. ## path. Since PATH might include "." we also add `pwd` to the end of PATH.
  136. ##
  137. progname=$0
  138. # if PWD already has a value, it is probably wrong.
  139. if [ -n "$PWD" ]; then PWD=`${PWDCMD-pwd}`; fi
  140. case "${progname}" in
  141. /* | [A-Za-z]:[\\/]* ) ;;
  142. */*) ;;
  143. *)
  144. PATH=$PATH:${PWD=`${PWDCMD-pwd}`} ; export PATH
  145. ;;
  146. esac
  147. # Export original configure arguments for use by sub-configures.
  148. TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
  149. export TOPLEVEL_CONFIGURE_ARGUMENTS
  150. # Loop over all args
  151. while :
  152. do
  153. # Break out if there are no more args
  154. case $# in
  155. 0)
  156. break
  157. ;;
  158. esac
  159. # Get the first arg, and shuffle
  160. option=$1
  161. shift
  162. # Make all options have two hyphens
  163. orig_option=$option # Save original for error messages
  164. case $option in
  165. --*) ;;
  166. -*) option=-$option ;;
  167. esac
  168. # Split out the argument for options that take them
  169. case $option in
  170. --*=*)
  171. optarg=`echo $option | sed -e 's/^[^=]*=//'`
  172. arguments="$arguments $option"
  173. ;;
  174. # These options have mandatory values. Since we didn't find an = sign,
  175. # the value must be in the next argument
  176. --bu* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-* | --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*)
  177. optarg=$1
  178. shift
  179. arguments="$arguments $option=$optarg"
  180. ;;
  181. --v)
  182. arguments="$arguments -v"
  183. ;;
  184. --*)
  185. arguments="$arguments $option"
  186. ;;
  187. esac
  188. # Now, process the options
  189. case $option in
  190. --bi*)
  191. bindir=$optarg
  192. diroptions="$diroptions --bindir=$optarg"
  193. ;;
  194. --build* | --bu*)
  195. case "$build_alias" in
  196. "") build_alias=$optarg ;;
  197. *) echo '***' Can only configure for one build machine at a time. 1>&2
  198. fatal=yes
  199. ;;
  200. esac
  201. ;;
  202. --cache*)
  203. cache_file=$optarg
  204. ;;
  205. --da*)
  206. datadir=$optarg
  207. diroptions="$diroptions --datadir=$optarg"
  208. ;;
  209. --disable-*)
  210. enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
  211. eval $enableopt=no
  212. disableoptions="$disableoptions $option"
  213. ;;
  214. --enable-*)
  215. case "$option" in
  216. *=*) ;;
  217. *) optarg=yes ;;
  218. esac
  219. enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
  220. eval "$enableopt=\$optarg"
  221. enableoptions="$enableoptions '$option'"
  222. ;;
  223. --exec-prefix* | --ex*)
  224. exec_prefix=$optarg
  225. exec_prefixoption="--exec-prefix=$optarg"
  226. ;;
  227. --gas | --g*)
  228. gas=yes
  229. ;;
  230. --help | --he*)
  231. fatal=yes
  232. ;;
  233. --host* | --ho*)
  234. case $host_alias in
  235. NOHOST) host_alias=$optarg ;;
  236. *) echo '***' Can only configure for one host at a time. 1>&2
  237. fatal=yes
  238. ;;
  239. esac
  240. ;;
  241. --inc*)
  242. includedir=$optarg
  243. diroptions="$diroptions --includedir=$optarg"
  244. ;;
  245. --inf*)
  246. infodir=$optarg
  247. diroptions="$diroptions --infodir=$optarg"
  248. ;;
  249. --libd*)
  250. libdir=$optarg
  251. diroptions="$diroptions --libdir=$optarg"
  252. ;;
  253. --libe*)
  254. libexecdir=$optarg
  255. diroptions="$diroptions --libexecdir=$optarg"
  256. ;;
  257. --lo*)
  258. localstatedir=$optarg
  259. diroptions="$diroptions --localstatedir=$optarg"
  260. ;;
  261. --ma*)
  262. mandir=$optarg
  263. diroptions="$diroptions --mandir=$optarg"
  264. ;;
  265. --nfp | --nf*)
  266. floating_point=no
  267. floating_pointoption="--nfp"
  268. ;;
  269. --norecursion | --no*)
  270. norecursion=yes
  271. ;;
  272. --ol*)
  273. oldincludedir=$optarg
  274. diroptions="$diroptions --oldincludedir=$optarg"
  275. ;;
  276. --prefix* | --pre*)
  277. prefix=$optarg
  278. prefixoption="--prefix=$optarg"
  279. ;;
  280. --program-prefix* | --program-p*)
  281. program_prefix=$optarg
  282. program_prefixoption="--program-prefix=$optarg"
  283. ;;
  284. --program-suffix* | --program-s*)
  285. program_suffix=$optarg
  286. program_suffixoption="--program-suffix=$optarg"
  287. ;;
  288. --program-transform-name* | --program-t*)
  289. # Double any backslashes or dollar signs in the argument
  290. program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
  291. program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
  292. ;;
  293. --rm)
  294. removing=--rm
  295. ;;
  296. --sb*)
  297. sbindir=$optarg
  298. diroptions="$diroptions --sbindir=$optarg"
  299. ;;
  300. --sh*)
  301. sharedstatedir=$optarg
  302. diroptions="$diroptions --sharedstatedir=$optarg"
  303. ;;
  304. --silent | --sil* | --quiet | --q*)
  305. redirect=">/dev/null"
  306. verbose=--silent
  307. ;;
  308. --site* | --sit*)
  309. site=$optarg
  310. site_option="--site=$optarg"
  311. ;;
  312. --srcdir*/ | --sr*/)
  313. # Remove trailing slashes. Otherwise, when the file name gets
  314. # bolted into an object file as debug info, it has two slashes
  315. # in it. Ordinarily this is ok, but emacs takes double slash
  316. # to mean "forget the first part".
  317. srcdir=`echo $optarg | sed -e 's:/$::'`
  318. ;;
  319. --srcdir* | --sr*)
  320. srcdir=$optarg
  321. ;;
  322. --sy*)
  323. sysconfdir=$optarg
  324. diroptions="$diroptions --sysconfdir=$optarg"
  325. ;;
  326. --target* | --ta*)
  327. case $target_alias in
  328. NOTARGET) target_alias=$optarg ;;
  329. *) echo '***' Can only configure for one target at a time. 1>&2
  330. fatal=yes
  331. ;;
  332. esac
  333. ;;
  334. --tmpdir* | --tm*)
  335. TMPDIR=$optarg
  336. tmpdiroption="--tmpdir=$optarg"
  337. ;;
  338. --verbose | --v | --verb*)
  339. redirect=
  340. verbose=--verbose
  341. ;;
  342. --version | --V | --vers*)
  343. echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
  344. exit 0
  345. ;;
  346. --with-*)
  347. case "$option" in
  348. *=*) ;;
  349. *) optarg=yes ;;
  350. esac
  351. withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
  352. eval $withopt="\$optarg"
  353. withoptions="$withoptions $option"
  354. ;;
  355. --without-*)
  356. withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
  357. eval $withopt=no
  358. withoutoptions="$withoutoptions $option"
  359. ;;
  360. --x) with_x=yes
  361. withoptions="$withoptions --with-x"
  362. ;;
  363. --x-i* | --x-l*) other_options="$other_options $orig_option"
  364. ;;
  365. --*)
  366. echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
  367. exit 1
  368. ;;
  369. *)
  370. case $undefs in
  371. NOUNDEFS) undefs=$option ;;
  372. *) echo '***' Can only configure for one host and one target at a time. 1>&2
  373. fatal=yes
  374. ;;
  375. esac
  376. ;;
  377. esac
  378. done
  379. # process host and target
  380. # Do some error checking and defaulting for the host and target type.
  381. # The inputs are:
  382. # configure --host=HOST --target=TARGET UNDEFS
  383. #
  384. # The rules are:
  385. # 1. You aren't allowed to specify --host, --target, and undefs at the
  386. # same time.
  387. # 2. Host defaults to undefs.
  388. # 3. If undefs is not specified, then host defaults to the current host,
  389. # as determined by config.guess.
  390. # 4. Target defaults to undefs.
  391. # 5. If undefs is not specified, then target defaults to host.
  392. case "${fatal}" in
  393. "")
  394. # Make sure that host, target & undefs aren't all specified at the
  395. # same time.
  396. case $host_alias---$target_alias---$undefs in
  397. NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
  398. ;;
  399. *) echo '***' Can only configure for one host and one target at a time. 1>&2
  400. fatal=yes
  401. break 2
  402. ;;
  403. esac
  404. # Now, do defaulting for host.
  405. case $host_alias in
  406. NOHOST)
  407. case $undefs in
  408. NOUNDEFS)
  409. # Neither --host option nor undefs were present.
  410. # Call config.guess.
  411. guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
  412. if host_alias=`${config_shell} ${guesssys}`
  413. then
  414. # If the string we are going to use for
  415. # the target is a prefix of the string
  416. # we just guessed for the host, then
  417. # assume we are running native, and force
  418. # the same string for both target and host.
  419. case $target_alias in
  420. NOTARGET) ;;
  421. *)
  422. if expr $host_alias : $target_alias >/dev/null
  423. then
  424. host_alias=$target_alias
  425. fi
  426. ;;
  427. esac
  428. echo "Configuring for a ${host_alias} host."
  429. arguments="--host=$host_alias $arguments"
  430. else
  431. echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
  432. fatal=yes
  433. fi
  434. ;;
  435. *)
  436. host_alias=$undefs
  437. arguments="--host=$host_alias $arguments"
  438. undefs=NOUNDEFS
  439. ;;
  440. esac
  441. esac
  442. # Do defaulting for target. If --target option isn't present, default
  443. # to undefs. If undefs isn't present, default to host.
  444. case $target_alias in
  445. NOTARGET)
  446. case $undefs in
  447. NOUNDEFS)
  448. target_alias=$host_alias
  449. ;;
  450. *)
  451. target_alias=$undefs
  452. arguments="--target=$target_alias $arguments"
  453. ;;
  454. esac
  455. esac
  456. ;;
  457. *) ;;
  458. esac
  459. if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
  460. exec 1>&2
  461. echo Usage: configure [OPTIONS] [HOST]
  462. echo
  463. echo Options: [defaults in brackets]
  464. echo ' --prefix=MYDIR install into MYDIR [/usr/local]'
  465. echo ' --exec-prefix=MYDIR install host-dependent files into MYDIR [/usr/local]'
  466. echo ' --help print this message [normal config]'
  467. echo ' --build=BUILD configure for building on BUILD [BUILD=HOST]'
  468. echo ' --host=HOST configure for HOST [determined via config.guess]'
  469. echo ' --norecursion configure this directory only [recurse]'
  470. echo ' --program-prefix=FOO prepend FOO to installed program names [""]'
  471. echo ' --program-suffix=FOO append FOO to installed program names [""]'
  472. echo ' --program-transform-name=P transform installed names by sed pattern P [""]'
  473. echo ' --site=SITE configure with site-specific makefile for SITE'
  474. echo ' --srcdir=DIR find the sources in DIR [. or ..]'
  475. echo ' --target=TARGET configure for TARGET [TARGET=HOST]'
  476. echo ' --tmpdir=TMPDIR create temporary files in TMPDIR [/tmp]'
  477. echo ' --nfp configure for software floating point [hard float]'
  478. echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
  479. echo ' --without-FOO package FOO is NOT available'
  480. echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
  481. echo ' --disable-FOO do not include feature FOO'
  482. echo
  483. echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'
  484. echo
  485. if [ -r config.status ] ; then
  486. cat config.status
  487. fi
  488. exit 1
  489. fi
  490. configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
  491. moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
  492. ## the sed command below emulates the dirname command
  493. topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; ${PWDCMD-pwd}`
  494. # this is a hack. sun4 must always be a valid host alias or this will fail.
  495. if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then
  496. true
  497. else
  498. echo '***' cannot find config.sub. 1>&2
  499. exit 1
  500. fi
  501. touch config.junk
  502. if ${config_shell} ${moveifchange} config.junk config.trash ; then
  503. true
  504. else
  505. echo '***' cannot find move-if-change. 1>&2
  506. exit 1
  507. fi
  508. rm -f config.junk config.trash
  509. case "${srcdir}" in
  510. "")
  511. if [ -r configure.in ] ; then
  512. srcdir=.
  513. else
  514. if [ -r ${progname}.in ] ; then
  515. srcdir=`echo ${progname} | sed 's:/configure$::'`
  516. else
  517. echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
  518. exit 1
  519. fi
  520. fi
  521. ;;
  522. *)
  523. # Set srcdir to "." if that's what it is.
  524. # This is important for multilib support.
  525. if [ ! -d ${srcdir} ] ; then
  526. echo "Invalid source directory ${srcdir}" >&2
  527. exit 1
  528. fi
  529. pwd=`${PWDCMD-pwd}`
  530. srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
  531. if [ "${pwd}" = "${srcpwd}" ] ; then
  532. srcdir=.
  533. fi
  534. esac
  535. ### warn about some conflicting configurations.
  536. case "${srcdir}" in
  537. ".") ;;
  538. *)
  539. if [ -f ${srcdir}/config.status ] ; then
  540. echo '***' Cannot configure here in \"${PWD=`${PWDCMD-pwd}`}\" when \"${srcdir}\" is currently configured. 1>&2
  541. exit 1
  542. fi
  543. esac
  544. # default exec_prefix
  545. case "${exec_prefixoption}" in
  546. "") exec_prefix="\$(prefix)" ;;
  547. *) ;;
  548. esac
  549. # Define the trigger file to make sure configure will re-run whenever
  550. # the gcc version number changes.
  551. if [ "${with_gcc_version_trigger+set}" = set ]; then
  552. gcc_version_trigger="$with_gcc_version_trigger"
  553. gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
  554. else
  555. # If gcc's sources are available, define the trigger file.
  556. if [ -f ${topsrcdir}/gcc/version.c ] ; then
  557. gcc_version_trigger=${topsrcdir}/gcc/version.c
  558. gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'`
  559. case "$arguments" in
  560. *--with-gcc-version-trigger=$gcc_version_trigger* )
  561. ;;
  562. * )
  563. # Make sure configure.in knows about this.
  564. arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments"
  565. ;;
  566. esac
  567. withoptions="--with-gcc-version-trigger=$gcc_version_trigger $withoptions"
  568. fi
  569. fi
  570. ### break up ${srcdir}/configure.in.
  571. case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
  572. "")
  573. echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
  574. # Check for a directory that's been converted to use autoconf since
  575. # it was last configured.
  576. if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then
  577. echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2
  578. if [ -r ${srcdir}/configure ] ; then
  579. echo '***' Running the local configure script. 1>&2
  580. case "${cache_file}" in
  581. "") cache_file_option= ;;
  582. *) cache_file_option="--cache-file=${cache_file}" ;;
  583. esac
  584. srcdiroption="--srcdir=${srcdir}"
  585. case "${build_alias}" in
  586. "") buildopt= ;;
  587. *) buildopt="--build=${build_alias}" ;;
  588. esac
  589. eval exec ${config_shell} ${srcdir}/configure ${verbose} \
  590. ${buildopt} --host=${host_alias} --target=${target_alias} \
  591. ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
  592. ${srcdiroption} ${diroptions} \
  593. ${program_prefixoption} ${program_suffixoption} \
  594. ${program_transform_nameoption} ${site_option} \
  595. ${withoptions} ${withoutoptions} \
  596. ${enableoptions} ${disableoptions} ${floating_pointoption} \
  597. ${cache_file_option} ${removing} ${other_options} ${redirect}
  598. else
  599. echo '***' There is no configure script present though. 1>&2
  600. fi
  601. fi
  602. exit 1
  603. ;;
  604. *) ;;
  605. esac
  606. case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
  607. "")
  608. echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
  609. exit 1
  610. ;;
  611. *) ;;
  612. esac
  613. case "${TMPDIR}" in
  614. "") TMPDIR=/tmp ; export TMPDIR ;;
  615. *) ;;
  616. esac
  617. # keep this filename short for &%*%$*# 14 char file names and 8+3 file names
  618. tmpdir=${TMPDIR}/cNf$$
  619. mkdir ${tmpdir} || exit 1
  620. tmpfile=${tmpdir}/cNf$$
  621. # Note that under many versions of sh a trap handler for 0 will *override* any
  622. # exit status you explicitly specify! At this point, the only non-error exit
  623. # is at the end of the script; these actions are duplicated there, minus
  624. # the "exit 1". Don't use "exit 0" anywhere after this without resetting the
  625. # trap handler, or you'll lose.
  626. trap "rm -rf Makefile.tem ${tmpdir}; exit 1" 0 1 2 15
  627. # split ${srcdir}/configure.in into common, per-host, per-target,
  628. # and post-target parts. Post-target is optional.
  629. sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
  630. sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
  631. if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
  632. sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
  633. sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
  634. else
  635. sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
  636. echo >${tmpfile}.pos
  637. fi
  638. ### do common part of configure.in
  639. # If the language specific compiler does not exist, but the "gcc" directory does,
  640. # we will skip this directory; in this case the sub-directory's common part
  641. # of configure.in will create a small shell script "skip-this-dir" containing
  642. # commands to completely clean up any temporary or created files.
  643. . ${tmpfile}.com
  644. if test -f skip-this-dir; then
  645. # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
  646. # and reset the trap handler.
  647. trap 0
  648. rm -rf Makefile* ${tmpdir}
  649. # Execute the final clean-up actions
  650. ${config_shell} skip-this-dir
  651. # and stop configuring this directory.
  652. exit 0
  653. fi
  654. # some sanity checks on configure.in
  655. case "${srctrigger}" in
  656. "")
  657. echo '***' srctrigger not set in ${PWD=`${PWDCMD-pwd}`}/configure.in. 1>&2
  658. exit 1
  659. ;;
  660. *) ;;
  661. esac
  662. case "${build_alias}" in
  663. "")
  664. if result=`${config_shell} ${configsub} ${host_alias}` ; then
  665. build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  666. build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  667. build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  668. build=${build_cpu}-${build_vendor}-${build_os}
  669. build_alias=${host_alias}
  670. fi
  671. ;;
  672. *)
  673. if result=`${config_shell} ${configsub} ${build_alias}` ; then
  674. buildopt="--build=${build_alias}"
  675. build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  676. build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  677. build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  678. build=${build_cpu}-${build_vendor}-${build_os}
  679. else
  680. echo "Unrecognized build system name ${build_alias}." 1>&2
  681. exit 1
  682. fi
  683. ;;
  684. esac
  685. if result=`${config_shell} ${configsub} ${host_alias}` ; then
  686. true
  687. else
  688. echo "Unrecognized host system name ${host_alias}." 1>&2
  689. exit 1
  690. fi
  691. host_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  692. host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  693. host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  694. host=${host_cpu}-${host_vendor}-${host_os}
  695. . ${tmpfile}.hst
  696. if result=`${config_shell} ${configsub} ${target_alias}` ; then
  697. true
  698. else
  699. echo "Unrecognized target system name ${target_alias}." 1>&2
  700. exit 1
  701. fi
  702. target_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  703. target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  704. target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  705. target=${target_cpu}-${target_vendor}-${target_os}
  706. . ${tmpfile}.tgt
  707. # Find the source files, if location was not specified.
  708. case "${srcdir}" in
  709. "")
  710. srcdirdefaulted=1
  711. srcdir=.
  712. if [ ! -r ${srctrigger} ] ; then
  713. srcdir=..
  714. fi
  715. ;;
  716. *) ;;
  717. esac
  718. if [ ! -r ${srcdir}/${srctrigger} ] ; then
  719. case "${srcdirdefaulted}" in
  720. "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/${srcdir}" 1>&2 ;;
  721. *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/. or ${PWD=`${PWDCMD-pwd}`}/.." 1>&2 ;;
  722. esac
  723. echo '***' \(At least ${srctrigger} is missing.\) 1>&2
  724. exit 1
  725. fi
  726. # Some systems (e.g., one of the i386-aix systems the gas testers are
  727. # using) don't handle "\$" correctly, so don't use it here.
  728. tooldir='$(exec_prefix)'/${target_alias}
  729. if [ "${host_alias}" != "${target_alias}" ] ; then
  730. if [ "${program_prefixoption}" = "" ] ; then
  731. if [ "${program_suffixoption}" = "" ] ; then
  732. if [ "${program_transform_nameoption}" = "" ] ; then
  733. program_prefix=${target_alias}- ;
  734. fi
  735. fi
  736. fi
  737. fi
  738. # Merge program_prefix and program_suffix onto program_transform_name.
  739. # (program_suffix used to use $, but it's hard to preserve $ through both
  740. # make and sh.)
  741. if [ "${program_suffix}" != "" ] ; then
  742. program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}"
  743. fi
  744. if [ "${program_prefix}" != "" ] ; then
  745. program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
  746. fi
  747. # If CC and CXX are not set in the environment, and the Makefile
  748. # exists, try to extract them from it. This is to handle running
  749. # ./config.status by hand.
  750. if [ -z "${CC}" ] && [ -r Makefile ]; then
  751. sed -n -e ':loop
  752. /\\$/ N
  753. s/\\\n//g
  754. t loop
  755. /^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  756. CC=`tail -1 Makefile.cc`
  757. rm -f Makefile.cc
  758. fi
  759. if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then
  760. sed -n -e ':loop
  761. /\\$/ N
  762. s/\\\n//g
  763. t loop
  764. /^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  765. CFLAGS=`tail -1 Makefile.cc`
  766. rm -f Makefile.cc
  767. fi
  768. if [ -z "${CXX}" ] && [ -r Makefile ]; then
  769. sed -n -e ':loop
  770. /\\$/ N
  771. s/\\\n//g
  772. t loop
  773. /^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  774. CXX=`tail -1 Makefile.cc`
  775. rm -f Makefile.cc
  776. fi
  777. if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then
  778. sed -n -e ':loop
  779. /\\$/ N
  780. s/\\\n//g
  781. t loop
  782. /^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
  783. CXXFLAGS=`tail -1 Makefile.cc`
  784. rm -f Makefile.cc
  785. fi
  786. # Generate a default definition for YACC. This is used if the makefile can't
  787. # locate bison or byacc in objdir.
  788. for prog in 'bison -y' byacc yacc
  789. do
  790. set dummy $prog; tmp=$2
  791. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  792. for dir in $PATH; do
  793. test -z "$dir" && dir=.
  794. if test -f $dir/$tmp; then
  795. DEFAULT_YACC="$prog"
  796. break
  797. fi
  798. done
  799. IFS="$save_ifs"
  800. test -n "$DEFAULT_YACC" && break
  801. done
  802. # Generate a default definition for M4. This is used if the makefile can't
  803. # locate m4 in objdir.
  804. for prog in gm4 gnum4 m4
  805. do
  806. set dummy $prog; tmp=$2
  807. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  808. for dir in $PATH; do
  809. test -z "$dir" && dir=.
  810. if test -f $dir/$tmp; then
  811. DEFAULT_M4="$prog"
  812. break
  813. fi
  814. done
  815. IFS="$save_ifs"
  816. test -n "$DEFAULT_M4" && break
  817. done
  818. # Generate a default definition for LEX. This is used if the makefile can't
  819. # locate flex in objdir.
  820. for prog in flex lex
  821. do
  822. set dummy $prog; tmp=$2
  823. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  824. for dir in $PATH; do
  825. test -z "$dir" && dir=.
  826. if test -f $dir/$tmp; then
  827. DEFAULT_LEX="$prog"
  828. break
  829. fi
  830. done
  831. IFS="$save_ifs"
  832. test -n "$DEFAULT_LEX" && break
  833. done
  834. if [ "${build}" != "${host}" ]; then
  835. # If we are doing a Canadian Cross, in which the host and build systems
  836. # are not the same, we set reasonable default values for the tools.
  837. tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD"
  838. tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET GCJ_FOR_TARGET"
  839. tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET BUILD_PREFIX"
  840. tools="${tools} BUILD_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
  841. tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
  842. tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
  843. tools="${tools} OBJCOPY OBJDUMP"
  844. for var in ${tools}; do
  845. if eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then
  846. sed -n -e ':loop
  847. /\\$/ N
  848. s/\\\n//g
  849. t loop
  850. /^'"${var}"'[ ]*=/ s/'"${var}"'[ ]*=[ ]*\(.*\)/\1/p' \
  851. < Makefile > Makefile.v
  852. t=`tail -1 Makefile.v`
  853. if [ -n "${t}" ]; then
  854. eval "${var}=\${t}"
  855. fi
  856. rm -f Makefile.v
  857. fi
  858. done
  859. AR=${AR-${host_alias}-ar}
  860. AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar}
  861. AS=${AS-${host_alias}-as}
  862. AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
  863. BISON=${BISON-bison}
  864. CC=${CC-${host_alias}-gcc}
  865. CFLAGS=${CFLAGS-"-g -O2"}
  866. CXX=${CXX-${host_alias}-c++}
  867. CXXFLAGS=${CXXFLAGS-"-g -O2"}
  868. CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
  869. CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
  870. CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
  871. GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
  872. DLLTOOL=${DLLTOOL-${host_alias}-dlltool}
  873. DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool}
  874. GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
  875. BUILD_PREFIX=${build_alias}-
  876. BUILD_PREFIX_1=${build_alias}-
  877. LD=${LD-${host_alias}-ld}
  878. LD_FOR_TARGET=${LD_FOR_TARGET-${target_alias}-ld}
  879. MAKEINFO=${MAKEINFO-makeinfo}
  880. NM=${NM-${host_alias}-nm}
  881. NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm}
  882. RANLIB=${RANLIB-${host_alias}-ranlib}
  883. RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib}
  884. WINDRES=${WINDRES-${host_alias}-windres}
  885. WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres}
  886. OBJCOPY=${OBJCOPY-${host_alias}-objcopy}
  887. OBJDUMP=${OBJDUMP-${host_alias}-objdump}
  888. if [ -z "${YACC}" ]; then
  889. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  890. for dir in $PATH; do
  891. test -z "$dir" && dir=.
  892. if test -f $dir/bison; then
  893. YACC="bison -y"
  894. break
  895. fi
  896. if test -f $dir/byacc; then
  897. YACC=byacc
  898. break
  899. fi
  900. if test -f $dir/yacc; then
  901. YACC=yacc
  902. break
  903. fi
  904. done
  905. IFS="$save_ifs"
  906. if [ -z "${YACC}" ]; then
  907. YACC="bison -y"
  908. fi
  909. fi
  910. if [ -z "${LEX}" ]; then
  911. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  912. for dir in $PATH; do
  913. test -z "$dir" && dir=.
  914. if test -f $dir/flex; then
  915. LEX=flex
  916. break
  917. fi
  918. if test -f $dir/lex; then
  919. LEX=lex
  920. break
  921. fi
  922. done
  923. IFS="$save_ifs"
  924. LEX=${LEX-flex}
  925. fi
  926. # Export variables which autoconf might try to set.
  927. export AS
  928. export AR
  929. export CC_FOR_BUILD
  930. export DLLTOOL
  931. export LD
  932. export NM
  933. export RANLIB
  934. export WINDRES
  935. export OBJCOPY
  936. export OBJDUMP
  937. else
  938. # If CC is still not set, try to get gcc.
  939. if [ -z "${CC}" ]; then
  940. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
  941. for dir in $PATH; do
  942. test -z "$dir" && dir=.
  943. if test -f $dir/gcc; then
  944. CC="gcc"
  945. echo 'void f(){}' > conftest.c
  946. if test -z "`${CC} -g -c conftest.c 2>&1`"; then
  947. CFLAGS=${CFLAGS-"-g -O2"}
  948. CXXFLAGS=${CXXFLAGS-"-g -O2"}
  949. else
  950. CFLAGS=${CFLAGS-"-O2"}
  951. CXXFLAGS=${CXXFLAGS-"-O2"}
  952. fi
  953. rm -f conftest*
  954. break
  955. fi
  956. done
  957. IFS="$save_ifs"
  958. CC=${CC-cc}
  959. else
  960. if test -z "${CFLAGS}"; then
  961. # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC
  962. # is set to a version of gcc.
  963. case "${CC}" in
  964. *gcc)
  965. echo 'void f(){}' > conftest.c
  966. if test -z "`${CC} -g -c conftest.c 2>&1`"; then
  967. CFLAGS=${CFLAGS-"-g -O2"}
  968. CXXFLAGS=${CXXFLAGS-"-g -O2"}
  969. else
  970. CFLAGS=${CFLAGS-"-O2"}
  971. CXXFLAGS=${CXXFLAGS-"-O2"}
  972. fi
  973. rm -f conftest*
  974. ;;
  975. esac
  976. fi
  977. fi
  978. CXX=${CXX-"c++"}
  979. CFLAGS=${CFLAGS-"-g"}
  980. CXXFLAGS=${CXXFLAGS-"-g -O2"}
  981. fi
  982. export CC
  983. export CXX
  984. export CFLAGS
  985. export CXXFLAGS
  986. all_build_modules=
  987. if test x"${build_alias}" != x"${host_alias}"
  988. then
  989. all_build_modules='$(ALL_BUILD_MODULES_LIST)'
  990. fi
  991. for subdir in . ${subdirs} ; do
  992. # ${subdir} is relative path from . to the directory we're currently
  993. # configuring.
  994. # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
  995. invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
  996. ### figure out what to do with srcdir
  997. case "${srcdir}" in
  998. ".") # no -srcdir option. We're building in place.
  999. makesrcdir=. ;;
  1000. /* | [A-Za-z]:[\\/]* ) # absolute path
  1001. makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
  1002. ;;
  1003. *) # otherwise relative
  1004. case "${subdir}" in
  1005. .) makesrcdir=${srcdir} ;;
  1006. *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
  1007. esac
  1008. ;;
  1009. esac
  1010. if [ "${subdir}/" != "./" ] ; then
  1011. Makefile=${subdir}/Makefile
  1012. fi
  1013. if [ ! -d ${subdir} ] ; then
  1014. if mkdir ${subdir} ; then
  1015. true
  1016. else
  1017. echo '***' "${progname}: could not make ${PWD=`${PWDCMD-pwd}`}/${subdir}" 1>&2
  1018. exit 1
  1019. fi
  1020. fi
  1021. case "${removing}" in
  1022. "")
  1023. case "${subdir}" in
  1024. .) ;;
  1025. *) eval echo Building in ${subdir} ${redirect} ;;
  1026. esac
  1027. # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
  1028. # Set up the list of links to be made.
  1029. # ${links} is the list of link names, and ${files} is the list of names to link to.
  1030. # Make the links.
  1031. configlinks="${links}"
  1032. if [ -r ${subdir}/config.status ] ; then
  1033. mv -f ${subdir}/config.status ${subdir}/config.back
  1034. fi
  1035. while [ -n "${files}" ] ; do
  1036. # set file to car of files, files to cdr of files
  1037. set ${files}; file=$1; shift; files=$*
  1038. set ${links}; link=$1; shift; links=$*
  1039. if [ ! -r ${srcdir}/${file} ] ; then
  1040. if [ ! -r ${file} ] ; then
  1041. echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
  1042. echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
  1043. exit 1
  1044. else
  1045. srcfile=${file}
  1046. fi
  1047. else
  1048. srcfile=${srcdir}/${file}
  1049. fi
  1050. ${remove} -f ${link}
  1051. # Make a symlink if possible, otherwise try a hard link
  1052. if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then
  1053. true
  1054. else
  1055. # We need to re-remove the file because Lynx leaves a
  1056. # very strange directory there when it fails an NFS symlink.
  1057. ${remove} -r -f ${link}
  1058. ${hard_link} ${srcfile} ${link}
  1059. fi
  1060. if [ ! -r ${link} ] ; then
  1061. echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2
  1062. exit 1
  1063. fi
  1064. echo "Linked \"${link}\" to \"${srcfile}\"."
  1065. done
  1066. # Create a .gdbinit file which runs the one in srcdir
  1067. # and tells GDB to look there for source files.
  1068. if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then
  1069. case ${srcdir} in
  1070. .) ;;
  1071. *) cat > ${subdir}/.gdbinit <<EOF
  1072. # ${NO_EDIT}
  1073. dir ${makesrcdir}
  1074. dir .
  1075. source ${makesrcdir}/.gdbinit
  1076. EOF
  1077. ;;
  1078. esac
  1079. fi
  1080. # Install a makefile, and make it set VPATH
  1081. # if necessary so that the sources are found.
  1082. # Also change its value of srcdir.
  1083. # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
  1084. # been somewhat optimized and is perhaps a bit twisty.
  1085. # code is order so as to try to sed the smallest input files we know.
  1086. # so do these separately because I don't trust the order of sed -e expressions.
  1087. # the five makefile fragments MUST end up in the resulting Makefile in this order:
  1088. # package macros, target, host, site, and package rules.
  1089. if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then
  1090. # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem.
  1091. rm -f ${subdir}/${Makefile}.tem
  1092. case "${package_makefile_rules_frag}" in
  1093. "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;;
  1094. *)
  1095. if [ ! -f ${package_makefile_rules_frag} ] ; then
  1096. package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag}
  1097. fi
  1098. if [ -f ${package_makefile_rules_frag} ] ; then
  1099. sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${subdir}/${Makefile_in} > ${Makefile}.tem
  1100. else
  1101. echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2
  1102. echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
  1103. cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem
  1104. fi
  1105. esac
  1106. # working copy now in ${Makefile}.tem
  1107. # Conditionalize for this site.
  1108. rm -f ${Makefile}
  1109. case "${site}" in
  1110. "") mv ${subdir}/Makefile.tem ${Makefile} ;;
  1111. *)
  1112. site_makefile_frag=${srcdir}/config/ms-${site}
  1113. if [ -f ${site_makefile_frag} ] ; then
  1114. sed -e "/^####/ r ${site_makefile_frag}" ${subdir}/Makefile.tem \
  1115. > ${Makefile}
  1116. else
  1117. mv ${subdir}/Makefile.tem ${Makefile}
  1118. site_makefile_frag=
  1119. fi
  1120. ;;
  1121. esac
  1122. # working copy now in ${Makefile}
  1123. # Conditionalize the makefile for this host.
  1124. rm -f ${subdir}/Makefile.tem
  1125. case "${host_makefile_frag}" in
  1126. "") mv ${Makefile} ${subdir}/Makefile.tem ;;
  1127. *)
  1128. if [ ! -f ${host_makefile_frag} ] ; then
  1129. host_makefile_frag=${srcdir}/${host_makefile_frag}
  1130. fi
  1131. if [ -f ${host_makefile_frag} ] ; then
  1132. sed -e "/^####/ r ${host_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
  1133. else
  1134. echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
  1135. echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
  1136. mv ${Makefile} ${subdir}/Makefile.tem
  1137. fi
  1138. esac
  1139. # working copy now in ${subdir)/Makefile.tem
  1140. # Conditionalize the makefile for this target.
  1141. rm -f ${Makefile}
  1142. case "${target_makefile_frag}" in
  1143. "") mv ${subdir}/Makefile.tem ${Makefile} ;;
  1144. *)
  1145. if [ ! -f ${target_makefile_frag} ] ; then
  1146. target_makefile_frag=${srcdir}/${target_makefile_frag}
  1147. fi
  1148. if [ -f ${target_makefile_frag} ] ; then
  1149. sed -e "/^####/ r ${target_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
  1150. else
  1151. mv ${subdir}/Makefile.tem ${Makefile}
  1152. target_makefile_frag=
  1153. fi
  1154. ;;
  1155. esac
  1156. # working copy now in ${Makefile}
  1157. # Emit the default values of this package's macros.
  1158. rm -f ${subdir}/Makefile.tem
  1159. case "${package_makefile_frag}" in
  1160. "") mv ${Makefile} ${subdir}/Makefile.tem ;;
  1161. *)
  1162. if [ ! -f ${package_makefile_frag} ] ; then
  1163. package_makefile_frag=${srcdir}/${package_makefile_frag}
  1164. fi
  1165. if [ -f ${package_makefile_frag} ] ; then
  1166. sed -e "/^####/ r ${package_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem
  1167. else
  1168. echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2
  1169. echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
  1170. mv ${Makefile} ${subdir}/Makefile.tem
  1171. fi
  1172. esac
  1173. # real copy now in ${subdir}/Makefile.tem
  1174. # prepend warning about editing, and a bunch of variables.
  1175. rm -f ${Makefile}
  1176. cat > ${Makefile} <<EOF
  1177. # ${NO_EDIT}
  1178. VPATH = ${makesrcdir}
  1179. links = ${configlinks}
  1180. host_alias = ${host_alias}
  1181. host_cpu = ${host_cpu}
  1182. host_vendor = ${host_vendor}
  1183. host_os = ${host_os}
  1184. host_canonical = ${host_cpu}-${host_vendor}-${host_os}
  1185. target_alias = ${target_alias}
  1186. target_cpu = ${target_cpu}
  1187. target_vendor = ${target_vendor}
  1188. target_os = ${target_os}
  1189. target_canonical = ${target_cpu}-${target_vendor}-${target_os}
  1190. EOF
  1191. case "${build}" in
  1192. "") ;;
  1193. *) cat >> ${Makefile} << EOF
  1194. build_alias = ${build_alias}
  1195. build_cpu = ${build_cpu}
  1196. build_vendor = ${build_vendor}
  1197. build_os = ${build_os}
  1198. build_canonical = ${build_cpu}-${build_vendor}-${build_os}
  1199. EOF
  1200. esac
  1201. case "${package_makefile_frag}" in
  1202. "") ;;
  1203. /* | [A-Za-z]:[\\/]* ) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;;
  1204. *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;;
  1205. esac
  1206. case "${target_makefile_frag}" in
  1207. "") ;;
  1208. /* | [A-Za-z]:[\\/]* ) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;;
  1209. *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;;
  1210. esac
  1211. case "${host_makefile_frag}" in
  1212. "") ;;
  1213. /* | [A-Za-z]:[\\/]* ) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;;
  1214. *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;;
  1215. esac
  1216. if [ "${site_makefile_frag}" != "" ] ; then
  1217. echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
  1218. fi
  1219. echo enable_shared = ${enable_shared} >> ${Makefile}
  1220. echo enable_threads = ${enable_threads} >> ${Makefile}
  1221. # record if we want to rumtime library stuff installed in libsubdir.
  1222. if test -z "${enable_version_specific_runtime_libs}"; then
  1223. echo enable_version_specific_runtime_libs = no >> ${Makefile}
  1224. else
  1225. echo enable_version_specific_runtime_libs = ${enable_version_specific_runtime_libs} >> ${Makefile}
  1226. fi
  1227. # Emit a macro which describes the file containing gcc's
  1228. # version number.
  1229. echo gcc_version_trigger = ${gcc_version_trigger} >> ${Makefile}
  1230. # And emit a macro defining gcc's version number.
  1231. echo gcc_version = ${gcc_version} >> ${Makefile}
  1232. # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
  1233. # remove any form feeds.
  1234. if [ -z "${subdirs}" ]; then
  1235. rm -f ${subdir}/Makefile.tm2
  1236. sedtemp=sed.$$
  1237. cat >$sedtemp <<EOF
  1238. s:@configdirs@:${configdirs}:
  1239. EOF
  1240. sed -f $sedtemp \
  1241. ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2
  1242. rm -f $sedtemp
  1243. rm -f ${subdir}/Makefile.tem
  1244. mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem
  1245. fi
  1246. sed -e "s|@prefix@|${prefix}|" \
  1247. -e "s|@exec_prefix@|${exec_prefix}|" \
  1248. -e "s|@bindir@|${bindir}|" \
  1249. -e "s|@sbindir@|${sbindir}|" \
  1250. -e "s|@libexecdir@|${libexecdir}|" \
  1251. -e "s|@datadir@|${datadir}|" \
  1252. -e "s|@sysconfdir@|${sysconfdir}|" \
  1253. -e "s|@sharedstatedir@|${sharedstatedir}|" \
  1254. -e "s|@localstatedir@|${localstatedir}|" \
  1255. -e "s|@libdir@|${libdir}|" \
  1256. -e "s|@includedir@|${includedir}|" \
  1257. -e "s|@oldincludedir@|${oldincludedir}|" \
  1258. -e "s|@infodir@|${infodir}|" \
  1259. -e "s|@mandir@|${mandir}|" \
  1260. -e "s|@all_build_modules@|${all_build_modules}|" \
  1261. -e "/^CC[ ]*=/{
  1262. :loop1
  1263. /\\\\$/ N
  1264. s/\\\\\\n//g
  1265. t loop1
  1266. s%^CC[ ]*=.*$%CC = ${CC}%
  1267. }" \
  1268. -e "/^CXX[ ]*=/{
  1269. :loop2
  1270. /\\\\$/ N
  1271. s/\\\\\\n//g
  1272. t loop2
  1273. s%^CXX[ ]*=.*$%CXX = ${CXX}%
  1274. }" \
  1275. -e "/^CFLAGS[ ]*=/{
  1276. :loop3
  1277. /\\\\$/ N
  1278. s/\\\\\\n//g
  1279. t loop3
  1280. s%^CFLAGS[ ]*=.*$%CFLAGS = ${CFLAGS}%
  1281. }" \
  1282. -e "/^CXXFLAGS[ ]*=/{
  1283. :loop4
  1284. /\\\\$/ N
  1285. s/\\\\\\n//g
  1286. t loop4
  1287. s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}%
  1288. }" \
  1289. -e "s|@config_shell@|${config_shell}|" \
  1290. -e "s|@srcdir@|${makesrcdir}|" \
  1291. -e "s/ //" \
  1292. -e "s:@program_transform_name@:${program_transform_name}:" \
  1293. -e "s|@tooldir@|${tooldir}|" \
  1294. -e "s|@build_tooldir@|${tooldir}|" \
  1295. -e "s:@DEFAULT_YACC@:${DEFAULT_YACC}:" \
  1296. -e "s:@DEFAULT_LEX@:${DEFAULT_LEX}:" \
  1297. -e "s:@DEFAULT_M4@:${DEFAULT_M4}:" \
  1298. ${subdir}/Makefile.tem >> ${Makefile}
  1299. sed -e "s:@GDB_TK@:${GDB_TK}:" ${Makefile} >${Makefile}.tem
  1300. mv -f ${Makefile}.tem ${Makefile}
  1301. # If this is a Canadian Cross, preset the values of many more
  1302. # tools.
  1303. if [ "${build}" != "${host}" ]; then
  1304. for var in ${tools}; do
  1305. eval val=\$${var}
  1306. sed -e "/^${var}[ ]*=/{
  1307. :loop1
  1308. /\\\\$/ N
  1309. /\\\\$/ b loop1
  1310. s/\\\\\\n//g
  1311. s%^${var}[ ]*=.*$%${var} = ${val}%
  1312. }" ${Makefile} > ${Makefile}.tem
  1313. mv -f ${Makefile}.tem ${Makefile}
  1314. done
  1315. fi
  1316. # final copy now in ${Makefile}
  1317. else
  1318. echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
  1319. fi
  1320. rm -f ${subdir}/Makefile.tem
  1321. case "${host_makefile_frag}" in
  1322. "") using= ;;
  1323. *) using="and \"${host_makefile_frag}\"" ;;
  1324. esac
  1325. case "${target_makefile_frag}" in
  1326. "") ;;
  1327. *) using="${using} and \"${target_makefile_frag}\"" ;;
  1328. esac
  1329. case "${site_makefile_frag}" in
  1330. "") ;;
  1331. *) using="${using} and \"${site_makefile_frag}\"" ;;
  1332. esac
  1333. newusing=`echo "${using}" | sed 's/and/using/'`
  1334. using=${newusing}
  1335. echo "Created \"${Makefile}\" in" ${PWD=`${PWDCMD-pwd}`} ${using}
  1336. . ${tmpfile}.pos
  1337. # describe the chosen configuration in config.status.
  1338. # Make that file a shellscript which will reestablish
  1339. # the same configuration. Used in Makefiles to rebuild
  1340. # Makefiles.
  1341. case "${norecursion}" in
  1342. "") arguments="${arguments} --norecursion" ;;
  1343. *) ;;
  1344. esac
  1345. if [ ${subdir} = . ] ; then
  1346. echo "#!/bin/sh
  1347. # ${NO_EDIT}
  1348. # This directory was configured as follows:
  1349. ${progname}" ${arguments} "
  1350. # ${using}" > ${subdir}/config.new
  1351. else
  1352. echo "#!/bin/sh
  1353. # ${NO_EDIT}
  1354. # This directory was configured as follows:
  1355. cd ${invsubdir}
  1356. ${progname}" ${arguments} "
  1357. # ${using}" > ${subdir}/config.new
  1358. fi
  1359. chmod a+x ${subdir}/config.new
  1360. if [ -r ${subdir}/config.back ] ; then
  1361. mv -f ${subdir}/config.back ${subdir}/config.status
  1362. fi
  1363. ${config_shell} ${moveifchange} ${subdir}/config.new ${subdir}/config.status
  1364. ;;
  1365. *) rm -f ${Makefile} ${subdir}/config.status ${links} ;;
  1366. esac
  1367. done
  1368. # If there are subdirectories, then recur.
  1369. if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then
  1370. for configdir in ${configdirs} ${extraconfigdirs} ; do
  1371. # If configdir contains ',' it is
  1372. # srcdir,builddir,target_alias
  1373. # These come from extraconfigdirs.
  1374. case ${configdir} in
  1375. *,*)
  1376. eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'`
  1377. ;;
  1378. *)
  1379. cfg_dir=${configdir}
  1380. bld_dir=${configdir}
  1381. tgt_alias=${target_alias}
  1382. ;;
  1383. esac
  1384. if [ -d ${srcdir}/${cfg_dir} ] ; then
  1385. eval echo Configuring ${configdir}... ${redirect}
  1386. case "${srcdir}" in
  1387. ".") ;;
  1388. *)
  1389. if [ ! -d ./${bld_dir} ] ; then
  1390. if mkdir ./${bld_dir} ; then
  1391. true
  1392. else
  1393. echo '***' "${progname}: could not make ${PWD=`${PWDCMD-pwd}`}/${bld_dir}" 1>&2
  1394. exit 1
  1395. fi
  1396. fi
  1397. ;;
  1398. esac
  1399. POPDIR=${PWD=`${PWDCMD-pwd}`}
  1400. cd ${bld_dir}
  1401. ### figure out what to do with srcdir
  1402. case "${srcdir}" in
  1403. ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
  1404. /* | [A-Za-z]:[\\/]* ) # absolute path
  1405. newsrcdir=${srcdir}/${cfg_dir}
  1406. srcdiroption="--srcdir=${newsrcdir}"
  1407. ;;
  1408. *) # otherwise relative
  1409. newsrcdir=../${srcdir}/${cfg_dir}
  1410. srcdiroption="--srcdir=${newsrcdir}"
  1411. ;;
  1412. esac
  1413. # Handle --cache-file=../XXX
  1414. case "${cache_file}" in
  1415. "") # empty
  1416. ;;
  1417. /* | [A-Za-z]:[\\/]* ) # absolute path
  1418. cache_file_option="--cache-file=${cache_file}"
  1419. ;;
  1420. *) # relative path
  1421. cache_file_option="--cache-file=../${cache_file}"
  1422. ;;
  1423. esac
  1424. ### check for guested configure, otherwise fix possibly relative progname
  1425. if [ -f ${newsrcdir}/configure ] ; then
  1426. recprog=${newsrcdir}/configure
  1427. elif [ -f ${newsrcdir}/configure.in ] ; then
  1428. case "${progname}" in
  1429. /* | [A-Za-z]:[\\/]* ) recprog=${progname} ;;
  1430. *) recprog=../${progname} ;;
  1431. esac
  1432. else
  1433. eval echo No configuration information in ${cfg_dir} ${redirect}
  1434. recprog=
  1435. fi
  1436. ### The recursion line is here.
  1437. if [ ! -z "${recprog}" ] ; then
  1438. if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${tgt_alias} \
  1439. ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
  1440. ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
  1441. true
  1442. else
  1443. echo Configure in `${PWDCMD-pwd}` failed, exiting. 1>&2
  1444. exit 1
  1445. fi
  1446. fi
  1447. cd ${POPDIR}
  1448. fi
  1449. done
  1450. fi
  1451. # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
  1452. # and reset the trap handler.
  1453. rm -rf ${tmpdir}
  1454. trap 0
  1455. exit 0
  1456. #
  1457. # Local Variables:
  1458. # fill-column: 131
  1459. # End:
  1460. #
  1461. # end of configure