summaryrefslogtreecommitdiff
path: root/Source/DiVine/configure.in
blob: d9e07d80e63c605e1a9b6137ac4a3dbc0257c905 (plain)
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
137
138
139
dnl Process this file with autoconf to produce a configure script.

AC_INIT(include/divine.h)

AC_PREREQ(2.52)

#
# Making releases:
#   DIVINE_MICRO_VERSION += 1;
#   DIVINE_INTERFACE_AGE += 1;
#   DIVINE_BINARY_AGE += 1;
# if any functions have been added, set DIVINE_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set DIVINE_BINARY_AGE and DIVINE_INTERFACE_AGE to 0.
#
DIVINE_MAJOR_VERSION=0
DIVINE_MINOR_VERSION=4
DIVINE_MICRO_VERSION=0
DIVINE_INTERFACE_AGE=0
DIVINE_BINARY_AGE=0
DIVINE_VERSION=$DIVINE_MAJOR_VERSION.$DIVINE_MINOR_VERSION.$DIVINE_MICRO_VERSION

AC_SUBST(DIVINE_MAJOR_VERSION)
AC_SUBST(DIVINE_MINOR_VERSION)
AC_SUBST(DIVINE_MICRO_VERSION)
AC_SUBST(DIVINE_INTERFACE_AGE)
AC_SUBST(DIVINE_BINARY_AGE)
AC_SUBST(DIVINE_VERSION)

AC_DEFINE_UNQUOTED(DIVINE_VERSION, "$DIVINE_VERSION", [DiVine Version])
AC_DEFINE_UNQUOTED(DIVINE_MAJOR_VERSION, $DIVINE_MAJOR_VERSION,
					 [DiVine major version number])
AC_DEFINE_UNQUOTED(DIVINE_MINOR_VERSION, $DIVINE_MINOR_VERSION,
                                         [DiVine minor version number])

# libtool versioning
LT_RELEASE=$DIVINE_MAJOR_VERSION.$DIVINE_MINOR_VERSION
LT_CURRENT=`expr $DIVINE_MICRO_VERSION - $DIVINE_INTERFACE_AGE`
LT_REVISION=$DIVINE_INTERFACE_AGE
LT_AGE=`expr $DIVINE_BINARY_AGE - $DIVINE_INTERFACE_AGE`

AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

# For automake.
VERSION=$DIVINE_VERSION
PACKAGE=DiVine

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_DISABLE_STATIC
AC_PROG_CC
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_HEADER_STDC


dnl Clear default CFLAGS
if test x"$CFLAGS" = x"-g -O2"; then
  CFLAGS=
fi
  
CFLAGS="-O3 -pipe $CFLAGS"

if test "x$GCC" = xyes; then
  CFLAGS="-Wall $CFLAGS"
fi


AM_CONDITIONAL(BUILD_STATIC, test "$enable_static" = "yes")


#
# Find pkg-config
#
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno ; then
  AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
fi

if ! pkg-config --atleast-pkgconfig-version 0.9 ; then
  AC_MSG_ERROR([*** pkg-config too old; version 0.9 or better required.])  
fi


#
# Check for DirectFB
#
DIRECTFB_REQUIRED_VERSION=1.0.0

AC_MSG_CHECKING(for DirectFB)
  if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
        DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
        DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
        AC_MSG_RESULT(found)
  else
    	AC_MSG_ERROR([*** DirectFB $DIRECTFB_REQUIRED_VERSION or newer is required. ])
  fi
 

#
# Check for DirectFB-Internal
#
AC_MSG_CHECKING(for DirectFB-Internal)
  if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb-internal ; then
        MODULEDIR=$libdir/`$PKG_CONFIG --variable=moduledirname directfb-internal`
        DIRECTFB_INTERNAL_CFLAGS=`$PKG_CONFIG --cflags directfb-internal`
        AC_MSG_RESULT(found)
  else
    	AC_MSG_ERROR([*** DirectFB-Internal $DIRECTFB_REQUIRED_VERSION or newer is required. ])
  fi


AC_SUBST(DIRECTFB_CFLAGS)
AC_SUBST(DIRECTFB_LIBS)
AC_SUBST(MODULEDIR)
AC_SUBST(DIRECTFB_INTERNAL_CFLAGS)

CFLAGS="$CFLAGS -Werror-implicit-function-declaration"

AC_OUTPUT([
divine-config
divine.pc     
Makefile
driver/Makefile
examples/Makefile
lib/Makefile
include/Makefile
proxy/Makefile
proxy/dispatcher/Makefile
proxy/requestor/Makefile
rules/Makefile
], [chmod +x divine-config])