~ubuntu-branches/ubuntu/precise/libgcrypt11/precise-security

« back to all changes in this revision

Viewing changes to autogen.sh

Tags: 1.5.0-1
* Merge multi-arch changes (1.4.6-6 and 1.4.6-7), drop libtool la file.
* Drop CFLAGS += -Wall again, it has become unnecessary.
* New upstream version.
* Bump shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
 
# Run this to generate all the initial makefiles, etc. 
 
2
# Run this to generate all the initial makefiles, etc.
3
3
#
4
4
# Copyright (C) 2003 g10 Code GmbH
5
5
#
36
36
  shift
37
37
fi
38
38
 
 
39
# Begin list of optional variables sourced from ~/.gnupg-autogen.rc
 
40
w32_toolprefixes=
 
41
w32_extraoptions=
 
42
w32ce_toolprefixes=
 
43
w32ce_extraoptions=
 
44
amd64_toolprefixes=
 
45
# End list of optional variables sourced from ~/.gnupg-autogen.rc
 
46
# What follows are variables which are sourced but default to
 
47
# environment variables or lacking them hardcoded values.
 
48
#w32root=
 
49
#w32ce_root=
 
50
#amd64root=
 
51
 
 
52
if [ -f "$HOME/.gnupg-autogen.rc" ]; then
 
53
    echo "sourcing extra definitions from $HOME/.gnupg-autogen.rc"
 
54
    . "$HOME/.gnupg-autogen.rc"
 
55
fi
 
56
 
 
57
# Convenience option to use certain configure options for some hosts.
 
58
myhost=""
 
59
myhostsub=""
 
60
case "$1" in
 
61
    --build-w32)
 
62
        myhost="w32"
 
63
        ;;
 
64
    --build-w32ce)
 
65
        myhost="w32"
 
66
        myhostsub="ce"
 
67
        ;;
 
68
    --build-amd64)
 
69
        myhost="amd64"
 
70
        ;;
 
71
    --build*)
 
72
        echo "**Error**: invalid build option $1" >&2
 
73
        exit 1
 
74
        ;;
 
75
     *)
 
76
        ;;
 
77
esac
 
78
 
 
79
 
39
80
# ***** W32 build script *******
40
81
# Used to cross-compile for Windows.
41
 
if test "$1" = "--build-w32"; then
 
82
if [ "$myhost" = "w32" ]; then
42
83
    tmp=`dirname $0`
43
84
    tsdir=`cd "$tmp"; pwd`
44
85
    shift
48
89
    fi
49
90
    build=`$tsdir/config.guess`
50
91
 
51
 
    [ -z "$w32root" ] && w32root="$HOME/w32root"
 
92
    case $myhostsub in
 
93
        ce)
 
94
          w32root="$w32ce_root"
 
95
          [ -z "$w32root" ] && w32root="$HOME/w32ce_root"
 
96
          toolprefixes="arm-mingw32ce"
 
97
          ;;
 
98
        *)
 
99
          [ -z "$w32root" ] && w32root="$HOME/w32root"
 
100
          toolprefixes="i586-mingw32msvc i386-mingw32msvc"
 
101
          ;;
 
102
    esac
52
103
    echo "Using $w32root as standard install directory" >&2
53
 
    
 
104
 
54
105
    # Locate the cross compiler
55
106
    crossbindir=
56
 
    for host in i586-mingw32msvc i386-mingw32msvc; do
 
107
    for host in $toolprefixes; do
57
108
        if ${host}-gcc --version >/dev/null 2>&1 ; then
58
109
            crossbindir=/usr/${host}/bin
59
110
            conf_CC="CC=${host}-gcc"
62
113
    done
63
114
    if [ -z "$crossbindir" ]; then
64
115
        echo "Cross compiler kit not installed" >&2
65
 
        echo "Under Debian GNU/Linux, you may install it using" >&2
66
 
        echo "  apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2 
 
116
        if [ -z "$sub" ]; then
 
117
          echo "Under Debian GNU/Linux, you may install it using" >&2
 
118
          echo "  apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2
 
119
        fi
67
120
        echo "Stop." >&2
68
121
        exit 1
69
122
    fi
70
 
   
 
123
 
71
124
    if [ -f "$tsdir/config.log" ]; then
72
125
        if ! head $tsdir/config.log | grep "$host" >/dev/null; then
73
126
            echo "Pease run a 'make distclean' first" >&2
