File: configure.ac

package info (click to toggle)
liboop 1.0.1-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,108 kB
  • sloc: sh: 11,098; ansic: 2,533; makefile: 133
file content (129 lines) | stat: -rw-r--r-- 3,645 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(INSTALL)
AM_INIT_AUTOMAKE(liboop,1.0.1)
AC_CANONICAL_HOST
AM_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_INSTALL
PROG_LDCONFIG=:

AC_ARG_WITH(adns, AC_HELP_STRING(--without-adns,disable ADNS adapter))
AC_ARG_WITH(readline, AC_HELP_STRING(--without-readline,disable readline adapter))
AC_ARG_WITH(glib, AC_HELP_STRING(--without-glib,disable GLib adapter))
AC_ARG_WITH(tcl, AC_HELP_STRING(--without-tcl,disable Tcl/Tk adapter))
AC_ARG_WITH(libwww, AC_HELP_STRING(--with-libwww,build libwww adapter))

dnl System type checks.
case "$host" in
  *-linux-*|*-k*bsd*|*-gnu*)
    AC_PATH_PROG(PROG_LDCONFIG, ldconfig, :, $PATH:/usr/sbin:/sbin)
    no_wacky_libs=yes
    ;;
  *-sgi-irix6*)
    if test -n "$LPATH" ; then
      LDFLAGS="-Wl,-rpath,$LPATH $LDFLAGS"
    fi
    no_wacky_libs=yes
    ;;
esac

AC_CHECK_HEADERS(poll.h sys/select.h sys/socket.h string.h strings.h)

if test xno != x$with_adns; then
  AC_CHECK_LIB(adns,adns_init,[
    ADNS_LIBS="-ladns"
    AC_DEFINE(HAVE_ADNS)
  ])
fi
AM_CONDITIONAL([WANT_ADNS], [test -n "$ADNS_LIBS"])

if test xno != x$with_readline; then
  AC_CHECK_LIB(readline,rl_callback_handler_install,[
  AC_CHECK_HEADER(readline/readline.h,[
    READLINE_LIBS="-lreadline"
    AC_DEFINE(HAVE_READLINE)
  ])])
fi
AM_CONDITIONAL([WANT_READLINE], [test -n "$READLINE_LIBS"])

if test xno != x$with_glib; then
  save_libs="$LIBS"
  save_cppflags="$CPPFLAGS"
  AC_CHECK_PROG(PROG_GLIB_CONFIG,glib-config,glib-config)
  if test -n "$PROG_GLIB_CONFIG" ; then
    GLIB_INCLUDES="`glib-config --cflags`"
    GLIB_LIBS="`glib-config --libs`"
    LIBS="$save_libs $GLIB_LIBS"
    CPPFLAGS="$save_cppflags $GLIB_INCLUDES"
    AC_CHECK_FUNC(g_main_set_poll_func,[
    AC_CHECK_HEADER(glib.h,[
      have_glib="true"
      AC_DEFINE(HAVE_GLIB)
    ])])
  fi
  LIBS="$save_libs"
  CPPFLAGS="$save_cppflags"

  PKG_CHECK_MODULES(GLIB2,glib-2.0 >= 2.0,[
    have_glib2="true"
    AC_DEFINE(HAVE_GLIB)
    ],[:])
fi
AM_CONDITIONAL([WANT_GLIB], [test -n "$have_glib"])
AM_CONDITIONAL([WANT_GLIB2], [test -n "$have_glib2"])

if test xno != x$with_tcl; then
  for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
    CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
    AC_CHECK_LIB(tcl$version,Tcl_Main,[
    AC_CHECK_HEADER(tcl.h,[
      AC_DEFINE(HAVE_TCL)
      TCL_INCLUDES="-I/usr/include/tcl$version"
      TCL_LIBS="-ltcl$version"
      break
    ])])
  done
  CPPFLAGS="$save_cppflags"
fi
AM_CONDITIONAL([WANT_TCL], [test -n "$TCL_LIBS"])

if test xyes = x$with_libwww; then
  save_libs="$LIBS"
  save_cppflags="$CPPFLAGS"
  AC_CHECK_PROG(PROG_WWW_CONFIG,libwww-config,libwww-config)
  if test -n "$PROG_WWW_CONFIG" ; then
    WWW_INCLUDES="`libwww-config --cflags`"
    WWW_LIBS="`libwww-config --libs`"
    LIBS="$save_libs $WWW_LIBS"
    CPPFLAGS="$save_cppflags $WWW_INCLUDES"
    AC_CHECK_FUNC(HTEvent_setRegisterCallback,[
      have_www="true"
      AC_DEFINE(HAVE_WWW)
    ])
  fi
  LIBS="$save_libs"
  CPPFLAGS="$save_cppflags"
fi
AM_CONDITIONAL([WANT_WWW], [test -n "$have_www"])

if test -z "$no_wacky_libs" ; then
  AC_CHECK_LIB(resolv,res_query)
  AC_SEARCH_LIBS(gethostbyname,nsl)
  AC_SEARCH_LIBS(socket,socket)
fi

test yes = "$GCC" && 
CFLAGS="-Wall -Wno-comment -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wwrite-strings $CFLAGS"' $(EXTRA_CFLAGS)'

AC_SUBST(PROG_LDCONFIG)
AC_SUBST(GLIB_INCLUDES)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB2_CFLAGS)
AC_SUBST(GLIB2_LIBS)
AC_SUBST(TCL_INCLUDES)
AC_SUBST(TCL_LIBS)
AC_SUBST(ADNS_LIBS)
AC_SUBST(WWW_INCLUDES)
AC_SUBST(WWW_LIBS)
AC_SUBST(READLINE_LIBS)
AC_OUTPUT([Makefile liboop.pc liboop-glib2.pc])