[pure-lang-svn] SF.net SVN: pure-lang: [201] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-06-13 08:32:02
|
Revision: 201 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=201&view=rev Author: agraef Date: 2008-06-13 01:32:03 -0700 (Fri, 13 Jun 2008) Log Message: ----------- Add configure magic to get -fPIC on Linux x86-64. Modified Paths: -------------- pure/trunk/Makefile.in pure/trunk/configure pure/trunk/configure.ac Modified: pure/trunk/Makefile.in =================================================================== --- pure/trunk/Makefile.in 2008-06-09 23:11:12 UTC (rev 200) +++ pure/trunk/Makefile.in 2008-06-13 08:32:03 UTC (rev 201) @@ -53,7 +53,7 @@ LLVM_FLAGS = `llvm-config --cppflags` LLVM_LIBS = `llvm-config --ldflags --libs core jit native` -CPPFLAGS = @CPPFLAGS@ $(LLVM_FLAGS) +CPPFLAGS = @CPPFLAGS@ CXXFLAGS = @CXXFLAGS@ # Pure library name. Currently we use a simple versioning scheme, which @@ -68,13 +68,21 @@ libpurelnk = lib$(libpure_base)$(DLL) LIBPURE = -l$(libpure_vers) -# Whether to build the Pure library. If this is set to anything but "yes", the -# interpreter is linked statically and no separate runtime library is +# Whether to build the Pure runtime library. If this is set to anything but +# "yes", the interpreter is linked statically and no separate library is # produced. This is necessary on some systems where LLVM cannot be linked in # dynamically. SHARED = @SHARED@ +# On some systems -fPIC is needed for code linked as a shared library. + +ifeq ($(SHARED), yes) +PIC = @PIC@ +else +PIC = +endif + # Auxiliary libraries to be loaded at runtime. Usually this is just libpure # (when built), but on some systems we have to load additional dlls to resolve # some library functions. @@ -119,11 +127,14 @@ ln -sf $(libpure) $(libpurelnk) pure.o: pure.cc - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -DPURELIB='"$(libdir)/pure"' -c -o $@ $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LLVM_FLAGS) -DPURELIB='"$(libdir)/pure"' -c -o $@ $< interpreter.o: interpreter.cc - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(AUXLIBS) -c -o $@ $< + $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) $(AUXLIBS) -c -o $@ $< +%.o: %.cc + $(CXX) $(CXXFLAGS) $(PIC) $(CPPFLAGS) $(LLVM_FLAGS) -c -o $@ $< + lexer.cc: lexer.ll flex -o lexer.cc $< Modified: pure/trunk/configure =================================================================== --- pure/trunk/configure 2008-06-09 23:11:12 UTC (rev 200) +++ pure/trunk/configure 2008-06-13 08:32:03 UTC (rev 201) @@ -657,6 +657,7 @@ host_cpu host_vendor host_os +PIC RDYNAMIC DLLEXT AUXLIBS @@ -1846,6 +1847,7 @@ _ACEOF +PIC= RDYNAMIC= DLLEXT=".so" AUX_LIBS= @@ -1854,6 +1856,7 @@ AUXLIBS="-DLIBGLOB='\"libglob.dll\"' -DLIBREGEX='\"libgnurx-0.dll\"'"; LIBS="$LIBS -limagehlp -lpsapi"; LDFLAGS="-Wl,--enable-auto-import";; + x86_64-*-linux*) RDYNAMIC="-rdynamic"; PIC="-fPIC";; *-*-linux*) RDYNAMIC="-rdynamic";; *-*-freebsd*) RDYNAMIC="-rdynamic";; *-*-darwin*) DLLEXT=".dylib";; @@ -1862,6 +1865,7 @@ + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -6025,6 +6029,7 @@ host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim +PIC!$PIC$ac_delim RDYNAMIC!$RDYNAMIC$ac_delim DLLEXT!$DLLEXT$ac_delim AUXLIBS!$AUXLIBS$ac_delim @@ -6051,7 +6056,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 69; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 70; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: pure/trunk/configure.ac =================================================================== --- pure/trunk/configure.ac 2008-06-09 23:11:12 UTC (rev 200) +++ pure/trunk/configure.ac 2008-06-13 08:32:03 UTC (rev 201) @@ -9,6 +9,9 @@ AC_DEFINE_UNQUOTED(HOST, "${host}", [Define to the name of the host system.]) AC_SUBST(host) dnl Figure out extra build flags and filename extensions for various systems. +dnl XXXFIXME: -fPIC is acurrently assumed for Linux x86-64 only. There might +dnl be other Unix systems which need this. +PIC= RDYNAMIC= DLLEXT=".so" AUX_LIBS= @@ -17,11 +20,13 @@ AUXLIBS="-DLIBGLOB='\"libglob.dll\"' -DLIBREGEX='\"libgnurx-0.dll\"'"; LIBS="$LIBS -limagehlp -lpsapi"; LDFLAGS="-Wl,--enable-auto-import";; + x86_64-*-linux*) RDYNAMIC="-rdynamic"; PIC="-fPIC";; *-*-linux*) RDYNAMIC="-rdynamic";; *-*-freebsd*) RDYNAMIC="-rdynamic";; *-*-darwin*) DLLEXT=".dylib";; hppa*-hp-hpux*) DLLEXT=".sl";; esac +AC_SUBST(PIC) AC_SUBST(RDYNAMIC) AC_SUBST(DLLEXT) AC_SUBST(AUXLIBS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |