Skip to content

Commit

Permalink
New conditionals: HAVE_X11 and IS_WINDOWS
Browse files Browse the repository at this point in the history
Use these conditionals in ros/adm/make/TKService/Makefile.am
to define sources and includes conditionnally.

When X11 is not found, do not compile sources from Xw and
ImageUtility.
On Windows, compile files from ros/src/WNT
  • Loading branch information
dbarbier committed Mar 28, 2011
1 parent 66d637f commit 68d1d35
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 19 deletions.
84 changes: 69 additions & 15 deletions ros/adm/make/TKService/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ VPATH = @srcdir@ : \
@top_srcdir@/drv/InterfaceGraphic : @top_srcdir@/src/InterfaceGraphic: \
@top_srcdir@/drv/SelectBasics : @top_srcdir@/src/SelectBasics: \
@top_srcdir@/drv/Viewer : @top_srcdir@/src/Viewer: \
@top_srcdir@/drv/Xw : @top_srcdir@/src/Xw: \
@top_srcdir@/drv/MFT : @top_srcdir@/src/MFT: \
@top_srcdir@/drv/PS : @top_srcdir@/src/PS: \
@top_srcdir@/drv/CGM : @top_srcdir@/src/CGM: \
@top_srcdir@/drv/AlienImage : @top_srcdir@/src/AlienImage: \
@top_srcdir@/drv/Image : @top_srcdir@/src/Image: \
@top_srcdir@/drv/PlotMgt : @top_srcdir@/src/PlotMgt: \
@top_srcdir@/drv/ImageUtility : @top_srcdir@/src/ImageUtility: \
@top_srcdir@/drv/TColQuantity : @top_srcdir@/src/TColQuantity


