--- examples/Makefile.orig 2016-03-24 12:00:28 UTC +++ examples/Makefile @@ -85,7 +85,7 @@ CIMG_EXTRA_FILES = use_tiff_stream use_j # Set correct variables and paths #--------------------------------- CIMG_VERSION = _cimg_version -X11PATH = /usr/X11R6 +X11PATH = $(LOCALBASE) EXEPFX = ifeq ($(MSYSTEM),MINGW32) EXESFX = .exe @@ -104,7 +104,7 @@ CXXVER = "icpc \( `$(CXX) -v 2>&1` CFLAGS = -I.. LIBS = else -CFLAGS = -I.. -Wall -W +CFLAGS = -I.. -Wall -W $(CPPFLAGS) LIBS = -lm endif @@ -128,7 +128,7 @@ CIMG_VT100_CFLAGS = -Dcimg_use_vt100 # Flags to enable code optimization by the compiler. ifeq ($(notdir $(CXX)),g++) -CIMG_OPT_CFLAGS = -O2 -mtune=generic +CIMG_OPT_CFLAGS = -mtune=generic else ifeq ($(notdir $(CXX)),icpc) CIMG_OPT_CFLAGS = -fast @@ -148,7 +148,7 @@ endif # Flags to enable OpenCV support. CIMG_OPENCV_DEFINE = -Dcimg_use_opencv -CIMG_OPENCV_INCDIR = `pkg-config opencv --cflags || echo -I/usr/include/opencv` -I/usr/include/opencv +CIMG_OPENCV_INCDIR = `pkg-config opencv --cflags || echo -I$(LOCALBASE)/include/opencv` -I$(LOCALBASE)/include/opencv CIMG_OPENCV_CFLAGS = $(CIMG_OPENCV_DEFINE) $(CIMG_OPENCV_INCDIR) CIMG_OPENCV_LIBS = `pkg-config opencv --libs || echo -lopencv_core -lopencv_highgui` @@ -160,7 +160,7 @@ CIMG_NODISPLAY_CFLAGS = -Dcimg_display=0 CIMG_X11_DEFINE = -Dcimg_display=1 CIMG_X11_INCDIR = `pkg-config --cflags x11 || echo -I/usr/X11R6/include` CIMG_X11_CFLAGS = $(CIMG_X11_DEFINE) $(CIMG_X11_INCDIR) -CIMG_X11_LIBS = `pkg-config --libs x11 || echo -L/usr/X11R6/lib -lX11` -lpthread +CIMG_X11_LIBS = `pkg-config --libs x11 || echo -L$(LOCALBASE)/X11R6/lib -lX11` -lpthread # 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 !!! @@ -200,7 +200,7 @@ CIMG_JPEG_LIBS = -ljpeg CIMG_TIFF_DEFINE = -Dcimg_use_tiff CIMG_TIFF_INCDIR = CIMG_TIFF_CFLAGS = $(CIMG_TIFF_DEFINE) $(CIMG_TIFF_INCDIR) -CIMG_TIFF_LIBS = -ltiff +CIMG_TIFF_LIBS = -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 ) @@ -212,14 +212,14 @@ CIMG_MINC2_LIBS = -lminc_io -lvolume_io2 # Flags to enable native support for EXR image files, using the OpenEXR library. # ( http://www.openexr.com/ ) CIMG_EXR_DEFINE = -Dcimg_use_openexr -CIMG_EXR_INCDIR = -I/usr/include/OpenEXR +CIMG_EXR_INCDIR = -I$(LOCALBASE)/include/OpenEXR CIMG_EXR_CFLAGS = $(CIMG_EXR_DEFINE) $(CIMG_EXR_INCDIR) CIMG_EXR_LIBS = -lIlmImf -lHalf # Flags to enable native support for various video files, using the FFMPEG library. # ( http://www.ffmpeg.org/ ) CIMG_FFMPEG_DEFINE = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -CIMG_FFMPEG_INCDIR = -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/include/ffmpeg +CIMG_FFMPEG_INCDIR = -I$(LOCALBASE)/include/libavcodec -I$(LOCALBASE)/include/libavformat -I$(LOCALBASE)/include/libswscale -I$(LOCALBASE)/include/ffmpeg CIMG_FFMPEG_CFLAGS = $(CIMG_FFMPEG_DEFINE) $(CIMG_FFMPEG_INCDIR) CIMG_FFMPEG_LIBS = -lavcodec -lavformat -lswscale @@ -237,10 +237,10 @@ CIMG_CURL_INCDIR = CIMG_CURL_CFLAGS = $(CIMG_CURL_DEFINE) CIMG_CURL_LIBS = -lcurl -# Flags to enable native support of most classical image file formats, using the Magick++ library. +# Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library. # ( http://www.imagemagick.org/Magick++/ ) CIMG_MAGICK_DEFINE = -Dcimg_use_magick -CIMG_MAGICK_INCDIR = `pkg-config --cflags GraphicsMagick++ || echo -I$(USR)/$(INCLUDE)/GraphicsMagick` +CIMG_MAGICK_INCDIR = `pkg-config --cflags GraphicsMagick++ || echo -I$(LOCALBASE)/$(INCLUDE)/GraphicsMagick` CIMG_MAGICK_CFLAGS = $(CIMG_MAGICK_DEFINE) $(CIMG_MAGICK_INCDIR) CIMG_MAGICK_LIBS = `pkg-config --libs GraphicsMagick++ || echo -lGraphicsMagick++` @@ -259,16 +259,19 @@ endif # ( http://www.netlib.org/lapack/ ) CIMG_LAPACK_DEFINE = -Dcimg_use_lapack CIMG_LAPACK_INCDIR = -CIMG_LAPACK_CFLAGS = $(CIMG_LAPACK_DEFINE) $(CIMG_LAPACK_INCDIR) -CIMG_LAPACK_LIBS = -lblas -llapack +#CIMG_LAPACK_CFLAGS = $(CIMG_LAPACK_DEFINE) $(CIMG_LAPACK_INCDIR) +#CIMG_LAPACK_LIBS = -lblas -llapack # Flags to enable the use of the Board library # ( http://libboard.sourceforge.net/ ) CIMG_BOARD_DEFINE = -Dcimg_use_board -CIMG_BOARD_INCDIR = -I/usr/include/board +CIMG_BOARD_INCDIR = -I$(LOCALBASE)/include/board CIMG_BOARD_CFLAGS = $(CIMG_BOARD_DEFINE) $(CIMG_BOARD_INCDIR) CIMG_BOARD_LIBS = -lboard +# Flags to compile on FreeBSD +CIMG_FREEBSD_LDFLAGS = $(LDFLAGS) -ansi -ffast-math -I$(X11PATH)/include $(EXTRA_FLAGS) -lX11 -L$(X11PATH)/lib + # Flags to compile on Sun Solaris CIMG_SOLARIS_LIBS = -R$(X11PATH)/lib -lrt -lnsl -lsocket @@ -343,7 +346,8 @@ $(CIMG_XSHM_CFLAGS)" \ $(CIMG_X11_LIBS) \ $(CIMG_TIFF_LIBS) \ $(CIMG_LAPACK_LIBS) \ -$(CIMG_XSHM_LIBS)" \ +$(CIMG_XSHM_LIBS) \ +$(PTHREAD_LIBS)" \ all $(CIMG_EXTRA_FILES) # Linux/BSD/Mac OSX targets, with X11 display. @@ -412,8 +416,10 @@ $(CIMG_ZLIB_CFLAGS) \ $(CIMG_CURL_CFLAGS) \ $(CIMG_OPENCV_CFLAGS) \ $(CIMG_MAGICK_CFLAGS) \ +$(CIMG_LAPACK_CFLAGS) \ $(CIMG_FFTW3_CFLAGS)" \ "CONF_LIBS = \ +$(CIMG_FREEBSD_LDFLAGS) \ $(CIMG_X11_LIBS) \ $(CIMG_XSHM_LIBS) \ $(CIMG_XRANDR_LIBS) \ @@ -425,6 +431,7 @@ $(CIMG_ZLIB_LIBS) \ $(CIMG_CURL_LIBS) \ $(CIMG_OPENCV_LIBS) \ $(CIMG_MAGICK_LIBS) \ +$(CIMG_LAPACK_LIBS) \ $(CIMG_FFTW3_LIBS)" \ "STRIP_EXE=true" \ all $(CIMG_EXTRA_FILES)