]> git.sesse.net Git - vlc/blob - bootstrap
Create ABOUT-NLS before running autoreconf
[vlc] / bootstrap
1 #! /bin/sh
2
3 ##  bootstrap file for the VLC media player
4 ##
5 ## Copyright (C) 2005-2008 the VideoLAN team
6 ##
7 ##  Authors: Sam Hocevar <sam@zoy.org>
8 ##           RĂ©mi Denis-Courmont <rem # videolan # org>
9
10 if test "$#" != "0"; then
11   echo "Usage: $0"
12   echo "  Calls autoreconf to generate m4 macros and prepare Makefiles."
13   exit 1
14 fi
15
16 ###
17 ###  Get a sane environment, just in case
18 ###
19 CYGWIN=binmode
20 export CYGWIN
21
22 set -e
23 set -x
24
25 ##
26 ## Check for various tools
27 ##
28
29 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
30
31 # Check for contrib directory
32 if test -d extras/contrib/bin; then
33   PATH="`pwd`/extras/contrib/bin:$PATH"
34   if test -d extras/contrib/share/aclocal; then
35     ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
36   fi
37   if test ".`uname -s`" = ".Darwin"; then
38     LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
39     DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
40     export LD_LIBRARY_PATH
41     export DYLD_LIBRARY_PATH
42   elif test ".`uname -s`" = ".BeOS"; then
43     LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
44     BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
45     export LIBRARY_PATH
46     export BELIBRARIES
47   fi
48 elif test ".`uname -s`" = ".Darwin"; then
49   set +x
50   echo ""
51   echo "ERR: Contribs haven't been built"
52   echo "ERR: Please run:"
53   echo "ERR: "
54   echo "ERR:    'cd extras/contrib && ./bootstrap && make && cd ../..'"
55   echo "ERR: "
56   echo "ERR: Make sure fink has been disabled too."
57   echo ""
58   set -x
59   exit 1
60 fi
61
62 # Check for pkg-config
63 if pkg-config --version >/dev/null 2>&1; then
64   # We have pkg-config, everything is cool.
65   PKGCONFIG=yes
66 else
67   PKGCONFIG=no
68 fi
69
70 ##
71 ## Generate the modules makefile, by parsing modules/**/Modules.am
72 ##
73
74 set +x
75 echo "generating modules/**/Makefile.am and m4/private.m4"
76
77 # Prepare m4/private.m4
78 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
79 dnl  Private VLC macros - generated by bootstrap
80
81 EOF
82
83 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
84 dnl  User does not have pkg-config, so assume package was not found
85 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
86
87 EOF
88 fi
89
90 cat >> m4/private.m4 << EOF
91 dnl  Helper macro for vlc-config generation
92 AC_DEFUN([VLC_CONFIG_HELPER], [
93   cat >> vlc-config.in << BLAH
94 EOF
95
96 modules=""
97
98 modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
99
100 cat >> m4/private.m4 << EOF
101 BLAH
102 ])
103 EOF
104
105 ###
106 ###  classic bootstrap stuff
107 ###
108 set -x
109
110 # Automake complains if these are not present
111 echo > vlc-config.in
112 echo > ABOUT-NLS
113 cp -f INSTALL INSTALL.git
114
115 AUTOPOINT=true autoreconf --install --force --verbose ${ACLOCAL_ARGS}
116 rm -f po/Makevars.template
117 mv -f INSTALL.git INSTALL
118
119 ##
120 ##  files which need to be regenerated
121 ##
122 rm -f vlc-config.in vlc-config
123 rm -f src/misc/modules_builtin.h
124 rm -f stamp-builtin stamp-h* mozilla/stamp-pic
125
126 # Shut up
127 set +x
128
129 ##
130 ##  Tell the user about gettext, pkg-config and sed
131 ##
132 if [ "$PKGCONFIG" = "no" ]; then
133   cat << EOF
134
135 ==============================================================
136 NOTE: "pkg-config" is missing from your system. Certain
137 libraries may not be detected properly.
138 EOF
139 fi
140
141 echo "Successfully bootstrapped"