configure.ac 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl
  3. dnl And be careful when changing it! If you must add tests with square
  4. dnl brackets, be sure changequote invocations surround it.
  5. dnl
  6. dnl Copyright (C) 2012-2022 Free Software Foundation, Inc.
  7. dnl
  8. dnl This file is free software; you can redistribute it and/or modify
  9. dnl it under the terms of the GNU General Public License as published by
  10. dnl the Free Software Foundation; either version 3 of the License, or
  11. dnl (at your option) any later version.
  12. dnl
  13. dnl This program is distributed in the hope that it will be useful,
  14. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. dnl GNU General Public License for more details.
  17. dnl
  18. dnl You should have received a copy of the GNU General Public License
  19. dnl along with this program; see the file COPYING3. If not see
  20. dnl <http://www.gnu.org/licenses/>.
  21. dnl
  22. dnl v2.5 needed for --bindir et al
  23. m4_include([../bfd/version.m4])
  24. AC_INIT([gas], BFD_VERSION)
  25. AC_CONFIG_SRCDIR(as.h)
  26. dnl Autoconf 2.57 will find the aux dir without this. However, unless
  27. dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in
  28. dnl gas/ instead of gas/../.
  29. AC_CONFIG_AUX_DIR(..)
  30. AC_CANONICAL_TARGET
  31. AM_INIT_AUTOMAKE
  32. AM_SILENT_RULES([yes])
  33. AC_PROG_CC
  34. AC_GNU_SOURCE
  35. AC_USE_SYSTEM_EXTENSIONS
  36. LT_INIT
  37. ACX_LARGEFILE
  38. ACX_PROG_CMP_IGNORE_INITIAL
  39. AC_ARG_ENABLE(targets,
  40. [ --enable-targets alternative target configurations besides the primary],
  41. [case "${enableval}" in
  42. yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
  43. ;;
  44. no) enable_targets= ;;
  45. *) enable_targets=$enableval ;;
  46. esac])dnl
  47. ac_checking=
  48. . ${srcdir}/../bfd/development.sh
  49. test "$development" = true && ac_checking=yes
  50. AC_ARG_ENABLE(checking,
  51. [ --enable-checking enable run-time checks],
  52. [case "${enableval}" in
  53. no|none) ac_checking= ;;
  54. *) ac_checking=yes ;;
  55. esac])dnl
  56. if test x$ac_checking != x ; then
  57. AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.])
  58. fi
  59. # PR gas/19109
  60. # Decide the default method for compressing debug sections.
  61. ac_default_compressed_debug_sections=unset
  62. # Provide a configure time option to override our default.
  63. AC_ARG_ENABLE(compressed_debug_sections,
  64. AS_HELP_STRING([--enable-compressed-debug-sections={all,gas,none}],
  65. [compress debug sections by default]),
  66. [case ,"${enableval}", in
  67. ,yes, | ,all, | *,gas,*) ac_default_compressed_debug_sections=yes ;;
  68. ,no, | ,none,) ac_default_compressed_debug_sections=no ;;
  69. *) ac_default_compressed_debug_sections=unset ;;
  70. esac])dnl
  71. # PR gas/19520
  72. # Decide if x86 assembler should generate relax relocations.
  73. ac_default_x86_relax_relocations=unset
  74. # Provide a configure time option to override our default.
  75. AC_ARG_ENABLE(x86_relax_relocations,
  76. AS_HELP_STRING([--enable-x86-relax-relocations],
  77. [generate x86 relax relocations by default]),
  78. [case "${enableval}" in
  79. no) ac_default_x86_relax_relocations=0 ;;
  80. esac])dnl
  81. # Decide if ELF assembler should generate common symbols with the
  82. # STT_COMMON type.
  83. ac_default_elf_stt_common=unset
  84. # Provide a configure time option to override our default.
  85. AC_ARG_ENABLE(elf_stt_common,
  86. AS_HELP_STRING([--enable-elf-stt-common],
  87. [generate ELF common symbols with STT_COMMON type by default]),
  88. [case "${enableval}" in
  89. yes) ac_default_elf_stt_common=1 ;;
  90. esac])dnl
  91. # Decide if the ELF assembler should default to generating
  92. # GNU Build notes if none are provided by the input.
  93. ac_default_generate_build_notes=0
  94. # Provide a configuration option to override the default.
  95. AC_ARG_ENABLE(generate_build_notes,
  96. AS_HELP_STRING([--enable-generate-build-notes],
  97. [generate GNU Build notes if none are provided by the input]),
  98. [case "${enableval}" in
  99. yes) ac_default_generate_build_notes=1 ;;
  100. no) ac_default_generate_build_notes=0 ;;
  101. esac])dnl
  102. # Decide if the MIPS assembler should default to enable MIPS fix Loongson3
  103. # LLSC errata.
  104. ac_default_mips_fix_loongson3_llsc=unset
  105. # Provide a configuration option to override the default.
  106. AC_ARG_ENABLE(mips-fix-loongson3-llsc,
  107. AS_HELP_STRING([--enable-mips-fix-loongson3-llsc],
  108. [enable MIPS fix Loongson3 LLSC errata]),
  109. [case "${enableval}" in
  110. yes) ac_default_mips_fix_loongson3_llsc=1 ;;
  111. no) ac_default_mips_fix_loongson3_llsc=0 ;;
  112. esac])dnl
  113. # Decide if the x86 ELF assembler should default to generating GNU x86
  114. # used ISA and feature properties.
  115. ac_default_generate_x86_used_note=unset
  116. # Provide a configuration option to override the default.
  117. AC_ARG_ENABLE(x86-used-note,
  118. AS_HELP_STRING([--enable-x86-used-note],
  119. [generate GNU x86 used ISA and feature properties]),
  120. [case "${enableval}" in
  121. yes) ac_default_generate_x86_used_note=1 ;;
  122. no) ac_default_generate_x86_used_note=0 ;;
  123. esac])dnl
  124. # Decide if the RISC-V ELF assembler should default to generating attribute.
  125. ac_default_generate_riscv_attr=unset
  126. # Provide a configuration option to override the default.
  127. AC_ARG_ENABLE(default-riscv-attribute,
  128. AS_HELP_STRING([--enable-default-riscv-attribute],
  129. [generate RISC-V arch attribute by default]),
  130. [case "${enableval}" in
  131. yes) ac_default_generate_riscv_attr=1 ;;
  132. no) ac_default_generate_riscv_attr=0 ;;
  133. esac])dnl
  134. using_cgen=no
  135. AM_BINUTILS_WARNINGS
  136. # Generate a header file
  137. AC_CONFIG_HEADERS(config.h:config.in)
  138. dnl Option --with-cpu=TYPE allows configure type control of the default
  139. dnl cpu type within the assembler. Currently only the ARC target
  140. dnl supports this feature, but others may be added in the future.
  141. AC_ARG_WITH(cpu,
  142. AS_HELP_STRING([--with-cpu=CPU],
  143. [default cpu variant is CPU (currently only supported on ARC)]),
  144. [AC_DEFINE_UNQUOTED(TARGET_WITH_CPU,
  145. "${with_cpu}",
  146. [Target specific CPU.])],
  147. [])
  148. # PR 14072
  149. AH_VERBATIM([00_CONFIG_H_CHECK],
  150. [/* Check that config.h is #included before system headers
  151. (this works only for glibc, but that should be enough). */
  152. #if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
  153. # error config.h must be #included before system headers
  154. #endif
  155. #define __CONFIG_H__ 1])
  156. # If we are on a DOS filesystem, we must use gdb.ini rather than
  157. # .gdbinit.
  158. case "${host}" in
  159. *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*)
  160. GDBINIT="gdb.ini"
  161. AC_CONFIG_FILES(gdb.ini:gdbinit.in)
  162. ;;
  163. *)
  164. GDBINIT=".gdbinit"
  165. AC_CONFIG_FILES(.gdbinit:gdbinit.in)
  166. ;;
  167. esac
  168. AC_SUBST(GDBINIT)
  169. #We need this for the host.
  170. AC_C_BIGENDIAN
  171. te_file=generic
  172. # Makefile target for installing gas in $(tooldir)/bin.
  173. install_tooldir=install-exec-tooldir
  174. canon_targets=""
  175. all_targets=no
  176. if test -n "$enable_targets" ; then
  177. for t in `echo $enable_targets | sed 's/,/ /g'`; do
  178. if test $t = "all"; then
  179. all_targets=yes
  180. continue
  181. fi
  182. result=`$ac_config_sub $t 2>/dev/null`
  183. if test -n "$result" ; then
  184. canon_targets="$canon_targets $result"
  185. # else
  186. # # Permit "all", etc. We don't support it yet though.
  187. # canon_targets="$canon_targets $t"
  188. fi
  189. done
  190. GAS_UNIQ(canon_targets)
  191. fi
  192. emulations=""
  193. for this_target in $target $canon_targets ; do
  194. targ=${this_target}
  195. . ${srcdir}/configure.tgt
  196. case ${target_cpu} in
  197. crisv32)
  198. AC_DEFINE_UNQUOTED(DEFAULT_CRIS_ARCH, $arch,
  199. [Default CRIS architecture.])
  200. ;;
  201. esac
  202. if test ${this_target} = $target ; then
  203. target_cpu_type=${cpu_type}
  204. elif test ${target_cpu_type} != ${cpu_type} ; then
  205. continue
  206. fi
  207. generic_target=${cpu_type}-${target_vendor}-${target_os}
  208. case ${generic_target} in
  209. i386-*-msdosdjgpp* \
  210. | i386-*-go32* \
  211. | i386-go32-rtems*)
  212. AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?])
  213. ;;
  214. i386-*-linux-* | x86_64-*-linux-*)
  215. if test ${this_target} = $target \
  216. && test ${ac_default_generate_x86_used_note} = unset; then
  217. ac_default_generate_x86_used_note=1
  218. fi
  219. ;;
  220. i386-*-solaris2 \
  221. | x86_64-*-solaris2 \
  222. | i386-*-solaris2.[[0-9]] \
  223. | i386-*-solaris2.1[[01]] \
  224. | x86_64-*-solaris2.1[[01]])
  225. if test ${this_target} = $target \
  226. && test ${ac_default_x86_relax_relocations} = unset; then
  227. ac_default_x86_relax_relocations=0
  228. fi
  229. ;;
  230. microblaze*)
  231. ;;
  232. changequote(,)dnl
  233. ppc-*-aix[5-9].*)
  234. changequote([,])dnl
  235. AC_DEFINE(AIX_WEAK_SUPPORT, 1,
  236. [Define if using AIX 5.2 value for C_WEAKEXT.])
  237. ;;
  238. ppc-*-solaris*)
  239. if test ${this_target} = $target; then
  240. AC_DEFINE(TARGET_SOLARIS_COMMENT, 1,
  241. [Define if default target is PowerPC Solaris.])
  242. fi
  243. if test x${endian} = xbig; then
  244. AC_MSG_ERROR(Solaris must be configured little endian)
  245. fi
  246. ;;
  247. esac
  248. if test ${this_target} = $target ; then
  249. endian_def=
  250. if test x${endian} = xbig; then
  251. endian_def=1
  252. elif test x${endian} = xlittle; then
  253. endian_def=0
  254. fi
  255. if test x${endian_def} != x; then
  256. AC_DEFINE_UNQUOTED(TARGET_BYTES_BIG_ENDIAN, $endian_def,
  257. [Define as 1 if big endian.])
  258. fi
  259. fi
  260. # Other random stuff.
  261. case ${cpu_type} in
  262. mips)
  263. # Set mips_cpu to the name of the default CPU.
  264. case ${target_cpu} in
  265. mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el)
  266. mips_cpu=from-abi
  267. ;;
  268. mipsisa32 | mipsisa32el)
  269. mips_cpu=mips32
  270. ;;
  271. mipsisa32r2 | mipsisa32r2el)
  272. mips_cpu=mips32r2
  273. ;;
  274. mipsisa32r3 | mipsisa32r3el)
  275. mips_cpu=mips32r3
  276. ;;
  277. mipsisa32r5 | mipsisa32r5el)
  278. mips_cpu=mips32r5
  279. ;;
  280. mipsisa32r6 | mipsisa32r6el)
  281. mips_cpu=mips32r6
  282. ;;
  283. mipsisa64 | mipsisa64el)
  284. mips_cpu=mips64
  285. ;;
  286. mipsisa64r2 | mipsisa64r2el)
  287. mips_cpu=mips64r2
  288. ;;
  289. mipsisa64r3 | mipsisa64r3el)
  290. mips_cpu=mips64r3
  291. ;;
  292. mipsisa64r5 | mipsisa64r5el)
  293. mips_cpu=mips64r5
  294. ;;
  295. mipsisa64r6 | mipsisa64r6el)
  296. mips_cpu=mips64r6
  297. ;;
  298. mipstx39 | mipstx39el)
  299. mips_cpu=r3900
  300. ;;
  301. mips64vr | mips64vrel)
  302. mips_cpu=vr4100
  303. ;;
  304. mipsisa32r2* | mipsisa64r2*)
  305. changequote(,)dnl
  306. mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'`
  307. changequote([,])dnl
  308. ;;
  309. mipsisa32r6* | mipsisa64r6*)
  310. changequote(,)dnl
  311. mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r6//' -e 's/el$//'`
  312. changequote([,])dnl
  313. ;;
  314. mips64* | mipsisa64* | mipsisa32*)
  315. changequote(,)dnl
  316. mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'`
  317. changequote([,])dnl
  318. ;;
  319. mips*)
  320. changequote(,)dnl
  321. mips_cpu=`echo $target_cpu | sed -e 's/^mips//' -e 's/el$//'`
  322. changequote([,])dnl
  323. ;;
  324. *)
  325. AC_MSG_ERROR($target_cpu isn't a supported MIPS CPU name)
  326. ;;
  327. esac
  328. # See whether it's appropriate to set E_MIPS_ABI_O32 for o32
  329. # binaries. It's a GNU extension that some OSes don't understand.
  330. case ${target} in
  331. *-*-irix*)
  332. use_e_mips_abi_o32=0
  333. ;;
  334. *)
  335. use_e_mips_abi_o32=1
  336. ;;
  337. esac
  338. # Decide whether to generate 32-bit or 64-bit code by default.
  339. # Used to resolve -march=from-abi when an embedded ABI is selected.
  340. case ${target} in
  341. mips64*-*-* | mipsisa64*-*-*)
  342. mips_default_64bit=1
  343. ;;
  344. *)
  345. mips_default_64bit=0
  346. ;;
  347. esac
  348. # Decide which ABI to target by default.
  349. case ${target} in
  350. mips64*-linux* | mips-sgi-irix6* | mips64*-freebsd* \
  351. | mips64*-kfreebsd*-gnu | mips64*-ps2-elf*)
  352. mips_default_abi=N32_ABI
  353. ;;
  354. mips*-linux* | mips*-freebsd* | mips*-kfreebsd*-gnu)
  355. mips_default_abi=O32_ABI
  356. ;;
  357. mips64*-openbsd*)
  358. mips_default_abi=N64_ABI
  359. ;;
  360. *)
  361. mips_default_abi=NO_ABI
  362. ;;
  363. esac
  364. AC_DEFINE_UNQUOTED(MIPS_CPU_STRING_DEFAULT, "$mips_cpu",
  365. [Default CPU for MIPS targets. ])
  366. AC_DEFINE_UNQUOTED(USE_E_MIPS_ABI_O32, $use_e_mips_abi_o32,
  367. [Allow use of E_MIPS_ABI_O32 on MIPS targets. ])
  368. AC_DEFINE_UNQUOTED(MIPS_DEFAULT_64BIT, $mips_default_64bit,
  369. [Generate 64-bit code by default on MIPS targets. ])
  370. AC_DEFINE_UNQUOTED(MIPS_DEFAULT_ABI, $mips_default_abi,
  371. [Choose a default ABI for MIPS targets. ])
  372. ;;
  373. esac
  374. # Do we need the opcodes library?
  375. case ${cpu_type} in
  376. vax | tic30)
  377. ;;
  378. *)
  379. need_opcodes=yes
  380. case "${enable_shared}" in
  381. yes) shared_opcodes=true ;;
  382. *opcodes*) shared_opcodes=true ;;
  383. *) shared_opcodes=false ;;
  384. esac
  385. ;;
  386. esac
  387. # Any other special object files needed ?
  388. case ${cpu_type} in
  389. bfin)
  390. for f in config/bfin-parse.o config/bfin-lex-wrapper.o; do
  391. case " $extra_objects " in
  392. *" $f "*) ;;
  393. *) extra_objects="$extra_objects $f" ;;
  394. esac
  395. done
  396. ;;
  397. bpf)
  398. if test $this_target = $target ; then
  399. AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
  400. fi
  401. using_cgen=yes
  402. ;;
  403. epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k)
  404. using_cgen=yes
  405. ;;
  406. loongarch)
  407. for f in config/loongarch-parse.o config/loongarch-lex-wrapper.o; do
  408. case " $extra_objects " in
  409. *" $f "*) ;;
  410. *) extra_objects="$extra_objects $f" ;;
  411. esac
  412. done
  413. # --target=loongarch[32|64]-*-*. */
  414. if test $this_target = $target ; then
  415. AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
  416. fi
  417. ;;
  418. m32c)
  419. using_cgen=yes
  420. ;;
  421. frv)
  422. using_cgen=yes
  423. ;;
  424. m68k)
  425. f=config/m68k-parse.o
  426. case " $extra_objects " in
  427. *" $f "*) ;;
  428. *) extra_objects="$extra_objects $f" ;;
  429. esac
  430. ;;
  431. mep)
  432. using_cgen=yes
  433. ;;
  434. mips)
  435. for f in itbl-parse.o itbl-lex-wrapper.o itbl-ops.o; do
  436. case " $extra_objects " in
  437. *" $f "*) ;;
  438. *) extra_objects="$extra_objects $f" ;;
  439. esac
  440. done
  441. ;;
  442. mt)
  443. using_cgen=yes
  444. ;;
  445. nds32)
  446. # setup NDS32_LINUX_TOOLCHAIN definition
  447. if test "linux" = $em; then
  448. AC_DEFINE(NDS32_LINUX_TOOLCHAIN, 1,
  449. [Define value for nds32_linux_toolchain])
  450. else
  451. AC_DEFINE(NDS32_LINUX_TOOLCHAIN, 0,
  452. [Define default value for nds32_linux_toolchain])
  453. fi
  454. # Decide BASELINE, REDUCED_REGS, FPU_DP_EXT, FPU_SP_EXT features
  455. # based on arch_name.
  456. AC_MSG_CHECKING(for default configuration of --with-arch)
  457. if test "x${with_arch}" != x; then
  458. case ${with_arch} in
  459. v2j | v2s | v2f | v2 | v3m | v3j | v3s | v3f | v3 )
  460. AC_DEFINE_UNQUOTED(NDS32_DEFAULT_ARCH_NAME, "$with_arch",
  461. [Define value for nds32_arch_name])
  462. ;;
  463. *)
  464. AC_MSG_ERROR(This kind of arch name does *NOT* exist!)
  465. ;;
  466. esac
  467. fi
  468. AC_MSG_RESULT($with_arch)
  469. # Decide features one by one.
  470. AC_MSG_CHECKING(for default configuration of --enable-dx-regs)
  471. if test "x${enable_dx_regs}" = xyes; then
  472. AC_DEFINE(NDS32_DEFAULT_DX_REGS, 1,
  473. [Define value for nds32_dx_regs])
  474. else
  475. AC_DEFINE(NDS32_DEFAULT_DX_REGS, 0,
  476. [Define default value for nds32_dx_regs])
  477. fi
  478. AC_MSG_RESULT($enable_dx_regs)
  479. AC_MSG_CHECKING(for default configuration of --enable-perf-ext)
  480. if test "x${enable_perf_ext}" = xno; then
  481. AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 0,
  482. [Define value for nds32_perf_ext])
  483. else
  484. AC_DEFINE(NDS32_DEFAULT_PERF_EXT, 1,
  485. [Define default value for nds32_perf_ext])
  486. fi
  487. AC_MSG_RESULT($enable_perf_ext)
  488. AC_MSG_CHECKING(for default configuration of --enable-perf-ext2)
  489. if test "x${enable_perf_ext2}" = xno; then
  490. AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 0,
  491. [Define value for nds32_perf_ext2])
  492. else
  493. AC_DEFINE(NDS32_DEFAULT_PERF_EXT2, 1,
  494. [Define default value for nds32_perf_ext2])
  495. fi
  496. AC_MSG_RESULT($enable_perf_ext2)
  497. AC_MSG_CHECKING(for default configuration of --enable-string-ext)
  498. if test "x${enable_string_ext}" = xno; then
  499. AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 0,
  500. [Define value for nds32_string_ext])
  501. else
  502. AC_DEFINE(NDS32_DEFAULT_STRING_EXT, 1,
  503. [Define default value for nds32_string_ext])
  504. fi
  505. AC_MSG_RESULT($enable_string_ext)
  506. AC_MSG_CHECKING(for default configuration of --enable-audio-ext)
  507. if test "x${enable_audio_ext}" = xno; then
  508. AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 0,
  509. [Define value for nds32_audio_ext])
  510. else
  511. AC_DEFINE(NDS32_DEFAULT_AUDIO_EXT, 1,
  512. [Define default value for nds32_audio_ext])
  513. fi
  514. AC_MSG_RESULT($enable_audio_ext)
  515. AC_MSG_CHECKING(for default configuration of --enable-dsp-ext)
  516. if test "x${enable_dsp_ext}" = xno; then
  517. AC_DEFINE(NDS32_DEFAULT_DSP_EXT, 0,
  518. [Define value for nds32_dsp_ext])
  519. else
  520. AC_DEFINE(NDS32_DEFAULT_DSP_EXT, 1,
  521. [Define default value for nds32_dsp_ext])
  522. fi
  523. AC_MSG_RESULT($enable_dsp_ext)
  524. AC_MSG_CHECKING(for default configuration of --enable-zol-ext)
  525. if test "x${enable_zol_ext}" = xno; then
  526. AC_DEFINE(NDS32_DEFAULT_ZOL_EXT, 0,
  527. [Define value for nds32_zol_ext])
  528. else
  529. AC_DEFINE(NDS32_DEFAULT_ZOL_EXT, 1,
  530. [Define default value for nds32_zol_ext])
  531. fi
  532. AC_MSG_RESULT($enable_zol_ext)
  533. ;;
  534. aarch64 | i386 | s390 | sparc)
  535. if test $this_target = $target ; then
  536. AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
  537. fi
  538. ;;
  539. riscv)
  540. # --target=riscv[32|64]-*-*. */
  541. if test $this_target = $target ; then
  542. AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
  543. fi
  544. # --with-arch=<value>. The syntax of <value> is same as Gas option -march.
  545. AC_MSG_CHECKING(for default configuration of --with-arch)
  546. if test "x${with_arch}" != x; then
  547. AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ARCH_WITH_EXT, "$with_arch",
  548. [Define default value for RISC-V -march.])
  549. fi
  550. AC_MSG_RESULT($with_arch)
  551. # --with-isa-spec=[2.2|20190608|20191213].
  552. AC_MSG_CHECKING(for default configuration of --with-isa-spec)
  553. if test "x${with_isa_spec}" != x; then
  554. AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ISA_SPEC, "$with_isa_spec",
  555. [Define default value for RISC-V -misa-spec.])
  556. fi
  557. AC_MSG_RESULT($with_isa_spec)
  558. # --with-priv-spec=[1.9.1|1.10|1.11|1.12].
  559. AC_MSG_CHECKING(for default configuration of --with-priv-spec)
  560. if test "x${with_priv_spec}" != x; then
  561. AC_DEFINE_UNQUOTED(DEFAULT_RISCV_PRIV_SPEC, "$with_priv_spec",
  562. [Define default value for RISC-V -mpriv-spec])
  563. fi
  564. AC_MSG_RESULT($with_priv_spec)
  565. ;;
  566. rl78)
  567. f=config/rl78-parse.o
  568. case " $extra_objects " in
  569. *" $f "*) ;;
  570. *) extra_objects="$extra_objects $f" ;;
  571. esac
  572. ;;
  573. rx)
  574. f=config/rx-parse.o
  575. case " $extra_objects " in
  576. *" $f "*) ;;
  577. *) extra_objects="$extra_objects $f" ;;
  578. esac
  579. ;;
  580. xstormy16)
  581. using_cgen=yes
  582. ;;
  583. xc16x)
  584. using_cgen=yes
  585. ;;
  586. xtensa)
  587. f=config/xtensa-relax.o
  588. case " $extra_objects " in
  589. *" $f "*) ;;
  590. *) extra_objects="$extra_objects $f" ;;
  591. esac
  592. ;;
  593. *)
  594. ;;
  595. esac
  596. if test $using_cgen = yes ; then
  597. f=cgen.o
  598. case " $extra_objects " in
  599. *" $f "*) ;;
  600. *) extra_objects="$extra_objects $f" ;;
  601. esac
  602. fi
  603. # See if we really can support this configuration with the emulation code.
  604. if test $this_target = $target ; then
  605. obj_format=$fmt
  606. te_file=$em
  607. fi
  608. case ${te_file} in
  609. vms)
  610. f=config/te-vms.o
  611. case " $extra_objects " in
  612. *" $f "*) ;;
  613. *) extra_objects="$extra_objects $f" ;;
  614. esac ;;
  615. esac
  616. # From target name and format, produce a list of supported emulations.
  617. case ${generic_target}-${fmt} in
  618. mips-*-*-*) case "$endian" in
  619. big) emulation="mipsbelf mipslelf mipself" ;;
  620. *) emulation="mipslelf mipsbelf mipself" ;;
  621. esac ;;
  622. # i386-pc-pe-coff != i386-pc-coff.
  623. i386-*-pe-coff) ;;
  624. # Uncommenting the next line will turn on support for i386 AOUT
  625. # for the default linux configuration
  626. # i386-*-linux*-elf) emulation="i386elf i386aout" ;;
  627. #
  628. i386-*-aout) emulation="i386aout" ;;
  629. i386-*-coff) emulation="i386coff" ;;
  630. i386-*-elf) emulation="i386elf" ;;
  631. # Always all formats. The first stated emulation becomes the default.
  632. cris-*-*aout*) emulation="crisaout criself" ;;
  633. cris-*-*) emulation="criself crisaout" ;;
  634. esac
  635. emulations="$emulations $emulation"
  636. done
  637. if test ${ac_default_x86_relax_relocations} = unset; then
  638. ac_default_x86_relax_relocations=1
  639. fi
  640. AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_X86_RELAX_RELOCATIONS,
  641. $ac_default_x86_relax_relocations,
  642. [Define to 1 if you want to generate x86 relax relocations by default.])
  643. if test ${ac_default_elf_stt_common} = unset; then
  644. ac_default_elf_stt_common=0
  645. fi
  646. AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_ELF_STT_COMMON,
  647. $ac_default_elf_stt_common,
  648. [Define to 1 if you want to generate ELF common symbols with the
  649. STT_COMMON type by default.])
  650. AC_DEFINE_UNQUOTED(DEFAULT_GENERATE_BUILD_NOTES,
  651. $ac_default_generate_build_notes,
  652. [Define to 1 if you want to generate GNU Build attribute notes
  653. by default, if none are contained in the input.])
  654. if test ${ac_default_generate_x86_used_note} = unset; then
  655. ac_default_generate_x86_used_note=0
  656. fi
  657. AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE,
  658. $ac_default_generate_x86_used_note,
  659. [Define to 1 if you want to generate GNU x86 used ISA and feature
  660. properties by default.])
  661. if test ${ac_default_generate_riscv_attr} = unset; then
  662. ac_default_generate_riscv_attr=1
  663. fi
  664. AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ATTR,
  665. $ac_default_generate_riscv_attr,
  666. [Define to 1 if you want to generate RISC-V arch attribute by default.])
  667. if test ${ac_default_mips_fix_loongson3_llsc} = unset; then
  668. ac_default_mips_fix_loongson3_llsc=0
  669. fi
  670. AC_DEFINE_UNQUOTED(DEFAULT_MIPS_FIX_LOONGSON3_LLSC,
  671. $ac_default_mips_fix_loongson3_llsc,
  672. [Define to 1 if you want to fix Loongson3 LLSC Errata by default.])
  673. if test x$ac_default_compressed_debug_sections = xyes ; then
  674. AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
  675. fi
  676. # Turn on all targets if possible
  677. if test ${all_targets} = "yes"; then
  678. case ${target_cpu_type} in
  679. i386)
  680. case ${obj_format} in
  681. aout)
  682. emulations="$emulations i386coff i386elf"
  683. ;;
  684. coff)
  685. emulations="$emulations i386aout i386elf"
  686. ;;
  687. elf)
  688. emulations="$emulations i386aout i386coff"
  689. ;;
  690. esac
  691. ;;
  692. x86_64)
  693. case ${obj_format} in
  694. aout)
  695. emulations="$emulations i386coff i386elf"
  696. ;;
  697. coff)
  698. emulations="$emulations i386aout i386elf"
  699. ;;
  700. elf)
  701. emulations="$emulations i386aout i386coff"
  702. ;;
  703. esac
  704. ;;
  705. esac
  706. fi
  707. # PE code has way too many macros tweaking behaviour
  708. case ${te_file} in
  709. pe*) emulations="" ;;
  710. esac
  711. # Assign floating point type. Most processors with FP support
  712. # IEEE FP. On those that don't support FP at all, usually IEEE
  713. # is emulated.
  714. case ${target_cpu} in
  715. vax | pdp11 ) atof=vax ;;
  716. *) atof=ieee ;;
  717. esac
  718. case "${obj_format}" in
  719. "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
  720. esac
  721. # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU).
  722. cgen_cpu_prefix=""
  723. if test $using_cgen = yes ; then
  724. case ${target_cpu} in
  725. or1knd)
  726. cgen_cpu_prefix=or1k ;;
  727. *) cgen_cpu_prefix=${target_cpu} ;;
  728. esac
  729. AC_SUBST(cgen_cpu_prefix)
  730. AC_DEFINE(USING_CGEN, 1, [Using cgen code?])
  731. fi
  732. dnl
  733. dnl Make sure the desired support files exist.
  734. dnl
  735. if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
  736. AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
  737. fi
  738. if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
  739. AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
  740. fi
  741. # Some COFF configurations want these random other flags set.
  742. case ${obj_format} in
  743. coff)
  744. case ${target_cpu_type} in
  745. i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;;
  746. x86_64) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;;
  747. esac
  748. ;;
  749. esac
  750. # Getting this done right is going to be a bitch. Each configuration specified
  751. # with --enable-targets=... should be checked for environment, format, cpu
  752. # setting.
  753. #
  754. # For each configuration, the necessary object file support code must be linked
  755. # in. This might be only one, it might be up to four. The necessary emulation
  756. # code needs to be provided, too.
  757. #
  758. # And then there's "--enable-targets=all"....
  759. #
  760. # For now, just always do it for MIPS ELF configurations. Sigh.
  761. formats="${obj_format}"
  762. emfiles=""
  763. EMULATIONS=""
  764. GAS_UNIQ(emulations)
  765. for em in . $emulations ; do
  766. case $em in
  767. .) continue ;;
  768. mipsbelf | mipslelf | mipself)
  769. fmt=elf file=mipself ;;
  770. *coff)
  771. fmt=coff file=$em ;;
  772. *aout)
  773. fmt=aout file=$em ;;
  774. *elf)
  775. fmt=elf file=$em ;;
  776. esac
  777. formats="$formats $fmt"
  778. emfiles="$emfiles config/e-$file.o"
  779. EMULATIONS="$EMULATIONS &$em,"
  780. done
  781. GAS_UNIQ(formats)
  782. GAS_UNIQ(emfiles)
  783. if test `set . $formats ; shift ; echo $#` -gt 1 ; then
  784. for fmt in $formats ; do
  785. case $fmt in
  786. aout) AC_DEFINE(OBJ_MAYBE_AOUT, 1, [a.out support?]) ;;
  787. coff) AC_DEFINE(OBJ_MAYBE_COFF, 1, [COFF support?]) ;;
  788. ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF, 1, [ECOFF support?]) ;;
  789. elf) AC_DEFINE(OBJ_MAYBE_ELF, 1, [ELF support?]) ;;
  790. generic) AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;;
  791. som) AC_DEFINE(OBJ_MAYBE_SOM, 1, [SOM support?]) ;;
  792. esac
  793. extra_objects="$extra_objects config/obj-$fmt.o"
  794. done
  795. obj_format=multi
  796. fi
  797. if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
  798. DEFAULT_EMULATION=`set . $emulations ; echo $2`
  799. # e-mipself has more than one emulation per file, e-i386* has just one at the
  800. # moment. If only one emulation is specified, then don't define
  801. # USE_EMULATIONS or include any of the e-files as they will only be bloat.
  802. case "${obj_format}${emfiles}" in
  803. multi* | *mipself*)
  804. extra_objects="$extra_objects $emfiles"
  805. AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;;
  806. esac
  807. fi
  808. AC_SUBST(extra_objects)
  809. AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.])
  810. AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION",
  811. [Default emulation.])
  812. reject_dev_configs=yes
  813. case ${reject_dev_configs}-${dev} in
  814. yes-yes) # Oops.
  815. AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
  816. ;;
  817. esac
  818. AC_SUBST(target_cpu_type)
  819. AC_SUBST(obj_format)
  820. AC_SUBST(te_file)
  821. AC_SUBST(install_tooldir)
  822. AC_SUBST(atof)
  823. dnl AC_SUBST(emulation)
  824. # do we need the opcodes library?
  825. case "${need_opcodes}" in
  826. yes)
  827. OPCODES_LIB=../opcodes/libopcodes.la
  828. ;;
  829. esac
  830. AC_SUBST(OPCODES_LIB)
  831. AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.])
  832. AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}", [Canonical target.])
  833. AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}", [Target CPU.])
  834. AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}", [Target vendor.])
  835. AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.])
  836. AC_PROG_YACC
  837. AM_PROG_LEX
  838. ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
  839. ZW_GNU_GETTEXT_SISTER_DIR
  840. AM_PO_SUBDIRS
  841. AM_MAINTAINER_MODE
  842. AM_CONDITIONAL(GENINSRC_NEVER, false)
  843. AC_EXEEXT
  844. AC_CHECK_HEADERS(memory.h sys/stat.h sys/types.h unistd.h)
  845. # Put this here so that autoconf's "cross-compiling" message doesn't confuse
  846. # people who are not cross-compiling but are compiling cross-assemblers.
  847. AC_MSG_CHECKING(whether compiling a cross-assembler)
  848. if test "${host}" = "${target}"; then
  849. cross_gas=no
  850. else
  851. cross_gas=yes
  852. AC_DEFINE(CROSS_COMPILE, 1, [Compiling cross-assembler?])
  853. fi
  854. AC_MSG_RESULT($cross_gas)
  855. AC_CHECK_FUNCS(strsignal)
  856. AM_LC_MESSAGES
  857. # do we need the math library?
  858. case "${need_libm}" in
  859. yes)
  860. LT_LIB_M
  861. AC_SUBST(LIBM)
  862. ;;
  863. esac
  864. # Some non-ANSI preprocessors botch requoting inside strings. That's bad
  865. # enough, but on some of those systems, the assert macro relies on requoting
  866. # working properly!
  867. GAS_WORKING_ASSERT
  868. # On some systems, the system header files may not declare malloc, realloc,
  869. # and free. There are places where gas needs these functions to have been
  870. # declared -- such as when taking their addresses.
  871. gas_test_headers="
  872. #ifdef HAVE_MEMORY_H
  873. #include <memory.h>
  874. #endif
  875. #include <string.h>
  876. #include <stdlib.h>
  877. #ifdef HAVE_UNISTD_H
  878. #include <unistd.h>
  879. #endif
  880. "
  881. AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
  882. AC_CACHE_VAL(gas_cv_decl_getopt_unistd_h,
  883. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
  884. gas_cv_decl_getopt_unistd_h=yes, gas_cv_decl_getopt_unistd_h=no)])
  885. AC_MSG_RESULT($gas_cv_decl_getopt_unistd_h)
  886. if test $gas_cv_decl_getopt_unistd_h = yes; then
  887. AC_DEFINE([HAVE_DECL_GETOPT], 1,
  888. [Is the prototype for getopt in <unistd.h> in the expected format?])
  889. fi
  890. GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers)
  891. GAS_CHECK_DECL_NEEDED(ffs, f, int (*f)(int), $gas_test_headers)
  892. AC_CHECK_DECLS([asprintf, mempcpy, stpcpy])
  893. BFD_BINARY_FOPEN
  894. # Link in zlib if we can. This allows us to write compressed debug sections.
  895. AM_ZLIB
  896. # Support for VMS timestamps via cross compile
  897. if test "$ac_cv_header_time_h" = yes; then
  898. GAS_HAVE_TIME_TYPE_MEMBER(struct tm, tm_gmtoff)
  899. fi
  900. if test "$ac_cv_header_sys_stat_h" = yes; then
  901. GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_sec)
  902. GAS_HAVE_SYS_STAT_TYPE_MEMBER(struct stat, st_mtim, tv_nsec)
  903. fi
  904. dnl Required for html, pdf, install-pdf and install-html targets.
  905. AC_SUBST(datarootdir)
  906. AC_SUBST(docdir)
  907. AC_SUBST(htmldir)
  908. AC_SUBST(pdfdir)
  909. dnl This must come last.
  910. dnl We used to make symlinks to files in the source directory, but now
  911. dnl we just use the right name for .c files, and create .h files in
  912. dnl the build directory which include the right .h file. Make sure
  913. dnl the old symlinks don't exist, so that a reconfigure in an existing
  914. dnl directory behaves reasonably.
  915. AC_CONFIG_FILES(Makefile po/Makefile.in:po/Make-in)
  916. AC_CONFIG_COMMANDS([default],
  917. [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
  918. echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
  919. echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
  920. echo '#include "te-'"${te_file}"'.h"' > targ-env.h
  921. echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
  922. if test "x$cgen_cpu_prefix" != x ; then
  923. echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h
  924. fi],
  925. [target_cpu_type=${target_cpu_type}
  926. cgen_cpu_prefix=${cgen_cpu_prefix}
  927. obj_format=${obj_format}
  928. te_file=${te_file}])
  929. AC_OUTPUT
  930. GNU_MAKE_JOBSERVER