mirror of
https://github.com/transmission/transmission
synced 2025-01-03 13:35:36 +00:00
More autoconf work. Added instructions on building Transmission to README. autoconf might work out-of-the-box on OS X now.
This commit is contained in:
parent
32083ba787
commit
9a00da4dda
8 changed files with 630 additions and 205 deletions
|
@ -1,3 +1,5 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
if WITH_GTK
|
||||
GTK_DIR = gtk
|
||||
endif
|
||||
|
|
22
README
22
README
|
@ -11,3 +11,25 @@ and BeOS (native interface).
|
|||
|
||||
For more information (including build instructions), please consult the
|
||||
website: http://transmission.m0k.org/
|
||||
|
||||
|
||||
Building Transmission
|
||||
=====================
|
||||
|
||||
Transmission has xcode files that allows it to be built in xcode.
|
||||
|
||||
Building a Transmission release from the command line:
|
||||
|
||||
$ tar xvfz Transmission-80.tar.gz
|
||||
$ cd Transmission-0.80
|
||||
$ ./configure && make
|
||||
$ make install
|
||||
|
||||
Building Transmission from SVN:
|
||||
|
||||
$ svn co svn://svn.m0k.org/Transmission/trunk Transmission
|
||||
$ cd Transmission
|
||||
$ ./autogen.sh
|
||||
$ ./configure && make
|
||||
$ make install
|
||||
|
||||
|
|
208
m4/acx-pthread.m4
Normal file
208
m4/acx-pthread.m4
Normal file
|
@ -0,0 +1,208 @@
|
|||
# URL: http://autoconf-archive.cryp.to/acx_pthread.html
|
||||
# Author: Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Revised: 2007-07-29
|
||||
#
|
||||
# Copyright © 2007 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
|
||||
|
398
m4/glib-gettext.m4
Normal file
398
m4/glib-gettext.m4
Normal file
|
@ -0,0 +1,398 @@
|
|||
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
|
||||
#
|
||||
# This file is free software, distributed under the terms of the GNU
|
||||
# General Public License. As a special exception to the GNU General
|
||||
# Public License, this file may be distributed as part of a program
|
||||
# that contains a configuration script generated by Autoconf, under
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
#
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
|
||||
#
|
||||
# Modified to never use included libintl.
|
||||
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
|
||||
#
|
||||
# Major rework to remove unused code
|
||||
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
|
||||
#
|
||||
# Added better handling of ALL_LINGUAS from GNU gettext version
|
||||
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
|
||||
#
|
||||
# Modified to require ngettext
|
||||
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
|
||||
#
|
||||
# We need this here as well, since someone might use autoconf-2.5x
|
||||
# to configure GLib then an older version to configure a package
|
||||
# using AM_GLIB_GNU_GETTEXT
|
||||
AC_PREREQ(2.53)
|
||||
|
||||
dnl
|
||||
dnl We go to great lengths to make sure that aclocal won't
|
||||
dnl try to pull in the installed version of these macros
|
||||
dnl when running aclocal in the glib directory.
|
||||
dnl
|
||||
m4_copy([AC_DEFUN],[glib_DEFUN])
|
||||
m4_copy([AC_REQUIRE],[glib_REQUIRE])
|
||||
dnl
|
||||
dnl At the end, if we're not within glib, we'll define the public
|
||||
dnl definitions in terms of our private definitions.
|
||||
dnl
|
||||
|
||||
# GLIB_LC_MESSAGES
|
||||
#--------------------
|
||||
glib_DEFUN([GLIB_LC_MESSAGES],
|
||||
[AC_CHECK_HEADERS([locale.h])
|
||||
if test $ac_cv_header_locale_h = yes; then
|
||||
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
||||
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
||||
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
||||
if test $am_cv_val_LC_MESSAGES = yes; then
|
||||
AC_DEFINE(HAVE_LC_MESSAGES, 1,
|
||||
[Define if your <locale.h> file defines LC_MESSAGES.])
|
||||
fi
|
||||
fi])
|
||||
|
||||
# GLIB_PATH_PROG_WITH_TEST
|
||||
#----------------------------
|
||||
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
|
||||
[# Extract the first word of "$2", so it can be a program name with args.
|
||||
set dummy $2; ac_word=[$]2
|
||||
AC_MSG_CHECKING([for $ac_word])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,
|
||||
[case "[$]$1" in
|
||||
/*)
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if [$3]; then
|
||||
ac_cv_path_$1="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
dnl If no 4th arg is given, leave the cache variable unset,
|
||||
dnl so AC_PATH_PROGS will keep looking.
|
||||
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||
])dnl
|
||||
;;
|
||||
esac])dnl
|
||||
$1="$ac_cv_path_$1"
|
||||
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
# GLIB_WITH_NLS
|
||||
#-----------------
|
||||
glib_DEFUN([GLIB_WITH_NLS],
|
||||
dnl NLS is obligatory
|
||||
[USE_NLS=yes
|
||||
AC_SUBST(USE_NLS)
|
||||
|
||||
gt_cv_have_gettext=no
|
||||
|
||||
CATOBJEXT=NONE
|
||||
XGETTEXT=:
|
||||
INTLLIBS=
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[gt_cv_func_dgettext_libintl="no"
|
||||
libintl_extra_libs=""
|
||||
|
||||
#
|
||||
# First check in libc
|
||||
#
|
||||
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
|
||||
[AC_TRY_LINK([
|
||||
#include <libintl.h>
|
||||
],
|
||||
[return !ngettext ("","", 1)],
|
||||
gt_cv_func_ngettext_libc=yes,
|
||||
gt_cv_func_ngettext_libc=no)
|
||||
])
|
||||
|
||||
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
||||
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
|
||||
[AC_TRY_LINK([
|
||||
#include <libintl.h>
|
||||
],
|
||||
[return !dgettext ("","")],
|
||||
gt_cv_func_dgettext_libc=yes,
|
||||
gt_cv_func_dgettext_libc=no)
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
|
||||
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
||||
fi
|
||||
|
||||
#
|
||||
# If we don't have everything we want, check in libintl
|
||||
#
|
||||
if test "$gt_cv_func_dgettext_libc" != "yes" \
|
||||
|| test "$gt_cv_func_ngettext_libc" != "yes" \
|
||||
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
|
||||
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CHECK_LIB(intl, ngettext,
|
||||
[AC_CHECK_LIB(intl, dgettext,
|
||||
gt_cv_func_dgettext_libintl=yes)])])
|
||||
|
||||
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
|
||||
AC_MSG_CHECKING([if -liconv is needed to use gettext])
|
||||
AC_MSG_RESULT([])
|
||||
AC_CHECK_LIB(intl, ngettext,
|
||||
[AC_CHECK_LIB(intl, dcgettext,
|
||||
[gt_cv_func_dgettext_libintl=yes
|
||||
libintl_extra_libs=-liconv],
|
||||
:,-liconv)],
|
||||
:,-liconv)
|
||||
fi
|
||||
|
||||
#
|
||||
# If we found libintl, then check in it for bind_textdomain_codeset();
|
||||
# we'll prefer libc if neither have bind_textdomain_codeset(),
|
||||
# and both have dgettext and ngettext
|
||||
#
|
||||
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
|
||||
glib_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lintl $libintl_extra_libs"
|
||||
unset ac_cv_func_bind_textdomain_codeset
|
||||
AC_CHECK_FUNCS(bind_textdomain_codeset)
|
||||
LIBS="$glib_save_LIBS"
|
||||
|
||||
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
|
||||
gt_cv_func_dgettext_libc=no
|
||||
else
|
||||
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
||||
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
|
||||
gt_cv_func_dgettext_libintl=no
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_dgettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
||||
gt_cv_have_gettext=yes
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
|
||||
INTLLIBS="-lintl $libintl_extra_libs"
|
||||
fi
|
||||
|
||||
if test "$gt_cv_have_gettext" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT,1,
|
||||
[Define if the GNU gettext() function is already present or preinstalled.])
|
||||
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
if test "$MSGFMT" != "no"; then
|
||||
glib_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
AC_CHECK_FUNCS(dcgettext)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr],
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[case $host in
|
||||
*-*-solaris*)
|
||||
dnl On Solaris, if bind_textdomain_codeset is in libc,
|
||||
dnl GNU format message catalog is always supported,
|
||||
dnl since both are added to the libc all together.
|
||||
dnl Hence, we'd like to go with DATADIRNAME=share and
|
||||
dnl and CATOBJEXT=.gmo in this case.
|
||||
AC_CHECK_FUNC(bind_textdomain_codeset,
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[CATOBJEXT=.mo
|
||||
DATADIRNAME=lib])
|
||||
;;
|
||||
*)
|
||||
CATOBJEXT=.mo
|
||||
DATADIRNAME=lib
|
||||
;;
|
||||
esac])
|
||||
LIBS="$glib_save_LIBS"
|
||||
INSTOBJEXT=.mo
|
||||
else
|
||||
gt_cv_have_gettext=no
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$gt_cv_have_gettext" = "yes" ; then
|
||||
AC_DEFINE(ENABLE_NLS, 1,
|
||||
[always defined to indicate that i18n is enabled])
|
||||
fi
|
||||
|
||||
dnl Test whether we really found GNU xgettext.
|
||||
if test "$XGETTEXT" != ":"; then
|
||||
dnl If it is not GNU xgettext we define it as : so that the
|
||||
dnl Makefiles still can work.
|
||||
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
||||
: ;
|
||||
else
|
||||
AC_MSG_RESULT(
|
||||
[found xgettext program is not GNU xgettext; ignore it])
|
||||
XGETTEXT=":"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to process the po/ directory.
|
||||
POSUB=po
|
||||
|
||||
AC_OUTPUT_COMMANDS(
|
||||
[case "$CONFIG_FILES" in *po/Makefile.in*)
|
||||
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
|
||||
esac])
|
||||
|
||||
dnl These rules are solely for the distribution goal. While doing this
|
||||
dnl we only have to keep exactly one list of the available catalogs
|
||||
dnl in configure.in.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
GMOFILES="$GMOFILES $lang.gmo"
|
||||
POFILES="$POFILES $lang.po"
|
||||
done
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST(CATALOGS)
|
||||
AC_SUBST(CATOBJEXT)
|
||||
AC_SUBST(DATADIRNAME)
|
||||
AC_SUBST(GMOFILES)
|
||||
AC_SUBST(INSTOBJEXT)
|
||||
AC_SUBST(INTLLIBS)
|
||||
AC_SUBST(PO_IN_DATADIR_TRUE)
|
||||
AC_SUBST(PO_IN_DATADIR_FALSE)
|
||||
AC_SUBST(POFILES)
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
# AM_GLIB_GNU_GETTEXT
|
||||
# -------------------
|
||||
# Do checks necessary for use of gettext. If a suitable implementation
|
||||
# of gettext is found in either in libintl or in the C library,
|
||||
# it will set INTLLIBS to the libraries needed for use of gettext
|
||||
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
|
||||
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
|
||||
# on various variables needed by the Makefile.in.in installed by
|
||||
# glib-gettextize.
|
||||
dnl
|
||||
glib_DEFUN([GLIB_GNU_GETTEXT],
|
||||
[AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
|
||||
GLIB_LC_MESSAGES
|
||||
GLIB_WITH_NLS
|
||||
|
||||
if test "$gt_cv_have_gettext" = "yes"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
LINGUAS=
|
||||
else
|
||||
AC_MSG_CHECKING(for catalogs to be installed)
|
||||
NEW_LINGUAS=
|
||||
for presentlang in $ALL_LINGUAS; do
|
||||
useit=no
|
||||
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
|
||||
desiredlanguages="$LINGUAS"
|
||||
else
|
||||
desiredlanguages="$ALL_LINGUAS"
|
||||
fi
|
||||
for desiredlang in $desiredlanguages; do
|
||||
# Use the presentlang catalog if desiredlang is
|
||||
# a. equal to presentlang, or
|
||||
# b. a variant of presentlang (because in this case,
|
||||
# presentlang can be used as a fallback for messages
|
||||
# which are not translated in the desiredlang catalog).
|
||||
case "$desiredlang" in
|
||||
"$presentlang"*) useit=yes;;
|
||||
esac
|
||||
done
|
||||
if test $useit = yes; then
|
||||
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
|
||||
fi
|
||||
done
|
||||
LINGUAS=$NEW_LINGUAS
|
||||
AC_MSG_RESULT($LINGUAS)
|
||||
fi
|
||||
|
||||
dnl Construct list of names of catalog files to be constructed.
|
||||
if test -n "$LINGUAS"; then
|
||||
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
fi
|
||||
if test -z "$MKINSTALLDIRS"; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
fi
|
||||
AC_SUBST(MKINSTALLDIRS)
|
||||
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
rm -f po/POTFILES
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
|
||||
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
|
||||
# -------------------------------
|
||||
# Define VARIABLE to the location where catalog files will
|
||||
# be installed by po/Makefile.
|
||||
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
|
||||
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
|
||||
glib_save_prefix="$prefix"
|
||||
glib_save_exec_prefix="$exec_prefix"
|
||||
test "x$prefix" = xNONE && prefix=$ac_default_prefix
|
||||
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
|
||||
if test "x$CATOBJEXT" = "x.mo" ; then
|
||||
localedir=`eval echo "${libdir}/locale"`
|
||||
else
|
||||
localedir=`eval echo "${datadir}/locale"`
|
||||
fi
|
||||
prefix="$glib_save_prefix"
|
||||
exec_prefix="$glib_save_exec_prefix"
|
||||
AC_DEFINE_UNQUOTED($1, "$localedir",
|
||||
[Define the location where the catalogs will be installed])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Now the definitions that aclocal will find
|
||||
dnl
|
||||
ifdef(glib_configure_in,[],[
|
||||
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
|
||||
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
|
||||
])dnl
|
|
@ -1,208 +1,3 @@
|
|||
|
||||
|
||||
# http://autoconf-archive.cryp.to/acx_pthread.html
|
||||
# Copyright © 2006 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
AC_DEFUN([ACX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
acx_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$acx_pthread_ok" = xno; then
|
||||
for flag in $acx_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_TRY_LINK([#include <pthread.h>],
|
||||
[pthread_t th; pthread_join(th, 0);
|
||||
pthread_attr_init(0); pthread_cleanup_push(0, 0);
|
||||
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
|
||||
[acx_pthread_ok=yes])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_MSG_RESULT($acx_pthread_ok)
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$acx_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||
[attr_name=$attr; break])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GCC" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$acx_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
acx_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_RESTORE
|
||||
])dnl ACX_PTHREAD
|
||||
|
||||
|
||||
dnl
|
||||
dnl nicked from wxwin.m4
|
||||
dnl
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macros for wxWidgets detection. Typically used in configure.in as:
|
||||
dnl
|
0
configure → mk/configure
vendored
0
configure → mk/configure
vendored
Loading…
Reference in a new issue