Expand All @@ -29,14 +27,12 @@ INCLUDES = $(STLPort_INCLUDES) $(CSF_XwLibs_INCLUDES) $(CSF_dpsLibs_INCLUDES) $(
-I@top_srcdir@/drv/InterfaceGraphic -I@top_srcdir@/src/InterfaceGraphic \
-I@top_srcdir@/drv/SelectBasics -I@top_srcdir@/src/SelectBasics \
-I@top_srcdir@/drv/Viewer -I@top_srcdir@/src/Viewer \
-I@top_srcdir@/drv/Xw -I@top_srcdir@/src/Xw \
-I@top_srcdir@/drv/MFT -I@top_srcdir@/src/MFT \
-I@top_srcdir@/drv/PS -I@top_srcdir@/src/PS \
-I@top_srcdir@/drv/CGM -I@top_srcdir@/src/CGM \
-I@top_srcdir@/drv/AlienImage -I@top_srcdir@/src/AlienImage \
-I@top_srcdir@/drv/Image -I@top_srcdir@/src/Image \
-I@top_srcdir@/drv/PlotMgt -I@top_srcdir@/src/PlotMgt \
-I@top_srcdir@/drv/ImageUtility -I@top_srcdir@/src/ImageUtility \
-I@top_srcdir@/drv/TColQuantity -I@top_srcdir@/src/TColQuantity


Expand All @@ -45,7 +41,7 @@ lib_LTLIBRARIES=libTKService.la
libTKService_la_LIBADD = \
../TKernel/libTKernel.la \
../TKMath/libTKMath.la \
$(STLPort_LIB) $(CSF_XwLibs_LIB) $(CSF_dpsLibs_LIB) $(CSF_XmuLibs_LIB) $(CSF_FreeImagePlus_LIB)
$(STLPort_LIB) $(CSF_XwLibs_LIB) $(CSF_dpsLibs_LIB) $(CSF_XmuLibs_LIB) $(CSF_FreeImagePlus_LIB) $(CSF_SOCKETLibs_LIB) $(CSF_gdi32_LIB)

libTKService_la_SOURCES = \
@top_srcdir@/drv/Aspect/Aspect_Array1OfEdge_0.cxx \
Expand Down Expand Up @@ -209,15 +205,6 @@ libTKService_la_SOURCES = \
@top_srcdir@/src/Image/Image_PixelInterpolation.cxx \
@top_srcdir@/src/Image/Image_PlanarPixelInterpolation.cxx \
@top_srcdir@/src/Image/Image_PseudoColorImage.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Display.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Dump.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11GC.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Window.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11XImage.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XPR.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XWD.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XWUD.cxx \
@top_srcdir@/src/InterfaceGraphic/InterfaceGraphic_Palette.c \
@top_srcdir@/src/InterfaceGraphic/InterfaceGraphic_cPrintf.cxx \
@top_srcdir@/src/MFT/MFT.cxx \
Expand All @@ -243,7 +230,65 @@ libTKService_la_SOURCES = \
@top_srcdir@/src/SelectBasics/SelectBasics_SensitiveEntity.cxx \
@top_srcdir@/src/SelectBasics/SelectBasics_SortAlgo.cxx \
@top_srcdir@/src/Viewer/Viewer_View.cxx \
@top_srcdir@/src/Viewer/Viewer_Viewer.cxx \
@top_srcdir@/src/Viewer/Viewer_Viewer.cxx

if IS_WINDOWS
libTKService_la_SOURCES += \
@top_srcdir@/src/WNT/EHDC.cxx \
@top_srcdir@/src/WNT/W32_Allocator.cxx \
@top_srcdir@/src/WNT/W95_Allocator.cxx \
@top_srcdir@/src/WNT/WNT_Allocator.cxx \
@top_srcdir@/src/WNT/WNT_ColorRef.cxx \
@top_srcdir@/src/WNT/WNT_Dword.cxx \
@top_srcdir@/src/WNT/WNT_IconBox_1.cxx \
@top_srcdir@/src/WNT/WNT_ImageProcessor.cxx \
@top_srcdir@/src/WNT/WNT_LogFont.cxx \
@top_srcdir@/src/WNT/WNT_Long.cxx \
@top_srcdir@/src/WNT/WNT_MFTDraw.cxx \
@top_srcdir@/src/WNT/WNT_Uint.cxx \
@top_srcdir@/src/WNT/WNT_WindowData.cxx \
@top_srcdir@/src/WNT/WNT_WndProc.cxx \
@top_srcdir@/drv/WNT/WNT_ClassDefinitionError_0.cxx \
@top_srcdir@/drv/WNT/WNT_ColorTable_0.cxx \
@top_srcdir@/drv/WNT/WNT_FontMapEntryDefinitionError_0.cxx \
@top_srcdir@/drv/WNT/WNT_FontTable_0.cxx \
@top_srcdir@/drv/WNT/WNT_HColorTable_0.cxx \
@top_srcdir@/drv/WNT/WNT_HFontTable_0.cxx \
@top_srcdir@/drv/WNT/WNT_HListOfMFTFonts_0.cxx \
@top_srcdir@/drv/WNT/WNT_ListOfMFTFonts_0.cxx \
@top_srcdir@/drv/WNT/WNT_SequenceNodeOfSequenceOfImage_0.cxx \
@top_srcdir@/drv/WNT/WNT_SequenceOfImage_0.cxx \
@top_srcdir@/src/WNT/WNT_DDriver.cxx \
@top_srcdir@/src/WNT/WNT_FontMapEntry.cxx \
@top_srcdir@/src/WNT/WNT_GraphicDevice.cxx \
@top_srcdir@/src/WNT/WNT_Icon.cxx \
@top_srcdir@/src/WNT/WNT_IconBox.cxx \
@top_srcdir@/src/WNT/WNT_Image.cxx \
@top_srcdir@/src/WNT/WNT_ImageManager.cxx \
@top_srcdir@/src/WNT/WNT_PixMap.cxx \
@top_srcdir@/src/WNT/WNT_TextManager.cxx \
@top_srcdir@/src/WNT/WNT_WClass.cxx \
@top_srcdir@/src/WNT/WNT_WDriver.cxx \
@top_srcdir@/src/WNT/WNT_Window.cxx

VPATH += : \
@top_srcdir@/drv/WNT : @top_srcdir@/src/WNT

INCLUDES += \
-I@top_srcdir@/drv/WNT -I@top_srcdir@/src/WNT
endif

if HAVE_X11
libTKService_la_SOURCES += \
@top_srcdir@/src/ImageUtility/ImageUtility.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Display.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Dump.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11GC.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11Window.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_X11XImage.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XPR.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XWD.cxx \
@top_srcdir@/src/ImageUtility/ImageUtility_XWUD.cxx \
@top_srcdir@/src/Xw/Xw.cxx \
@top_srcdir@/src/Xw/Xw_ColorMap.cxx \
@top_srcdir@/src/Xw/Xw_Driver.cxx \
Expand Down Expand Up @@ -394,3 +439,12 @@ libTKService_la_SOURCES = \
@top_srcdir@/src/Xw/Xw_wait_event.cxx \
@top_srcdir@/src/Xw/Xw_zoom_image.cxx

VPATH += : \
@top_srcdir@/drv/ImageUtility : @top_srcdir@/src/ImageUtility: \
@top_srcdir@/drv/Xw : @top_srcdir@/src/Xw

INCLUDES += \
-I@top_srcdir@/drv/ImageUtility -I@top_srcdir@/src/ImageUtility \
-I@top_srcdir@/drv/Xw -I@top_srcdir@/src/Xw
endif

32 changes: 28 additions & 4 deletions ros/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,28 @@ AC_CHECK_HEADERS(X11/extensions/multibuf.h)
AC_CHECK_HEADERS(sys/filio.h sys/mman.h libc.h)

#-----------------------------------------------------------------------------
# Posix threads library is required
# Posix threads library is required on Unix
#-----------------------------------------------------------------------------
case "x$host" in
*msvc) ;;
*)
AC_CHECK_HEADER([pthread.h],[],[AC_MSG_ERROR([Posix threads required])])
AC_CHECK_LIB([pthread],[pthread_create],[],[AC_MSG_ERROR([Posix threads required])])
CSF_ThreadLibs_LIB=-lpthread
AC_SUBST(CSF_ThreadLibs_LIB)
;;
esac

