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