xref: /aoo41x/main/cairo/cairo/makefile.mk (revision 7871dc3e)
1*7871dc3eSAndrew Rist#**************************************************************
2*7871dc3eSAndrew Rist#
3*7871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*7871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*7871dc3eSAndrew Rist#  distributed with this work for additional information
6*7871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*7871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*7871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
9*7871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*7871dc3eSAndrew Rist#
11*7871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*7871dc3eSAndrew Rist#
13*7871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*7871dc3eSAndrew Rist#  software distributed under the License is distributed on an
15*7871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*7871dc3eSAndrew Rist#  specific language governing permissions and limitations
18*7871dc3eSAndrew Rist#  under the License.
19*7871dc3eSAndrew Rist#
20*7871dc3eSAndrew Rist#**************************************************************
21*7871dc3eSAndrew Rist
22*7871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweirPRJ=..
25cdf0e10cSrcweir
26cdf0e10cSrcweirPRJNAME=cairo
27cdf0e10cSrcweirTARGET=so_cairo
28cdf0e10cSrcweirEXTERNAL_WARNINGS_NOT_ERRORS := TRUE
29cdf0e10cSrcweir
30cdf0e10cSrcweir# --- Settings -----------------------------------------------------
31cdf0e10cSrcweir
32cdf0e10cSrcweir.INCLUDE :	settings.mk
33cdf0e10cSrcweir
34cdf0e10cSrcweir.IF  "$(ENABLE_CAIRO)" == ""
35cdf0e10cSrcweirall:
36cdf0e10cSrcweir	@echo "Nothing to do (Cairo not enabled)."
37cdf0e10cSrcweir
38cdf0e10cSrcweir.ELIF "$(SYSTEM_CAIRO)" == "YES"
39cdf0e10cSrcweirall:
40cdf0e10cSrcweir	@echo "Nothing to do, using system cairo."
41cdf0e10cSrcweir
42cdf0e10cSrcweir.ENDIF
43cdf0e10cSrcweir
44cdf0e10cSrcweir# --- Files --------------------------------------------------------
45cdf0e10cSrcweir
46cdf0e10cSrcweirCAIROVERSION=1.8.0
47cdf0e10cSrcweir
48cdf0e10cSrcweirTARFILE_NAME=$(PRJNAME)-$(CAIROVERSION)
49cdf0e10cSrcweirTARFILE_MD5=4ea70ea87b47e92d318d4e7f5b940f47
50cdf0e10cSrcweir
51cdf0e10cSrcweirPATCH_FILES=..$/$(TARFILE_NAME).patch
52cdf0e10cSrcweir
53cdf0e10cSrcweircairo_CFLAGS=$(SOLARINC)
54cdf0e10cSrcweircairo_LDFLAGS=$(SOLARLIB)
55cdf0e10cSrcweir
56cdf0e10cSrcweircairo_CPPFLAGS=
57cdf0e10cSrcweir
58cdf0e10cSrcweir.IF "$(SYSTEM_ZLIB)"!="YES"
59cdf0e10cSrcweircairo_CPPFLAGS+=-I$(SOLARINCDIR)$/external$/zlib
60cdf0e10cSrcweircairo_COMPRESS=z_compress
61cdf0e10cSrcweir.ELSE
62cdf0e10cSrcweircairo_COMPRESS=compress
63cdf0e10cSrcweir.ENDIF
64cdf0e10cSrcweircairo_CPPFLAGS+=$(INCLUDE)
65cdf0e10cSrcweir
66cdf0e10cSrcweir.IF "$(OS)"=="WNT"
67cdf0e10cSrcweir# --------- Windows -------------------------------------------------
68cdf0e10cSrcweir.IF "$(COM)"=="GCC"
69cdf0e10cSrcweircairo_LDFLAGS+=-no-undefined -L$(ILIB:s/;/ -L/)
70cdf0e10cSrcweircairo_CPPFLAGS+=-nostdinc
71cdf0e10cSrcweircairo_CC=$(CC) -mthreads
72cdf0e10cSrcweir
73cdf0e10cSrcweir.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
74cdf0e10cSrcweircairo_CC+=-shared-libgcc
75cdf0e10cSrcweir.ENDIF
76cdf0e10cSrcweir.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
77cdf0e10cSrcweircairo_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
78cdf0e10cSrcweir.ENDIF
79cdf0e10cSrcweir
80cdf0e10cSrcweirCONFIGURE_DIR=
81cdf0e10cSrcweirCONFIGURE_ACTION=cp $(SRC_ROOT)$/$(PRJNAME)$/cairo$/dummy_pkg_config . && .$/configure
82cdf0e10cSrcweirCONFIGURE_FLAGS=--disable-xlib --disable-ft --disable-pthread --disable-svg --enable-gtk-doc=no --enable-test-surfaces=no --enable-static=no --build=i586-pc-mingw32 --host=i586-pc-mingw32 PKG_CONFIG=./dummy_pkg_config CC="$(cairo_CC)" LIBS="$(cairo_LIBS)" ZLIB3RDLIB=$(ZLIB3RDLIB) COMPRESS=$(cairo_COMPRESS) OBJDUMP="$(WRAPCMD) objdump"
83cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE)
84cdf0e10cSrcweirBUILD_FLAGS+= -j$(EXTMAXPROCESS)
85cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
86cdf0e10cSrcweir.IF "$(GUI)$(COM)"=="WNTGCC"
87cdf0e10cSrcweir.EXPORT : PWD
88cdf0e10cSrcweir.ENDIF
89cdf0e10cSrcweir
90cdf0e10cSrcweir.ELSE   # WNT, not GCC
91cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE) -f Makefile.win32 CFG=release
92cdf0e10cSrcweirBUILD_DIR=
93cdf0e10cSrcweir.ENDIF
94cdf0e10cSrcweir
95cdf0e10cSrcweirOUT2INC+=src$/cairo-win32.h
96cdf0e10cSrcweir
97cdf0e10cSrcweir.ELIF "$(GUIBASE)"=="aqua"
98cdf0e10cSrcweir# ----------- Native Mac OS X (Aqua/Quartz) --------------------------------
99cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
100cdf0e10cSrcweir.IF "$(EXTRA_CFLAGS)" != ""
101cdf0e10cSrcweircairo_CFLAGS+=$(EXTRA_CFLAGS) $(EXTRA_CDEFS)
102cdf0e10cSrcweircairo_CPPFLAGS+=$(EXTRA_CFLAGS) $(EXTRA_CDEFS)
103cdf0e10cSrcweir.ENDIF # "$(EXTRA_CFLAGS)" != ""
104cdf0e10cSrcweir.ENDIF # "$(SYSBASE)"!=""
105cdf0e10cSrcweirCONFIGURE_DIR=
106cdf0e10cSrcweirCONFIGURE_ACTION=cp $(SRC_ROOT)$/$(PRJNAME)$/cairo$/dummy_pkg_config . && .$/configure
107cdf0e10cSrcweirCONFIGURE_FLAGS=--enable-static=no --disable-xlib --disable-ft --disable-svg --enable-quartz --enable-quartz-font --enable-gtk-doc=no --enable-test-surfaces=no PKG_CONFIG=./dummy_pkg_config ZLIB3RDLIB=$(ZLIB3RDLIB) COMPRESS=$(cairo_COMPRESS)
108cdf0e10cSrcweircairo_CPPFLAGS+=$(EXTRA_CDEFS)
109cdf0e10cSrcweircairo_LDFLAGS+=$(EXTRA_LINKFLAGS)
110cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE)
111cdf0e10cSrcweirBUILD_FLAGS+= -j$(EXTMAXPROCESS)
112cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
113cdf0e10cSrcweir
114cdf0e10cSrcweirOUT2INC+=src$/cairo-quartz.h
115cdf0e10cSrcweir
116cdf0e10cSrcweir.ELSE
117cdf0e10cSrcweir# ----------- Unix ---------------------------------------------------------
118cdf0e10cSrcweir.IF "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC"
119cdf0e10cSrcweircairo_LDFLAGS+=-Wl,-rpath,'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib' -Wl,-noinhibit-exec
120cdf0e10cSrcweir.ELIF "$(OS)$(COM)"=="SOLARISC52"
121cdf0e10cSrcweircairo_LDFLAGS+=-Wl,-R'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
122cdf0e10cSrcweir.ENDIF  # "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC"
123cdf0e10cSrcweir
124cdf0e10cSrcweir.IF "$(SYSBASE)"!=""
125cdf0e10cSrcweircairo_CFLAGS+=-I$(SYSBASE)$/usr$/include -I$(SOLARINCDIR)$/external $(EXTRA_CFLAGS)
126cdf0e10cSrcweir.IF "$(OS)"=="SOLARIS" || "$(OS)"=="LINUX"
127cdf0e10cSrcweircairo_LDFLAGS+=-L$(SYSBASE)$/lib -L$(SYSBASE)$/usr$/lib -L$(SOLARLIBDIR) -lpthread -ldl
128cdf0e10cSrcweir.ENDIF
129cdf0e10cSrcweir.ENDIF			# "$(SYSBASE)"!=""
130cdf0e10cSrcweir
131cdf0e10cSrcweirLDFLAGS:=$(cairo_LDFLAGS)
132cdf0e10cSrcweir.EXPORT: LDFLAGS
133cdf0e10cSrcweir
134cdf0e10cSrcweir.IF "$(COMNAME)"=="sunpro5"
135cdf0e10cSrcweircairo_CFLAGS+=-xc99=none
136cdf0e10cSrcweir.ENDIF
137cdf0e10cSrcweir
138cdf0e10cSrcweir.IF "$(CPU)"=="I"
139cdf0e10cSrcweircairo_CFLAGS+=-march=i486
140cdf0e10cSrcweir.ENDIF
141cdf0e10cSrcweir
142cdf0e10cSrcweirCONFIGURE_DIR=
143cdf0e10cSrcweirCONFIGURE_ACTION=.$/configure
144cdf0e10cSrcweirCONFIGURE_FLAGS=--enable-xlib --enable-ft --disable-svg --enable-gtk-doc=no --enable-test-surfaces=no --enable-static=no ZLIB3RDLIB=$(ZLIB3RDLIB) COMPRESS=$(cairo_COMPRESS)
145cdf0e10cSrcweirBUILD_ACTION=$(GNUMAKE)
146cdf0e10cSrcweirBUILD_FLAGS+= -j$(EXTMAXPROCESS)
147cdf0e10cSrcweirBUILD_DIR=$(CONFIGURE_DIR)
148cdf0e10cSrcweir
149cdf0e10cSrcweirOUT2INC+=src$/cairo-xlib.h \
150cdf0e10cSrcweir	 src$/cairo-xlib-xrender.h \
151cdf0e10cSrcweir	 src$/cairo-ft.h
152cdf0e10cSrcweir
153cdf0e10cSrcweir.ENDIF
154cdf0e10cSrcweir
155cdf0e10cSrcweir
156cdf0e10cSrcweir# -------- All platforms --------------------------------------------
157cdf0e10cSrcweir
158cdf0e10cSrcweir.IF "$(OS)" != "WNT" || "$(COM)" == "GCC"
159cdf0e10cSrcweir# all other platforms except vanilla WNT, which does not use configure
160cdf0e10cSrcweir
161cdf0e10cSrcweir.IF "$(BUILD_PIXMAN)" == "YES"
162cdf0e10cSrcweir# pixman is in this module
163cdf0e10cSrcweir# We include paths to this module also in LDFLAGS/CFLAGS to guarantee search order.
164cdf0e10cSrcweir# However pixman_* vars need to be also set for configure to work properly on all platforms.
165cdf0e10cSrcweirCONFIGURE_FLAGS+=pixman_CFLAGS="-I$(SRC_ROOT)$/$(PRJNAME)$/$(INPATH)$/inc" pixman_LIBS="-L$(SRC_ROOT)$/$(PRJNAME)$/$(INPATH)$/lib -lpixman-1"
166cdf0e10cSrcweir.ENDIF
167cdf0e10cSrcweir
168cdf0e10cSrcweirCONFIGURE_FLAGS+=CFLAGS="-I$(SRC_ROOT)$/$(PRJNAME)$/$(INPATH)$/inc $(cairo_CFLAGS)" LDFLAGS="-L$(SRC_ROOT)$/$(PRJNAME)$/$(INPATH)$/lib $(cairo_LDFLAGS)" CPPFLAGS="$(cairo_CPPFLAGS)"
169cdf0e10cSrcweir
170cdf0e10cSrcweir.ENDIF
171cdf0e10cSrcweir
172cdf0e10cSrcweir.IF "$(SYSTEM_LIBPNG)" != "YES"
173cdf0e10cSrcweirCONFIGURE_FLAGS+=png_CFLAGS="-I$(SOLARINCDIR)$/external$/libpng" png_LIBS="-L$(SOLARLIBDIR) -lpng"
174cdf0e10cSrcweir.ENDIF
175cdf0e10cSrcweir
176cdf0e10cSrcweir
177cdf0e10cSrcweirOUT2INC+=cairo-version.h \
178cdf0e10cSrcweir	 src$/cairo-deprecated.h \
179cdf0e10cSrcweir	 src$/cairo-features.h  \
180cdf0e10cSrcweir	 src$/cairo-pdf.h	\
181cdf0e10cSrcweir	 src$/cairo-ps.h	\
182cdf0e10cSrcweir	 src$/cairo.h
183cdf0e10cSrcweir
184cdf0e10cSrcweir.IF "$(OS)"=="MACOSX"
185cdf0e10cSrcweirEXTRPATH=LOADER
186cdf0e10cSrcweirOUT2LIB+=src$/.libs$/libcairo*.dylib
187cdf0e10cSrcweir.ELIF "$(OS)"=="WNT"
188cdf0e10cSrcweir.IF "$(COM)"=="GCC"
189cdf0e10cSrcweirOUT2BIN+=src$/.libs$/*.a
190cdf0e10cSrcweirOUT2BIN+=src$/.libs$/*.dll
191cdf0e10cSrcweir.ELSE
192cdf0e10cSrcweirOUT2LIB+=src$/release$/*.lib
193cdf0e10cSrcweirOUT2BIN+=src$/release$/*.dll
194cdf0e10cSrcweir.ENDIF
195cdf0e10cSrcweir.ELSE
196cdf0e10cSrcweirOUT2LIB+=src$/.libs$/libcairo.so*
197cdf0e10cSrcweir.ENDIF
198cdf0e10cSrcweir
199cdf0e10cSrcweir# --- Targets ------------------------------------------------------
200cdf0e10cSrcweir
201cdf0e10cSrcweir.INCLUDE : set_ext.mk
202cdf0e10cSrcweir.INCLUDE : target.mk
203cdf0e10cSrcweir.INCLUDE : tg_ext.mk
204cdf0e10cSrcweir
205