1 # This file is a shell script fragment that supplies the information
2 # necessary for a configure script to process the program in
3 # this directory. For more information, look at ../configure.
5 # We need multilib support.
6 . ${srcdir}/../cfg-ml-com.in
9 srctrigger=../libiberty/getopt1.c
10 srcname="cross -liberty library"
11 Makefile_in=../libiberty/Makefile.in
15 *) srcdir=${srcdir}/../libiberty ;;
22 files="../libiberty/alloca-norm.h"
27 . ${srcdir}/../libiberty/config.table
28 target_makefile_frag=${frag}
32 # Make sure we also make links to all the source files
33 source_files=`echo ../libiberty/*.[ch] ../libiberty/functions.def`
34 files="${files} ${source_files}"
35 source_links=`echo "$source_files" | sed -e 's|../libiberty/||g'`
36 links="${links} ${source_links}"
44 # if we are candian crossing the we need to pick up host copies of
45 # the tools, otherwise we can look in the current tree
46 # but we shouldn't build xiberty if we're not canadian crossing.
47 if [ "${host}" != "${target}" ] ; then
48 echo "CC = ${target_alias}-gcc" > Makefile.tem
49 echo "AR = ${target_alias}-ar " >> Makefile.tem
50 echo "RANLIB = ${target_alias}-ranlib " >> Makefile.tem
55 echo "INSTALL_DEST = tooldir" >> Makefile.tem
57 # If we are cross-compiling, check at compile time whether we are
58 # using newlib. If we are, we already know the files we need, since
59 # the linker will fail when run on some of the newlib targets.
60 if [ "${host}" != "${target}" ] ; then
61 cat > Makefile.tem2 <<'!EOF!'
63 NEEDED_LIST = xneeded-list
66 if [ -f ../newlib/Makefile ]; then \
67 echo "#define NEED_sys_nerr 1" >xconfig.h; \
68 echo "#define NEED_sys_errlist 1" >>xconfig.h; \
69 echo "#define NEED_sys_siglist 1" >>xconfig.h; \
70 echo "#define NEED_psignal 1" >>xconfig.h; \
72 $(MAKE) $(FLAGS_TO_PASS) lconfig.h; \
73 cp lconfig.h xconfig.h; \
76 xneeded-list: Makefile
77 if [ -f ../newlib/Makefile ]; then \
78 echo insque.o random.o strdup.o alloca.o >xneeded-list; \
80 $(MAKE) $(FLAGS_TO_PASS) lneeded-list; \
81 cp lneeded-list xneeded-list; \
85 sed -e "/^####/ r Makefile.tem" -e "/^####/ r Makefile.tem2" ${Makefile} > Makefile.tem3
86 mv Makefile.tem3 ${Makefile}
87 rm -f Makefile.tem Makefile.tem2
89 if [ "${srcdir}" = "." ] ; then
90 echo "EXTRA_LINKS = ${source_links}" >>Makefile
92 mv Makefile Makefile.tmp
93 # Patch 'install' and 'Makefile' rules in Makefile
94 # (The latter is only needed when "$srcdir" = ".".)
95 sed <Makefile.tmp -e '/INSTALL_DEST =/s/libdir/tooldir/' \
96 -e '/Makefile/s|(srcdir)/Makefile.in|(srcdir)/../libiberty/Makefile.in|' \
100 # We need multilib support.
101 . ${srcdir}/../cfg-ml-pos.in