File: regenerate_all.sh

package info (click to toggle)
blkreplay 1.0-3.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 25,672 kB
  • sloc: sh: 3,175; ansic: 2,057; makefile: 23
file content (100 lines) | stat: -rwxr-xr-x 2,629 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
#!/bin/bash

echo "####################################################"
echo "Regenerating (almost) everything from scratch..."
echo ""
rm="rm -rf conf* auto* ac* missing install-sh INSTALL depcomp stamp* Makefile *.in src/*.in src/*.o src/*.exe src/Makefile src/*/*.in src/*/*.o src/*/*.exe src/*/Makefile"
echo "$rm"
$rm

ls -lt

echo "autoscan..."
autoscan || exit $?
<<EOF cat > configure.ac
####################################################

# This file is automatically generated from regenerate_all.sh => DO NOT EDIT!

####################################################
# customization prefix

AC_DEFINE([_GNU_SOURCE])
AH_VERBATIM([_GNU_SOURCE],
[/* Enable GNU extensions on systems that have them.  */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif])

define(IS_REQUIRED, [AC_MSG_ERROR([this is absolutely needed])])

AC_INIT([blkreplay], [0.1], [tst@1und1.de])
AM_INIT_AUTOMAKE([-Wall -Werror])

AC_SEARCH_LIBS([log10], [m], , IS_REQUIRED)
AC_SEARCH_LIBS([clock_gettime], [rt], , IS_REQUIRED)

AC_SEARCH_LIBS([nanosleep])

AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([time.h])

# required functions
AC_CHECK_DECLS([strlen, malloc, free], , IS_REQUIRED)

# optional functions
#AC_CHECK_DECLS([O_LARGEFILE]) # does not work, use direct test instead
AC_CHECK_DECLS([nanosleep],,,[#define _GNU_SOURCE 1
#include <time.h>])
AC_CHECK_DECLS([random])
AC_CHECK_DECLS([exp10])
AC_CHECK_DECLS([lseek64])
AC_CHECK_DECLS([llseek])
AC_CHECK_DECLS([lseek])
AC_CHECK_DECLS([memalign])
AC_CHECK_DECLS([posix_memalign], ,
[AC_MSG_WARN([posix_memalign() not available, substituting by malloc()
====> This may lead to distortions of your measurements!])])

####################################################
EOF
grep -v "AC_INIT\|AC_OUTPUT" < configure.scan >> configure.ac
rm configure.scan 
<<EOF cat >> configure.ac
####################################################
# customization suffix

$(for i in src/arch.*/subconfigure.ac; do echo "m4_include([$i])"; done)

AM_PROG_CC_C_O

####################################################
AC_OUTPUT
EOF

(
  grep -v SUBDIRS < src/Makefile.am
  echo "SUBDIRS = $(cd src; echo arch.*)"
) > src/Makefile.tmp && mv src/Makefile.tmp src/Makefile.am

echo "aclocal..."
aclocal || exit $?

echo "autoheader..."
autoheader || exit $?

echo "autoreconf --install..."
autoreconf --install

echo "autoconf..."
autoconf || exit $?

echo "automake..."
automake || exit $?

echo "git add..."
git add $0 configure.ac configure INSTALL *.in src/*.{am,in} src/arch.*/*.{ac,am,in}

echo "OK, now do 'git commit' by hand if all is right."