File: configure.in

package info (click to toggle)
lopster 1.2.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,588 kB
  • ctags: 4,156
  • sloc: ansic: 56,739; sh: 350; makefile: 125
file content (202 lines) | stat: -rw-r--r-- 5,913 bytes parent folder | download | duplicates (2)
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
dnl Process this file with autoconf to produce a configure script.

AC_INIT(configure.in)
AM_INIT_AUTOMAKE(lopster, "1.2.2")
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_PROG_INSTALL

AC_C_BIGENDIAN
AC_C_CONST

AC_HEADER_STDC
AC_CHECK_HEADERS(locale.h fcntl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(liblconv.h)
AC_CHECK_LIB(lconv, lconv_conv)

AC_CHECK_FUNCS(setlocale mkdir socket strdup strcasestr)

dnl ALL_LINGUAS="ca de fr it ja ru_RU.KOI8-R"
dnl BUILD_INCLUDED_LIBINTL=no
dnl AC_SUBST(BUILD_INCLUDED_LIBINTL)
dnl AM_GNU_GETTEXT

AM_PATH_GTK(1.2.0, , [AC_MSG_ERROR([GTK is required!])])

dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", [Location of Lopster's data files])
  else
    AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [Location of Lopster's data files])
  fi
else
  AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", [Location of Lopster's data files])
fi

dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Location of Lopster's sources])

if test "x$prefix" = "xNONE"; then
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/share/locale", [Location of Lopster's locale files])
else
  AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale", [Location of Lopster's locale files])
fi

dnl Set ENABLE_WHITE_BOARD in config.h
dnl enable_whiteboard=false
dnl AC_ARG_WITH(whiteboard,
dnl         [--{with,without}-whiteboard   Compile with whiteboard support or without it],
dnl         [ if test "$withval" = "yes"; then
dnl 	    enable_whiteboard=true
dnl           fi
dnl 	])
dnl if $enable_whiteboard; then
dnl   AC_DEFINE(ENABLE_WHITE_BOARD, 1, [Define if you want to compile in whiteboard support])
dnl fi

dnl Use -Wall if we have gcc.
if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  [*[\ \	]-Wall[\ \	]*]) ;;
  *) CFLAGS="$CFLAGS -W -Wall" ;;
  esac
  CFLAGS="$CFLAGS -D_GNU_SOURCE"
fi

dnl save comiler and linker flags
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"

w_ogg=no
AC_ARG_WITH(ogg,
    [  --with-ogg[=path]       Use OGG [default=yes]],
    [ac_with_ogg=$withval],
    [test -z "$ac_with_ogg" && ac_with_ogg=yes]
  )
if test "x$ac_with_ogg" != xno; then
  if test "x$ac_with_ogg" != xyes; then
    CPPFLAGS="$CPPFLAGS -I$ac_with_ogg/include"
    LDFLAGS="$LDFLAGS -L$ac_with_ogg/lib"
  fi
  AC_CHECK_HEADER(ogg/ogg.h, [
      AC_CHECK_LIB(ogg, ogg_sync_init, [
          AC_DEFINE(HAVE_OGG, 1, [Define if you want to build with OGG support])
          if test "x${ac_with_ogg}" != "xyes"; then
              ADD_CFLAGS="$ADD_CFLAGS -I${ac_with_ogg}/include"
              ADD_LIBS="$ADD_LIBS -L${ac_with_ogg}/lib -logg"
          else
              ADD_LIBS="$ADD_LIBS -logg"
          fi
          w_ogg=yes
        ])
    ])
fi

CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
dnl check flac
w_flac=no
AC_ARG_WITH(flac,
    [  --with-flac[=path]      Use FLAC [default=yes]],
    [ac_with_flac=$withval],
    [test -z "$ac_with_flac" && ac_with_flac=yes]
  )
if test "x$ac_with_flac" != xno; then
  if test "x$ac_with_flac" != xyes; then
    CPPFLAGS="$CPPFLAGS -I$ac_with_flac/include"
    LDFLAGS="$LDFLAGS -L$ac_with_flac/lib"
  fi
  AC_CHECK_HEADER(FLAC/metadata.h, [
      AC_DEFINE(HAVE_FLAC, , [Define if you want to build with FLAC support])
      if test "x${ac_with_flac}" != "xyes"; then
          ADD_CFLAGS="$ADD_CFLAGS -I${ac_with_flac}/include"
          ADD_LIBS="$ADD_LIBS -L${ac_with_flac}/lib -lFLAC"
      else
          ADD_LIBS="$ADD_LIBS -lFLAC"
      fi
      w_flac=yes
    ])
fi

CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
dnl check threads
w_threads=no
AC_ARG_WITH(pthread,
    [  --with-pthread[=path]   Use Posix-Threads [default=yes]],
    [ac_with_pthread=$withval],
    [test -z "$ac_with_pthread" && ac_with_pthread=yes]
  )
if test "x$ac_with_pthread" != xno; then
  if test "x$ac_with_pthread" != xyes; then
    CPPFLAGS="$CPPFLAGS -I$ac_with_pthread/include"
    LDFLAGS="$LDFLAGS -L$ac_with_pthread/lib"
  fi
  AC_CHECK_HEADER(pthread.h, [
      AC_CHECK_LIB(pthread, pthread_attr_init, [
          AC_DEFINE(THREADS_ENABLED, , [Define if you want to build with Posix-Thread support])
          ADD_CFLAGS="$ADD_CFLAGS `glib-config --cflags gthread`"
          ADD_LIBS="$ADD_LIBS `glib-config --libs gthread`"
          w_threads=yes
        ])
    ])
fi

CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
dnl check zlib
w_zlib=no
AC_ARG_WITH(zlib,
    [  --with-zlib[=path]      Use Zlib client-server compression [default=yes]],
    [ac_with_zlib=$withval],
    [test -z "$ac_with_zlib" && ac_with_zlib=yes]
  )
if test "$ac_with_zlib" != no; then
  if test "$ac_with_zlib" != yes; then
    CPPFLAGS="$CPPFLAGS -I$ac_with_zlib/include"
    LDFLAGS="$LDFLAGS -L$ac_with_zlib/lib"
  fi
  AC_CHECK_HEADERS(zlib.h, [
      AC_CHECK_LIB(z, gzread, [
          AC_DEFINE(HAVE_ZLIB, , [Define if you want to build with Zlib support])
          if test "x${ac_with_zlib}" != "xyes"; then
              ADD_CFLAGS="$ADD_CFLAGS -I${ac_with_zlib}/include"
              ADD_LIBS="$ADD_LIBS -L${ac_with_zlib}/lib -lz"
          else
              ADD_LIBS="$ADD_LIBS -lz"
          fi
          w_zlib=yes
        ])
    ])
fi
dnl restore flags and libs
CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}

AC_SUBST(ADD_CFLAGS)
AC_SUBST(ADD_LIBS)

AC_OUTPUT([
Makefile 
src/Makefile
m4/Makefile 
])

echo "
Configuration:
--------------------------------------------------
   Compiler          :  ${CC}
   ZLib Support      :  ${w_zlib}
   Ogg Support       :  ${w_ogg}
   Flac Support      :  ${w_flac}
   Thread Support    :  ${w_threads}
--------------------------------------------------
"

dnl ## internationalization support
dnl stamp.h],[])