OSDN Git Service

add ability to probe for existance of headers and libraries to configure.py
[handbrake-jp/handbrake-jp-git.git] / gtk / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Created by Anjuta application wizard.
3
4 AC_INIT(ghb, 0.1)
5
6 AM_INIT_AUTOMAKE([1.7.9 foreign dist-bzip2 dist-zip])
7 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
9
10 AC_ISC_POSIX
11 AC_PROG_CC
12 AC_PROG_CXX
13 AM_PROG_CC_STDC
14 AC_HEADER_STDC
15
16 # introduce the optional configure parameter for the path of libXXX.a
17 AC_ARG_WITH(hb,
18         AC_HELP_STRING(
19             [--with-hb=prefix],
20             [try this for the hb-library prefix install directory]
21           ),
22           hb_PATHSET=1,
23           hb_PATHSET=0
24 )
25
26 if test  $hb_PATHSET = 1 ; then
27     case ${with_hb} in
28     /*)
29                 CXXFLAGS="$CXXFLAGS -I$with_hb/libhb"
30                 CFLAGS="$CFLAGS -I$with_hb/libhb"
31                 LDFLAGS="$LDFLAGS -L$with_hb/libhb -L$with_hb/contrib/lib"
32                 AC_SUBST(HB_DIR, "$with_hb")
33         ;;
34     *)
35                 CXXFLAGS="$CXXFLAGS "'-I$(top_srcdir)/'"$with_hb/libhb"
36                 CFLAGS="$CFLAGS "'-I$(top_srcdir)/'"$with_hb/libhb"
37                 LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"$with_hb/libhb "'-L$(top_srcdir)/'"$with_hb/contrib/lib"
38                 AC_SUBST(HB_DIR, '$(top_srcdir)/'"$with_hb")
39         ;;
40     esac
41 else
42         CXXFLAGS="$CXXFLAGS "'-I$(top_srcdir)/'"../libhb"
43         CFLAGS="$CFLAGS "'-I$(top_srcdir)/'"../libhb"
44         LDFLAGS="$LDFLAGS "'-L$(top_srcdir)/'"../libhb "'-L$(top_srcdir)/'"../contrib/lib"
45         AC_SUBST(HB_DIR, '$(top_srcdir)/'"..")
46 fi
47
48 AC_ARG_ENABLE(dl,
49         AS_HELP_STRING([--enable-dl], [enable libdl]),
50         use_libdl=yes, use_libdl=no)
51
52 AC_ARG_ENABLE(gst,
53         AS_HELP_STRING([--enable-gst], [enable gstreamer on Win32]),
54         w32_gst=yes, w32_gst=no)
55
56 # overwrite global variable (used for Makefile generation)
57 AC_SUBST(GLOBALCXXFLAGS, $CXXFLAGS )
58 AC_SUBST(GLOBALLDFLAGS, $LDFLAGS )
59
60
61
62 dnl ***************************************************************************
63 dnl Internatinalization
64 dnl ***************************************************************************
65 GETTEXT_PACKAGE=ghb
66 AC_SUBST(GETTEXT_PACKAGE)
67 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
68 AM_GLIB_GNU_GETTEXT
69 IT_PROG_INTLTOOL([0.35.0])
70
71 AM_PROG_LIBTOOL
72
73 case $host in
74   *-*-mingw*)
75     if test "x$w32_gst" = "xyes" ; then
76                 GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0"
77         else
78         GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gio-2.0"
79         fi
80         mingw_flag=yes
81     ;;
82   *)
83         GHB_PACKAGES="gtk+-2.0 >= 2.10 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 libnotify gudev-1.0"
84         mingw_flag=no
85     ;;
86 esac
87
88 if test "x$w32_gst" = "xyes" -o  "x$mingw_flag" != "xyes" ; then
89         CXXFLAGS="$CXXFLAGS -D_ENABLE_GST"
90         CFLAGS="$CFLAGS -D_ENABLE_GST"
91 fi
92
93 PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
94 if test "x$old_webkit" = "xyes" ; then
95         if test "x$mingw_flag" = "xno" ; then
96                 GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
97                 CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
98                 CFLAGS="$CFLAGS -D_OLD_WEBKIT"
99         fi
100 else
101         if test "x$mingw_flag" = "xno" ; then
102                 GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
103         fi
104 fi
105
106 AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
107
108 PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
109
110 case $host in
111   *-*-mingw*)
112     if test "x$use_libdl" = "xyes" ; then
113                 GHB_LIBS="$GHB_LIBS -ldl"
114         fi
115     ;;
116 esac
117
118 AC_SUBST(GHB_CFLAGS)
119 AC_SUBST(GHB_LIBS)
120
121 AC_OUTPUT([
122 Makefile
123 src/Makefile
124 po/Makefile.in
125 ])