Commit 50686c88 authored by Bill Hoffman's avatar Bill Hoffman

ENH: changes to allow build with cygwin

parent 98c1f58a
......@@ -3,5 +3,6 @@
*.bat -crlf
*.dsp -crlf
*.dsw -crlf
MakeDLL crlf=input
configure crlf=input
install-sh crlf=input
......@@ -48,9 +48,9 @@ libVTK${ME}.a: ${SRC_OBJ} ${KIT_OBJ}
libVTK$(ME)$(SHLIB_SUFFIX): ${KIT_OBJ}
rm -f libVTK$(ME)$(SHLIB_SUFFIX)
$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
$(SHLIB_LD) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
libVTK$(ME)$(SHLIB_SUFFIX) \
${KIT_OBJ} ${KIT_EXTERNAL_LIBS} ${SHLIB_LD_LIBS}
${KIT_OBJ} ${KIT_EXTERNAL_LIBS} ${SHLIB_VTK_LIBS} ${SHLIB_LD_LIBS}
#------------------------------------------------------------------------------
# rules for the tcl library
......@@ -67,10 +67,12 @@ libVTK${ME}Tcl.a: tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ}
libVTK$(ME)Tcl$(SHLIB_SUFFIX): tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ} \
libVTK$(ME)$(SHLIB_SUFFIX)
rm -f libVTK$(ME)Tcl$(SHLIB_SUFFIX)
$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
$(SHLIB_LD) \
${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} -o \
libVTK$(ME)Tcl$(SHLIB_SUFFIX) \
tcl/${ME}Init.o ${KIT_LIBS} ${KIT_TCL_OBJ} \
-L. -lVTK$(ME)
-L. -lVTK$(ME) ${SHLIB_VTK_TCL_LIBS} ${SHLIB_VTK_LIBS} \
${SHLIB_LD_LIBS} ${TK_LIB} ${TCL_LIB}
#------------------------------------------------------------------------------
# rules for the java library
......
#! /bin/sh
#
# MakeDLL: Script to create VTK DLLs for Cygwin (v >= 1.1.7) and MingW.
# Mumit Khan <khan@nanotech.wisc.edu>
#
# Script to create VTK DLLs for Cygwin. The only reason this script
# exists is to avoid the *huge* memory requirement of the GNU linker
# when building the Graphics DLL, and possibly also the Imaging DLL,
# in one piece. Currently, Cygwin linker can take upto a 600+ MB of
# VM building the Graphics DLL using the normal scheme: using -DVTKDLL
# to compile the DLL code and then using ``c++ -shared ...'' to build
# the DLL. So, this script builds the DLLs using a slightly different
# technique that is much more resource-friendly: compile the DLL code
# as if building a static library (ie., use -DVTKSTATIC), then run
# `dlltool' to create a DEF file exporting all global symbols, and
# use the ``c++ -shared <DEF_FILE_HERE> ...'' to create the DLL. All
# this script does is to create and then tack on that extra DEF_FILE
# argument to the compiler driver.
# Invoke this script in the same way you'd invoke the normal command
# to build a DLL.
# Variables passed in from system.make SHLIB_LD variable.
CXX=${CXX-'c++'}
DLLTOOL=${DLLTOOL-'dlltool'}
# Set to "yes" if you want to create import library for the DLL.
# Cygwin linker will directly link against a DLL, so there's
# really no need.
create_import_library=no
# Set to "no" if you want the default image base and want to supply
# from the command line or Makefile. Trust me, having a whole bunch
# of DLLs that try to relocate isn't a pretty sight.
set_auto_image_base=yes
cmdline="$@"
tmpfile=/tmp/$$.def
trap "rm -f $tmpfile; exit 1" 1 2 15 3
# Create a DEF file from all the object files and non-import library
# archives on the command line. We extract all the .o/.obj/.a files
# and also get the name of the output DLL.
objfiles=""
dllname="foo.dll"
while [ $# -gt 0 ]; do
case "$1" in
*.obj | *.o | *.a)
objfiles="$objfiles $1"
;;
-o)
if test $# -lt 2; then
echo "Error: No output DLL specified after -o option"
exit 1
fi
shift
dllname="$1"
;;
-v)
set -x
;;
esac
shift
done
def_file="`echo ${dllname} | \
sed -e 's, ,_,g' -e 's,\(.*\)\.\(.*\),\1.def,'`"
extra_driver_flags=""
if test "$create_import_library" = "yes"; then
implib="`echo ${dllname} | \
sed -e 's, ,_,g' -e 's,\(.*\)\.\(.*\),\1.a,'`"
extra_driver_flags="$extra_driver_flags -Wl,--out-implib,$implib"
fi
if test "$set_auto_image_base" = "yes"; then
extra_driver_flags="$extra_driver_flags -Wl,--enable-auto-image-base"
fi
$DLLTOOL --export-all --output-def $tmpfile $objfiles
cat $tmpfile | sed '1d' | awk '{print $1}' > $def_file
rm -f $tmpfile
$CXX $def_file $extra_driver_flags $cmdline
exit $?
......@@ -64,7 +64,7 @@ build_parallel: build_graphics build_imaging
cd parallel; ${MAKE} -${MAKEFLAGS} all
build_tcl: build_common ${BUILD_TOOLKITS}
cd tcl; ${MAKE} -${MAKEFLAGS} vtk
cd tcl; ${MAKE} -${MAKEFLAGS} vtk$(EXEEXT) $(VTK_TCL_SHLIB_TARGET)
build_python: build_common ${BUILD_TOOLKITS}
cd python; ${MAKE} -${MAKEFLAGS} all
......@@ -183,5 +183,3 @@ install-dirs:
else true; \
fi; \
done;
......@@ -161,7 +161,8 @@ vtkWindowToImageFilter \
vtkInterpolatedVelocityField \
vtkRungeKutta2 \
vtkRungeKutta4 \
vtkXMLFileOutputWindow
vtkXMLFileOutputWindow \
$(VTK_PLATFORM_OBJ)
WIN32_OBJ = \
vtkWin32OutputWindow
......
This diff is collapsed.
......@@ -14,7 +14,6 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PATH_XTRA
# get byte swapping info
AC_C_BIGENDIAN
......@@ -52,6 +51,52 @@ else
fi
fi
AC_CACHE_VAL(vtk_cv_system_name, [vtk_cv_system_name=$system])
##########################
## ##
## X11 ##
## ##
##########################
case $system in
CYGWIN* | MINGW*) no_x="yes" ;;
esac
AC_PATH_XTRA
AC_SUBST(XEXT_LIB)
AC_SUBST(XT_LIB)
AC_SUBST(X11_LIB)
XEXT_LIB=
XT_LIB=
X11_LIB=
case $system in
CYGWIN* | MINGW*)
;;
*)
if test "$no_x" = "yes"; then
true
else
XEXT_LIB=-lXext
XT_LIB=-lXt
X11_LIB=-lX11
fi
;;
esac
##########################
## ##
## Math lib ##
## ##
##########################
# Most Unix systems need -lm, but Win32 based systems don't necessarily
# need it, and in some cases, will cause link errors.
AC_SUBST(MATH_LIB)
case $system in
CYGWIN* | MINGW*) MATH_LIB= ;;
*) MATH_LIB="-lm" ;;
esac
##########################
## ##
......@@ -75,6 +120,14 @@ if test "$use_oglr" = "no"; then
OGLR_INCLUDE="-I/usr/X11R6/include")
fi
# Avoid incorrect definition of use_oglr. Must do it after all the tests
# because we may be cross-compiling and the host system may indeed
# satisfy one of the tests above and use_olgr will be incorrectly set.
case $system in
CYGWIN* | MINGW*) use_oglr=no ;;
*) ;;
esac
AC_MSG_CHECKING(for OpenGL library)
OPENGLSW=""
dirs="/opt/graphics/OpenGL/lib /usr/openwin/lib /usr/X11R6/lib"
......@@ -98,6 +151,26 @@ if test "$use_oglr" = "yes"; then
GRAPHICS_API_FLAGS="${GRAPHICS_API_FLAGS} ${OGLR_INCLUDE}"
fi
# We use VTK_PLATFORM_* variable in Makefiles to select platform
# specific files needed by Unix vs Win32.
case $system in
CYGWIN* | MINGW*)
VTK_PLATFORM_ABSTRACT="\${WIN32_ABSTRACT}"
VTK_PLATFORM_CONCRETE="\${WIN32_CONCRETE}"
VTK_PLATFORM_OBJ="\${WIN32_OBJ}"
VTK_PLATFORM=WIN32
;;
*)
VTK_PLATFORM_ABSTRACT="\${UNIX_ABSTRACT}"
VTK_PLATFORM_CONCRETE="\${UNIX_CONCRETE}"
VTK_PLATFORM_OBJ="\${UNIX_OBJ}"
VTK_PLATFORM=UNIX
;;
esac
AC_SUBST(VTK_PLATFORM)
AC_SUBST(VTK_PLATFORM_ABSTRACT)
AC_SUBST(VTK_PLATFORM_CONCRETE)
AC_SUBST(VTK_PLATFORM_OBJ)
##########################
## ##
......@@ -156,7 +229,7 @@ fi
case $system in
CYGWIN_NT*)
GRAPHICS_API_OBJ="\${WIN32_OBJ}"
GRAPHICS_API_LIBS=" -lopengl32"
GRAPHICS_API_LIBS=" -lopengl32 -mwindows"
GRAPHICS_API_FLAGS=
esac
......@@ -395,7 +468,6 @@ AC_ARG_WITH(bsdmake,
AC_SUBST(MAKEINCLUDE)
AC_SUBST(MAKEQUOTE)
#------------------------------------------------------------------------------
# If user.make is not in the build directory, copy it local.
#------------------------------------------------------------------------------
......@@ -446,6 +518,35 @@ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Step 4: set configuration options based on system name and version.
fullSrcDir=`cd $srcdir; pwd`
# SHLIB_LD may not be the same as the C++ compiler for all platforms.
SHLIB_LD=${CXX}
AC_SUBST(SHLIB_LD)
# Autoconf can detect this, but you need to use config.guess/config.sub
# to detect host instead of the VTK approach inherited from Tcl.
EXEEXT=""
AC_SUBST(EXEEXT)
# Building DLLs under Windows require all symbols be resolved at link
# time.
SHLIB_VTK_GRAPHICS_DEP_LIBS=
SHLIB_VTK_IMAGING_DEP_LIBS=
SHLIB_VTK_CONTRIB_DEP_LIBS=
SHLIB_VTK_PATENTED_DEP_LIBS=
SHLIB_VTK_LOCAL_DEP_LIBS=
SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS=
SHLIB_VTK_IMAGING_TCL_DEP_LIBS=
SHLIB_VTK_CONTRIB_TCL_DEP_LIBS=
SHLIB_VTK_PATENTED_TCL_DEP_LIBS=
SHLIB_VTK_LOCAL_TCL_DEP_LIBS=
AC_SUBST(SHLIB_VTK_GRAPHICS_DEP_LIBS)
AC_SUBST(SHLIB_VTK_IMAGING_DEP_LIBS)
AC_SUBST(SHLIB_VTK_CONTRIB_DEP_LIBS)
AC_SUBST(SHLIB_VTK_PATENTED_DEP_LIBS)
AC_SUBST(SHLIB_VTK_LOCAL_DEP_LIBS)
AC_SUBST(SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS)
AC_SUBST(SHLIB_VTK_IMAGING_TCL_DEP_LIBS)
AC_SUBST(SHLIB_VTK_CONTRIB_TCL_DEP_LIBS)
AC_SUBST(SHLIB_VTK_PATENTED_TCL_DEP_LIBS)
AC_SUBST(SHLIB_VTK_LOCAL_TCL_DEP_LIBS)
case $system in
AIX-*)
# AIX: can't link shared library extensions unless Tcl and Tk are
......@@ -618,6 +719,32 @@ case $system in
DL_LIBS="-ldl"
VTK_SHLIB_LINK_FLAGS="-Wl,-Bexport"
;;
CYGWIN* | MINGW*)
EXEEXT=".exe"
# Cygwin/Mingw build use a separate script, MakeDLL, to
# build the DLLs to avoid running out of VM when building
# the large DLLs. See comments in MakeDLL for more
# info.
DLLTOOL="${DLLTOOL-dlltool}"
SHLIB_LD="CXX=\$(CXX) DLLTOOL=$DLLTOOL $fullSrcDir/MakeDLL"
VTK_SHLIB_BUILD_FLAGS="-shared -s"
SHLIB_CFLAGS="-DVTKSTATIC"
SHLIB_LD_LIBS="-mwindows"
SHLIB_SUFFIX=".dll"
# Win32 DLLs, unlike Unix shared libraries, need to resolve all
# symbols at link time.
SHLIB_VTK_GRAPHICS_DEP_LIBS="-L../common -lVTKCommon \${GRAPHICS_API_LIBS}"
SHLIB_VTK_IMAGING_DEP_LIBS="$SHLIB_VTK_GRAPHICS_DEP_LIBS"
SHLIB_VTK_CONTRIB_DEP_LIBS="-L../graphics -lVTKGraphics -L../imaging -lVTKImaging $SHLIB_VTK_GRAPHICS_DEP_LIBS"
SHLIB_VTK_PATENTED_DEP_LIBS="$SHLIB_VTK_CONTRIB_DEP_LIBS"
SHLIB_VTK_LOCAL_DEP_LIBS="$SHLIB_VTK_CONTRIB_DEP_LIBS"
SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS="-L../common -lVTKCommonTcl"
SHLIB_VTK_IMAGING_TCL_DEP_LIBS="$SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS"
SHLIB_VTK_CONTRIB_TCL_DEP_LIBS="-L../graphics -lVTKGraphicsTcl -L../imaging -lVTKImagingTcl $SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS"
SHLIB_VTK_PATENTED_TCL_DEP_LIBS="$SHLIB_VTK_CONTRIB_TCL_DEP_LIBS"
SHLIB_VTK_LOCAL_TCL_DEP_LIBS="$SHLIB_VTK_CONTRIB_TCL_DEP_LIBS"
;;
esac
export SHLIB_SUFFIX
......@@ -625,20 +752,29 @@ export SHLIB_SUFFIX
# libraries to the right flags for gcc, instead of those for the
# standard manufacturer compiler.
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
SHLIB_CFLAGS="-fPIC"
case $system in
CYGWIN* | MINGW*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
esac
fi
if test "$vtk_shared_ok" = "yes"; then
VTK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
VTK_LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS}"
VTK_TCL_SHLIB_TARGET="vtktcl"
case $system in
CYGWIN* | MINGW*) VTK_TCL_SHLIB_TARGET="vtktcl.dll" ;;
*) VTK_TCL_SHLIB_TARGET="" ;;
esac
RANLIB=":"
TOOLKIT_DEPENDS=""
VTK_LIB_EXT="${SHLIB_SUFFIX}"
else
VTK_LIB_EXT=".a"
SHLIB_LD_LIBS=""
VTK_SHLIB_CFLAGS=""
case $system in
CYGWIN* | MINGW*) VTK_SHLIB_CFLAGS=-DVTKSTATIC ;;
*) VTK_SHLIB_CFLAGS="" ;;
esac
VTK_LD_SEARCH_FLAGS=""
TOOLKIT_DEPENDS="\${VTK_OBJ}/common/libVTKCommonTcl.a"
if test "X$graphicsdir" != "X"; then
......
......@@ -49,8 +49,8 @@ vtkTransformToGrid \
vtkVideoSource \
vtkVolumeProMapper \
vtkVRMLImporter \
vtkXYPlotActor
vtkXYPlotActor \
${VTK_PLATFORM_OBJ}
WIN32_OBJ = \
vtkWin32OffscreenRenderWindow
......@@ -70,6 +70,11 @@ vtkWin32OffscreenRenderWindow
@MAKEINCLUDE@ @MAKEQUOTE@targets.make@MAKEQUOTE@
# On some systems, building VTK components as shared libraries or DLLs
# may require linking with other VTK libraries.
SHLIB_VTK_LIBS = $(SHLIB_VTK_CONTRIB_DEP_LIBS)
SHLIB_VTK_TCL_LIBS = $(SHLIB_VTK_CONTRIB_TCL_DEP_LIBS)
# add in any extra libraries here
KIT_EXTERNAL_LIBS =
......
......@@ -77,6 +77,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkNormals.h"
#include "vtkSystemIncludes.h"
// Provide isatty prototype for Cygwin.
#ifdef __CYGWIN__
#include <unistd.h>
#endif
// Used later to get the current VRMLImporter
static vtkVRMLImporter *CurrentImporter;
......
......@@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "vtkWin32OffscreenRenderWindow.h"
#include <gl/gl.h>
#include <GL/gl.h>
#include "vtkObjectFactory.h"
//------------------------------------------------------------------------------
......
......@@ -83,7 +83,7 @@ vtkVolumeRayCastFunction \
vtkVolumeReader \
vtkVolumeTextureMapper \
vtkWriter \
${UNIX_ABSTRACT}
${VTK_PLATFORM_ABSTRACT}
# put all concrete classes here
......@@ -330,7 +330,7 @@ vtkWindowedSincPolyDataFilter \
vtkWorldPointPicker \
vtkWarpVector \
${GRAPHICS_API_OBJ} \
${UNIX_CONCRETE}
${VTK_PLATFORM_CONCRETE}
WIN32_OBJ = \
vtkOpenGLRenderer \
......@@ -363,6 +363,10 @@ vtkWin32RenderWindowInteractor
@MAKEINCLUDE@ @MAKEQUOTE@targets.make@MAKEQUOTE@
# On some systems, building VTK components as shared libraries or DLLs
# may require linking with other VTK libraries.
SHLIB_VTK_LIBS = $(SHLIB_VTK_GRAPHICS_DEP_LIBS)
SHLIB_VTK_TCL_LIBS = $(SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS)
VTK_LIB_FILE = libVTK${ME}${VTK_LIB_EXT}
TCL_LIB_FILE = libVTK${ME}Tcl${VTK_LIB_EXT}
......@@ -385,7 +389,7 @@ vtkJavaPanel.o: java/vtk_vtkPanel.h java/vtk_vtkPanel.c
# standard stuff here
KIT_OBJ = ${SRC_OBJ}
KIT_TCL_OBJ = vtkXRenderWindowTclInteractor.o ${TCL_OBJ}
KIT_TCL_OBJ = @TCL_INTERACTOR_OBJ@ ${TCL_OBJ}
KIT_NEWS = ${TCL_NEWS}
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
......@@ -57,6 +57,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
......@@ -340,7 +341,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.12"
echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
......@@ -510,9 +511,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
......@@ -578,6 +581,16 @@ fi
case "$vtk_cv_system_name" in
CYGWIN*)
TCL_INTERACTOR_OBJ=""
;;
*)
TCL_INTERACTOR_OBJ="vtkXRenderWindowTclInteractor.o"
;;
esac
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
......@@ -623,7 +636,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set) 2>&1` in
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
......@@ -702,7 +715,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.12"
echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
......@@ -721,9 +734,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
......@@ -745,6 +760,7 @@ s%@mandir@%$mandir%g
s%@TKWIDGET@%$TKWIDGET%g
s%@MAKEINCLUDE@%$MAKEINCLUDE%g
s%@MAKEQUOTE@%$MAKEQUOTE%g
s%@TCL_INTERACTOR_OBJ@%$TCL_INTERACTOR_OBJ%g
s%@subdirs@%$subdirs%g
CEOF
......
......@@ -39,6 +39,16 @@ AC_ARG_WITH(bsdmake,
AC_SUBST(MAKEINCLUDE)
AC_SUBST(MAKEQUOTE)
case "$vtk_cv_system_name" in
CYGWIN*)
TCL_INTERACTOR_OBJ=""
;;
*)
TCL_INTERACTOR_OBJ="vtkXRenderWindowTclInteractor.o"
;;
esac
AC_SUBST(TCL_INTERACTOR_OBJ)
AC_CONFIG_SUBDIRS(python tcl java examplesCxx)
dnl Checks for library functions.
......
......@@ -43,7 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#ifdef _MSC_VER
#include <GL/glaux.h>
#else
#include <GL/gl.h>
#endif
#include "vtkWin32OpenGLRenderWindow.h"
#include "vtkWin32RenderWindowInteractor.h"
#include "vtkOpenGLRenderer.h"
......
......@@ -44,11 +44,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <math.h>
#include "vtkWin32OpenGLRenderWindow.h"
// MSVC does the right thing without the forward declaration when it
// sees it in the friend decl in vtkWin32RenderWindowInteractor, but
// GCC needs to see the declaration beforehand. It has to do with the
// CALLBACK attribute.
VTK_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND,UINT,WPARAM,LPARAM);
VTK_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND,UINT,WPARAM,LPARAM,class vtkWin32RenderWindowInteractor*);
#include "vtkWin32RenderWindowInteractor.h"
#include "vtkInteractorStyle.h"
#include "vtkActor.h"
#ifndef VTK_IMPLEMENT_MESA_CXX
#include <gl/gl.h>
#include <GL/gl.h>
#endif
#include "vtkObjectFactory.h"
#include "vtkCommand.h"
......
......@@ -149,7 +149,7 @@ vtkScaledTextActor \
vtkTextMapper \
vtkTIFFReader \
vtkTIFFWriter \
${UNIX_CONCRETE} \
${VTK_PLATFORM_CONCRETE} \
${GRAPHICS_API_OBJ}
WIN32_OBJ = \
......@@ -179,6 +179,10 @@ vtkWin32PolyDataMapper2D
@MAKEINCLUDE@ @MAKEQUOTE@targets.make@MAKEQUOTE@
# On some systems, building VTK components as shared libraries or DLLs
# may require linking with other VTK libraries.
SHLIB_VTK_LIBS = $(SHLIB_VTK_IMAGING_DEP_LIBS)
SHLIB_VTK_TCL_LIBS = $(SHLIB_VTK_IMAGING_TCL_DEP_LIBS)
VTK_LIB_FILE = libVTK${ME}${VTK_LIB_EXT}
TCL_LIB_FILE = libVTK${ME}Tcl${VTK_LIB_EXT}
......
......@@ -42,7 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#ifdef _MSC_VER
#include <GL/glaux.h>
#else
#include <GL/gl.h>
#endif
#include "vtkWin32OpenGLImageWindow.h"
#include "vtkObjectFactory.h"
......
......@@ -45,6 +45,10 @@ vtkSynchronizedTemplates3D
@MAKEINCLUDE@ @MAKEQUOTE@targets.make@MAKEQUOTE@
# On some systems, building VTK components as shared libraries or DLLs
# may require linking with other VTK libraries.
SHLIB_VTK_LIBS = $(SHLIB_VTK_PATENTED_DEP_LIBS)
SHLIB_VTK_TCL_LIBS = $(SHLIB_VTK_PATENTED_TCL_DEP_LIBS)
VTK_LIB_FILE = libVTK${ME}${VTK_LIB_EXT}
TCL_LIB_FILE = libVTK${ME}Tcl${VTK_LIB_EXT}
......
VTK_OBJ = @VTK_OBJ@
VTK_OBJ = @VTK_OBJ@
VTK_PLATFORM = @VTK_PLATFORM@
VTK_PLATFORM_ABSTRACT = @VTK_PLATFORM_ABSTRACT@
VTK_PLATFORM_CONCRETE = @VTK_PLATFORM_CONCRETE@
VTK_PLATFORM_OBJ = @VTK_PLATFORM_OBJ@
RANLIB = @RANLIB@
CC = @CC@
......@@ -10,9 +14,15 @@ CXXFLAGS = @VTK_SHLIB_CFLAGS@ @VTK_TEMPLATE_FLAGS@
USER_CFLAGS = @CFLAGS@
USER_CXXFLAGS = @CXXFLAGS@
EXEEXT = @EXEEXT@
MATH_LIB = @MATH_LIB@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
XLIBS = @X_LIBS@
XEXT_LIB = @XEXT_LIB@
XT_LIB = @XT_LIB@
X11_LIB = @X11_LIB@
prefix = @prefix@
exec_prefix = @exec_prefix@
LIB_RUNTIME_DIR = @exec_prefix@/lib
......@@ -56,6 +66,18 @@ DL_LIBS = @DL_LIBS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
SHLIB_LD = @SHLIB_LD@
SHLIB_VTK_GRAPHICS_DEP_LIBS = @SHLIB_VTK_GRAPHICS_DEP_LIBS@
SHLIB_VTK_IMAGING_DEP_LIBS = @SHLIB_VTK_IMAGING_DEP_LIBS@
SHLIB_VTK_CONTRIB_DEP_LIBS = @SHLIB_VTK_CONTRIB_DEP_LIBS@
SHLIB_VTK_PATENTED_DEP_LIBS = @SHLIB_VTK_PATENTED_DEP_LIBS@
SHLIB_VTK_LOCAL_DEP_LIBS = @SHLIB_VTK_LOCAL_DEP_LIBS@
SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS = @SHLIB_VTK_GRAPHICS_TCL_DEP_LIBS@
SHLIB_VTK_IMAGING_TCL_DEP_LIBS = @SHLIB_VTK_IMAGING_TCL_DEP_LIBS@
SHLIB_VTK_CONTRIB_TCL_DEP_LIBS = @SHLIB_VTK_CONTRIB_TCL_DEP_LIBS@
SHLIB_VTK_PATENTED_TCL_DEP_LIBS = @SHLIB_VTK_PATENTED_TCL_DEP_LIBS@
SHLIB_VTK_LOCAL_TCL_DEP_LIBS = @SHLIB_VTK_LOCAL_TCL_DEP_LIBS@
THREAD_LIBS = @THREAD_LIBS@
GRAPHICS_API_OBJ = @GRAPHICS_API_OBJ@
......
......@@ -44,7 +44,7 @@ CXX_FLAGS = ${USER_CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS} -I${srcdir} \
${USE_TOOLKIT_FLAGS}
C_FLAGS = ${USER_CFLAGS} ${CPPFLAGS} ${CFLAGS} -I${srcdir} \
-I${srcdir}/../common ${TK_INCLUDE} ${TCL_INCLUDE} \
-I${srcdir}/../common -I../common ${TK_INCLUDE} ${TCL_INCLUDE} \
${GRAPHICS_API_FLAGS} ${CONTROLLER_API_FLAGS} ${USE_TOOLKIT_FLAGS}
all:
......@@ -58,25 +58,31 @@ vtktcl.o: vtktcl.c Makefile
#------------------------------------------------------------------------------
# build the vtk executable
#
vtk: Makefile tkAppInit.o ${TOOLKIT_DEPENDS}
$(CXX) -o vtk tkAppInit.o \
vtk$(EXEEXT): Makefile tkAppInit.o ${TOOLKIT_DEPENDS}
$(CXX) -o $@ tkAppInit.o \
-L. ${CXX_FLAGS} ${VTK_SHLIB_LINK_FLAGS} ${XLDFLAGS} ${LDLIBS} \
${XLIBS} -lXext -lXt ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} -lm
${XLIBS} ${XEXT_LIB} ${XT_LIB} ${X_PRE_LIBS} ${X11_LIB} ${X_EXTRA_LIBS} ${MATH_LIB}
vtktcl: Makefile vtktcl.o ${TOOLKIT_DEPENDS}
${CXX} -o vtktcl vtktcl.o \
vtktcl$(EXEEXT): Makefile vtktcl.o ${TOOLKIT_DEPENDS}
${CXX} -o $@ vtktcl.o \
-L. ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} ${XLDFLAGS} ${LDLIBS} \
${XLIBS} -lXext -lXt ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} -lm
${XLIBS} ${XEXT_LIB} ${XT_LIB} ${X_PRE_LIBS} ${X11_LIB} ${X_EXTRA_LIBS} ${MATH_LIB}
# This target is for Cygwin and Mingw.
vtktcl.dll: Makefile vtktcl.o ${TOOLKIT_DEPENDS}
${SHLIB_LD} -o $@ vtktcl.o \
-L. ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} ${XLDFLAGS} ${LDLIBS}
#------------------------------------------------------------------------------
# install
#
install: vtk
${INSTALL} -m 755 vtk $(BIN_INSTALL_DIR)/vtk
@for i in vtk$(EXEEXT) $(VTK_TCL_SHLIB_TARGET) ; do \
${INSTALL} -m 755 $$i $(BIN_INSTALL_DIR)/$$i; \
done
#------------------------------------------------------------------------------
clean:
-rm -f vtktcl vtk *.o *.a cpp_parse kit_init Makefile
-rm -f vtktcl vtk$(EXEEXT) vtktcl.dll *.o *.a cpp_parse kit_init Makefile
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment