aboutsummaryrefslogtreecommitdiffstats
path: root/libfsotransport/configure.ac
blob: 36e7b010680654edaccdff6282bcffac10d79f68 (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
AC_INIT([libfsotransport], [0.9.8], [smartphones-userland@linuxtogo.org], [libfsotransport])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_PROG_CC
AM_PROG_CC_C_O
AC_GNU_SOURCE
AC_PROG_LIBTOOL

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

# pkg-config requirements
PKG_PROG_PKG_CONFIG

VALA_REQUIRED=0.11.3
GLIB_REQUIRED=2.26.0
GEE_REQUIRED=0.5.0
FSO_BASICS_REQUIRED=0.9.9

# vala
AC_PATH_PROG(VALAC, valac, valac)
AC_SUBST(VALAC)
m4_ifdef([AM_PROG_VALAC], [AM_PROG_VALAC([$VALA_REQUIRED])])

# glib and friends
PKG_CHECK_MODULES(GLIB,
  glib-2.0 >= $GLIB_REQUIRED
  gobject-2.0 >= $GLIB_REQUIRED
  gio-2.0 >= $GLIB_REQUIRED
  gee-1.0 >= $GEE_REQUIRED
  fsobasics-2.0 >= $FSO_BASICS_REQUIRED)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

# check for debugging
AC_ARG_ENABLE(debug,
  AS_HELP_STRING([--enable-debug], [Enable debug build (default=no)]),
  [debug="$enableval"],
  [debug="no"])
AM_CONDITIONAL( [WANT_DEBUG], [test x"$debug" = x"yes"])

# check for disabling of fast baud rates
AC_ARG_ENABLE(fast-baud,
  AS_HELP_STRING([--disable-fast-baud], [Disable fast baud rates (default=yes)]),
  [fastbaud="$enableval"],
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
    #include <termios.h>
    int tspeed = B2500000 + B4000000;
  ]])],fastbaud="yes",fastbaud="no") )
AM_CONDITIONAL( [FAST_BAUD], [test x"$fastbaud" = x"yes"])

# check for disabling palm pre hsuart support
AC_ARG_ENABLE(palmpre-hsuart,
  AS_HELP_STRING([--disable-palmpre-hsuart], [Disable Palm Pre HSUART support (default=yes)]),
  [palmprehsuart="$enableval"],
  [palmprehsuart="yes"])
AM_CONDITIONAL( [WANT_PALMPRE_HSUART], [test x"$palmprehsuart" = x"yes"])

# check for disabling the n_gsm support
AC_ARG_ENABLE(ngsm,
  AS_HELP_STRING([--disable-ngsm], [Disable support for the N_GSM line discipline (default=yes)]),
  [ngsm="$enableval"],
  [ngsm="yes"])
AM_CONDITIONAL( [WANT_NGSM], [test x"$ngsm" = x"yes"])

# git version
GITV=`cat ../.git/refs/heads/master || echo "unknown"`
AC_DEFINE_UNQUOTED([PACKAGE_GITV], ["${GITV}"], [git version])

# output
AC_CONFIG_FILES([Makefile
  fsotransport-2.0.pc
  fsotransport/Makefile
  tests/Makefile])

AC_OUTPUT

# info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION-$GITV"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options:"
echo
echo "  debug build....................: $debug"
echo
echo "  fast baud rates................: $fastbaud"
echo "  palm pre hsuart support........: $palmprehsuart"
echo "  n_gsm line discipline support..: $ngsm"
echo
echo "  prefix.........................: $prefix"
echo
echo "------------------------------------------------------------------------"
echo
echo "Now type 'make' to compile and 'make install' to install this package."