aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-02-16 07:49:26 +0000
committerMark Mitchell <mark@codesourcery.com>2005-02-16 07:49:26 +0000
commit0b48acfe664456ecf535a81be69bae8b52ae5631 (patch)
treeda439735b0220fbc42b0ce75127bb5e87d359ad1 /ld/emultempl
parentff925e69c551bca76b417c3beb9651746ae021b0 (diff)
downloadgdb-0b48acfe664456ecf535a81be69bae8b52ae5631.zip
gdb-0b48acfe664456ecf535a81be69bae8b52ae5631.tar.gz
gdb-0b48acfe664456ecf535a81be69bae8b52ae5631.tar.bz2
* configure.in (AC_CHECK_FUNCS): Add glob.
* configure: Regenerated. * emultempl/elf32.em (<glob.h>): Do not include if HAVE_GLOB is not defined. (gld${EMULATION_NAME}_parse_ld_so_conf_include): Do not use glob if HAVE_GLOB is not defined.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em9
1 files changed, 9 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 886c7a4..5337e18 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -67,7 +67,9 @@ if [ "x${USE_LIBPATH}" = xyes ] ; then
case ${target} in
*-*-linux-gnu*)
cat >>e${EMULATION_NAME}.c <<EOF
+#ifdef HAVE_GLOB
#include <glob.h>
+#endif
EOF
;;
esac
@@ -539,7 +541,9 @@ gld${EMULATION_NAME}_parse_ld_so_conf_include
const char *pattern)
{
char *newp = NULL;
+#ifdef HAVE_GLOB
glob_t gl;
+#endif
if (pattern[0] != '/')
{
@@ -552,6 +556,7 @@ gld${EMULATION_NAME}_parse_ld_so_conf_include
pattern = newp;
}
+#ifdef HAVE_GLOB
if (glob (pattern, 0, NULL, &gl) == 0)
{
size_t i;
@@ -560,6 +565,10 @@ gld${EMULATION_NAME}_parse_ld_so_conf_include
gld${EMULATION_NAME}_parse_ld_so_conf (info, gl.gl_pathv[i]);
globfree (&gl);
}
+#else
+ /* If we do not have glob, treat the pattern as a literal filename. */
+ gld${EMULATION_NAME}_parse_ld_so_conf (info, pattern);
+#endif
if (newp)
free (newp);