11#! /bin/sh
2+ # -------------------------------------------------------------------------
3+ #
4+ # Copyright (c) 2020 Rajit Manohar
5+ #
6+ # This program is free software; you can redistribute it and/or
7+ # modify it under the terms of the GNU General Public License
8+ # as published by the Free Software Foundation; either version 2
9+ # of the License, or (at your option) any later version.
10+ #
11+ # This program is distributed in the hope that it will be useful,
12+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ # GNU General Public License for more details.
15+ #
16+ # You should have received a copy of the GNU General Public License
17+ # along with this program; if not, write to the Free Software
18+ # Foundation, Inc., 51 Franklin Street, Fifth Floor,
19+ # Boston, MA 02110-1301, USA.
20+ #
21+ # -------------------------------------------------------------------------
222
323if [ $# -ne 1 ]
424then
@@ -10,38 +30,46 @@ xyce_build=$1
1030
1131echo " Xyce build dir: $xyce_build "
1232
13- if [ ! -d $xyce_build ]
33+ if [ -f $xyce_build /link.txt ]
1434then
35+ $file =$xyce_build /link.txt
36+ else
37+ if [ ! -d $xyce_build ]
38+ then
1539 echo " Could not find directory $xyce_build "
1640 exit 1
17- fi
41+ fi
1842
19- if [ ! -d $xyce_build /src/CMakeFiles/Xyce.dir ]
20- then
43+ if [ ! -d $xyce_build /src/CMakeFiles/Xyce.dir ]
44+ then
2145 echo " Could not find Xyce sub-directory (src/CMakeFiles/Xyce.dir) in $xyce_build "
2246 exit 1
23- fi
47+ fi
2448
25- file=$xyce_build /src/CMakeFiles/Xyce.dir/link.txt
49+ file=$xyce_build /src/CMakeFiles/Xyce.dir/link.txt
50+ fi
2651
2752if [ ! -f $file ]
2853then
29- echo " Could not find Xyce link.txt file in build directory"
30- exit 1
54+ echo " Could not find Xyce link.txt file in build directory"
55+ exit 1
3156fi
3257
58+ #
59+ # Now find the linker options!
60+ #
61+
3362linker_stuff=
3463compiler_stuff=
35-
3664found=0
3765
3866for i in ` cat $file `
3967do
40- case $found in
68+ case $found in
4169 0) compiler_stuff=$i ; found=1;;
4270 1) if [ $i = " Xyce" ]
4371 then
44- found=2
72+ found=2
4573 fi ;;
4674 2) if [ $i = " libxyce.a" ]
4775 then
5078 val=$i
5179 fi ;
5280 linker_stuff=" ${linker_stuff} $val " ;;
53- esac
81+ esac
5482done
5583
56- echo
84+ echo
5785echo " Creating xyce.in..."
5886echo
5987echo " Xyce was linked with the following compiler:"
0 commit comments