]> git.sesse.net Git - vlc/blob - bootstrap.sh
42b13ae4af3e0eb1ed5b04ab3db8aa1d00052cc7
[vlc] / bootstrap.sh
1 #! /bin/sh
2
3 ##  bootstrap.sh file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap.sh,v 1.11 2002/08/24 11:57:07 sam Exp $
5 ##
6 ##  Authors: Samuel Hocevar <sam@zoy.org>
7
8 ###
9 ###  get a sane environment
10 ###
11 export LANG=C
12
13 ###
14 ###  argument check
15 ###
16 do_po=no
17 while test $# -gt 0; do
18   case "$1" in
19     --update-po)
20       do_po=yes
21       ;;
22     *)
23       echo "unknown option $1"
24       ;;
25   esac
26   shift
27 done
28
29 ##
30 ##  autoconf && autoheader
31 ##
32 echo -n " + running the auto* tools: "
33 autoconf || exit $?
34 echo -n "autoconf "
35 autoheader || exit $?
36 echo "autoheader."
37
38
39 ##
40 ##  headers which need to be regenerated because of the VLC_EXPORT macro
41 ##
42 file=src/misc/modules_plugin.h
43 echo -n " + creating headers: "
44 rm -f $file
45 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
46 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
47 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
48        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
49 echo '' >> $file
50 echo -n "$file "
51
52 file=include/vlc_symbols.h
53 rm -f $file && touch $file
54 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
55 echo '' >> $file
56 echo 'struct module_symbols_t' >> $file
57 echo '{' >> $file
58 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
59        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
60 echo '};' >> $file
61 echo '' >> $file
62 echo '#ifdef __PLUGIN__' >> $file
63 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
64        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
65 echo '#endif /* __PLUGIN__ */' >> $file
66 echo '' >> $file
67 echo "$file."
68
69
70 ##
71 ##  Glade sometimes sucks
72 ##
73 echo -n " + fixing glade bugs: "
74 for file in gnome_interface.c gtk_interface.c
75 do
76 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
77 then
78     rm -f /tmp/$$.$file.bak
79     cat > /tmp/$$.$file.bak << EOF
80 /* This file was created automatically by glade and fixed by bootstrap.sh */
81
82 #include <vlc/vlc.h>
83 EOF
84     tail +8 modules/gui/gtk/$file \
85         | sed 's#_("-:--:--")#"-:--:--"#' \
86         | sed 's#_("---")#"---"#' \
87         | sed 's#_("--")#"--"#' \
88         | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
89         | sed 's#_(\("./."\))#\1#' \
90         >> /tmp/$$.$file.bak
91     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
92 fi
93 echo -n "$file "
94 done
95
96 file=gtk_support.h
97 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
98 then
99     rm -f /tmp/$$.$file.bak
100     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
101     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
102 fi
103 echo "$file."
104
105
106 ##
107 ##  Update the potfiles because no one ever does it
108 ##
109 if test "$do_po" = "no"
110 then
111   echo "not updating potfiles. use --update-po to force doing it."
112 else
113   echo -n " + updating potfiles: "
114   cd po
115   make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
116   cd ..
117   echo "."
118 fi
119