1 | dnl This file is an input file used by the GNU "autoconf" program to |
1 | dnl This file is an input file used by the GNU "autoconf" program to |
2 | dnl generate the file "configure", which tries to guess your system |
2 | dnl generate the file "configure", which tries to guess your system |
3 | dnl configuration so that no manual editing of the Makefile should be |
3 | dnl configuration so that no manual editing of the Makefile should be |
4 | dnl necessary |
4 | dnl necessary |
5 | dnl |
5 | dnl |
6 | dnl $Id: configure.in,v 1.12 2020/12/11 20:09:23 root Exp $ |
6 | dnl $Id: configure.in,v 1.13 2020/12/12 03:54:59 root Exp $ |
7 | dnl |
7 | dnl |
8 | |
8 | |
9 | AC_INIT(uulib.c) |
9 | AC_INIT(uulib.c) |
10 | AC_PREREQ(2.9) |
10 | AC_PREREQ(2.9) |
11 | AC_CONFIG_HEADER(config.h) |
11 | AC_CONFIG_HEADER(config.h) |
… | |
… | |
19 | AC_ARG_WITH(cc,,CC=$with_cc) |
19 | AC_ARG_WITH(cc,,CC=$with_cc) |
20 | AC_ARG_WITH(cflags,,CFLAGS=$with_cflags) |
20 | AC_ARG_WITH(cflags,,CFLAGS=$with_cflags) |
21 | |
21 | |
22 | AC_PROG_CC |
22 | AC_PROG_CC |
23 | AC_PROG_CPP |
23 | AC_PROG_CPP |
24 | wi_PROTOTYPES |
|
|
25 | AC_PROG_MAKE_SET |
24 | AC_PROG_MAKE_SET |
26 | AC_PROG_RANLIB |
25 | AC_PROG_RANLIB |
27 | |
|
|
28 | if test "$wi_cv_prototypes" = no ; then |
|
|
29 | AC_WARN([Your compiler does not support function prototyping and]) |
|
|
30 | AC_WARN([is not able to properly compile this package. What a pity.]) |
|
|
31 | AC_WARN([Get gcc, or any compiler that supports function prototypes.]) |
|
|
32 | exit 1 |
|
|
33 | fi |
|
|
34 | |
26 | |
35 | # |
27 | # |
36 | # Checks for header files and library functions |
28 | # Checks for header files and library functions |
37 | # |
29 | # |
38 | |
30 | |
… | |
… | |
40 | AC_TYPE_SIZE_T |
32 | AC_TYPE_SIZE_T |
41 | AC_HEADER_TIME |
33 | AC_HEADER_TIME |
42 | AC_CHECK_HEADERS(fcntl.h unistd.h memory.h malloc.h errno.h) |
34 | AC_CHECK_HEADERS(fcntl.h unistd.h memory.h malloc.h errno.h) |
43 | AC_CHECK_HEADERS(io.h sys/time.h) |
35 | AC_CHECK_HEADERS(io.h sys/time.h) |
44 | |
36 | |
45 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
|
|
46 | #include <stdio.h> |
|
|
47 | |
|
|
48 | ]])], [OPTION_FOUND="yes"], [OPTION_FOUND="no"]) |
|
|
49 | |
|
|
50 | CFLAGS="$CFLAGS -D_GNU_SOURCE" |
37 | CFLAGS="$CFLAGS -D_GNU_SOURCE" |
51 | AC_CHECK_FUNCS(gettimeofday getc_unlocked feof_unlocked ferror_unlocked) |
38 | AC_CHECK_FUNCS(tempnam gettimeofday flockfile getc_unlocked feof_unlocked ferror_unlocked) |
52 | dnl AC_CHECK_FUNCS(strcasecmp strncasecmp strcasestr) |
39 | dnl AC_CHECK_FUNCS(strcasecmp strncasecmp strcasestr) |
53 | |
40 | |
54 | AC_CHECK_FUNC(tempnam,,AC_DEFINE(tempnam,FP_tempnam)) |
41 | AC_CHECK_FUNCS(chmod umask mkstemp) |
55 | |
|
|
56 | AC_CHECK_FUNC(chmod,AC_DEFINE(HAVE_CHMOD)) |
|
|
57 | AC_CHECK_FUNC(umask,AC_DEFINE(HAVE_UMASK)) |
|
|
58 | AC_CHECK_FUNC(mkstemp,AC_DEFINE(HAVE_MKSTEMP)) |
|
|
59 | |
|
|
60 | # |
|
|
61 | # strerror might be internally defined. this would cause a |
|
|
62 | # CHECK_FUNCS(strerror) to fail because it'd be called with |
|
|
63 | # zero arguments. So use our own code. |
|
|
64 | # |
|
|
65 | AC_MSG_CHECKING([for strerror]) |
|
|
66 | AC_TRY_LINK([ |
|
|
67 | char *blubb() { return (char *) strerror (42); } |
|
|
68 | ],[ |
|
|
69 | (void) blubb(); |
|
|
70 | ],have_strerror=yes,AC_DEFINE(strerror,FP_strerror) |
|
|
71 | have_strerror=no) |
|
|
72 | AC_MSG_RESULT($have_strerror) |
|
|
73 | |
|
|
74 | AC_MSG_CHECKING([for stdin]) |
|
|
75 | AC_TRY_LINK([ |
|
|
76 | #include <stdio.h> |
|
|
77 | char *blubb() { FILE *in, *out; in=stdin; out=stdout; return (char*)0; } |
|
|
78 | ],[ |
|
|
79 | (void) blubb(); |
|
|
80 | ],have_stdio=yes,AC_DEFINE(HAVE_STDIO) |
|
|
81 | have_stdio=no) |
|
|
82 | AC_MSG_RESULT($have_stdio) |
|
|
83 | |
|
|
84 | if test "$ac_cv_header_stdc" = "no" ; then |
|
|
85 | AC_CHECK_HEADERS(stdarg.h varargs.h) |
|
|
86 | if test "$ac_cv_header_stdarg_h" = "no" ; then |
|
|
87 | if test "$ac_cv_header_varargs_h" = "no" ; then |
|
|
88 | AC_MSG_ERROR([neither stdarg.h nor varargs.h present]) |
|
|
89 | fi |
|
|
90 | fi |
|
|
91 | fi |
|
|
92 | |
|
|
93 | # |
|
|
94 | # Check whether this is a DOS-Based system. Another bogus test. |
|
|
95 | # Don't even bother to print a message. This code is needed so |
|
|
96 | # that autoheader includes the #undef into the final config.h |
|
|
97 | # and we can change the definition by hand on a really DOS |
|
|
98 | # system (where ./configure doesn't work anyway ...) |
|
|
99 | # |
|
|
100 | |
|
|
101 | if false ; then |
|
|
102 | AC_DEFINE(SYSTEM_DOS) |
|
|
103 | AC_DEFINE(SYSTEM_QUICKWIN) |
|
|
104 | AC_DEFINE(SYSTEM_WINDLL) |
|
|
105 | AC_DEFINE(SYSTEM_OS2) |
|
|
106 | fi |
|
|
107 | |
42 | |
108 | # |
43 | # |
109 | # On some systems (so far, OS2 and WINDOWS), functions that are exported |
44 | # On some systems (so far, OS2 and WINDOWS), functions that are exported |
110 | # from a DLL must be declared specifically. |
45 | # from a DLL must be declared specifically. |
111 | # |
46 | # |