~ubuntu-branches/debian/sid/freeciv/sid

« back to all changes in this revision

Viewing changes to m4/auth.m4

  • Committer: Package Import Robot
  • Author(s): Karl Goetz
  • Date: 2011-12-31 11:39:58 UTC
  • mfrom: (1.2.20)
  • Revision ID: package-import@ubuntu.com-20111231113958-laureotb00yk2331
Tags: 2.3.1-1
* Switch to short style dh with overrides
  - Update control to 7.0.50 and compat to 7
  - Various packaging cleanups, fixes various issues with our
    packaging that appears to have been broken for some time.
* Change our dependency away from ttf-sazanami-gothic per the
  request of its maintainer (Closes: #642944)
* New package freeciv-client-extras with freeciv-modpack in it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
  AC_ARG_WITH(mysql-prefix,[  --with-mysql-prefix=PFX Prefix where MySQL is installed (optional)],
19
19
              mysql_prefix="$withval", mysql_prefix="")
20
20
 
 
21
  if test "x$mysql_prefix" != "x" ; then
 
22
    mysql_libdir="$mysql_prefix/lib/mysql"
 
23
  fi
 
24
 
 
25
  AC_ARG_WITH([mysql-libdir], [  --with-mysql-libdir=Where MySQL library is installed (optional)],
 
26
[mysql_libdir="$withval"])
 
27
 
21
28
  if test x$auth = xyes ; then
22
29
 
23
30
    if test x$mysql_prefix = x ; then
25
32
                      [AC_MSG_WARN([couldn't find mysql header: disabling auth]);
26
33
                       auth=no])
27
34
 
28
 
      dnl we need to set -L correctly, we will check once in standard locations
29
 
      dnl then we will check with other LDFLAGS. if none of these work, we fail.
30
 
 
31
 
      AC_CHECK_LIB(mysqlclient, mysql_query, 
32
 
                   [AUTH_LIBS="-lmysqlclient $AUTH_LIBS"],
33
 
                   [AC_MSG_WARN([couldn't find mysql libs in normal locations]);
34
 
                    auth=no])
35
 
 
36
 
      if test x$auth = xno ; then
37
 
        fc_preauth_LDFLAGS="$LDFLAGS"
38
 
        fc_mysql_lib_loc="-L/usr/lib/mysql -L/usr/local/lib/mysql"
39
 
 
40
 
        for __ldpath in $fc_mysql_lib_loc; do
41
 
          unset ac_cv_lib_mysqlclient_mysql_query
42
 
          LDFLAGS="$LDFLAGS $__ldpath"
43
 
 
44
 
          AC_CHECK_LIB(mysqlclient, mysql_query,
45
 
                       [AUTH_LIBS="-lmysqlclient $AUTH_LIBS";
46
 
                        AC_MSG_WARN([had to add $__ldpath to LDFLAGS])
47
 
                        auth=yes],
48
 
                        [AC_MSG_WARN([couldn't find mysql libs in $__ldpath])])
49
 
 
50
 
          if test x$auth = xyes; then
51
 
            break
52
 
          else
53
 
            LDFLAGS="$fc_preauth_LDFLAGS"
54
 
          fi
55
 
        done
56
 
 
 
35
      if test "x$mysql_libdir" = "x" ; then
 
36
        dnl we need to set -L correctly, we will check once in standard locations
 
37
        dnl then we will check with other LDFLAGS. if none of these work, we fail.
 
38
        AC_CHECK_LIB(mysqlclient, mysql_query, 
 
39
                     [AUTH_LIBS="-lmysqlclient $AUTH_LIBS"],
 
40
                     [AC_MSG_WARN([couldn't find mysql libs in normal locations]);
 
41
                     auth=no])
57
42
        if test x$auth = xno ; then
58
 
          AC_MSG_ERROR([couldn't find mysql libs at all])
 
43
          fc_preauth_LDFLAGS="$LDFLAGS"
 
44
          fc_mysql_lib_loc="-L/usr/lib/mysql -L/usr/local/lib/mysql"
 
45
 
 
46
          for __ldpath in $fc_mysql_lib_loc; do
 
47
            unset ac_cv_lib_mysqlclient_mysql_query
 
48
            LDFLAGS="$LDFLAGS $__ldpath"
 
49
 
 
50
            AC_CHECK_LIB(mysqlclient, mysql_query,
 
51
                         [AUTH_LIBS="-lmysqlclient $AUTH_LIBS";
 
52
                          AC_MSG_WARN([had to add $__ldpath to LDFLAGS])
 
53
                          auth=yes],
 
54
                          [AC_MSG_WARN([couldn't find mysql libs in $__ldpath])])
 
55
 
 
56
            if test x$auth = xyes; then
 
57
              break
 
58
            else
 
59
              LDFLAGS="$fc_preauth_LDFLAGS"
 
60
            fi
 
61
          done
59
62
        fi
 
63
 
 
64
      else
 
65
        LDFLAGS="$LDFLAGS -L$mysql_libdir"
 
66
        AC_CHECK_LIB([mysqlclient], [mysql_query],
 
67
                     [AUTH_LIBS="-lmysqlclient $AUTH_LIBS"],
 
68
                     [AC_MSG_WARN([couldn't find mysql libs in $mysql_libdir]);
 
69
                     auth=no])
 
70
      fi
 
71
 
 
72
      if test x$auth = xno ; then
 
73
        AC_MSG_ERROR([couldn't find mysql libs at all])
60
74
      fi
61
75
    else
62
76
      AUTH_CFLAGS="-I$mysql_prefix/include $AUTH_CFLAGS"
63
 
      AUTH_LIBS="-L$mysql_prefix/lib/mysql -lmysqlclient $AUTH_LIBS"
 
77
      AUTH_LIBS="-L$mysql_libdir -lmysqlclient $AUTH_LIBS"
64
78
      auth_saved_cflags="$CFLAGS"
65
79
      auth_saved_cppflags="$CPPFLAGS"
66
80
      auth_saved_libs="$LIBS"
72
86
                       auth=no])
73
87
      if test x$auth = xyes; then
74
88
        AC_CHECK_LIB(mysqlclient, mysql_query, ,
75
 
                     [AC_MSG_WARN([couldn't find mysql libs in $mysql_prefix/lib/mysql]);
 
89
                     [AC_MSG_WARN([couldn't find mysql libs in $mysql_libdir]);
76
90
                      auth=no])
77
91
      fi
78
92
      CFLAGS="$auth_saved_cflags"