--- gmic-1.6.0.1/src/Makefile.orig 2014-11-17 20:44:08.008787505 +0200 +++ gmic-1.6.0.1/src/Makefile 2014-11-17 20:57:59.015269525 +0200 @@ -98,22 +98,22 @@ endif # Flags to enable debugging. -DEBUG_CFLAGS = -Dcimg_verbosity=3 -g +DEBUG_CFLAGS = -Dcimg_verbosity=3 # Flags to enable optimizations. -ifeq ($(CC),g++) -ifeq ($(OS),Darwin) -OPT_CFLAGS = -O2 -mtune=generic -else -OPT_CFLAGS = -O2 -fno-ipa-sra -mtune=generic -endif -else -ifeq ($(CC),icpc) -OPT_CFLAGS = -fast -else -OPT_CFLAGS = -O2 -endif -endif +#ifeq ($(CC),g++) +#ifeq ($(OS),Darwin) +#OPT_CFLAGS = -O2 -mtune=generic +#else +#OPT_CFLAGS = -O2 -fno-ipa-sra -mtune=generic +#endif +#else +#ifeq ($(CC),icpc) +#OPT_CFLAGS = -fast +#else +#OPT_CFLAGS = -O2 +#endif +#endif # Flags to enable parallel processing. ifneq ($(OS),Darwin) @@ -136,14 +136,14 @@ # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). # This requires the presence of the X11 include and library files. # (package 'libx11-dev' on Debian). -X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr -X11_LIBS = -L/usr/X11R6/lib -lX11 -lpthread #-lXrandr +X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" #-Dcimg_use_xrandr +X11_LIBS = `pkg-config x11 --libs` # Flags to enable fast display, using XShm. # This requires the presence of the X11 extension include and library files. # (package 'libx11-dev' on Debian). XSHM_CFLAGS = -Dcimg_use_xshm -XSHM_LIBS = -L$(USR)/X11R6/lib -lXext +XSHM_LIBS = `pkg-config xext --libs` # Flags to enable image display, using GDI32. # This requires the presence of the GDI32 include and library files. @@ -154,7 +154,7 @@ # This requires the presence of the libpng include and library files. # (package 'libpng12-dev' on Debian). PNG_CFLAGS = -Dcimg_use_png -PNG_LIBS = -lpng -lz +PNG_LIBS = `pkg-config libpng --libs` # Flags to enable native support for JPEG image files, using the JPEG library. # This requires the presence of the libjpeg include and library files. @@ -166,7 +166,7 @@ # This requires the presence of the libtiff include and library files. # (package 'libtiff4-dev' on Debian). TIFF_CFLAGS = -Dcimg_use_tiff -TIFF_LIBS = -ltiff +TIFF_LIBS = `pkg-config libtiff-4 --libs` # Flags to enable native support for MINC2 image files, using the MINC2 library. # ( http://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_Users_Guide ) @@ -178,25 +178,19 @@ # This requires the presence of the FFMPEG include and library files. # (packages 'libavcodec-dev', 'libavutil-dev', 'libavformat-dev' and 'libswscale-dev' on Debian). 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 -FFMPEG_LIBS = -lavcodec -lavformat -lswscale +FFMPEG_LIBS = `pkg-config libavcodec libavformat libswscale --libs` # Flags to enable native support for compressed .cimgz files, using the Zlib library. # This requires the presence of the Zlib include and library files. # (package 'zlib1g-dev' on Debian). ZLIB_CFLAGS = -Dcimg_use_zlib -ZLIB_LIBS = -lz +ZLIB_LIBS = `pkg-config zlib --libs` # Flags to enable native support of webcams, using the OpenCV library. # This requires the presence of the OpenCV include and library files. # (package 'libcv3-2-dev' on Debian). -ifeq ($(OS),Darwin) OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/$(INCLUDE) -I$(USR)/$(INCLUDE)/opencv OPENCV_LIBS = `pkg-config opencv --libs` #-> Use this for OpenCV 2.2.0 ! -else -OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/$(INCLUDE) -I$(USR)/$(INCLUDE)/opencv -# OPENCV_LIBS = -lcv -lhighgui -OPENCV_LIBS = -lopencv_core -lopencv_highgui #-> Use this for OpenCV >= 2.2.0 ! -endif # Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library. # This requires the presence of the GraphicsMagick++ include and library files. @@ -205,20 +199,20 @@ ifeq ($(OS),Darwin) MAGICK_LIBS = -L$(USR)/$(LIB) -lGraphicsMagick++ -lGraphicsMagick -llcms -ltiff -lfreetype -ljpeg -lpng -lbz2 -lxml2 -lz -lm -lltdl else -MAGICK_LIBS = -lGraphicsMagick++ +MAGICK_LIBS = `pkg-config GraphicsMagick++ --libs` endif # Flags to enable native support of EXR file format, using the OpenEXR library/ # This requires the presence of the OpenEXR include and library files. # (package 'libopenexr-dev' on Debian). EXR_CFLAGS = -Dcimg_use_openexr -I$(USR)/$(INCLUDE)/OpenEXR -EXR_LIBS = -lIlmImf -lHalf +EXR_LIBS = `pkg-config OpenEXR --libs` # Flags to enable the use of the FFTW3 library. # This requires the presence of the FFTW3 include and library files. # (package 'libfftw3-dev' on Debian). FFTW_CFLAGS = -Dcimg_use_fftw3 -FFTW_LIBS = -lfftw3 -lfftw3_threads +FFTW_LIBS = `pkg-config fftw3 --libs` -lfftw3_threads ifeq ($(OSTYPE),msys) FFTW_LIBS = -lfftw3-3 endif @@ -327,21 +321,21 @@ endif gimp: - $(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_GIMP_LIBS) $(OPT_LIBS)" "STRIP_EXE=1" gmic_gimp + $(MAKE) "CFLAGS+=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_GIMP_LIBS) $(OPT_LIBS)" gmic_gimp lib: - $(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_LIB_LIBS) $(OPT_LIBS)" gmic_lib + $(MAKE) "CFLAGS+=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_LIB_LIBS) $(OPT_LIBS)" gmic_lib zart: lib ifneq ($(OS),Darwin) - cd ../zart && qmake-qt4 zart.pro && $(MAKE) && strip zart + cd ../zart && qmake-qt4 zart.pro && $(MAKE) else cd ../zart && qmake zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "SUBLIBS=$(STD_MACOSX_LIBS) $(OPT_LIBS)" endif # Entries for other configurations. linux: - $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS=$(STD_UNIX_LIBS)" "STRIP_EXE=1" gmic + $(MAKE) "CFLAGS+=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_UNIX_LIBS)" gmic solaris: $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS=$(STD_UNIX_LIBS) -R$(USR)/X11R6/lib -lrt -lnsl -lsocket" "STRIP_EXE=1" gmic @@ -371,7 +365,6 @@ ar rcs libgmic.a gmic_lib.o ifneq ($(OS),Darwin) $(CC) -shared -Wl,-soname,libgmic.so.1 -o libgmic.so gmic_lib.o $(LIBS) - $(CC) -o gmic_use_lib gmic_use_lib.cpp -L. -lgmic $(FFTW_LIBS) else $(CC) -shared -o libgmic.so gmic_lib.o $(LIBS) endif @@ -379,8 +372,7 @@ gmic_gimp.o: gmic.cpp CImg.h $(CC) -o gmic_gimp.o -c gmic.cpp $(CFLAGS) -Dgmic_gimp gmic_gimp : gmic_gimp.o gmic_gimp.cpp - $(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) `gimptool-2.0$(EXE) --libs` $(LIBS) - strip gmic_gimp$(EXE) + $(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) $(LIBS) `gimptool-2.0$(EXE) --libs` gmic: gmic.cpp gmic.h CImg.h $(CC) -o gmic gmic.cpp $(CFLAGS) -Dgmic_main $(LIBS)