Skip to content

Commit

Permalink
- Updating makefiles so we can enable boehm when it works with dynami…
Browse files Browse the repository at this point in the history
…cally loaded code

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14106 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 28, 2012
1 parent ca2d05d commit 5fbe6ed
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Compiler/runtime/Makefile.in
Expand Up @@ -31,7 +31,7 @@ CXX = @CXX@
IDL = @IDLCMD@
IDLPYTHON = @IDLPYTHONCMD@
CXXFLAGS = $(CFLAGS)
CPPFLAGS = @CPPFLAGS@ -I$(RMLINCLUDE) -I$(top_builddir)/SimulationRuntime/c -I$(top_builddir)/SimulationRuntime/c/simulation/results -I$(top_builddir)/SimulationRuntime/c/simulation/libf2c -I$(top_builddir)/SimulationRuntime/c/util -I$(top_builddir)/SimulationRuntime/c/meta -I$(top_builddir)/SimulationRuntime/c/meta/gc -I$(srcdir) -I. $(CORBAINCL) -I$(FMIINCLUDE)
CPPFLAGS = @CPPFLAGS@ -I$(RMLINCLUDE) -I$(top_builddir)/SimulationRuntime/c -I$(top_builddir)/SimulationRuntime/c/simulation/results -I$(top_builddir)/SimulationRuntime/c/simulation/libf2c -I$(top_builddir)/SimulationRuntime/c/util -I$(top_builddir)/SimulationRuntime/c/meta -I$(top_builddir)/SimulationRuntime/c/meta/gc -I$(srcdir) -I. $(CORBAINCL) -I$(FMIINCLUDE) -I$(top_builddir)/3rdParty/gc-7.2/include

include Makefile.common

Expand Down
31 changes: 27 additions & 4 deletions Makefile.common
Expand Up @@ -22,7 +22,7 @@ INSTALL_MANDIR = ${DESTDIR}${datadir}/man/
INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java
INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale

.PHONY : interactive omc release qtclient mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall
.PHONY : interactive omc release qtclient mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall boehm-gc

mkbuilddirs:
if [ "$(EXE)" = ".app" ]; then mkdir -p $(builddir_app); fi
Expand All @@ -45,7 +45,7 @@ install-python:
install-openturns: mkbuilddirs
(time cp SimulationRuntime/OpenTurns/* $(builddir_share)/omc/scripts/OpenTurns/)

interactive: .testvariables mkbuilddirs
interactive: .testvariables mkbuilddirs boehm-gc
$(MAKE) -C SimulationRuntime/interactive -f $(defaultMakefileTarget)
# Depends on libinteractive.a
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget)
Expand All @@ -59,7 +59,27 @@ docs: mkbuilddirs omlibrary
# man pages
(cd doc/manpages/ && for f in *.1; do gzip $$f -c > ../../$(builddir_man)/man1/$$f.gz && touch -r $$f ../../$(builddir_man)/man1/$$f.gz; done)

boehm-gc: 3rdParty/gc-7.2/Makefile
GC_HEADERS=gc.h gc_allocator.h gc_amiga_redirects.h gc_backptr.h gc_config_macros.h gc_gcj.h
libgc-dev: /usr/include/gc/gc_inline.h
libgc-dev: /usr/include/gc/gc_mark.h
libgc-dev: /usr/include/gc/gc_pthread_redirects.h
libgc-dev: /usr/include/gc/gc_tiny_fl.h
libgc-dev: /usr/include/gc/gc_typed.h
libgc-dev: /usr/include/gc/gc_version.h
libgc-dev: /usr/include/gc/leak_detector.h
libgc-dev: /usr/include/gc/new_gc_alloc.h
libgc-dev: /usr/include/gc/weakpointer.h

boehm-gc: build/lib/omc/libgc.a build/include/omc/gc.h build/include/omc/gc_config_macros.h build/include/omc/gc_version.h
build/include/omc/gc.h: 3rdParty/gc-7.2/include/gc.h
cp $< $@
build/include/omc/gc_config_macros.h: 3rdParty/gc-7.2/include/gc_config_macros.h
cp $< $@
build/include/omc/gc_version.h: 3rdParty/gc-7.2/include/gc_version.h
cp $< $@
build/lib/omc/libgc.a: 3rdParty/gc-7.2/.libs/libgc.a
cp $< $@
3rdParty/gc-7.2/.libs/libgc.a: 3rdParty/gc-7.2/Makefile
$(MAKE) -C 3rdParty/gc-7.2/
3rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
(cd 3rdParty/gc-7.2 && ./configure --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)")
Expand Down Expand Up @@ -208,7 +228,10 @@ distclean: clean
rm -rf build/
fmil-clean:
rm -rf 3rdParty/FMIL/build 3rdParty/FMIL/install 3rdParty/FMIL/Makefile
clean: qtclean fmil-clean opencl_rt_clean
gc-clean:
if test -f 3rdParty/gc-7.2/Makefile; then make -C 3rdParty/gc-7.2 clean; fi
rm -f 3rdParty/gc-7.2/Makefile
clean: qtclean fmil-clean opencl_rt_clean gc-clean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd SimulationRuntime/interactive && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
Expand Down
2 changes: 1 addition & 1 deletion Parser/Makefile.in
@@ -1,7 +1,7 @@
CC=@CC@
CXX=@CXX@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@ -I$(COMPILERHOME) $(RMLINC) -I. -Iantlr-3.2/runtime/C -Iantlr-3.2/runtime/C/include $(BUILDINC)
CPPFLAGS=@CPPFLAGS@ -I$(COMPILERHOME) $(RMLINC) -I. -Iantlr-3.2/runtime/C -Iantlr-3.2/runtime/C/include -I../3rdParty/gc-7.2/include $(BUILDINC)
RMLHOME=@rmlhome@
OMC=../build/bin/omc

Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/Makefile.common
Expand Up @@ -6,7 +6,7 @@

include Makefile.objs

CPPFLAGS = -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc -I./simulation/libf2c/
CPPFLAGS = -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc -I./simulation/libf2c/ -I$(top_builddir)/3rdParty/gc-7.2/include
CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) -Wall -pedantic $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
FFLAGS = -O -fexceptions
Expand Down
10 changes: 4 additions & 6 deletions SimulationRuntime/c/meta/gc/mmc_gc.h
Expand Up @@ -47,13 +47,11 @@
#ifndef META_MODELICA_GC_H_
#define META_MODELICA_GC_H_

/* uncomment this to use the MetaModelica Garbage collector
#define _MMC_GC_ 1
*/
/* uncomment this to use the MetaModelica Garbage collector */
/* #define _MMC_GC_ 1 */

/* uncomment this to use the BOEHM Garbage collector
#define _MMC_USE_BOEHM_GC_
*/
/* uncomment this to use the BOEHM Garbage collector */
/* #define _MMC_USE_BOEHM_GC_ */

#if defined(__cplusplus)
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Expand Up @@ -627,9 +627,9 @@ else
fi

if test "Darwin" != `uname`; then
RT_LDFLAGS="$RT_LDFLAGS -lrt $OPENMP"
RT_LDFLAGS="$RT_LDFLAGS -lrt -lgc $OPENMP"
else
RT_LDFLAGS="$RT_LDFLAGS -liconv $OPENMP"
RT_LDFLAGS="$RT_LDFLAGS -liconv -lgc $OPENMP"
fi

dnl should we compile modpar
Expand Down

0 comments on commit 5fbe6ed

Please sign in to comment.