File: configure.ac

package info (click to toggle)
libgit2-glib 0.0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,456 kB
  • ctags: 4,162
  • sloc: ansic: 15,757; sh: 11,230; makefile: 308; python: 52
file content (175 lines) | stat: -rw-r--r-- 4,723 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
AC_PREREQ([2.63])

m4_define(libgit2_glib_major_version,  0)
m4_define(libgit2_glib_minor_version,  0)
m4_define(libgit2_glib_micro_version, 22)
m4_define(libgit2_glib_version, libgit2_glib_major_version.libgit2_glib_minor_version.libgit2_glib_micro_version)

AC_INIT([libgit2-glib],
        [libgit2_glib_version],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=libgit2-glib],
        [libgit2-glib])

# Libtool versioning
#
# For development releases, keep the same numbers.
#
# For stable releases, apply the following algorithm step by step:
# 1. If the library source code has changed at all since the last
#    update, then increment REVISION.
# 2. If any exported functions or data have been added, removed, or
#    changed since the last update, increment CURRENT and set REVISION
#    to 0.
# 3. If any exported functions or data have been added since the last
#    public release, increment AGE.
# 4. If any exported functions or data have been removed since the last
#    public release, set AGE to 0.

LIBGIT2_GLIB_LT_CURRENT=0
LIBGIT2_GLIB_LT_REVISION=0
LIBGIT2_GLIB_LT_AGE=0
LIBGIT2_GLIB_LT_VERSION="$LIBGIT2_GLIB_LT_CURRENT:$LIBGIT2_GLIB_LT_REVISION:$LIBGIT2_GLIB_LT_AGE"
AC_SUBST(LIBGIT2_GLIB_LT_VERSION)

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([libgit2-glib/ggit-repository.c])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip])
AM_MAINTAINER_MODE([enable])

AM_SILENT_RULES([yes])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])

AM_INIT_AUTOMAKE
AC_PROG_LIBTOOL
AC_PROG_CC

# GLib enums
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)

# Documentation
GTK_DOC_CHECK([1.11], [--flavour=no-tmpl])

INTROSPECTION_REQUIRED=0.10.1
GLIB_REQUIRED=2.28.0
GIT2_REQUIRED=0.21.0

PKG_CHECK_MODULES(LIBGIT2_GLIB, [
	gobject-2.0 >= $GLIB_REQUIRED
	glib-2.0 >= $GLIB_REQUIRED
	gio-2.0 >= $GLIB_REQUIRED
	libgit2 >= $GIT2_REQUIRED
	gobject-introspection-1.0 >= $INTROSPECTION_REQUIRED
])

LIBGIT2_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir libgit2)
LIBGIT2_GLIB_CFLAGS="${LIBGIT2_GLIB_CFLAGS} -I$LIBGIT2_INCLUDE_DIR"

GOBJECT_INTROSPECTION_REQUIRE($INTROSPECTION_REQUIRED)

AC_SUBST(INTROSPECTION_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GIT2_REQUIRED)

dnl ===========================================================================
dnl Check for libgit2 ssh support
dnl ===========================================================================

AC_MSG_CHECKING([for libgit2 ssh support])

cflags_save="${CFLAGS}"
libs_save="${LIBS}"

CFLAGS="${LIBGIT2_GLIB_CFLAGS}"
LIBS="${LIBGIT2_GLIB_LIBS}"

AC_TRY_RUN([
        #include <git2.h>
        int
        main(int argc, const char *argv[])
        {
                git_threads_init ();
                return ((git_libgit2_features() & GIT_FEATURE_SSH) != 0) ? 0 : 1;
        }
],[
    AC_MSG_RESULT([yes])
    git_ssh=yes
],[
    AC_MSG_RESULT([no])
    git_ssh=no
])

CFLAGS="${cflags_save}"
LIBS="${libs_save}"

if test "x$git_ssh" = "xyes"; then
	LIBGIT2_GLIB_CFLAGS="${LIBGIT2_GLIB_CFLAGS} -DGIT_SSH=1"
	LIBGIT2_GLIB_PCCFLAGS="-DGIT_SSH=1"

    GGIT_SSH_INCLUDES="
#include <libgit2-glib/ggit-cred-ssh-key-from-agent.h>
#include <libgit2-glib/ggit-cred-ssh-interactive.h>
"
fi

AC_SUBST(GGIT_SSH_INCLUDES)
AC_SUBST(LIBGIT2_GLIB_PCCFLAGS)

AM_CONDITIONAL(GIT_SSH, test x"$git_ssh" = "xyes")

dnl ===========================================================================
dnl Check for python
dnl ===========================================================================
PYGOBJECT_REQUIRED=3.0.0

AC_ARG_ENABLE([python],
              AS_HELP_STRING([--enable-python[=@<:@no/auto/yes@:>@]],[Build with python support]),
              [enable_python=$enableval],
              [enable_python="auto"])

if test "x$enable_python" = "xauto"; then
        PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
                         [enable_python=yes],[enable_python=no])
fi

if test "x$enable_python" = "xyes"; then
        AM_PATH_PYTHON(3.2.3)

        PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])

        pyoverridesdir="\$(pyexecdir)/gi/overrides"
        AC_SUBST(pyoverridesdir)
fi

AM_CONDITIONAL(ENABLE_PYTHON, test x"$enable_python" = "xyes")

# Vala
VAPIGEN_CHECK

AC_CHECK_HEADER([termios.h],
                [has_termios=yes],
                [has_termios=no])

AM_CONDITIONAL(HAS_TERMIOS, test x"$has_termios" = "xyes")

GNOME_COMPILE_WARNINGS([maximum])

AC_OUTPUT([
	libgit2-glib-1.0.pc
	Makefile
	docs/Makefile
	docs/reference/Makefile
	docs/reference/version.xml
	examples/Makefile
	libgit2-glib/Makefile
    libgit2-glib/ggit.h
	tests/Makefile
])

if test "x$git_ssh" != "xyes"; then
echo "*** libgit2-glib will be built without SSH support! ***"
fi