1995-09-07 19:20:53 +02: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
|
|
|
|
|
|
|
|
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 05:42:05 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
# host-specific stuff:
|
1991-09-01 05:42:05 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
. ${srcdir}/configure.host
|
1991-09-01 05:42:05 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
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 22:55:43 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
|
|
|
|
AC_CHECK_FUNCS(sbrk)
|
1992-09-09 20:59:11 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
BFD_BINARY_FOPEN
|
1991-09-01 05:42:05 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
# target-specific stuff:
|
1991-09-01 05:42:05 +02:00
|
|
|
|
1993-10-19 20:55:52 +01:00
|
|
|
# Canonicalize the secondary target names.
|
1995-09-07 19:20:53 +02:00
|
|
|
if test -n "$enable_targets"; then
|
1994-07-14 21:20:53 +02:00
|
|
|
for targ in `echo $enable_targets | sed 's/,/ /g'`
|
1993-10-19 20:55:52 +01:00
|
|
|
do
|
1995-09-07 19:20:53 +02:00
|
|
|
result=`$ac_config_sub $targ 2>/dev/null`
|
|
|
|
if test -n "$result"; then
|
1993-10-19 20:55:52 +01: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 19:20:53 +02:00
|
|
|
EMUL=
|
|
|
|
all_emuls=
|
1993-10-19 20:55:52 +01:00
|
|
|
|
|
|
|
for targ in $target $canon_targets
|
|
|
|
do
|
1995-09-07 19:20:53 +02:00
|
|
|
if test "x$targ" = "xall"; then
|
1993-10-19 20:55:52 +01:00
|
|
|
all_targets=true
|
|
|
|
else
|
1995-09-07 19:20:53 +02:00
|
|
|
. ${srcdir}/configure.tgt
|
1993-06-07 21:57:26 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
if test "x$targ" = "x$target"; then
|
|
|
|
EMUL=${targ_emul}
|
1993-10-19 20:55:52 +01:00
|
|
|
fi
|
1995-09-07 19:20:53 +02:00
|
|
|
|
|
|
|
all_emuls="${all_emuls} ${targ_emul} ${targ_extra_emuls}"
|
1993-10-19 20:55:52 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
AC_SUBST(EMUL)
|
1993-10-19 20:55:52 +01:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
if test x${all_targets} = xfalse; then
|
1993-10-19 20:55:52 +01:00
|
|
|
# uniq the list.
|
|
|
|
f=""
|
1995-09-07 19:20:53 +02:00
|
|
|
for i in $all_emuls ; do
|
1993-10-19 20:55:52 +01:00
|
|
|
case " $f " in
|
1995-09-07 19:20:53 +02:00
|
|
|
*" e$i.o "*) ;;
|
|
|
|
*) f="$f e$i.o" ;;
|
1993-10-19 20:55:52 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
EMULATION_OFILES="$f"
|
1993-10-19 20:55:52 +01:00
|
|
|
|
|
|
|
else # all_targets is true
|
1995-09-07 19:20:53 +02:00
|
|
|
EMULATION_OFILES='$(ALL_EMULATIONS)'
|
1993-10-19 20:55:52 +01:00
|
|
|
fi # all_targets is true
|
|
|
|
|
1995-09-07 19:20:53 +02: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 22:55:43 +02:00
|
|
|
|
1995-09-07 19:20:53 +02:00
|
|
|
AC_OUTPUT(Makefile,
|
|
|
|
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
|