/[eiffelstudio]/trunk/Delivery/studio/spec/unix/finish_freezing
ViewVC logotype

Contents of /trunk/Delivery/studio/spec/unix/finish_freezing

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73200 - (show annotations)
Fri Apr 25 17:23:47 2008 UTC (11 years, 9 months ago) by fivaa
File size: 3365 byte(s)
Also needed to change finish_freezing to work with unix layout again
1 #!/bin/sh
2 arg=none
3 nologo=""
4 ncpus=0
5 prioritylevel="" # Default prority level
6
7 if [ $# -gt 0 ]; then
8 while [ "$1" != "" ]; do
9 case "$1" in
10 "cecil" | "-cecil" | "-library") arg=$1 ;;
11 "-nproc")
12 shift
13 if [ $# -gt 0 ]; then
14 # Test if $1 is indeed an integer argument.
15 echo $1 | grep "[^0-9]" > /dev/null 2>&1
16 if [ "$?" -eq "0" ]; then
17 echo "Error: invalid value for nproc option"
18 echo "Option -nproc needs a non-negative integer argument"
19 exit 1
20 else
21 ncpus=$1
22 fi
23 else
24 echo "Usage: option -nproc needs a non-negative integer argument"
25 exit 1
26 fi
27 ;;
28 "-x86") ;; # No effect on Unix yet
29 "-low") prioritylevel="nice -n 19" ;;
30 "-silent") ;; #Nothing anymore, kept for backward compatibility
31 "-nologo") nologo="nologo" ;; # Keep or remove display of logo.
32 *)
33 echo "Usage: finish_freezing [-cecil | -library | -nproc VAL | -x86 | -silent | -low]"
34 exit 1
35 ;;
36 esac
37 shift
38 done
39 fi
40
41 if [ "$nologo" = "" ]; then
42 echo "Eiffel C/C++ Compilation Tool - Version 6.0"
43 echo "Copyright Eiffel Software 1985-2007. All Rights Reserved"
44 echo
45 fi
46
47 # default values for unix layout, so that no environment variables need to be set
48 if [ -z "$ISE_EIFFEL" ]; then
49 if [ -z "$ISE_PREFIX" ]; then
50 ISE_PREFIX=/usr #UNIX_BASE_PATH comment for replacement
51 export ISE_PREFIX
52 fi
53 if [ -z "$ISE_VERSION" ]; then
54 ISE_VERSION=6.2
55 export ISE_VERSION
56 fi
57 if [ -z "$ISE_PLATFORM" ]; then
58 ISE_PLATFORM=unix
59 export ISE_PLATFORM
60 fi
61 if [ -z "$ISE_LIB_NAME" ]; then
62 ISE_LIB_NAME=lib #UNIX_LIB_NAME comment for replacement
63 export ISE_LIB_NAME
64 fi
65 fi
66
67 #Check if ISE_LIBRARY is defined, if not we use ISE_EIFFEL.
68 if [ -z "$ISE_LIBRARY" ]; then
69 if [ -n "$ISE_EIFFEL" ]; then
70 ISE_LIBRARY=$ISE_EIFFEL
71 else
72 ISE_LIBRARY=$ISE_PREFIX/lib/eiffelstudio-$ISE_VERSION/
73 fi
74 export ISE_LIBRARY
75 fi
76
77 #Use $MAKE as make utility instead of `make'.
78 if [ -z "$MAKE" ]; then
79 make=make
80 else
81 make=$MAKE
82 fi
83
84 if $make --version 2>/dev/null | grep GNU >/dev/null 2>&1; then
85 if [ ! $ncpus -gt 0 ]; then
86 case `uname` in
87 Darwin) ncpus=`sysctl -n hw.activecpu` ;;
88 Linux)
89 if [ -f /proc/cpuinfo ] ; then
90 ncpus=`grep -c '^processor[[:space:]]*:' /proc/cpuinfo`
91 fi
92 ;;
93 SunOS) ncpus=`/usr/sbin/psrinfo | wc -l` ;;
94 IRIX*) ncpus=`hinv | awk '/^[0-9]+ [0-9]+ MHZ/ {print $1}'` ;;
95 esac
96 fi
97 if [ -z "$MAKELEVEL" -a -n "$ncpus" ]; then
98 if [ $ncpus -gt 1 ]; then
99 make_args="-j $ncpus"
100 fi
101 fi
102 # Special handling if `distcc' is currently used to speed up C compilation
103 # time.
104 if [ -n "$DISTCC_COUNT" ]; then
105 make_args="-j $DISTCC_COUNT"
106 fi
107 fi
108
109 if [ "$arg" != "-library" ]; then
110 if [ -n "$ISE_EIFFEL" ]; then
111 $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin/quick_finalize . o
112 else
113 $ISE_PREFIX/$ISE_LIB_NAME/eiffelstudio-$ISE_VERSION/studio/quick_finalize . o
114 fi
115 else
116 echo "Generating C libraries ..."
117 fi
118
119 if [ ! -f config.sh ]; then
120 if [ -n "$ISE_EIFFEL" ]; then
121 cp $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include/config.sh .
122 else
123 cp $ISE_PREFIX/include/eiffelstudio-$ISE_VERSION/config.sh .
124 fi
125 fi
126 sh Makefile.SH
127
128 if [ "$arg" = cecil -o "$arg" = "-cecil" ] ; then
129 echo Generating CECIL library ...
130 $prioritylevel $make -s $make_args cecil && echo "C compilation completed"
131 else
132 $prioritylevel $make -s $make_args && echo "C compilation completed"
133 fi

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23