Blame src/openpa/confdb/aclocal_bugfix.m4

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