Module_ooo.mk                    |    1 
 Repository.mk                    |    3 +
 rsc/Executable_rsc.mk            |   52 ++++++++++++++++++++++++
 rsc/Executable_rsc2.mk           |   84 +++++++++++++++++++++++++++++++++++++++
 rsc/Executable_rscpp.mk          |   68 +++++++++++++++++++++++++++++++
 rsc/Makefile                     |   32 ++++++++++++++
 rsc/Module_rsc.mk                |   34 +++++++++++++++
 rsc/Package_inc.mk               |   25 +++++++++++
 rsc/prj/build.lst                |    9 ----
 rsc/prj/d.lst                    |    9 ----
 rsc/prj/makefile.mk              |   44 ++++++++++++++++++++
 solenv/gbuild/Executable.mk      |    1 
 solenv/gbuild/LinkTarget.mk      |   27 ++++++++++++
 solenv/gbuild/TargetLocations.mk |    1 
 14 files changed, 373 insertions(+), 17 deletions(-)

New commits:
commit 21a0c3efd32b0f0e32cf54d6278d87a37650db89
Author:     Damjan Jovanovic <dam...@apache.org>
AuthorDate: Fri Aug 31 18:54:31 2018 +0000
Commit:     Damjan Jovanovic <dam...@apache.org>
CommitDate: Fri Aug 31 18:54:31 2018 +0000

    Implement gbuild functions for building Bison files.
    
    Port main/rsc to gbuild.
    
    Patch by: me

diff --git a/Module_ooo.mk b/Module_ooo.mk
index 70391af9fd3f..ca7635d58893 100644
--- a/Module_ooo.mk
+++ b/Module_ooo.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
     remotebridges \
     reportdesign \
     ridljar \
+    rsc \
     sane \
     sax \
     sc \