#-----------------------------------------------------------------------------
# dl library is required
# dl library is required on Unix
#-----------------------------------------------------------------------------
case "x$host" in
*msvc) ;;
*)
AC_CHECK_LIB([dl],[dlopen],[],[AC_MSG_ERROR([dl library is required])])
CSF_SOCKETLibs_LIB=-ldl
;;
esac

#------------------------------------------------------------------------------
# Get Tcl and TK configuration information from tclConfig.sh.
Expand All @@ -96,12 +106,22 @@ AC_SUBST(CSF_TclTkLibs_INCLUDES)
AC_SUBST(CSF_TclLibs_LIB)
AC_SUBST(CSF_TclTkLibs_LIB)

platform=`uname -s`

dnl Make sure CSFDB is defined in CXXFLAGS and CFLAGS
CXXFLAGS="$CXXFLAGS -DCSFDB -DOCC_CONVERT_SIGNALS"
CFLAGS="$CFLAGS -DCSFDB -DOCC_CONVERT_SIGNALS"

case $host in
*msvc)
CPPFLAGS="$CPPFLAGS -DWNT -D__MATH_WNT_H -DHAVE_NO_DLL"
CSF_SOCKETLibs_LIB='-lwinspool -lws2_32'
CSF_gdi32_LIB='-lgdi32'
LDFLAGS="$LDFLAGS -no-undefined -shared -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -Wl,-export-all-symbols"
platform=win32
;;
*)

platform=`uname -s`

case $platform in
Linux*) CXXFLAGS="$CXXFLAGS -DLIN -DLININTEL -D_GNU_SOURCE=1"
CFLAGS="$CFLAGS -DLIN -DLININTEL -fexceptions"
Expand All @@ -115,8 +135,11 @@ case $platform in
LD=$CXX;;
*) ;;
esac
esac
AC_SUBST(CSF_SOCKETLibs_LIB)

AM_CONDITIONAL( IS_WINDOWS, [test "xwin32" = "x$platform" || test "xwin64" = "x$platform" ] )

AC_SUBST(platform)
AC_LANG([C++])

Expand Down Expand Up @@ -347,6 +370,7 @@ if test "xyes" != "x$no_x"; then
AC_CHECK_HEADER( [X11/Xmu/Xmu.h], [], [HAVE_X11=no] )
AC_CHECK_LIB( [Xmu], [XmuLookupStandardColormap], [CSF_XmuLibs_LIB="$CSF_XmuLibs_LIB -lXmu"], [HAVE_X11=no], [-lXt -lX11] )
fi
AM_CONDITIONAL( HAVE_X11, [test "xyes" = "x$HAVE_X11"] )

#---------------------------------------------------------------------
#
Expand Down

0 comments on commit 68d1d35

Please sign in to comment.