Hi,

I managed to compile the psttf driver in Windows. I needed to obtain most of the gtk developing environment, and that Alan wrote cmake files for the liblasi library was also a big help ;)

Anyway, here is the cookbook, tested for MinGW, but should also work for Visual C++:

  Installing liblasi in Windows
  =============================

- Downloading from http://www.gimp.org/~tml/gimp/win32/downloads.html
  - glib-2.12.7.zip and glib-dev-2.12.7.zip
  - pango-1.14.9.zip and pango-dev-1.14.9.zip
  - pkg-config-0.20-zip
  - libiconv-1.9.1.bin.woe32.zip
  - cairo-1.2.6.zip and cairo-dev-1.2.6.zip
  - freetype-2.2.1.zip and freetype-dev-2.2.1.zip
- fontconfig-tml-2.3.2-20060825.zip and fontconfig-dev-2.3.2-tml-20060825.zip - expat.zip (from here, copy xmlparse.dll in path and rename it to libexpat.dll)
  - gettext-0.14.5.zip and gettext-dev-0.14.5.zip

- Unzipping all packages in a directory, e.g. C:\Dev\gtk

- Setting environment variables (USER_ROOTDIR is the
  development directory, e.g. C:\Dev\gtk):

rem setup glib, pango, cairo, freetype, pkg-config
set PKG_CONFIG_PATH=%USER_ROOTDIR%\gtk\lib\pkgconfig
set PATH=%USER_ROOTDIR%\gtk\bin;%PATH%

 - Downloading lasi-1.0.6.tar.gz from http://unifont.org/lasi/
 - Applied patch from Alan (attached)
- change last 3 lines of gtk/lib/pkg-config/pangoft2.pc to (add freetype2 as requirement and delete absolute directories in Cflags):

Requires: pango,freetype2
Libs: -L${libdir} -lpangoft2-1.0
Cflags: -I${includedir}/pango-1.0

 - cd lasi-1.0.6
 - mkdir build
 - cd build
 - cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=z:\DevZone\gtk ..
- mingw32-make install (compiles and install into gtk directory, copy for now the libLASi.dll into bin folder from lib folder)

PLplot enables now the psttf driver and compiles without problems. Example 1 works, example 24 crashes with (I think) a gtk error message:

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Note: Don't forget to copy the liblasi.dll by hand (we should change the cmake files accordingly)
and rename the xmlparse.dll to libexpat.dll.

That's it ;)

This are rather lengthy instructions - I'll maybe put the gtk stuff in the third party package. This will make the package huge - but it's not for the everyday user anyway. The binary packages of plplot need only the dll files (still some Mb!).

Regards,
Werner



--
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
       +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499
