Blame src/openpa/confdb/aclocal_make.m4

Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl We need routines to check that make works.  Possible problems with
Packit Service c5cf8c
dnl make include
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl It is really gnumake, and contrary to the documentation on gnumake,
Packit Service c5cf8c
dnl it insists on screaming everytime a directory is changed.  The fix
Packit Service c5cf8c
dnl is to add the argument --no-print-directory to the make
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl It is really BSD 4.4 make, and can't handle 'include'.  For some
Packit Service c5cf8c
dnl systems, this can be fatal; there is no fix (other than removing this
Packit Service c5cf8c
dnl alleged make).
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl It is the OSF V3 make, and can't handle a comment in a block of target
Packit Service c5cf8c
dnl code.  There is no acceptable fix.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Find a make program if none is defined.
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_PROGRAM],[true
Packit Service c5cf8c
if test "X$MAKE" = "X" ; then
Packit Service c5cf8c
   AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake)
Packit Service c5cf8c
fi
Packit Service c5cf8c
])dnl
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Synopsis:
Packit Service c5cf8c
dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false])
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Output Effect:
Packit Service c5cf8c
dnl   None
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Notes:
Packit Service c5cf8c
dnl  This checks for makes that do not support 'include filename'.  Some
Packit Service c5cf8c
dnl  versions of BSD 4.4 make required '#include' instead; some versions of
Packit Service c5cf8c
dnl  'pmake' have the same syntax.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl See Also:
Packit Service c5cf8c
dnl  PAC_PROG_MAKE
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_INCLUDE],[
Packit Service c5cf8c
AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[
Packit Service c5cf8c
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest
Packit Service c5cf8c
cat > conftest <<.
Packit Service c5cf8c
ALL:
Packit Service c5cf8c
	@echo "success"
Packit Service c5cf8c
.
Packit Service c5cf8c
cat > conftest1 <<.
Packit Service c5cf8c
include conftest
Packit Service c5cf8c
.
Packit Service c5cf8c
pac_str=`$MAKE -f conftest1 2>&1`
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest conftest1
Packit Service c5cf8c
if test "$pac_str" != "success" ; then
Packit Service c5cf8c
    pac_cv_prog_make_include="no"
Packit Service c5cf8c
else
Packit Service c5cf8c
    pac_cv_prog_make_include="yes"
Packit Service c5cf8c
fi
Packit Service c5cf8c
])
Packit Service c5cf8c
if test "$pac_cv_prog_make_include" = "no" ; then
Packit Service c5cf8c
    ifelse([$2],,:,[$2])
Packit Service c5cf8c
else
Packit Service c5cf8c
    ifelse([$1],,:,[$1])
