summaryrefslogtreecommitdiff
path: root/m4/facebook.m4
blob: 150793b0cc3a1be88ed3de44428c6c7164795b78 (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
AC_DEFUN([GRUSCHLER_CHECK_FACEBOOK],
[
  AC_REQUIRE([AC_PROG_SED])

  AC_MSG_CHECKING([for Facebook settings])

  if ! test -f "facebook.conf"; then
    AC_MSG_ERROR([facebook.conf not found])
  fi

  gruschler_facebook_apikey=`$SED -ne s/^apikey=//p facebook.conf`
  gruschler_facebook_secret=`$SED -ne "s/^secret=//p" facebook.conf`
  gruschler_facebook_email=`$SED -ne "s/^email=//p" facebook.conf`
  gruschler_facebook_password=`$SED -ne "s/^password=//p" facebook.conf`

  if ! test -n "$gruschler_facebook_apikey"; then
    AC_MSG_ERROR(['apikey' setting not found])
  fi

  if ! test -n "$gruschler_facebook_secret"; then
    AC_MSG_ERROR(['secret' setting not found])
  fi

  AC_MSG_RESULT([yes])

  AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_APIKEY],
                     ["$gruschler_facebook_apikey"],
                     [The API key for accessing Facebook])
  AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_SECRET],
                     ["$gruschler_facebook_secret"],
                     [The secret key for accessing Facebook])
  AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_DEFAULT_EMAIL],
                     ["$gruschler_facebook_email"],
                     [Default email address for accessing Facebook])
  AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_DEFAULT_PASSWORD],
                     ["$gruschler_facebook_password"],
                     [Default password for accessing Facebook])
])