~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Arnold D. Robbins
  • Date: 2010-07-16 09:54:45 UTC
  • Revision ID: git-v1:f20ab7c3039a4023f41372bfe4bde3b16d481df7
Tags: gawk-3.0.4
Move to gawk-3.0.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl
2
2
dnl aclocal.m4 --- autoconf input file for gawk
3
3
dnl 
4
 
dnl Copyright (C) 1995, 96 the Free Software Foundation, Inc.
 
4
dnl Copyright (C) 1995, 1996, 1998, 1999 the Free Software Foundation, Inc.
5
5
dnl 
6
6
dnl This file is part of GAWK, the GNU implementation of the
7
7
dnl AWK Progamming Language.
38
38
fi
39
39
AC_MSG_RESULT([${gawk_cv_c_stringize}])
40
40
])dnl
 
41
 
 
42
 
 
43
dnl By default, many hosts won't let programs access large files;
 
44
dnl one must use special compiler options to get large-file access to work.
 
45
dnl For more details about this brain damage please see:
 
46
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
 
47
 
 
48
dnl Written by Paul Eggert <eggert@twinsun.com>.
 
49
 
 
50
dnl Internal subroutine of GAWK_AC_SYS_LARGEFILE.
 
51
dnl GAWK_AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
 
52
AC_DEFUN(GAWK_AC_SYS_LARGEFILE_FLAGS,
 
53
  [AC_CACHE_CHECK([for $1 value to request large file support],
 
54
     gawk_cv_sys_largefile_$1,
 
55
     [gawk_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
 
56
        gawk_cv_sys_largefile_$1=no
 
57
        ifelse($1, CFLAGS,
 
58
          [case "$host_os" in
 
59
           # IRIX 6.2 and later require cc -n32.
 
60
changequote(, )dnl
 
61
           irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
 
62
changequote([, ])dnl
 
63
             if test "$GCC" != yes; then
 
64
               gawk_cv_sys_largefile_CFLAGS=-n32
 
65
             fi
 
66
             gawk_save_CC="$CC"
 
67
             CC="$CC $gawk_cv_sys_largefile_CFLAGS"
 
68
             AC_TRY_LINK(, , , gawk_cv_sys_largefile_CFLAGS=no)
 
69
             CC="$gawk_save_CC"
 
70
           esac])
 
71
      }])])
 
72
 
 
73
dnl Internal subroutine of GAWK_AC_SYS_LARGEFILE.
 
74
dnl GAWK_AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
 
75
AC_DEFUN(GAWK_AC_SYS_LARGEFILE_SPACE_APPEND,
 
76
  [case $2 in
 
77
   no) ;;
 
78
   ?*)
 
79
     case "[$]$1" in
 
80
     '') $1=$2 ;;
 
81
     *) $1=[$]$1' '$2 ;;
 
82
     esac ;;
 
83
   esac])
 
84
 
 
85
dnl Internal subroutine of GAWK_AC_SYS_LARGEFILE.
 
86
dnl GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, CODE-TO-SET-DEFAULT)
 
87
AC_DEFUN(GAWK_AC_SYS_LARGEFILE_MACRO_VALUE,
 
88
  [AC_CACHE_CHECK([for $1], $2,
 
89
     [$2=no
 
90
changequote(, )dnl
 
91
      $3
 
92
      for gawk_flag in $gawk_cv_sys_largefile_CFLAGS no; do
 
93
        case "$gawk_flag" in
 
94
        -D$1)
 
95
          $2=1 ;;
 
96
        -D$1=*)
 
97
          $2=`expr " $gawk_flag" : '[^=]*=\(.*\)'` ;;
 
98
        esac
 
99
      done
 
100
changequote([, ])dnl
 
101
      ])
 
102
   if test "[$]$2" != no; then
 
103
     AC_DEFINE_UNQUOTED([$1], [$]$2)
 
104
   fi])
 
105
 
 
106
AC_DEFUN(GAWK_AC_SYS_LARGEFILE,
 
107
  [AC_REQUIRE([AC_CANONICAL_HOST])
 
108
   AC_ARG_ENABLE(largefile,
 
109
     [  --disable-largefile     omit support for large files])
 
110
   if test "$enable_largefile" != no; then
 
111
     AC_CHECK_TOOL(GETCONF, getconf)
 
112
     GAWK_AC_SYS_LARGEFILE_FLAGS(CFLAGS)
 
113
     GAWK_AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
 
114
     GAWK_AC_SYS_LARGEFILE_FLAGS(LIBS)
 
115
        
 
116
     for gawk_flag in $gawk_cv_sys_largefile_CFLAGS no; do
 
117
       case "$gawk_flag" in
 
118
       no) ;;
 
119
       -D_FILE_OFFSET_BITS=*) ;;
 
120
       -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
 
121
       -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
 
122
       -D?* | -I?*)
 
123
         GAWK_AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$gawk_flag") ;;
 
124
       *)
 
125
         GAWK_AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$gawk_flag") ;;
 
126
       esac
 
127
     done
 
128
     GAWK_AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$gawk_cv_sys_largefile_LDFLAGS")
 
129
     GAWK_AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$gawk_cv_sys_largefile_LIBS")
 
130
     GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
 
131
       gawk_cv_sys_file_offset_bits,
 
132
       [case "$host_os" in
 
133
        # HP-UX 10.20 and later
 
134
        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
 
135
          gawk_cv_sys_file_offset_bits=64 ;;
 
136
        esac])
 
137
     GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
 
138
       gawk_cv_sys_largefile_source,
 
139
       [case "$host_os" in
 
140
        # HP-UX 10.20 and later
 
141
        hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
 
142
          gawk_cv_sys_largefile_source=1 ;;
 
143
        esac])
 
144
     GAWK_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
 
145
       gawk_cv_sys_large_files,
 
146
       [case "$host_os" in
 
147
        # AIX 4.2 and later
 
148
        aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
 
149
          gawk_cv_sys_large_files=1 ;;
 
150
        esac])
 
151
   fi
 
152
  ])
 
153
 
 
154
dnl Check for AIX and add _XOPEN_SOURCE_EXTENDED
 
155
AC_DEFUN(GAWK_AC_AIX_TWEAK, [
 
156
AC_MSG_CHECKING([for AIX compilation hacks])
 
157
AC_CACHE_VAL(gawk_cv_aix_hack, [
 
158
if test -d /lpp/bos
 
159
then
 
160
        CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
 
161
        gawk_cv_aix_hack=yes
 
162
else
 
163
        gawk_cv_aix_hack=no
 
164
fi
 
165
])dnl
 
166
AC_MSG_RESULT([${gawk_cv_aix_hack}])
 
167
])dnl