[go: up one dir, main page]

File: file.m4

package info (click to toggle)
a2ps 4.13b-16woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,992 kB
  • ctags: 4,762
  • sloc: ansic: 31,146; sh: 10,780; lex: 2,283; perl: 1,471; yacc: 757; makefile: 702; lisp: 399; ada: 263; objc: 189; java: 151; f90: 109; pascal: 109; sed: 107; ml: 85; sql: 74; modula3: 33; haskell: 32; python: 24
file content (38 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## --------------------------------------------------------- ##
## Find where is `file' and what is the option for it to     ##
## follow the links. If no way, use a plain `file'           ##
##                           demaille@inf.enst.fr            ##
## --------------------------------------------------------- ##

# serial 4

dnl This is a test to know what is the correct way to get
dnl file following the links
dnl I hope it is robust, but I'm a novice :) Akim Demaille
AC_DEFUN(ad_PROG_FILE_LINK,
  [AC_PATH_PROG(file_prog, file)dnl
   AC_MSG_CHECKING(for the option for file to follow the links)
   AC_CACHE_VAL(ac_cv_prog_file_link_option,[
     touch conftestfile
     ln -s conftestfile conftestfile1
     for file_opt in '' ' -L'
     do
       res=`eval $file_prog $file_opt conftestfile1 2>&-` || res=symbolic
       case $res in
	  *symbolic*) ;;
	  *) ac_cv_prog_file_link_option=$file_opt ; break    ;;
       esac
     done
     rm conftestfile conftestfile1
     if test "X$ac_cv_prog_file_link_option" = X; then
        ac_cv_prog_file_link_option="no";
     fi])dnl
   # If no flag were found, default to `file' with no options
   case "X$ac_cv_prog_file_link_option" in
     X)   AC_MSG_RESULT(none required) ;
          FILE_LINK=${file_prog} ;;
     Xno) AC_MSG_RESULT(no way);
          FILE_LINK=${file_prog} ;;
     *)   AC_MSG_RESULT($ac_cv_prog_file_link_option);
          FILE_LINK=${file_prog}${ac_cv_prog_file_link_option} ;;
   esac])