diff -Naur lasi-1.0.5p1/CMakeLists.txt lasi-1.0.5p1_cmake/CMakeLists.txt
--- lasi-1.0.5p1/CMakeLists.txt 1969-12-31 16:00:00.000000000 -0800
+++ lasi-1.0.5p1_cmake/CMakeLists.txt   2007-01-14 17:32:54.000000000 -0800
@@ -0,0 +1,81 @@
+# Top-level CMakeLists.txt for libLASi
+###
+### Process this file with cmake to produce Makefile
+###
+
+# Version 2.4.5 or above of cmake is required!
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
+
+project(libLASi)
+
+set(PACKAGE lasi)
+
+# Location where libLASi cmake build system first looks for cmake modules.
+set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
+
+# Version information.
+
+include(lasi_version)
+
+# parameters to control overall cmake behaviour.
+
+# Configure libLASi component variables....
+
+include(lasi)
+
+# Use configured variables to process configurable top-level files.
+
+# Disable warnings about deprecated functions (Visual C++ 2005)
+if(MSVC_VERSION GREATER 1399)
+  ADD_DEFINITIONS("/D_CRT_SECURE_NO_DEPRECATE")
+endif(MSVC_VERSION GREATER 1399)
+
+# in windows all created dlls are gathered in the dll directory
+# if you add this directory to your PATH all shared libraries are available
+if(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)
+  SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll)
+endif(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)
+
+# Borland Compiler must compile in ANSII mode
+if(BORLAND)
+  ADD_DEFINITIONS(-A)
+endif(BORLAND)
+
+configure_file(
+${CMAKE_CURRENT_SOURCE_DIR}/lasi.pc.in
+${CMAKE_CURRENT_BINARY_DIR}/lasi.pc
+)
+install(FILES lasi.pc DESTINATION ${PKG_CONFIG_DIR})
+
+install(FILES include/LASi.h DESTINATION ${includedir})
+
+add_subdirectory(src)
+
+#
+# Packing stuff
+#
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+"The PostScript Complex Text Layout Library, LASi")
+set(CPACK_PACKAGE_VENDOR "Ed Trager <[EMAIL PROTECTED]>")
+set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
+if(WIN32)
+  set(CPACK_GENERATOR ZIP)
+else(WIN32)
+  set(CPACK_GENERATOR TGZ)
+endif(WIN32)
+set(
+CPACK_SOURCE_PACKAGE_FILE_NAME
+"lasi-${VERSION}"
+CACHE INTERNAL "tarball basename"
+)
+set(CPACK_SOURCE_GENERATOR TGZ)
+# The following components are regex's to match anywhere (unless anchored)
+# in absolute path + filename to find files or directories to be excluded
+# from source tarball.
+set(CPACK_SOURCE_IGNORE_FILES
+"~$"
+"\\\\.cvsignore$"
+"^${PROJECT_SOURCE_DIR}.*/CVS/"
+)
+#message("CPACK_SOURCE_IGNORE_FILES = ${CPACK_SOURCE_IGNORE_FILES}")
+include(CPack)
diff -Naur lasi-1.0.5p1/cmake/modules/lasi.cmake 
lasi-1.0.5p1_cmake/cmake/modules/lasi.cmake
--- lasi-1.0.5p1/cmake/modules/lasi.cmake       1969-12-31 16:00:00.000000000 
-0800
+++ lasi-1.0.5p1_cmake/cmake/modules/lasi.cmake 2007-01-14 16:55:17.000000000 
-0800
@@ -0,0 +1,62 @@
+# cmake/modules/lasi.cmake
+# Module for determining all configuration variables for libLASi.
+
+# libraries are all shared by default
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
+# Useful macro for helping to do version tests.  May be needed for future
+# development of CMake build system for libLASi.
+
+macro(TRANSFORM_VERSION _numerical_result _version)
+# _version must be a period-delimited triplet string of the form
+# "major.minor.patch".
+# This macro transforms that into a numerical result that can be compared.
+string(REGEX REPLACE "^(.*)\\..*\\..*$" "\\1" _major ${_version})
+string(REGEX REPLACE "^.*\\.(.*)\\..*$" "\\1" _minor ${_version})
+string(REGEX REPLACE "^.*\\..*\\.(.*)$" "\\1" _patch ${_version})
+math(EXPR ${_numerical_result}
+"${_major}*10000 + ${_minor}*100 + ${_patch}
+")
+endmacro(TRANSFORM_VERSION)
+
+# On windows systems the math library is not separated so do not specify
+# it unless you are on a non-windows system.
+if(NOT WIN32)
+  set(MATH_LIB m)
+endif(NOT WIN32)
+
+# Fundamental install locations (used in, e.g., configured lasi.pc file).
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${prefix})
+set(libdir ${prefix}/lib)
+set(includedir ${prefix}/include)
+
+# =======================================================================
+# pkg-config support
+# =======================================================================
+
+include(pkg-config)
+
+PKGCONFIG(pango  PANGO_INCLUDE_DIR PANGO_LINK_DIR PANGO_LINK_FLAGS
+PANGO_CFLAGS)
+IF(PANGO_INCLUDE_DIR)
+        INCLUDE_DIRECTORIES(${PANGO_INCLUDE_DIR})
+        LINK_DIRECTORIES(${PANGO_LINK_DIR})
+        ADD_DEFINITIONS(${PANGO_CFLAGS})
+ELSE (PANGO_INCLUDE_DIR)
+        MESSAGE(FATAL_ERROR "Pango
+(http://ftp.gnome.org/pub/GNOME/sources/pango/) is required to build
+libLASi.")
+ENDIF(PANGO_INCLUDE_DIR)
+
+PkGCONFIG(pangoft2 PANGOFT2_INCLUDE_DIR PANGOFT2_LINK_DIR
+PANGOFT2_LINK_FLAGS PANGOFT2_CFLAGS)
+IF(PANGOFT2_INCLUDE_DIR)
+        INCLUDE_DIRECTORIES(${PANGOFT2_INCLUDE_DIR})
+        LINK_DIRECTORIES(${PANGOFT2_LINK_DIR})
+        ADD_DEFINITIONS(${PANGOFT2_CFLAGS})
+ELSE (PANGOFT2_INCLUDE_DIR)
+        MESSAGE(FATAL_ERROR "Pangoft2 not found")
+ENDIF(PANGOFT2_INCLUDE_DIR)
+
diff -Naur lasi-1.0.5p1/cmake/modules/lasi_version.cmake 
lasi-1.0.5p1_cmake/cmake/modules/lasi_version.cmake
--- lasi-1.0.5p1/cmake/modules/lasi_version.cmake       1969-12-31 
16:00:00.000000000 -0800
+++ lasi-1.0.5p1_cmake/cmake/modules/lasi_version.cmake 2007-01-14 
18:29:38.000000000 -0800
@@ -0,0 +1,29 @@
+# cmake/modules/lasi_version.cmake
+# Version data that need review and possible modification for each release.
+
+set(VERSION 1.0.5p1)
+
+# CPack version numbers for release tarball name.
+set(CPACK_PACKAGE_VERSION_MAJOR 1)
+set(CPACK_PACKAGE_VERSION_MINOR 0)
+set(CPACK_PACKAGE_VERSION_PATCH 5p1)
+
+#  libLASi version information.
+
+# Rules: 
+# (1) If a backwards incompatible API change has been made in the library
+#     API (e.g., if old compiled and linked applications will no longer work)
+#     then increment SOVERSION and zero the corresponding minor and patch
+#     numbers just before release.
+# (2) If the library changes are limited to additions to the API, then
+#     then leave SOVERSION alone, increment the minor number and zero the
+#     patch number just before release.
+# (3) If the library changes are limited to implementation changes with 
+#     no API changes at all, then leave SOVERSION and minor number alone, and
+#     increment the patch number just before the release.
+# (4) If there are no library source code changes at all, then leave all
+#     library version numbers the same for the release.
+
+set(LASi_SOVERSION 0)
+set(LASi_VERSION ${LASi_SOVERSION}.0.0)
+
diff -Naur lasi-1.0.5p1/cmake/modules/pkg-config.cmake 
lasi-1.0.5p1_cmake/cmake/modules/pkg-config.cmake
--- lasi-1.0.5p1/cmake/modules/pkg-config.cmake 1969-12-31 16:00:00.000000000 
-0800
+++ lasi-1.0.5p1_cmake/cmake/modules/pkg-config.cmake   2007-01-14 
17:35:14.000000000 -0800
@@ -0,0 +1,15 @@
+# cmake/modules/pkg-config.cmake
+
+message(STATUS "Looking for pkg-config")
+# Following line is in UsePkgConfig.cmake so comment it out.
+# find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin)
+# Make PKGCONFIG_EXECUTABLE available as well as the PKGCONFIG macro.
+include(UsePkgConfig)
+
+if(PKGCONFIG_EXECUTABLE)
+  message(STATUS "Looking for pkg-config - found")
+  set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
+else(PKGCONFIG_EXECUTABLE)
+  message(STATUS "Looking for pkg-config - not found")
+  message(FATAL_ERROR "Build of libLASi requires pkg-config.")
+endif(PKGCONFIG_EXECUTABLE)
diff -Naur lasi-1.0.5p1/src/CMakeLists.txt lasi-1.0.5p1_cmake/src/CMakeLists.txt
--- lasi-1.0.5p1/src/CMakeLists.txt     1969-12-31 16:00:00.000000000 -0800
+++ lasi-1.0.5p1_cmake/src/CMakeLists.txt       2007-01-14 17:46:28.000000000 
-0800
@@ -0,0 +1,45 @@
+# src/CMakeLists.txt for libLASi
+###
+### Process this file with cmake to produce Makefile
+###
+
+set(LASi_LIB_SRCS
+drawGlyph.cpp
+glyphMgr.cpp
+psDoc.cpp
+util.cpp
+)
+
+set(LASi_LIB_HDRS
+contextMgr.h
+drawGlyph.h
+glyphMgr.h
+manager.h
+stringDimensions.h
+util.h
+)
+
+include_directories(
+${CMAKE_SOURCE_DIR}/include
+${CMAKE_BINARY_DIR}
+)
+
+add_library(LASi ${LASi_LIB_SRCS} ${LASi_LIB_HDRS})
+
+set(libLASi_LINK_LIBRARIES ${PANGO_LINK_FLAGS} ${PANGOFT2_LINK_FLAGS})
+
+if(MATH_LIB)
+  set(libLASi_LINK_LIBRARIES ${libLASi_LINK_LIBRARIES} ${MATH_LIB})
+endif(MATH_LIB)
+
+target_link_libraries(LASi ${libLASi_LINK_LIBRARIES} )
+
+set_target_properties(
+LASi
+PROPERTIES 
+SOVERSION ${LASi_SOVERSION}
+VERSION ${LASi_VERSION}
+INSTALL_NAME_DIR "${libdir}"
+)
+
+install(TARGETS LASi DESTINATION ${libdir})
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to