Commit 73b9c415 by devttys0

Added --with-python and --disable-clibs configure options.

parent 22ee406b
......@@ -7,33 +7,33 @@ export exec_prefix=@exec_prefix@
export LIBDIR=@libdir@
export INSTALL_OPTIONS=@INSTALL_OPTIONS@
PYTHON=python
BUILD_C_LIBS=@BUILD_C_LIBS@
PYTHON=@PYTHON@
SRC_C_DIR="./src/C"
.PHONY: all install build deps clean uninstall
all: build
install:
make -C $(SRC_C_DIR) install
install: build
$(PYTHON) ./setup.py install
ldconfig || true
build:
make -C $(SRC_C_DIR)
$(PYTHON) ./setup.py build
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then ldconfig || true; fi
deps:
./deps.sh
build:
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR); fi
$(PYTHON) ./setup.py build
clean:
make -C $(SRC_C_DIR) clean
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR) clean; fi
$(PYTHON) ./setup.py clean
distclean: clean
make -C $(SRC_C_DIR) distclean
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR) distclean; fi
rm -rf Makefile config.* *.cache
uninstall:
make -C $(SRC_C_DIR) uninstall
if [ "$(BUILD_C_LIBS)" -eq "1" ]; then make -C $(SRC_C_DIR) uninstall; fi
$(PYTHON) ./setup.py uninstall
......@@ -602,6 +602,8 @@ ac_subst_vars='LTLIBOBJS
INSTALL_OPTIONS
SOEXT
SONAME
PYTHON
BUILD_C_LIBS
LIBOBJS
EGREP
GREP
......@@ -654,6 +656,8 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_python
enable_clibs
'
ac_precious_vars='build_alias
host_alias
......@@ -1269,6 +1273,18 @@ if test -n "$ac_init_help"; then
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-clibs do not build/install dependent c libraries
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-python=python explicitly install using the specified python
interpreter (python2, python3, etc)
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
......@@ -3274,6 +3290,23 @@ fi
# Check whether --with-python was given.
if test "${with_python+set}" = set; then :
withval=$with_python; PYTHON=$withval
else
PYTHON=python
fi
# Check whether --enable-clibs was given.
if test "${enable_clibs+set}" = set; then :
enableval=$enable_clibs; BUILD_C_LIBS=0
else
BUILD_C_LIBS=1
fi
CFLAGS="-Wall -fPIC $CFLAGS"
if test "$(uname)" == "Darwin"
......@@ -3287,8 +3320,15 @@ else
INSTALL_OPTIONS="-D -m644"
fi
(cd ./src/C/file-*/ && autoreconf -v && ./configure) || exit 1
(cd ./src/C/ssdeep-*/ && autoreconf -v && ./configure) || exit 1
if test "$BUILD_C_LIBS" != "0"
then
(cd ./src/C/file-*/ && autoreconf -v && ./configure) || exit 1
(cd ./src/C/ssdeep-*/ && autoreconf -v && ./configure) || exit 1
fi
BUILD_C_LIBS=$BUILD_C_LIBS
PYTHON=$PYTHON
SONAME=$SONAME
......
......@@ -7,6 +7,16 @@ AC_LANG(C)
AC_TYPE_SIZE_T
AC_FUNC_MALLOC
AC_ARG_WITH([python],
[AS_HELP_STRING([--with-python=python], [explicitly install using the specified python interpreter (python2, python3, etc)])],
[PYTHON=$withval],
[PYTHON=python])
AC_ARG_ENABLE([clibs],
[AS_HELP_STRING([--disable-clibs], [do not build/install dependent c libraries])],
[BUILD_C_LIBS=0],
[BUILD_C_LIBS=1])
CFLAGS="-Wall -fPIC $CFLAGS"
if test "$(uname)" == "Darwin"
......@@ -19,10 +29,16 @@ else
SOEXT="so"
INSTALL_OPTIONS="-D -m644"
fi
dnl AS_IF([test "x$enable_foo" != "xno"], [
(cd ./src/C/file-*/ && autoreconf -v && ./configure) || exit 1
(cd ./src/C/ssdeep-*/ && autoreconf -v && ./configure) || exit 1
if test "$BUILD_C_LIBS" != "0"
then
(cd ./src/C/file-*/ && autoreconf -v && ./configure) || exit 1
(cd ./src/C/ssdeep-*/ && autoreconf -v && ./configure) || exit 1
fi
AC_SUBST(BUILD_C_LIBS, $BUILD_C_LIBS)
AC_SUBST(PYTHON, $PYTHON)
AC_SUBST(SONAME, $SONAME)
AC_SUBST(SOEXT, $SOEXT)
AC_SUBST(INSTALL_OPTIONS, $INSTALL_OPTIONS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment