OSDN Git Service

Revert to 1.1
[pf3gnuchains/gcc-fork.git] / gcc / configure.frag
1 # configure.frag for GNU CC
2 # Process the Makefile fragments from language directories.
3
4 # Copyright (C) 1997 Free Software Foundation, Inc.
5
6 #This file is part of GNU CC.
7
8 #GNU CC is free software; you can redistribute it and/or modify
9 #it under the terms of the GNU General Public License as published by
10 #the Free Software Foundation; either version 2, or (at your option)
11 #any later version.
12
13 #GNU CC is distributed in the hope that it will be useful,
14 #but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #GNU General Public License for more details.
17
18 #You should have received a copy of the GNU General Public License
19 #along with GNU CC; see the file COPYING.  If not, write to
20 #the Free Software Foundation, 59 Temple Place - Suite 330,
21 #Boston, MA 02111-1307, USA.
22
23 rm -f Make-lang
24 touch Make-lang
25
26 # First parameter is the source directory, second is list of subdirectories
27 savesrcdir=$1
28 savesubdirs=$2
29 for subdir in . $savesubdirs
30 do
31         oldsrcdir=$savesrcdir
32
33         # Re-adjust the path
34         case $oldsrcdir in
35         /*)
36                 case $subdir in
37                 .)
38                         srcdir=$oldsrcdir
39                         ;;
40                 *)
41                         srcdir=$oldsrcdir/$subdir
42                         ;;
43                 esac
44                 ;;
45         *)
46                 case $subdir in
47                 .)
48                         ;;
49                 *)
50                         oldsrcdir=../${oldsrcdir}
51                         srcdir=$oldsrcdir/$subdir
52                         ;;
53                 esac
54                 ;;
55         esac
56         mainsrcdir=$oldsrcdir
57         STARTDIR=`pwd`
58         test -d $subdir || mkdir $subdir
59         cd $subdir
60
61         # If this is the top level Makefile, add the language fragments.
62         if [ $subdir = . ]
63         then
64                 for s in .. $savesubdirs
65                 do
66                         if [ $s != ".." ]
67                         then
68                                 cat ${mainsrcdir}/$s/Make-lang.in >> Make-lang
69                         fi
70                 done
71         fi
72
73         cd $STARTDIR
74 done   # end of current-dir SUBDIRS loop
75
76 srcdir=$savesrcdir