Commit ab339d62 by Alexandre Oliva Committed by Alexandre Oliva

configure.in: new flags --with-ld and --with-as...

	* configure.in: new flags --with-ld and --with-as, equivalent
	to setting LD and AS environment variables.  Test whether
	specified arguments are GNU commands, and report them with
	checking messages.  Use the specified AS for configure
	tests too.
	* configure: ditto
	* acconfig.h: add DEFAULT_ASSEMBLER and DEFAULT_LINKER
	* config.in: ditto
	* gcc.c (find_a_file): when looking for `as' and `ld', return
	the DEFAULT program if it exists
	* collect2.c (main): use DEFAULT_LINKER if it exists
	* gcc.c (find_a_file): the test for existence of a full
	pathname was reversed

From-SVN: r22629
parent 42820a49
Mon Sep 28 19:41:24 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
* configure.in: new flags --with-ld and --with-as, equivalent
to setting LD and AS environment variables. Test whether
specified arguments are GNU commands, and report them with
checking messages. Use the specified AS for configure
tests too.
* configure: ditto
* acconfig.h: add DEFAULT_ASSEMBLER and DEFAULT_LINKER
* config.in: ditto
* gcc.c (find_a_file): when looking for `as' and `ld', return
the DEFAULT program if it exists
* collect2.c (main): use DEFAULT_LINKER if it exists
* gcc.c (find_a_file): the test for existence of a full
pathname was reversed
Mon Sep 28 17:34:35 1998 Michael Meissner <meissner@cygnus.com>
* rs6000.h (ASM_OUTPUT_MI_THUNK): Only define on ELF systems.
......
......@@ -86,4 +86,11 @@
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
/* Define to enable the use of a default assembler. */
#undef DEFAULT_ASSEMBLER
/* Define to enable the use of a default linker. */
#undef DEFAULT_LINKER
@TOP@
......@@ -1075,6 +1075,11 @@ main (argc, argv)
/* Try to discover a valid linker/nm/strip to use. */
/* Maybe we know the right file to use (if not cross). */
#ifdef DEFAULT_LINKER
if (access (DEFAULT_LINKER, X_OK) == 0)
ld_file_name = DEFAULT_LINKER;
if (ld_file_name == 0)
#endif
#ifdef REAL_LD_FILE_NAME
ld_file_name = find_a_file (&path, REAL_LD_FILE_NAME);
if (ld_file_name == 0)
......
......@@ -88,6 +88,13 @@
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
/* Define to enable the use of a default assembler. */
#undef DEFAULT_ASSEMBLER
/* Define to enable the use of a default linker. */
#undef DEFAULT_LINKER
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
......
......@@ -90,12 +90,37 @@ AC_ARG_WITH(gnu-ld,
gnu_ld_flag="$with_gnu_ld",
gnu_ld_flag=no)
# With pre-defined ld
AC_ARG_WITH(ld,
[ --with-ld arrange to use the specified ld (full pathname).],
LD="$with_ld")
if test x"${LD+set}" = x"set"; then
if test ! -x "$LD"; then
AC_MSG_WARN([cannot execute: $LD: check --with-ld or env. var. LD])
elif test "GNU" = `$LD -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
gnu_ld_flag=yes
fi
AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$LD")
fi
# With GNU as
AC_ARG_WITH(gnu-as,
[ --with-gnu-as arrange to work with GNU as.],
gas_flag="$with_gnu_as",
gas_flag=no)
AC_ARG_WITH(as,
[ --with-as arrange to use the specified as (full pathname).],
AS="$with_as")
if test x"${AS+set}" = x"set"; then
if test ! -x "$AS"; then
AC_MSG_WARN([cannot execute: $AS: check --with-as or env. var. AS])
elif test "GNU" = `$AS -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
gas_flag=yes
fi
AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$AS")
fi
# With stabs
AC_ARG_WITH(stabs,
[ --with-stabs arrange to use stabs instead of host debug format.],
......@@ -254,6 +279,28 @@ AC_SUBST(stage1_warn_cflags)
AC_PROG_MAKE_SET
AC_MSG_CHECKING([whether a default assembler was specified])
if test x"${AS+set}" = x"set"; then
if test x"$with_gas" = x"no"; then
AC_MSG_RESULT([yes ($AS)])
else
AC_MSG_RESULT([yes ($AS - GNU as)])
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether a default linker was specified])
if test x"${LD+set}" = x"set"; then
if test x"$with_gnu_ld" = x"no"; then
AC_MSG_RESULT([yes ($LD)])
else
AC_MSG_RESULT([yes ($LD - GNU ld)])
fi
else
AC_MSG_RESULT(no)
fi
# Find some useful tools
AC_PROG_AWK
AC_PROG_LEX
......@@ -3621,7 +3668,9 @@ AC_MSG_CHECKING(assembler alignment features)
gcc_cv_as=
gcc_cv_as_alignment_features=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
if test -x as$host_exeext; then
if test -x "$AS"; then
gcc_cv_as=$AS
elif test -x as$host_exeext; then
# Build using assembler in the current directory.
gcc_cv_as=./as$host_exeext
elif test -f $gcc_cv_as_gas_srcdir/configure.in; then
......
......@@ -1983,6 +1983,26 @@ find_a_file (pprefix, name, mode)
struct prefix_list *pl;
int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
#ifdef DEFAULT_ASSEMBLER
if (! strcmp(name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0) {
name = DEFAULT_ASSEMBLER;
len = strlen(name)+1;
temp = xmalloc (len);
strcpy (temp, name);
return temp;
}
#endif
#ifdef DEFAULT_LINKER
if (! strcmp(name, "ld") && access (DEFAULT_LINKER, mode) == 0) {
name = DEFAULT_LINKER;
len = strlen(name)+1;
temp = xmalloc (len);
strcpy (temp, name);
return temp;
}
#endif
if (machine_suffix)
len += strlen (machine_suffix);
......@@ -1995,7 +2015,7 @@ find_a_file (pprefix, name, mode)
|| (DIR_SEPARATOR == '\\' && name[1] == ':'
&& (name[2] == DIR_SEPARATOR || name[2] == '/')))
{
if (access (name, mode))
if (access (name, mode) == 0)
{
strcpy (temp, name);
return temp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment