Browse Source

Add a build variable

This variable, EXECSUFFIX, makes sure that my bc will not interfere with
other installed bc's.
signals
Gavin Howard 3 years ago
parent
commit
5d05715dad
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 7
      Makefile.in
  2. 5
      configure.sh
  3. 11
      install.sh

7
Makefile.in

@ -80,6 +80,7 @@ BC = bc
DC = dc
BC_EXEC = $(BIN)/$(BC)
DC_EXEC = $(BIN)/$(DC)
EXEC_SUFFIX = %%EXECSUFFIX%%
MANUALS = manuals
BC_MANPAGE_NAME = $(BC).1
@ -273,19 +274,19 @@ install_dc_manpage:
$(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(DC_MANPAGE) $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME)
install:%%INSTALL_PREREQS%%
$(INSTALL) $(DESTDIR)$(BINDIR) $(BIN)
$(INSTALL) $(DESTDIR)$(BINDIR) $(BIN) $(EXEC_SUFFIX)
uninstall_bc_manpage:
$(RM) -f $(DESTDIR)$(MAN1DIR)/$(BC_MANPAGE_NAME)
uninstall_bc:
$(RM) -f $(DESTDIR)$(BINDIR)/$(BC)
$(RM) -f $(DESTDIR)$(BINDIR)/$(BC)$(EXEC_SUFFIX)
uninstall_dc_manpage:
$(RM) -f $(DESTDIR)$(MAN1DIR)/$(DC_MANPAGE_NAME)
uninstall_dc:
$(RM) -f $(DESTDIR)$(BINDIR)/$(DC)
$(RM) -f $(DESTDIR)$(BINDIR)/$(DC)$(EXEC_SUFFIX)
uninstall:%%UNINSTALL_MAN_PREREQS%%%%UNINSTALL_PREREQS%%

5
configure.sh

@ -95,6 +95,10 @@ usage() {
printf ' MANDIR The location to install manpages to. Default is "$DATADIR/man".\n'
printf ' MAN1DIR The location to install Section 1 manpages to. Default is\n'
printf ' "$MANDIR/man1".\n'
printf ' EXECSUFFIX The suffix to append to the executable names, used to not\n'
printf ' interfere with other installed bc executables. This can only\n'
printf ' be a suffix because bc uses the first letter of the executable\n'
printf ' name to switch between bc and dc. Default is "".\n'
printf ' DESTDIR For package creation. Default is "".\n'
printf ' GEN_EMU Emulator to run string generator code under\n'
printf ' (leave empty if not necessary). Default is "".\n'
@ -497,6 +501,7 @@ contents=$(replace "$contents" "BC_LIB2_O" "$BC_LIB2_O")
contents=$(replace "$contents" "KARATSUBA_LEN" "$karatsuba_len")
contents=$(replace "$contents" "DESTDIR" "$DESTDIR")
contents=$(replace "$contents" "EXECSUFFIX" "$EXECSUFFIX")
contents=$(replace "$contents" "BINDIR" "$BINDIR")
contents=$(replace "$contents" "MAN1DIR" "$MAN1DIR")
contents=$(replace "$contents" "CFLAGS" "$CFLAGS")

11
install.sh

@ -15,7 +15,7 @@
#
usage() {
printf "usage: %s install_dir bin_dir\n" "$0" 1>&2
printf "usage: %s install_dir bin_dir exec_suffix\n" "$0" 1>&2
exit 1
}
@ -24,7 +24,7 @@ scriptdir=$(dirname "$script")
INSTALL="$scriptdir/safe-install.sh"
test "$#" -gt 1 || usage
test "$#" -ge 3 || usage
installdir="$1"
shift
@ -32,6 +32,9 @@ shift
bindir="$1"
shift
exec_suffix="$1"
shift
cd "$bindir"
for exe in ./*; do
@ -41,9 +44,9 @@ for exe in ./*; do
if [ -L "$exe" ]; then
L=$(ls -dl "$exe")
link=$(printf ${L#*-> })
"$INSTALL" -Dlm 755 "$link" "$installdir/$base"
"$INSTALL" -Dlm 755 "$link$exec_suffix" "$installdir/$base$exec_suffix"
else
"$INSTALL" -Dm 755 "$exe" "$installdir/$base"
"$INSTALL" -Dm 755 "$exe" "$installdir/$base$exec_suffix"
fi
done

Loading…
Cancel
Save