]> git.sesse.net Git - vlc/blob - bootstrap
Directory content is now read at startup.
[vlc] / bootstrap
1 #! /bin/sh
2
3 ##  bootstrap.sh file for vlc, the VideoLAN Client
4 ##  $Id: bootstrap,v 1.1 2002/08/25 23:18:04 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 ###  classic stuff
31 ###
32 aclocal -I m4
33 autoheader
34 echo "no" | gettextize --force --intl --copy --no-changelog
35 automake --foreign --add-missing --copy
36 autoconf
37
38 # nuahahahahaha !! overwriting Makefile.in with what *I* want!
39 cp Makefile.old Makefile.in
40
41 ##
42 ##  headers which need to be regenerated because of the VLC_EXPORT macro
43 ##
44 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 echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
49 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
50        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    (p_symbols)->\2_inner = \2; \\/' >> $file
51 echo '' >> $file
52 echo -n "$file "
53
54 file=include/vlc_symbols.h
55 rm -f $file && touch $file
56 echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
57 echo '' >> $file
58 echo 'struct module_symbols_t' >> $file
59 echo '{' >> $file
60 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
61        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/    \1 (* \2_inner) \3;/' | sort >> $file
62 echo '};' >> $file
63 echo '' >> $file
64 echo '#ifdef __PLUGIN__' >> $file
65 cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
66        sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/#   define \2 p_symbols->\2_inner/' | sort >> $file
67 echo '#endif /* __PLUGIN__ */' >> $file
68 echo '' >> $file
69 echo "$file."
70
71
72 ##
73 ##  Glade sometimes sucks
74 ##
75 echo -n " + fixing glade bugs: "
76 for file in gnome_interface.c gtk_interface.c
77 do
78 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
79 then
80     rm -f /tmp/$$.$file.bak
81     cat > /tmp/$$.$file.bak << EOF
82 /* This file was created automatically by glade and fixed by bootstrap.sh */
83
84 #include <vlc/vlc.h>
85 EOF
86     tail +8 modules/gui/gtk/$file \
87         | sed 's#_("-:--:--")#"-:--:--"#' \
88         | sed 's#_("---")#"---"#' \
89         | sed 's#_("--")#"--"#' \
90         | sed 's#_("/dev/dvd")#"/dev/dvd"#' \
91         | sed 's#_(\("./."\))#\1#' \
92         >> /tmp/$$.$file.bak
93     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
94 fi
95 echo -n "$file "
96 done
97
98 file=gtk_support.h
99 if grep "DO NOT EDIT THIS FILE" modules/gui/gtk/$file 2>&1 > /dev/null
100 then
101     rm -f /tmp/$$.$file.bak
102     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
103     mv -f /tmp/$$.$file.bak modules/gui/gtk/$file
104 fi
105 echo "$file."
106
107
108 ##
109 ##  Update the potfiles because no one ever does it
110 ##
111 if test "$do_po" = "no"
112 then
113   echo "not updating potfiles. use --update-po to force doing it."
114 else
115   echo -n " + updating potfiles: "
116   cd po
117   make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
118   cd ..
119   echo "."
120 fi
121