File: autogen.sh

package info (click to toggle)
nexus 4.3.2-svn1921-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 45,052 kB
  • sloc: java: 70,724; cpp: 34,810; ansic: 19,434; xml: 4,191; python: 4,123; f90: 2,326; fortran: 1,529; makefile: 1,105; sh: 809; tcl: 173; lisp: 169; pascal: 93; haskell: 27
file content (180 lines) | stat: -rwxr-xr-x 4,189 bytes parent folder | download | duplicates (2)
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/sh

rm -fr autom4te.cache

PACKAGE_RELEASE=""
NEXUS_VERSION=""
NEXUS_RELEASE=""
while getopts "p:r:v:" opt; do
  case $opt in
    p)
	PACKAGE_RELEASE="$OPTARG"
	;;
    v)
	NEXUS_VERSION="$OPTARG"
	;;
    r)
	NEXUS_RELEASE="$OPTARG"
	;;
    \?)
	echo "Invalid option: -$OPTARG" >&2
	;;
  esac
done
if test ! -z "$PACKAGE_RELEASE"; then
    echo "Setting package release to $PACKAGE_RELEASE"
    mv configure.ac configure.ac.$$
    sed -e "s/^m4_define.*PACKAGE_REL.*/m4_define\([PACKAGE_REL],[$PACKAGE_RELEASE]\)dnl/" < configure.ac.$$ > configure.ac
    rm -f configure.ac.$$
fi
if test ! -z "$NEXUS_VERSION"; then
    echo "Setting NeXus version to $NEXUS_VERSION"
    mv configure.ac configure.ac.$$
    sed -e "s/^m4_define.*NEXUS_VERSION.*/m4_define\([NEXUS_VERSION],[$NEXUS_VERSION]\)dnl/" < configure.ac.$$ > configure.ac
    rm -f configure.ac.$$
fi
if test ! -z "$NEXUS_RELEASE"; then
    echo "Setting NeXus release to $NEXUS_RELEASE"
    mv configure.ac configure.ac.$$
    sed -e "s/^m4_define.*NEXUS_REL.*/m4_define\([NEXUS_REL],[$NEXUS_RELEASE]\)dnl/" < configure.ac.$$ > configure.ac
    rm -f configure.ac.$$
fi

for libtoolize in glibtoolize libtoolize ; do 
	LIBTOOLIZE=`which $libtoolize 2>/dev/null`
	if test "$LIBTOOLIZE" ; then
		break;
	fi
done
LIBTOOLIZE="$libtoolize --force --copy --automake"

# set up environment variables with the correct
# version of autoconf and automake - this also needs
# to be done in configure.ac to maintain consistancy
. ./autoversion.sh

touch AUTHORS NEWS README
rm -f ChangeLog

# Discover what version of autoconf we are using.
autoconfversion=`$AUTOCONF --version | head -n 1`
automakeversion=`$AUTOMAKE --version | head -n 1`
libtoolversion=`$LIBTOOLIZE --version | head -n 1`

echo "Using $autoconfversion"
echo "Using $automakeversion"
echo "Using $libtoolversion"
case $autoconfversion in
    *2.6*)
	;;
    *2.7*)
	;;
    *)
	echo "This autoconf version is not supported by NeXus."
	echo "NeXus only supports autoconf 2.61 and above"
	echo "You may download it from ftp://ftp.gnu.org/gnu/autoconf"
	exit
	;;
esac

case $automakeversion in
    *1.[4-9]*)
	;;
    *1.1[0-9]*)
	;;
    *)
	echo "This automake version is not supported by NeXus."
	echo "NeXus only supports automake 1.4 and above"
	echo "You may download it from ftp://ftp.gnu.org/gnu/automake"
	exit
	;;
esac

case $libtoolversion in
    *1.[456]*)
	;;
    *[2-9].*)
	;;
    *)
	echo "This libtool version is not supported by NeXus."
	echo "NeXus only supports libtool 1.4 and above"
	echo "You may download it from ftp://ftp.gnu.org/gnu/libtool"
	exit
	;;
esac

echo -n "Locating GNU m4... "
GNUM4=
for prog in $M4 gm4 gnum4 m4; do
	# continue if $prog generates error (e.g. does not exist)
	( $prog --version ) < /dev/null > /dev/null 2>&1
	if test $? -ne 0 ; then continue; fi

	# /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
	case `$prog --version < /dev/null 2>&1` in
	*GNU*)	GNUM4=$prog
		break ;;
	esac
done
if test x$GNUM4 = x ; then
	echo "not found."
	exit
else
	echo `which $GNUM4`
fi

# 
if { test ! -d config ; } ; then 
	mkdir config ; 
else 
	rm -rf config/* ;  
fi

# Prepare the use of libtool
if ( $LIBTOOLIZE --version ) < /dev/null > /dev/null 2>&1 ; then
	echo "Preparing the use of libtool ..."
	$LIBTOOLIZE
	if { test -r ltmain.sh ; } ; then mv ltmain.sh config/ ; fi 
	echo "done."
else
	echo "libtoolize not found -- aborting"
	exit
fi

# Generate the Makefiles and configure files
if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
	echo "Building macros..."
	$ACLOCAL
	echo "done."
else
	echo "aclocal not found -- aborting"
	exit
fi

if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
	echo "Building config header template..."
	$AUTOHEADER 
	echo "done."
else
	echo "autoheader not found -- aborting"
	exit
fi

if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
	echo "Building Makefile templates..."
	$AUTOMAKE
	echo "done."
else
	echo "automake not found -- aborting"
	exit
fi

if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
	echo "Building configure..."
	$AUTOCONF
	echo "done."
else
	echo "autoconf not found -- aborting"
	exit
fi