xref: /AOO41X/main/redland/raptor/makefile.mk (revision 3e7e88da551a0263f8ccb9c990b61cd1e5829c2f)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=..
25
26PRJNAME=redland
27TARGET=so_raptor
28
29# --- Settings -----------------------------------------------------
30
31.INCLUDE :  settings.mk
32
33.IF "$(SYSTEM_REDLAND)" == "YES"
34all:
35    @echo "An already available installation of Redland RDF should exist on your system."
36    @echo "Therefore the version provided here does not need to be built in addition."
37.ENDIF
38
39# --- Files --------------------------------------------------------
40
41.INCLUDE :  ../redlandversion.mk
42
43RAPTORVERSION=2.0.15
44
45TARFILE_NAME=raptor2-$(RAPTORVERSION)
46TARFILE_MD5=a39f6c07ddb20d7dd2ff1f95fa21e2cd
47
48ADDITIONAL_FILES=src/makefile.mk src/raptor_config.h
49
50OOO_PATCH_FILES= \
51    $(TARFILE_NAME).patch.nspace \
52    $(TARFILE_NAME).patch.dmake \
53
54PATCH_FILES=$(OOO_PATCH_FILES)
55
56
57.IF "$(OS)"=="OS2"
58OOO_PATCH_FILES+=$(TARFILE_NAME).patch.os2
59CONFIGURE_DIR=
60CONFIGURE_ACTION=libtoolize && aclocal && autoconf && .$/configure
61# do not enable grddl parser (#i93768#)
62CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(PWD)/$(OUT) --includedir=(PWD)$/$(INCCOM) --libdir=$(PWD)$/$(LB)
63BUILD_ACTION=$(GNUMAKE)
64BUILD_FLAGS+= -j$(EXTMAXPROCESS)
65BUILD_DIR=$(CONFIGURE_DIR)
66.ELIF "$(OS)"=="WNT"
67.IF "$(COM)"=="GCC"
68OOO_PATCH_FILES+=$(TARFILE_NAME).patch.mingw
69raptor_CC=$(CC) -mthreads
70.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
71raptor_CC+=-shared-libgcc
72.ENDIF
73raptor_LIBS=
74.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
75raptor_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
76.ENDIF
77
78CONFIGURE_DIR=
79CONFIGURE_ACTION=.$/configure
80# do not enable grddl parser (#i93768#)
81CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" --prefix=$(PWD)/$(OUT) --includedir=(PWD)$/$(INCCOM) --libdir=$(PWD)$/$(LB) --CC="$(raptor_CC)" CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2,--export-all-symbols  -L$(ILIB:s/;/ -L/)" LIBS="$(raptor_LIBS)" OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) XSLTLIB="$(XSLTLIB)"
82BUILD_ACTION=$(GNUMAKE)
83BUILD_FLAGS+= -j$(EXTMAXPROCESS)
84BUILD_DIR=$(CONFIGURE_DIR)
85.ELSE
86# there is no wntmsci build environment in the tarball; we use custom dmakefile
87OOO_PATCH_FILES+=$(TARFILE_NAME).patch.win32
88CONFIGURE_ACTION= ${PERL} -p -e '$$prefix="'$(PWD)/$(OUT)'"; $$libdir="'$(PWD)/$(LB)'"; $$incdir="'$(PWD)/$(INCCOM)'"; $$ldflags="-L$(SOLARLIBDIR) -lxml2 -lm";' -e 's/\@prefix\@/$$prefix/; s/\@exec_prefix\@/\$${prefix}/; s/\@libdir\@/$$libdir/; s/\@includedir\@/$$incdir/; s/\@PACKAGE\@/raptor2/; s/\@VERSION\@/2.0.15/; s/\@PKG_CONFIG_REQUIRES\@//; s/\@RAPTOR_LDFLAGS\@/$$ldflags/;'  < raptor2.pc.in > raptor2.pc && \
89    ${PERL} -p -e 's/\@RAPTOR_VERSION_DECIMAL\@/20015/;s/\@VERSION\@/2.0.15/;s/\@RAPTOR_VERSION_MAJOR\@/2/;s/\@RAPTOR_VERSION_MINOR\@/0/;s/\@RAPTOR_VERSION_RELEASE\@/15/' < src/raptor2.h.in > src/raptor2.h && \
90    $(COPY) src/raptor_config.h.in src/raptor_config.h
91BUILD_ACTION=dmake
92BUILD_DIR=$(CONFIGURE_DIR)$/src
93.ENDIF
94
95.ELSE # "WNT"
96
97.IF "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC"
98LDFLAGS:=-Wl,-rpath,'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib' -Wl,-noinhibit-exec
99.ENDIF                  # "$(OS)$(COM)"=="LINUXGCC"
100.IF "$(OS)$(COM)"=="SOLARISC52"
101LDFLAGS:=-Wl,-R'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib'
102.ENDIF                  # "$(OS)$(COM)"=="SOLARISC52"
103
104.IF "$(OS)"=="LINUX" || "$(OS)"=="FREEBSD"
105LDFLAGS+:=-Wl,-z,noexecstack
106.ENDIF # "$(OS)"=="LINUX" || "$(OS)"=="FREEBSD"
107
108.IF "$(COM)"=="C52" && "$(CPU)"=="U"
109CFLAGS=-m64
110.EXPORT: CFLAGS
111.ENDIF
112
113# NB: SOLARDIR before SYSBASE, because linux SYSBASE contains obsolete libcrypto
114CPPFLAGS+:=-I$(SOLARINCDIR)$/external
115LDFLAGS+:=-L$(SOLARLIBDIR)
116
117.IF "$(SYSBASE)"!=""
118CPPFLAGS+:=-I$(SYSBASE)$/usr$/include
119.IF "$(OS)"=="SOLARIS" || "$(OS)"=="LINUX"
120LDFLAGS+:=-L$(SYSBASE)$/lib -L$(SYSBASE)$/usr$/lib -lpthread -ldl
121.ENDIF
122.ENDIF          # "$(SYSBASE)"!=""
123
124CPPFLAGS+:=$(EXTRA_CDEFS) $(EXTRA_CFLAGS)
125LDFLAGS+:=$(EXTRA_LINKFLAGS)
126XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config
127
128.EXPORT: CPPFLAGS
129.EXPORT: LDFLAGS
130.EXPORT: LIBXML2LIB
131.EXPORT: XSLTLIB
132
133CONFIGURE_DIR=
134CONFIGURE_ACTION=.$/configure
135# do not enable grddl parser (#i93768#)
136CONFIGURE_FLAGS=--with-threads --with-curl-config=no --with-icu-config=no --disable-static --disable-gtk-doc --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(PDW)/$(OUT) --includedir=$(PWD)/$(INCCOM) --libdir=$(PWD)/$(LB)
137.IF "$(SYSTEM_LIBXML)" == "NO"
138CONFIGURE_FLAGS+=--with-xml2-config=${SOLARVERSION}/${INPATH}/bin/xml2-config \
139    --with-xslt-config=${SOLARVERSION}/${INPATH}/bin/xslt-config
140.ENDIF
141BUILD_ACTION=$(GNUMAKE)
142BUILD_FLAGS+= -j$(EXTMAXPROCESS)
143BUILD_DIR=$(CONFIGURE_DIR)
144#INSTALL_ACTION=$(GNUMAKE) install
145#INSTALL_FLAGS+=DESTDIR=$(PWD)$/$(P_INSTALL_TARGET_DIR)
146.ENDIF
147
148
149OUT2INC+=src/raptor.h src/raptor2.h src/raptor_config.h
150
151.IF "$(OS)"=="MACOSX"
152OUT2LIB+=src$/.libs$/libraptor2.$(RAPTOR_MAJOR).dylib src$/.libs$/libraptor2.dylib
153OOO_PATCH_FILES+=$(TARFILE_NAME).patch.macos
154.ELIF "$(OS)"=="WNT"
155.IF "$(COM)"=="GCC"
156OUT2LIB+=src$/.libs$/*.a
157OUT2BIN+=src$/.libs$/*.dll
158.ELSE
159# if we use dmake, this is done automagically
160.ENDIF
161.ELIF "$(GUI)"=="OS2"
162OUT2LIB+=src$/.libs$/*.a
163OUT2BIN+=src$/.libs$/*.dll
164.ELSE
165OUT2LIB+=src$/.libs$/libraptor2.so.$(RAPTOR_MAJOR) src$/.libs$/libraptor2.so
166.ENDIF
167
168# --- Targets ------------------------------------------------------
169
170.INCLUDE : set_ext.mk
171.INCLUDE : target.mk
172.INCLUDE : tg_ext.mk
173
174