File: rebuild

package info (click to toggle)
links2 2.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,852 kB
  • sloc: ansic: 181,859; sh: 2,585; cpp: 1,450; makefile: 84; awk: 49; perl: 34
file content (157 lines) | stat: -rwxr-xr-x 4,899 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# rebuild
# (c) 2002 Karel 'Clock' Kulhavy, Mikulas Patocka, Petr 'Brain' Kulhavy
# This file is a part of the Links program, released under GPL.

make=make
if which gmake 2>/dev/null >/dev/null && gmake --version | grep -i "GNU Make" >/dev/null; then
	echo Found GNU Make under gmake. Going to use gmake instead of make.
	make=gmake
fi

N="`grep -c ^processor /proc/cpuinfo 2>/dev/null || true`"
if ! test "$N" = 0 -o "$N" = ""; then
	MAKEFLAGS=-j$N
	export MAKEFLAGS
fi

if which automake-1.4 2>/dev/null >/dev/null; then
	automake="automake-1.4"
else
	automake="automake"
fi

if which aclocal-1.4 2>/dev/null >/dev/null; then
	aclocal="aclocal-1.4"
	if [ -d /usr/share/aclocal-1.4/ ]; then
		aclocal="$aclocal --acdir=/usr/share/aclocal-1.4/"
	fi
else
	aclocal="aclocal"
fi

if which autoconf2.13 2>/dev/null >/dev/null; then
	autoconf="autoconf2.13"
elif which autoconf-2.13 2>/dev/null >/dev/null; then
	autoconf="autoconf-2.13"
else
	autoconf="autoconf"
fi

if which autoheader2.13 2>/dev/null >/dev/null; then
	autoheader="autoheader2.13"
elif which autoheader-2.13 2>/dev/null >/dev/null; then
	autoheader="autoheader-2.13"
else
	autoheader="autoheader"
fi

if [ "$1" = reconf ]; then
	if ! which pkg-config 2>/dev/null >/dev/null; then
		echo Warning: You don\'t have pkg-config. The PKG_CHECK_MODULES macro will probably fail. >&2
	fi

	if ! which $autoconf 2>/dev/null >/dev/null; then
		echo You don\'t have autoconf. Wiping out. >&2
		exit 1
	fi

	if ! $autoconf --version | grep -i "GNU Autoconf" >/dev/null; then
		echo This looks like autoconf installed on OpenBSD. >&2
		if ! AUTOCONF_VERSION=2.13 $autoconf --version 2>/dev/null >/dev/null
		then
			echo Autoconf 2.13 is not found. This script needs at most autoconf 2.13. \
			Trying with some other \(random\) autoconf. >&2
			exit 1
			path=`echo "$PATH" | tr -s ':' '\n'`
			alt=`find $path -name 'autoconf*' -and ! -name autoconf | head -n 1`
			if [ -z "$alt" ]
				then
				echo Cannot find the real autoconf >&2
				exit 1
			fi
			export AUTOCONF_VERSION=`echo $alt | sed -e 's/^.*autoconf-//g'`
			echo Found $alt. Setting AUTOCONF_VERSION to $AUTOCONF_VERSION.>&2
		else
			echo Found Autoconf 2.13. It should work. >&2
			export AUTOCONF_VERSION=2.13
		fi
	fi

	if ! $automake --version | grep -i "GNU automake" >/dev/null
	then
		echo This looks like automake installed on OpenBSD. >&2
		export AUTOMAKE_VERSION=1.4
		if ! $automake --version 2>/dev/null >/dev/null
		then
			echo Automake 1.4 is needed. Wiping out. >&2
			exit 1
		fi
		echo Found Automake 1.4. It should work. >&2
	fi
fi

do_reconf=false

rm -f config.h Makefile config.cache &&
if [ "$1" = reconf ]; then
	do_reconf=true
	shift
	echo NEPOUZIVAT pokud nebylo zmeneno configure.in nebo Makefile.am !!! &&
        echo DO NOT use unless configure.in or Makefile.am has been changed !!! &&
	echo rebuild reconf se NESMI prerusit protoze pak by pri nasledujicim commitu byly commitnuty spatne dependence a pri kompilaci by tise vznikaly zahadne neodladitelne chyby!!! &&
	echo rebuild reconf MUST NOT be interrupted because after the following commit bad dependencies would be commited and during compilation, mysterious and undebuggable bugs would originate!!! &&
	echo Timto mistoprisezne prohlasuji ze toto skutecne nastalo a ze proces neprerusim. &&
	echo I hereby affirm that this really has happened and I won\'t break the process. &&
	read kecy &&
	if [ "$kecy" = "ano" -o "$kecy" = "Ano" -o "$kecy" = "yes" -o "$kecy" = "Yes" ]; then
		echo Zodpovednost prijata. &&
		echo Responsibility accepted. &&
		rm -rf .deps missing depcomp aclocal.m4 &&
		$autoheader &&
		rm -f autoh* &&
		$aclocal -I . &&
		$automake --add-missing &&
		sed 's%sed '\''s/\\\.am\$/\.in/'\''%sed '\''s/\\\.[aA][mM]\$/\.in/'\''%' <missing >missing.tmp &&
		mv -f missing.tmp missing &&
		chmod a+x missing &&
		$autoconf &&
		ed configure <<EOS
1a
LANG=
LC_ALL=
.
/DELETE1/-1,/DELETE1/d
/DELETE2/-1,/DELETE2/d
w
q
EOS

	else
		exit
	fi
fi &&
if [ "$1" = reconf_aby_to_brain_nepouzival ]; then
	echo "Mikulasi, vyser si voko!" &&
	exit
fi &&
#cd Unicode;./gen; cd ..
#cd intl; ./synclang; cd ..
export CFLAGS="-Wall -g -O2 -pipe -fno-common $CFLAGS" &&
#export CFLAGS="-Wall -g -O2 -pipe -ansi -U__STRICT_ANSI__"
export CXXFLAGS="$CXXFLAGS -Wall -g -O2 -pipe" &&
./configure --enable-graphics --enable-debuglevel=2 "$@" &&
$make clean &&
$make &&
if $do_reconf; then
	$autoheader &&
	$automake --add-missing --include-deps --build-dir=. --srcdir-name=. --output-dir=. &&
	sed 's%sed '\''s/\\\.am\$/\.in/'\''%sed '\''s/\\\.[aA][mM]\$/\.in/'\''%' <missing >missing.tmp &&
	mv -f missing.tmp missing &&
	chmod a+x missing &&
	sed -n '{h;s/X11R6/X11R7/p;x;p;}' <configure >configure.tmp &&
	mv -f configure.tmp configure &&
	chmod a+x configure &&
	./configure --enable-graphics --enable-debuglevel=2 "$@"
	if [ $? != 0 ]; then echo CONFIGURE FAILED; exit 1; fi
fi