File: configure.in

package info (click to toggle)
bibclean 2.11.4-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 5,212 kB
  • ctags: 1,545
  • sloc: ansic: 10,737; makefile: 817; perl: 66; sh: 40; awk: 27; sed: 6
file content (182 lines) | stat: -rw-r--r-- 5,007 bytes parent folder | download | duplicates (5)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
dnl Process this file with autoconf to produce a configure script.
AC_INIT(bibclean.c)

AC_CONFIG_HEADER(config.h:config.hin)

dnl Checks for support programs

AC_PATH_PROGS(AWK, [gawk nawk mawk awk])

dnl Checks for NeXT -posix
AC_MSG_CHECKING(whether we have NeXT system, and so need -posix)
if test -d /NextAdmin
then CFLAGS=-posix
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi

dnl Checks for compiler
AC_PROG_CC
AC_PROG_CXX

dnl Checks for ALL (IBM RS/6000 c89 needs _ALL_SOURCE when ioctl.h is
dnl used with winsize)
AC_MSG_CHECKING(whether we need _ALL_SOURCE)
all=no
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/ioctl.h>
struct winsize w;
], , , all=maybe)
if test $all = maybe ; then
AC_TRY_COMPILE([
#define _ALL_SOURCE
#include <sys/types.h>
#include <sys/ioctl.h>
struct winsize w;
], , AC_DEFINE(_ALL_SOURCE) all=yes)
fi
if test $all = maybe ; then all=no ; fi
AC_MSG_RESULT($all)

dnl Checks for POSIX (HP-UX c89 needs _POSIX_SOURCE when stat.h is used)
AC_MSG_CHECKING(whether we need _POSIX_SOURCE)
posix=no
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/stat.h>
struct stat buffer;
], , , posix=maybe)
if test $posix = maybe ; then
AC_TRY_COMPILE([
#define _POSIX_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
struct stat buffer;
], , AC_DEFINE(_POSIX_SOURCE) posix=yes)
fi
if test $posix = maybe ; then posix=no ; fi
AC_MSG_RESULT($posix)

dnl Checks for Standard C and C++ function declarations.
AC_MSG_CHECKING(for Standard C and C++ function declarations)
AC_TRY_COMPILE([void foo(void){}
int bar(int x, float y, char z){return 1;}], ,
  [AC_MSG_RESULT(yes)
    AC_DEFINE(HAVE_STDC)],
    AC_MSG_RESULT(no))

dnl Checks for SunOS C++ free() argument type bug
AC_MSG_CHECKING(for SunOS C++ free() argument type bug)
freebug=no
AC_TRY_COMPILE([#include <stdlib.h>],
[void *p; p = (void*)0; free(p)],
, freebug=maybe)

if test $freebug = maybe ; then
AC_TRY_COMPILE([#include <stdlib.h>],
[void *p; p = (void*)0; free((char*)p)],
AC_DEFINE(FREE_CAST_IS_CHAR_STAR) freebug=yes)
fi
if test $freebug = maybe ; then freebug=no ; fi
AC_MSG_RESULT($freebug)

dnl Checks for Standard C alert character
AC_MSG_CHECKING(for Standard C alert character)
havealert=yes
AC_TRY_RUN(int main(){return((int)'\a'-007);},
    [havealert=yes
     AC_DEFINE(HAVE_ALERT_CHAR)],
    havealert=no,
    havealert=no)
AC_MSG_RESULT($havealert)

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(conio.h ctype.h descrip.h errno.h fcntl.h io.h \
iodef.h jpidef.h libc.h limits.h osfcn.h pwd.h regex.h regexp.h \
rms.h sgtty.h ssdef.h stat.h stdio.h stdlib.h string.h sys/ioctl.h \
sys/param.h sys/stat.h sys/types.h termio.h termios.h time.h \
tt2def.h ttdef.h types.h unistd.h unixio.h )

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_STRUCT_TM

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_UTIME_NULL
AC_REPLACE_FUNCS(strtol)
AC_CHECK_FUNCS(getcwd getwd re_comp strcspn strdup strspn strstr strtod strtol)

AC_MSG_CHECKING(for ioctl prototype)
AC_EGREP_CPP([ioctl[ 	]*[(]],
[
#include <sys/ioctl.h>
#include <unistd.h>
],
[
AC_DEFINE(HAVE_IOCTL_PROTOTYPE)
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
])

# suppress caching of EXTERNAL_PAGER; different searches are made for
# different configurations.
unset ac_cv_path_EXTERNAL_PAGER
AC_ARG_WITH(pager,
  [  --with-pager=<path>     use the specified external pager (eg, /bin/more)],
  [case $withval in
     no | /* | ?:/*) EXTERNAL_PAGER="$withval" ;;
     yes) # Try to find a sensible pager to compile in. Feel free
          # to extend the list of pagers looked for here
          AC_PATH_PROGS(EXTERNAL_PAGER,pager more less,no)
          case $EXTERNAL_PAGER in no)
            AC_MSG_ERROR(
       [No well-known pager found in \$PATH, please specify one])
            ;;
          esac ;;
     *)   SAVED_PAGER="$withval"
          AC_PATH_PROG(EXTERNAL_PAGER,"$SAVED_PAGER",no)
          case $EXTERNAL_PAGER in no)
            AC_MSG_ERROR(
       [--with-pager=$SAVED_PAGER: not absolute pathname and not in \$PATH])
            ;;
     esac ;;
   esac],
      [EXTERNAL_PAGER=no])
case $EXTERNAL_PAGER in no) ;; *)
  if test x"$ac_cv_header_unistd_h" = xyes ; then
    AC_DEFINE(SCREEN_LINES,0)
    AC_DEFINE_UNQUOTED(PAGER_PROGRAM,"$EXTERNAL_PAGER")
  else
    AC_MSG_WARN([unistd.h was not found, so --with-pager is ignored])
  fi ;;
esac

BIBCLEANRC='$(bindir)/.bibcleanrc'
AC_ARG_WITH(fhs-rcfiles,
  [  --with-fhs-rcfiles      look for rcfiles in \$(datadir) or /etc, not \$PATH],
  [case $withval in yes) AC_DEFINE(FHS_RCFILES,1)
                         BIBCLEANRC='$(datadir)/bibcleanrc' ;;
   esac])
AC_SUBST(BIBCLEANRC)

dnl Remove -g from CFLAGS if we are compiling with lcc because it
dnl produces bad debug symbol tables on Sun Solaris 2.x.
if test "$CC" = "lcc"
then
    CFLAGS="`echo $CFLAGS | sed -e 's/-g //g' -e 's/ -g$//g' -e 's/^-g$//'`"
fi

AC_OUTPUT(Makefile)