OSDN Git Service

PT_GNU_STACK markings make no sense with FLAT binaries, so discard the
[uclinux-h8/elf2flt.git] / configure.in
index d6e9d44..5ab8983 100644 (file)
@@ -37,6 +37,12 @@ AC_ARG_WITH(binutils-ldscript-dir,
        [ ac_binutils_ldscript_dir=NONE ]
 )
 
+AC_ARG_WITH(binutils-build-dir,
+       [ --with-binutils-build-dir=<dir>  path to compiled binutils tree ],
+       [ ac_binutils_build_dir=$withval ],
+       [ ac_binutils_build_dir=NONE ]
+)
+
 AC_ARG_ENABLE(got-check,
        [ --disable-got-check - disable check for GOT (needed on H8) ],
        [ got_check=$enableval ],
@@ -56,6 +62,13 @@ dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
 
+if test "$ac_binutils_build_dir" != "NONE"; then
+  test "$ac_libbfd"               = "NONE" && ac_libbfd="$ac_binutils_build_dir/bfd/libbfd.a"
+  test "$ac_libiberty"            = "NONE" && ac_libiberty="$ac_binutils_build_dir/libiberty/libiberty.a"
+  test "$ac_bfd_include_dir"      = "NONE" && ac_bfd_include_dir="$ac_binutils_build_dir/bfd"
+  test "$ac_binutils_include_dir" = "NONE" && ac_binutils_include_dir="$ac_binutils_build_dir/include"
+fi
+
 dnl Checks for libraries.
 if test "$ac_libiberty" = "NONE"; then
   AC_CHECK_LIB(iberty, objalloc_create)
@@ -122,6 +135,13 @@ Run configure again specifying these options:
 ])
 fi
 
+dnl Make sure we resolve system symbols before libiberty/libbfd ones.
+dnl Otherwise, things like getopt get screwed up because the system headers
+dnl redirect some functions to the system symbols, but other local symbols
+dnl come from libiberty/libbfd.
+dnl int getopt(int, char * const [], const char *) __asm("_" "getopt" "$UNIX2003");
+AC_CHECK_LIB(c, malloc, LIBS="-lc $LIBS")
+
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)