1dnl 2dnl We need routines to check that make works. Possible problems with 3dnl make include 4dnl 5dnl It is really gnumake, and contrary to the documentation on gnumake, 6dnl it insists on screaming everytime a directory is changed. The fix 7dnl is to add the argument --no-print-directory to the make 8dnl 9dnl It is really BSD 4.4 make, and can't handle 'include'. For some 10dnl systems, this can be fatal; there is no fix (other than removing this 11dnl alleged make). 12dnl 13dnl It is the OSF V3 make, and can't handle a comment in a block of target 14dnl code. There is no acceptable fix. 15dnl 16dnl 17dnl 18dnl 19dnl Find a make program if none is defined. 20AC_DEFUN([PAC_PROG_MAKE_PROGRAM],[true 21if test "X$MAKE" = "X" ; then 22 AC_CHECK_PROGS(MAKE,make gnumake nmake pmake smake) 23fi 24])dnl 25 26dnl/*D 27dnl PAC_PROG_MAKE_INCLUDE - Check whether make supports include 28dnl 29dnl Synopsis: 30dnl PAC_PROG_MAKE_INCLUDE([action if true],[action if false]) 31dnl 32dnl Output Effect: 33dnl None 34dnl 35dnl Notes: 36dnl This checks for makes that do not support 'include filename'. Some 37dnl versions of BSD 4.4 make required '#include' instead; some versions of 38dnl 'pmake' have the same syntax. 39dnl 40dnl See Also: 41dnl PAC_PROG_MAKE 42dnl 43dnl D*/ 44AC_DEFUN([PAC_PROG_MAKE_INCLUDE],[ 45AC_CACHE_CHECK([whether make supports include],pac_cv_prog_make_include,[ 46AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) 47# This is needed for Mac OSX 10.5 48rm -rf conftest.dSYM 49rm -f conftest 50cat > conftest <<. 51ALL: 52 @echo "success" 53. 54cat > conftest1 <<. 55include conftest 56. 57pac_str=`$MAKE -f conftest1 2>&1` 58# This is needed for Mac OSX 10.5 59rm -rf conftest.dSYM 60rm -f conftest conftest1 61if test "$pac_str" != "success" ; then 62 pac_cv_prog_make_include="no" 63else 64 pac_cv_prog_make_include="yes" 65fi 66]) 67if test "$pac_cv_prog_make_include" = "no" ; then 68 ifelse([$2],,:,[$2]) 69else 70 ifelse([$1],,:,[$1]) 71fi 72])dnl 73 74dnl/*D 75dnl PAC_PROG_MAKE_ALLOWS_COMMENTS - Check whether comments are allowed in 76dnl shell commands in a makefile 77dnl 78dnl Synopsis: 79dnl PAC_PROG_MAKE_ALLOWS_COMMENTS([false text]) 80dnl 81dnl Output Effect: 82dnl Issues a warning message if comments are not allowed in a makefile. 83dnl Executes the argument if one is given. 84dnl 85dnl Notes: 86dnl Some versions of OSF V3 make do not all comments in action commands. 87dnl 88dnl See Also: 89dnl PAC_PROG_MAKE 90dnl D*/ 91dnl 92AC_DEFUN([PAC_PROG_MAKE_ALLOWS_COMMENTS],[ 93AC_CACHE_CHECK([whether make allows comments in actions], 94pac_cv_prog_make_allows_comments,[ 95AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) 96# This is needed for Mac OSX 10.5 97rm -rf conftest.dSYM 98rm -f conftest 99cat > conftest <<. 100SHELL=/bin/sh 101ALL: 102 @# This is a valid comment! 103 @echo "success" 104. 105pac_str=`$MAKE -f conftest 2>&1` 106# This is needed for Mac OSX 10.5 107rm -rf conftest.dSYM 108rm -f conftest 109if test "$pac_str" != "success" ; then 110 pac_cv_prog_make_allows_comments="no" 111else 112 pac_cv_prog_make_allows_comments="yes" 113fi 114]) 115if test "$pac_cv_prog_make_allows_comments" = "no" ; then 116 AC_MSG_WARN([Your make does not allow comments in target code. 117Using this make may cause problems when building programs. 118You should consider using gnumake instead.]) 119 ifelse([$1],,[$1]) 120fi 121])dnl 122 123dnl/*D 124dnl PAC_PROG_MAKE_VPATH - Check whether make supports source-code paths. 125dnl 126dnl Synopsis: 127dnl PAC_PROG_MAKE_VPATH 128dnl 129dnl Output Effect: 130dnl Sets the variable 'VPATH' to either 131dnl.vb 132dnl VPATH = .:${srcdir} 133dnl.ve 134dnl or 135dnl.vb 136dnl .PATH: . ${srcdir} 137dnl.ve 138dnl 139dnl Notes: 140dnl The test checks that the path works with implicit targets (some makes 141dnl support only explicit targets with 'VPATH' or 'PATH'). 142dnl 143dnl NEED TO DO: Check that $< works on explicit targets. 144dnl 145dnl See Also: 146dnl PAC_PROG_MAKE 147dnl 148dnl D*/ 149AC_DEFUN([PAC_PROG_MAKE_VPATH],[ 150AC_SUBST(VPATH) 151dnl AM_IGNORE(VPATH) 152AC_CACHE_CHECK([for virtual path format], 153pac_cv_prog_make_vpath,[ 154AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) 155# This is needed for Mac OSX 10.5 156rm -rf conftest.dSYM 157rm -rf conftest* 158mkdir conftestdir 159cat >conftestdir/a.c <<EOF 160A sample file 161EOF 162cat > conftest <<EOF 163all: a.o 164VPATH=.:conftestdir 165.c.o: 166 @echo \$< 167EOF 168ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'` 169if test -n "$ac_out" ; then 170 pac_cv_prog_make_vpath="VPATH" 171else 172 rm -f conftest 173 cat > conftest <<EOF 174all: a.o 175.PATH: . conftestdir 176.c.o: 177 @echo \$< 178EOF 179 ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'` 180 if test -n "$ac_out" ; then 181 pac_cv_prog_make_vpath=".PATH" 182 else 183 pac_cv_prog_make_vpath="neither VPATH nor .PATH works" 184 fi 185fi 186# This is needed for Mac OSX 10.5 187rm -rf conftest.dSYM 188rm -rf conftest* 189]) 190if test "$pac_cv_prog_make_vpath" = "VPATH" ; then 191 VPATH='VPATH=.:${srcdir}' 192elif test "$pac_cv_prog_make_vpath" = ".PATH" ; then 193 VPATH='.PATH: . ${srcdir}' 194fi 195])dnl 196 197dnl/*D 198dnl PAC_PROG_MAKE_SET_CFLAGS - Check whether make sets CFLAGS 199dnl 200dnl Synopsis: 201dnl PAC_PROG_MAKE_SET_CFLAGS([action if true],[action if false]) 202dnl 203dnl Output Effects: 204dnl Executes the first argument if 'CFLAGS' is set by 'make'; executes 205dnl the second argument if 'CFLAGS' is not set by 'make'. 206dnl 207dnl Notes: 208dnl If 'CFLAGS' is set by make, you may wish to override that choice in your 209dnl makefile. 210dnl 211dnl See Also: 212dnl PAC_PROG_MAKE 213dnl D*/ 214AC_DEFUN([PAC_PROG_MAKE_SET_CFLAGS],[ 215AC_CACHE_CHECK([whether make sets CFLAGS], 216pac_cv_prog_make_set_cflags,[ 217AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) 218# This is needed for Mac OSX 10.5 219rm -rf conftest.dSYM 220rm -f conftest 221cat > conftest <<EOF 222SHELL=/bin/sh 223ALL: 224 @echo X[\$]{CFLAGS}X 225EOF 226pac_str=`$MAKE -f conftest 2>&1` 227# This is needed for Mac OSX 10.5 228rm -rf conftest.dSYM 229rm -f conftest 230if test "$pac_str" = "XX" ; then 231 pac_cv_prog_make_set_cflags="no" 232else 233 pac_cv_prog_make_set_cflags="yes" 234fi 235]) 236if test "$pac_cv_prog_make_set_cflags" = "no" ; then 237 ifelse([$2],,:,[$2]) 238else 239 ifelse([$1],,:,[$1]) 240fi 241])dnl 242 243dnl/*D 244dnl PAC_PROG_MAKE_CLOCK_SKEW - Check whether there is a problem with 245dnl clock skew in suing make. 246dnl 247dnl Effect: 248dnl Sets the cache variable 'pac_cv_prog_make_found_clock_skew' to yes or no 249dnl D*/ 250AC_DEFUN([PAC_PROG_MAKE_CLOCK_SKEW],[ 251AC_CACHE_CHECK([whether clock skew breaks make], 252pac_cv_prog_make_found_clock_skew,[ 253AC_REQUIRE([PAC_PROG_MAKE_PROGRAM]) 254# This is needed for Mac OSX 10.5 255rm -rf conftest.dSYM 256rm -f conftest* 257cat > conftest <<EOF 258ALL: 259 @-echo "success" 260EOF 261$MAKE -f conftest > conftest.out 2>&1 262if grep -i skew conftest >/dev/null 2>&1 ; then 263 pac_cv_prog_make_found_clock_skew=yes 264else 265 pac_cv_prog_make_found_clock_skew=no 266fi 267# This is needed for Mac OSX 10.5 268rm -rf conftest.dSYM 269rm -f conftest* 270]) 271dnl We should really do something if we detect clock skew. The question is, 272dnl what? 273if test "$pac_cv_prog_make_found_clock_skew" = "yes" ; then 274 AC_MSG_WARN([Clock skew found by make. The configure and build may fail. 275Consider building in a local instead of NFS filesystem.]) 276fi 277]) 278 279dnl/*D 280dnl PAC_PROG_MAKE - Checks for the varieties of MAKE, including support for 281dnl VPATH 282dnl 283dnl Synopsis: 284dnl PAC_PROG_MAKE 285dnl 286dnl Output Effect: 287dnl Sets 'MAKE' to the make program to use if 'MAKE' is not already set. 288dnl Sets the variable 'SET_CFLAGS' to 'CFLAGS =' if make sets 'CFLAGS'. 289dnl 290dnl Notes: 291dnl This macro uses 'PAC_PROG_MAKE_INCLUDE', 292dnl 'PAC_PROG_MAKE_ALLOWS_COMMENTS', 'PAC_PROG_MAKE_VPATH', and 293dnl 'PAC_PROG_MAKE_SET_CFLAGS'. See those commands for details about their 294dnl actions. 295dnl 296dnl It may call 'AC_PROG_MAKE_SET', which sets 'SET_MAKE' to 'MAKE = @MAKE@' 297dnl if the make program does not set the value of make, otherwise 'SET_MAKE' 298dnl is set to empty; if the make program echos the directory name, then 299dnl 'SET_MAKE' is set to 'MAKE = $MAKE'. 300dnl D*/ 301AC_DEFUN([PAC_PROG_MAKE],[ 302PAC_PROG_MAKE_PROGRAM 303PAC_PROG_MAKE_CLOCK_SKEW 304PAC_PROG_MAKE_INCLUDE 305PAC_PROG_MAKE_ALLOWS_COMMENTS 306PAC_PROG_MAKE_VPATH 307AC_SUBST(SET_CFLAGS) 308dnl AM_IGNORE(SET_CFLAGS) 309PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS=']) 310if test "$pac_cv_prog_make_echos_dir" = "no" ; then 311 AC_PROG_MAKE_SET 312else 313 SET_MAKE="MAKE=${MAKE-make}" 314fi 315]) 316