1# Process this file with autoconf to produce a configure script. 2# 3# Help for autoconf: 4# - http://www.linuxselfhelp.com/gnu/autoconf/html_chapter/autoconf_toc.html 5# Option Syntax: 6# - http://www.linuxselfhelp.com/gnu/autoconf/html_chapter/autoconf_12.html 7# Printing Messages: 8# - http://www.linuxselfhelp.com/gnu/autoconf/html_chapter/autoconf_7.html 9# 10 11AC_INIT([gtkextra], [3.3.4]) 12AC_LANG([C]) 13AC_CONFIG_MACRO_DIR([m4]) 14 15# Save this value here, since automake will set cflags later 16cflags_set=${CFLAGS:+set} 17CFLAGS=${CFLAGS:-""} 18 19AC_DIVERT_PUSH(NOTICE)dnl 20 21# GtkExtra versioning: before making releases, be sure to read 22# http://gtkextra.sourceforge.net/cms/index.php?option=com_content&view=article&id=44&Itemid=22 23 24GTK_EXTRA_MAJOR_VERSION=3 25GTK_EXTRA_MINOR_VERSION=3 26GTK_EXTRA_MICRO_VERSION=4 27 28GTK_EXTRA_VERSION=$GTK_EXTRA_MAJOR_VERSION.$GTK_EXTRA_MINOR_VERSION.$GTK_EXTRA_MICRO_VERSION 29 30GTK_EXTRA_VERSION_SHORT=$GTK_EXTRA_MAJOR_VERSION.$GTK_EXTRA_MINOR_VERSION 31 32AC_DIVERT_POP()dnl 33 34AC_SUBST(GTK_EXTRA_MAJOR_VERSION) 35AC_SUBST(GTK_EXTRA_MINOR_VERSION) 36AC_SUBST(GTK_EXTRA_MICRO_VERSION) 37AC_SUBST(GTK_EXTRA_VERSION) 38AC_SUBST(GTK_EXTRA_VERSION_SHORT) 39 40# libtool versioning 41 42LT_CURRENT=9 43LT_REVISION=4 44LT_AGE=1 45 46AC_SUBST(LT_CURRENT) 47AC_SUBST(LT_REVISION) 48AC_SUBST(LT_AGE) 49 50LIBGTKEXTRA_SO_VERSION=$LT_CURRENT:$LT_REVISION:$LT_AGE 51AC_SUBST(LIBGTKEXTRA_SO_VERSION) 52 53# For automake 54VERSION=$GTK_EXTRA_VERSION 55PACKAGE=gtk+extra 56 57AC_CONFIG_AUX_DIR([build-aux]) 58# Initialize automake stuff 59AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 60#AM_SILENT_RULES([yes]) 61 62# Specify a configuration file 63AC_CONFIG_HEADERS([config.h]) 64AC_CONFIG_MACRO_DIR([m4]) 65AC_DEFINE([ENABLE_NLS],1, [NLS enabled]) 66AC_DEFINE([HAVE_GETTEXT],1, [have gettext]) 67 68# Build time sanity check... 69AM_SANITY_CHECK 70 71# Checks for programs. 72AC_PROG_CC 73AC_ISC_POSIX 74AC_PROG_CC 75AC_PROG_INSTALL 76AC_PROG_MAKE_SET 77m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 78 79# Initialize libtool 80AC_LIBTOOL_WIN32_DLL 81AM_PROG_LIBTOOL 82AM_MAINTAINER_MODE 83 84AC_MSG_CHECKING([for some Win32 platform]) 85case "$host" in 86 *-*-mingw*|*-*-cygwin*) 87 platform_win32=yes 88 ;; 89 *) 90 platform_win32=no 91 ;; 92esac 93AC_MSG_RESULT([$platform_win32]) 94AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") 95 96AC_MSG_CHECKING([for native Win32]) 97case "$host" in 98 *-*-mingw*) 99 os_win32=yes 100 ;; 101 *) 102 os_win32=no 103 ;; 104esac 105AC_MSG_RESULT([$os_win32]) 106AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") 107 108if test "$os_win32" = "yes"; then 109 AC_CHECK_PROG(ms_librarian, lib.exe, yes, no) 110fi 111AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes) 112 113# --enable-debug option 114 115AC_MSG_CHECKING([whether to enable debugging]) 116 117AC_ARG_ENABLE(debug, 118 AC_HELP_STRING( 119 [--enable-debug=[no/yes]], 120 [turn on debugging [default=no]]), 121 , 122 enable_debug=no) 123 124if test "x$enable_debug" = "xyes"; then 125 test "$cflags_set" = set || CFLAGS="$CFLAGS -g -DDEBUG" 126 AC_MSG_RESULT(yes) 127else 128 test "$cflags_set" = set || CFLAGS="$CFLAGS -O2" 129 AC_MSG_RESULT(no) 130fi 131 132# --enable-tests option 133 134AC_MSG_CHECKING([whether to enable tests]) 135 136AC_ARG_ENABLE(tests, 137 AC_HELP_STRING( 138 [--enable-tests=[no/yes]], 139 [turn on tests [default=yes]]), 140 , 141 enable_tests=yes) 142 143if test "x$enable_tests" = "xyes"; then 144 AC_MSG_RESULT(yes) 145else 146 AC_MSG_RESULT(no) 147fi 148AM_CONDITIONAL(ENABLE_TESTS, test x$enable_tests = xyes) 149 150 151 152changequote(,)dnl 153if test "x$GCC" = "xyes"; then 154 case " $CFLAGS " in 155 *[\ \ ]-Wall[\ \ ]*) ;; 156 *) CFLAGS="$CFLAGS -Wall" ;; 157 esac 158fi 159changequote([,])dnl 160 161# Compiler and Lib Stuff 162# AC_PROG_CXX 163 164# Checks for header files. 165AC_HEADER_STDC 166 167# Checks for typedefs, structures, and compiler characteristics. 168AC_C_CONST 169 170dnl header file checks 171AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H, 1, [unistd.h found])) 172AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H, 1, [dirent.h found])) 173AC_CHECK_HEADERS([locale.h]) 174AC_CHECK_HEADERS([sys/time.h]) 175 176dnl Don't attempt to use fnmatch under win32 due to problems with creating DLLs. 177if test "$platform_win32" = "no"; then 178 AC_CHECK_HEADERS(fnmatch.h, AC_DEFINE(HAVE_FNMATCH_H, 1, [fnmatch.h found])) 179fi 180 181# Checks for nonportable Functions 182AC_CHECK_FUNCS([floor getcwd gethostname gettimeofday]) 183AC_CHECK_FUNCS([pow setlocale strstr strtol sin]) 184AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK 185AC_FUNC_MALLOC 186AC_FUNC_REALLOC 187AC_FUNC_STRTOD 188 189dnl NeXTStep cc seems to need this 190AC_MSG_CHECKING([for extra flags for POSIX compliance]) 191AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;], 192 AC_MSG_RESULT(none needed), 193 gtk_save_CFLAGS=$CFLAGS 194 CFLAGS="$CFLAGS -posix" 195 AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;], 196 AC_MSG_RESULT(-posix), 197 AC_MSG_RESULT() 198 CFLAGS=$gtk_save_CFLAGS 199 AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)]))) 200 201 202# Checks for typedefs, structures, and compiler characteristics. 203AC_C_CONST 204AC_C_INLINE 205 206 207################################################## 208# Checks for gtk-doc and docbook-tools 209################################################## 210 211# check for gtk-doc 212GTK_DOC_CHECK(1.8) 213 214AC_CHECK_PROG(DB2HTML, db2html, true, false) 215AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) 216 217# --enable-man option 218 219AC_MSG_CHECKING([whether to enable man pages]) 220 221AC_ARG_ENABLE(man, 222 AC_HELP_STRING( 223 [--enable-man], 224 [regenerate man pages from Docbook [default=no]])], 225 , 226 enable_man=no) 227 228if test "${enable_man}" != no; then 229 AC_MSG_RESULT(yes) 230 231 AC_PATH_PROG([XSLTPROC], [xsltproc]) 232 if test -z "$XSLTPROC"; then 233 enable_man=no 234 fi 235 236 if test "$enable_man" = "no" ; then 237 AC_MSG_WARN([xsltproc is missing - disabling man pages]) 238 fi 239 240 #check for DocBook DTD and stylesheets in the local catalog 241 242 JH_CHECK_XML_CATALOG( 243 [-//OASIS//DTD DocBook XML V4.1.2//EN], 244 [DocBook XML DTD V4.1.2], 245 , 246 enable_man=no) 247 248 if test "$enable_man" = "no" ; then 249 AC_MSG_WARN([missing DocBook DTD - disabling man pages]) 250 fi 251 252 JH_CHECK_XML_CATALOG( 253 [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], 254 [DocBook XSL Stylesheets], 255 , 256 enable_man=no) 257 258 if test "$enable_man" = "no" ; then 259 AC_MSG_WARN([missing DocBook XML stylesheets - disabling man pages]) 260 fi 261else 262 AC_MSG_RESULT(no) 263fi 264AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) 265 266 267################################################## 268# Start of pkg-config checks 269################################################## 270 271PKG_PROG_PKG_CONFIG 272 273# Find the GTK+ include and library directories. 274 275# 4.5.10/fp - fontconfig should be implicit to pango 276#PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0 fontconfig]) 277PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0]) 278 279AC_SUBST(GLIB_GENMARSHAL, `$PKG_CONFIG --variable=glib_genmarshal glib-2.0`) 280 281# --enable-glade option 282 283AC_MSG_CHECKING([whether to enable glade integration]) 284 285AC_ARG_ENABLE(glade, 286 AC_HELP_STRING( 287 [--enable-glade], 288 [build glade integration files [default=no]]), 289 , 290 enable_glade=no) 291 292if test "x$enable_glade" != xno; then 293 AC_MSG_RESULT(yes) 294 295 PKG_CHECK_MODULES([GLADE], [gladeui-1.0 >= 3.6]) 296 297 AC_SUBST(GLADE_CATALOG_DIR, `$PKG_CONFIG --variable=catalogdir gladeui-1.0`) 298 AC_SUBST(GLADE_MODULE_DIR, `$PKG_CONFIG --variable=moduledir gladeui-1.0`) 299 AC_SUBST(GLADE_PIXMAP_DIR, `$PKG_CONFIG --variable=pixmapdir gladeui-1.0`) 300 301 #You must define GETTEXT_PACKAGE before including gi18n-lib.h 302 GETTEXT_PACKAGE=AC_PACKAGE_NAME 303 AC_SUBST(GETTEXT_PACKAGE) 304 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", 305 [Name of the gettext package.]) 306 AM_GLIB_GNU_GETTEXT 307else 308 AC_MSG_RESULT(no) 309fi 310AM_CONDITIONAL(ENABLE_GLADE, test x$enable_glade != xno) 311 312 313# --enable-introspection 314 315AC_MSG_CHECKING([whether to enable gobject-introspection]) 316 317AC_ARG_ENABLE(introspection, 318 AC_HELP_STRING( 319 [--enable-introspection], 320 [build gobject-introspection [default=no]]), 321 , 322 enable_introspection=no) 323 324if test "x$enable_introspection" != xno; then 325 AC_MSG_RESULT(yes) 326 GOBJECT_INTROSPECTION_CHECK([0.6.14]) 327else 328 AC_MSG_RESULT(no) 329 AM_CONDITIONAL(HAVE_INTROSPECTION, test 1=0) 330fi 331AM_CONDITIONAL(ENABLE_INTROSPECTION, test x$enable_introspection != xno) 332 333 334if test "$platform_win32" = "yes"; then 335 AC_SUBST(libgladegtkextra_soname, [libgladegtkextra.dll]) 336else 337 AC_SUBST(libgladegtkextra_soname, [libgladegtkextra.so]) 338fi 339 340 341 342AC_SUBST(gdktarget, `$PKG_CONFIG --variable=target gtk+-2.0`) 343 344gtkextratargetlib=libgtkextra-$gdktarget-3.0.la 345 346AC_SUBST(gtkextratargetlib) 347AC_CHECK_LIB(m, sqrt) 348 349if test "x$gdktarget" = "xwin32"; then 350 AM_CONDITIONAL(USE_WIN32, true) 351else 352 AM_CONDITIONAL(USE_WIN32, false) 353fi 354 355 356# configure output definition 357 358AC_CONFIG_FILES( 359Makefile 360glade/Makefile 361glade/pixmaps/Makefile 362glade/gtk+extra-catalog.xml 363gtkextra/Makefile 364gtkextra/gtkextrafeatures.h 365docs/Makefile 366docs/reference/Makefile 367docs/tutorial/Makefile 368gtkextra-3.0.spec 369gtkextra-3.0.pc 370) 371 372AC_OUTPUT 373