Skip to content

Commit 5c107f3

Browse files
committed
irteus: cleanup Makfile, check if JPEG/PQP installed
1 parent 7b19e3b commit 5c107f3

File tree

6 files changed

+50
-10
lines changed

6 files changed

+50
-10
lines changed

irteus/Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
### ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242
###
4343

44-
include ./Makefile.$(ARCHDIR)
45-
4644
# directory where this package install object file to
4745
IRTEUSDIR=$(EUSDIR)
4846
INSTALLBINDIR=$(IRTEUSDIR)/$(ARCHDIR)/bin
@@ -69,6 +67,14 @@ else
6967
endif
7068
$(info "-- HAVE_PQP = ${HAVE_PQP}")
7169

70+
71+
HAVE_JPEG=$(shell echo "\#include <stdio.h>\n\#include \"jpeglib.h\"\n\#include \"jconfig.h\"\n" > test-jpeg.c; $(CC) -c test-jpeg.c 2>&1 > /dev/null && echo 1 || echo 0)
72+
$(info "-- HAVE_JPEG = ${HAVE_JPEG}")
73+
HAVE_PNG=$(shell echo "\#include <png.h>\n" > test-png.c; $(CC) -c test-png.c 2>&1 > /dev/null && echo 1 || echo 0)
74+
$(info "-- HAVE_PNG = ${HAVE_PNG}")
75+
76+
include ./Makefile.$(ARCHDIR)
77+
7278
# common
7379
WFLAGS= #-Wall
7480

@@ -94,7 +100,14 @@ EUSLIB_MODULES.L=$(addprefix $(EUSDIR)/lib/,$(MODULES.L))
94100
IRTEUS=irtmath irtutil irtgraph gnuplotlib pgsql time
95101
IRTEUSG=irtgeo pqp bullet irtcollision irtscene irtmodel irtsensor irtdyna irtrobot irtbvh irtcollada irtpointcloud irtstl irtwrl
96102
IRTEUSX=irtx
97-
IRTEUSIMG=irtimage eusjpeg png
103+
IRTEUSIMG=irtimage
104+
ifeq ($(HAVE_JPEG), 1)
105+
IRTEUSIMG+=eusjpeg
106+
JPEGMEMCD=$(INSTALLLIBDIR)/jpegmemcd.$(LSFX)
107+
endif
108+
ifeq ($(HAVE_PNG), 1)
109+
IRTEUSIMG+=png
110+
endif
98111
IRTEUSGL=irtgl irtglrgb irtviewer
99112
NR=nr
100113

@@ -149,7 +162,9 @@ IRTEUSGL_L=$(addsuffix .l,$(IRTEUSGL))
149162

150163
IRTCOBJECTS=$(INSTALLOBJDIR)/irtc.$(OSFX) $(INSTALLOBJDIR)/irtgeoc.$(OSFX)
151164
IRTGCOBJECTS=$(INSTALLOBJDIR)/CPQP.$(OSFX) $(INSTALLOBJDIR)/euspqp.$(OSFX) $(INSTALLOBJDIR)/CBULLET.$(OSFX) $(INSTALLOBJDIR)/eusbullet.$(OSFX)
152-
IRTIMGCOBJECTS=$(INSTALLOBJDIR)/euspng.$(OSFX)
165+
ifeq ($(HAVE_PNG), 1)
166+
IRTIMGCOBJECTS=$(INSTALLOBJDIR)/euspng.$(OSFX)
167+
endif
153168
IRTGLCOBJECTS=$(INSTALLOBJDIR)/irtglc.$(OSFX)
154169
NROBJECTS=$(INSTALLOBJDIR)/nr.$(OSFX)
155170

@@ -177,7 +192,7 @@ $(LIBIRTEUSG): $(IRTEUSGOBJS) $(IRTGCOBJECTS) $(LIBNR) $(PQPLIBSTATIC)
177192
$(LIBIRTEUSX): $(IRTEUSXOBJS) $(LIBNR)
178193
$(CXX) $(SOFLAGS) $(OUTOPT)$(LIBIRTEUSX) $(IRTEUSXOBJS) $(IMPLIB)
179194

180-
$(LIBIRTEUSIMG): $(INSTALLLIBDIR)/jpegmemcd.$(LSFX) $(IRTEUSIMGOBJS) $(IRTIMGCOBJECTS) $(LIBNR)
195+
$(LIBIRTEUSIMG): $(JPEGMEMCD) $(IRTEUSIMGOBJS) $(IRTIMGCOBJECTS) $(LIBNR)
181196
$(CXX) $(SOFLAGS) $(OUTOPT)$(LIBIRTEUSIMG) $(IRTEUSIMGOBJS) $(IRTIMGCOBJECTS) $(IMPLIB) $(IMPLIBIMG)
182197

