-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathautogen.sh
More file actions
executable file
·86 lines (79 loc) · 1.69 KB
/
autogen.sh
File metadata and controls
executable file
·86 lines (79 loc) · 1.69 KB
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
#!/bin/bash -e
v() { echo "$@"; "$@"; }
m4dir="autotools/m4"
# check for dependencies
if ! qlist -qI dev-libs/gnulib > /dev/null ; then
echo "please install dev-libs/gnulib"
exit 1
fi
if ! qlist -qI dev-build/autoconf-archive > /dev/null ; then
echo "please install dev-build/autoconf-archive"
exit 1
fi
# keep this list updated with non-generated M4 files
keepm4=( ac_check_sendfile.m4 )
for keepf in "${keepm4[@]}" ; do
v mv "${m4dir}/${keepf}" "autotools/"
done
v rm -rf autotools/{gnulib,m4}
v mkdir "${m4dir}"
for keepf in "${keepm4[@]}" ; do
v mv "autotools/${keepf}" "${m4dir}/"
done
# reload the gnulib code
PATH=/usr/local/src/gnu/gnulib:${PATH}
mods="
crypto/md5-buffer
crypto/sha1-buffer
crypto/sha256-buffer
crypto/sha512-buffer
dirent-h
faccessat
fdopendir
fstatat
futimens
getline
getopt-posix
inttypes-h
mkdirat
openat
readlinkat
renameat
stat-time
strcasestr-simple
strncat
strtoll
symlinkat
sys_stat-h
unlinkat
utimensat
xalloc
"
v gnulib-tool \
--source-base=autotools/gnulib --m4-base=autotools/m4 \
--import \
--no-vc-files \
${mods}
{
sed -e '/^# BEGIN GNULIB/,/^# END GNULIB/d' .gitignore
cat <<- EOM
# BEGIN GNULIB -- keep this at the end of this file
# regenerate using:
# ls autotools/gnulib/*.in.h | sed -e 's/\.in\.h/.h/' | sed -e 's:_:/: | sed -e 's:^:/:'
# or use autogen.sh
EOM
ls autotools/gnulib/*.in.h \
| sed -e 's/\.in\.h/.h/' \
| sed -e 's:_:/:' \
| sed -e 's:^:/:'
cat <<- EOM
# manual additions
/autotools/gnulib/sys
/autotools/gnulib/malloc/scratch_buffer.gl.h
*.dirstamp
# END GNULIB
EOM
} > .gitignore.new
[[ -s .gitignore.new ]] && mv .gitignore.new .gitignore
export AUTOMAKE="automake --foreign"
v autoreconf -i -f