]>
Commit | Line | Data |
---|---|---|
6599da04 JM |
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. | |
4 | ||
5 | # We need multilib support. | |
6 | . ${srcdir}/../cfg-ml-com.in | |
7 | ||
8 | configdirs= | |
9 | srctrigger=../libiberty/getopt1.c | |
10 | srcname="cross -liberty library" | |
11 | Makefile_in=../libiberty/Makefile.in | |
12 | ||
13 | case "$srcdir" in | |
14 | ".") ;; | |
15 | *) srcdir=${srcdir}/../libiberty ;; | |
16 | esac | |
17 | ||
18 | # per-host: | |
19 | ||
20 | # per-target: | |
21 | ||
22 | files="../libiberty/alloca-norm.h" | |
23 | links="alloca-conf.h" | |
24 | ||
25 | xhost=${target} | |
26 | xsrcdir=../libiberty/ | |
27 | . ${srcdir}/../libiberty/config.table | |
28 | target_makefile_frag=${frag} | |
29 | ||
30 | case "$srcdir" in | |
31 | ".") | |
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}" | |
37 | ;; | |
38 | *) | |
39 | ;; | |
40 | esac | |
41 | ||
42 | # post-target: | |
43 | ||
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 | |
51 | else | |
52 | echo > Makefile.tem | |
53 | fi | |
54 | ||
55 | echo "INSTALL_DEST = tooldir" >> Makefile.tem | |
56 | ||
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!' | |
62 | CONFIG_H = xconfig.h | |
63 | NEEDED_LIST = xneeded-list | |
64 | ||
65 | xconfig.h: Makefile | |
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; \ | |
71 | else \ | |
72 | $(MAKE) $(FLAGS_TO_PASS) lconfig.h; \ | |
73 | cp lconfig.h xconfig.h; \ | |
74 | fi | |
75 | ||
76 | xneeded-list: Makefile | |
77 | if [ -f ../newlib/Makefile ]; then \ | |
78 | echo insque.o random.o strdup.o alloca.o >xneeded-list; \ | |
79 | else \ | |
80 | $(MAKE) $(FLAGS_TO_PASS) lneeded-list; \ | |
81 | cp lneeded-list xneeded-list; \ | |
82 | fi | |
83 | !EOF! | |
84 | fi | |
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 | |
88 | ||
89 | if [ "${srcdir}" = "." ] ; then | |
90 | echo "EXTRA_LINKS = ${source_links}" >>Makefile | |
91 | fi | |
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|' \ | |
97 | >Makefile | |
98 | rm -f Makefile.tmp | |
99 | ||
100 | # We need multilib support. | |
101 | . ${srcdir}/../cfg-ml-pos.in |