Debian Codegraph @

PNG/libpng/configure.ac

raw
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
21 AC_INIT([libpng], [1.2.12], [[email protected]])
22 AM_INIT_AUTOMAKE
23 dnl stop configure from automagically running automake
24 AM_MAINTAINER_MODE
25
26 PNGLIB_VERSION=1.2.12
27 PNGLIB_MAJOR=12
28 PNGLIB_MINOR=12
29
30 dnl End of version number stuff
31
32 AC_CONFIG_SRCDIR([pngget.c])
33 AM_CONFIG_HEADER(config.h)
34
35 # Checks for programs.
36 AC_PROG_CC
37 AC_PROG_LD
38 AC_PROG_CPP
39 AC_CHECK_TOOL(SED, sed, :)
40 AC_PROG_INSTALL
41 AC_PROG_LN_S
42 AC_PROG_MAKE_SET
43 AC_PROG_LIBTOOL
44
45 # Checks for header files.
46 AC_HEADER_STDC
47 AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h])
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
57 AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
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]))
60
61 AC_MSG_CHECKING([if assembler code in pnggccrd.c can be compiled])
62 AC_TRY_COMPILE(
63 [#include "pnggccrd.c"],
64 [return 0;],
65 LIBPNG_DEFINES=,
66 LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG\ -DPNG_NO_ASSEMBLER_CODE)
67 if test "$LIBPNG_DEFINES"; then
68 AC_MSG_RESULT(no)
69 else
70 AC_MSG_RESULT(yes)
71 LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
72 fi
73 AC_SUBST(LIBPNG_DEFINES)
74
75 AC_MSG_CHECKING([if libraries can be versioned])
76 GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
77 if test "$GLD"; then
78 have_ld_version_script=yes
79 AC_MSG_RESULT(yes)
80 else
81 have_ld_version_script=no
82 AC_MSG_RESULT(no)
83 AC_MSG_WARN(*** You have not enabled versioned symbols.)
84 fi
85 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
86
87 # Substitutions for .in files
88 AC_SUBST(PNGLIB_VERSION)
89 AC_SUBST(PNGLIB_MAJOR)
90 AC_SUBST(PNGLIB_MINOR)
91
92 # Additional arguments (and substitutions)
93 # Allow the pkg-config directory to be set
94 AC_ARG_WITH(pkgconfigdir,
95 AC_HELP_STRING([--with-pkgconfigdir],
96 [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
97 [pkgconfigdir=${withval}],
98 [pkgconfigdir='${libdir}/pkgconfig'])
99
100 AC_SUBST([pkgconfigdir])
101 AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
102
103 # Make the *-config binary config scripts optional
104 AC_ARG_WITH(binconfigs,
105 AC_HELP_STRING([--with-binconfigs],
106 [Generate shell libpng-config scripts as well as pkg-config data]
107 [@<:@default=yes@:>@]),
108 [if test "${withval}" = no; then
109 binconfigs=
110 AC_MSG_NOTICE([libpng-config scripts will not be built])
111 else
112 binconfigs='${binconfigs}'
113 fi],
114 [binconfigs='${binconfigs}'])
115 AC_SUBST([binconfigs])
116
117 # Allow the old version number library, libpng.so, to be removed from
118 # the build
119 AC_ARG_WITH(libpng-compat,
120 AC_HELP_STRING([--with-libpng-compat],
121 [Generate the obsolete libpng.so library @<:@default=yes@:>@]),
122 [if test "${withval}" = no; then
123 compatlib=
124 AC_MSG_NOTICE([libpng.so will not be built])
125 else
126 compatlib=libpng.la
127 fi],
128 [compatlib=libpng.la])
129 AC_SUBST([compatlib])
130
131 # Config files, substituting as above
132 AC_CONFIG_FILES([Makefile libpng.pc:scripts/libpng.pc.in])
133 AC_CONFIG_FILES([libpng-config:scripts/libpng-config.in],
134 [chmod +x libpng-config])
135
136 AC_OUTPUT