Annotation of gpl/axl/configure.ac, revision 1.1.1.2

1.1       misho       1: dnl  Copyright (C) 2009 Advanced Software Production Line, S.L.
                      2: dnl
                      3: dnl  This program is free software; you can redistribute it and/or
                      4: dnl  modify it under the terms of the GNU Lesser General Public License
                      5: dnl  as published by the Free Software Foundation; either version 2.1 of
                      6: dnl  the License, or (at your option) any later version.
                      7: dnl
                      8: dnl  This program is distributed in the hope that it will be useful,
                      9: dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
                     10: dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
                     11: dnl  GNU Lesser General Public License for more details.
                     12: dnl
                     13: dnl  You should have received a copy of the GNU Lesser General Public
                     14: dnl  License along with this program; if not, write to the Free
                     15: dnl  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
                     16: dnl  02111-1307 USA
                     17: dnl  
                     18: dnl  You may find a copy of the license under this software is released
                     19: dnl  at COPYING file. This is LGPL software: you are wellcome to
                     20: dnl  develop propietary applications using this library withtout any
                     21: dnl  royalty or fee but returning back any change, improvement or
                     22: dnl  addition in the form of source code, project image, documentation
                     23: dnl  patches, etc. 
                     24: dnl
                     25: dnl  For commercial support on build XML enabled solutions contact us:
                     26: dnl          
                     27: dnl      Postal address:
                     28: dnl         Advanced Software Production Line, S.L.
                     29: dnl         Edificio Alius A, Oficina 102,
                     30: dnl         C/ Antonio Suarez Nº 10,
                     31: dnl         Alcalá de Henares 28802 Madrid
                     32: dnl         Spain
                     33: dnl
                     34: dnl      Email address:
                     35: dnl         info@aspl.es - http://www.aspl.es/xml
                     36: dnl
                     37: AC_INIT(src/axl.h)
                     38: 
                     39: configure_dir=`dirname "$0"`
                     40: AXL_VERSION=`cat $configure_dir/VERSION`
                     41: AC_SUBST(AXL_VERSION)
                     42: 
                     43: AC_CONFIG_AUX_DIR(.)
                     44: AM_INIT_AUTOMAKE(axl, $AXL_VERSION)
                     45: AM_CONFIG_HEADER(config.h)
                     46: AM_MAINTAINER_MODE
                     47: 
                     48: AC_PROG_CC
                     49: AC_ISC_POSIX
                     50: AC_HEADER_STDC
                     51: AM_PROG_LIBTOOL
                     52: 
                     53: # check type sizes
                     54: AC_CHECK_SIZEOF(long)
                     55: AC_CHECK_SIZEOF(int)
                     56: AC_CHECK_SIZEOF(void *)
                     57: 
