]> git.sesse.net Git - vlc/blob - bootstrap
macosx: fixes pkg-config compilation issue
[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 set -e
11
12 cd "$(dirname "$0")"
13
14 if test "$#" != "0"; then
15   echo "Usage: $0"
16   echo "  Calls autoreconf to generate m4 macros and prepare Makefiles."
17   exit 1
18 fi
19
20 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
21
22 ###
23 ###  Get a sane environment, just in case
24 ###
25 CYGWIN=binmode
26 export CYGWIN
27
28 # Check for contrib directory
29 if test -d extras/contrib/build/bin; then
30   PATH="`pwd`/extras/contrib/build/bin:$PATH"
31   if test -d extras/contrib/build/share/aclocal; then
32     ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
33   fi
34   if test ".`uname -s`" = ".Darwin"; then
35     LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
36     DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
37     export LD_LIBRARY_PATH
38     export DYLD_LIBRARY_PATH
39   fi
40 fi
41
42 # Prepare m4/private.m4
43 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
44 dnl  Private VLC macros - generated by bootstrap
45 EOF
46
47 # Check for pkg-config
48 if ! pkg-config --version >/dev/null 2>&1; then
49         cat << EOF
50 NOTE: "pkg-config" is missing from your system.
51 Many underlying libraries will not be detected.
52 ==============================================================
53
54 EOF
55         cat >> m4/private.m4 << EOF
56 dnl  User does not have pkg-config, so assume package was not found
57 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
58
59 EOF
60 fi
61
62 # Check for autopoint (GNU gettext)
63 export AUTOPOINT
64 test "$AUTOPOINT" || AUTOPOINT=autopoint
65 if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
66         AUTOPOINT=true
67         cat << EOF
68 NOTE: GNU gettext appears to be missing or out-of-date.
69 Please install or update GNU gettext.
70 Also check if you have cvs, a dependency of autopoint.
71 Otherwise, you will not be able to build a source tarball.
72 ==============================================================
73
74 EOF
75 fi
76
77 ###
78 ### Generate the modules makefile, by parsing modules/**/Modules.am
79 ###
80
81 echo "generating modules/**/Makefile.am"
82 find modules/ -name Modules.am | \
83 sed -ne 's,modules/\(.*\)/Modules.am,\1,p' | \
84 while read d; do
85         sh modules/genmf "$d"
86         printf "."
87 done
88 printf "\n"
89
90 set -x
91
92 ###
93 ###  classic bootstrap stuff
94 ###
95
96 # Automake complains if these are not present
97 echo > ABOUT-NLS
98 cp -f INSTALL INSTALL.git
99
100 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
101 rm -f po/Makevars.template ABOUT-NLS
102 echo > ABOUT-NLS
103 mv -f INSTALL.git INSTALL
104
105 ##
106 ##  files which need to be regenerated
107 ##
108 rm -f stamp-h*
109
110 # Shut up
111 set +x
112 echo "Successfully bootstrapped"