diff options
Diffstat (limited to 'Build/source/utils/asymptote/Makefile.in')
-rw-r--r-- | Build/source/utils/asymptote/Makefile.in | 76 |
1 files changed, 48 insertions, 28 deletions
diff --git a/Build/source/utils/asymptote/Makefile.in b/Build/source/utils/asymptote/Makefile.in index 9e323a5345b..8460880d319 100644 --- a/Build/source/utils/asymptote/Makefile.in +++ b/Build/source/utils/asymptote/Makefile.in @@ -9,12 +9,16 @@ GCLIB = @GCLIB@ GCPPLIB = @GCPPLIB@ GCLIBS = $(GCPPLIB) $(GCLIB) LFLAGS = @LDFLAGS@ -LIBS = $(LFLAGS) @LIBS@ $(GCLIBS) +LIBS = $(LFLAGS) @PTHREAD_LIBS@ @LIBS@ $(GCLIBS) + +# Libraries needed to make asymptote.so. +# We have to remove OpenGL, threading, GC, etc from this. +SHAREDLIBS = $(filter-out -lGL -lGLU -lglut -pthread $(GCLIBS), $(LIBS)) vpath %.cc prc CAMP = camperror path drawpath drawlabel picture psfile texfile util settings \ - guide flatguide knot drawfill path3 drawpath3 drawsurface + guide flatguide knot drawfill path3 drawpath3 drawsurface pen RUNTIME_FILES = runtime runbacktrace runpicture runlabel runhistory runarray \ runfile runsystem runpair runtriple runpath runpath3d runstring \ @@ -25,14 +29,16 @@ SYMBOL_FILES = types builtin gsl $(RUNTIME_FILES) PRC = PRCbitStream oPRCFile PRCdouble writePRC -FILES = $(CAMP) $(SYMBOL_FILES) env genv main stm dec errormsg \ +COREFILES = $(CAMP) $(SYMBOL_FILES) env genv stm dec errormsg \ callable name symbol entry exp newexp stack camp.tab lex.yy \ access virtualfieldaccess absyn record interact fileio \ - fftw++ simpson coder coenv \ + fftw++ simpson coder coenv impdatum \ @getopt@ locate parser program application varinit fundec refaccess \ envcompleter process constructor array Delaunay predicates \ $(PRC) glrender tr arcball algebra3 quaternion svnrevision +FILES = $(COREFILES) main + DIST = camp.tab.h camp.tab.cc lex.yy.cc runtime.cc keywords.cc \ asy-keywords.el $(RUNTIME_FILES:=.cc) $(RUNTIME_FILES:=.h) asy.list \ allsymbols.h opsymbols.h $(SYMBOL_FILES:=.symbols.h) @@ -49,14 +55,19 @@ LATEXFILES = asymptote.sty asycolors.sty ocg.sty latexmkrc CONTEXTFILES = colo-asy.tex ASY = ./asy -dir base -config "" -render=0 -DEFS = @DEFS@ @OPTIONS@ \ - -DTRANSJUMP +DEFS = @DEFS@ @OPTIONS@ @PTHREAD_CFLAGS@ CFLAGS = @CPPFLAGS@ @CFLAGS@ -OPTS = $(DEFS) $(CFLAGS) +OPTS = $(DEFS) $(CFLAGS) INCL = -I . @INCL@ -CXX = @CXX@ -Wall -ansi -CC = @CC@ -Wall -ansi +# Options for compiling the object files for the shared library. +# gc has to be configured with the option --disable-threads in order to make a +# shared library that doesn't seg fault. For now, just disable gc in the +# shared library. +SHAREDOPTS = $(filter-out -DUSEGC, $(DEFS)) $(CFLAGS) -fPIC -DFOR_SHARED + +CXX = @CXX@ -Wall +CC = @CC@ -Wall MAKEDEPEND = $(OPTS) -O0 -M -DDEPEND BISON = bison LEX = @LEX@ @@ -82,7 +93,17 @@ last = `cat svnrevision.cc | sed -e 's/.*\"\(.*\)\";/\\1/'` export prefix docdir exampledir mandir infodir INSTALL MAKE DESTDIR TEXI2DVI -asy: $(GCLIB) $(FILES:=.o) +asy: version GUIversion + if test -n "$(MSDOS)"; then \ + cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/@VERSION@$(revision)/" | \ + windres -o asy.o; \ + $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) asy.o $(LIBS) -s -static; \ + else \ + ln -sf GUI/xasy.py $(XNAME); \ + $(CXX) $(DEFS) -o $(NAME) $(FILES:=.o) $(LIBS); \ + fi + +version: $(GCLIB) $(FILES:=.o) if test "$(revision)" != "$(last)"; then \ echo $(REVISION)\"$(revision)\"\; > svnrevision.cc; \ $(CXX) $(OPTS) $(INCL) -o svnrevision.o -c svnrevision.cc; \ @@ -90,26 +111,17 @@ asy: $(GCLIB) $(FILES:=.o) echo string VERSION=\"@VERSION@$(revision)\"\; > base/version.asy echo @set VERSION @VERSION@$(revision) > doc/version.texi echo @set Datadir @datadir@ >> doc/version.texi + +GUIversion: echo "#!/usr/bin/env python" > GUI/xasyVersion.py echo xasyVersion = \"@VERSION@$(revision)\" >> GUI/xasyVersion.py - ln -sf GUI/xasy.py $(XNAME) - $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) $(LIBS) + +asymptote.so: version + $(CXX) $(OPTS) -shared -o asymptote.so $(COREFILES:=.pic.o) $(SHAREDLIBS) svnrevision.cc: echo $(REVISION)\"\"\; > svnrevision.cc; -msdos: $(GCLIB) $(FILES:=.o) asy.o - echo string VERSION=\"@VERSION@\"\; > base/version.asy - echo @set VERSION @VERSION@ > doc/version.texi - echo @set Datadir @datadir@ >> doc/version.texi - echo "#!/usr/bin/env python" > GUI/xasyVersion.py - echo xasyVersion = \"@VERSION@\" >> GUI/xasyVersion.py - $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) asy.o $(LIBS) -s -static - -asy.o: asy.rc asy.ico Makefile - cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/@VERSION@$(revision)/" | \ - windres -o asy.o - all: asy sty man faq asy-keywords.el $(GCLIB): $(GC).tar.gz @@ -123,6 +135,9 @@ $(GCLIB): $(GC).tar.gz cd $(GC)/include/private && \ patch < ../../../patches/gc-7.0nomem.patch; \ fi + if test "$(GC)" = "gc-7.2b"; then \ + mv gc-7.2 gc-7.2b; \ + fi cd $(GC); \ ./configure $(GCOPTIONS); \ $(MAKE) check @@ -184,7 +199,7 @@ asy-keywords.el: asy grep -v three_\* | grep -v featpost3D | xargs $(ASY) -l >> asy.list perl ./asy-list.pl asy.list @VERSION@ -install: install-texhash install-man +install: asy-keywords.el install-texhash install-man install-all: install install-html @@ -193,7 +208,7 @@ install-texhash: install-asy texhash; \ fi -install-asy: asy sty asy-keywords.el +install-asy: asy sty ${INSTALL} -d $(bindir) $(asydir) $(GUIdir) $(exampledir) \ $(animationsdir) -${INSTALL} -d $(latexdir) @@ -246,7 +261,7 @@ uninstall-docdir: -rmdir $(docdir) clean: FORCE - -rm -f asy *.o *.d *mon.out $(CLEAN) + -rm -f asy asymptote.so *.pic.o *.o *.d *mon.out $(CLEAN) gc-clean: FORCE clean -if test -d $(GC); then \ @@ -284,7 +299,7 @@ check-all: asy FORCE @echo Creating $@; \ rm -f $@; \ ${CXX} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + sed 's,\($*\)\.o[ :]*,\1.o \1.pic.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ .c.d: @echo Creating $@; \ @@ -293,6 +308,11 @@ check-all: asy FORCE sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ +# Compile for the shared library. OpenGL must be disabled as it causes +# crashes inside a shared library. +%.pic.o: %.cc + $(CXX) $(SHAREDOPTS) $(INCL) -o $@ -c $< + ifeq (,$(findstring clean,${MAKECMDGOALS})) -include $(FILES:=.d) endif |