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

##  bootstrap.sh file for vlc, the VideoLAN Client
4
##  $Id: bootstrap,v 1.1 2002/08/25 23:18:04 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
32
33
34
35
36
###
###  classic stuff
###
aclocal -I m4
autoheader
echo "no" | gettextize --force --intl --copy --no-changelog
automake --foreign --add-missing --copy
autoconf
37

38
39
# nuahahahahaha !! overwriting Makefile.in with what *I* want!
cp Makefile.old Makefile.in
40
41
42
43
44

##
##  headers which need to be regenerated because of the VLC_EXPORT macro
##
file=src/misc/modules_plugin.h
45
echo -n " + creating headers: "
46
rm -f $file
47
sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
48
49
50
51
52
53
54
55
56
57
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
echo '' >> $file
echo -n "$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
58
echo 'struct module_symbols_t' >> $file
59
60
echo '{' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
61
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
62
63
64
65
echo '};' >> $file
echo '' >> $file
echo '#ifdef __PLUGIN__' >> $file
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
66
       sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
67
68
69
70
71
72
73
74
echo '#endif /* __PLUGIN__ */' >> $file
echo '' >> $file
echo "$file."


##
##  Glade sometimes sucks
##
75
echo -n " + fixing glade bugs: "
76
77
for file in gnome_interface.c gtk_interface.c
do
78
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
79
80
81
82
83
84
85
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
86
    tail +8 modules/gui/gtk/$file \
87
88
89
90
91
92
        | sed 's#_("-:--:--")#"-:--:--"#' \
        | sed 's#_("---")#"---"#' \
        | sed 's#_("--")#"--"#' \
        | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
        | sed 's#_(\("./."\))#\1#' \
        >> /tmp/$$.$file.bak
93
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
94
95
96
97
98
fi
echo -n "$file "
done

file=gtk_support.h
99
if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
100
101
then
    rm -f /tmp/$$.$file.bak
102
103
    sed '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
    mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
104
105
106
107
108
109
110
fi
echo "$file."


##
##  Update the potfiles because no one ever does it
##
111
112
113
114
115
116
117
118
119
120
if test "$do_po" = "no"
then
  echo "not updating potfiles. use --update-po to force doing it."
else
  echo -n " + updating potfiles: "
  cd po
  make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
  cd ..
  echo "."
fi
121