Skip to content

Commit

Permalink
Add --program-prefix support to build
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164633 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Sebastian Pop committed Sep 25, 2012
1 parent 2039a8f commit ba48ceb
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ endif

prefix := @prefix@
PROJ_prefix := $(prefix)
program_prefix := @program_prefix@
PROJ_VERSION := $(LLVMVersion)
else
ifndef PROJ_SRC_ROOT
Expand Down
4 changes: 2 additions & 2 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin
else
ToolBinDir = $(DESTDIR)$(PROJ_bindir)
endif
DestTool = $(ToolBinDir)/$(TOOLEXENAME)
DestTool = $(ToolBinDir)/$(program_prefix)$(TOOLEXENAME)

install-local:: $(DestTool)

Expand All @@ -1556,7 +1556,7 @@ uninstall-local::

# TOOLALIAS install.
ifdef TOOLALIAS
DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT)
DestToolAlias = $(ToolBinDir)/$(program_prefix)$(TOOLALIAS)$(EXEEXT)

install-local:: $(DestToolAlias)

Expand Down
5 changes: 5 additions & 0 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,11 @@ fi
dnl OCaml findlib META file
AC_CONFIG_FILES([bindings/ocaml/llvm/META.llvm])

dnl Add --program-prefix value to Makefile.rules. Already an ARG variable.
test "x$program_prefix" = "xNONE" && program_prefix=""
AC_SUBST([program_prefix])


dnl Do special configuration of Makefiles
AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
AC_CONFIG_MAKEFILE(Makefile)
Expand Down
16 changes: 10 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ OCAML_LIBDIR
ENABLE_VISIBILITY_INLINES_HIDDEN
RPATH
RDYNAMIC
program_prefix
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
Expand Down Expand Up @@ -10316,7 +10317,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 10319 "configure"
#line 10320 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -21409,6 +21410,10 @@ fi
ac_config_files="$ac_config_files bindings/ocaml/llvm/META.llvm"


test "x$program_prefix" = "xNONE" && program_prefix=""



ac_config_commands="$ac_config_commands setup"

ac_config_commands="$ac_config_commands Makefile"
Expand Down Expand Up @@ -22334,11 +22339,12 @@ OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
RPATH!$RPATH$ac_delim
RDYNAMIC!$RDYNAMIC$ac_delim
program_prefix!$program_prefix$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Expand All @@ -22357,7 +22363,7 @@ fi

cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
Expand All @@ -22370,8 +22376,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
:end
s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF

Expand Down Expand Up @@ -22619,7 +22623,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out

test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
Expand Down
4 changes: 2 additions & 2 deletions projects/sample/Makefile.llvm.rules
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ install-local::
uninstall-local::
$(Echo) Uninstall circumvented with NO_INSTALL
else
DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
DestTool = $(DESTDIR)$(PROJ_bindir)/$(program_prefix)$(TOOLEXENAME)

install-local:: $(DestTool)

Expand All @@ -1451,7 +1451,7 @@ uninstall-local::

# TOOLALIAS install.
ifdef TOOLALIAS
DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(program_prefix)$(TOOLALIAS)$(EXEEXT)

install-local:: $(DestToolAlias)

Expand Down
2 changes: 1 addition & 1 deletion tools/llvm-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ ifeq ($(LLVM_CROSS_COMPILING),1)
install:: $(DESTDIR)$(PROJ_bindir)
$(Echo) Installing llvm-config-host
$(Verb) $(ProgInstall) $(BuildLLVMToolDir)/llvm-config \
$(DESTDIR)$(PROJ_bindir)/llvm-config-host
$(DESTDIR)$(PROJ_bindir)/$(program_prefix)llvm-config-host
endif

0 comments on commit ba48ceb

Please sign in to comment.