1.1.1.2 ! misho      58: dnl check for py-axl support
        !            59: AC_ARG_ENABLE(py-axl,   [   --disable-py-axl       Makes Axl Library to be build without PyAxl: python bindings support],
        !            60:               enable_py_axl_support="$enableval",
        !            61:              enable_py_axl_support=yes)
        !            62: AM_CONDITIONAL(ENABLE_PY_AXL_SUPPORT, test "x$enable_py_axl_support" = "xyes")
        !            63: if test "$enable_py_axl_support" = "yes" ; then
        !            64:    AM_PATH_PYTHON([2.3])
        !            65: 
        !            66:    # find python-config
        !            67:    PYTHON_CONFIG=`./get-python-config`
        !            68: 
        !            69:    # get site_packages
        !            70:    python_dir_check=`eval ./check-python-dir.py ${pythondir}`
        !            71: 
        !            72:    # get python includes 
        !            73:    PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
        !            74:    old_CPPFLAGS=$CPPFLAGS
        !            75:    CPPFLAGS="$PYTHON_INCLUDES"
        !            76:    echo "Python includes: $PYTHON_INCLUDES"
        !            77:    AC_SUBST(PYTHON_INCLUDES)
        !            78: 
        !            79:    AC_TRY_COMPILE([#include <Python.h>],
        !            80:       [Py_InitModule3(NULL, NULL, NULL);],
        !            81:       python_devel_found=yes,
        !            82:       python_devel_found=no)
        !            83:    AC_MSG_RESULT([Python development headers status: $python_devel_found])
        !            84:    if test "x$python_devel_found" = "xno"; then
        !            85:        AC_MSG_WARN([Cannot find Python.h header or current python development environment do not compile symbols required. On debian try to install python-dev package.])
        !            86:    fi
        !            87: 
        !            88:    # get python flags and libs
        !            89:    PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags 2>/dev/null | sed -r 's/\-arch (\d|\w)+ //g'`
        !            90:    PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null`
        !            91:    AC_SUBST(PYTHON_CFLAGS)
        !            92:    AC_SUBST(PYTHON_LIBS)
        !            93: 
        !            94:    # check python_install_dir and pythondir maches
        !            95:    python_dir_temp=`eval echo ${pythondir}`
        !            96:    # check python_install_dir and pythondir maches
        !            97:    if test "$python_dir_check" != "ok" ; then
        !            98:       AC_MSG_ERROR([ERROR: pythondir variable is poiting to an unusable location: $python_dir_temp. Error detected: $python_dir_check. Fix your autoconf install or disable python building, for that, pass --disable-py-vortex to configure. This usually indicates a problem with automake package which provides the _AM_PATH_PYTHON_ macro.])
        !            99:    fi
        !           100:    echo "Python install dir OK: $python_dir_temp"
        !           101: fi
        !           102: AM_CONDITIONAL(ENABLE_PY_AXL, test "x$python_devel_found" = "xyes")
1.1       misho     103: 
1.1.1.2 ! misho     104: compiler_options=""
        !           105: STRICT_PROTOTYPES=""
        !           106: if test "$compiler" = "gcc" ; then
        !           107:    compiler_options="-Wstrict-prototypes -Wall -Werror -g -ansi"
        !           108:    echo "Detected gcc compiler: $compiler, adding options: $compiler_options"
        !           109: fi
        !           110: AC_SUBST(compiler_options)
1.1       misho     111: 
1.1.1.2 ! misho     112: AC_CHECK_PROG(PKG_CONFIG, pkg-config, "yes", "no")
        !           113: if test "$PKG_CONFIG" = "no" ; then
        !           114:   AC_MSG_ERROR([You need to install pkg-config to compile Vortex 1.1. See: http://pkgconfig.freedesktop.org/releases/])
1.1       misho     115: fi
                    116: 
                    117: 
                    118: ##########################
                    119: # Check for doxygen tool #
                    120: ##########################
                    121: dnl check for doxygen documentation
                    122: AC_ARG_ENABLE(axl-doc, [  --enable-axl-doc     Enable building Axl documentation (doxygen required) [default=yes]], enable_axl_doc="$enableval", enable_axl_doc=yes)
                    123: if test x$enable_axl_doc = xyes ; then
                    124:         AC_CHECK_PROG(DOXYGEN, doxygen, "yes", "no")
                    125: fi
                    126: AM_CONDITIONAL(ENABLE_AF_ARCH_DOC, test "x$DOXYGEN" = "xyes")
                    127: 
                    128: dnl check to build test files
                    129: AC_ARG_ENABLE(axl-test, [  --enable-axl-test     Enable building Axl test executables [default=yes]], enable_axl_test="$enableval", enable_axl_test=yes)
                    130: AM_CONDITIONAL(ENABLE_AXL_TESTS, test "x$enable_axl_test" = "xyes")
                    131: 
                    132: dnl check to build libaxl namespace support
                    133: AC_ARG_ENABLE(axl-ns, [  --enable-axl-ns     Enable building Axl Namespace support [default=yes]], enable_axl_ns="$enableval", enable_axl_ns=yes)
                    134: AM_CONDITIONAL(ENABLE_AXL_NS, test "x$enable_axl_ns" = "xyes")
                    135: 
                    136: AC_ARG_ENABLE(axl-log, [  --enable-axl-log     Enable building Axl with debug log support [default=yes]], enable_axl_log="$enableval", enable_axl_log=yes)
                    137: AM_CONDITIONAL(ENABLE_AXL_LOG, test "x$enable_axl_log" = "xyes")
                    138: 
                    139: dnl check to build axl knife tool 
                    140: AC_ARG_ENABLE(axl-knife, [  --enable-axl-knife     Enable building Axl Knife tool [default=yes]], enable_axl_knife="$enableval", enable_axl_knife=yes)
                    141: AM_CONDITIONAL(ENABLE_AXL_KNIFE, test "x$enable_axl_knife" = "xyes")
                    142: 
                    143: dnl check to build axl babel support
                    144: AC_ARG_ENABLE(axl-babel, [  --enable-axl-babel     Enable building Axl Babel tool [default=yes]], enable_axl_babel="$enableval", enable_axl_babel=yes)
                    145: AM_CONDITIONAL(ENABLE_AXL_BABEL, test "x$enable_axl_babel" = "xyes")
                    146: 
                    147: # The following command also comes to produce the axl_config.h file
                    148: # required by the tool. If you update this, remember to update the
                    149: # af-arch main configure.ac
                    150: AC_TRY_LINK([#define _GNU_SOURCE
                    151: #include <stdio.h>], 
                    152: [
                    153:   char * result;
1.1.1.2 ! misho     154:   return vasprintf (&result, "This is a test: %d", NULL);
1.1       misho     155: ], [have_vasprintf=yes],[have_vasprintf=no])
                    156: echo "Checking vasprintf support: $have_vasprintf"
                    157: 
                    158: # produce axl_config.h file this section will only be run if
                    159: # config.status is invoked with no arguments, or with "axl_config.h"
                    160: # as an argument. Remember to update af-arch configure.ac file to
                    161: # include the same script building as the following.
                    162: AC_CONFIG_COMMANDS([axl_config.h],
                    163: [
                    164:        outfile=axl_config.h-tmp
                    165:        cat > $outfile <<_______EOF
                    166: /* 
                    167:  * Axl Library axl_config.h
                    168:  * Platform dependant definitions.
                    169:  *
                    170:  * This is a generated file.  Please modify 'configure.in'
                    171:  */
                    172: 
                    173: #ifndef __AXL_CONFIG_H__
                    174: #define __AXL_CONFIG_H__
                    175: 
                    176: /** 
                    177:  * \addtogroup axl_decl_module
                    178:  * @{
                    179:  */
                    180: 
                    181: /** 
                    182:  * @brief Allows to convert integer value (including constant values)
                    183:  * into a pointer representation. 
                    184:  *
                    185:  * Use the oposite function to restore the value from a pointer to a
                    186:  * integer: \ref PTR_TO_INT. 
                    187:  *
                    188:  * @param integer The integer value to cast to pointer.
                    189:  *
                    190:  * @return A \ref axlPointer reference.
                    191:  */
                    192: #define INT_TO_PTR(integer)   ((axlPointer) ${pti_cast} ((int)integer))
                    193: 
                    194: /** 
                    195:  * @brief Allows to convert a pointer reference (\ref axlPointer),
                    196:  * which stores an integer that was stored using \ref INT_TO_PTR.
                    197:  *
                    198:  * Use the oposite function to restore the pointer value stored in the
                    199:  * integer value.
                    200:  * 
                    201:  * @param ptr The pointer to cast to a integer value.
                    202:  * 
                    203:  * @return A int value.
                    204:  */
                    205: #define PTR_TO_INT(ptr) ((int) ${pti_cast} (ptr))
                    206: 
                    207: /**
                    208:  * @brief Allows to get current platform configuration. This is used
                    209:  * by Axl library but could be used by applications built on top of
                    210:  * Axl to change its configuration based on the platform information.
                    211:  */
                    212: $axl_platform
                    213: 
                    214: $vasprintf_status
                    215: 
                    216: /* @} */
                    217: 
                    218: #endif
                    219: _______EOF
                    220: 
                    221:        # Check if the file exists and it is equal, if not, overwrite it 
                    222:        if cmp -s $outfile src/axl_config.h; then
                    223:          AC_MSG_NOTICE([axl_config.h is unchanged])
                    224:          rm -f $outfile
                    225:        else
                    226:          mv $outfile src/axl_config.h
                    227:        fi
                    228: ],[
                    229: 
                    230: # Check size of void pointer against the size of a single
                    231: # integer. This will allow us to know if we can cast directly a
                    232: # integer to pointer and viceversa.
                    233: case $ac_cv_sizeof_void_p in
                    234: $ac_cv_sizeof_int)     pti_cast=''        ptui_cast=''                ;;
                    235: $ac_cv_sizeof_long)    pti_cast='(long)'  ptui_cast='(unsigned long)' ;;
                    236: *)                     pti_unknown_void_p=yes                         ;;
                    237: esac
                    238: 
                    239: # Get current configure for the platform and the os we are running.
1.1.1.2 ! misho     240: echo "Host detected: $host"
1.1       misho     241: case $host in
                    242:   *-*-beos*)
                    243:     axl_platform="#define AXL_OS_BEOS (1)"
                    244:     ;;
                    245:   *-*-cygwin*)
                    246:     axl_platform="#define AXL_OS_UNIX (1)
                    247: #define AXL_PLATFORM_WIN32 (1)
                    248: #define AXL_WITH_CYGWIN (1)"
                    249:     ;;
                    250:   *-*-mingw*)
                    251:     axl_platform="#define AXL_OS_WIN32 (1)
                    252: #define AXL_PLATFORM_WIN32 (1)"
                    253:     ;;
                    254:   *)
                    255:     axl_platform="#define AXL_OS_UNIX (1)"
                    256:     ;;
                    257: esac
                    258: 
                    259: case $have_vasprintf in
                    260: yes)
                    261:      vasprintf_status="/**
                    262:  * @internal Allows to now if the platform support vasprintf
                    263:  * function. Do not use this macro as it is supposed to be for
                    264:  * internal use.
                    265:  */
                    266: #define AXL_HAVE_VASPRINTF (1)"
                    267:      ;;
                    268: no)
                    269:      vasprintf_status=""
                    270:      ;;
                    271: esac
                    272: 
                    273: ])
                    274: 
                    275: dnl The following lines are for the embeded support of exarg inside axl-knife.
                    276: dnl support for vasprintf
                    277: case $have_vasprintf in
                    278: yes)
                    279:        EXARG_FLAGS="-DHAVE_VASPRINTF $EXARG_FLAGS"
                    280:        echo "vasprintf support found"
                    281:      ;;
                    282: esac
                    283: 
                    284: dnl check for windows platform
                    285: case $host in
                    286: *-*-mingw*)
                    287:        EXARG_FLAGS="-DOS_WIN32 $EXARG_FLAGS"
                    288:        echo "windows platform found"
                    289:        ;;      
                    290: *)
                    291:        echo "platform found: $host"
                    292:     ;;
                    293: esac
                    294: AC_SUBST(EXARG_FLAGS)
                    295: 
                    296: dnl get site dinamic library extension
                    297: SHARED_EXTENSION=$shrext_cmds
                    298: AC_SUBST(SHARED_EXTENSION)
                    299: 
                    300: 
                    301: AC_OUTPUT([
                    302: Makefile
1.1.1.2 ! misho     303: Makefile.win
1.1       misho     304: src/Makefile
                    305: ns/Makefile
                    306: doc/Makefile
                    307: doc/axl-doc.doxygen
                    308: babel/Makefile
                    309: test/Makefile
                    310: knife/Makefile
                    311: py-axl/Makefile
                    312: py-axl/__init__.py
                    313: py-axl/doc/conf.py
                    314: py-axl/doc/Makefile
                    315: axl.pc
                    316: axl-ns.pc
                    317: axl-babel.pc])
                    318: 
                    319: echo "------------------------------------------"
                    320: echo "--       LibAXL LIBRARY SETTINGS        --"
                    321: echo "------------------------------------------"
                    322: echo "   Installation prefix:          [$prefix]"
1.1.1.2 ! misho     323: echo "   Compiler:                     [$compiler]"
1.1       misho     324: echo "   Build Axl Namespace support:  [$enable_axl_ns]"
                    325: echo "   Build Axl Library tests:      [$enable_axl_test]"
                    326: echo "   Build Axl Knife:              [$enable_axl_knife]"
                    327: echo "   Build Axl Library debug log:  [$enable_axl_log]"
1.1.1.2 ! misho     328: echo "   Build PyAxl:                  [$enable_py_axl_support]"
1.1       misho     329: if test x$DOXYGEN = xyes ; then
                    330:    echo "   Build Axl Library doc:        enabled"
                    331: else       
                    332:    echo "   Build Axl Library doc:        disabled"
                    333:    echo "     NOTE: To enable Axl documentation you will"
                    334:    echo "     have to install doxygen tool. Then run again"
                    335:    echo "     configure process."
                    336: fi
                    337: echo "   vasprintf support:            [$have_vasprintf]"
                    338: echo "------------------------------------------"
                    339: echo "--     NOW TYPE: make; make install     --"
                    340: echo "------------------------------------------"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>