X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=t%2Fcompile4.sh;h=ddabe3143a9c246b179a312cccc13c261891aef1;hb=6febcd41b3dcf99a89aaf21329c00fdadcd68771;hp=bb9f6719c47afbb9a1c0df652b02c634b3000547;hpb=76f0605a6dd790ab43cc608db11ac2141ddf46c0;p=platform%2Fupstream%2Fautomake.git diff --git a/t/compile4.sh b/t/compile4.sh old mode 100755 new mode 100644 index bb9f671..ddabe31 --- a/t/compile4.sh +++ b/t/compile4.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010-2012 Free Software Foundation, Inc. +# Copyright (C) 2010-2013 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 @@ -18,36 +18,34 @@ # with respect to absolute paths. required='cl' -. ./defs || Exit 1 +. test-init.sh get_shell_script compile mkdir sub cat >sub/foo.c <<'EOF' -int -foo () +int foo (void) { return 0; } EOF cat >main.c <<'EOF' -extern int foo (); -int -main () +extern int foo (void); +int main (void) { return foo (); } EOF -absfoodir=`pwd`/sub -absmainc=`pwd`/main.c -absmainobj=`pwd`/main.obj +cwd=$(pwd) || fatal_ "cannot get current directory" +absfoodir=$cwd/sub +absmainc=$cwd/main.c +absmainobj=$cwd/main.obj cat >> configure.ac << 'END' AC_PROG_CC -AM_PROG_CC_C_O AM_PROG_AR AC_PROG_RANLIB AC_CONFIG_FILES([sub/Makefile]) @@ -71,22 +69,13 @@ $MAKE ./compile cl $CPPFLAGS $CFLAGS -c -o "$absmainobj" "$absmainc" -# cl expects archives to be named foo.lib, not libfoo.a so -# make a simple copy here if needed. This is a severe case -# of badness, but ignore that since this is not what is -# being tested here... -if test -f sub/libfoo.a; then - cp sub/libfoo.a sub/foo.lib -fi - # POSIX mandates that the compiler accepts a space between the -I, # -l and -L options and their respective arguments. Traditionally, # this should work also without a space. Try both usages. for sp in '' ' '; do rm -f main - - ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" -o main -l${sp}foo - + ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" \ + -o main -l${sp}foo ./main done