2
# Process this file with autoconf to produce a configure script.
5
AC_INIT(mplayerplug-in, 3.35, mplayerplug-in-devel@lists.sourceforge.net)
6
AC_CONFIG_SRCDIR([config.h.in])
7
AC_CONFIG_HEADER([config.h])
8
AC_CONFIG_LIBOBJ_DIR([Source])
10
# Checks for programs.
17
# Checks for libraries.
19
AC_ARG_ENABLE(force32,
20
AC_HELP_STRING([--enable-force32], [Compile 32bit version of mplayerplug-in for use on x86_64 architecture]),
21
[if test "$enableval" = ""; then use_32=yes; else use_32=$enableval; fi],[use_32=no])
23
if test $use_32 = yes; then
25
LDFLAGS64="-melf_i386"
26
PKG_CONFIG_PATH="${prefix}/lib/pkgconfig"
27
export PKG_CONFIG_PATH
28
AC_SUBST(PKG_CONFIG_PATH)
29
AC_MSG_NOTICE("Using pkg-config path of ${PKG_CONFIG_PATH}")
32
#tell us where gecko-sdk is, try to find if not provided
34
AC_ARG_WITH([gecko-sdk],[ --with-gecko-sdk=<path> prefix of gecko-sdk installation],
35
[GECKO_SDK_PREFIX=$with_gecko_sdk
36
AC_SUBST(GECKO_SDK_PREFIX)
37
if test -d ${GECKO_SDK_PREFIX}/xpcom/include; then
38
MOZPLUG_CFLAGS="-I${GECKO_SDK_PREFIX} -I${GECKO_SDK_PREFIX}/xpcom/include -I${GECKO_SDK_PREFIX}/nspr/include -I${GECKO_SDK_PREFIX}/string/include -I${GECKO_SDK_PREFIX}/plugin/include -I${GECKO_SDK_PREFIX}/java/include -DGECKOSDK_ENABLED"
39
GECKO_DEFINES="-DXPCOM_GLUE -DMOZILLA_STRICT_API"
40
AC_SUBST(GECKO_DEFINES)
42
echo "Using new (v1.7+) gecko-sdk"
43
MOZPLUG_CFLAGS="-I${GECKO_SDK_PREFIX} -I${GECKO_SDK_PREFIX}/include"
44
GECKO_DEFINES="-DXPCOM_GLUE -DMOZILLA_STRICT_API"
45
AC_SUBST(GECKO_DEFINES)
48
AC_HELP_STRING([--enable-rpath], [Add gecko-sdk bin and lib directories to the rpath]),
49
[if test "$enableval" = ""; then use_rpath=yes; else use_rpath=$enableval; fi], [use_rpath=no])
51
if test "$use_rpath" = "yes"; then
52
LDFLAGS="$LDFLAGS -Wl,-R${GECKO_SDK_PREFIX}/bin:${GECKO_SDK_PREFIX}/lib"
56
AC_MSG_NOTICE([Determining mozilla/firefox packages to build against])
57
PKG_CHECK_MODULES(MOZPLUG,[mozilla-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir mozilla-plugin`"
58
MOZILLA_HOME=`$PKG_CONFIG --variable=libdir mozilla-plugin`
59
],[AC_MSG_WARN([mozilla-plugin not found])])
61
if test "$MOZPLUG_CFLAGS" = ""; then
62
PKG_CHECK_MODULES(MOZPLUG,[firefox-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir firefox-plugin`"
63
MOZILLA_HOME=`$PKG_CONFIG --variable=libdir firefox-plugin`
64
],[AC_MSG_WARN([firefox-plugin not found])])
66
if test "$MOZPLUG_CFLAGS" = ""; then
67
PKG_CHECK_MODULES(MOZPLUG,[seamonkey-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir seamonkey-plugin`"
68
MOZILLA_HOME=`$PKG_CONFIG --variable=libdir seamonkey-plugin`
69
],[AC_MSG_WARN([seamonkey-plugin not found])])
71
if test "$MOZPLUG_CFLAGS" = ""; then
72
PKG_CHECK_MODULES(MOZPLUG,[xulrunner-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir xulrunner-plugin`"
73
MOZILLA_HOME=`$PKG_CONFIG --variable=libdir xulrunner-plugin`
74
],[AC_MSG_WARN([xulrunner-plugin not found])])
76
if test "$MOZPLUG_CFLAGS" = ""; then
77
PKG_CHECK_MODULES(MOZPLUG,[iceape-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir iceape-plugin`"
78
MOZILLA_HOME=`$PKG_CONFIG --variable=libdir iceape-plugin`
79
],[AC_MSG_WARN([iceape-plugin not found])])
82
if test "$MOZPLUG_CFLAGS" = ""; then
83
AC_MSG_ERROR([Unable to find mozilla or firefox development files])
88
AC_ARG_WITH([mozilla-home],[ --with-mozilla-home=<path> prefix of mozilla/firefox installation],
89
[MOZ_HOME=$with_mozilla_home
90
if test -d ${MOZ_HOME}/plugins; then
91
MOZILLA_HOME=$MOZ_HOME
94
AC_SUBST(MOZILLA_HOME)
96
AC_SUBST(MOZPLUG_CFLAGS)
98
GTK_DEFINES="-DX_ENABLED"
100
AC_HELP_STRING([--disable-gtk2], [Disable the use of gtk2 toolkit]),
101
[use_gtk2=$enableval], [use_gtk2=yes])
103
AC_HELP_STRING([--enable-gtk1], [Enable the use of gtk1 toolkit. Disable gtk2]),
104
[if test "$enableval" = ""; then use_gtk1=yes; else use_gtk1=$enableval; fi], [use_gtk1=no])
106
AC_HELP_STRING([--enable-x], [Enable the use of X toolkit. Disable gtk1 and gtk2]),
107
[if test "$enableval" = ""; then use_x=yes; else use_x=$enableval; fi], [use_x=no])
109
if test $use_x = yes; then
114
if test $use_gtk1 = yes; then
118
if test $use_gtk2 = yes; then
119
PKG_CHECK_MODULES(GTK,[gtk+-2.0],[GTK_DEFINES="-DGTK_ENABLED" AC_DEFINE([GTK2_ENABLED],[1],[Define to 1 if you have GTK2])],[AC_MSG_WARN([*** Running in X mode - Limited Features ***])])
120
PKG_CHECK_MODULES(GTK24,[gtk+-2.0 >= 2.4.0],[GTK_DEFINES="-DGTK_ENABLED" AC_DEFINE([GTK24_ENABLED],[1],[Define to 1 if you have GTK2])],[AC_MSG_WARN([Some GUI Features are disabled])])
121
PKG_CHECK_MODULES(GTHREAD,[gthread-2.0],,[AC_MSG_ERROR([Missing gthread package])])
123
if test $use_gtk1 = yes; then
124
PKG_CHECK_MODULES(GTK,[gtk+],[GTK_DEFINES="-DGTK_ENABLED" AC_DEFINE([GTK1_ENABLED],[1],[Define to 1 if you have GTK1])],[AC_MSG_WARN([gtk+ development packages are not found])])
125
PKG_CHECK_MODULES(GTHREAD,[gthread],,[AC_MSG_ERROR([Missing gthread package])])
129
AC_HELP_STRING([--enable-wmp], [Build with Windows Media Support]),
130
[if test "$enableval" = ""; then wmp=yes; else wmp=$enableval; fi],[wmp=yes])
132
AC_HELP_STRING([--enable-qt], [Build with QuickTime Support]),
133
[if test "$enableval" = ""; then qt=yes; else qt=$enableval; fi],[qt=yes])
135
AC_HELP_STRING([--enable-rm], [Build with Real Media Support]),
136
[if test "$enableval" = ""; then rm=yes; else rm=$enableval; fi],[rm=yes])
138
AC_HELP_STRING([--enable-gmp], [Build with Google Media Support]),
139
[if test "$enableval" = ""; then gmp=no; else gmp=$enableval; fi],[gmp=no])
141
AC_HELP_STRING([--enable-dvx], [Build with DivX Media Support]),
142
[if test "$enableval" = ""; then dvx=yes; else dvx=$enableval; fi],[dvx=yes])
144
CREATE="mplayerplug-in"
145
if test x$wmp = xyes; then
146
CREATE=" $CREATE mplayerplug-in-wmp"
148
if test x$qt = xyes; then
149
CREATE=" $CREATE mplayerplug-in-qt"
151
if test x$rm = xyes; then
152
CREATE=" $CREATE mplayerplug-in-rm"
154
if test x$gmp = xyes; then
155
CREATE=" $CREATE mplayerplug-in-gmp"
157
if test x$dvx = xyes; then
158
CREATE=" $CREATE mplayerplug-in-dvx"
167
AC_SUBST(GTHREAD_CFLAGS)
168
AC_SUBST(GTHREAD_LIBS)
169
AC_SUBST(GTK_DEFINES)
171
# Checks for header files.
172
PKG_CHECK_MODULES(X,[x11],,[AC_MSG_ERROR([Missing x11 package])])
173
PKG_CHECK_MODULES(XPM,[xpm],,[AC_MSG_ERROR([Missing xpm package])])
176
PKG_CHECK_MODULES(XT,[xt],,[AC_MSG_ERROR([Missing xt package])])
179
CFLAGS="$CFLAGS $X_CFLAGS"
180
LIBS="$X_LIBS $LIBS -lX11 $X_EXTRA_LIBS"
181
GTK_CFLAGS="$GTK_CFLAGS $GTK24_CFLAGS"
182
GTK_LIBS="$GTK_LIBS $GTK24_LIBS"
183
GTK_DEFINES="$GTK_DEFINES $GTK24_DEFINES"
185
AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h sys/stat.h fcntl.h])
187
# Checks for typedefs, structures, and compiler characteristics.
193
# Checks for library functions.
196
AC_CHECK_FUNCS([memset strcasecmp strchr strdup strncasecmp strstr strrchr snprintf mkfifo dup2 gettimeofday strerror strtol mkdir setlocale])
197
#AC_REPLACE_FUNCS([memmem strlcpy strlcat])
198
AC_REPLACE_FUNCS([memmem])
200
LDFLAGS="$LDFLAGS $INTLLIBS"
201
LOCALEDIR=/share/locale
203
AC_SUBST(SUBDIR,languages)
204
AC_SUBST(INSTALL_SUBDIR,install-languages)
205
AC_CHECK_HEADERS([libintl.h],[AC_DEFINE([HAVE_GETTEXT],[1],[Define to 1 if you have the <libintl.h> header file.])])
207
AC_CHECK_HEADERS([sys/time.h])
208
AC_CHECK_HEADERS([sys/param.h])
209
AC_CHECK_HEADERS([locale.h])
214
#AC_CHECK_HEADER([X11/xpm.h],[AC_DEFINE([HAVE_X11_XPM],[1],[Define to 1 if you have the <X11/xpm.h> header file.]) XPM_LIBS="-lXpm -lXt"])
216
AC_CHECK_LIB(Xdpms, DPMSQueryExtension, [XEXT_LIBS="-lXdpms" AC_DEFINE([DPMSExtension],[1],[Define to 1 if you have the <X11/extensions/dpms.h> header file.])],[
217
AC_CHECK_HEADER([X11/extensions/dpms.h],[AC_DEFINE([DPMSExtension],[1],[Define to 1 if you have the <X11/extensions/dpms.h> header file.]) XEXT_LIBS="-lXext -lX11"],,[ #include <X11/Xlib.h> ])],,)
219
AC_CONFIG_FILES([Makefile po/Makefile install.sh uninstall.sh])
221
chmod u+x install.sh uninstall.sh
222
if test $use_x = yes; then
223
echo "**************************************************************"
224
echo " ARE YOU SURE YOU WANT TO BUILD WITHOUT GTK?"
225
echo " BECAUSE mplayerplug-in WITHOUT GTK TAKES AWAY FUNCITIONALITY "
226
echo "**************************************************************"