Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
AR="$(AR)" \
- SED="$(SED)" STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
+ GREP="$(GREP)" SED="$(SED)" STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
MANIFEST_TOOL="$(MANIFEST_TOOL)" \
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
LT_AT_BOOTSTRAP([--copy], [-I m4], [ignore], [--add-missing])
LT_AT_EXEC_CHECK([subdir/subdemo], 0, stdout)
-AT_CHECK([grep 'Welcome to GNU Libtool subdir-objects test' stdout],
+AT_CHECK([$GREP 'Welcome to GNU Libtool subdir-objects test' stdout],
[], [ignore])
-AT_CHECK([grep 'This is libsub' stdout],
+AT_CHECK([$GREP 'This is libsub' stdout],
[], [ignore])
AT_CLEANUP
AT_CHECK([$LIBTOOL --mode=install cp libbar.la $thisdir], [], [ignore], [ignore])
eval `$EGREP '^(old_library)=' < libbar.la`
libbar=$old_library
-AT_CHECK([$AR -t $libbar | grep $libfoo],[1],[ignore],[ignore])
-AT_CHECK([$AR -t $libbar | grep foo.$OBJEXT],[],[ignore],[ignore])
-AT_CHECK([$AR -t $libbar | grep bar.$OBJEXT],[],[ignore],[ignore])
+AT_CHECK([$AR -t $libbar | $GREP $libfoo],[1],[ignore],[ignore])
+AT_CHECK([$AR -t $libbar | $GREP foo.$OBJEXT],[],[ignore],[ignore])
+AT_CHECK([$AR -t $libbar | $GREP bar.$OBJEXT],[],[ignore],[ignore])
AT_CLEANUP
curdir=`pwd`
-eval "`$LIBTOOL --config | grep '^objdir='`"
+eval "`$LIBTOOL --config | $GREP '^objdir='`"
AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC -c -o foo.lo $CPPFLAGS $CFLAGS foo.c],[0],[ignore],[ignore])
AT_CHECK([$LIBTOOL --mode=compile --tag=CC $CC -c -o baz.lo $CPPFLAGS $CFLAGS baz.c],[0],[ignore],[ignore])
;;
esac
-eval "`$LIBTOOL --config | grep '^build_libtool_libs='`"
+eval "`$LIBTOOL --config | $GREP '^build_libtool_libs='`"
AT_CHECK([test yes = "$build_libtool_libs" || exit 77])
####
LT_AT_BOOTSTRAP([--ltdl], [-I libltdl/m4], [ignore], [ignore], [], [], [ignore])
AT_CHECK([$MAKE print-ltdl], [], [stdout], [ignore])
-AT_CHECK([grep libltdl/libltdlc.la stdout], [], [ignore])
+AT_CHECK([$GREP libltdl/libltdlc.la stdout], [], [ignore])
AT_CLEANUP
AT_KEYWORDS([libtool])
# make sure existing libtool is configured for shared libraries
-AT_CHECK([$LIBTOOL --features | grep 'disable shared libraries' && exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'disable shared libraries' && exit 77],
[1], [ignore])
AT_DATA([trivial.c],
[], [ignore], [ignore])
LT_AT_EXEC_CHECK([./usea], [0], [ignore], [stderr], [--lt-debug])
LT_AT_UNIFY_NL([stderr])
-AT_CHECK([grep 'libtool wrapper' stderr], [0], [ignore], [ignore])
+AT_CHECK([$GREP 'libtool wrapper' stderr], [0], [ignore], [ignore])
# Test compile-time activation of wrapper debugging.
[], [ignore], [ignore])
LT_AT_EXEC_CHECK([./usea], [0], [ignore], [stderr], [])
LT_AT_UNIFY_NL([stderr])
- AT_CHECK([grep 'libtool wrapper' stderr], [0], [ignore], [ignore])
+ AT_CHECK([$GREP 'libtool wrapper' stderr], [0], [ignore], [ignore])
done
done
IFS=$save_IFS
-until $ECHO "PATH=$PATH" | grep 'PATH=.\{250\}'; do
+until $ECHO "PATH=$PATH" | $GREP 'PATH=.\{250\}'; do
PATH=$PATH$PATH_SEPARATOR$dirpath
done
export PATH
AT_CHECK([test -f "$objdir/lt-usea.c" || exit 77])
# Try to make sure the test is relevant.
-AT_CHECK([grep ' *fputs' $objdir/lt-usea.c > /dev/null])
+AT_CHECK([$GREP ' *fputs' $objdir/lt-usea.c > /dev/null])
# Check for no overly long fputs.
-AT_CHECK([grep ' *fputs.\{250\}' $objdir/lt-usea.c], [1])
+AT_CHECK([$GREP ' *fputs.\{250\}' $objdir/lt-usea.c], [1])
AT_CLEANUP
AT_KEYWORDS([libtool])
# make sure existing libtool is configured for shared libraries
-AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'enable shared libraries' || exit 77],
[], [ignore])
LDFLAGS="$LDFLAGS -no-undefined"
AT_CHECK([$LIBTOOL --dry-run --mode=link $CC $CFLAGS $LDFLAGS ]dnl
[ -o libbar.la bar.lo -rpath /foo libfoo.la],
[], [ignore], [ignore])
-AT_CHECK([grep stamp $lockfile], [], [ignore])
+AT_CHECK([$GREP stamp $lockfile], [], [ignore])
AT_CLEANUP
AT_CHECK([echo quit | $LIBTOOL --mode=execute gdb main],
[ignore], [ignore], [stderr])
-AT_CHECK([grep 'Could not find object file' stderr],[1],[ignore],[ignore])
+AT_CHECK([$GREP 'Could not find object file' stderr],[1],[ignore],[ignore])
AT_XFAIL_IF([
eval "`$LIBTOOL --config | $EGREP '^(whole_archive_flag_spec)='`"
AT_CHECK([echo quit | $LIBTOOL --mode=execute gdb main],
[ignore], [ignore], [stderr])
-AT_CHECK([grep 'Could not find object file' stderr],[1],[ignore],[ignore])
+AT_CHECK([$GREP 'Could not find object file' stderr],[1],[ignore],[ignore])
AT_CLEANUP
AT_KEYWORDS([libltdl dylib])
# This test requires shared library support.
-AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'enable shared libraries' || exit 77],
[], [ignore])
eval `$LIBTOOL --config | $EGREP '^shrext_cmds='`
for dir in inst/lib "$libdir"; do
LT_AT_EXEC_CHECK([./ltdl-loader], [], [stdout], [ignore],
[$dir/simple-module World])
- AT_CHECK([grep "Hello, World" stdout], [], [ignore])
+ AT_CHECK([$GREP "Hello, World" stdout], [], [ignore])
LT_AT_EXEC_CHECK([./ltdl-loader], [], [stdout], [ignore],
[$dir/libsimple-dylib World])
- AT_CHECK([grep "Hello, World" stdout], [], [ignore])
+ AT_CHECK([$GREP "Hello, World" stdout], [], [ignore])
done
AT_CLEANUP
@rm -f hc-direct
@echo "You may ignore any linking errors from the following command:"
@shlib=./$(objdir)/libhello.a; \
- eval "`grep '^library_names' libhello.la`"; \
+ eval "`$(GREP) '^library_names' libhello.la`"; \
for lib in $$library_names; do \
shlib="./$(objdir)/$$lib"; \
done; \
@rm -f hc-libpath
@echo "You may ignore any linking errors from the following command:"
@$(SET_HARDCODE_FLAGS); \
- eval `$(LIBTOOL) --config | grep '^shlibpath_var='`; \
+ eval `$(LIBTOOL) --config | $(GREP) '^shlibpath_var='`; \
libdir=$(libdir); \
flag=`eval echo \"$$hardcode_libdir_flag_spec\"`; \
echo "$$shlibpath_var=./$(objdir) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(hell_OBJECTS) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
elif $FGREP "$objdir" $file > /dev/null 2>&1; then
# We retry fgrep without tr, in case the above lead to a false negative.
hardcoded=yes
- elif ($SED -e '1!d' $file | grep 'unsupported') >/dev/null 2>&1; then
+ elif ($SED -e '1!d' $file | $GREP 'unsupported') >/dev/null 2>&1; then
hardcoded=unsupported
fi
# Common setup for the next few tests.
m4_pushdef([_LT_DIRSETUP],
[# DESTDIR installs do not work with relink at install time.
-AT_XFAIL_IF([eval `$LIBTOOL --config | grep '^fast_install='`
+AT_XFAIL_IF([eval `$LIBTOOL --config | $GREP '^fast_install='`
case $fast_install in no) :;; *) false;; esac])
LDFLAGS="$LDFLAGS -no-undefined"
if test -n "$we_are_on_a_safe_system"; then # let's read shorter cmdlines.
AT_CHECK([$CC $CPPFLAGS $CFLAGS -c variable.c], [], [ignore], [ignore])
AT_CHECK([$NM variable.$OBJEXT], [], [stdout], [ignore])
-AT_CHECK([grep 'External.*some_variable' stdout || exit 77], [], [ignore])
+AT_CHECK([$GREP 'External.*some_variable' stdout || exit 77], [], [ignore])
eval `$LIBTOOL --config | $EGREP '^(global_symbol_pipe)='`
# Check if the _convenience symbol from section SECT3 in conv.lib is
# present even if section SECT3 in foo.obj is hidden.
AT_CHECK([< dumpbin-output eval "$global_symbol_pipe"], [], [stdout])
-AT_CHECK([grep convenience stdout], [], [ignore])
+AT_CHECK([$GREP convenience stdout], [], [ignore])
AT_CLEANUP
LT_AT_MAKE
LT_AT_EXEC_CHECK([./hell], [0], [stdout])
-AT_CHECK([grep 'Welcome to GNU Hell' stdout], [], [ignore])
-AT_CHECK([grep 'This is not GNU Hello.' stdout],
+AT_CHECK([$GREP 'Welcome to GNU Hell' stdout], [], [ignore])
+AT_CHECK([$GREP 'This is not GNU Hello.' stdout],
[], [ignore])
AT_CLEANUP
LT_AT_MAKE
LT_AT_EXEC_CHECK([./hell], [0], [stdout])
-AT_CHECK([grep 'Welcome to GNU Hell' stdout], [], [ignore])
-AT_CHECK([grep 'This is not GNU Hello.' stdout], [], [ignore])
+AT_CHECK([$GREP 'Welcome to GNU Hell' stdout], [], [ignore])
+AT_CHECK([$GREP 'This is not GNU Hello.' stdout], [], [ignore])
# Make sure config.status --recheck updates the libtool script
rm libtool
# Check that .la files are not transformed by the wrapper searching loop.
AT_CHECK([$LIBTOOL --mode=execute echo ./main$EXEEXT liba.lo libfakelib.la], [], [stdout])
# This could be .libs/lt-main or similar (or just plain 'main').
-AT_CHECK([grep main stdout], [], [ignore])
-AT_CHECK([grep liba.lo stdout], [], [ignore])
-AT_CHECK([grep libfakelib.la stdout], [], [ignore])
+AT_CHECK([$GREP main stdout], [], [ignore])
+AT_CHECK([$GREP liba.lo stdout], [], [ignore])
+AT_CHECK([$GREP libfakelib.la stdout], [], [ignore])
AT_CLEANUP
AT_SETUP([export from a DLL with a .def file])
AT_KEYWORDS([libtool])
-AT_CHECK([$LIBTOOL --features | grep 'disable shared libraries' && (exit 77)],
+AT_CHECK([$LIBTOOL --features | $GREP 'disable shared libraries' && (exit 77)],
[1], [ignore])
eval `$LIBTOOL --config | $EGREP '^(shrext_cmds|libname_spec|soname_spec)='`
AT_SETUP([Export test])
AT_KEYWORDS([libtool])
-AT_CHECK([$LIBTOOL --features | grep 'disable shared libraries' && (exit 77)],
+AT_CHECK([$LIBTOOL --features | $GREP 'disable shared libraries' && (exit 77)],
[1], [ignore])
AT_CHECK([eval `$LIBTOOL --config | $SED -n '/^archive_expsym_cmds=/,/^$/p'`
test -n "$archive_expsym_cmds" || echo false >can-hide
LT_AT_EXEC_CHECK([./fprogram], 0, [stdout])
# A weaker output content check that is agnostic to the issues above.
-AT_CHECK([grep 'Welcome to GNU libtool Fortran demo!' stdout],
+AT_CHECK([$GREP 'Welcome to GNU libtool Fortran demo!' stdout],
[0], [ignore])
# Similarly, we can't reliably compare actual output with the following.
LT_AT_EXEC_CHECK([./cprogram], 0, [stdout])
# A weaker output content check that is agnostic to the issues above.
-AT_CHECK([grep 'Welcome to GNU libtool mixed C/Fortran demo!' stdout],
+AT_CHECK([$GREP 'Welcome to GNU libtool mixed C/Fortran demo!' stdout],
[0], [ignore])
])
LT_AT_EXEC_CHECK([./fprogram], 0, [stdout])
# A weaker output content check that is agnostic to the issues above.
-AT_CHECK([grep 'Welcome to GNU libtool Fortran demo!' stdout],
+AT_CHECK([$GREP 'Welcome to GNU libtool Fortran demo!' stdout],
[0], [ignore])
# Similarly, we can't reliably compare actual output with the following.
LT_AT_EXEC_CHECK([./cprogram], 0, [stdout])
# A weaker output content check that is agnostic to the issues above.
-AT_CHECK([grep 'Welcome to GNU libtool mixed C/Fortran demo!' stdout],
+AT_CHECK([$GREP 'Welcome to GNU libtool mixed C/Fortran demo!' stdout],
[0], [ignore])
])
])
# Linker flags are not passed to the archiver, so don't test static libraries.
-if $LIBTOOL --features | grep 'enable shared libraries'; then
+if $LIBTOOL --features | $GREP 'enable shared libraries'; then
library_and_module='library.la "module.la -module -avoid-version"'
else
library_and_module=
AT_CHECK([$LIBTOOLIZE --help], [], [ignore])
AT_CHECK([$LIBTOOLIZE --version], [], [stdout])
-AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([$GREP 'Copyright.*Free Software Foundation' stdout], [], [ignore])
AT_CHECK([$LIBTOOL --help], [], [ignore])
AT_CHECK([$LIBTOOL --help-all], [], [ignore])
AT_CHECK([$LIBTOOL --version], [], [stdout])
-AT_CHECK([grep 'Copyright.*Free Software Foundation' stdout], [], [ignore])
+AT_CHECK([$GREP 'Copyright.*Free Software Foundation' stdout], [], [ignore])
AT_CHECK([$LIBTOOL], [1], [stdout], [stderr])
-AT_CHECK([grep 'specify a MODE' stderr], [], [ignore])
-AT_CHECK([grep ' --help' stdout], [], [ignore])
+AT_CHECK([$GREP 'specify a MODE' stderr], [], [ignore])
+AT_CHECK([$GREP ' --help' stdout], [], [ignore])
AT_CLEANUP
check_trace ()
{
if test X--debug = "X$trace"; then
- AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [0], [ignore])
- AT_CHECK([grep ' --mode' stderr], [0], [ignore])
+ AT_CHECK([$GREP 'enabling shell trace mode' stdout stderr], [0], [ignore])
+ AT_CHECK([$GREP ' --mode' stderr], [0], [ignore])
else
- AT_CHECK([grep 'enabling shell trace mode' stdout stderr], [1])
- AT_CHECK([grep ' --mode' stderr], [1])
+ AT_CHECK([$GREP 'enabling shell trace mode' stdout stderr], [1])
+ AT_CHECK([$GREP ' --mode' stderr], [1])
fi
}
# it was passed at link mode.
AT_CHECK([$orig_LIBTOOL --mode=install $lt_INSTALL liba.la libb.la $libdir],
[], [stdout], [stderr])
- if grep ': relinking ' stdout stderr; then
+ if $GREP ': relinking ' stdout stderr; then
if test X--debug = "X$trace"; then
- AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+ AT_CHECK([$GREP ' --mode=relink' stdout stderr | $GREP ' --debug '],
[0], [ignore])
else
- AT_CHECK([grep ' --mode=relink' stdout stderr | grep ' --debug '],
+ AT_CHECK([$GREP ' --mode=relink' stdout stderr | $GREP ' --debug '],
[1])
fi
fi
# 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib'
# here. This fails on win32/MSVC because the generated command lines have a
# different syntax. So drop the first 'l'.
-AT_CHECK([$LIBTOOL --features | grep 'disable shared libraries' && (exit 77)], [1], [ignore])
-AT_CHECK([grep 'lt_[[ui]]nlikely_existing_lib.*lt_[[ui]]nlikely_existing_lib' stdout],
+AT_CHECK([$LIBTOOL --features | $GREP 'disable shared libraries' && (exit 77)], [1], [ignore])
+AT_CHECK([$GREP 'lt_[[ui]]nlikely_existing_lib.*lt_[[ui]]nlikely_existing_lib' stdout],
[0],[ignore],[ignore])
AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main$EXEEXT main.lo -no-undefined -rpath /nonexistent ./libfoo.la ./libbar.la],
[ignore],[stdout],[ignore])
-AT_CHECK([grep 'lt_[[ui]]nlikely_existing_lib.*lt_[[ui]]nlikely_existing_lib' stdout],
+AT_CHECK([$GREP 'lt_[[ui]]nlikely_existing_lib.*lt_[[ui]]nlikely_existing_lib' stdout],
[0],[ignore],[ignore])
# now check for duplicates
AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbaz.la baz.lo -no-undefined -rpath /nonexistent ./libfoo.la ./libbar.la ./libboth.la],
[ignore],[stdout],[ignore])
-AT_CHECK([grep 'lt_inlikely_existing_lib.*lt_inlikely_existing_lib' stdout],
+AT_CHECK([$GREP 'lt_inlikely_existing_lib.*lt_inlikely_existing_lib' stdout],
[1],[ignore],[ignore])
-AT_CHECK([grep 'lt_unlikely_existing_lib.*lt_unlikely_existing_lib' stdout],
+AT_CHECK([$GREP 'lt_unlikely_existing_lib.*lt_unlikely_existing_lib' stdout],
[1],[ignore],[ignore])
AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main$EXEEXT main.lo -no-undefined -rpath /nonexistent ./libfoo.la ./libbar.la ./libboth.la],
[ignore],[stdout],[ignore])
-AT_CHECK([grep 'lt_inlikely_existing_lib.*lt_inlikely_existing_lib' stdout],
+AT_CHECK([$GREP 'lt_inlikely_existing_lib.*lt_inlikely_existing_lib' stdout],
[1],[ignore],[ignore])
-AT_CHECK([grep 'lt_unlikely_existing_lib.*lt_unlikely_existing_lib' stdout],
+AT_CHECK([$GREP 'lt_unlikely_existing_lib.*lt_unlikely_existing_lib' stdout],
[1],[ignore],[ignore])
mv libboth.la libboth.la.bak
AT_CHECK([$LIBTOOL -n --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -framework Cocoa -framework ApplicationServices -o libbaz.la baz.lo libboth.la -no-undefined -rpath /nonexistent],
[], [stdout], [ignore])
-AT_CHECK([grep Cocoa.ltframework stdout], [1], [], [])
-AT_CHECK([grep ' -framework Cocoa' stdout], [0], [ignore], [])
+AT_CHECK([$GREP Cocoa.ltframework stdout], [1], [], [])
+AT_CHECK([$GREP ' -framework Cocoa' stdout], [0], [ignore], [])
AT_CLEANUP
# Ensure that install_override_mode overrides the mode of the shared
# library (and only the shared library).
-AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'enable shared libraries' || exit 77],
[], [ignore])
$SED 's|^\(install_override_mode\)=.*|\1=755|' < $LIBTOOL > ./libtool
LIBTOOL=./libtool
[-rpath $inst -no-undefined], [], [ignore], [ignore])
AT_CHECK([$LIBTOOL --mode=install $lt_INSTALL liba.la $inst],
[], [stdout], [ignore])
-AT_CHECK([grep ' -m 755' stdout], [], [ignore])
+AT_CHECK([$GREP ' -m 755' stdout], [], [ignore])
AT_CHECK([$LIBTOOL --mode=install $lt_INSTALL -m 644 liba.la $inst],
[], [stdout], [ignore])
-AT_CHECK([grep ' -m 755' stdout], [], [ignore])
-AT_CHECK([grep ' -m 644.*liba.la' stdout], [], [ignore])
+AT_CHECK([$GREP ' -m 755' stdout], [], [ignore])
+AT_CHECK([$GREP ' -m 644.*liba.la' stdout], [], [ignore])
AT_CLEANUP
for file in ./missing-closing-quote.la ./wrong-quotes.la \
./no-dlname.la ./nonexistent-dlname.la; do
LT_AT_EXEC_CHECK([./main], [1], [stdout], [ignore], [$file])
- AT_CHECK([grep 'plugin failed to open' stdout], [], [ignore])
+ AT_CHECK([$GREP 'plugin failed to open' stdout], [], [ignore])
done
AT_CLEANUP
AT_SETUP([check help output])
AT_CHECK([$LIBTOOL --help], [0], [stdout], [stderr])
-AT_CHECK([grep '^Usage:' stdout stderr], [0], [ignore])
+AT_CHECK([$GREP '^Usage:' stdout stderr], [0], [ignore])
AT_CHECK([$LIBTOOL --mode=link --help], [0], [stdout], [stderr])
-AT_CHECK([grep '^Usage:' stdout stderr], [0], [ignore])
+AT_CHECK([$GREP '^Usage:' stdout stderr], [0], [ignore])
AT_CLEANUP
AT_SETUP([diagnose no mode specified])
AT_CHECK([$LIBTOOL], [1], [ignore], [stderr])
-AT_CHECK([grep 'you must specify a MODE' stderr], [0], [ignore])
+AT_CHECK([$GREP 'you must specify a MODE' stderr], [0], [ignore])
AT_CLEANUP
AT_SETUP([quote shell meta-characters in filenames])
-eval `$LIBTOOL --config | grep '^wl='`
+eval `$LIBTOOL --config | $GREP '^wl='`
# Do the torture test.
for mode in compile link install; do
# We must not attempt to match $preargs in the output, because libtool
# may modify them. For example, on Cygwin, 'libtool --mode=link gcc -o
# foo foo.o' becomes 'gcc -o foo.exe foo.o'.
- AT_CHECK([grep "$mode:.*$match_preflag$flag:test " stdout], [0], [ignore])
+ AT_CHECK([$GREP "$mode:.*$match_preflag$flag:test " stdout], [0], [ignore])
# Non-trivial...
[0], [stdout])
# NOTE: we use "..."'"'"..." to insert a literal quote into the expression
# because "...\"..." is not expanded consistently by all shells.
- AT_CHECK([grep "$mode:.*$match_preflag"'"\?'"$flag\\\\\\\\:test\\\\\\\\"'"\? ' stdout],
+ AT_CHECK([$GREP "$mode:.*$match_preflag"'"\?'"$flag\\\\\\\\:test\\\\\\\\"'"\? ' stdout],
[0], [ignore])
# Shell metacharacters that should be backslashified by libtool.
for mchar in \" \` \$; do
AT_CHECK([$LIBTOOL -n --mode=$mode $preargs $preflag"$flag$mchar:test$mchar" $postargs],
[0], [stdout])
- AT_CHECK([grep "$mode:.*$match_preflag"'"'"\?$flag\\\\$mchar:test\\\\$mchar"'"'"\? " stdout], [0], [ignore])
+ AT_CHECK([$GREP "$mode:.*$match_preflag"'"'"\?$flag\\\\$mchar:test\\\\$mchar"'"'"\? " stdout], [0], [ignore])
done
# Shell metacharacters that should be double quoted by libtool, and need
AT_CHECK([$LIBTOOL -n --mode=$mode $preargs $preflag"$flag$mchar:test$mchar" $postargs],
[0], [stdout])
- AT_CHECK([grep "$mode:.*$match_preflag\"$flag\\$mchar:test\\$mchar\" " stdout], [0], [ignore])
+ AT_CHECK([$GREP "$mode:.*$match_preflag\"$flag\\$mchar:test\\$mchar\" " stdout], [0], [ignore])
done
# Metacharacters that should be double quoted by libtool, but which are
AT_CHECK([$LIBTOOL -n --mode=$mode $preargs $preflag"$flag$mchar:test$mchar" $postargs],
[0], [stdout])
- AT_CHECK([grep "$mode:.*$match_preflag\"$flag$mchar:test$mchar\" " stdout], [0], [ignore])
+ AT_CHECK([$GREP "$mode:.*$match_preflag\"$flag$mchar:test$mchar\" " stdout], [0], [ignore])
done
done
# Try a sample compile command.
AT_CHECK([$LIBTOOL -n --mode=compile compiler -c foo.$ext],
[1], [ignore], [stderr])
- AT_CHECK([grep 'cannot' stderr], [1], [ignore])
+ AT_CHECK([$GREP 'cannot' stderr], [1], [ignore])
done
# Make sure that invalid suffixes are not recognized.
for name in $bad_names; do
AT_CHECK([$LIBTOOL -n --mode=compile compiler -c $name],
[1], [ignore], [stderr])
- AT_CHECK([grep 'cannot' stderr], [0], [ignore])
+ AT_CHECK([$GREP 'cannot' stderr], [0], [ignore])
done
AT_CLEANUP
AT_SETUP([check objectlist file operation])
AT_CHECK([$LIBTOOL -n --mode=link $CC -objectlist nonexistent], [1], [ignore], [stderr])
-AT_CHECK([grep 'nonexistent' stderr], [0], [ignore])
+AT_CHECK([$GREP 'nonexistent' stderr], [0], [ignore])
AT_CLEANUP
for tag in $traced_tags; do
AT_CHECK([$LIBTOOL -n --mode=link --tag=$tag compiler -o liba.la foo.lo],
[], [ignore], [stderr])
- AT_CHECK([grep 'ignoring unknown tag' stderr], [1], [ignore])
+ AT_CHECK([$GREP 'ignoring unknown tag' stderr], [1], [ignore])
done
# Ensure the above command would have failed for unknown tags
AT_CHECK([$LIBTOOL -n --mode=link --tag=UnKnOwN compiler -o liba.la foo.lo],
[], [ignore], [stderr])
-AT_CHECK([grep 'ignoring unknown tag' stderr], [0], [ignore])
+AT_CHECK([$GREP 'ignoring unknown tag' stderr], [0], [ignore])
AT_CLEANUP
LT_AT_CHECK_LIBTOOLIZE([--copy --force --ltdl], 0, [ignore])
# check files are left as expected
-AT_CHECK([grep 'keep me' acinclude.m4], 0, [ignore])
+AT_CHECK([$GREP 'keep me' acinclude.m4], 0, [ignore])
AT_CHECK([test -f libltdl/acinclude.m4], 1, [ignore], [ignore])
AT_CLEANUP
# selections and the available locales.
#
# Continuing processing using the "C" locale.
-AT_CHECK([grep locale stdout stderr && exit 77], [1])
+AT_CHECK([$GREP locale stdout stderr && exit 77], [1])
AT_CHECK([diff expected-stderr libtool-stderr])
AT_CHECK([diff expected-stdout libtool-stdout])
[[LANGUAGE='a; nosuchprogram " '\'' & $x /#+*(){}|,:`\ !%']])
AT_CHECK([(lt_localize $LIBTOOL --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS -c b.c)],
[0], [stdout], [stderr])
-AT_CHECK([grep nosuchprogram stdout stderr], [1])
+AT_CHECK([$GREP nosuchprogram stdout stderr], [1])
m4_popdef([lt_localize])
# ------------------------------------------------------------------------- #
have_shared=false
-$LIBTOOL --features | grep 'enable shared libraries' >/dev/null && have_shared=:
+$LIBTOOL --features | $GREP 'enable shared libraries' >/dev/null && have_shared=:
case $host_os,$have_shared in
cygwin* | mingw* | cegcc* | *,false)
AT_XFAIL_IF([:])
# This test only works if the system allows undefined symbols.
-eval `$LIBTOOL --config | grep '^allow_undefined_flag='`
+eval `$LIBTOOL --config | $GREP '^allow_undefined_flag='`
AT_CHECK([test unsupported != "$allow_undefined_flag" || exit 77])
AT_DATA([main.c],
LT_AT_EXEC_CHECK([./main], [], [ignore], [ignore], [./good-plugin.la])
LT_AT_EXEC_CHECK([./main], [1], [ignore], [stderr], [./missing-symbol-plugin.la])
-AT_CHECK([grep 'missing symbol' stderr], [], [ignore])
+AT_CHECK([$GREP 'missing symbol' stderr], [], [ignore])
AT_CLEANUP
AT_KEYWORDS([libltdl])
# This test requires shared library support.
-AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'enable shared libraries' || exit 77],
[], [ignore])
prefix=`pwd`/inst
for dir in inst/lib "$libdir"; do
LT_AT_EXEC_CHECK([./ltdl-loader], [], [stdout], [ignore],
[$dir/simple-module World])
- AT_CHECK([grep "Hello, World" stdout], [], [ignore])
+ AT_CHECK([$GREP "Hello, World" stdout], [], [ignore])
for var in MODULE_PATH LTDL_LIBRARY_PATH $shlibpath_var
do
export $var
LT_AT_EXEC_CHECK([./ltdl-loader], [], [stdout], [ignore],
[simple-module World])
- AT_CHECK([grep "Hello, World" stdout], [], [ignore])
+ AT_CHECK([$GREP "Hello, World" stdout], [], [ignore])
$unset $var || eval $var=
done
done
AT_CHECK([eval "$NM \"\$argz_o\" | $global_symbol_pipe"],
[], [stdout], [ignore])
# Check for global symbols beginning with "argz_"
-AT_CHECK([grep "^T argz_" stdout], [1])
+AT_CHECK([$GREP "^T argz_" stdout], [1])
# and also for the _ prefixed version "_argz_"
-AT_CHECK([grep "^T _argz_" stdout], [1])
+AT_CHECK([$GREP "^T _argz_" stdout], [1])
AT_CLEANUP
AT_KEYWORDS([libltdl])
# This test requires shared library support.
-AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+AT_CHECK([$LIBTOOL --features | $GREP 'enable shared libraries' || exit 77],
[], [ignore])
# With MinGW, try Windows-style paths only.
m4_define([_LT_CHECK_EXECUTE],
[LT_AT_MAKE
LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
- [./foo1.la ./libfoo2.la | grep '^try_iterate: '])
+ [./foo1.la ./libfoo2.la | $GREP '^try_iterate: '])
LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
- [./foo1.la ./libfoo2.la | grep '^try_iterate: '])
+ [./foo1.la ./libfoo2.la | $GREP '^try_iterate: '])
LT_AT_EXEC_CHECK([./mdemo_static], 0, [ignore], [],
- [`pwd`/foo1.la `pwd`/libfoo2.la | grep '^try_iterate: '])
+ [`pwd`/foo1.la `pwd`/libfoo2.la | $GREP '^try_iterate: '])
LT_AT_EXEC_CHECK([./mdemo], 0, [ignore], [],
- [`pwd`/foo1.la `pwd`/libfoo2.la | grep '^try_iterate: '])
+ [`pwd`/foo1.la `pwd`/libfoo2.la | $GREP '^try_iterate: '])
])
# _LT_CHECK_INSTALL
PATH=$prefixdir/lib:$PATH
LT_AT_EXEC_CHECK([$prefixdir/bin/mdemo_static], 0, [ignore], [],
- [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | grep '^try_iterate: '])
+ [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | $GREP '^try_iterate: '])
LT_AT_EXEC_CHECK([$prefixdir/bin/mdemo], 0, [ignore], [],
- [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | grep '^try_iterate: '])
+ [$prefixdir/lib/foo1.la $prefixdir/lib/libfoo2.la | $GREP '^try_iterate: '])
])
mv -f configure.int configure.in
AT_CHECK([$LIBTOOLIZE -n], [0], [stdout], [stderr])
# ensure no shell errors:
-AT_CHECK([grep -v "^libtoolize: " stderr], [1])
-AT_CHECK([grep "Remember to add.*LT_INIT.*to configure.in" stdout], [0], [ignore])
-AT_CHECK([grep "Consider adding.*LT_WITH_LTDL" stdout], [1])
-AT_CHECK([grep "Remember to add.*LT_CONFIG_LTDL_DIR" stdout], [1])
+AT_CHECK([$GREP -v "^libtoolize: " stderr], [1])
+AT_CHECK([$GREP "Remember to add.*LT_INIT.*to configure.in" stdout], [0], [ignore])
+AT_CHECK([$GREP "Consider adding.*LT_WITH_LTDL" stdout], [1])
+AT_CHECK([$GREP "Remember to add.*LT_CONFIG_LTDL_DIR" stdout], [1])
AT_CLEANUP
AT_CHECK([$CC $CPPFLAGS $CFLAGS $C_pic_flag -c foo.c || exit 77],
[], [stdout], [stderr])
# The configure test for the PIC flag also checks for warnings.
-AT_CHECK([grep fpic stdout stderr && exit 77], [1])
-AT_CHECK([[grep '[uU]nknown.*option' stdout stderr && exit 77]], [1])
+AT_CHECK([$GREP fpic stdout stderr && exit 77], [1])
+AT_CHECK([[$GREP '[uU]nknown.*option' stdout stderr && exit 77]], [1])
CXX_pic_flag='-fpic -DPIC'
if $CXX $CPPFLAGS $CXXFLAGS $CXX_pic_flag -c foo.cpp; then :; else
[./configure])
: ${MAKE=make}
AT_CHECK([$MAKE], [], [stdout], [ignore])
-AT_CHECK([if ./libtool --features | grep 'enable shared libraries'; then ]dnl
- [ grep ' -fpic' stdout; else exit 77; fi], [], [ignore], [ignore])
+AT_CHECK([if ./libtool --features | $GREP 'enable shared libraries'; then ]dnl
+ [ $GREP ' -fpic' stdout; else exit 77; fi], [], [ignore], [ignore])
AT_CLEANUP
[-dlopen plugin.la $LIBLTDL],
[], [ignore], [ignore])
LT_AT_EXEC_CHECK([./main], [], [stdout], [ignore], [./plugin.la])
-AT_CHECK([grep 'called from atexit handler' stdout], [], [ignore])
+AT_CHECK([$GREP 'called from atexit handler' stdout], [], [ignore])
AT_CLEANUP
AT_CHECK([$LIBTOOL --mode=install cp libb.la $libdir/libb.la], [], [ignore], [ignore])
AT_CHECK([$LIBTOOL --mode=install cp m$EXEEXT $bindir/m$EXEEXT], [], [ignore], [ignore])
-AT_CHECK([grep /foobar $libdir/liba.la], [], [ignore])
-AT_CHECK([grep /foobar $libdir/libb.la], [], [ignore])
+AT_CHECK([$GREP /foobar $libdir/liba.la], [], [ignore])
+AT_CHECK([$GREP /foobar $libdir/libb.la], [], [ignore])
# TODO: check that m gets -R, too.
}
]])
-eval "`$LIBTOOL --config | grep '^build_libtool_libs='`"
+eval "`$LIBTOOL --config | $GREP '^build_libtool_libs='`"
AT_CHECK([test yes = "$build_libtool_libs" || exit 77])
AT_CHECK([$LIBTOOL --mode=compile --tag=CC \
# If -luser32 was found, then libtool will build a shared library,
# otherwise libtool will fall back to creating a static library.
-AT_CHECK([grep old_library=\'\' libgc.la], [], [ignore])
+AT_CHECK([$GREP old_library=\'\' libgc.la], [], [ignore])
AT_CLEANUP
have_static=false
have_shared=false
per_deplib=false
-$LIBTOOL --features | grep 'enable static libraries' >/dev/null && have_static=:
-$LIBTOOL --features | grep 'enable shared libraries' >/dev/null && have_shared=:
+$LIBTOOL --features | $GREP 'enable static libraries' >/dev/null && have_static=:
+$LIBTOOL --features | $GREP 'enable shared libraries' >/dev/null && have_shared=:
eval `$LIBTOOL --config |
$EGREP '^(per_deplib_(static|dynamic)_flag|shlibpath_var|link_static_flag)='`
if test -n "$per_deplib_static_flag" && test -n "$per_deplib_dynamic_flag"; then
AT_CHECK([$MAKE install DESTDIR=$sysroot], [0], [ignore], [ignore])
AT_CHECK([test -f "$sysroot/$prefix/lib/lib1.la"])
-AT_CHECK([grep -F "$sysroot" "$sysroot/$prefix/lib/lib1.la"], [1])
+AT_CHECK([$GREP -F "$sysroot" "$sysroot/$prefix/lib/lib1.la"], [1])
cd ..
# Build and install package 2.
AT_CHECK([$MAKE install DESTDIR=$sysroot], [0], [ignore], [ignore])
AT_CHECK([test -f "$sysroot/$prefix/lib/lib2.la"])
-AT_CHECK([grep -F "$sysroot" "$sysroot/$prefix/lib/lib2.la"], [1])
+AT_CHECK([$GREP -F "$sysroot" "$sysroot/$prefix/lib/lib2.la"], [1])
cd ..
# Build and install a program.
AT_CHECK([$MAKE install DESTDIR=$sysroot], [0], [ignore], [ignore])
AT_CHECK([test -f "$sysroot/$prefix/bin/prog$EXEEXT"])
-AT_CHECK([grep -F "$sysroot" "$sysroot/$prefix/bin/prog$EXEEXT"], [1])
-AT_CHECK([grep "'.*=" $sysroot/$prefix/lib/lib2.la], [0], [ignore])
+AT_CHECK([$GREP -F "$sysroot" "$sysroot/$prefix/bin/prog$EXEEXT"], [1])
+AT_CHECK([$GREP "'.*=" $sysroot/$prefix/lib/lib2.la], [0], [ignore])
AT_CHECK([./libtool --mode=finish $sysroot/$prefix/lib/lib@<:@12@:>@.la], [0], [ignore])
-AT_CHECK([grep "'.*=" $sysroot/$prefix/lib/lib@<:@12@:>@.la], [1])
+AT_CHECK([$GREP "'.*=" $sysroot/$prefix/lib/lib@<:@12@:>@.la], [1])
# missing tests
# 1) pass absolute .la files
# If the compiler supports -c -o, we want to use it:
# it may make a difference for templates
-eval `$LIBTOOL --tag=CXX --config | grep ^compiler_c_o=`
+eval `$LIBTOOL --tag=CXX --config | $GREP ^compiler_c_o=`
case $compiler_c_o in
yes)
main_o=sub/main.$OBJEXT
if eval \$$tool --version >/dev/null 2>&1; then :; else eval $tool=no; fi
done
export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF
-eval `$LIBTOOL --config | grep '^EGREP='`
+eval `$LIBTOOL --config | $GREP '^EGREP='`
eval `$LIBTOOL --config | $EGREP '^(FGREP|objdir|objext)'`
eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|build_alias|to_host_file_cmd|to_tool_file_cmd)='`
configure_options=--prefix=/nonexistent
# --------------------------
m4_define([LT_AT_AUTOMAKE],
[AT_CHECK([$AUTOMAKE $1], [0], [ignore], [stderr],
- [AT_CHECK([grep 'require .*but have' stderr && (exit 77)], [1])])
+ [AT_CHECK([$GREP 'require .*but have' stderr && (exit 77)], [1])])
AT_XFAIL_IF([test no = "$AUTOMAKE"])
AT_KEYWORDS([automake])
])
[m4_define([AC_CONFIG_MACRO_DIRS], m4_defn([AC_CONFIG_MACRO_DIR]))])
]])
AT_CHECK([$AUTORECONF $1], [0], [ignore], [stderr],
- [AT_CHECK([grep 'require .*but have' stderr && (exit 77)], [1])])
+ [AT_CHECK([$GREP 'require .*but have' stderr && (exit 77)], [1])])
AT_XFAIL_IF(
[case ,$AUTORECONF,$AUTOCONF,$AUTOHEADER,$ACLOCAL,$AUTOMAKE, in *,no,*) :;; *) false;; esac])
AT_KEYWORDS([autoconf automake])
# Hypothesis: -version-info is ignored for convenience archives.
AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la liba1.lo ]dnl
[-version-info 0:0:0], [], [ignore], [stderr])
-AT_CHECK([grep 'version-info.*ignored for convenience' stderr], [], [ignore])
+AT_CHECK([$GREP 'version-info.*ignored for convenience' stderr], [], [ignore])
# Hypothesis: the deprecated -version-number works.
# Be sure not to use zero here, it's not portable.
# Hypothesis: we diagnose when AGE is higher than CURRENT.
AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la liba1.lo ]dnl
[-version-info 1:3:2 -rpath $libdir], [1], [ignore], [stderr])
-AT_CHECK([grep 'AGE.*is greater than' stderr], [], [ignore])
+AT_CHECK([$GREP 'AGE.*is greater than' stderr], [], [ignore])
# Hypothesis: we diagnose invalid values.
for version_info in 1:2:3:4 -1 0:-1 0:0:-1; do