Mercurial > hg > octave-lojdl
changeset 9575:55ecaefb7d0f
Use pkg-config to configure GraphicsMagick++.
author | David Grundberg <individ@acc.umu.se> |
---|---|
date | Tue, 25 Aug 2009 14:03:30 +0200 |
parents | 19124db6fc1c |
children | d73c9bd101ef |
files | ChangeLog Makeconf.in configure.in src/ChangeLog src/DLD-FUNCTIONS/__magick_read__.cc src/Makefile.in src/oct-conf.h.in src/toplev.cc |
diffstat | 8 files changed, 93 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -36,6 +36,18 @@ * mkoctfile.cc.in: Fix typo. * octave-bug.cc.in: Correct substututions. +2009-08-25 David Grundberg <individ@acc.umu.se> + + * configure.in: Run PKG_PROG_PKG_CONFIG earlier. Use pkg-config + instead of GraphicsMagick++-config. Determine only -I, -L and -l + flags and put them in MAGICK_CPPFLAGS, MAGICK_LDFLAGS and + MAGICK_LIBS respectively. Substitute these variables. + Remove variables MAGICK_CONFIG and MAGICK_INCFLAGS. + Test linking against GraphicsMagick++. + * Makeconf.in: Don't run $(MAGICK_CONFIG) here. Use substituted + valued from MAGICK_CPPFLAGS, MAGICK_LDFLAGS and MAGICK_LIBS. + Remove variables MAGICK_CONFIG and MAGICK_INCFLAGS. + 2009-08-24 Jaroslav Hajek <highegg@gmail.com> * acx_blas_f77_func.m4: Fix typo.
--- a/Makeconf.in +++ b/Makeconf.in @@ -151,9 +151,9 @@ CARBON_LIBS = @CARBON_LIBS@ -MAGICK_CONFIG = @MAGICK_CONFIG@ -MAGICK_INCFLAGS = $(shell $(MAGICK_CONFIG) --cppflags) -MAGICK_LIBS = $(shell $(MAGICK_CONFIG) --libs) +MAGICK_CPPFLAGS = @MAGICK_CPPFLAGS@ +MAGICK_LDFLAGS = @MAGICK_LDFLAGS@ +MAGICK_LIBS = @MAGICK_LIBS@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ @@ -645,7 +645,8 @@ -e "s|%OCTAVE_CONF_LIBOCTINTERP%|\"${LIBOCTINTERP}\"|" \ -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \ -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \ - -e "s|%OCTAVE_CONF_MAGICK_INCFLAGS%|\"${MAGICK_INCFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \ -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"@MKOCTFILE_DL_LDFLAGS@\"|' \ -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
--- a/configure.in +++ b/configure.in @@ -113,6 +113,10 @@ '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') +### Find pkg-config executable (sets $PKG_CONFIG) + +PKG_PROG_PKG_CONFIG + ### Make configure args available for other uses. config_opts=$ac_configure_args @@ -562,15 +566,56 @@ LIBS="$save_LIBS" CPPFLAGS="$save_CPPFLAGS" -# GraphicsMagick++ +### GraphicsMagick++ + +warn_magick="GraphicsMagick++ library not found. The imread function for reading image files will not be fully functional." + +MAGICK_CPPFLAGS= +MAGICK_LDFLAGS= +MAGICK_LIBS= + +PKG_CHECK_EXISTS([GraphicsMagick++], [ + ## Make sure we only get -I, -L and -l flags. Some GraphicsMagick++ + ## packages adds extra flags that are useful when building + ## GraphicsMagick++ extentions. These extra flags break the Octave build. + MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L GraphicsMagick++` + MAGICK_LIBS=`$PKG_CONFIG --libs-only-l GraphicsMagick++` + MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I GraphicsMagick++` + + warn_magick="GraphicsMagick++ library fails tests. The imread function for reading image files will not be fully functional." -warn_magick= -AC_CHECK_PROGS(MAGICK_CONFIG, [GraphicsMagick++-config GraphicsMagick-config]) -if test -z "$MAGICK_CONFIG"; then - warn_magick="GraphicsMagick++ config script not found. Assuming GraphicsMagic++ library and header files are missing, so imread will not be fully functional" + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS" + LDFLAGS="$LIBS $MAGICK_LDFLAGS" + LIBS="$LIBS $MAGICK_LIBS" + AC_LANG_PUSH(C++) + AC_CHECK_HEADER([Magick++.h], [ + AC_MSG_CHECKING([for Magick::ColorRGB in Magick++.h]) + AC_TRY_LINK([#include <Magick++.h>], [Magick::ColorRGB c;], [ + AC_MSG_RESULT(yes) + warn_magick= + ], [ + AC_MSG_RESULT(no) + ]) + ]) + AC_LANG_POP(C++) + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" +]) + +if test -z "$warn_magick"; then + AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.]) else - AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.]) + MAGICK_CPPFLAGS= + MAGICK_LDFLAGS= + MAGICK_LIBS= fi +AC_SUBST(MAGICK_CPPFLAGS) +AC_SUBST(MAGICK_LDFLAGS) +AC_SUBST(MAGICK_LIBS) # --------------------------------------------------------------------- @@ -642,7 +687,6 @@ # fontconfig library warn_fontconfig="" -PKG_PROG_PKG_CONFIG if test -z "$warn_freetype"; then PKG_CHECK_MODULES(FONTCONFIG,[fontconfig],[ have_fontconfig=yes @@ -2024,6 +2068,10 @@ GLPK CPPFLAGS: $GLPK_CPPFLAGS GLPK LDFLAGS: $GLPK_LDFLAGS GLPK libraries: $GLPK_LIBS + GraphicsMagick++ + CPPFLAGS: $MAGICK_CPPFLAGS + LDFLAGS: $MAGICK_LDFLAGS + libraries: $MAGICK_LIBS HDF5 CPPFLAGS: $HDF5_CPPFLAGS HDF5 LDFLAGS: $HDF5_LDFLAGS HDF5 libraries: $HDF5_LIBS @@ -2046,7 +2094,6 @@ Default pager: $DEFAULT_PAGER gnuplot: $GNUPLOT - Magick config: $MAGICK_CONFIG Do internal array bounds checking: $BOUNDS_CHECKING Build static libraries: $STATIC_LIBS
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2009-08-25 David Grundberg <individ@acc.umu.se> + + * DLD-FUNCTIONS/__magick_read__.cc [HAVE_MAGICK]: Include + Magick++.h instead of GraphicsMagick/Magic++.h. + * Makefile.in: Replace MAGICK_LIBS with MAGICK_LDFLAGS and + MAGICK_LIBS. Replace MAGICK_INCFLAGS with MAGICK_CPPFLAGS. + * oct-conf.h.in: Ditto. + * toplev.cc (octave_config_info): Ditto. + 2009-08-26 John W. Eaton <jwe@octave.org> * oct-conf.h.in: New defines for UMFPACK_CPPFLAGS and UMFPACK_LDFLAGS.
--- a/src/DLD-FUNCTIONS/__magick_read__.cc +++ b/src/DLD-FUNCTIONS/__magick_read__.cc @@ -33,7 +33,7 @@ #ifdef HAVE_MAGICK -#include <GraphicsMagick/Magick++.h> +#include <Magick++.h> unsigned int scale_quantum_to_depth (const Magick::Quantum& quantum, unsigned int depth)
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -314,7 +314,7 @@ $(REGEX_LDFLAGS) $(REGEX_LIBS) \ $(CURL_LDFLAGS) $(CURL_LIBS) \ $(GLPK_LDFLAGS) $(GLPK_LIBS) \ - $(MAGICK_LIBS) \ + $(MAGICK_LDFLAGS) $(MAGICK_LIBS) \ $(GRAPHICS_LDFLAGS) $(GRAPHICS_LIBS) \ $(FT2_LDFLAGS) $(FT2_LIBS) \ $(HDF5_LDFLAGS) $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ @@ -685,8 +685,8 @@ display.d display.df display.o pic/display.o: CPPFLAGS += $(X11_FLAGS) __magick_read__.d __magick_read__.df __magick_read__.o pic/__magick_read__.o: \ - CPPFLAGS += $(MAGICK_INCFLAGS) -__magick_read__.oct: OCT_LINK_DEPS += $(MAGICK_LIBS) + CPPFLAGS += $(MAGICK_CPPFLAGS) +__magick_read__.oct: OCT_LINK_DEPS += $(MAGICK_LDFLAGS) $(MAGICK_LIBS) convhull.d convhull.df convhull.o pic/convhull.o: CPPFLAGS += $(QHULL_CPPFLAGS) convhulln.oct: OCT_LINK_DEPS += $(QHULL_LDFLAGS) $(QHULL_LIBS)
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -365,8 +365,12 @@ #define OCTAVE_CONF_LN_S %OCTAVE_CONF_LN_S% #endif -#ifndef OCTAVE_CONF_MAGICK_INCFLAGS -#define OCTAVE_CONF_MAGICK_INCFLAGS %OCTAVE_CONF_MAGICK_INCFLAGS% +#ifndef OCTAVE_CONF_MAGICK_CPPFLAGS +#define OCTAVE_CONF_MAGICK_CPPFLAGS %OCTAVE_CONF_MAGICK_CPPFLAGS% +#endif + +#ifndef OCTAVE_CONF_MAGICK_LDFLAGS +#define OCTAVE_CONF_MAGICK_LDFLAGS %OCTAVE_CONF_MAGICK_LDFLAGS% #endif #ifndef OCTAVE_CONF_MAGICK_LIBS
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -1275,7 +1275,8 @@ { false, "LIBOCTINTERP", OCTAVE_CONF_LIBOCTINTERP }, { false, "LIBS", OCTAVE_CONF_LIBS }, { false, "LN_S", OCTAVE_CONF_LN_S }, - { false, "MAGICK_INCFLAGS", OCTAVE_CONF_MAGICK_INCFLAGS }, + { false, "MAGICK_CPPFLAGS", OCTAVE_CONF_MAGICK_CPPFLAGS }, + { false, "MAGICK_LDFLAGS", OCTAVE_CONF_MAGICK_LDFLAGS }, { false, "MAGICK_LIBS", OCTAVE_CONF_MAGICK_LIBS }, { false, "MKOCTFILE_DL_LDFLAGS", OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS }, { false, "OPENGL_LIBS", OCTAVE_CONF_OPENGL_LIBS },