configure.in
上传用户:hongyu5696
上传日期:2018-01-22
资源大小:391k
文件大小:8k
- # -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
- AC_PREREQ(2.59)
- AC_INIT(downloadplug-in, 3.31, downloadplug-in-devel@lists.sourceforge.net)
- AC_CONFIG_SRCDIR([config.h.in])
- AC_CONFIG_HEADER([config.h])
- AC_CONFIG_LIBOBJ_DIR([Source])
- # Checks for programs.
- AC_PROG_CXX
- AC_PROG_CC
- AC_PROG_INSTALL
- AC_PROG_AWK
- AC_PROG_MAKE_SET
- # Checks for libraries.
- #tell us where gecko-sdk is, try to find if not provided
- AC_ARG_WITH([gecko-sdk],[ --with-gecko-sdk=<path> prefix of gecko-sdk installation],
- [GECKO_SDK_PREFIX=$with_gecko_sdk
- AC_SUBST(GECKO_SDK_PREFIX)
- if test -d ${GECKO_SDK_PREFIX}/xpcom/include; then
- 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"
- GECKO_DEFINES="-DXPCOM_GLUE -DMOZILLA_STRICT_API"
- AC_SUBST(GECKO_DEFINES)
- else
- echo "Using new (v1.7+) gecko-sdk"
- MOZPLUG_CFLAGS="-I${GECKO_SDK_PREFIX} -I${GECKO_SDK_PREFIX}/include"
- GECKO_DEFINES="-DXPCOM_GLUE -DMOZILLA_STRICT_API"
- AC_SUBST(GECKO_DEFINES)
- fi
- AC_ARG_ENABLE(rpath,
- AC_HELP_STRING([--enable-rpath], [Add gecko-sdk bin and lib directories to the rpath]),
- [if test "$enableval" = ""; then use_rpath=yes; else use_rpath=$enableval; fi], [use_rpath=no])
- if test "$use_rpath" = "yes"; then
- LDFLAGS="$LDFLAGS -Wl,-R${GECKO_SDK_PREFIX}/bin:${GECKO_SDK_PREFIX}/lib"
- fi
- ],[
- AC_MSG_NOTICE([Determining mozilla/firefox packages to build against])
- PKG_CHECK_MODULES(MOZPLUG,[mozilla-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir mozilla-plugin`"],[AC_MSG_WARN([mozilla-plugin not found])])
- if test "$MOZPLUG_CFLAGS" = ""; then
- PKG_CHECK_MODULES(MOZPLUG,[firefox-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir firefox-plugin`"],[AC_MSG_WARN([firefox-plugin not found])])
- fi
- if test "$MOZPLUG_CFLAGS" = ""; then
- PKG_CHECK_MODULES(MOZPLUG,[seamonkey-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir seamonkey-plugin`"],[AC_MSG_WARN([seamonkey-plugin not found])])
- fi
- if test "$MOZPLUG_CFLAGS" = ""; then
- PKG_CHECK_MODULES(MOZPLUG,[xulrunner-plugin],[AC_SUBST(MOZPLUG_CFLAGS) MOZPLUG_CFLAGS="${MOZPLUG_CFLAGS} -I`$PKG_CONFIG --variable=includedir xulrunner-plugin`"],[AC_MSG_WARN([xulrunner-plugin not found])])
- fi
- if test "$MOZPLUG_CFLAGS" = ""; then
- AC_MSG_ERROR([Unable to find mozilla or firefox development files])
- fi
- ]
- )
- AC_ARG_WITH([mozilla-home],[ --with-mozilla-home=<path> prefix of mozilla/firefox installation],
- [MOZ_HOME=$with_mozilla_home
- if test -d ${MOZ_HOME}/plugins; then
- MOZILLA_HOME=$MOZ_HOME
- fi
- ])
- AC_SUBST(MOZILLA_HOME)
- AC_SUBST(MOZPLUG_CFLAGS)
- GTK_DEFINES="-DX_ENABLED"
- AC_ARG_ENABLE(gtk2,
- AC_HELP_STRING([--disable-gtk2], [Disable the use of gtk2 toolkit]),
- [use_gtk2=$enableval], [use_gtk2=yes])
- AC_ARG_ENABLE(gtk1,
- AC_HELP_STRING([--enable-gtk1], [Enable the use of gtk1 toolkit. Disable gtk2]),
- [if test "$enableval" = ""; then use_gtk1=yes; else use_gtk1=$enableval; fi], [use_gtk1=no])
- AC_ARG_ENABLE(x,
- AC_HELP_STRING([--enable-x], [Enable the use of X toolkit. Disable gtk1 and gtk2]),
- [if test "$enableval" = ""; then use_x=yes; else use_x=$enableval; fi], [use_x=no])
- if test $use_x = yes; then
- use_gtk2=no
- use_gtk1=no
- fi
- if test $use_gtk1 = yes; then
- use_gtk2=no
- fi
- if test $use_gtk2 = yes; then
- 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 ***])])
- 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])])
- PKG_CHECK_MODULES(GTHREAD,[gthread-2.0],,[AC_MSG_ERROR([Missing gthread package])])
- fi
- if test $use_gtk1 = yes; then
- 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])])
- PKG_CHECK_MODULES(GTHREAD,[gthread],,[AC_MSG_ERROR([Missing gthread package])])
- fi
- AC_ARG_ENABLE(x86_64,
- AC_HELP_STRING([--enable-x86_64], [Compile 32bit version of downloadplug-in for use on x86_64 architecture]),
- [if test "$enableval" = ""; then use_64=yes; else use_64=$enableval; fi],[use_64=no])
-
- if test $use_64 = yes; then
- CXXFLAGS64="-m32"
- LDFLAGS64="-melf_i386"
- fi
-
- AC_ARG_ENABLE(wmp,
- AC_HELP_STRING([--enable-wmp], [Build with Windows Media Support]),
- [if test "$enableval" = ""; then wmp=yes; else wmp=$enableval; fi],[wmp=yes])
- AC_ARG_ENABLE(qt,
- AC_HELP_STRING([--enable-qt], [Build with QuickTime Support]),
- [if test "$enableval" = ""; then qt=yes; else qt=$enableval; fi],[qt=yes])
- AC_ARG_ENABLE(rm,
- AC_HELP_STRING([--enable-rm], [Build with Real Media Support]),
- [if test "$enableval" = ""; then rm=yes; else rm=$enableval; fi],[rm=yes])
- AC_ARG_ENABLE(gmp,
- AC_HELP_STRING([--enable-gmp], [Build with Google Media Support]),
- [if test "$enableval" = ""; then gmp=no; else gmp=$enableval; fi],[gmp=no])
- AC_ARG_ENABLE(dvx,
- AC_HELP_STRING([--enable-dvx], [Build with DivX Media Support]),
- [if test "$enableval" = ""; then dvx=yes; else dvx=$enableval; fi],[dvx=yes])
- CREATE="downloadplug-in"
- if test x$wmp = xyes; then
- CREATE=" $CREATE downloadplug-in-wmp"
- fi
- if test x$qt = xyes; then
- CREATE=" $CREATE downloadplug-in-qt"
- fi
- if test x$rm = xyes; then
- CREATE=" $CREATE downloadplug-in-rm"
- fi
- if test x$gmp = xyes; then
- CREATE=" $CREATE downloadplug-in-gmp"
- fi
- if test x$dvx = xyes; then
- CREATE=" $CREATE downloadplug-in-dvx"
- fi
- AC_SUBST(CREATE)
- AC_SUBST(CXXFLAGS64)
- AC_SUBST(LDFLAGS64)
-
- AC_SUBST(GTK_CFLAGS)
- AC_SUBST(GTK_LIBS)
- AC_SUBST(GTHREAD_CFLAGS)
- AC_SUBST(GTHREAD_LIBS)
- AC_SUBST(GTK_DEFINES)
- # Checks for header files.
- AC_PATH_X
- AC_PATH_XTRA
- CFLAGS="$CFLAGS $X_CFLAGS"
- LIBS="$X_LIBS $LIBS -lX11 $X_EXTRA_LIBS"
- GTK_CFLAGS="$GTK_CFLAGS $GTK24_CFLAGS"
- GTK_LIBS="$GTK_LIBS $GTK24_LIBS"
- GTK_DEFINES="$GTK_DEFINES $GTK24_DEFINES"
- AC_HEADER_STDC
- AC_CHECK_HEADERS([stddef.h stdlib.h unistd.h X11/Xlib.h X11/Intrinsic.h X11/StringDefs.h sys/stat.h fcntl.h])
- # Checks for typedefs, structures, and compiler characteristics.
- AC_C_CONST
- AC_HEADER_TIME
- AC_TYPE_PID_T
- AC_TYPE_SIZE_T
- # Checks for library functions.
- AC_FUNC_MALLOC
- AC_FUNC_FORK
- AC_CHECK_FUNCS([memset strcasecmp strchr strdup strncasecmp strstr strrchr snprintf mkfifo dup2 gettimeofday strerror strtol mkdir setlocale])
- #AC_REPLACE_FUNCS([memmem strlcpy strlcat])
- AC_REPLACE_FUNCS([memmem])
- LDFLAGS="$LDFLAGS $INTLLIBS"
- LOCALEDIR=/share/locale
- AC_SUBST(LOCALEDIR)
- AC_SUBST(SUBDIR,languages)
- AC_SUBST(INSTALL_SUBDIR,install-languages)
- AC_CHECK_HEADERS([libintl.h],[AC_DEFINE([HAVE_GETTEXT],[1],[Define to 1 if you have the <libintl.h> header file.])])
- AC_CHECK_HEADERS([sys/time.h])
- AC_CHECK_HEADERS([sys/param.h])
- AC_CHECK_HEADERS([locale.h])
- AC_HEADER_STDBOOL
- AC_HEADER_SYS_WAIT
- AC_TYPE_SIGNAL
- 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"])
- AC_SUBST(XPM_LIBS)
- 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.])],[
- 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> ])],,)
- AC_SUBST(XEXT_LIBS)
- AC_CONFIG_FILES([Makefile po/Makefile install.sh uninstall.sh])
- AC_OUTPUT
- chmod u+x install.sh uninstall.sh
- if test $use_x = yes; then
- echo "**************************************************************"
- echo " ARE YOU SURE YOU WANT TO BUILD WITHOUT GTK?"
- echo " BECAUSE downloadplug-in WITHOUT GTK TAKES AWAY FUNCITIONALITY "
- echo "**************************************************************"
- fi