mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-11 15:00:08 +08:00
C binding even if $CC is a C++ compiler. Skip the test with g++ as its command line driver reorders `-lm'. * tests/search-path.at: Declare `inflate' with C binding. * tests/stresstest.at: Avoid unused variable warnings.
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
# Hand crafted tests for GNU Libtool. -*- Autotest -*-
|
|
# Copyright 2006 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
# 02110-1301, USA.
|
|
|
|
AT_SETUP([sys_lib_search_path])
|
|
AT_KEYWORDS([libtool])
|
|
LDFLAGS="$LDFLAGS -no-undefined"
|
|
|
|
AT_DATA([main.c],
|
|
[[extern
|
|
#ifdef __cplusplus
|
|
"C"
|
|
#endif
|
|
int inflate ();
|
|
int main()
|
|
{
|
|
return inflate ();
|
|
}
|
|
]])
|
|
|
|
$CC $CPPFLAGS $CFLAGS -c main.c
|
|
eval `$LIBTOOL --config | $EGREP '^(sys_lib_search_path_spec)='`
|
|
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
|
|
for path in $sys_lib_search_path; do
|
|
if $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT -L$path -lz
|
|
then
|
|
AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main.$OBJEXT -lz],
|
|
[], [ignore], [ignore])
|
|
break
|
|
fi
|
|
done
|
|
|
|
AT_CLEANUP
|