Tcl-Tk-Tkwidget-treectrl

 view release on metacpan or  search on metacpan

configure.ac  view on Meta::CPAN


AS_IF([test "$GCC" = yes], [

# Needed for pointer-to-int conversions with GCC on 64-bit
AC_CHECK_TYPE([intptr_t], [
    AC_DEFINE([HAVE_INTPTR_T], 1, [Do we have the intptr_t type?])], [
    AC_CACHE_CHECK([for pointer-size signed integer type], tcl_cv_intptr_t, [
    for tcl_cv_intptr_t in "int" "long" "long long" none; do
	if test "$tcl_cv_intptr_t" != none; then
	    AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT],
		    [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], 
		[tcl_ok=yes], [tcl_ok=no])
	    test "$tcl_ok" = yes && break; fi
    done])
    if test "$tcl_cv_intptr_t" != none; then
	AC_DEFINE_UNQUOTED([intptr_t], [$tcl_cv_intptr_t], [Signed integer
	   type wide enough to hold a pointer.])
    fi
])

], [])

#--------------------------------------------------------------------
# __CHANGE__
# A few miscellaneous platform-specific items:
#
# Define a special symbol for Windows (BUILD_sample in this case) so
# that we create the export library with the dll.  See sha1.h on how
# to use this.
#
# Windows creates a few extra files that need to be cleaned up.
# You can add more files to clean if your extension creates any extra
# files.
#
# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
# These will be appended to the current set of compiler flags for
# your system.
#--------------------------------------------------------------------

OUTPUTFILES=Makefile

if test "${TEA_PLATFORM}" = "windows" ; then
    TEA_ADD_SOURCES([tkWinTree.c])
    TEA_ADD_LIBS([gdi32.lib user32.lib])

    AC_ARG_ENABLE(shellicon,
	AC_HELP_STRING([--enable-shellicon],
	[build the shellicon extension (default: no)]),
	[tcl_ok=$enableval], [tcl_ok=no])
    if test "$tcl_ok" = "yes" ; then
	AC_CONFIG_SUBDIRS(shellicon)
    fi

    # Find rc.exe or windres.exe.
    # Defined in winrc.m4.
    TREECTRL_PROG_RC

    # X86|AMD64|IA64 for manifest
    AC_SUBST(MACHINE)

    # PKG_MANIFEST -> VC_MANIFEST_EMBED_DLL -> MAKE_SHARED_LIB
    TEA_ADD_MANIFEST([treectrl.dll.manifest])

    # Create treectrl.dll.manifest from treectrl.dll.manifest.in.
    # treectrl.dll.manifest is included by treectrl.rc.
    # If building with a Microsoft compiler that generates
    # treectrlNN.dll.manifest (to pick the correct MSVCRT runtime) then
    # that manifest is merged with mine using mt.exe (see the Makefile
    # rule for PKG_LIB_FILE).
    OUTPUTFILES="Makefile treectrl.dll.manifest"

    TREECTRL_ADD_RC([treectrl.rc])
fi

if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
    AC_MSG_CHECKING([whether to use Cocoa or Carbon])
    case ${TK_LIBS} in
	*Cocoa*)
	    AC_MSG_RESULT([Cocoa])
	    TEA_ADD_CFLAGS([-DMAC_TK_COCOA -std=gnu99 -x objective-c -fobjc-gc])
	    TEA_ADD_SOURCES([tkMacOSXTree.c])
	    TEA_ADD_LIBS([-framework Cocoa -framework Carbon])
	    ;;
	*)
	    AC_MSG_RESULT([Carbon])
	    TEA_ADD_CFLAGS([-DMAC_TK_CARBON])
	    TEA_ADD_SOURCES([tkMacOSXTree.c])
	    TEA_ADD_LIBS([-framework Carbon])
	    ;;
    esac
fi

if test "${TEA_WINDOWINGSYSTEM}" = "x11"; then
    TEA_ADD_SOURCES([tkUnixTree.c])

    AC_ARG_ENABLE(gtk,
	AC_HELP_STRING([--enable-gtk],
	[build GTK+ theme-aware treectrl (default: no)]),
	[tcl_ok=$enableval], [tcl_ok=no])
    if test "$tcl_ok" = "yes" ; then
		PKG_CHECK_MODULES([GTK], [gtk+-2.0 gdk-pixbuf-xlib-2.0])
	TEA_ADD_CFLAGS([-DTREECTRL_GTK $GTK_CFLAGS])
	TEA_ADD_LIBS([$GTK_LIBS])
    fi

    TEA_ADD_LIBS([${MATH_LIBS}])
fi

#--------------------------------------------------------------------
# Check whether --enable-threads or --disable-threads was given.
#--------------------------------------------------------------------

TEA_ENABLE_THREADS

AS_IF([test "${TCL_THREADS}" = "1"], [
    DIST_WIN_THREADS=-threads
], [
    DIST_WIN_THREADS=""
])
AC_SUBST(DIST_WIN_THREADS)



( run in 0.477 second using v1.01-cache-2.11-cpan-71847e10f99 )