File: add-defs1

package info (click to toggle)
gcl 2.6.7-62
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 132,776 kB
  • ctags: 168,407
  • sloc: ansic: 904,568; asm: 373,218; lisp: 164,545; exp: 45,962; makefile: 42,895; sh: 38,281; cpp: 23,784; perl: 6,701; yacc: 6,319; tcl: 3,181; lex: 1,715; sed: 684; pascal: 175; awk: 56; fortran: 48; csh: 23
file content (89 lines) | stat: -rwxr-xr-x 2,200 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh

#CC=cc
if test "$1" = "mingw" -o  "$1" = "gnuwin95"  ; then
   EXE=.exe ; # CC=gcc
   rm -f o/*.ini
fi
 
#(cd bin ; make file-sub EXE=${EXE} CC=${CC})

if [ $# -le 0 ]  ; then
  echo usage: ./add-defs machine-type;
  echo  or '  ' ./add-defs machine-type directory
  echo where directory might be '/usr/local' or '/public' or '/lusr' -- a place to find various local includes or libs
  echo see echo h/*.defs
exit 1 ; fi

if [ -f h/$1.defs ] ; then echo using $1.defs ;
  else echo h/$1.defs does not exist
  echo Build one or use one of `ls h/*.defs`
  exit 1
fi

echo $1 > machine


#  rm -f makedefs
#  echo > makedefs
#  echo "# begin makedefs" >> makedefs
#  echo "# constructed by ${USER} using: $0 $1 $2 $3 $4 $5" >> makdefs

  rm -f makedefs
  cp makedefc makedefs
  if [ -d ${PWD}/unixport ] ; 
   then  echo "GCLDIR=${PWD}" >> makedefs ;
   else echo "GCLDIR=`pwd`" >> makedefs ;
  fi
  echo "SHELL=/bin/sh" >> makedefs
  echo "MACHINE=$1"  >> makedefs


####machine specific .defs files may over ride the above####


####### insert the h/machine.defs file ############
  cat h/$1.defs >> makedefs
  if [ -f makedefsafter ] ; then cat makedefsafter >> makedefs ; fi
  if [ -f ${HOME}/local_gcl.defs ] ; then
    cat ${HOME}/local_gcl.defs >> makedefs
  fi

  echo "" >> makedefs
  echo "# end makedefs" >> makedefs
   

#  echo inserting h/$1.defs in ..
#  for v in makefile unixport/make_kcn */makefile ; 
#  do
#  echo " $v,"
#  ./bin/file-sub makedefs $v "# begin makedefs" "# end makedefs" tmpx
#  mv tmpx $v
#  done
#
#echo ""

# Copy the config.h over.

cat h/$1.h > tmpx
if [ -f ${HOME}/local_gcl.h ] ; then
 cat  ${HOME}/local_gcl.h >> tmpx
fi

if fgrep =unknown makedefs > /dev/null ;
then echo " if the 'unknown' directories exist you may provide
a second argument to ./add-defs of a local directory where things might be,
or edit ./add-defs so that it can find them.   Otherwise just continue
and the portions with unknown will not be compiled."
fi


if cmp tmpx h/config.h  > /dev/null 2>&1 ;then true;
else
rm -f h/config.h
cp tmpx h/config.h
fi
rm -f tmpx

# machine specific stuff that cant be handled normally...
if [ -f ./xbin/$1-fix ] ; then ./xbin/$1-fix ; fi