~ubuntu-branches/ubuntu/precise/mpeg4ip/precise

1 by Mario Limonciello
Import upstream version 1.6dfsg
1
#!/bin/sh
2
#
3
# Bootstrap development of mpeg4ip with GNU autoconf, automake, and libtool
4
# Assumes tools are available on the system
5
#
6
7
# Check that we can find libtool
8
# Frequently it hasn't been installed
9
if glibtool --version > /dev/null 2> /dev/null
10
then 
11
    libtool=glibtool
12
    if libtoolize --version > /dev/null
13
    then
14
	echo "Found link for libtoolize"
15
    else 
16
	echo "Need a link for libtoolize to glibtoolize"
17
	echo "Please see readme for how to make on OS X"
18
	exit 1
19
    fi
20
elif libtool --version >/dev/null
21
then libtool=libtool
22
else echo "libtool does not appear to be installed."
23
     echo "Please install it and then rerun this script."
24
     exit 1
25
fi
26
27
for tool in aclocal autoheader autoconf automake
28
do 
29
  if $tool --version >/dev/null 
30
  then :
31
  else echo "$tool does not appear to be installed."
32
       echo "Please install it and then rerun this script."
33
       exit 1
34
  fi
35
done
36
#
37
# Test for SDL
38
#
39
target_system=`uname -s`
40
   if sdl-config --version >/dev/null 2>/dev/null
41
      then
42
      echo "Found SDL"
43
   else
44
      echo "SDL does not appear to be installed - can't find sdl-config"
45
      echo "Please install it and rerun this script"
46
      exit 1
47
   fi
48
#
49
# Test for faac
50
#
51
allargs="$@"
52
53
if test $target_system = "Linux"; then
54
    have_faac=no
55
    if which faac >/dev/null 2>/dev/null; then
56
	have_faac=yes
57
    fi
58
59
    if test $have_faac = "yes"; then
60
	# we have lame and faac - see if faac is built with mp4 support
61
	faac --help >faac_help 2>&1
62
	sdf=`grep "MP4 support unavailable" faac_help`
63
	rm -f faac_help
64
	if test -z "$sdf"; then
65
	    if which mpeg4ip-config >/dev/null 2>/dev/null; then
66
		echo "Warning - faac uses libmp4v, but we've detected a version"
67
		echo "of mpeg4ip.  If you get errors building mp4live, please"
68
		echo "rebuild faac without mp4v2 support"
69
	    else
70
		echo "Error - we have detected a version of faac that has libmp4v2 support"
71
		echo "and no copy of mpeg4ip-config.  This means faac was built with"
72
		echo "faad2 and the libraries will be incompatible".
73
		echo "Please reinstall faac without mp4v2 support"
74
		exit 1
75
	    fi
76
	fi
77
    fi
78
fi
79
80
set -x
81
82
# if src tree is created via cvs export to tar.gz
83
# then empty directories in the repository are pruned
84
# this code recreates the empty directories
85
# if src tree is checked out directly via cvs, this is a no-op
86
mkdir -p ./config || exit 1
87
88
#
89
# This tries to find all the aclocal files that we need
90
for dir in /usr/local /usr/contrib /opt/gnome /usr /opt/local
91
do
92
   if test -d $dir/share/aclocal -a `which aclocal` != $dir/bin/aclocal
93
   then
94
     ACLOCAL_FLAGS="-I $dir/share/aclocal $ACLOCAL_FLAGS"
95
   fi
96
done
97
98
if test $target_system != "CYGWIN_NT-5.1"; then
99
ERRCMD=--enable-warns-as-err
100
else
101
ERRCMD=
102
fi
103
104
pwd=`pwd`
105
if test $target_system != "Darwin"; then
106
if test $target_system != "CYGWIN_NT-5.1"; then
107
for	dir \
108
in	$pwd/lib/SDLAudio 
109
do	cd $dir
110
  aclocal $ACLOCAL_FLAGS || exit 4
111
  libtoolize --force
112
  automake --add-missing --foreign || exit 5
113
  autoconf || exit 6
114
done
115
fi
116
fi
117
118
#cd $pwd/lib/rtp
119
#aclocal $ACLOCAL_FLAGS || exit 3
120
#libtoolize --force
121
#autoheader
122
#automake --add-missing --foreign || exit 1
123
#autoconf || exit 1
124
#cd $pwd
125
126
cd $pwd/common/video/iso-mpeg4
127
aclocal $ACLOCAL_FLAGS || exit 3
128
libtoolize --force
129
autoheader
130
automake --add-missing --foreign || exit 1
131
autoconf || exit 1
132
133
cd $pwd 
134
# top level - we're using autoheader, which needs to be after aclocal  
135
if `aclocal $ACLOCAL_FLAGS`; then
136
  echo
137
  if grep AM_PATH_GTK_2_0 aclocal.m4; then
138
    echo
139
  else
140
    ACLOCAL_FLAGS="-I $pwd/doc $ACLOCAL_FLAGS"
141
    aclocal $ACLOCAL_FLAGS
142
  fi
143
  if grep AM_PATH_ALSA aclocal.m4; then
144
     echo
145
  else
146
     ACLOCAL_FLAGS="-I $pwd/util $ACLOCAL_FLAGS"
147
     aclocal $ACLOCAL_FLAGS
148
  fi
149
else
150
  if `aclocal -I $pwd/doc`; then
151
    ACLOCAL_FLAGS="-I $pwd/doc $ACLOCAL_FLAGS"
152
  else 
153
    if `aclocal -I $pwd/util`; then
154
      ACLOCAL_FLAGS="-I $pwd/util $ACLOCAL_FLAGS"
155
    else
156
      aclocal -I $pwd/util -I $pwd/doc
157
      ACLOCAL_FLAGS="-I $pwd/util -I $pwd/doc $ACLOCAL_FLAGS"
158
    fi
159
  fi
160
fi 
161
162
libtoolize --force
163
autoheader || exit 1
164
automake --add-missing --foreign || exit 1
165
autoconf || exit 1
166
echo "Do not remove this file or you might have to re-bootstrap" > bootstrapped
167
[ ! -x configure ] || ./configure $ERRCMD $allargs ACLOCAL_AMFLAGS="$ACLOCAL_FLAGS" || exit 1
168
set +x
169
170
if test $target_system = "Linux"; then
171
   disabled_mp4live=no
172
   while test $# -gt 0;
173
     do
174
     if test $1 = "--disable-server"; then
175
        disabled_mp4live=yes
176
     else
177
        if test $1 = "--disable-mp4live"; then
178
           disabled_mp4live=yes
179
        fi
180
     fi
181
     shift
182
   done
183
   if test $disabled_mp4live = no; then
184
       sh ./mp4live_encoder_check.sh
185
   fi
186
187
fi
188
# Now ready to run make
189
echo
190
echo "ready to make"