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

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: 
                     58: AM_PATH_PYTHON([2.3])
                     59: 
                     60: # find python-config
                     61: PYTHON_CONFIG=`./get-python-config`
                     62: 
                     63: # get python includes 
                     64: PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
                     65: old_CPPFLAGS=$CPPFLAGS
                     66: CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
                     67: echo "Python includes: $PYTHON_INCLUDES"
                     68: AC_SUBST(PYTHON_INCLUDES)
                     69: 
                     70: AC_TRY_COMPILE([#include <Python.h>],
                     71:   [Py_InitModule3(NULL, NULL, NULL);],
                     72:   python_devel_found=yes,
                     73:   python_devel_found=no)
                     74: AC_MSG_RESULT([Python development headers status: $python_devel_found])
                     75: if test "x$python_devel_found" = "xno"; then
                     76:    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.])
                     77: fi
                     78: 
                     79: # get python flags and libs
                     80: PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags 2>/dev/null`
                     81: PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null`
                     82: AC_SUBST(PYTHON_CFLAGS)
                     83: AC_SUBST(PYTHON_LIBS)
                     84: AM_CONDITIONAL(ENABLE_PY_AXL, test "x$python_devel_found" = "xyes")
                     85: 
                     86: ##########################
                     87: # Check for doxygen tool #
                     88: ##########################
                     89: dnl check for doxygen documentation
                     90: AC_ARG_ENABLE(axl-doc, [  --enable-axl-doc     Enable building Axl documentation (doxygen required) [default=yes]], enable_axl_doc="$enableval", enable_axl_doc=yes)
                     91: if test x$enable_axl_doc = xyes ; then
                     92:         AC_CHECK_PROG(DOXYGEN, doxygen, "yes", "no")
                     93: fi
                     94: AM_CONDITIONAL(ENABLE_AF_ARCH_DOC, test "x$DOXYGEN" = "xyes")
                     95: 
                     96: dnl check to build test files
                     97: AC_ARG_ENABLE(axl-test, [  --enable-axl-test     Enable building Axl test executables [default=yes]], enable_axl_test="$enableval", enable_axl_test=yes)
                     98: AM_CONDITIONAL(ENABLE_AXL_TESTS, test "x$enable_axl_test" = "xyes")
                     99: 
                    100: dnl check to build libaxl namespace support
                    101: AC_ARG_ENABLE(axl-ns, [  --enable-axl-ns     Enable building Axl Namespace support [default=yes]], enable_axl_ns="$enableval", enable_axl_ns=yes)
                    102: AM_CONDITIONAL(ENABLE_AXL_NS, test "x$enable_axl_ns" = "xyes")
                    103: 
                    104: 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)
                    105: AM_CONDITIONAL(ENABLE_AXL_LOG, test "x$enable_axl_log" = "xyes")
                    106: 
                    107: dnl check to build axl knife tool 
                    108: AC_ARG_ENABLE(axl-knife, [  --enable-axl-knife     Enable building Axl Knife tool [default=yes]], enable_axl_knife="$enableval", enable_axl_knife=yes)
                    109: AM_CONDITIONAL(ENABLE_AXL_KNIFE, test "x$enable_axl_knife" = "xyes")
                    110: 
                    111: dnl check to build axl babel support
                    112: AC_ARG_ENABLE(axl-babel, [  --enable-axl-babel     Enable building Axl Babel tool [default=yes]], enable_axl_babel="$enableval", enable_axl_babel=yes)
                    113: AM_CONDITIONAL(ENABLE_AXL_BABEL, test "x$enable_axl_babel" = "xyes")
                    114: 
                    115: # The following command also comes to produce the axl_config.h file
                    116: # required by the tool. If you update this, remember to update the
                    117: # af-arch main configure.ac
                    118: AC_TRY_LINK([#define _GNU_SOURCE
                    119: #include <stdio.h>], 
                    120: [
                    121:   char * result;
                    122:   vasprintf (&result, "This is a test: %d", NULL);
                    123:   return 0;
                    124: ], [have_vasprintf=yes],[have_vasprintf=no])
                    125: echo "Checking vasprintf support: $have_vasprintf"
                    126: 
                    127: # produce axl_config.h file this section will only be run if
                    128: # config.status is invoked with no arguments, or with "axl_config.h"
                    129: # as an argument. Remember to update af-arch configure.ac file to
                    130: # include the same script building as the following.
                    131: AC_CONFIG_COMMANDS([axl_config.h],
                    132: [
                    133:        outfile=axl_config.h-tmp
                    134:        cat > $outfile <<_______EOF
                    135: /* 
                    136:  * Axl Library axl_config.h
                    137:  * Platform dependant definitions.
                    138:  *
                    139:  * This is a generated file.  Please modify 'configure.in'
                    140:  */
                    141: 
                    142: #ifndef __AXL_CONFIG_H__
                    143: #define __AXL_CONFIG_H__
                    144: 
                    145: /** 
                    146:  * \addtogroup axl_decl_module
                    147:  * @{
                    148:  */
                    149: 
                    150: /** 
                    151:  * @brief Allows to convert integer value (including constant values)
                    152:  * into a pointer representation. 
                    153:  *
                    154:  * Use the oposite function to restore the value from a pointer to a
                    155:  * integer: \ref PTR_TO_INT. 
                    156:  *
                    157:  * @param integer The integer value to cast to pointer.
                    158:  *
                    159:  * @return A \ref axlPointer reference.
                    160:  */
                    161: #define INT_TO_PTR(integer)   ((axlPointer) ${pti_cast} ((int)integer))
                    162: 
                    163: /** 
                    164:  * @brief Allows to convert a pointer reference (\ref axlPointer),
                    165:  * which stores an integer that was stored using \ref INT_TO_PTR.
                    166:  *
                    167:  * Use the oposite function to restore the pointer value stored in the
                    168:  * integer value.
                    169:  * 
                    170:  * @param ptr The pointer to cast to a integer value.
                    171:  * 
                    172:  * @return A int value.
                    173:  */
                    174: #define PTR_TO_INT(ptr) ((int) ${pti_cast} (ptr))
                    175: 
                    176: /**
                    177:  * @brief Allows to get current platform configuration. This is used
                    178:  * by Axl library but could be used by applications built on top of
                    179:  * Axl to change its configuration based on the platform information.
                    180:  */
                    181: $axl_platform
                    182: 
                    183: $vasprintf_status
                    184: 
                    185: /* @} */
                    186: 
                    187: #endif
                    188: _______EOF
                    189: 
                    190:        # Check if the file exists and it is equal, if not, overwrite it 
                    191:        if cmp -s $outfile src/axl_config.h; then
                    192:          AC_MSG_NOTICE([axl_config.h is unchanged])
                    193:          rm -f $outfile
                    194:        else
                    195:          mv $outfile src/axl_config.h
                    196:        fi
                    197: ],[
                    198: 
                    199: # Check size of void pointer against the size of a single
                    200: # integer. This will allow us to know if we can cast directly a
                    201: # integer to pointer and viceversa.
                    202: case $ac_cv_sizeof_void_p in
                    203: $ac_cv_sizeof_int)     pti_cast=''        ptui_cast=''                ;;
                    204: $ac_cv_sizeof_long)    pti_cast='(long)'  ptui_cast='(unsigned long)' ;;
                    205: *)                     pti_unknown_void_p=yes                         ;;
                    206: esac
                    207: 
                    208: # Get current configure for the platform and the os we are running.
                    209: case $host in
                    210:   *-*-beos*)
                    211:     axl_platform="#define AXL_OS_BEOS (1)"
                    212:     ;;
                    213:   *-*-cygwin*)
                    214:     axl_platform="#define AXL_OS_UNIX (1)
                    215: #define AXL_PLATFORM_WIN32 (1)
                    216: #define AXL_WITH_CYGWIN (1)"
                    217:     ;;
                    218:   *-*-mingw*)
                    219:     axl_platform="#define AXL_OS_WIN32 (1)
                    220: #define AXL_PLATFORM_WIN32 (1)"
                    221:     ;;
                    222:   *)
                    223:     axl_platform="#define AXL_OS_UNIX (1)"
                    224:     ;;
                    225: esac
                    226: 
                    227: case $have_vasprintf in
                    228: yes)
                    229:      vasprintf_status="/**
                    230:  * @internal Allows to now if the platform support vasprintf
                    231:  * function. Do not use this macro as it is supposed to be for
                    232:  * internal use.
                    233:  */
                    234: #define AXL_HAVE_VASPRINTF (1)"
                    235:      ;;
                    236: no)
                    237:      vasprintf_status=""
                    238:      ;;
                    239: esac
                    240: 
                    241: ])
                    242: 
                    243: dnl The following lines are for the embeded support of exarg inside axl-knife.
                    244: dnl support for vasprintf
                    245: case $have_vasprintf in
                    246: yes)
                    247:        EXARG_FLAGS="-DHAVE_VASPRINTF $EXARG_FLAGS"
                    248:        echo "vasprintf support found"
                    249:      ;;
                    250: esac
                    251: 
                    252: dnl check for windows platform
                    253: case $host in
                    254: *-*-mingw*)
                    255:        EXARG_FLAGS="-DOS_WIN32 $EXARG_FLAGS"
                    256:        echo "windows platform found"
                    257:        ;;      
                    258: *)
                    259:        echo "platform found: $host"
                    260:     ;;
                    261: esac
                    262: AC_SUBST(EXARG_FLAGS)
                    263: 
                    264: dnl get site dinamic library extension
                    265: SHARED_EXTENSION=$shrext_cmds
                    266: AC_SUBST(SHARED_EXTENSION)
                    267: 
                    268: 
                    269: AC_OUTPUT([
                    270: Makefile
                    271: src/Makefile
                    272: ns/Makefile
                    273: doc/Makefile
                    274: doc/axl-doc.doxygen
                    275: babel/Makefile
                    276: test/Makefile
                    277: knife/Makefile
                    278: py-axl/Makefile
                    279: py-axl/__init__.py
                    280: py-axl/doc/conf.py
                    281: py-axl/doc/Makefile
                    282: axl.pc
                    283: axl-ns.pc
                    284: axl-babel.pc])
                    285: 
                    286: echo "------------------------------------------"
                    287: echo "--       LibAXL LIBRARY SETTINGS        --"
                    288: echo "------------------------------------------"
                    289: echo "   Installation prefix:          [$prefix]"
                    290: echo "   Build Axl Namespace support:  [$enable_axl_ns]"
                    291: echo "   Build Axl Library tests:      [$enable_axl_test]"
                    292: echo "   Build Axl Knife:              [$enable_axl_knife]"
                    293: echo "   Build Axl Library debug log:  [$enable_axl_log]"
                    294: echo "   Build PyAxl:                  [$python_devel_found]"
                    295: if test x$DOXYGEN = xyes ; then
                    296:    echo "   Build Axl Library doc:        enabled"
                    297: else       
                    298:    echo "   Build Axl Library doc:        disabled"
                    299:    echo "     NOTE: To enable Axl documentation you will"
                    300:    echo "     have to install doxygen tool. Then run again"
                    301:    echo "     configure process."
                    302: fi
                    303: echo "   vasprintf support:            [$have_vasprintf]"
                    304: echo "------------------------------------------"
                    305: echo "--     NOW TYPE: make; make install     --"
                    306: echo "------------------------------------------"

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