-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfigure.in
114 lines (98 loc) · 3.3 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([console.c])
AC_CONFIG_HEADERS([config.h])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_CACHE_CHECK([for EMX], ac_cv_have_emx,
AC_TRY_COMPILE(, [#ifndef __EMX__
kill me!
#endif ], ac_cv_have_emx=yes, ac_cv_have_emx=no)
)
if test "$ac_cv_have_emx" = yes; then
LDFLAGS="`echo "$LDFLAGS -Zsysv-signals -Zbin-files" | sed "s/-Zexe//g" | sed "s/-Zmt//g"`"
CFLAGS="`echo "$CFLAGS" | sed "s/-Zmt//g"`"
fi
dnl Checks for libraries.
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h linux/vt.h linux/kd.h siginfo.h float.h sys/select.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday select strtol strtoul getopt psignal access)
AC_CHECK_FUNC(random, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(bsd, random)
fi
AC_CHECK_FUNC(srandom, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(bsd, srandom)
fi
AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(socket, socket)
fi
AH_TEMPLATE([HAVE_LIBX11], [Define if you have the X11 library (-lX11).])
AH_TEMPLATE([HAVE_LIBXPM], [Define if you have the Xpm library (-lXpm).])
AH_TEMPLATE([HAVE_TYPEOF], [Define if you have the typeof function.])
AC_CACHE_CHECK([for typeof], ac_cv_have_typeof,
AC_TRY_COMPILE(, [int a;
typeof(a) b;], ac_cv_have_typeof=yes, ac_cv_have_typeof=no)
)
test "$ac_cv_have_typeof" = yes && AC_DEFINE(HAVE_TYPEOF)
#AC_MSG_CHECKING([for gethostbyname])
#AC_TRY_LINK([#include <netdb.h>], [gethostbyname("")], cf_result=yes, cf_result=no)
#AC_MSG_RESULT($cf_result)
AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(socket, gethostbyname, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(nsl, gethostbyname)
else
test -z "`echo $LIBS | grep -- -lsocket`" && LIBS="$LIBS -lsocket"
fi
fi
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNC(pthread_create, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(pthread, pthread_create, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(pthread, pthread_create)
else
test -z "`echo $LIBS | grep -- -lpthread`" && LIBS="$LIBS -lpthread"
AC_DEFINE(HAVE_LIBPTHREAD)
fi
fi
if test "$with_x" = yes ; then
if test "$ac_cv_have_emx" = yes && test -n "$X11ROOT"; then
CFLAGS="$CFLAGS -I$X11ROOT/XFree86/include"
LDFLAGS="$LDFLAGS -L$X11ROOT/XFree86/lib"
fi
AC_PATH_XTRA
dnl Replace `main' with a function in -lX11:
AC_CHECK_LIB(X11, main,AC_DEFINE(HAVE_LIBXPM) X_LIBS="$X_LIBS -lX11",,-L$x_libraries)
dnl Replace `main' with a function in -lXpm:
AC_CHECK_LIB(Xpm, main,AC_DEFINE(HAVE_LIBX11) X_LIBS="$X_LIBS -lXpm",,-L$x_libraries -lX11)
X0VERKILL=x0verkill
XEDITOR=xeditor
XAVI=xavi
AC_SUBST(X0VERKILL)
AC_SUBST(XEDITOR)
AC_SUBST(XAVI)
fi
if test "$ac_cv_have_emx" = yes; then
LDFLAGS="$LDFLAGS -Zexe"
OVERKILL_SPECIAL="emxbind -e -f -q 0verkill.exe"
fi
AC_SUBST(OVERKILL_SPECIAL)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT