"Fossies" - the Fresh Open Source Software Archive

Member "dbtool-1.9.1/configure.ac" (15 May 2015, 7069 Bytes) of package /linux/privat/dbtool-1.9.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.9_vs_1.9.1.

    1 # -*-sh-*-
    2 
    3 AC_PREREQ(2.61)
    4 
    5 define([dbtoolversion], esyscmd([sh -c "cat VERSION|head -1"]))
    6 
    7 # what we are compiling
    8 AC_INIT([dbtool], [dbtoolversion], [tlinden@cpan.org])
    9 
   10 AC_CONFIG_AUX_DIR(config)
   11 AC_CONFIG_MACRO_DIR(config)
   12 AC_CONFIG_HEADER(platform.h)
   13 
   14 AM_INIT_AUTOMAKE()
   15 LT_INIT
   16 
   17 # default values, dynamically linking and stripped binary
   18 STATIC="no"
   19 
   20 
   21 # provide flag --enable-static
   22 AC_ARG_ENABLE([static-binary],
   23     AS_HELP_STRING([--enable-static-binary], [create a statically linked binary]),
   24     [
   25 	if test "x$enableval" = "xyes"; then
   26 	    STATIC="yes"
   27 	    LDFLAGS="$LDFLAGS -static"
   28 	fi
   29 ])
   30 
   31 AC_ARG_ENABLE([debug],
   32     AS_HELP_STRING([--disable-debug], [Disable debugging]))
   33 AS_IF([test "x$enable_debug" != "xno"], [
   34           CXXFLAGS="$CFLAGS -g -DDEBUG"
   35           enable_debug="yes"
   36 ])
   37 
   38 
   39 AC_CANONICAL_HOST
   40 
   41 
   42 # look for the existence of install
   43 AC_PROG_INSTALL
   44 
   45 # look if c++ compiler exists
   46 AC_PROG_CXX
   47 
   48 # look for libc
   49 AC_HEADER_STDC
   50 
   51 # additional headers which are required
   52 AC_CHECK_HEADERS(unistd.h stdio.h stdlib.h)
   53 
   54 
   55 # Check for some target-specific stuff
   56 case "$host" in
   57     *aix*)
   58         # libm is required as well
   59         CXXFLAGS="$CFLAGS -D_AIX_SOURCE=1"
   60         LDFLAGS="$LDFLAGS -lm"
   61         ;;
   62     *-*-android*) ;;
   63     *-*-cygwin*) ;;
   64     *-*-dgux*) ;;
   65     *-*-darwin*) ;;
   66     *-*-dragonfly*) ;;
   67     *-*-haiku*) ;;
   68     *-*-hpux*) ;;
   69     *-*-irix5*) ;;
   70     *-*-irix6*) ;;
   71     *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) ;;
   72     *-*-linux*) ;;
   73     *-*-netbsd*) ;;
   74     *-*-freebsd*)
   75         # ports install to /usr/local by default, check
   76         if test -d "/usr/local/lib" -a -d "/usr/local/include"; then
   77             CXXFLAGS="$CFLAGS -I/usr/local/include"
   78             LDFLAGS="$LDFLAGS -L/usr/local/lib"
   79         fi
   80         ;;
   81     *-*-bsdi*) ;;
   82     *-next-*) ;;
   83     *-*-openbsd*) ;;
   84     *-*-solaris*) ;;
   85     *-*-sunos4*) ;;
   86     *-ncr-sysv*) ;;
   87     *-sni-sysv*) ;;
   88     *-*-sysv4.2*) ;;
   89     *-*-sysv5*) ;;
   90     *-*-sysv*) ;;
   91     *-*-sco*) ;;
   92     *-*-unicos*) ;;
   93     *-dec-osf*) ;;
   94     *-*-nto-qnx*) ;;
   95     *-*-ultrix*) ;;
   96     *-*-lynxos) ;;
   97 esac
   98 
   99 
  100 # look for libs
  101 GDBM="yes"
  102 BERKELEY="no"
  103 PCRE="no"
  104 
  105 
  106 # configure args
  107 AC_ARG_WITH([berkeley],
  108     [AS_HELP_STRING([--with-berkeley],
  109 	            [Use berkeley library ])])
  110 
  111 if test "x$with_berkeley" = "xno"; then
  112   BERKELEY=no
  113   GDBM=yes
  114 elif test "x$with_berkeley" = "xyes"; then
  115   BERKELEY=yes
  116   GDBM=no
  117 fi
  118 
  119 
  120 AC_ARG_WITH([gdbm],
  121     [AS_HELP_STRING([--with-gdbm],
  122 	            [Use GNU gdbm library ])])
  123 
  124 if test "x$with_gdbm" = "xno"; then
  125   GDBM=no
  126 elif test "x$with_gdbm" = "xyes"; then
  127   GDBM=yes
  128 fi
  129 
  130 AC_ARG_WITH([gdbm-dir],
  131     [AS_HELP_STRING([--with-gdbm-dir=DIR],
  132 	            [Use GNU gdbm library in DIR])],
  133     [
  134 	AC_MSG_CHECKING([checking $with_gdbm_dir/include/gdbm.h presence])
  135 	if test -r "$with_gdbm_dir/include/gdbm.h" ; then
  136 	    CXXFLAGS="-I$with_gdbm_dir/include $CXXFLAGS"
  137 	    CFLAGS="$CXXFLAGS"
  138 	    LDFLAGS="-L$with_gdbm_dir/lib $LDFLAGS"
  139 	    LIBS="-lgdbm"
  140             GDBM=yes
  141 	    AC_MSG_RESULT([yes])
  142 	else
  143             GDBM=no
  144 	    AC_MSG_RESULT([no])
  145 	fi
  146     ])
  147 
  148 AC_ARG_WITH([pcre-dir],
  149     [AS_HELP_STRING([--with-pcre-dir=DIR],
  150 	            [Use GNU pcre library in DIR])],
  151     [
  152 	AC_MSG_CHECKING([checking $with_pcre_dir/include/pcre.h presence])
  153 	if test -r "$with_pcre_dir/include/pcre.h" ; then
  154 	    CXXFLAGS="-I$with_pcre_dir/include $CXXFLAGS"
  155 	    CFLAGS="$CXXFLAGS"
  156 	    LDFLAGS="-L$with_pcre_dir/lib $LDFLAGS"
  157 	    LIBS="-lpcre"
  158 	    AC_MSG_RESULT([yes])
  159 	else
  160 	    AC_MSG_RESULT([no])
  161 	fi
  162     ])
  163 
  164 AC_ARG_WITH([bdb-include-dir],
  165             [AS_HELP_STRING([--with-bdb-include-dir],
  166                             [Specify bdb include prefix])],
  167             [
  168 		    GDBM="no"
  169 		    BERKELEY="yes"
  170 		    CXXFLAGS="-I${with_bdb_include_dir} ${CXXFLAGS}"
  171 		    CFLAGS="$CXXFLAGS"
  172    	     ],
  173             [])
  174 
  175 AC_ARG_WITH([bdb_lib_dir],
  176             [AS_HELP_STRING([--with-bdb-lib-dir],
  177                             [Specify bdb library prefix])],
  178 	    [
  179 		# dont check presence since lib file name unpredictable
  180 		GDBM="no"
  181 		BERKELEY="yes"
  182 		LDFLAGS="-L${with_bdb_lib_dir} ${LDFLAGS}"
  183             ])
  184 
  185 
  186 # first, check for gdbm, which is the default
  187 if test "$GDBM" = "yes"; then
  188     # search for it via pkg-config
  189     PKG_CHECK_MODULES([GDBM], [gdbm], _gdbm=yes, _gdbm=no)
  190     if test "x$_gdbm" = "xyes"; then
  191 	AC_SUBST([GDBM_CFLAGS])
  192 	AC_SUBST([GDBM_CXXFLAGS])
  193 	AC_SUBST([GDBM_LIBS])
  194 	GDBM="yes"
  195     fi
  196 fi
  197 
  198 if test "$GDBM" = "yes"; then
  199      export LDFLAGS
  200      export LIBS
  201      export CFLAGS
  202      AC_CHECK_LIB(gdbm, gdbm_open)
  203      if test "x$ac_cv_lib_gdbm_gdbm_open" = "xno"; then
  204 	 GDBM="no"
  205      fi
  206 fi
  207 
  208 # now, if we didn't find gdbm or it was disabled, try berkeley db
  209 if test "$GDBM" = "no"; then
  210     AC_LANG(C++)
  211      export LDFLAGS
  212      export LIBS
  213      export CXXFLAGS
  214     AX_BERKELEY_DB_CXX([4.0.0],[
  215 	    LDFLAGS="$DB_CXX_LIBS $LDFLAGS"
  216 	    BERKELEY="yes"
  217 	    ],[BERKELEY="no"])
  218 fi
  219 
  220 
  221 
  222 export CFLAGS
  223 export LIBS
  224 export LDFLAGS
  225 AC_CHECK_LIB(pcre, pcre_compile)
  226 
  227 
  228 
  229 # these functions must exist
  230 AC_CHECK_FUNCS(getopt fdopen fgetc getenv getpass)
  231 
  232 # complain if the functions checked for above does not exists
  233 if test "$ac_cv_func_getopt" != yes; then
  234   echo
  235   echo "*** Warning: function getopt() not found!"
  236   echo "*** You will not be able to compile dbtool!"
  237   #exit 1
  238 fi
  239 
  240 if test "$ac_cv_func_fdopen" != yes; then
  241   echo
  242   echo "*** Warning: function fdopen() not found!"
  243   echo "*** You will not be able to compile dbtool!"
  244   #exit 1
  245 fi
  246 
  247 if test "$ac_cv_func_fgetc" != yes; then
  248   echo
  249   echo "*** Warning: function fgetc() not found!"
  250   echo "*** You will not be able to compile dbtool!"
  251   #exit 1
  252 fi
  253 
  254 if test "$ac_cv_func_getenv" != yes; then
  255   echo
  256   echo "*** Warning: function getenv() not found!"
  257   echo "*** You will not be able to compile dbtool!"
  258   #exit 1
  259 fi
  260 
  261 if test "$ac_cv_lib_pcre_pcre_compile" != yes; then
  262   echo
  263   echo "*** Warning: the PCRE library could not be found!"
  264   echo "*** You will not be able to compile dbtool!"
  265   echo "*** Please get a copy from http://www.pcre.org,"
  266   echo "*** install it and then retry!"
  267   exit 1
  268 fi
  269 
  270 if test "$GDBM" = "yes"; then
  271     USEDB="GDBM"
  272 elif test "$BERKELEY" = "yes"; then
  273     USEDB="BERKELEY-DB"
  274     CXXFLAGS="-DHAVE_BERKELEY=1 $CXXFLAGS"
  275 else
  276     echo "Neither gdbm or berkeley-db is instaled!"
  277     exit 1
  278 fi
  279 
  280 
  281 # Checks for typedefs, structures, and compiler characteristics.
  282 AC_C_CONST
  283 
  284 # the default prefix
  285 AC_PREFIX_DEFAULT(/usr/local)
  286 
  287 # finaly write out
  288 AC_CONFIG_FILES([Makefile])
  289 AC_OUTPUT
  290 
  291 
  292 AC_MSG_RESULT([
  293     Build configured for $PACKAGE $VERSION:
  294         CXX:                    ${CXX}
  295         CXXFLAGS:               ${CXXFLAGS}
  296         LDFLAGS:                ${LDFLAGS}
  297         LIBS:                   ${LIBS}
  298         debug:                  ${enable_debug}
  299         static build:           ${STATIC}
  300 
  301         prefix:                 ${prefix}
  302         libdir:                 ${libdir}
  303         includedir:             ${includedir}
  304 
  305         target platform:        ${host}
  306 
  307 	db backend:             ${USEDB}
  308     Type 'make' to build, 'make install' to install.
  309 ])
  310 
  311 
  312 echo