Win32: Use _WIN32_WINNT 0x501 everywhere
[vlc.git] / bootstrap
blobceeb9d9812a084c5323bd23d2b6e1b0d7909fa85
1 #! /bin/sh
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>
10 if test "$#" != "0"; then
11 echo "Usage: $0"
12 echo " Calls autoreconf to generate m4 macros and prepare Makefiles."
13 exit 1
16 ###
17 ### Get a sane environment, just in case
18 ###
19 CYGWIN=binmode
20 export CYGWIN
22 set -e
23 set -x
25 cd "$(dirname "$0")"
28 ## Check for various tools
31 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
33 # Check for contrib directory
34 if test -d extras/contrib/build/bin; then
35 PATH="`pwd`/extras/contrib/build/bin:$PATH"
36 if test -d extras/contrib/build/share/aclocal; then
37 ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
39 if test ".`uname -s`" = ".Darwin"; then
40 LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
41 DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
42 export LD_LIBRARY_PATH
43 export DYLD_LIBRARY_PATH
45 elif test ".`uname -s`" = ".Darwin"; then
46 set +x
47 echo ""
48 echo "ERR: Contribs haven't been built"
49 echo "ERR: Please run:"
50 echo "ERR: "
51 echo "ERR: 'cd extras/contrib && ./bootstrap && make && cd ../..'"
52 echo "ERR: "
53 echo "ERR: Make sure fink has been disabled too."
54 echo ""
55 set -x
56 exit 1
59 # Check for pkg-config
60 if pkg-config --version >/dev/null 2>&1; then
61 # We have pkg-config, everything is cool.
62 PKGCONFIG=yes
63 else
64 PKGCONFIG=no
67 # Check for autopoint (GNU gettext)
68 export AUTOPOINT
69 test "$AUTOPOINT" || AUTOPOINT=autopoint
70 if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
71 AUTOPOINT=true
72 echo > ABOUT-NLS
76 ## Generate the modules makefile, by parsing modules/**/Modules.am
79 set +x
80 echo "generating modules/**/Makefile.am"
82 # Prepare m4/private.m4
83 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
84 dnl Private VLC macros - generated by bootstrap
86 EOF
88 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
89 dnl User does not have pkg-config, so assume package was not found
90 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
92 EOF
95 sh modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
97 ###
98 ### classic bootstrap stuff
99 ###
100 set -x
102 # Automake complains if these are not present
103 echo > vlc-config.in
104 echo > ABOUT-NLS
105 cp -f INSTALL INSTALL.git
107 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
108 rm -f po/Makevars.template ABOUT-NLS
109 echo > ABOUT-NLS
110 mv -f INSTALL.git INSTALL
113 ## files which need to be regenerated
115 rm -f vlc-config.in vlc-config
116 rm -f stamp-h*
118 # Shut up
119 set +x
122 ## Tell the user about gettext, pkg-config and sed
124 if [ "$AUTOPOINT" = "true" ]; then
125 cat << EOF
127 ==============================================================
128 NOTE: GNU gettext appears to be missing or out-of-date.
129 Please install or update GNU gettext.
130 Also check if you have cvs, a dependency of autopoint.
131 Otherwise, you will not be able to build a source tarball.
135 if [ "$PKGCONFIG" = "no" ]; then
136 cat << EOF
138 ==============================================================
139 NOTE: "pkg-config" is missing from your system. Certain
140 libraries may not be detected properly.
144 echo "Successfully bootstrapped"