Changeset 1509

Show
Ignore:
Timestamp:
01/14/08 01:49:16 (9 months ago)
Author:
common
Message:

libemu

  • auto* libcargos with --enable-cargos --with-cargos-lib= --with-cargos-inc=
    sctest uses per-program specific CPPFLAGS and LDFLAGS to link libcargos if avalible
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libemu/trunk/configure.ac

    r1491 r1509  
    8383AC_SUBST(libemu_soname) 
    8484 
    85  
     85AM_PROG_CC_C_O 
    8686 
    8787dnl ************************************************** 
     
    151151AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS], [test x$enable_python = xtrue]) 
    152152 
     153dnl ************************************************** 
     154dnl * libcargos                                      * 
     155dnl ************************************************** 
     156 
     157 
     158AC_SUBST([LIB_CARGOS]) 
     159AC_SUBST([LIB_CARGOS_LIBDIR]) 
     160AC_SUBST([LIB_CARGOS_INCDIR]) 
     161 
     162 
     163enable_cargos="yes" 
     164 
     165AC_ARG_ENABLE(cargos, [  --enable-cargos      enable support for libcargos], 
     166                        [enable_cargos="$enableval"],[enable_cargos="yes"]) 
     167 
     168AC_ARG_WITH(cargos-include, 
     169                        [  --with-cargos-include=DIR  libcargos include dir], 
     170                                      [cargos_inc="$withval"],[cargos_inc=no]) 
     171AC_ARG_WITH(cargos-lib, 
     172                        [  --with-cargos-lib=DIR  libcargos library dir], 
     173                        [cargos_lib="$withval"],[cargos_lib=no]) 
     174 
     175 
     176if test x$enable_cargos = "xyes" ; then 
     177        OLD_CPPFLAGS=${CPPFLAGS}; 
     178        if test x$cargos_inc != "xno"; then 
     179                CPPFLAGS="${CPPFLAGS} -I${cargos_inc}" 
     180        fi 
     181         
     182        AC_CHECK_HEADER(cargos-lib.h,[enable_cargos=yes],[enable_cargos=no]) 
     183         
     184        if test x$enable_cargos = "xyes" ; then 
     185                OLD_LDFLAGS=${LDFLAGS} 
     186                if test x$cargos_lib != "xno"; then 
     187                        LDFLAGS="${LDFLAGS}  -L${cargos_lib}" 
     188                fi 
     189         
     190                AC_CHECK_LIB([cargos],[cargos_lib_create],enable_cargos="yes", enable_cargos="no") 
     191         
     192                if test x$enable_cargos = "xyes" ; then 
     193                        LIB_CARGOS="-lcargos" 
     194                        LIB_CARGOS_LIBDIR="-L$cargos_lib" 
     195                        LIB_CARGOS_INCDIR="-I$cargos_inc" 
     196                        AC_DEFINE([HAVE_LIBCARGOS], [1], [Define to 1 to compile with cargos support]) 
     197                fi 
     198        fi 
     199        CPPFLAGS=${OLD_CPPFLAGS} 
     200        LDFLAGS=${OLD_LDFLAGS} 
     201fi 
    153202 
    154203 
     
    204253echo "bindings" 
    205254echo " - python                          : $enable_python" 
     255echo "" 
     256echo "support" 
     257echo " - cargos                          : $enable_cargos" 
     258 
  • libemu/trunk/testsuite/Makefile.am

    r1386 r1509  
    1717instrtest_SOURCES = instrtest.c 
    1818 
     19sctest_CPPFLAGS = ${LIB_CARGOS_INCDIR}  ${AM_CPPFLAGS} 
     20sctest_LDFLAGS =  ${LIB_CARGOS} ${LIB_CARGOS_LIBDIR} ${AM_LDFLAGS} 
    1921sctest_LDADD = ../src/libemu.la 
    2022sctest_SOURCES = sctest.c