- do not add rules that are always fulfilled
[platform/upstream/libsolv.git] / configure.in
1 dnl *******************************************
2 dnl *** Initialize automake and set version ***
3 dnl *******************************************
4
5 AC_PREREQ(2.53)
6 AC_INIT(satsolver, 0.0.1)
7 AC_CONFIG_SRCDIR(src/solver.c)
8 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
9
10 AM_CONFIG_HEADER(config.h)
11 AC_PROG_MAKE_SET
12
13 dnl ***************************
14 dnl *** Set debugging flags ***
15 dnl ***************************
16
17 debug_default=minimum
18
19
20 # Declare --enable-* args and collect ac_help strings
21 AC_ARG_ENABLE(debug, 
22               [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,
23               enable_debug=$debug_default)
24
25 # Set the debug flags
26 if test "x$enable_debug" = "xyes"; then
27     test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
28 fi
29
30 # check for ssize_t
31 AC_CHECK_TYPE(ssize_t, int)
32
33 dnl ***************************
34 dnl *** Checks for programs ***
35 dnl ***************************
36
37
38 AC_PROG_CC
39 AM_PROG_CC_STDC
40 AC_PROG_INSTALL
41
42 # Set STDC_HEADERS
43 AC_HEADER_STDC
44
45 # Turn off the shared solver library until we have a stable API
46 AC_DISABLE_SHARED
47
48 # Initialize libtool
49 AM_PROG_LIBTOOL
50
51 # This isn't a program, but it doesn't fit anywhere else...
52 AC_FUNC_ALLOCA
53
54
55
56 dnl ***********************
57 dnl *** expat and db43  ***
58 dnl ***********************
59
60 AC_CHECK_LIB([expat], [XML_ParserCreate], [], [AC_MSG_ERROR(Please install expat)])
61
62 AC_CHECK_LIB([db-4.3], [db_create], [], [AC_MSG_ERROR(Please install db43-devel)])
63
64 dnl ***********************
65 dnl *** Check for Win32 ***
66 dnl ***********************
67
68 AC_MSG_CHECKING([for Win32])
69 case "$host" in
70   *-*-mingw*)
71     os_win32=yes
72     AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes])
73     AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes])
74     AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes])
75     AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes])
76     AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes])
77     ;;
78   *)
79     os_win32=no
80     ;;
81 esac
82 AC_MSG_RESULT([$os_win32])
83 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
84
85 dnl *******************
86 dnl *** Misc checks ***
87 dnl *******************
88 AC_CHECK_FUNCS(gmtime_r)
89 dnl ----------------------------------------------------------------------
90 AC_CHECK_HEADERS([inttypes.h stdlib.h])
91
92     AC_CHECK_SIZEOF(short)
93     AC_CHECK_SIZEOF(int)
94     AC_CHECK_SIZEOF(long)
95     AC_CHECK_SIZEOF(long long)
96     SIZEOF_SHORT=$ac_cv_sizeof_short
97     SIZEOF_INT=$ac_cv_sizeof_int
98     SIZEOF_LONG=$ac_cv_sizeof_long
99     SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
100     AC_SUBST(SIZEOF_SHORT)
101     AC_SUBST(SIZEOF_INT)
102     AC_SUBST(SIZEOF_LONG)
103     AC_SUBST(SIZEOF_LONG_LONG)
104
105 if test "$prefix" = "NONE"; then
106     prefix=$ac_default_prefix;
107 fi
108
109 dnl *************************************
110 dnl *** Warnings to show if using GCC ***
111 dnl *************************************
112
113 AC_ARG_ENABLE(more-warnings,
114               [  --disable-more-warnings  Inhibit compiler warnings],
115               set_more_warnings=no)
116
117 if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
118         CFLAGS="$CFLAGS \
119                 -Wall -Wstrict-prototypes -Wmissing-declarations \
120                 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
121                 -Wunused -Werror"
122 fi
123
124 if test "$os_win32" != yes; then
125         # Use reentrant functions (FIXME!)
126         CFLAGS="$CFLAGS -D_REENTRANT"
127 fi
128
129 dnl *************************
130 dnl *** Output Everything ***
131 dnl *************************
132 AC_SUBST(SYSCONFDIR)
133
134 AC_OUTPUT([
135         Makefile
136         src/Makefile
137         tools/Makefile
138         testsuite/Makefile
139         doc/Makefile
140         ])