-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.in
153 lines (135 loc) · 3.26 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
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(stegdetect.c, 0.6.1, provos@citi.umich.edu)
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR(stegdetect.c)
AM_INIT_AUTOMAKE(stegdetect, 0.6.1)
AM_CONFIG_HEADER(config.h)
dnl Initialize prefix.
if test "$prefix" = "NONE"; then
prefix="/usr/local"
fi
dnl Checks for programs.
AM_PROG_AS
AC_PROG_CXX
AC_PROG_CC
AC_C_INLINE
AC_PROG_INSTALL
dnl Checks for libraries.
AC_MSG_CHECKING(blowfish object)
AC_SUBST(BFOBJ)
case "$target" in
i386-*-*)
AC_MSG_RESULT(bf-586.o)
BFOBJ=bf-586.o ;;
*)
AC_MSG_RESULT(bf_enc.o)
BFOBJ=bf_enc.o;;
esac
dnl Checking for gtk
AC_PATH_PROG(PATH_GTKCONFIG, gtk-config)
if test ! -z "$PATH_GTKCONFIG" ; then
dnl Checks for libevent
havelibevent=no
AC_MSG_CHECKING(for libevent)
AC_ARG_WITH(libevent,
[ --with-libevent=DIR use libevent build directory],
[ case "$withval" in
yes|no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT($withval)
if test -f $withval/event.h -a -f $withval/libevent.a; then
owd=`pwd`
if cd $withval; then withval=`pwd`; cd $owd; fi
EVENTINC="-I$withval"
EVENTLIB="-L$withval -levent"
havelibevent=yes
else
AC_ERROR(event.h or libevent.a not found in $withval)
fi
;;
esac ],
[ if test -f ${prefix}/include/event.h; then
EVENTINC="-I${prefix}/include"
EVENTLIB="-L${prefix}/lib -levent"
havelibevent=yes
AC_MSG_RESULT(yes)
elif test -f /usr/include/event/event.h; then
EVENTINC="-I/usr/include/event"
EVENTLIB="-levent"
havelibevent=yes
AC_MSG_RESULT(yes)
elif test -f /usr/include/event.h; then
EVENTLIB="-levent"
havelibevent=yes
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
]
)
if test $havelibevent = yes; then
AC_SUBST(EVENTINC)
AC_SUBST(EVENTLIB)
GTKINC=`$PATH_GTKCONFIG --cflags`
GTKLIB=`$PATH_GTKCONFIG --libs`
AC_SUBST(GTKINC)
AC_SUBST(GTKLIB)
XSTEG="xsteg"
AC_SUBST(XSTEG)
fi
fi
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_CHECK_TYPE(u_int32_t, unsigned int)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int8_t, unsigned char)
dnl Checks for library functions.
AC_REPLACE_FUNCS(strlcat strlcpy dirname)
if test "x$ac_cv_func_dirname" = "xyes"; then
AC_MSG_CHECKING(for working dirname)
AC_TRY_RUN(
#include <sys/types.h>
#include <string.h>
int
main(int argc, char **argv)
{
char *name = "solaris/sucks";
char *p;
int len = strlen(name);
p = dirname(name);
exit(len != strlen(name));
}, AC_MSG_RESULT(yes), [
AC_MSG_RESULT(no)
LIBOBJS="$LIBOBJS dirname.o"
], AC_MSG_RESULT(yes))
fi
AC_CHECK_FUNCS(strerror)
needmd5=no
AC_CHECK_FUNCS(MD5Update, , [needmd5=yes])
if test $needmd5 = yes; then
LIBOBJS="$LIBOBJS md5.o"
fi
neederr=no
AC_CHECK_FUNCS(warnx, , [neederr=yes])
if test $neederr = yes; then
LIBOBJS="$LIBOBJS err.o"
fi
AC_MSG_CHECKING([for timeradd in sys/time.h])
AC_EGREP_CPP(yes,
[
#include <sys/time.h>
#ifdef timeradd
yes
#endif
], [ AC_DEFINE(HAVE_TIMERADD)
AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])
)
dnl Other stuff
AC_DEFINE_UNQUOTED(_PATH_RULES, "$prefix/share/stegbreak/rules.ini")
AC_C_BIGENDIAN
AC_CONFIG_SUBDIRS(jpeg-6b file)
AC_OUTPUT(Makefile)