File: configure.in

package info (click to toggle)
mtr 0.67-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 708 kB
  • ctags: 504
  • sloc: ansic: 4,139; sh: 677; makefile: 78
file content (136 lines) | stat: -rw-r--r-- 3,919 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
130
131
132
133
134
135
136
AC_INIT(mtr.c)
AM_INIT_AUTOMAKE(mtr, 0.67)


AC_SUBST(GTK_OBJ)
AC_SUBST(CURSES_OBJ)

GTK_OBJ=gtk.o
CURSES_OBJ=curses.o

AC_PROG_CC

AC_CHECK_SIZEOF(unsigned char, 1)
AC_CHECK_SIZEOF(unsigned short, 2)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned long, 4)

# Some doc I found somewhere. :-) -- REW
# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])

# We don't refer to any symbols in termcap, but -lcurses on SunOS does.
# We have to trust the linker not to mess things up... (It should not
# pull in anything if we don't refer to anything in the lib). 
AC_CHECK_LIB(termcap, tgetent)

AC_CHECK_FUNC(initscr, , 
  AC_CHECK_LIB(ncurses, initscr, , 
    AC_CHECK_LIB(curses, initscr, , 
      AC_CHECK_LIB(cursesX, initscr, , 
	AC_MSG_WARN(Building without curses display support)
	AC_DEFINE(NO_CURSES)
	CURSES_OBJ=))))

AC_CHECK_FUNCS(attron)


AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h)
AC_CHECK_HEADERS(sys/xti.h)

AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))

dnl Added ability to cleanly disable GTK+      (12 Jan 2000, Joseph Carter)
AC_ARG_WITH(gtk,
[  --without-gtk           Do not try to use GTK+ at all],
WANTS_GTK=$withval, WANTS_GTK=yes)

AC_ARG_ENABLE(gtk2,
[  --enable-gtk2           Compile against GTK2 instead of GTK+],
WANTS_GTK2=$enableval, WANTS_GTK2=no)
   
if test "x$WANTS_GTK" = "xyes"; then
	if test "x$WANTS_GTK2" = "xyes"; then
                AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS"
                           LIBS="$LIBS $GTK_LIBS -lm",
                           AC_MSG_WARN(Building without GTK2 display support)
                           AC_DEFINE(NO_GTK)
                           GTK_OBJ="")
        else
		AM_PATH_GTK(1.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS"
                           LIBS="$LIBS $GTK_LIBS",
                           AC_MSG_WARN(Building without GTK+ display support)
                           AC_DEFINE(NO_GTK)
                           GTK_OBJ="")
	fi
else
	AC_DEFINE(NO_GTK)
	GTK_OBJ=""
fi

AC_CHECK_FUNC(socket, , 
  AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(No socket library found)))

AC_CHECK_FUNC(gethostbyname, ,
  AC_CHECK_LIB(nsl, gethostbyname, , AC_MSG_ERROR(No nameservice library found)))

#AC_CHECK_FUNC(res_init, , 
#  AC_CHECK_LIB(bind, res_init, , 
#   AC_CHECK_LIB(resolv, res_init, , AC_MSG_ERROR(No resolver library found))))

AC_CHECK_FUNCS(seteuid)
#  AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or setuid))

AC_CHECK_FUNC(res_mkquery, , 
  AC_CHECK_LIB(bind, res_mkquery, , 
   AC_CHECK_LIB(resolv, res_mkquery, , AC_MSG_ERROR(No resolver library found))))

AC_CHECK_FUNC(herror, , AC_DEFINE(NO_HERROR))
AC_CHECK_FUNC(strerror, , AC_DEFINE(NO_STRERROR))


dnl Add C flags to display more warnings
AC_MSG_CHECKING(for C flags to get more warnings)
ac_save_CFLAGS="$CFLAGS"
if test "x$ac_cv_prog_gcc" = "xyes" ; then
  dnl gcc is the easiest C compiler
  warning_CFLAGS="-Wall"
else
  dnl Vendor supplied C compilers are a bit tricky
  case "$host_os" in
    dnl SGI IRIX with the MipsPRO C compiler
    irix*)
      CFLAGS="$CFLAGS -fullwarn"
      AC_TRY_COMPILE([#include <stdio.h>],[printf("test");],
        warning_CFLAGS="-fullwarn",)
      ;;

    dnl SunOS 4.x with the SparcWorks(?) acc compiler
    sunos*)
        if "$CC" = "acc" ; then
          CFLAGS="$CFLAGS -vc"
          AC_TRY_COMPILE([#include <stdio.h>],[printf("test");],
            warning_CFLAGS="-vc",)
        fi
      ;;

    dnl Unknown, do nothing
    *)
      warning_CFLAGS="none"
      ;;
  esac
fi
CFLAGS="$ac_save_CFLAGS"
if test "$warning_CFLAGS" = "none" ; then
  AC_MSG_RESULT(none)
else
  CFLAGS="$CFLAGS $warning_CFLAGS"
  AC_MSG_RESULT($warning_CFLAGS)
fi




AM_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile img/Makefile)