| 1 |
# -*- Autoconf -*- |
| 2 |
# Process this file with autoconf to produce a configure script. |
| 3 |
|
| 4 |
AC_PREREQ([2.66]) |
| 5 |
AC_INIT(x11guirecord, 0.29, [email protected]) |
| 6 |
AM_INIT_AUTOMAKE(x11guirecord, 0.29) |
| 7 |
AC_CONFIG_SRCDIR([src/script_file.c]) |
| 8 |
AC_CONFIG_HEADERS([config.h]) |
| 9 |
|
| 10 |
# Checks for programs. |
| 11 |
AC_PROG_CC |
| 12 |
|
| 13 |
# --- Compiler Flag Portability Guard --- |
| 14 |
# -Wstrict-prototypes/-Wmissing-prototypes/-Wmissing-declarations are |
| 15 |
# GCC/Clang-specific flag spellings that Sun Studio cc (Solaris), xlc |
| 16 |
# (AIX), and aCC (HP-UX) don't recognize; combined with -Werror that would |
| 17 |
# turn "unrecognized option" into a hard configure/build failure on those |
| 18 |
# compilers. Only add them when the detected compiler is GCC-compatible |
| 19 |
# ($GCC is set to "yes" by AC_PROG_CC in that case). |
| 20 |
if test "x$GCC" = "xyes"; then |
| 21 |
WARN_CFLAGS="-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations" |
| 22 |
else |
| 23 |
WARN_CFLAGS="" |
| 24 |
fi |
| 25 |
AC_SUBST([WARN_CFLAGS]) |
| 26 |
|
| 27 |
# Checks for libraries. |
| 28 |
|
| 29 |
# X11: AC_PATH_XTRA (a superset of AC_PATH_X) locates the X headers/libs, |
| 30 |
# and any platform-specific extra libraries needed alongside them (e.g. |
| 31 |
# -lsocket -lnsl on some Solaris configurations), substituting X_CFLAGS, |
| 32 |
# X_LIBS, X_PRE_LIBS, and X_EXTRA_LIBS for use in src/Makefile.am -- this |
| 33 |
# is far more reliable across platforms than a hardcoded path list. |
| 34 |
AC_PATH_XTRA |
| 35 |
|
| 36 |
# popt is required for command-line parsing and isn't part of the base OS |
| 37 |
# on any of our target platforms (Linux, FreeBSD, Solaris, HP-UX, AIX), so |
| 38 |
# probe for it and fail with a clear message at configure time rather than |
| 39 |
# an opaque compile/link error part-way through the build. |
| 40 |
AC_CHECK_HEADER([popt.h], [], |
| 41 |
[AC_MSG_ERROR([popt.h not found. Install the 'popt' development package and try again.])]) |
| 42 |
AC_CHECK_LIB([popt], [poptGetContext], [], |
| 43 |
[AC_MSG_ERROR([libpopt not found. Install the 'popt' library and try again.])]) |
| 44 |
|
| 45 |
# GNU gettext (bindtextdomain/textdomain/gettext via libintl.h) is native |
| 46 |
# on Linux, the BSDs, and modern Solaris, but NOT on AIX or HP-UX, which |
| 47 |
# use catgets-based i18n instead. No .po/.mo catalogs are shipped in this |
| 48 |
# project, so translation support has no functional payload today -- |
| 49 |
# treat it as optional and degrade gracefully (see Common.h) instead of |
| 50 |
# hard-requiring it. |
| 51 |
AC_CHECK_HEADER([libintl.h], [have_libintl_h=yes], [have_libintl_h=no]) |
| 52 |
if test "x$have_libintl_h" = "xyes"; then |
| 53 |
AC_SEARCH_LIBS([gettext], [intl], [have_gettext=yes], [have_gettext=no]) |
| 54 |
else |
| 55 |
have_gettext=no |
| 56 |
fi |
| 57 |
if test "x$have_gettext" = "xyes"; then |
| 58 |
AC_DEFINE([HAVE_GETTEXT], [1], |
| 59 |
[Define if a usable GNU gettext (libintl.h + bindtextdomain/textdomain/gettext) was found]) |
| 60 |
else |
| 61 |
AC_MSG_WARN([GNU gettext not found or unusable; building without translation support (no .po/.mo catalogs are shipped, so this has no effect on functionality).]) |
| 62 |
fi |
| 63 |
|
| 64 |
# Checks for header files. |
| 65 |
AC_CHECK_HEADERS([stdlib.h string.h strings.h locale.h sys/time.h unistd.h]) |
| 66 |
|
| 67 |
# Checks for typedefs, structures, and compiler characteristics. |
| 68 |
|
| 69 |
# Checks for library functions. |
| 70 |
AC_CHECK_FUNCS([gettimeofday]) |
| 71 |
|
| 72 |
AC_OUTPUT(Makefile src/Makefile man/Makefile) |