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