75
128
        fi
76
129
    fi
77
130
 
78
 
    ./configure --enable-maintainer-mode  --prefix=${w32root}  \
 
131
    $tsdir/configure --enable-maintainer-mode  --prefix=${w32root}  \
79
132
            --host=${host} --build=${build} \
80
133
            --with-gpg-error-prefix=${w32root}
81
134
    exit $?
85
138
 
86
139
# ***** AMD64 cross build script *******
87
140
# Used to cross-compile for AMD64 (for testing)
88
 
if test "$1" = "--build-amd64"; then
 
141
if [ "$myhost" = "amd64" ]; then
89
142
    tmp=`dirname $0`
90
143
    tsdir=`cd "$tmp"; pwd`
91
144
    shift
97
150
 
98
151
    [ -z "$amd64root" ] && amd64root="$HOME/amd64root"
99
152
    echo "Using $amd64root as standard install directory" >&2
100
 
    
 
153
 
101
154
    # Locate the cross compiler
102
155
    crossbindir=
103
156
    for host in x86_64-linux-gnu amd64-linux-gnu; do
112
165
        echo "Stop." >&2
113
166
        exit 1
114
167
    fi
115
 
   
 
168
 
116
169
    if [ -f "$tsdir/config.log" ]; then
117
170
        if ! head $tsdir/config.log | grep "$host" >/dev/null; then
118
171
            echo "Please run a 'make distclean' first" >&2
122
175
 
123
176
    $tsdir/configure --enable-maintainer-mode --prefix=${amd64root}  \
124
177
             --host=${host} --build=${build} \
125
 
             --with-gpg-error-prefix=${amd64root} 
126
 
 
 
178
             --with-gpg-error-prefix=${amd64root}
 
179
 
127
180
    rc=$?
128
181
    exit $rc
129
182
fi
130
183
# ***** end AMD64 cross build script *******
131
184
 
132
185
# Grep the required versions from configure.ac
133
 
autoconf_vers=`sed -n '/^AC_PREREQ(/ { 
 
186
autoconf_vers=`sed -n '/^AC_PREREQ(/ {
134
187
s/^.*(\(.*\))/\1/p
135
188
q
136
189
}' ${configure_ac}`
137
190
autoconf_vers_num=`echo "$autoconf_vers" | cvtver`
138
191
 
139
 
automake_vers=`sed -n '/^min_automake_version=/ { 
 
192
automake_vers=`sed -n '/^min_automake_version=/ {
140
193
s/^.*="\(.*\)"/\1/p
141
194
q
142
195
}' ${configure_ac}`
143
196
automake_vers_num=`echo "$automake_vers" | cvtver`
144
197
 
145
 
#gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ { 
 
198
#gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
146
199
#s/^.*(\(.*\))/\1/p
147
200
#q
148
201
#}' ${configure_ac}`
179
232
if test "$DIE" = "yes"; then
180
233
    cat <<EOF
181
234
 
182
 
Note that you may use alternative versions of the tools by setting 
 
235
Note that you may use alternative versions of the tools by setting
183
236
the corresponding environment variables; see README.SVN for details.
184
 
                   
 
237
 
185
238
EOF
186
239
    exit 1
187
240
fi
188
241
 
 
242
# Check the git setup.
 
243
if [ -d .git ]; then
 
244
  if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
 
245
    cat <<EOF >&2
 
246
*** Activating trailing whitespace git pre-commit hook. ***
 
247
    For more information see this thread:
 
248
      http://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084html
 
249
    To deactivate this pre-commit hook again move .git/hooks/pre-commit
 
250
    and .git/hooks/pre-commit.sample out of the way.
 
251
EOF
 
252
      cp -av .git/hooks/pre-commit.sample .git/hooks/pre-commit
 
253
      chmod -c +x  .git/hooks/pre-commit
 
254
  fi
 
255
fi
 
256
 
 
257
 
189
258
echo "Running aclocal -I m4 ${ACLOCAL_FLAGS:+$ACLOCAL_FLAGS }..."
190
259
$ACLOCAL -I m4 $ACLOCAL_FLAGS
191
260
echo "Running autoheader..."
195
264
echo "Running autoconf${FORCE} ..."
196
265
$AUTOCONF${FORCE}
197
266
 
198
 
echo "You may now run: 
 
267
echo "You may now run:
199
268
  ./configure --enable-maintainer-mode && make
200
269
"