# Hand crafted tests for GNU Libtool. -*- Autotest -*- # Copyright 2005 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # Test that convenience archives work. # for each TAG, test: # - adding one or multiple convenience archives # - with or without additional objects on the cmdline AT_SETUP([C convenience archives]) AT_KEYWORDS([libtool]) cat >main1.c <main2.c <main3.c < a$i.c $LIBTOOL --mode=compile $CC $CFLAGS -c main$i.c $LIBTOOL --mode=compile $CC $CFLAGS -c a$i.c $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba$i.la a$i.lo done AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba12.la liba1.la liba2.la -rpath /notexist], [0],[ignore],[ignore]) AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba123.la a3.lo liba1.la liba2.la -rpath /notexist], [0],[ignore],[ignore]) conv= for i in 1 2 3; do conv=$conv$i AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -static -o main_static main$i.lo liba$conv.la], [0],[ignore],[ignore]) AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o main main$i.lo liba$conv.la], [0],[ignore],[ignore]) LT_AT_EXEC_CHECK([./main_static]) LT_AT_EXEC_CHECK([./main]) done AT_CLEANUP AT_SETUP([C++ convenience archives]) LT_AT_TAG([CXX]) AT_KEYWORDS([libtool]) cat >main1.cpp <main2.cpp <main3.cpp < a$i.cpp $LIBTOOL --tag=CXX --mode=compile $CXX $CXXFLAGS -c main$i.cpp $LIBTOOL --tag=CXX --mode=compile $CXX $CXXFLAGS -c a$i.cpp $LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o liba$i.la a$i.lo done AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o liba12.la liba1.la liba2.la -rpath /notexist], [0],[ignore],[ignore]) AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o liba123.la a3.lo liba1.la liba2.la -rpath /notexist], [0],[ignore],[ignore]) conv= for i in 1 2 3; do conv=$conv$i AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -static -o main_static main$i.lo liba$conv.la], [0],[ignore],[ignore]) AT_CHECK([$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $LDFLAGS -o main main$i.lo liba$conv.la], [0],[ignore],[ignore]) LT_AT_EXEC_CHECK([./main_static]) LT_AT_EXEC_CHECK([./main]) done AT_CLEANUP AT_SETUP([F77 convenience archives]) LT_AT_TAG([F77]) AT_KEYWORDS([libtool]) cat >main1.f <main2.f <main3.f <a$i.f <main1.f <main2.f <main3.f <a$i.f <foo1.java <foo2.java <foo3.java <A$i.java <