Use AC_PROG_INSTALL to find a usable install

Thanks to LeftWing aka Joshua M. Clulow. This patch is based on his work.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2067 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-07-05 16:35:48 +00:00
parent b667c0ed96
commit eb307ddc6f
5 changed files with 124 additions and 10 deletions
+10 -6
View File
@@ -23,6 +23,10 @@ LIBZNCDIR:= @LIBZNCDIR@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
PKGCONFIGDIR := $(libdir)/pkgconfig
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
INSTALL_SCRIPT := @INSTALL_SCRIPT@
INSTALL_DATA := @INSTALL_DATA@
LIB_SRCS := ZNCString.cpp Csocket.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
DCCSock.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp MD5.cpp Buffer.cpp Utils.cpp \
@@ -77,15 +81,15 @@ install: znc $(LIBZNC)
mkdir -p $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)
cp -Rp $(srcdir)/webskins $(DESTDIR)$(DATADIR)
install -m 0755 znc $(DESTDIR)$(bindir)
install -m 0755 znc-config $(DESTDIR)$(bindir)
install -m 0755 znc-buildmod $(DESTDIR)$(bindir)
install -m 0644 $(srcdir)/*.h $(DESTDIR)$(includedir)/znc
install -m 0644 znc.pc $(DESTDIR)$(PKGCONFIGDIR)
$(INSTALL_PROGRAM) znc $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) znc-config $(DESTDIR)$(bindir)
$(INSTALL_SCRIPT) znc-buildmod $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(srcdir)/*.h $(DESTDIR)$(includedir)/znc
$(INSTALL_DATA) znc.pc $(DESTDIR)$(PKGCONFIGDIR)
@$(MAKE) -C modules install DESTDIR=$(DESTDIR);
if test -n "$(LIBZNC)"; then \
mkdir -p $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
install -m 0755 $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
$(INSTALL_PROGRAM) $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
fi
@$(MAKE) -C man install DESTDIR=$(DESTDIR)
Vendored
+102
View File
@@ -584,6 +584,9 @@ build_os
build_vendor
build_cpu
build
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
OBJEXT
EXEEXT
ac_ct_CXX
@@ -2448,6 +2451,99 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# 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:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -4501,6 +4597,7 @@ gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
test -n "\$AWK" || AWK=awk
_ACEOF
@@ -4926,6 +5023,10 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -4979,6 +5080,7 @@ s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
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
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+1
View File
@@ -16,6 +16,7 @@ AC_DEFUN([ZNC_AUTO_FAIL], [
# AC_PROG_CXX sets CXXFLAGS to "-O2 -g" if it is unset which we don't want
CXXFLAGS="$CXXFLAGS "
AC_PROG_CXX
AC_PROG_INSTALL
AC_CANONICAL_HOST
AC_SYS_LARGEFILE
+4 -1
View File
@@ -8,6 +8,9 @@ exec_prefix := @exec_prefix@
datarootdir := @datarootdir@
mandir := @mandir@
INSTALL := @INSTALL@
INSTALL_DATA := @INSTALL_DATA@
MAN1 := znc.1.gz znc-buildmod.1.gz znc-config.1.gz
all: $(MAN1)
@@ -20,7 +23,7 @@ clean:
install: $(MAN1)
mkdir -p $(DESTDIR)$(mandir)/man1
install -m 644 $(MAN1) $(DESTDIR)$(mandir)/man1
$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(mandir)/man1
uninstall:
for file in $(MAN1) ; do \
+7 -3
View File
@@ -26,6 +26,10 @@ MODDIR := @MODDIR@
DATADIR := @DATADIR@
LIBZNC := @LIBZNC@
LIBZNCDIR:= @LIBZNCDIR@
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
INSTALL_SCRIPT := @INSTALL_SCRIPT@
INSTALL_DATA := @INSTALL_DATA@
TCL_FLAGS:= @TCL_FLAGS@
@@ -86,7 +90,7 @@ CLEAN := *.so extra/*.so
all: $(TARGETS)
install: all create_install_dir install_metadirs $(PERLHOOK) $(TCLHOOK)
install -m 0755 $(TARGETS) $(DESTDIR)$(MODDIR)
$(INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)$(MODDIR)
create_install_dir:
mkdir -p $(DESTDIR)$(MODDIR)
@@ -111,12 +115,12 @@ clean:
modperl_install: create_install_dir
for i in $(srcdir)/*.pm; do \
install -m 0644 $$i $(DESTDIR)$(MODDIR); \
$(INSTALL_DATA) $$i $(DESTDIR)$(MODDIR); \
done
modtcl_install:
mkdir -p $(DESTDIR)$(DATADIR)/modtcl/
install -m 0644 $(srcdir)/extra/modtcl.tcl $(srcdir)/extra/binds.tcl $(DESTDIR)$(DATADIR)/modtcl/
$(INSTALL_DATA) $(srcdir)/extra/modtcl.tcl $(srcdir)/extra/binds.tcl $(DESTDIR)$(DATADIR)/modtcl/
uninstall:
# Yes, we are lazy, just remove everything in there