[Forensics-changes] [yara] 274/415: Improve build system
Hilko Bengen
bengen at moszumanska.debian.org
Thu Apr 3 05:43:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch debian
in repository yara.
commit bafb8c06406432f2787a52479863748470129d85
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Tue Dec 3 10:45:47 2013 +0100
Improve build system
---
Makefile.am | 4 +--
bootstrap.sh | 86 +++++++++++++++++++++++++++++++++++++++---------------------
build.sh | 4 +++
configure.ac | 4 +--
4 files changed, 64 insertions(+), 34 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9050eb1..bca6896 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS=-g -O4 -I$(srcdir)/libyara
+AM_CFLAGS=-g -O4 -Wall -I$(srcdir)/libyara
# Build the library in the hand subdirectory first.
SUBDIRS = libyara
@@ -17,5 +17,5 @@ yarac_LDADD = libyara/.libs/libyara.a
# man page
man1_MANS = yara.man
-EXTRA_DIST = $(man1_MANS) REVISION
+EXTRA_DIST = $(man1_MANS) README.md
diff --git a/bootstrap.sh b/bootstrap.sh
index 735a082..3145865 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,42 +1,68 @@
#!/bin/sh
-# Quick and dirty script to reset everything
-# regarding libtool, autoconf, automake, etc.
+die() {
+ echo "$@"
+ exit 1
+}
-rm -rf m4
-rm -rf libyara/m4
+# Try to locate a program by using which, and verify that the file is an
+# executable
+locate_binary() {
+ for f in $@
+ do
+ file=`which $f 2>/dev/null | grep -v '^no '`
+ if test -n "$file" -a -x "$file"; then
+ echo $file
+ return 0
+ fi
+ done
-mkdir m4
-mkdir libyara/m4
+ echo ""
+ return 1
+}
-cd libyara
+autogen() {
-# Check if libtoolize exists, if not,
-# try with glibtoolize (Mac OS X name it that way)
+ echo "libtoolize..."
+ if test x$LIBTOOLIZE = x; then
+ LIBTOOLIZE=`locate_binary libtoolize glibtoolize`
+ if test x$LIBTOOLIZE = x; then
+ die "Did not find a supported aclocal"
+ fi
+ fi
+ $LIBTOOLIZE --force --quiet || exit 1
-hash libtoolize &> /dev/null
-if [ $? -eq 1 ]; then
- glibtoolize --force
-else
- libtoolize --force
-fi
+ echo "aclocal..."
+ if test x$ACLOCAL = x; then
+ ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal-1.7 aclocal17 aclocal-1.5 aclocal15 aclocal`
+ if test x$ACLOCAL = x; then
+ die "Did not find a supported aclocal"
+ fi
+ fi
+ $ACLOCAL || exit 1
-aclocal
-autoheader
-automake --add-missing
-autoreconf
+ echo "autoheader..."
+ AUTOHEADER=${AUTOHEADER:-autoheader}
+ $AUTOHEADER || exit 1
-cd ..
+ echo "automake..."
+ if test x$AUTOMAKE = x; then
+ AUTOMAKE=`locate_binary automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.7`
+ if test x$AUTOMAKE = x; then
+ die "Did not find a supported automake"
+ fi
+ fi
+ $AUTOMAKE --foreign --add-missing || $AUTOMAKE --gnu --add-missing || exit 1
-hash libtoolize &> /dev/null
-if [ $? -eq 1 ]; then
- glibtoolize --force
-else
- libtoolize --force
-fi
+ echo "autoconf..."
+ AUTOCONF=${AUTOCONF:-autoconf}
+ $AUTOCONF || exit 1
-aclocal
-autoheader
-automake --add-missing
-autoreconf
+}
+echo "== bootstraping yara"
+autogen
+echo "== bootstraping libyara"
+cd libyara
+autogen
+cd ..
\ No newline at end of file
diff --git a/build.sh b/build.sh
new file mode 100644
index 0000000..90bb778
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+./bootstrap.sh
+./configure
+make
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
index 7fbd5a7..ac83050 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,13 +2,13 @@ AC_INIT([yara], [2.0], [vmalvarez at virustotal.com])
${CFLAGS=""}
-# automake 1.12 seems to require AM_PROG_AR, but automake 1.11 doesn't
+# automake 1.12 seems to require AM_PROG_AR, but automake 1.11 doesn't
# recognize it
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
-AM_INIT_AUTOMAKE([-Wall -Werror])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list