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 |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 6 | dnl (third field in two places below) and set the PNGLIB_RELEASE |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 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 | 047c34b | 2009-11-07 10:40:40 -0600 | [diff] [blame] | 21 | AC_INIT([libpng], [1.4.0beta93], [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 | 047c34b | 2009-11-07 10:40:40 -0600 | [diff] [blame] | 26 | PNGLIB_VERSION=1.4.0beta93 |
Glenn Randers-Pehrson | 8568f6e | 2009-07-28 17:20:26 -0500 | [diff] [blame] | 27 | PNGLIB_MAJOR=1 |
| 28 | PNGLIB_MINOR=4 |
| 29 | PNGLIB_RELEASE=0 |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 30 | |
| 31 | dnl End of version number stuff |
| 32 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 33 | AC_CONFIG_SRCDIR([pngget.c]) |
Glenn Randers-Pehrson | 73b064c | 2006-05-15 06:44:21 -0500 | [diff] [blame] | 34 | AM_CONFIG_HEADER(config.h) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 35 | |
| 36 | # Checks for programs. |
| 37 | AC_PROG_CC |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 38 | AC_PROG_LD |
| 39 | AC_PROG_CPP |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 40 | AC_CHECK_TOOL(SED, sed, :) |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 41 | AC_LIBTOOL_WIN32_DLL |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 42 | AC_PROG_INSTALL |
| 43 | AC_PROG_LN_S |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 44 | AC_PROG_MAKE_SET |
| 45 | AC_PROG_LIBTOOL |
| 46 | |
| 47 | # Checks for header files. |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 48 | AC_HEADER_STDC |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 49 | AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 50 | |
| 51 | # Checks for typedefs, structures, and compiler characteristics. |
| 52 | AC_C_CONST |
| 53 | AC_TYPE_SIZE_T |
| 54 | AC_STRUCT_TM |
| 55 | |
| 56 | # Checks for library functions. |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 57 | AC_FUNC_STRTOD |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 58 | AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc])) |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 59 | AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) ) |
| 60 | AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed])) |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 61 | |
Glenn Randers-Pehrson | b3870ab | 2006-05-11 09:43:09 -0500 | [diff] [blame] | 62 | LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG |
Glenn Randers-Pehrson glennrp@comcast.net | 0a2547e | 2009-05-02 15:23:38 -0500 | [diff] [blame] | 63 | LIBPNG_DEFINES=$LIBPNG_DEFINES |
Glenn Randers-Pehrson | 629330e | 2006-04-17 14:33:23 -0500 | [diff] [blame] | 64 | AC_SUBST(LIBPNG_DEFINES) |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame] | 65 | |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 66 | AC_MSG_CHECKING([if libraries can be versioned]) |
| 67 | GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` |
| 68 | if test "$GLD"; then |
| 69 | have_ld_version_script=yes |
| 70 | AC_MSG_RESULT(yes) |
| 71 | else |
| 72 | have_ld_version_script=no |
| 73 | AC_MSG_RESULT(no) |
Glenn Randers-Pehrson | 1721829 | 2006-04-20 07:20:46 -0500 | [diff] [blame] | 74 | AC_MSG_WARN(*** You have not enabled versioned symbols.) |
Glenn Randers-Pehrson | e647462 | 2006-03-04 16:50:47 -0600 | [diff] [blame] | 75 | fi |
| 76 | 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] | 77 | |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 78 | if test "$have_ld_version_script" = "yes"; then |
| 79 | AC_MSG_CHECKING([for symbol prefix]) |
| 80 | SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ |
| 81 | | ${CPP-${CC-gcc} -E} - 2>&1 \ |
| 82 | | ${EGREP-grep} "^PREFIX=" \ |
| 83 | | ${SED-sed} "s:^PREFIX=::"` |
| 84 | AC_SUBST(SYMBOL_PREFIX) |
| 85 | AC_MSG_RESULT($SYMBOL_PREFIX) |
| 86 | fi |
| 87 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 88 | # Substitutions for .in files |
| 89 | AC_SUBST(PNGLIB_VERSION) |
| 90 | AC_SUBST(PNGLIB_MAJOR) |
| 91 | AC_SUBST(PNGLIB_MINOR) |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 92 | AC_SUBST(PNGLIB_RELEASE) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 93 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 94 | # Additional arguments (and substitutions) |
| 95 | # Allow the pkg-config directory to be set |
| 96 | AC_ARG_WITH(pkgconfigdir, |
| 97 | AC_HELP_STRING([--with-pkgconfigdir], |
Glenn Randers-Pehrson | b511b60 | 2006-04-16 19:45:31 -0500 | [diff] [blame] | 98 | [Use the specified pkgconfig dir (default is libdir/pkgconfig)]), |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 99 | [pkgconfigdir=${withval}], |
| 100 | [pkgconfigdir='${libdir}/pkgconfig']) |
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 | AC_SUBST([pkgconfigdir]) |
| 103 | AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 104 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 105 | # Make the *-config binary config scripts optional |
| 106 | AC_ARG_WITH(binconfigs, |
| 107 | AC_HELP_STRING([--with-binconfigs], |
| 108 | [Generate shell libpng-config scripts as well as pkg-config data] |
| 109 | [@<:@default=yes@:>@]), |
| 110 | [if test "${withval}" = no; then |
| 111 | binconfigs= |
| 112 | AC_MSG_NOTICE([libpng-config scripts will not be built]) |
| 113 | else |
| 114 | binconfigs='${binconfigs}' |
| 115 | fi], |
| 116 | [binconfigs='${binconfigs}']) |
| 117 | AC_SUBST([binconfigs]) |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 118 | |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 119 | # Allow the old version number library, libpng.so, to be removed from |
| 120 | # the build |
| 121 | AC_ARG_WITH(libpng-compat, |
| 122 | AC_HELP_STRING([--with-libpng-compat], |
| 123 | [Generate the obsolete libpng.so library @<:@default=yes@:>@]), |
| 124 | [if test "${withval}" = no; then |
| 125 | compatlib= |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 126 | AC_MSG_NOTICE([libpng.so will not be built]) |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 127 | else |
| 128 | compatlib=libpng.la |
| 129 | fi], |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 130 | [compatlib=libpng.la]) |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 131 | AC_SUBST([compatlib]) |
| 132 | |
| 133 | # Config files, substituting as above |
Glenn Randers-Pehrson | eb58091 | 2008-07-30 14:47:09 -0500 | [diff] [blame] | 134 | AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc-configure.in]) |
Glenn Randers-Pehrson | c3d51c1 | 2006-03-02 07:23:18 -0600 | [diff] [blame] | 135 | AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in], |
| 136 | [chmod +x libpng-config]) |
| 137 | |
Glenn Randers-Pehrson | 917648e | 2004-12-02 18:14:51 -0600 | [diff] [blame] | 138 | AC_OUTPUT |