1 dnl Process this file with autoconf to produce configure.
3 AC_INIT(src/subcommand.h)
4 AM_INIT_AUTOMAKE(libgui, 0.0)
5 AM_CONFIG_HEADER(config.h)
11 AC_ARG_ENABLE(install-libgui, \
12 [ --enable-install-libgui Install libgui.a and library header files])
13 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
14 AM_CONDITIONAL(INSTALL_LIBGUI, test x$enable_install_libgui = xyes)
15 AC_CHECK_TOOL(RANLIB, ranlib, :)
16 AC_CHECK_TOOL(AR, ar, :)
19 AC_HAVE_HEADERS(stddef.h stdlib.h getopt.h unistd.h fcntl.h sys/file.h sys/wait.h string.h strings.h)
22 AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support],
23 [case "${enableval}" in
26 *) AC_MSG_ERROR(bad value ${enableval} for enable-ide option) ;;
29 AM_CONDITIONAL(IDE_ENABLED, test x$ide = xyes)
30 if test x$ide = xyes; then
31 AC_DEFINE(IDE_ENABLED)
34 # If we have random, assume we have srandom. If we have drand48,
35 # assume we have srand48. If we have rand, assume we have srand.
36 AC_CHECK_FUNCS(random drand48 rand, break)
38 dnl Tcl ensures that strncasecmp is provided everywhere. But in some
39 dnl situations we might need to declare it. We check for that case
41 AC_EGREP_CPP(strncasecmp, [#include <string.h>],
42 AC_DEFINE(HAVE_STRNCASECMP_DECL))
45 AC_CACHE_CHECK([for cygwin32], ide_cv_os_cygwin32,
49 #endif],[ide_cv_os_cygwin32=yes],[ide_cv_os_cygwin32=no])])
51 if test x$ide_cv_os_cygwin32 = xyes; then
58 if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
59 case "$LIBGUI_CFLAGS" in
61 *) LIBGUI_CFLAGS="-mwin32 $LIBGUI_CFLAGS" ;;
69 LIBGUI_CFLAGS="-DWIN32 $LIBGUI_CFLAGS" ;;
71 AC_SUBST(LIBGUI_CFLAGS)
73 tmp="`cd $srcdir/library; pwd`"
74 if test x"$ac_cv_prog_CC" = xcl ; then
75 tmp2="`cygpath --windows $tmp`"
76 LIBGUI_LIBRARY_DIR="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
78 LIBGUI_LIBRARY_DIR=$tmp
80 AC_SUBST(LIBGUI_LIBRARY_DIR)
82 # Check for Tcl and Tk.
93 if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
94 # Using in-tree Tcl/Tk
96 *-*-cygwin*) platDir="win" ;;
100 TCL_INCLUDES="-I${TCL_SRC_DIR}/generic -I${TCL_SRC_DIR}/${platDir}"
101 TCL_LIBRARY=${TCL_BUILD_LIB_SPEC}
102 TK_INCLUDES="-I${TK_SRC_DIR}/generic -I${TK_SRC_DIR}/${platDir}"
103 TK_LIBRARY=${TK_BUILD_LIB_SPEC}
105 # Using installed Tcl/Tk
106 CY_AC_TCL_PRIVATE_HEADERS
107 CY_AC_TK_PRIVATE_HEADERS
108 TCL_INCLUDES="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
109 TCL_LIBRARY=${TCL_LIB_SPEC}
110 TK_INCLUDES="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
111 TK_LIBRARY=${TK_LIB_SPEC}
115 AC_SUBST(TCL_INCLUDES)
117 AC_SUBST(TK_INCLUDES)
118 AC_SUBST(TK_XINCLUDES)
121 AC_SUBST(TCL_LIBRARY)
124 AM_CONDITIONAL(TCL_SHARED, test x$TCL_SHARED_BUILD = x1)
126 AC_SUBST(RPATH_ENVVAR)
128 AC_OUTPUT([Makefile library/Makefile src/Makefile])