File: configures

package info (click to toggle)
feta 1.4.15
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 444 kB
  • ctags: 85
  • sloc: perl: 1,200; sh: 192; makefile: 55
file content (117 lines) | stat: -rwxr-xr-x 3,061 bytes parent folder | download | duplicates (3)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/sh
# This script is in the public domain
# configure script for small programs

NF="true"		# Do not force install ('not force')
PREFIX="/usr/local"

OPTS=`getopt -n configure -o v,p:,h,f,b:,l:,m:,d: --longoptions=prefix:,version,help,force,bindir:,libdir:,moddir:,headdir: -- $@`
if [ $? != 0 ] ; then exit 1; fi
eval set -- "$OPTS"

while true ; do
 case "$1" in
  -p|--prefix) PREFIX="$2"; shift 2;;
  -b|--bindir) BINDIR="$2"; shift 2;;
  -l|--libdir) LIBDIR="$2"; shift 2;;
  -m|--moddir) MODDIR="$2"; shift 2;;
  -d|--headdir) HEADDIR="$2"; shift 2;;
  -v|--version)
   echo "configures 1.3, by Joe Wreschnig <piman@sacredchao.net>"
   echo "Placed in the public domain."; exit;;
  -h|--help)
   echo " --version	Print the version"
   echo " --help		Print this message"
   echo " --prefix	Set the install prefix"
   echo " -f, --force	Create a Makefile even if the dependency detection fails";
   exit;;
  -f|--force) NF=""; shift;;
  --) shift ; break;;
 esac
done

. ./cfg.data

if test ! -r ./Makefile.in; then
 echo "There is no Makefile.in file, stopping configuration."
 exit 1
fi

echo "This script will attempt to look for files needed by $PROGNAME $VERSION."

test "$PROGRAMS" && echo "Programs:"
for I in $PROGRAMS; do
 echo -n "  Looking for $I... "
 for J in `echo $PATH | sed 's/:/ /g'` $BINDIR /bin /usr/bin /sbin /usr/sbin; do
  F="0"
  if test -x "$J/$I"; then
   echo "found."
   F="1"
   break
  fi
 done
 if test $F = "0"; then echo "not found."; test $NF && exit 1; fi
done

test "$LIBS" && echo "Libraries:"
for I in $LIBS; do
 echo -n "  Looking for lib$I... "
 for J in `echo $LD_LIBRARY_PATH | sed 's/:/ /g'` `test -x /etc/ld.so.conf && cat /etc/ld.so.conf` /lib /usr/lib /usr/local/lib $LIBDIR; do
  F="0"
  if test -r "$J/lib$I.so" || test -r "$J/lib$I.a"; then
   echo "found."
   F="1"
   break
  fi
 done
 if test $F = "0"; then echo "not found."; test $NF && exit 1; fi
done

test "$HEADERS" && echo "Headers:"
for I in $HEADERS; do
 echo -n "  Looking for $I... "
 for J in /usr/include /usr/X11R6/include /usr/local/include $INCDIR; do
  F="0" # Found
  if test -r "$J/$I"; then
   echo "found."
   F="1"
   break
  fi
 done
 if test $F = "0"; then echo "not found."; test $NF && exit 1; fi
done

test "$PM" && echo "Perl modules:"
for I in $PM; do
 echo -n "  Looking for $I... "
 for J in `perl -e "print join ' ', @INC"` $PERLDIR; do
  F="0"
  if test -r "$J/$I.pm"; then
   echo "found."
   F="1"
   break
  fi
 done
 if test $F = "0"; then echo "not found."; test $NF && exit 1; fi
done

test "$OTHER" && echo "Other files (will take a long time to find):"
for I in $OTHER; do
 echo -n "  Looking for $I... "
 F="0"
 if locate "$I" > /dev/null; then
  echo "found."
  F="1"
 fi
 if test $F = "0"; then echo "not found."; test $NF && exit 1; fi
done

echo; echo -n "Creating Makefile(s) to install into $PREFIX... "
for I in $DIRS .; do
 J=`pwd`
 cd $I && sed "s!PREFIX!$PREFIX!g" < Makefile.in > Makefile && cd $J
done

echo "Done."

echo "Type \`make; su -c \"make install\"' to compile and install $PROGNAME."