Skip to content

Commit

Permalink
Look for llvm-ld in llvm-config --bindir
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Dec 28, 2011
1 parent 1f0b448 commit 091bd35
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL

/* Location of LLVM binaries */
#undef LLVM_CONFIG_BINDIR

/* Version of LLVM installed */
#undef LLVM_VERSION

Expand Down
4 changes: 3 additions & 1 deletion m4/ax_llvm_c.m4
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ AC_ARG_WITH([llvm],
LLVM_CXXFLAGS=`$ac_llvm_config_path --cxxflags`
LLVM_LDFLAGS="$($ac_llvm_config_path --ldflags)"
LLVM_LIBS="$($ac_llvm_config_path --libs $1)"
LLVM_VERSION="$(llvm-config --version | sed s/\\.// | sed s/svn//g)"
LLVM_VERSION="$($ac_llvm_config_path --version | sed s/\\.// | sed s/svn//g)"
LLVM_CONFIG_BINDIR="$($ac_llvm_config_path --bindir)"
AC_REQUIRE([AC_PROG_CXX])
Expand Down Expand Up @@ -109,5 +110,6 @@ AC_ARG_WITH([llvm],
AC_SUBST(LLVM_LIBS)
AC_DEFINE(HAVE_LLVM,,[Defined if LLVM is available])
AC_DEFINE_UNQUOTED(LLVM_VERSION,[$LLVM_VERSION],[Version of LLVM installed])
AC_DEFINE_UNQUOTED(LLVM_CONFIG_BINDIR,["$LLVM_CONFIG_BINDIR"],[Location of LLVM binaries])
fi
])
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ AM_LDFLAGS = -rdynamic $(LLVM_LDFLAGS)
BUILT_SOURCES = parse.h

libnvc_a_SOURCES = lib.c util.c ident.c parse.y lexer.l tree.c type.c \
sem.c elab.c simp.c driver.c dump.c opt.c
sem.c elab.c simp.c driver.c dump.c opt.c link.c

libcgen_a_SOURCES = cgen.c link.c
libcgen_a_SOURCES = cgen.c
libcgen_a_CFLAGS = $(AM_CFLAGS) $(LLVM_CFLAGS)

nvc_SOURCES = nvc.c
Expand Down
4 changes: 1 addition & 3 deletions src/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <sys/types.h>
#include <sys/wait.h>

#include "llvm/Config/llvm-config.h"

#define MAX_ARGS 64
#define ARG_LEN 256

Expand Down Expand Up @@ -100,7 +98,7 @@ void link_bc(tree_t top)
{
args = xmalloc(MAX_ARGS * sizeof(char*));

link_arg_f("%s/llvm-ld", LLVM_BINDIR);
link_arg_f("%s/llvm-ld", LLVM_CONFIG_BINDIR);
link_arg_f("-v");
link_arg_f("-r");
link_arg_f("-stats");
Expand Down

0 comments on commit 091bd35

Please sign in to comment.