1995-09-07 17:20:53 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script
|
|
|
|
dnl
|
|
|
|
AC_PREREG(2.0)
|
|
|
|
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-07 19:03:38 +00:00
|
|
|
AC_ARG_ENABLE(shared,
|
|
|
|
[ --enable-shared build shared BFD library],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) shared=true ;;
|
|
|
|
no) shared=false ;;
|
|
|
|
*) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
|
|
|
|
esac])dnl
|
1995-09-07 17:20:53 +00: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 03:42:05 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
# host-specific stuff:
|
1991-09-01 03:42:05 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
. ${srcdir}/configure.host
|
1991-09-01 03:42:05 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_SUBST(CFLAGS)
|
1996-02-07 19:03:38 +00:00
|
|
|
AC_SUBST(HLDFLAGS)
|
1995-09-07 17:20:53 +00: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-17 20:55:43 +00:00
|
|
|
|
1996-02-07 19:03:38 +00: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'
|
|
|
|
if test "${shared}" = "true"; then
|
|
|
|
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.
|
|
|
|
BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
AC_SUBST(BFDLIB)
|
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
|
|
|
|
AC_CHECK_FUNCS(sbrk)
|
1996-02-07 19:03:38 +00:00
|
|
|
AC_HEADER_DIRENT
|
1992-09-09 18:59:11 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
BFD_BINARY_FOPEN
|
1991-09-01 03:42:05 +00:00
|
|
|
|
1996-02-07 19:03:38 +00:00
|
|
|
BFD_NEED_DECLARATION(free)
|
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
# target-specific stuff:
|
1991-09-01 03:42:05 +00:00
|
|
|
|
1993-10-19 19:55:52 +00:00
|
|
|
# Canonicalize the secondary target names.
|
1995-09-07 17:20:53 +00:00
|
|
|
if test -n "$enable_targets"; then
|
1994-07-14 19:20:53 +00:00
|
|
|
for targ in `echo $enable_targets | sed 's/,/ /g'`
|
1993-10-19 19:55:52 +00:00
|
|
|
do
|
1995-09-07 17:20:53 +00:00
|
|
|
result=`$ac_config_sub $targ 2>/dev/null`
|
|
|
|
if test -n "$result"; then
|
1993-10-19 19:55:52 +00:00
|
|
|
canon_targets="$canon_targets $result"
|
|
|
|
else
|
|
|
|
# Allow targets that config.sub doesn't recognize, like "all".
|
|
|
|
canon_targets="$canon_targets $targ"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
all_targets=false
|
1995-09-07 17:20:53 +00:00
|
|
|
EMUL=
|
|
|
|
all_emuls=
|
1993-10-19 19:55:52 +00:00
|
|
|
|
|
|
|
for targ in $target $canon_targets
|
|
|
|
do
|
1995-09-07 17:20:53 +00:00
|
|
|
if test "x$targ" = "xall"; then
|
1993-10-19 19:55:52 +00:00
|
|
|
all_targets=true
|
|
|
|
else
|
1995-09-07 17:20:53 +00:00
|
|
|
. ${srcdir}/configure.tgt
|
1993-06-07 19:57:26 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
if test "x$targ" = "x$target"; then
|
|
|
|
EMUL=${targ_emul}
|
1993-10-19 19:55:52 +00:00
|
|
|
fi
|
1995-09-07 17:20:53 +00:00
|
|
|
|
|
|
|
all_emuls="${all_emuls} ${targ_emul} ${targ_extra_emuls}"
|
1993-10-19 19:55:52 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
AC_SUBST(EMUL)
|
1993-10-19 19:55:52 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
if test x${all_targets} = xfalse; then
|
1993-10-19 19:55:52 +00:00
|
|
|
# uniq the list.
|
|
|
|
f=""
|
1995-09-07 17:20:53 +00:00
|
|
|
for i in $all_emuls ; do
|
1993-10-19 19:55:52 +00:00
|
|
|
case " $f " in
|
1995-09-07 17:20:53 +00:00
|
|
|
*" e$i.o "*) ;;
|
|
|
|
*) f="$f e$i.o" ;;
|
1993-10-19 19:55:52 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
EMULATION_OFILES="$f"
|
1993-10-19 19:55:52 +00:00
|
|
|
|
|
|
|
else # all_targets is true
|
1995-09-07 17:20:53 +00:00
|
|
|
EMULATION_OFILES='$(ALL_EMULATIONS)'
|
1993-10-19 19:55:52 +00:00
|
|
|
fi # all_targets is true
|
|
|
|
|
1995-09-07 17:20:53 +00: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-17 20:55:43 +00:00
|
|
|
|
1995-09-07 17:20:53 +00:00
|
|
|
AC_OUTPUT(Makefile,
|
|
|
|
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
|