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