1995-09-08 01:20:53 +08:00
|
|
|
dnl Process this file with autoconf to produce a configure script
|
|
|
|
dnl
|
1997-07-29 09:34:09 +08:00
|
|
|
AC_PREREG(2.5)
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_INIT(ldmain.c)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(targets,
|
|
|
|
[ --enable-targets alternative target configurations],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
|
|
|
|
;;
|
|
|
|
no) enable_targets= ;;
|
|
|
|
*) enable_targets=$enableval ;;
|
|
|
|
esac])dnl
|
1996-02-08 03:03:38 +08:00
|
|
|
AC_ARG_ENABLE(shared,
|
|
|
|
[ --enable-shared build shared BFD library],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) shared=true ;;
|
|
|
|
no) shared=false ;;
|
1997-07-29 09:34:09 +08:00
|
|
|
*bfd*) shared=true ;;
|
|
|
|
*) shared=false ;;
|
1996-02-08 03:03:38 +08:00
|
|
|
esac])dnl
|
1997-07-29 09:34:09 +08:00
|
|
|
AC_ARG_ENABLE(64-bit-bfd,
|
|
|
|
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) want64=true ;;
|
|
|
|
no) want64=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
|
|
|
|
esac],[want64=false])dnl
|
1995-09-08 01:20:53 +08:00
|
|
|
|
|
|
|
AC_CONFIG_HEADER(config.h:config.in)
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
if test -z "$target" ; then
|
|
|
|
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
|
|
|
|
fi
|
|
|
|
if test -z "$host" ; then
|
|
|
|
AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
|
|
|
|
fi
|
|
|
|
AC_ARG_PROGRAM
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
# host-specific stuff:
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1996-02-16 05:32:43 +08:00
|
|
|
AC_PROG_CC
|
1997-07-29 09:34:09 +08:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
CY_CYGWIN32
|
|
|
|
CY_EXEEXT
|
1996-02-16 05:32:43 +08:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
. ${srcdir}/configure.host
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1996-02-08 03:03:38 +08:00
|
|
|
AC_SUBST(HLDFLAGS)
|
1997-07-29 09:34:09 +08:00
|
|
|
AC_SUBST(HLDENV)
|
1996-02-16 03:00:07 +08:00
|
|
|
AC_SUBST(RPATH_ENVVAR)
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_SUBST(HDEFINES)
|
|
|
|
AC_SUBST(HOSTING_CRT0)
|
|
|
|
AC_SUBST(HOSTING_LIBS)
|
|
|
|
AC_SUBST(NATIVE_LIB_DIRS)
|
* ldfile.c (ldfile_open_command): Don't try .ld extension.
It wasn't documented (or likely used) and wastes time.
(try_open): If EXTEN is empty, don't try it.
* ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c,
ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c,
ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls
with normal function declarations.
* Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh.
Move *.sc-sh to scripttempl/*.sc.
* {emultempl,emulparams,scripttempl}/README: New files.
* sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files
removed, replaced with generic.em.
* h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from
h8[35]00hms.s[ch]. Change their contents to omit the "hms".
* *.em (*_get_script): Return script name instead of script contents.
* ldlang.c (lang_process): Change caller.
* ldlex.l, ldgram.y: Recognize -m option.
Check for input files after *all* options in grammar.
* ldmain.c (main): Check for -m options. Add default directory
for -m.
* mkscript.c: File removed.
* genscripts.sh: Take two more parameters, tooldirlib and libdir,
to add to the default LIB_PATH.
Look for input files in the new subdirectories.
Create the scripts in emulations subdirectory and don't filter
them through mkscript.
* configure.in: Make the emulations subdirectory.
* Makefile.in: Account for all of the above changes.
Remove unused .SUFFIXES. Get libgcc.a path with gcc
-print-libgcc-file-name instead of $(libdir)/libgcc.a.
Put CFLAGS last in the compilation rules.
Add -I../bfd to INCLUDES so sysdep.h is found.
* ldfile.c (try_open): If opening without the extension fails,
try with the extension even if -v or -V was given.
had_script is imported (from ldgram.y), not exported.
1993-06-18 04:55:43 +08:00
|
|
|
|
1996-02-08 03:03:38 +08:00
|
|
|
# For most hosts we can use a simple definition to pick up the BFD and
|
|
|
|
# opcodes libraries. However, if we are building shared libraries, we
|
|
|
|
# need to handle some hosts specially.
|
|
|
|
BFDLIB='-L../bfd -lbfd'
|
1997-07-29 09:34:09 +08:00
|
|
|
case "${host}" in
|
|
|
|
*-*-sunos*)
|
|
|
|
# On SunOS, we must link against the name we are going to install,
|
|
|
|
# not -lbfd, since SunOS does not support SONAME.
|
|
|
|
if test "${shared}" = "true"; then
|
1996-02-08 03:03:38 +08:00
|
|
|
BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
|
1997-07-29 09:34:09 +08:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
alpha*-*-osf*)
|
|
|
|
# On Alpha OSF/1, the native linker searches all the -L
|
|
|
|
# directories for any LIB.so files, and only then searches for any
|
|
|
|
# LIB.a files. That means that if there is an installed
|
|
|
|
# libbfd.so, but this build is not done with --enable-shared, the
|
|
|
|
# link will wind up being against the install libbfd.so rather
|
|
|
|
# than the newly built libbfd. To avoid this, we must explicitly
|
|
|
|
# link against libbfd.a when --enable-shared is not used.
|
|
|
|
if test "${shared}" != "true"; then
|
|
|
|
BFDLIB='../bfd/libbfd.a'
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
1996-02-08 03:03:38 +08:00
|
|
|
AC_SUBST(BFDLIB)
|
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
|
|
|
|
AC_CHECK_FUNCS(sbrk)
|
1996-02-08 03:03:38 +08:00
|
|
|
AC_HEADER_DIRENT
|
1992-09-10 02:59:11 +08:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
BFD_BINARY_FOPEN
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1997-07-29 09:34:09 +08:00
|
|
|
BFD_NEED_DECLARATION(strstr)
|
1996-02-08 03:03:38 +08:00
|
|
|
BFD_NEED_DECLARATION(free)
|
1997-07-29 09:34:09 +08:00
|
|
|
BFD_NEED_DECLARATION(sbrk)
|
|
|
|
BFD_NEED_DECLARATION(getenv)
|
1996-02-08 03:03:38 +08:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
# target-specific stuff:
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
all_targets=
|
1995-09-08 01:20:53 +08:00
|
|
|
EMUL=
|
|
|
|
all_emuls=
|
1996-02-15 07:54:05 +08:00
|
|
|
TDIRS=
|
1993-10-20 03:55:52 +08:00
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
|
1993-10-20 03:55:52 +08:00
|
|
|
do
|
1996-02-15 07:54:05 +08:00
|
|
|
if test "$targ_alias" = "all"; then
|
|
|
|
all_targets=true
|
|
|
|
else
|
|
|
|
# Canonicalize the secondary target names.
|
1997-07-29 09:34:09 +08:00
|
|
|
result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null`
|
1996-02-15 07:54:05 +08:00
|
|
|
if test -n "$result"; then
|
|
|
|
targ=$result
|
1993-10-20 03:55:52 +08:00
|
|
|
else
|
1996-02-15 07:54:05 +08:00
|
|
|
targ=$targ_alias
|
|
|
|
fi
|
1993-06-08 03:57:26 +08:00
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
. ${srcdir}/configure.tgt
|
1995-09-08 01:20:53 +08:00
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
if test "$targ" = "$target"; then
|
|
|
|
EMUL=$targ_emul
|
1993-10-20 03:55:52 +08:00
|
|
|
fi
|
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
for i in $targ_emul $targ_extra_emuls; do
|
|
|
|
case " $all_emuls " in
|
|
|
|
*" e${i}.o "*) ;;
|
|
|
|
*)
|
|
|
|
all_emuls="$all_emuls e${i}.o"
|
|
|
|
eval result=\$tdir_$i
|
|
|
|
test -z "$result" && result=$targ_alias
|
|
|
|
TDIRS="$TDIRS\\
|
|
|
|
tdir_$i=$result"
|
|
|
|
;;
|
1993-10-20 03:55:52 +08:00
|
|
|
esac
|
|
|
|
done
|
1996-02-15 07:54:05 +08:00
|
|
|
fi
|
|
|
|
done
|
1993-10-20 03:55:52 +08:00
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
AC_SUBST(EMUL)
|
|
|
|
AC_SUBST(TDIRS)
|
1993-10-20 03:55:52 +08:00
|
|
|
|
1997-07-29 09:34:09 +08:00
|
|
|
dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
|
|
|
|
dnl target, and in those cases we should also build the 64 bit
|
|
|
|
dnl emulations.
|
1996-02-15 07:54:05 +08:00
|
|
|
if test x${all_targets} = xtrue; then
|
1997-07-29 09:34:09 +08:00
|
|
|
if test x${want64} = xtrue; then
|
|
|
|
EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
|
|
|
|
else
|
|
|
|
EMULATION_OFILES='$(ALL_EMULATIONS)'
|
|
|
|
fi
|
1996-02-15 07:54:05 +08:00
|
|
|
else
|
|
|
|
EMULATION_OFILES=$all_emuls
|
|
|
|
fi
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_SUBST(EMULATION_OFILES)
|
* ldfile.c (ldfile_open_command): Don't try .ld extension.
It wasn't documented (or likely used) and wastes time.
(try_open): If EXTEN is empty, don't try it.
* ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c,
ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c,
ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls
with normal function declarations.
* Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh.
Move *.sc-sh to scripttempl/*.sc.
* {emultempl,emulparams,scripttempl}/README: New files.
* sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files
removed, replaced with generic.em.
* h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from
h8[35]00hms.s[ch]. Change their contents to omit the "hms".
* *.em (*_get_script): Return script name instead of script contents.
* ldlang.c (lang_process): Change caller.
* ldlex.l, ldgram.y: Recognize -m option.
Check for input files after *all* options in grammar.
* ldmain.c (main): Check for -m options. Add default directory
for -m.
* mkscript.c: File removed.
* genscripts.sh: Take two more parameters, tooldirlib and libdir,
to add to the default LIB_PATH.
Look for input files in the new subdirectories.
Create the scripts in emulations subdirectory and don't filter
them through mkscript.
* configure.in: Make the emulations subdirectory.
* Makefile.in: Account for all of the above changes.
Remove unused .SUFFIXES. Get libgcc.a path with gcc
-print-libgcc-file-name instead of $(libdir)/libgcc.a.
Put CFLAGS last in the compilation rules.
Add -I../bfd to INCLUDES so sysdep.h is found.
* ldfile.c (try_open): If opening without the extension fails,
try with the extension even if -v or -V was given.
had_script is imported (from ldgram.y), not exported.
1993-06-18 04:55:43 +08:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_OUTPUT(Makefile,
|
|
|
|
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
|