]> git.sesse.net Git - vlc/blob - bootstrap.sh
* ./configure.in: checking for the header should be enough in most cases
[vlc] / bootstrap.sh
1 #! /bin/sh
2
3 ##  bootstrap.sh file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap.sh,v 1.4 2002/06/07 14:30:40 sam Exp $
5 ##
6 ##  Authors: Samuel Hocevar <sam@zoy.org>
7
8 ##
9 ##  autoconf && autoheader
10 ##
11 echo -n "running the auto* tools: "
12 autoconf || exit $?
13 echo -n "autoconf "
14 autoheader || exit $?
15 echo "autoheader."
16
17
18 ##
19 ##  headers which need to be regenerated because of the VLC_EXPORT macro
20 ##
21 file=src/misc/modules_plugin.h
22 echo -n "creating headers: "
23 rm -f $file
24 sed 's#.*\$[I][d]:.*# * Automatically generated from '$file'.in by bootstrap.sh#' < $file.in > $file
25 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
26 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
27        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
28 echo '' >> $file
29 echo -n "$file "
30
31 file=include/vlc_symbols.h
32 rm -f $file && touch $file
33 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
34 echo '' >> $file
35 echo 'struct module_symbols_s' >> $file
36 echo '{' >> $file
37 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
38        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' >> $file
39 echo '};' >> $file
40 echo '' >> $file
41 echo '#ifdef __PLUGIN__' >> $file
42 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
43        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' >> $file
44 echo '#endif /* __PLUGIN__ */' >> $file
45 echo '' >> $file
46 echo "$file."
47
48
49 ##
50 ##  Glade sometimes sucks
51 ##
52 echo -n "fixing glade bugs: "
53 for file in gnome_interface.c gtk_interface.c
54 do
55 if grep -q "DO NOT EDIT THIS FILE" plugins/gtk/$file
56 then
57     rm -f /tmp/$$.$file.bak
58     cat > /tmp/$$.$file.bak << EOF
59 /* This file was created automatically by glade and fixed by bootstrap.sh */
60
61 #include <vlc/vlc.h>
62 EOF
63     tail +8 plugins/gtk/$file \
64         | sed 's#DISABLED!!!_("/dev/dvd")#config_GetPsz( "dvd" )#' \
65         | sed 's#DISABLED!!!11954#config_GetInt( "frequency" )#' \
66         | sed 's#DISABLED!!!27500#config_GetInt( "symbol-rate" )#' \
67         | sed 's#_("-:--:--")#"-:--:--"#' \
68         | sed 's#_("---")#"---"#' \
69         | sed 's#_("--")#"--"#' \
70         | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
71         | sed 's#_(\("./."\))#\1#' \
72         | sed 's/_GLADE_SUX_\([^,]*\), NULL/, "\1"/' \
73         >> /tmp/$$.$file.bak
74     mv -f /tmp/$$.$file.bak plugins/gtk/$file
75 fi
76 echo -n "$file "
77 done
78
79 file=gtk_support.h
80 if grep -q "DO NOT EDIT THIS FILE" plugins/gtk/$file
81 then
82     rm -f /tmp/$$.$file.bak
83     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 )/' < plugins/gtk/$file > /tmp/$$.$file.bak
84     mv -f /tmp/$$.$file.bak plugins/gtk/$file
85 fi
86 echo "$file."
87
88
89 ##
90 ##  Update the potfiles because no one ever does it
91 ##
92 echo -n "updating potfiles: "
93 cd po
94 make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
95 cd ..
96 echo "."
97