-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all autoconf packages that use gnu gettext for translations require a tool called autopoint in order to run `autoreconf -i`, which is the command to generate the configure script from configure.ac. this is often needed to compile git checkouts of applications, because they usually do not have the configure scripts and the other generated files checked into their version control systems. the autopoint tool is called without parameters, and it is required to copy some m4 files into place and generate some other files. this version here was created just by observing which error messages would be thrown after running it and gradually adding functionality. it was tested on a git checkout of weechat, and later on the source tarballs of various packages like glib, and it seemed to work so far. it's very likely that in future new scenarios will show up that require additional files, but what we have right now is a good start. the m4 files were taken from gnu gettext 0.18, and they are all licensed under very liberal conditions. each file has the original copyright header. there's only one m4 file i wrote myself, which is configheader.m4, supplying a macro i couldn't otherwise find in gettext's source code.
- Loading branch information
Showing
35 changed files
with
3,912 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# ansi-c++.m4 serial 1 (gettext-0.12) | ||
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | ||
dnl This file is free software; the Free Software Foundation | ||
dnl gives unlimited permission to copy and/or distribute it, | ||
dnl with or without modifications, as long as this notice is preserved. | ||
|
||
dnl From Bruno Haible. | ||
|
||
# Sets CXX to the name of a sufficiently ANSI C++ compliant compiler, | ||
# or to ":" if none is found. | ||
|
||
AC_DEFUN([gt_PROG_ANSI_CXX], | ||
[ | ||
AC_CHECK_PROGS(CXX, $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC, :) | ||
if test "$CXX" != ":"; then | ||
dnl Use a modified version of AC_PROG_CXX_WORKS that does not exit | ||
dnl upon failure. | ||
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) | ||
AC_LANG_PUSH(C++) | ||
AC_ARG_VAR([CXX], [C++ compiler command]) | ||
AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) | ||
echo 'int main () { return 0; }' > conftest.$ac_ext | ||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then | ||
ac_cv_prog_cxx_works=yes | ||
if (./conftest; exit) 2>/dev/null; then | ||
ac_cv_prog_cxx_cross=no | ||
else | ||
ac_cv_prog_cxx_cross=yes | ||
fi | ||
else | ||
ac_cv_prog_cxx_works=no | ||
fi | ||
rm -fr conftest* | ||
AC_LANG_POP(C++) | ||
AC_MSG_RESULT($ac_cv_prog_cxx_works) | ||
if test $ac_cv_prog_cxx_works = no; then | ||
CXX=: | ||
else | ||
dnl Test for namespaces. Both libasprintf and tests/lang-c++ need it. | ||
dnl We don't bother supporting pre-ANSI-C++ compilers. | ||
AC_MSG_CHECKING([whether the C++ compiler supports namespaces]) | ||
AC_LANG_PUSH(C++) | ||
cat <<EOF > conftest.$ac_ext | ||
#include <iostream> | ||
namespace test { using namespace std; } | ||
std::ostream* ptr; | ||
int main () { return 0; } | ||
EOF | ||
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then | ||
gt_cv_prog_cxx_namespaces=yes | ||
else | ||
gt_cv_prog_cxx_namespaces=no | ||
fi | ||
rm -fr conftest* | ||
AC_LANG_POP(C++) | ||
AC_MSG_RESULT($gt_cv_prog_cxx_namespaces) | ||
if test $gt_cv_prog_cxx_namespaces = no; then | ||
CXX=: | ||
fi | ||
fi | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# codeset.m4 serial 4 (gettext-0.18) | ||
dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc. | ||
dnl This file is free software; the Free Software Foundation | ||
dnl gives unlimited permission to copy and/or distribute it, | ||
dnl with or without modifications, as long as this notice is preserved. | ||
|
||
dnl From Bruno Haible. | ||
|
||
AC_DEFUN([AM_LANGINFO_CODESET], | ||
[ | ||
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], | ||
[AC_TRY_LINK([#include <langinfo.h>], | ||
[char* cs = nl_langinfo(CODESET); return !cs;], | ||
[am_cv_langinfo_codeset=yes], | ||
[am_cv_langinfo_codeset=no]) | ||
]) | ||
if test $am_cv_langinfo_codeset = yes; then | ||
AC_DEFINE([HAVE_LANGINFO_CODESET], [1], | ||
[Define if you have <langinfo.h> and nl_langinfo(CODESET).]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
AC_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# fcntl-o.m4 serial 1 | ||
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. | ||
dnl This file is free software; the Free Software Foundation | ||
dnl gives unlimited permission to copy and/or distribute it, | ||
dnl with or without modifications, as long as this notice is preserved. | ||
|
||
dnl Written by Paul Eggert. | ||
|
||
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work. | ||
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. | ||
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. | ||
AC_DEFUN([gl_FCNTL_O_FLAGS], | ||
[ | ||
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. | ||
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) | ||
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], | ||
[AC_RUN_IFELSE( | ||
[AC_LANG_PROGRAM( | ||
[[#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <unistd.h> | ||
#include <fcntl.h> | ||
#ifndef O_NOATIME | ||
#define O_NOATIME 0 | ||
#endif | ||
#ifndef O_NOFOLLOW | ||
#define O_NOFOLLOW 0 | ||
#endif | ||
static int const constants[] = | ||
{ | ||
O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, | ||
O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY | ||
}; | ||
]], | ||
[[ | ||
int status = !constants; | ||
{ | ||
static char const sym[] = "conftest.sym"; | ||
if (symlink (".", sym) != 0 | ||
|| close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) | ||
status |= 32; | ||
unlink (sym); | ||
} | ||
{ | ||
static char const file[] = "confdefs.h"; | ||
int fd = open (file, O_RDONLY | O_NOATIME); | ||
char c; | ||
struct stat st0, st1; | ||
if (fd < 0 | ||
|| fstat (fd, &st0) != 0 | ||
|| sleep (1) != 0 | ||
|| read (fd, &c, 1) != 1 | ||
|| close (fd) != 0 | ||
|| stat (file, &st1) != 0 | ||
|| st0.st_atime != st1.st_atime) | ||
status |= 64; | ||
} | ||
return status;]])], | ||
[gl_cv_header_working_fcntl_h=yes], | ||
[case $? in #( | ||
32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( | ||
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( | ||
96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( | ||
*) gl_cv_header_working_fcntl_h='no';; | ||
esac], | ||
[gl_cv_header_working_fcntl_h=cross-compiling])]) | ||
case $gl_cv_header_working_fcntl_h in #( | ||
*O_NOATIME* | no | cross-compiling) ac_val=0;; #( | ||
*) ac_val=1;; | ||
esac | ||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], | ||
[Define to 1 if O_NOATIME works.]) | ||
case $gl_cv_header_working_fcntl_h in #( | ||
*O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( | ||
*) ac_val=1;; | ||
esac | ||
AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], | ||
[Define to 1 if O_NOFOLLOW works.]) | ||
]) |
Oops, something went wrong.