diff --git a/Repository.mk b/Repository.mk
index 7e4d995f2216..4d9dcf8489e6 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -32,7 +32,10 @@ $(eval $(call gb_Helper_register_executables,NONE, \
     mkunroll \
     rdbedit \
     rdbmaker \
+    rsc \
+    rsc2 \
     rscdep \
+    rscpp \
     so_checksum \
     srvdepy \
     svidl \
diff --git a/rsc/Executable_rsc.mk b/rsc/Executable_rsc.mk
new file mode 100644
index 000000000000..fbeff1d390ed
--- /dev/null
+++ b/rsc/Executable_rsc.mk
@@ -0,0 +1,52 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+$(eval $(call gb_Executable_Executable,rsc))
+
+$(eval $(call 
gb_Executable_add_precompiled_header,rsc,$(SRCDIR)/rsc/inc/pch/precompiled_rsc))
+
+$(eval $(call gb_Executable_set_include,rsc,\
+        $$(INCLUDE) \
+        -I$(SRCDIR)/rsc/inc \
+        -I$(SRCDIR)/rsc/inc/pch \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,rsc,\
+       i18nisolang1 \
+       sal \
+       tl \
+       vos3 \
+       stl \
+    $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,rsc,\
+       rsc/source/prj/start \
+       rsc/source/tools/rschash \
+       rsc/source/tools/rsctree \
+       rsc/source/tools/rsctools \
+       rsc/source/tools/rscchar \
+       rsc/source/tools/rscdef \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/rsc/Executable_rsc2.mk b/rsc/Executable_rsc2.mk
new file mode 100644
index 000000000000..897f39b3d199
--- /dev/null
+++ b/rsc/Executable_rsc2.mk
@@ -0,0 +1,84 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+$(eval $(call gb_Executable_Executable,rsc2))
+
+$(eval $(call 
gb_Executable_add_precompiled_header,rsc2,$(SRCDIR)/rsc/inc/pch/precompiled_rsc))
+
+$(eval $(call gb_Executable_set_include,rsc2,\
+        $$(INCLUDE) \
+        -I$(SRCDIR)/rsc/inc \
+        -I$(SRCDIR)/rsc/inc/pch \
+))
+
+$(eval $(call gb_Executable_add_api,rsc2,\
+        offapi \
+        udkapi \
+))
+
+$(eval $(call gb_Executable_add_linked_libs,rsc2,\
+       i18nisolang1 \
+       sal \
+       tl \
+       vos3 \
+       stl \
+    $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_bison_files,rsc2,\
+       rsc/source/parser/yyrscyacc \
+))
+
+$(eval $(call gb_Executable_add_exception_objects,rsc2,\
+       rsc/source/misc/rsclst \
+       rsc/source/misc/rscdbl \
+       rsc/source/parser/rscpar \
+       rsc/source/parser/rscyacc \
+       rsc/source/parser/rsclex \
+       rsc/source/parser/erscerr \
+       rsc/source/parser/rsckey \
+       rsc/source/parser/rscinit \
+       rsc/source/parser/rscibas \
+       rsc/source/parser/rscdb \
+       rsc/source/parser/rscicpx \
+       rsc/source/prj/gui \
+       rsc/source/res/rscclobj \
+       rsc/source/res/rsctop \
+       rsc/source/res/rscrange \
+       rsc/source/res/rscconst \
+       rsc/source/res/rscflag \
+       rsc/source/res/rscstr \
+       rsc/source/res/rscall \
+       rsc/source/res/rsccont \
+       rsc/source/res/rscclass \
+       rsc/source/res/rscmgr \
+       rsc/source/res/rscarray \
+       rsc/source/rsc/rsc \
+       rsc/source/tools/rschash \
+       rsc/source/tools/rsctree \
+       rsc/source/tools/rsctools \
+       rsc/source/tools/rscchar \
+       rsc/source/tools/rscdef \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/rsc/Executable_rscpp.mk b/rsc/Executable_rscpp.mk
new file mode 100644
index 000000000000..e55f1012bda0
--- /dev/null
+++ b/rsc/Executable_rscpp.mk
@@ -0,0 +1,68 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+$(eval $(call gb_Executable_Executable,rscpp))
+
+$(eval $(call 
gb_Executable_add_precompiled_header,rscpp,$(SRCDIR)/rsc/inc/pch/precompiled_rsc))
+
+$(eval $(call gb_Executable_set_include,rscpp,\
+        $$(INCLUDE) \
+        -I$(SRCDIR)/rsc/inc \
+        -I$(SRCDIR)/rsc/inc/pch \
+))
+
+ifeq ($(GUI),UNX)
+$(eval $(call gb_Executable_add_defs,rscpp,\
+       -Dunix \
+))
+endif
+
+$(eval $(call gb_Executable_add_linked_libs,rscpp,\
+       i18nisolang1 \
+       sal \
+       tl \
+       vos3 \
+       stl \
+    $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_Executable_add_cobjects,rscpp,\
+       rsc/source/rscpp/cpp1 \
+       rsc/source/rscpp/cpp2 \
+       rsc/source/rscpp/cpp3 \
+       rsc/source/rscpp/cpp4 \
+       rsc/source/rscpp/cpp5 \
+       rsc/source/rscpp/cpp6 \
+))
+
+# cc: Sun C 5.5 Patch 112761-10 2004/08/10
+# Solaris x86 compiler ICE
+# "cpp6.c", [get]:ube: internal error
+# remove after compiler upgrade
+ifeq ($(OS)$(CPU),SOLARISI)
+$(eval $(call gb_LinkTarget_set_cxx_optimization, \
+       rsc/source/rscpp/cpp6, $(gb_COMPILERNOOPTFLAGS) \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/rsc/Makefile b/rsc/Makefile
new file mode 100644
index 000000000000..c1d144cbd4c9
--- /dev/null
+++ b/rsc/Makefile
@@ -0,0 +1,32 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+ifeq ($(strip $(SOLARENV)),)
+$(error No environment set!)
+endif
+
+gb_PARTIALBUILD := T
+GBUILDDIR := $(SOLARENV)/gbuild
+include $(GBUILDDIR)/gbuild.mk
+
+$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath 
$(firstword $(MAKEFILE_LIST))))/Module*.mk)))
+
+# vim: set noet sw=4 ts=4:
diff --git a/rsc/Module_rsc.mk b/rsc/Module_rsc.mk
new file mode 100644
index 000000000000..ef22d34dac0d
--- /dev/null
+++ b/rsc/Module_rsc.mk
@@ -0,0 +1,34 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+$(eval $(call gb_Module_Module,rsc))
+
+$(eval $(call gb_Module_add_targets,rsc,\
+       Executable_rsc \
+       Executable_rsc2 \
+       Executable_rscpp \
+       Package_inc \
+))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/rsc/Package_inc.mk b/rsc/Package_inc.mk
new file mode 100644
index 000000000000..48c082d5afb0
--- /dev/null
+++ b/rsc/Package_inc.mk
@@ -0,0 +1,25 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+$(eval $(call gb_Package_Package,rsc_inc,$(SRCDIR)/rsc/inc))
+$(eval $(call gb_Package_add_file,rsc_inc,inc/rsc/rscsfx.hxx,rsc/rscsfx.hxx))
diff --git a/rsc/prj/build.lst b/rsc/prj/build.lst
index a26b9a055b60..5e953f3a29db 100644
--- a/rsc/prj/build.lst
+++ b/rsc/prj/build.lst
@@ -1,9 +1,2 @@
 r      rsc     :       tools NULL
-r      rsc                                                                     
        usr1    -       all     rsc_mkout NULL
-r      rsc\source\misc                                                 nmake   
-       all     rsc_misc NULL
-r      rsc\source\tools                                                nmake   
-       all     rsc_tool NULL
-r      rsc\source\res                                                  nmake   
-       all     rsc_res NULL
-r      rsc\source\parser                                               nmake   
-       all     rsc_pars NULL
-r      rsc\source\rsc                                                  nmake   
-       all     rsc_rsc NULL
-r      rsc\source\rscpp                                                nmake   
-       all     rsc_cpp NULL
-r      rsc\source\prj                                                  nmake   
-       all     rsc_sprj rsc_misc rsc_pars rsc_res rsc_rsc rsc_tool NULL
+r      rsc\prj                                                 nmake   -       
all     rsc_sprj NULL
diff --git a/rsc/prj/d.lst b/rsc/prj/d.lst
index e79c03d9bb63..e69de29bb2d1 100644
--- a/rsc/prj/d.lst
+++ b/rsc/prj/d.lst
@@ -1,9 +0,0 @@
-..\%__SRC%\bin\rsc.exe %_DEST%\bin%_EXT%\rsc.exe
-..\%__SRC%\bin\rsc2.exe %_DEST%\bin%_EXT%\rsc2.exe
-..\%__SRC%\bin\rsc %_DEST%\bin%_EXT%\rsc
-..\%__SRC%\bin\rsc2 %_DEST%\bin%_EXT%\rsc2
-..\%__SRC%\bin\rscpp.exe %_DEST%\bin%_EXT%\rscpp.exe
-..\%__SRC%\bin\rscpp %_DEST%\bin%_EXT%\rscpp
-
-mkdir: %_DEST%\inc%_EXT%\rsc
-..\inc\rsc/rscsfx.hxx %_DEST%\inc%_EXT%\rsc\rscsfx.hxx
diff --git a/rsc/prj/makefile.mk b/rsc/prj/makefile.mk
new file mode 100644
index 000000000000..c62c6a657d16
--- /dev/null
+++ b/rsc/prj/makefile.mk
@@ -0,0 +1,44 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+
+
+PRJ=..
+TARGET=prj
+
+.INCLUDE : settings.mk
+
+.IF "$(VERBOSE)"!=""
+VERBOSEFLAG :=
+.ELSE
+VERBOSEFLAG := -s
+.ENDIF
+
+.IF "$(DEBUG)"!=""
+DEBUG_ARGUMENT=DEBUG=$(DEBUG)
+.ELIF "$(debug)"!=""
+DEBUG_ARGUMENT=debug=$(debug)
+.ELSE
+DEBUG_ARGUMENT=
+.ENDIF
+
+all:
+    cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) 
$(DEBUG_ARGUMENT) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/yyrscyacc.y
similarity index 100%
rename from rsc/source/parser/rscyacc.y
rename to rsc/source/parser/yyrscyacc.y
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index bbc9d5c2c7bb..e4bc18411d1d 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -98,6 +98,7 @@ $(eval $(foreach method,\
        add_sdi_headers \
        add_precompiled_header \
        set_private_extract_of_public_api \
+       add_bison_files \
 ,\
        $(call gb_Executable_forward_to_Linktarget,$(method))\
 ))
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 41d32e493f0a..1d2f8af12e86 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -598,6 +598,33 @@ $(call gb_LinkTarget_get_clean_target,$(1)) :
 
 endef
 
+gb_BisonTarget_get_source = $(SRCDIR)/$(1).y
+
+# Bison-generated .cxx files are always #include'd into in-module files,
+# and aren't compiled, so they effectively act as generated headers, not 
generated .cxx.
+
+define gb_LinkTarget_add_bison_file
+
+$(call gb_LinkTarget_get_external_headers_target,$(1)) :| \
+       $(call gb_BisonTarget_get_target,$(1),$(2))
+
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(dir $(call 
gb_BisonTarget_get_target,$(1),$(2)))
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(dir $(call 
gb_BisonTarget_get_target,$(1),$(2)))
+endif
+
+$(call gb_BisonTarget_get_target,$(1),$(2)) : $(call 
gb_BisonTarget_get_source,$(2))
+       mkdir -p $(dir $(call gb_BisonTarget_get_target,$(1),$(2))) && \
+       bison -d -o $(call gb_BisonTarget_get_target,$(1),$(2)) $(call 
gb_BisonTarget_get_source,$(2)) 
+
+endef
+
+define gb_LinkTarget_add_bison_files
+$(foreach bisonfile,$(2),$(call 
gb_LinkTarget_add_bison_file,$(1),$(bisonfile)))
+
+endef
+
 define gb_LinkTarget_add_libs
 $(call gb_LinkTarget_get_target,$(1)) : LIBS += $(2)
 endef
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index c46d8fe82c75..8c7677d7e8a4 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -46,6 +46,7 @@ endef
 
 gb_AllLangResTarget_get_target = $(WORKDIR)/AllLangRes/$(1)
 gb_Ant_get_target = $(WORKDIR)/Ant/$(1).jar
+gb_BisonTarget_get_target = $(WORKDIR)/Bison/$(1)/$(2).cxx
 gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o
 gb_ComponentTarget_get_target = $(WORKDIR)/ComponentTarget/$(1).component
 gb_ComponentTarget_get_inbuild_target = 
$(WORKDIR)/ComponentTarget/$(1).inbuild.component
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to