File: configure.in

package info (click to toggle)
gfcc 0.7.4-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,084 kB
  • ctags: 320
  • sloc: sh: 7,159; ansic: 4,082; makefile: 101
file content (113 lines) | stat: -rw-r--r-- 2,954 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(gfcc, 0.7.4)
AM_PROG_LIBTOOL

PACKAGE_VERSION="$PACKAGE-$VERSION"
AC_SUBST(PACKAGE_VERSION)
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION", [Name and Version])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK

AM_PATH_GTK(1.2.0,,
             AC_MSG_ERROR(Cannot find GTK+: Is gtk-config in executable path?))
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"

AC_ARG_WITH(ipfwc,
      [  --with-ipfwc=PATH          pass compiler flags to look for libraries],
      [lib_ipfwc_path="$withval"]) 

AC_MSG_CHECKING(for libipfwc)
if test -n "$lib_ipfwc_path"; then
	if ! test -d $lib_ipfwc_path; then
		AC_MSG_RESULT(library directory not exist)
		exit;
	fi
	if ! test -f $lib_ipfwc_path/libipfwc.a; then
		AC_MSG_RESULT(libipfwc.a not maked. make libipfwc.a first)
		exit;
	fi

	case "$lib_ipfwc_path" in
        /* | [A-Za-z]:[/\\]*)
	  ;;
	*)
	  lib_ipfwc_path="`pwd`/$lib_ipfwc_path"
	  ;;
	esac

	LIBS="-L$lib_ipfwc_path $LIBS -lipfwc" 
	CFLAGS="-I$lib_ipfwc_path $CFLAGS"
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT("! libipfwc not defined try --with-ipfwc=PATH")
	exit;
fi

AC_MSG_CHECKING(for Linux 2.1.102 or higher)
OS_NAME=`uname -s`
if test "$OS_NAME" = "Linux"; then
	OS_REV=`sed -ne 's/^#define UTS_RELEASE "\([^"]*\)"/\1/p' < /usr/include/linux/version.h`
	OS_MAJOR=`echo $OS_REV | cut -d. -f1`
	OS_MINOR=`echo $OS_REV | cut -d. -f2`
	OS_SUB_FULL=`echo $OS_REV | cut -d- -f1 | cut -d. -f3`
	changequote(<<,>>)
	OS_SUB_SUFFIX=`echo $OS_SUB_FULL |sed -ne 's/^[0-9]*/\1/p'`
	changequote([,])
	OS_SUB=`basename $OS_SUB_FULL $OS_SUB_SUFFIX`

	if test "$OS_MAJOR" -ge "2" -a "$OS_MINOR" -ge "1"; then
		if test "$OS_MINOR" -ge "2" -o "$OS_SUB" -ge "102"; then
			AC_MSG_RESULT(yes)
		else
			AC_MSG_RESULT("! You must upgrade the kernel...")
			exit;
		fi
	else
		AC_MSG_RESULT("! You must upgrade the kernel...")
		exit;
	fi
else
	AC_MSG_RESULT("! You must upgrade the kernel...")
	exit;
fi

CFLAGS="$CFLAGS -DGFCC_HOME=\\\"$datadir/$PACKAGE\\\""

dnl Checks for libraries.
dnl Replace `main' with a function in -lX11:
AC_CHECK_LIB(X11, main)
dnl Replace `main' with a function in -lXext:
AC_CHECK_LIB(Xext, main)
dnl Replace `main' with a function in -ldl:
AC_CHECK_LIB(dl, main)
dnl Replace `main' with a function in -lgdk:
AC_CHECK_LIB(gdk, main)
dnl Replace `main' with a function in -lglib:
AC_CHECK_LIB(glib, main)
dnl Replace `main' with a function in -lgmodule:
AC_CHECK_LIB(gmodule, main)
dnl Replace `main' with a function in -lgtk:
AC_CHECK_LIB(gtk, main)
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, main)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)

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

dnl Checks for library functions.
AC_FUNC_MEMCMP

AC_OUTPUT(rules/Makefile data/Makefile Makefile)