--- gmic-1.6.0.1/src/Makefile 2014-10-03 10:44:38.000000000 +0200 +++ gmic-1.6.0.1/src/Makefile 2014-11-18 20:35:17.919796624 +0100 @@ -81,10 +81,9 @@ # Flags that are mandatory to compile 'gmic'. MANDATORY_CFLAGS += -std=c++11 -Dgmic_build -I$(USR)/$(INCLUDE) -MANDATORY_LIBS += -L$(USR)/$(LIB) ifeq ($(CC),g++) MANDATORY_CFLAGS += -Wall -W -MANDATORY_LIBS += -lm +MANDATORY_LIBS = -lm endif MANDATORY_CFLAGS += $(IS_BETA_CFLAGS) ifeq ($(OS),Unix) @@ -136,14 +135,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 = -lX11 -lpthread #-lXrandr # 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 = -lXext # Flags to enable image display, using GDI32. # This requires the presence of the GDI32 include and library files. @@ -178,7 +177,7 @@ # 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 = -lavcodec -lavformat -lavutil -lswscale # Flags to enable native support for compressed .cimgz files, using the Zlib library. # This requires the presence of the Zlib include and library files. @@ -189,14 +188,7 @@ # 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. @@ -368,22 +360,21 @@ gmic_lib.o: gmic.cpp $(CC) -o gmic_lib.o -c gmic.cpp -fPIC $(CFLAGS) gmic_lib: gmic_lib.o - ar rcs libgmic.a gmic_lib.o + $(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) $(LDFLAGS) -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) + $(CC) $(LDFLAGS) -shared -o libgmic.so gmic_lib.o $(LIBS) endif 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) `gimptool-2.0$(EXE) --cflags` $(CFLAGS) $(LDFLAGS) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --libs` $(LIBS) gmic: gmic.cpp gmic.h CImg.h - $(CC) -o gmic gmic.cpp $(CFLAGS) -Dgmic_main $(LIBS) + $(CC) $(CFLAGS) -Dgmic_main $(LDFLAGS) -o gmic gmic.cpp $(LIBS) gmic_def.h: gmic_def.gmic @echo "#ifndef gmic_gimp" > gmic_def.h