Packit Service c5cf8c
fi
Packit Service c5cf8c
])dnl
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in 
Packit Service c5cf8c
dnl   shell commands in a makefile
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Synopsis:
Packit Service c5cf8c
dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text])
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Output Effect:
Packit Service c5cf8c
dnl Issues a warning message if comments are not allowed in a makefile.
Packit Service c5cf8c
dnl Executes the argument if one is given.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Notes:
Packit Service c5cf8c
dnl Some versions of OSF V3 make do not all comments in action commands.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl See Also:
Packit Service c5cf8c
dnl  PAC_PROG_MAKE
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
dnl
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_ALLOWS_COMMENTS],[
Packit Service c5cf8c
AC_CACHE_CHECK([whether make allows comments in actions],
Packit Service c5cf8c
pac_cv_prog_make_allows_comments,[
Packit Service c5cf8c
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest
Packit Service c5cf8c
cat > conftest <<.
Packit Service c5cf8c
SHELL=/bin/sh
Packit Service c5cf8c
ALL:
Packit Service c5cf8c
	@# This is a valid comment!
Packit Service c5cf8c
	@echo "success"
Packit Service c5cf8c
.
Packit Service c5cf8c
pac_str=`$MAKE -f conftest 2>&1`
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest 
Packit Service c5cf8c
if test "$pac_str" != "success" ; then
Packit Service c5cf8c
    pac_cv_prog_make_allows_comments="no"
Packit Service c5cf8c
else
Packit Service c5cf8c
    pac_cv_prog_make_allows_comments="yes"
Packit Service c5cf8c
fi
Packit Service c5cf8c
])
Packit Service c5cf8c
if test "$pac_cv_prog_make_allows_comments" = "no" ; then
Packit Service c5cf8c
    AC_MSG_WARN([Your make does not allow comments in target code.
Packit Service c5cf8c
Using this make may cause problems when building programs.
Packit Service c5cf8c
You should consider using gnumake instead.])
Packit Service c5cf8c
    ifelse([$1],,[$1])
Packit Service c5cf8c
fi
Packit Service c5cf8c
])dnl
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Synopsis:
Packit Service c5cf8c
dnl PAC_PROG_MAKE_VPATH
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Output Effect:
Packit Service c5cf8c
dnl Sets the variable 'VPATH' to either
Packit Service c5cf8c
dnl.vb
Packit Service c5cf8c
dnl VPATH = .:${srcdir}
Packit Service c5cf8c
dnl.ve
Packit Service c5cf8c
dnl or
Packit Service c5cf8c
dnl.vb
Packit Service c5cf8c
dnl .PATH: . ${srcdir}
Packit Service c5cf8c
dnl.ve
Packit Service c5cf8c
dnl 
Packit Service c5cf8c
dnl Notes:
Packit Service c5cf8c
dnl The test checks that the path works with implicit targets (some makes
Packit Service c5cf8c
dnl support only explicit targets with 'VPATH' or 'PATH').
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl NEED TO DO: Check that $< works on explicit targets.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl See Also:
Packit Service c5cf8c
dnl PAC_PROG_MAKE
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_VPATH],[
Packit Service c5cf8c
AC_SUBST(VPATH)
Packit Service c5cf8c
dnl AM_IGNORE(VPATH)
Packit Service c5cf8c
AC_CACHE_CHECK([for virtual path format],
Packit Service c5cf8c
pac_cv_prog_make_vpath,[
Packit Service c5cf8c
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -rf conftest*
Packit Service c5cf8c
mkdir conftestdir
Packit Service c5cf8c
cat >conftestdir/a.c <
Packit Service c5cf8c
A sample file
Packit Service c5cf8c
EOF
Packit Service c5cf8c
cat > conftest <
Packit Service c5cf8c
all: a.o
Packit Service c5cf8c
VPATH=.:conftestdir
Packit Service c5cf8c
.c.o:
Packit Service c5cf8c
	@echo \$<
Packit Service c5cf8c
EOF
Packit Service c5cf8c
ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
Packit Service c5cf8c
if test -n "$ac_out" ; then 
Packit Service c5cf8c
    pac_cv_prog_make_vpath="VPATH"
Packit Service c5cf8c
else
Packit Service c5cf8c
    rm -f conftest
Packit Service c5cf8c
    cat > conftest <
Packit Service c5cf8c
all: a.o
Packit Service c5cf8c
.PATH: . conftestdir
Packit Service c5cf8c
.c.o:
Packit Service c5cf8c
	@echo \$<
Packit Service c5cf8c
EOF
Packit Service c5cf8c
    ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
Packit Service c5cf8c
    if test -n "$ac_out" ; then 
Packit Service c5cf8c
        pac_cv_prog_make_vpath=".PATH"
Packit Service c5cf8c
    else
Packit Service c5cf8c
	pac_cv_prog_make_vpath="neither VPATH nor .PATH works"
Packit Service c5cf8c
    fi
Packit Service c5cf8c
fi
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -rf conftest*
Packit Service c5cf8c
])
Packit Service c5cf8c
if test "$pac_cv_prog_make_vpath" = "VPATH" ; then
Packit Service c5cf8c
    VPATH='VPATH=.:${srcdir}'
Packit Service c5cf8c
elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then
Packit Service c5cf8c
    VPATH='.PATH: . ${srcdir}'
Packit Service c5cf8c
fi
Packit Service c5cf8c
])dnl
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Synopsis:
Packit Service c5cf8c
dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false])
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Output Effects:
Packit Service c5cf8c
dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes
Packit Service c5cf8c
dnl the second argument if 'CFLAGS' is not set by 'make'.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Notes:
Packit Service c5cf8c
dnl If 'CFLAGS' is set by make, you may wish to override that choice in your
Packit Service c5cf8c
dnl makefile.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl See Also:
Packit Service c5cf8c
dnl PAC_PROG_MAKE
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_SET_CFLAGS],[
Packit Service c5cf8c
AC_CACHE_CHECK([whether make sets CFLAGS],
Packit Service c5cf8c
pac_cv_prog_make_set_cflags,[
Packit Service c5cf8c
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest
Packit Service c5cf8c
cat > conftest <
Packit Service c5cf8c
SHELL=/bin/sh
Packit Service c5cf8c
ALL:
Packit Service c5cf8c
	@echo X[\$]{CFLAGS}X
Packit Service c5cf8c
EOF
Packit Service c5cf8c
pac_str=`$MAKE -f conftest 2>&1`
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest 
Packit Service c5cf8c
if test "$pac_str" = "XX" ; then
Packit Service c5cf8c
    pac_cv_prog_make_set_cflags="no"
Packit Service c5cf8c
else
Packit Service c5cf8c
    pac_cv_prog_make_set_cflags="yes"
Packit Service c5cf8c
fi
Packit Service c5cf8c
])
Packit Service c5cf8c
if test "$pac_cv_prog_make_set_cflags" = "no" ; then
Packit Service c5cf8c
    ifelse([$2],,:,[$2])
Packit Service c5cf8c
else
Packit Service c5cf8c
    ifelse([$1],,:,[$1])
Packit Service c5cf8c
fi
Packit Service c5cf8c
])dnl
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with 
Packit Service c5cf8c
dnl clock skew in suing make.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Effect:
Packit Service c5cf8c
dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE_CLOCK_SKEW],[
Packit Service c5cf8c
AC_CACHE_CHECK([whether clock skew breaks make],
Packit Service c5cf8c
pac_cv_prog_make_found_clock_skew,[
Packit Service c5cf8c
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest*
Packit Service c5cf8c
cat > conftest <
Packit Service c5cf8c
ALL:
Packit Service c5cf8c
	@-echo "success"
Packit Service c5cf8c
EOF
Packit Service c5cf8c
$MAKE -f conftest > conftest.out 2>&1
Packit Service c5cf8c
if grep -i skew conftest >/dev/null 2>&1 ; then
Packit Service c5cf8c
    pac_cv_prog_make_found_clock_skew=yes
Packit Service c5cf8c
else
Packit Service c5cf8c
    pac_cv_prog_make_found_clock_skew=no
Packit Service c5cf8c
fi
Packit Service c5cf8c
# This is needed for Mac OSX 10.5
Packit Service c5cf8c
rm -rf conftest.dSYM
Packit Service c5cf8c
rm -f conftest*
Packit Service c5cf8c
])
Packit Service c5cf8c
dnl We should really do something if we detect clock skew.  The question is,
Packit Service c5cf8c
dnl what?
Packit Service c5cf8c
if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then
Packit Service c5cf8c
    AC_MSG_WARN([Clock skew found by make.  The configure and build may fail.
Packit Service c5cf8c
Consider building in a local instead of NFS filesystem.])
Packit Service c5cf8c
fi
Packit Service c5cf8c
])
Packit Service c5cf8c
Packit Service c5cf8c
dnl/*D
Packit Service c5cf8c
dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for 
Packit Service c5cf8c
dnl VPATH
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Synopsis:
Packit Service c5cf8c
dnl PAC_PROG_MAKE
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Output Effect:
Packit Service c5cf8c
dnl Sets 'MAKE' to the make program to use if 'MAKE' is not already set.
Packit Service c5cf8c
dnl Sets the variable 'SET_CFLAGS' to 'CFLAGS =' if make sets 'CFLAGS'.
Packit Service c5cf8c
dnl
Packit Service c5cf8c
dnl Notes:
Packit Service c5cf8c
dnl This macro uses 'PAC_PROG_MAKE_INCLUDE',
Packit Service c5cf8c
dnl 'PAC_PROG_MAKE_ALLOWS_COMMENTS', 'PAC_PROG_MAKE_VPATH', and
Packit Service c5cf8c
dnl 'PAC_PROG_MAKE_SET_CFLAGS'.  See those commands for details about their
Packit Service c5cf8c
dnl actions.
Packit Service c5cf8c
dnl 
Packit Service c5cf8c
dnl It may call 'AC_PROG_MAKE_SET', which sets 'SET_MAKE' to 'MAKE = @MAKE@'
Packit Service c5cf8c
dnl if the make program does not set the value of make, otherwise 'SET_MAKE'
Packit Service c5cf8c
dnl is set to empty; if the make program echos the directory name, then 
Packit Service c5cf8c
dnl 'SET_MAKE' is set to 'MAKE = $MAKE'.
Packit Service c5cf8c
dnl D*/
Packit Service c5cf8c
AC_DEFUN([PAC_PROG_MAKE],[
Packit Service c5cf8c
PAC_PROG_MAKE_PROGRAM
Packit Service c5cf8c
PAC_PROG_MAKE_CLOCK_SKEW
Packit Service c5cf8c
PAC_PROG_MAKE_INCLUDE
Packit Service c5cf8c
PAC_PROG_MAKE_ALLOWS_COMMENTS
Packit Service c5cf8c
PAC_PROG_MAKE_VPATH
Packit Service c5cf8c
AC_SUBST(SET_CFLAGS)
Packit Service c5cf8c
dnl AM_IGNORE(SET_CFLAGS)
Packit Service c5cf8c
PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS='])
Packit Service c5cf8c
if test "$pac_cv_prog_make_echos_dir" = "no" ; then
Packit Service c5cf8c
    AC_PROG_MAKE_SET
Packit Service c5cf8c
else
Packit Service c5cf8c
    SET_MAKE="MAKE=${MAKE-make}"
Packit Service c5cf8c
fi
Packit Service c5cf8c
])