Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 1 | # configure.ac |
| 2 | |
| 3 | dnl Process this file with autoconf to produce a configure script. |
| 4 | dnl |
| 5 | dnl Minor upgrades (compatible ABI): increment the package version |
| 6 | dnl (third field in two places below) and set the PNGLIB_MINOR |
| 7 | dnl variable. |
| 8 | dnl |
| 9 | dnl Major upgrades (incompatible ABI): increment the package major |
| 10 | dnl version (second field, or first if desired), set the minor |
| 11 | dnl to 0, set PNGLIB_MAJOR below *and* follow the instructions in |
| 12 | dnl Makefile.am to upgrade the package name. |
| 13 | |
| 14 | dnl This is here to prevent earlier autoconf from being used, it |
| 15 | dnl should not be necessary to regenerate configure if the time |
| 16 | dnl stamps are correct |
| 17 | AC_PREREQ(2.59) |
| 18 | |
| 19 | dnl Version number stuff here: |
| 20 | |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame^] | 21 | AC_INIT([libpng], [1.2.10beta5], [png-mng-implement@lists.sourceforge.net]) |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 22 | AM_INIT_AUTOMAKE |
| 23 | dnl stop configure from automagically running automake |
| 24 | AM_MAINTAINER_MODE |
| 25 | |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame^] | 26 | PNGLIB_VERSION=1.2.10beta5 |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 27 | PNGLIB_MAJOR=12 |
Glenn Randers-Pehrson | d5d6360 | 2006-04-15 06:37:45 -0500 | [diff] [blame] | 28 | PNGLIB_MINOR=10 |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 29 | |
| 30 | dnl End of version number stuff |
| 31 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 32 | AC_CONFIG_SRCDIR([pngget.c]) |
Glenn Randers-Pehrson | 3a5a759 | 2006-04-15 14:14:42 -0500 | [diff] [blame] | 33 | AM_CONFIG_HEADER([config.h]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 34 | |
| 35 | # Checks for programs. |
| 36 | AC_PROG_CC |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 37 | AC_PROG_LD |
| 38 | AC_PROG_CPP |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 39 | AC_CHECK_TOOL(SED, sed, :) |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 40 | AC_PROG_INSTALL |
| 41 | AC_PROG_LN_S |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 42 | AC_PROG_MAKE_SET |
| 43 | AC_PROG_LIBTOOL |
| 44 | |
| 45 | # Checks for header files. |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 46 | AC_HEADER_STDC |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 47 | AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 48 | |
| 49 | # Checks for typedefs, structures, and compiler characteristics. |
| 50 | AC_C_CONST |
| 51 | AC_TYPE_SIZE_T |
| 52 | AC_STRUCT_TM |
| 53 | |
| 54 | # Checks for library functions. |
| 55 | AC_FUNC_MALLOC |
| 56 | AC_FUNC_STRTOD |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 57 | AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc])) |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 58 | AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) ) |
| 59 | AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed])) |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 60 | |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame^] | 61 | AC_MSG_CHECKING([if assembler code in pnggccrd.c can be compiled]) |
| 62 | AC_TRY_COMPILE( |
| 63 | [#include "pnggccrd.c"], |
| 64 | [int main() { return 0; }], |
| 65 | LIBPNG_DEFINES=,LIBPNG_DEFINES=-DPNG_NO_ASSEMBLER_CODE) |
| 66 | AC_SUBST(LIBPNG_DEFINES) |
| 67 | if test "$LIBPNG_DEFINES"; then |
| 68 | AC_MSG_RESULT(no) |
| 69 | else |
| 70 | AC_MSG_RESULT(yes) |
| 71 | fi |
| 72 | |
| 73 | |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 74 | AC_MSG_CHECKING([if libraries can be versioned]) |
| 75 | GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` |
| 76 | if test "$GLD"; then |
| 77 | have_ld_version_script=yes |
| 78 | AC_MSG_RESULT(yes) |
| 79 | else |
| 80 | have_ld_version_script=no |
| 81 | AC_MSG_RESULT(no) |
| 82 | AC_MSG_WARN(*** You may want to rerun configure using --with-gnu-ld to enable versioned symbols.) |
| 83 | fi |
| 84 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 85 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 86 | # Substitutions for .in files |
| 87 | AC_SUBST(PNGLIB_VERSION) |
| 88 | AC_SUBST(PNGLIB_MAJOR) |
| 89 | AC_SUBST(PNGLIB_MINOR) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 90 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 91 | # Additional arguments (and substitutions) |
| 92 | # Allow the pkg-config directory to be set |
| 93 | AC_ARG_WITH(pkgconfigdir, |
| 94 | AC_HELP_STRING([--with-pkgconfigdir], |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame^] | 95 | [Use the specified pkgconfig dir (default is libdir/pkgconfig)]), |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 96 | [pkgconfigdir=${withval}], |
| 97 | [pkgconfigdir='${libdir}/pkgconfig']) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 98 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 99 | AC_SUBST([pkgconfigdir]) |
| 100 | AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 101 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 102 | # Make the *-config binary config scripts optional |
| 103 | AC_ARG_WITH(binconfigs, |
| 104 | AC_HELP_STRING([--with-binconfigs], |
| 105 | [Generate shell libpng-config scripts as well as pkg-config data] |
| 106 | [@<:@default=yes@:>@]), |
| 107 | [if test "${withval}" = no; then |
| 108 | binconfigs= |
| 109 | AC_MSG_NOTICE([libpng-config scripts will not be built]) |
| 110 | else |
| 111 | binconfigs='${binconfigs}' |
| 112 | fi], |
| 113 | [binconfigs='${binconfigs}']) |
| 114 | AC_SUBST([binconfigs]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 115 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 116 | # Allow the old version number library, libpng.so, to be removed from |
| 117 | # the build |
| 118 | AC_ARG_WITH(libpng-compat, |
| 119 | AC_HELP_STRING([--with-libpng-compat], |
| 120 | [Generate the obsolete libpng.so library @<:@default=yes@:>@]), |
| 121 | [if test "${withval}" = no; then |
| 122 | compatlib= |
| 123 | AC_MSG_NOTICE([libpng.so will not be built]) |
| 124 | else |
| 125 | compatlib=libpng.la |
| 126 | fi], |
| 127 | [compatlib=libpng.la]) |
| 128 | AC_SUBST([compatlib]) |
| 129 | |
| 130 | # Config files, substituting as above |
| 131 | AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc.in]) |
| 132 | AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in], |
| 133 | [chmod +x libpng-config]) |
| 134 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 135 | AC_OUTPUT |