1dnl Configuration for the toplevel directory of GNU libtextstyle 2dnl Copyright (C) 2009-2019 Free Software Foundation, Inc. 3dnl 4dnl This program is free software: you can redistribute it and/or modify 5dnl it under the terms of the GNU General Public License as published by 6dnl the Free Software Foundation; either version 3 of the License, or 7dnl (at your option) any later version. 8dnl 9dnl This program is distributed in the hope that it will be useful, 10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12dnl GNU General Public License for more details. 13dnl 14dnl You should have received a copy of the GNU General Public License 15dnl along with this program. If not, see <https://www.gnu.org/licenses/>. 16 17dnl Process this file with autoconf to produce a configure script. 18 19AC_PREREQ([2.63]) 20AC_INIT 21AC_CONFIG_SRCDIR([version.sh]) 22AC_CONFIG_AUX_DIR([build-aux]) 23. $srcdir/version.sh 24gl_INIT_PACKAGE([libtextstyle], [$VERSION_NUMBER]) 25AM_INIT_AUTOMAKE([1.13 silent-rules]) 26AM_CONFIG_HEADER([config.h]) 27 28dnl Override automake's tar command used for creating distributions. 29am__tar='${AMTAR} chof - --owner=root --group=root "$$tardir"' 30 31dnl Checks for basic programs. 32 33AC_PROG_CC 34AC_PROG_CPP 35AC_PROG_INSTALL 36AC_PROG_MKDIR_P 37 38dnl Check for host type. 39 40AC_CANONICAL_HOST 41 42dnl Checks that augment the CPPFLAGS. 43 44lts_EARLY 45 46dnl Checks for compiler output filename suffixes. 47 48AC_OBJEXT 49AC_EXEEXT 50 51dnl Check for build configuration. 52 53gl_WOE32_DLL 54 55LT_INIT([win32-dll]) 56 57dnl Prepares the libtool configuration for handling of Windows resources, and 58dnl sets the RC variable to a program that compiles Windows resource files. 59LT_LANG([Windows Resource]) 60 61dnl On mingw and Cygwin, we can activate special Makefile rules which add 62dnl version information to the shared libraries and executables. 63case "$host_os" in 64 mingw* | cygwin*) is_woe32=yes ;; 65 *) is_woe32=no ;; 66esac 67AM_CONDITIONAL([WOE32], [test $is_woe32 = yes]) 68 69dnl Checks for types, header files, functions and declarations. 70 71lts_INIT 72 73dnl Arrange that the gnulib-generated <unistd.h> does not declare isatty(). The 74dnl adhoc-tests want to get this declaration from <textstyle.h>, not <unistd.h>. 75GNULIB_ISATTY=0 76 77dnl Compilation on mingw and Cygwin needs special Makefile rules, because 78dnl 1. when we install a shared library, we must arrange to export 79dnl auxiliary pointer variables for every exported variable, 80dnl 2. when we install a shared library and a static library simultaneously, 81dnl the include file specifies __declspec(dllimport) and therefore we 82dnl must arrange to define the auxiliary pointer variables for the 83dnl exported variables _also_ in the static library. 84if test "$enable_shared" = yes; then 85 case "$host_os" in 86 mingw* | cygwin*) is_woe32dll=yes ;; 87 *) is_woe32dll=no ;; 88 esac 89else 90 is_woe32dll=no 91fi 92AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes]) 93dnl For substitution in woe32dll.in.h. 94if test $is_woe32dll = yes; then 95 DLL_VARIABLE='__declspec (dllimport)' 96else 97 DLL_VARIABLE= 98fi 99AC_SUBST([DLL_VARIABLE]) 100 101dnl Put some default definitions into config.h. 102AH_BOTTOM([ 103/* In order to define all the symbols declared by textstyle.h, do not use 104 'inline' functions, even when the compiler would support them. */ 105#include "notinline.h" 106 107/* Ignore DLL_VARIABLE markup that is meant for gettext. */ 108#define DLL_VARIABLE 109 110/* Get LIBTEXTSTYLE_DLL_VARIABLE. */ 111#include "textstyle/woe32dll.h" 112]) 113 114dnl Namespacing is the default: it builds a namespace clean library. 115dnl Allow the user to disable namespacing. This speeds up "make" considerably. 116AC_ARG_ENABLE([namespacing], 117 [ --disable-namespacing build a library that exports undesired symbols], 118 [:], [enable_namespacing=yes]) 119if test "$enable_namespacing" != no; then 120 NAMESPACING=yes 121else 122 NAMESPACING= 123fi 124AC_SUBST([NAMESPACING]) 125 126dnl Check for prerequisites of exported.sh. 127gt_GLOBAL_SYMBOL_PIPE 128 129dnl Substitutable version number. 130AC_PROG_AWK 131changequote(,) 132sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} 133i\ 1340 135q 136' 137sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} 138i\ 1390 140q 141' 142sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} 143i\ 1440 145q 146' 147changequote([,]) 148version_major=`echo "${VERSION}" | sed -n -e "$sed_extract_major"` 149version_minor=`echo "${VERSION}" | sed -n -e "$sed_extract_minor"` 150version_subminor=`echo "${VERSION}" | sed -n -e "$sed_extract_subminor"` 151HEXVERSION=0x`$AWK 'BEGIN { printf("%02X%02X%02X"',"$version_major","$version_minor","$version_subminor"') }'` 152AC_SUBST([HEXVERSION]) 153 154dnl For substitution in version.in.h. 155if test "$am_func_iconv" = yes; then 156 HAVE_ICONV=1 157else 158 HAVE_ICONV=0 159fi 160AC_SUBST([HAVE_ICONV]) 161 162dnl Check for tools needed for formatting the documentation. 163ac_aux_dir_abs=`cd $ac_aux_dir && pwd` 164AC_PATH_PROG([TEXI2DVI], [texi2dvi], [$ac_aux_dir_abs/missing texi2dvi]) 165AC_PATH_PROG([DVIPS], [dvips], [$ac_aux_dir_abs/missing dvips]) 166AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl]) 167 168AC_CONFIG_FILES([Makefile]) 169AC_CONFIG_FILES([doc/Makefile]) 170AC_CONFIG_FILES([lib/Makefile]) 171AC_CONFIG_FILES([lib/exported.sh]) 172AC_CONFIG_FILES([lib/textstyle/version.h:lib/textstyle/version.in.h]) 173AC_CONFIG_FILES([lib/textstyle/woe32dll.h:lib/textstyle/woe32dll.in.h]) 174AC_CONFIG_FILES([tests/Makefile]) 175AC_CONFIG_FILES([adhoc-tests/Makefile]) 176AC_OUTPUT 177