This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/libgui] Fix cygwin build woes


Hi,

I've committed the attached patch which should fix any problems with building libgui on cygwin. At least, it builds on *my* cygwin box.

NOTE: Not tested (and probably won't work) with mingw!

Please let me know (via this list) if there are any problems.

Keith

ChangeLog
2008-08-02  Keith Seitz  <keiths@redhat.com>

        * tcl.m4: Remove. I changed my mind.
        * acinclude.m4: Include ../config/tcl.m4.
        (CY_AC_TCL_PRIVATE_HEADERS): New macro.
        (CY_AC_TK_PRIVATE_HEADERS): New macro.
        * configure.ac: When using in-tree tcl/tk, include
        Tcl's/Tk's platform directory.
        When using installed Tcl/Tk, use CY_AC_{TCL,TK}_PRIVATE_HEADERS
        to find the private header files.
        * aclocal.m4: Regenerated.
        * configure: Regenerated.
        * library/Makefile.in: Regenerated.
        * src/Makefile.in: Regenerated.
Index: acinclude.m4
===================================================================
RCS file: /cvs/src/src/libgui/acinclude.m4,v
retrieving revision 1.3
diff -u -p -r1.3 acinclude.m4
--- acinclude.m4	22 Jul 2008 20:11:35 -0000	1.3
+++ acinclude.m4	2 Aug 2008 23:32:51 -0000
@@ -1 +1,43 @@
-"sinclude(tcl.m4)"
+sinclude(../config/tcl.m4)
+
+dnl Find the location of the private Tcl headers
+dnl When Tcl is installed, this is TCL_INCLUDE_SPEC/tcl-private/generic
+dnl When Tcl is in the build tree, this is not needed.
+dnl
+dnl Note: you must use first use SC_LOAD_TCLCONFIG!
+AC_DEFUN([CY_AC_TCL_PRIVATE_HEADERS], [
+  AC_MSG_CHECKING([for Tcl private headers])
+  private_dir=""
+  dir=`echo ${TCL_INCLUDE_SPEC}/tcl-private/generic | sed -e s/-I//`
+  if test -f ${dir}/tclInt.h ; then
+    private_dir=${dir}
+  fi
+
+  if test x"${private_dir}" = x; then
+    AC_ERROR(could not find private Tcl headers)
+  else
+    TCL_PRIVATE_INCLUDE="-I${private_dir}"
+    AC_MSG_RESULT(${private_dir})
+  fi
+])
+
+dnl Find the location of the private Tk headers
+dnl When Tk is installed, this is TK_INCLUDE_SPEC/tk-private/generic
+dnl When Tk is in the build tree, this not needed.
+dnl
+dnl Note: you must first use SC_LOAD_TKCONFIG
+AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
+  AC_MSG_CHECKING([for Tk private headers])
+  private_dir=""
+  dir=`echo ${TK_INCLUDE_SPEC}/tk-private/generic | sed -e s/-I//`
+  if test -f ${dir}/tkInt.h; then
+    private_dir=${dir}
+  fi
+
+  if test x"${private_dir}" = x; then
+    AC_ERROR(could not find Tk private headers)
+  else
+    TK_PRIVATE_INCLUDE="-I${private_dir}"
+    AC_MSG_RESULT(${private_dir})
+  fi
+])
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/libgui/configure.ac,v
retrieving revision 1.3
diff -u -p -r1.3 configure.ac
--- configure.ac	22 Jul 2008 20:11:35 -0000	1.3
+++ configure.ac	2 Aug 2008 23:32:51 -0000
@@ -92,15 +92,22 @@ cd ${here}
 
 if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
   # Using in-tree Tcl/Tk
-  TCL_INCLUDES="-I${TCL_SRC_DIR}/generic"
+  case "${host}" in
+    *-*-cygwin*) platDir="win" ;;
+    *) platDir="unix" ;;
+  esac
+
+  TCL_INCLUDES="-I${TCL_SRC_DIR}/generic -I${TCL_SRC_DIR}/${platDir}"
   TCL_LIBRARY=${TCL_BUILD_LIB_SPEC}
-  TK_INCLUDES="-I${TK_SRC_DIR}/generic"
+  TK_INCLUDES="-I${TK_SRC_DIR}/generic -I${TK_SRC_DIR}/${platDir}"
   TK_LIBRARY=${TK_BUILD_LIB_SPEC}
 else
   # Using installed Tcl/Tk
-  TCL_INCLUDES=${TCL_INCLUDE_SPEC}
+  CY_AC_TCL_PRIVATE_HEADERS
+  CY_AC_TK_PRIVATE_HEADERS
+  TCL_INCLUDES="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
   TCL_LIBRARY=${TCL_LIB_SPEC}
-  TK_INCLUDES=${TK_INCLUDE_SPEC}
+  TK_INCLUDES="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
   TK_LIBRARY=${TK_LIB_SPEC}
 fi
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]