1995-09-08 01:20:53 +08: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-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 ;;
|
|
|
|
*) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
|
|
|
|
esac])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
|
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
. ${srcdir}/configure.host
|
1991-09-01 12:42:05 +09:00
|
|
|
|
1995-09-08 01:20:53 +08:00
|
|
|
AC_SUBST(CFLAGS)
|
1996-02-08 03:03:38 +08:00
|
|
|
AC_SUBST(HLDFLAGS)
|
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'
|
|
|
|
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-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
|
|
|
|
1996-02-08 03:03:38 +08:00
|
|
|
BFD_NEED_DECLARATION(free)
|
|
|
|
|
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.
|
|
|
|
result=`$ac_config_sub $targ_alias 2>/dev/null`
|
|
|
|
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
|
|
|
|
1996-02-15 07:54:05 +08:00
|
|
|
if test x${all_targets} = xtrue; then
|
|
|
|
EMULATION_OFILES='$(ALL_EMULATIONS)'
|
|
|
|
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])
|