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

##  bootstrap.sh file for vlc, the VideoLAN Client
4
##  $Id: bootstrap,v 1.11 2002/08/28 15:30:57 sam 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
63
64
65
66
67
68
69
70
71
# Check for automake
if automake-1.6 --version >/dev/null 2>&1
then
  amvers=1.6
else if automake-1.5 --version >/dev/null 2>&1
then
  amvers=1.5
else
  set +x
  echo "you need automake version 1.5 or later"
72
  exit 1
73
74
75
fi;fi

# Do the rest
76
aclocal-${amvers} -I m4
77
autoheader
78
automake-${amvers} --foreign --add-missing --copy
79
autoconf
80

81
82
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
cp Makefile.old Makefile.in
83
84
85
86
87
88

##
##  headers which need to be regenerated because of the VLC_EXPORT macro
##
file=src/misc/modules_plugin.h
rm -f $file
89
sed -e 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
90
91
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
92
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
93
94
95
96
97
98
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
99
echo 'struct module_symbols_t' >> $file
100
101
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
102
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
103
104
105
106
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
107
       sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
108
109
110
111
112
113
114
115
116
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file


##
##  Glade sometimes sucks
##
for file in gnome_interface.c gtk_interface.c
do
117
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
118
119
120
121
122
123
124
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
125
126
127
128
129
130
131
    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
132
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
133
134
135
136
fi
done

file=gtk_support.h
137
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
138
139
then
    rm -f /tmp/$$.$file.bak
140
    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
141
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
142
143
fi

144
145
146
147
##
##  Shut up
##
set +x
148
149
150
151

##
##  Update the potfiles because no one ever does it
##
152
153
154
155
156
157
158
159
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
160

161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
##
##  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