Home | History | Annotate | Download | only in libcap-ng-0.7
      1 dnl
      2 define([AC_INIT_NOTICE],
      3 [### Generated automatically using autoconf version] AC_ACVERSION [
      4 ### Copyright 2009-2012 Steve Grubb <sgrubb (a] redhat.com>
      5 ###
      6 ### Permission is hereby granted, free of charge, to any person obtaining a
      7 ### copy of this software and associated documentation files (the "Software"),
      8 ### to deal in the Software without restriction, including without limitation
      9 ### the rights to use, copy, modify, merge, publish, distribute, sublicense,
     10 ### and/or sell copies of the Software, and to permit persons to whom the
     11 ### Software is furnished to do so, subject to the following conditions:
     12 ###
     13 ### The above copyright notice and this permission notice shall be included
     14 ### in all copies or substantial portions of the Software.
     15 ###
     16 ### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17 ### IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18 ### FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
     19 ### THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     20 ### OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     21 ### ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     22 ### OTHER DEALINGS IN THE SOFTWARE.
     23 ###
     24 ### For usage, run `./configure --help'
     25 ### For more detailed information on installation, read the file `INSTALL'.
     26 ###
     27 ### If configuration succeeds, status is in the file `config.status'.
     28 ### A log of configuration tests is in `config.log'.
     29 ])
     30 
     31 AC_REVISION($Revision: 1.3 $)dnl
     32 AC_INIT(libcap-ng,0.7)
     33 AC_PREREQ(2.12)dnl
     34 AM_CONFIG_HEADER(config.h)
     35 AC_CONFIG_MACRO_DIR([m4])
     36 
     37 echo Configuring libcap-ng $VERSION
     38 
     39 AC_CANONICAL_TARGET
     40 AM_INIT_AUTOMAKE
     41 AM_PROG_LIBTOOL
     42 AC_SUBST(LIBTOOL_DEPS)
     43 
     44 echo .
     45 echo Checking for programs
     46 
     47 AC_PROG_CC
     48 AC_PROG_INSTALL
     49 AC_PROG_AWK
     50 
     51 echo .
     52 echo Checking for header files
     53 AC_HEADER_STDC
     54 AC_CHECK_HEADERS(linux/capability.h, [], [AC_MSG_ERROR(linux/capability.h is required in order to build libcap-ng.)])
     55 AC_CHECK_HEADERS(attr/xattr.h, [], [AC_MSG_WARN(attr/xattr.h not found, disabling file system capabilities.)])
     56 AC_CHECK_HEADERS(linux/securebits.h, [], [])
     57 
     58 AC_C_CONST
     59 AC_C_INLINE
     60 AM_PROG_CC_C_O
     61 
     62 ALLWARNS=""
     63 ALLDEBUG="-g"
     64 OPT="-O"
     65 if test x"$GCC" = x"yes"; then
     66   OPT="-O2 -pipe"
     67   case "$target" in
     68     *linux*)
     69              ALLWARNS="-W -Wall -Wundef -Wpointer-arith -Wcast-align \
     70 -Wwrite-strings -Waggregate-return -Wstrict-prototypes \
     71 -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
     72 -Wnested-externs -Winline -Wfloat-equal -Wchar-subscripts"
     73              ;;
     74     esac
     75 fi
     76 
     77 ALLDEBUG="-g"
     78 AC_ARG_WITH(debug,
     79 [  --with-debug            turn on debugging [[default=no]]],
     80 [
     81 if test "x${withval}" = xyes; then
     82         DEBUG="$ALLDEBUG"
     83         OPT="-O"
     84         AM_CONDITIONAL(DEBUG, true)
     85 else
     86         DEBUG="-DNDEBUG"
     87         AM_CONDITIONAL(DEBUG, false)
     88 fi
     89 ],
     90 [ DEBUG="-DNDEBUG"; AM_CONDITIONAL(DEBUG, false) ])
     91 
     92 AC_ARG_WITH(warn,
     93 [  --with-warn             turn on warnings [[default=yes]]],
     94 [
     95 if test "x${withval}" = xyes; then
     96         WARNS="$ALLWARNS"
     97 else
     98         WARNS=""
     99 fi
    100 ],WARNS="$ALLWARNS")
    101 AC_SUBST(DEBUG)
    102 
    103 AC_CHECK_HEADER(sys/syscall.h,
    104 	[AC_DEFINE([HAVE_SYSCALL_H], [1],
    105 	[Define to 1 if you have <sys/syscall.h>.])], [],)
    106 
    107 AC_CHECK_PROG(swig_found, swig, yes, no)
    108 if test x"${swig_found}" = x"no" ; then
    109 	AC_MSG_WARN("Swig not found - python bindings will not be made")
    110 fi
    111 AM_CONDITIONAL(HAVE_SWIG, test x"${swig_found}" = x"yes")
    112 
    113 AC_MSG_CHECKING(whether to create python bindings)
    114 AC_ARG_WITH(python,
    115 AS_HELP_STRING([--with-python],[enable building python bindings]),
    116 use_python=$withval,
    117 use_python=auto)
    118 if test x$use_python = xno ; then
    119 	python_found="no"
    120 	AC_MSG_RESULT(no)
    121 else
    122 AC_MSG_RESULT(testing)
    123 AM_PATH_PYTHON
    124 if test -f /usr/include/python${am_cv_python_version}/Python.h ; then
    125 	python_found="yes"
    126 	AC_MSG_NOTICE(Python bindings will be built)
    127 else
    128 	python_found="no"
    129 	if test x$use_python = xyes ; then
    130 		AC_MSG_ERROR([Python explicitly required and python headers found])
    131 	else
    132 		AC_MSG_WARN("Python headers not found - python bindings will not be made")
    133 	fi
    134 fi
    135 fi
    136 AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
    137 
    138 AC_OUTPUT(Makefile src/Makefile src/libcap-ng.pc src/test/Makefile 
    139 	bindings/Makefile bindings/python/Makefile
    140 	bindings/python/test/Makefile utils/Makefile
    141 	m4/Makefile docs/Makefile)
    142 
    143 echo .
    144 echo "
    145 
    146   libcap-ng Version:      $VERSION
    147   Target:                 $target
    148   Installation prefix:    $prefix
    149   Compiler:               $CC
    150   Compiler flags:
    151 `echo $CFLAGS | fmt -w 50 | sed 's,^,                          ,'`
    152 "
    153