aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 78ea2aed3d4bfd7e32fc81589a43c2dd29d8d0dc (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
AC_PREREQ(2.53)
AC_INIT(zaurusd, 0.0, http://www.openedhand.com/)
AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_INSTALL
AC_STDC_HEADERS

if test "x$MACHINES" == "x"; then
  while read line
  do
    eval "MACHINE_$line=yes"
    if test -e ./config/mach-config/mach-$line-functions; then
      . ./config/mach-config/mach-$line-functions
    fi
  done < ./config/machines
else
  IFS=:
  for mach in $MACHINES
  do
    eval "MACHINE_$mach=yes"
    if test -e ./config/mach-config/mach-$line-functions; then
      . ./config/mach-config/mach-$line-functions
    fi
  done
  unset IFS
fi

AM_CONDITIONAL(HAVE_INPUT_SWITCHES, test x$HAVE_INPUT_SWITCHES == x1)
AM_CONDITIONAL(HAVE_TSKEYS, test x$HAVE_TSKEYS == x1)
AM_CONDITIONAL(HAVE_ALSA_MIXER, test x$HAVE_ALSA_MIXER == x1)

AC_PROG_AWK 

if $AWK -f ./scripts/gen-mach-header ./config/machines > ./include/machine.h
then
	AC_MSG_NOTICE([creating ./include/machine.h])
else
	AC_MSG_ERROR([Couldn't generate ./include/machine.h])
fi

if test "x$HAVE_TSKEYS" != "x"; then
	#
        # Checks for tslib
	#
	PKG_CHECK_MODULES(TSLIB, "tslib-1.0", :, AC_MSG_ERROR([TSKeys requires tslib.]))
	AC_SUBST(TSLIB_CFLAGS)
	AC_SUBST(TSLIB_LIBS)
fi

appconfdir="$sysconfdir/zaurusd"

AC_SUBST(appconfdir)

AC_CONFIG_HEADERS([include/config.h])

AC_CONFIG_FILES([
  Makefile
  apps/Makefile
  apps/switchevd/Makefile
  apps/tskeys/Makefile
  config/Makefile
  config/config
  config/mach-config/mach-akita-vars
  config/mach-config/mach-borzoi-vars
  config/mach-config/mach-corgi-vars
  config/mach-config/mach-husky-vars
  config/mach-config/mach-poodle-vars
  config/mach-config/mach-shepherd-vars
  config/mach-config/mach-spitz-vars
  config/mach-config/mach-tosa-vars
  scripts/Makefile
  scripts/switch-event
  scripts/zaurusd
  scripts/zaurus-hinge
  scripts/zaurus-mixer
  scripts/zaurus-mixer-callback
])

AC_OUTPUT