--- examples/Makefile.orig 2014-07-03 12:15:02.000000000 +0200 +++ examples/Makefile 2014-07-04 18:54:56.000000000 +0200 @@ -85,8 +85,8 @@ # Set correct variables and paths #--------------------------------- CIMG_VERSION = 1.5.9 -X11PATH = /usr/X11R6 -CC = g++ +#X11PATH = $(X11PATH) +CC = $(CXX) EXEPFX = CCVER = $(CC) ifeq ($(CC),g++) @@ -100,8 +100,8 @@ CFLAGS = -I.. LDFLAGS = else -CFLAGS = -I.. -Wall -W -LDFLAGS = -lm +CFLAGS = -I.. -Wall -W $(CPPFLAGS) +LDFLAGS += -lm endif #-------------------------------------------------- @@ -127,9 +127,9 @@ CIMG_OPT_CFLAGS = -O3 -ipo -no-prec-div else ifeq ($(CC),g++) -CIMG_OPT_CFLAGS = -O3 -fno-tree-pre +CIMG_OPT_CFLAGS = else -CIMG_OPT_CFLAGS = -O3 +CIMG_OPT_CFLAGS = endif endif @@ -141,7 +141,7 @@ endif # Flags to enable OpenCV support. -CIMG_OPENCV_CFLAGS = -Dcimg_use_opencv -I/usr/include/opencv +CIMG_OPENCV_CFLAGS = -Dcimg_use_opencv -I$(LOCALBASE)/include/opencv CIMG_OPENCV_LDFLAGS = -lopencv_core -lopencv_highgui #CIMG_OPENCV_LDFLAGS = -lcv -lhighgui #-> Use this for OpenCV < 2.2.0 @@ -152,7 +152,7 @@ # (X11 is used by CImg to handle display windows) # !!! For 64bits systems : replace -L$(X11PATH)/lib by -L$(X11PATH)/lib64 !!! CIMG_X11_CFLAGS = -I$(X11PATH)/include -CIMG_X11_LDFLAGS = -L$(X11PATH)/lib -lpthread -lX11 +CIMG_X11_LDFLAGS = -L$(X11PATH)/lib -lX11 $(PTHREAD_LIBS) # Flags to enable fast image display, using the XSHM library (when using X11). # !!! Seems to randomly crash when used on MacOSX and 64bits systems, so use it only when necessary !!! @@ -182,7 +182,7 @@ # Flags to enable native support for TIFF image files, using the TIFF library. # ( http://www.libtiff.org/ ) CIMG_TIFF_CFLAGS = -Dcimg_use_tiff -CIMG_TIFF_LDFLAGS = -ltiff +CIMG_TIFF_LDFLAGS = -ltiff -ltiffxx # Flags to enable native support for MINC2 image files, using the MINC2 library. # ( http://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_Users_Guide ) @@ -191,12 +191,12 @@ # Flags to enable native support for EXR image files, using the OpenEXR library. # ( http://www.openexr.com/ ) -CIMG_EXR_CFLAGS = -Dcimg_use_openexr -I/usr/include/OpenEXR +CIMG_EXR_CFLAGS = -Dcimg_use_openexr -I/$(LOCALBASE)/include/OpenEXR CIMG_EXR_LDFLAGS = -lIlmImf -lHalf # Flags to enable native support for various video files, using the FFMPEG library. # ( http://www.ffmpeg.org/ ) -CIMG_FFMPEG_CFLAGS = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/include/ffmpeg +CIMG_FFMPEG_CFLAGS = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I$(LOCALBASE)/include/libavcodec -I$(LOCALBASE)/include/libavformat -I$(LOCALBASE)/include/libswscale -I$(LOCALBASE)/include/ffmpeg CIMG_FFMPEG_LDFLAGS = -lavcodec -lavformat -lswscale # Flags to enable native support for compressed .cimgz files, using the Zlib library. @@ -206,8 +206,8 @@ # Flags to enable native support of most classical image file formats, using the Magick++ library. # ( http://www.imagemagick.org/Magick++/ ) -CIMG_MAGICK_CFLAGS = -Dcimg_use_magick `Magick++-config --cppflags` `Magick++-config --cxxflags` -CIMG_MAGICK_LDFLAGS = `Magick++-config --ldflags` `Magick++-config --libs` +CIMG_MAGICK_CFLAGS = -Dcimg_use_magick `GraphicsMagick++-config --cppflags` `GraphicsMagick++-config --cxxflags` +CIMG_MAGICK_LDFLAGS = `GraphicsMagick++-config --ldflags` `GraphicsMagick++-config --libs` # Flags to enable faster Discrete Fourier Transform computation, using the FFTW3 library # ( http://www.fftw.org/ ) @@ -220,14 +220,17 @@ # Flags to enable the use of LAPACK routines for matrix computation # ( http://www.netlib.org/lapack/ ) -CIMG_LAPACK_CFLAGS = -Dcimg_use_lapack -CIMG_LAPACK_LDFLAGS = -lblas -lg2c -llapack +#CIMG_LAPACK_CFLAGS = -Dcimg_use_lapack +#CIMG_LAPACK_LDFLAGS = -lblas -llapack # Flags to enable the use of the Board library # ( http://libboard.sourceforge.net/ ) -CIMG_BOARD_CFLAGS = -Dcimg_use_board -I/usr/include/board +CIMG_BOARD_CFLAGS = -Dcimg_use_board -I$(LOCALBASE)/include/board CIMG_BOARD_LDFLAGS = -lboard +# Flags to compile on FreeBSD +CIMG_FREEBSD_LDFLAGS = -ansi -ffast-math -I$(X11PATH)/include $(EXTRA_FLAGS) -lX11 -L$(X11PATH)/lib + # Flags to compile on Sun Solaris CIMG_SOLARIS_LDFLAGS = -R$(X11PATH)/lib -lrt -lnsl -lsocket @@ -372,6 +375,7 @@ $(CIMG_ZLIB_CFLAGS) \ $(CIMG_OPENCV_CFLAGS) \ $(CIMG_MAGICK_CFLAGS) \ +$(CIMG_LAPACK_CFLAGS) \ $(CIMG_FFTW3_CFLAGS)" \ "CONF_LDFLAGS = \ $(CIMG_X11_LDFLAGS) \ @@ -382,6 +386,7 @@ $(CIMG_PNG_LDFLAGS) \ $(CIMG_JPEG_LDFLAGS) \ $(CIMG_ZLIB_LDFLAGS) \ +$(CIMG_LAPACK_LDFLAGS) \ $(CIMG_OPENCV_LDFLAGS) \ $(CIMG_MAGICK_LDFLAGS) \ $(CIMG_FFTW3_LDFLAGS)" \