183198
$(LIBIRTEUSGL): $(IRTEUSGLOBJS) $(IRTGLCOBJECTS) $(LIBNR)

irteus/Makefile.Cygwin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ ESFX=.exe
5454
SOFLAGS=-shared -g -falign-functions=4 -Wl,--export-all-symbols
5555
IMPLIB=$(EUSDIR)/$(ARCH)/bin/eusgl.a $(EUSDIR)/$(ARCH)/lib/libnr.$(LSFX)
5656
IMPLIBGL=$(EUSDIR)/$(ARCH)/bin/eusgl.a -L/usr/X11R6/lib -lGLU -lGL -lXext
57-
IMPLIBIMG=-ljpeg -lpng
57+
ifeq ($(HAVE_JPEG), 1)
58+
IMPLIBIMG+=-ljpeg
59+
endif
60+
ifeq ($(HAVE_PNG), 1)
61+
IMPLIBIMG+=-lpng
62+
endif
5863
EXPLIB=
5964
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
6065
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a

irteus/Makefile.Darwin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ ESFX=
5252
SOFLAGS=-dynamiclib -flat_namespace -undefined suppress -g -falign-functions=8
5353
IMPLIB=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgeo -L$(INSTALLLIBDIR) -lnr
5454
IMPLIBGL=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgl -L/usr/X11R6/lib -lGLU -lGL -lXext
55-
IMPLIBIMG=-L/opt/local/lib/jpeg6b/lib -ljpeg -L/opt/local/lib -lpng
55+
ifeq ($(HAVE_JPEG), 1)
56+
IMPLIBIMG+=-L/opt/local/lib/jpeg6b/lib -ljpeg
57+
endif
58+
ifeq ($(HAVE_PNG), 1)
59+
IMPLIBIMG+=-L/opt/local/lib -lpng
60+
endif
5661
EXPLIB=
5762
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
5863
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a

irteus/Makefile.Linux

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ ESFX=
5454
SOFLAGS=-shared -g -falign-functions=4 -Xlinker --unresolved-symbols=ignore-all
5555
IMPLIB=-L$(EUSDIR)/$(ARCH)/lib -leusgeo -L$(INSTALLLIBDIR) -lnr
5656
IMPLIBGL=-L$(EUSDIR)/$(ARCH)/lib -leusgl -L/usr/X11R6/lib -lGLU -lGL -lXext
57-
IMPLIBIMG=-ljpeg -lpng
57+
ifeq ($(HAVE_JPEG), 1)
58+
IMPLIBIMG+=-ljpeg
59+
endif
60+
ifeq ($(HAVE_PNG), 1)
61+
IMPLIBIMG+=-lpng
62+
endif
5863
EXPLIB=
5964
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
6065
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a

irteus/Makefile.Linux64

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ ESFX=
5252
SOFLAGS=-shared -g -falign-functions=8 -Xlinker --unresolved-symbols=ignore-all
5353
IMPLIB=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgeo -L$(INSTALLLIBDIR) -lnr
5454
IMPLIBGL=-L$(EUSDIR)/$(ARCHDIR)/lib -leusgl -L/usr/X11R6/lib -lGLU -lGL -lXext
55-
IMPLIBIMG=-ljpeg -lpng
55+
ifeq ($(HAVE_JPEG), 1)
56+
IMPLIBIMG+=-ljpeg
57+
endif
58+
ifeq ($(HAVE_PNG), 1)
59+
IMPLIBIMG+=-lpng
60+
endif
5661
EXPLIB=
5762
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
5863
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a

irteus/Makefile.LinuxARM

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ ESFX=
5454
SOFLAGS=-shared -g -falign-functions=4 -Xlinker --unresolved-symbols=ignore-all
5555
IMPLIB=-L$(EUSDIR)/$(ARCH)/lib -leusgeo -L$(INSTALLLIBDIR) -lnr
5656
IMPLIBGL=-L$(EUSDIR)/$(ARCH)/lib -leusgl -L/usr/X11R6/lib -lGLU -lGL -lXext
57-
IMPLIBIMG=-ljpeg -lpng
57+
ifeq ($(HAVE_JPEG), 1)
58+
IMPLIBIMG+=-ljpeg
59+
endif
60+
ifeq ($(HAVE_PNG), 1)
61+
IMPLIBIMG+=-lpng
62+
endif
5863
EXPLIB=
5964
RAPID=-LRAPID/$(ARCHDIR) -lRAPID-static
6065
RAPIDLIB=RAPID/$(ARCHDIR)/$(LPFX)RAPID-static.a

0 commit comments

Comments
 (0)