bootstrap 5 KB
Newer Older
1
2
3
#! /bin/sh

##  bootstrap.sh file for vlc, the VideoLAN Client
4
##  $Id: bootstrap,v 1.12 2002/08/28 19:48:16 massiot Exp $
5
6
7
##
##  Authors: Samuel Hocevar <sam@zoy.org>

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
###
###  get a sane environment
###
export LANG=C

###
###  argument check
###
do_po=no
while test $# -gt 0; do
  case "$1" in
    --update-po)
      do_po=yes
      ;;
    *)
      echo "unknown option $1"
      ;;
  esac
  shift
done

29
30
31
###
###  classic stuff
###
32
33
set -x
rm -f aclocal.m4 configure config.guess config.log config.sub ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh
34

35
# Check for gettext
36
if gettextize --version >/dev/null 2>&1
37
38
then
if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
39
40
        '>' 0.11.3 >/dev/null 2>&1
then
41
  # We have gettext, and a recent version! Everything is cool.
42
  autopoint --force
43
  GETTEXT=yes
44
45
46
47
else
  # What?! User is not using a recent version of gettext? We'll have to
  # cheat a bit, then.
  rm -f po/ChangeLog~
48
  gettextize --copy --force | grep '^from the' | cut -f3 -d' '
49
50
51
  # Yuck!
  test -f po/ChangeLog~ && mv po/ChangeLog~ po/ChangeLog
  # Yuck!
52
  echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
53
54
55
  GETTEXT=old
fi;else
  # we don't have gettext. grmbl. try to continue anyway.
56
57
  mkdir -p intl
  echo > intl/Makefile.am
58
  echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' > m4/oldgettext.m4
59
  GETTEXT=no
60
fi
61

62
# Check for automake
63
amvers="none"
64
65
if automake-1.6 --version >/dev/null 2>&1
then
66
  amvers="-1.6"
67
else
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  if automake-1.5 --version >/dev/null 2>&1
  then
    amvers="-1.5"
  else
    if automake --version > /dev/null 2>&1
    then
      amvers=`automake --version | head -1 | cut -d\  -f 4`

      if expr "$amvers" "<" "1.5" > /dev/null 2>&1
      then amvers="none"
      else amvers=""
      fi
    fi
  fi
fi

if test x$amvers = xnone
then
86
87
  set +x
  echo "you need automake version 1.5 or later"
88
  exit 1
89
fi
90
91

# Do the rest
92
aclocal${amvers} -I m4
93
autoheader
94
automake${amvers} --foreign --add-missing --copy
95
autoconf
96

97
98
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
cp Makefile.old Makefile.in
99
100
101
102
103
104

##
##  headers which need to be regenerated because of the VLC_EXPORT macro
##
file=src/misc/modules_plugin.h
rm -f $file
105
sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
106
107
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
108
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
109
110
111
112
113
114
echo '' >> $file

file=include/vlc_symbols.h
rm -f $file && touch $file
echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
echo '' >> $file
115
echo 'struct module_symbols_t' >> $file
116
117
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
118
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
119
120
121
122
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
123
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
124
125
126
127
128
129
130
131
132
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file


##
##  Glade sometimes sucks
##
for file in gnome_interface.c gtk_interface.c
do
133
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
134
135
136
137
138
139
140
then
    rm -f /tmp/$$.$file.bak
    cat > /tmp/$$.$file.bak << EOF
/* This file was created automatically by glade and fixed by bootstrap.sh */

#include <vlc/vlc.h>
EOF
141
142
143
144
145
146
147
    sed -e 1,7d \
        -e 's#_("-:--:--")#"-:--:--"#' \
        -e 's#_("---")#"---"#' \
        -e 's#_("--")#"--"#' \
        -e 's#_("/dev/dvd")#"/dev/dvd"#' \
        -e 's#_(\("./."\))#\1#' \
	< modules/gui/gtk/$file >> /tmp/$$.$file.bak
148
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
149
150
151
152
fi
done

file=gtk_support.h
153
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
154
155
then
    rm -f /tmp/$$.$file.bak
156
    sed -e 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < modules/gui/gtk/$file > /tmp/$$.$file.bak
157
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
158
159
fi

160
161
162
163
##
##  Shut up
##
set +x
164
165
166
167

##
##  Update the potfiles because no one ever does it
##
168
169
170
171
172
173
174
175
if test "$do_po" = "no"
then
  echo "not updating potfiles. use --update-po to force doing it."
else
  cd po
  make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
  cd ..
fi
176

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
##
##  Tell the user about gettext
##
case "$GETTEXT" in
  yes)
  ;;
  no)
    echo ""
    echo "==========================================================="
    echo "IMPORTANT NOTE: you do not have gettext installed on your"
    echo "system. The vlc build will work, but you will not have"
    echo "internationalization support. We suggest installing gettext."
  ;;
  old)
    echo ""
    echo "=========================================================="
    echo "NOTE: you have an old version of gettext installed on your"
    echo "system. We suggest upgrading to gettext 0.11.3 or later."
  ;;
esac