summaryrefslogtreecommitdiff
path: root/configure.in
blob: 09d84515082d4f3964c892716abc82480150daaf (plain)
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
# Process this file with autoconf to produce a configure script.

# Require autoconf 2.12
AC_PREREQ(2.12)

# Initialize autoconf
AC_INIT(configure.in)

AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
SOUP_MAJOR_VERSION=0
SOUP_MINOR_VERSION=1
SOUP_MICRO_VERSION=6
SOUP_INTERFACE_AGE=0
SOUP_BINARY_AGE=0
SOUP_VERSION=$SOUP_MAJOR_VERSION.$SOUP_MINOR_VERSION.$SOUP_MICRO_VERSION
VERSION=$SOUP_VERSION
PACKAGE=soup
AC_DIVERT_POP()

LT_RELEASE=$SOUP_VERSION
LT_CURRENT=$SOUP_INTERFACE_AGE
LT_REVISION=$SOUP_BINARY_AGE
LT_AGE=`expr $SOUP_BINARY_AGE - $SOUP_INTERFACE_AGE`

AC_SUBST(SOUP_MAJOR_VERSION)
AC_SUBST(SOUP_MINOR_VERSION)
AC_SUBST(SOUP_MICRO_VERSION)
AC_SUBST(SOUP_VERSION)
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

# Specify a configuration file
AM_CONFIG_HEADER(config.h)

# Initialize automake
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)

# Initialize maintainer mode
AM_MAINTAINER_MODE


# ****************************************
# Set debugging flags

# Figure out debugging default, prior to $ac_help setup
AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
if test `expr $SOUP_MINOR_VERSION \% 2` = 1 ; then
	debug_default=yes
else
	debug_default=minimum
fi
AC_DIVERT_POP()

# Declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)

# Set the debug flags
AC_MSG_CHECKING(for --enable-debug)
if test "x$enable_debug" = "xyes"; then
  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
  SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
  AC_MSG_RESULT(yes)
else
  if test "x$enable_debug" = "xno"; then
    SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
    AC_MSG_RESULT(no)
  fi
fi

AC_SUBST(SOUP_DEBUG_FLAGS)


# ****************************************
# Check for programs

AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL

# Use an many warnings as possible
changequote(,)
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac

  if test "x$enable_ansi" = "xyes"; then
    case " $CFLAGS " in
    *[\ \	]-ansi[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -ansi" ;;
    esac

    case " $CFLAGS " in
    *[\ \	]-pedantic[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -pedantic" ;;
    esac
  fi
fi
changequote([,])

# Use reentrant functions
CFLAGS="$CFLAGS -D_REENTRANT"

# Set STDC_HEADERS
AC_HEADER_STDC

# Initialize libtool
AM_PROG_LIBTOOL


# ****************************************
# Check for libraries

# Need GLIB
AM_PATH_GLIB(1.2.0,
            [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
            AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))

GLIB_CFLAGS=`glib-config --cflags glib`
GLIB_LIBS=`glib-config --libs glib`

AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)


# Need GNET
AM_PATH_GNET(1.0.0,
	     [LIBS="$LIBS $GNET_LIBS" CFLAGS="$CFLAGS $GNET_CFLAGS"],
             AC_MSG_ERROR(Cannot find GNET: Is gnet-config in path?))

GNET_CFLAGS=`gnet-config --cflags gnet`
GNET_LIBS=`gnet-config --libs gnet`

AC_SUBST(GNET_CFLAGS)
AC_SUBST(GNET_LIBS)


# Need in.h and tcp.h for setting of TCP_NODELAY
AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)


# Check for OpenSSL
AC_CHECK_HEADERS(openssl/ssl.h)


# Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")

# If gcc is the compiler, compile with lots of warnings
if test "x$GCC" = "xyes"; then
	CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations "
fi

#	doc/Makefile
#	gnome-soup.spec

AC_OUTPUT([
	Makefile
	src/Makefile
	tests/Makefile
])