Blame confdb/aclocal_bugfix.m4

Packit 0848f5
dnl This internal macro fails to work properly with OTHER internal macros.
Packit 0848f5
dnl Basically, if the prologue is [], then no message should be generated.
Packit 0848f5
dnl This macro is in autoconf 2.52
Packit 0848f5
m4_define([AC_LANG_PROGRAM(Fortran 77)],
Packit 0848f5
[m4_if([$1],[[[]]],,[m4_ifval([$1],
Packit 0848f5
       [m4_warn([syntax], [$0: ignoring PROLOGUE: $1])])])dnl
Packit 0848f5
      program main
Packit 0848f5
$2
Packit 0848f5
      end])
Packit 0848f5
Packit 0848f5
Packit 0848f5
dnl/*D
Packit 0848f5
dnl PAC_PROG_CHECK_INSTALL_WORKS - Check whether the install program in INSTALL
Packit 0848f5
dnl works.
Packit 0848f5
dnl
Packit 0848f5
dnl Synopsis:
Packit 0848f5
dnl PAC_PROG_CHECK_INSTALL_WORKS
Packit 0848f5
dnl
Packit 0848f5
dnl Output Effect:
Packit 0848f5
dnl   Sets the variable 'INSTALL' to the value of 'ac_sh_install' if 
Packit 0848f5
dnl   a file cannot be installed into a local directory with the 'INSTALL'
Packit 0848f5
dnl   program
Packit 0848f5
dnl
Packit 0848f5
dnl Notes:
Packit 0848f5
dnl   The 'AC_PROG_INSTALL' scripts tries to avoid broken versions of 
Packit 0848f5
dnl   install by avoiding directories such as '/usr/sbin' where some 
Packit 0848f5
dnl   systems are known to have bad versions of 'install'.  Unfortunately, 
Packit 0848f5
dnl   this is exactly the sort of test-on-name instead of test-on-capability
Packit 0848f5
dnl   that 'autoconf' is meant to eliminate.  The test in this script
Packit 0848f5
dnl   is very simple but has been adequate for working around problems 
Packit 0848f5
dnl   on Solaris, where the '/usr/sbin/install' program (known by 
Packit 0848f5
dnl   autoconf to be bad because it is in /usr/sbin) is also reached by a 
Packit 0848f5
dnl   soft link through /bin, which autoconf believes is good.
Packit 0848f5
dnl
Packit 0848f5
dnl   No variables are cached to ensure that we do not make a mistake in 
Packit 0848f5
dnl   our choice of install program.
Packit 0848f5
dnl
Packit 0848f5
dnl   The Solaris configure requires the directory name to immediately
Packit 0848f5
dnl   follow the '-c' argument, rather than the more common 
Packit 0848f5
dnl.vb
Packit 0848f5
dnl      args sourcefiles destination-dir
Packit 0848f5
dnl.ve
Packit 0848f5
dnl D*/
Packit 0848f5
AC_DEFUN([PAC_PROG_CHECK_INSTALL_WORKS],[
Packit 0848f5
if test -z "$INSTALL" ; then
Packit 0848f5
    AC_MSG_RESULT([No install program available])
Packit 0848f5
else
Packit 0848f5
    # first make any "confdb/install-sh -c" into an absolute path
Packit 0848f5
    # this is a hack, but it's still much cleaner than anything else I could
Packit 0848f5
    # come up with (see tt#1007) [goodell@]
Packit 0848f5
    AS_CASE(["$INSTALL"],
Packit 0848f5
            [/*],[:],
Packit 0848f5
            [*install-sh*],[INSTALL="$master_top_srcdir/$INSTALL"])
Packit 0848f5
Packit 0848f5
    # Check that this install really works
Packit 0848f5
    rm -f conftest
Packit 0848f5
    echo "Test file" > conftest
Packit 0848f5
    if test ! -d .conftest ; then mkdir .conftest ; fi
Packit 0848f5
    AC_MSG_CHECKING([whether install works])
Packit 0848f5
    if $INSTALL conftest .conftest >/dev/null 2>&1 ; then
Packit 0848f5
        installOk=yes
Packit 0848f5
    else
Packit 0848f5
        installOk=no
Packit 0848f5
    fi
Packit 0848f5
    rm -rf .conftest conftest
Packit 0848f5
    AC_MSG_RESULT($installOk)
Packit 0848f5
    if test "$installOk" = no ; then
Packit 0848f5
        if test -n "$ac_install_sh" ; then
Packit 0848f5
            INSTALL=$ac_install_sh
Packit 0848f5
        else
Packit 0848f5
	    AC_MSG_ERROR([Unable to find working install])
Packit 0848f5
        fi
Packit 0848f5
    fi
Packit 0848f5
fi
Packit 0848f5
])