File: autogen.sh

package info (click to toggle)
bwm-ng 0.6-3.1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd, wheezy
  • size: 992 kB
  • sloc: ansic: 3,137; sh: 904; makefile: 59
file content (160 lines) | stat: -rwxr-xr-x 4,744 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#! /bin/sh

# Copyright (c) 2002  Daniel Elstner  <daniel.elstner@gmx.net>
#   * minor changes by Daniel Holbach <dh@mailempfang.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License VERSION 2 as
# published by the Free Software Foundation.  You are not allowed to
# use any other version of the license; unless you got the explicit
# permission from the author to do so.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


# Be Bourne compatible. (stolen from autoconf)
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi

PROJECT=bwm-ng
autoconf=autoconf
autoheader=autoheader
aclocal=
automake=
auto_version=0


srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.

origdir=`pwd`
cd "$srcdir"

AUTOMAKE_FLAGS="--add-missing --gnu $AUTOMAKE_FLAGS"

if test -z "$AUTOGEN_SUBDIR_MODE" && test "x$*" = x
then
  echo "I am going to run ./configure with no arguments - if you wish "
  echo "to pass any to it, please specify them on the $0 command line."
fi

if test -n "$AUTOCONF_VERSION"
then
   echo "test for autoconf version"
   for suffix in "" -2.62 -2.61 -2.60 -2.59 -2.58 -2.57 -2.56 -2.55 -2.54 -2.53 -2.52 -2.51
   do
      autoconf_version=`autoconf$suffix --version </dev/null 2>/dev/null | head -n1 | cut -d " " -f 4`
      autoheader_version=`autoheader$suffix --version </dev/null 2>/dev/null | head -n1 | cut -d " " -f 4`
      version=`echo "$autoconf_version" | cut -c-3 | tr -d .`
      if test -n "$autoconf_version" && test -n "$autoheader_version" && test "$autoconf_version" = "$autoheader_version" && \
         test -n "$version" && \
         test -z "`echo -n $version | sed -n s/[0-9]*//p`"
      then
         autoconf=autoconf$suffix
         autoheader=autoheader$suffix
         if test -n "$suffix"
         then
            echo "found version `echo $suffix | cut -c2-`"
            export AUTOCONF_VERSION=`echo $suffix | cut -c2-`
         fi
         break
      fi
   done
fi

if test -n "$AUTOMAKE_VERSION"
then
	echo "test for automake version"
	for suffix in "" -1.9 -1.8 -1.7 
	do
	  aclocal_version=`aclocal$suffix --version </dev/null 2>/dev/null | head -n1 | cut -d " " -f 4`
	  automake_version=`automake$suffix --version </dev/null 2>/dev/null | head -n1 | cut -d " " -f 4`
	  if test -n "$aclocal_version" && test -n "$automake_version" && test "$aclocal_version" = "$automake_version" && \
		  test -n `echo "$aclocal_version" | cut -c-3 | tr -d .` 
	  then
		  auto_version=`echo "$aclocal_version" | cut -c-3 | tr -d .`
		  if test -z "`echo -n $auto_version | sed -n s/[0-9]*//p`" && test $auto_version -ge 16
		  then
			  aclocal=aclocal$suffix
			  automake=automake$suffix
			  if test -n "$suffix"
			  then
				  echo "found version `echo $suffix | cut -c2-`"
				  export AUTOMAKE_VERSION=`echo $suffix | cut -c2-`
			  fi
			  break
		  fi
	  fi
	done
else
	aclocal=aclocal
	automake=automake
fi

if test -z "$aclocal" || test -z "$automake"
then
	echo "*******************************"
	echo "AT LEAST automake 1.7 REQUIRED!"
	echo "*******************************"
	exit 1
fi

set_option=':'
test -n "${BASH_VERSION+set}" && set_option='set'

$set_option -x

echo trying autoreconf to setup build enviroment
autoreconf -v -i -s -W all 
if test $? -eq 0 
then
   echo running configure now
	if test -z "$AUTOGEN_SUBDIR_MODE"
	then
	  "$srcdir/configure" ${1+"$@"} || exit 1
	  $set_option +x
	  echo
	  echo "Now type 'make' to compile $PROJECT."
	fi	
   exit 0
fi

echo looks like there is no autoreconf, trying to setup all now


rm -f config.guess config.sub depcomp install-sh missing mkinstalldirs
rm -f config.cache acconfig.h
rm -rf autom4te.cache

WARNINGS=all
export WARNINGS

"$aclocal" $ACLOCAL_FLAGS   || exit 1
"$autoheader"           || exit 1
"$automake" $AUTOMAKE_FLAGS || exit 1
"$autoconf"         || exit 1
cd "$origdir"           || exit 1

if test -z "$AUTOGEN_SUBDIR_MODE"
then
  "$srcdir/configure" ${1+"$@"} || exit 1
  $set_option +x
  echo
  echo "Now type 'make' to compile $PROJECT."
fi

exit 0