File: configure.in

package info (click to toggle)
netmon-applet 0.4-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 524 kB
  • ctags: 115
  • sloc: sh: 3,348; ansic: 684; makefile: 79
file content (103 lines) | stat: -rw-r--r-- 2,885 bytes parent folder | download | duplicates (2)
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
LIBPANEL_REQUIRED=2.0.0

AC_INIT(netmon_applet, 0.4)
AC_CONFIG_SRCDIR(.)
AM_CONFIG_HEADER(config.h)


# custom define templates (better way to do this without acconfig.h?)
if false; then
AC_DEFINE([__LINUX__], 1, [Using Linux.])
AC_DEFINE([__SOLARIS__], 1, [Using Solaris.])
fi

# Check host type
AC_CANONICAL_SYSTEM
case "$host" in
  *-*-linux*)   AC_DEFINE(__LINUX__)
                interface="eth0";;
  *-*-solaris*) AC_DEFINE(__SOLARIS__)
                interface="hme0"
                LDFLAGS+="-lkstat";;
  *) AC_MSG_ERROR(Only linux and solaris systems are supported.)
esac

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PATH_PROG(GCONFTOOL, gconftool-2)
GNOME_COMPILE_WARNINGS

AM_GCONF_SOURCE_2

AC_PROG_INSTALL
AC_SUBST(INSTALL)

# AM_GNOME2_GETTEXT
GETTEXT_PACKAGE=netmon_applet
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext pkg])
               
 
dnl Checks for header files.
# AC_HEADER_STDC
# AC_CHECK_HEADERS(limits.h syslog.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST

dnl Checks for library functions.
# AC_CHECK_FUNCS(strstr)

# Make sure gnome exists
PKG_CHECK_MODULES(GNOME_APPLETS, libpanelapplet-2.0)
AC_SUBST(GNOME_APPLETS_CFLAGS)
AC_SUBST(GNOME_APPLETS_LIBS)

# check that gnome headers are installed
# AC_MSG_CHECKING(gnome.h)
# hdr=`gnome-config --includedir`/gnome.h
# if test -f $hdr; then
#   AC_MSG_RESULT($hdr)
# else
#   AC_MSG_ERROR(Can't find gnome.h.  Make sure GNOME is correctly installed.)
# fi
# AC_MSG_CHECKING(applet-widget.h)
# hdr=`gnome-config --includedir`/applet-widget.h
# if test -f $hdr; then
#   AC_MSG_RESULT($hdr)
# else
#   AC_MSG_ERROR(Can't find applet-widget.h.  Make sure GNOME is correctly installed.)
# fi

# # Make sure orbit-config exists
# AC_CHECK_PROG(orbitconfig, "orbit-config", yes, no)
# if test $orbitconfig = no; then
#   AC_MSG_ERROR(Can't find orbit-config!  Make sure GNOME is correctly installed and gnome-config is in PATH)
# fi
#
# # set corba directory
# corba=/etc/CORBA/servers
# AC_ARG_WITH(corba, [  --with-corba=DIR  where put the gnorba file [/etc/CORBA/servers]], corba=$withval)
# AC_SUBST(corba)

AC_MSG_CHECKING([for GNOME2 prefix])
with_gnome_prefix=`(pkg-config --variable=prefix libpanelapplet-2.0) 2>/dev/null`
if test $? -ne 0; then
    with_gnome_prefix='${prefix}'
fi 
AC_MSG_RESULT([$with_gnome_prefix])

GNOME_DIR=$with_gnome_prefix
AC_SUBST(GNOME_DIR)


# set default interface
AC_ARG_WITH(interface, [  --with-default-interface=DEV  which network device to use by default]], interface=$withval)
# AC_SUBST(DEFAULT_INTERFACE)
AC_DEFINE_UNQUOTED(DEFAULT_INTERFACE, "$interface", [Default network interface])
AC_MSG_RESULT(Using default network interface $interface.)

AC_OUTPUT([Makefile GNOME_NetmonApplet_Factory.server netmon.schemas])