File: configure.ac

package info (click to toggle)
libemf 1.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,884 kB
  • sloc: ansic: 14,297; cpp: 5,733; makefile: 47; sh: 3
file content (117 lines) | stat: -rw-r--r-- 3,429 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Process this file with autoconf to produce a configure script.
# Copyright (C) 2002, 2003 lignum Computing, Inc. <dallenbarnett@users.sourceforge.net>
# $Id: configure.ac 83 2018-12-31 16:57:58Z dallenbarnett $

AC_INIT([libEMF],[1.0.11],[dallenbarnett@users.sourceforge.net])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR([libemf/libemf.cpp])
AC_CONFIG_HEADERS([config/config.h])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([-Wall])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AM_PROG_AR

LT_INIT

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h unistd.h limits.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_LIB(m, ceil)
AC_CHECK_FUNCS([floor memset select])

# Autoheader seems to complain about a lack of these (perhaps rightly)
AH_TEMPLATE(LIBEMF_DEBUG, [Turn on any addition debugging edits])
AH_TEMPLATE(ENABLE_EDITING, [Enable the EditEnhMetaFile() function])

# If you want to use Checker, then you have to enable debugging and
# disable threads

AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],[enable libEMF debugging [default=no]]),
  enable_debug=$enableval, enable_debug=no)
if test "x$enable_debug" = xyes; then
  AC_DEFINE(LIBEMF_DEBUG, 1)
  if test "x$GCC" = xyes; then
    CFLAGS="$CFLAGS -g -O0 -Wall -W"
    CXXFLAGS="$CXXFLAGS -g -O0 -Wall -W"
  else
    AC_MSG_WARN([compiler unknown, please disable optimizations manually in \
your CFLAGS])
  fi
fi

AC_ARG_ENABLE(threads,
AS_HELP_STRING([--enable-threads],[enable threads [default=yes]]),
  have_threads=$enableval, have_threads=yes)
if test "x$have_threads" = xyes; then
THREAD_LIBS=
AC_CHECK_HEADERS(pthread.h,
  AC_MSG_CHECKING(for pthread_create in -lpthread)

  save_LIBS=$LIBS
  LIBS="$LIBS -lpthread"
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
pthread_create (NULL, NULL, NULL, NULL)]])],[
    AC_MSG_RESULT(yes)
    CFLAGS="$CFLAGS -D_REENTRANT -DPTHREADS"
    CXXFLAGS="$CXXFLAGS -D_REENTRANT -DPTHREADS"
    THREAD_LIBS="$THREAD_LIBS -lpthread"],[AC_MSG_RESULT(no)]))
  LIBS=$save_LIBS
AC_SUBST(THREAD_LIBS)
else
  CFLAGS="$CFLAGS -D_NOTHREADS"
  CXXFLAGS="$CXXFLAGS -D_NOTHREADS"
fi

# You can turn on (human readable) editing of metafile if desired.
# Adds a lot of code and data to the library, though.

AC_ARG_ENABLE(editing,
AS_HELP_STRING([--enable-editing],[enable EditEnhMetaFile() function [default=no]]),
  enable_editing=$enableval, enable_editing=no)
if test "x$enable_editing" = xyes; then
   AC_DEFINE(ENABLE_EDITING, 1)
fi

AM_CONDITIONAL(LIBEMF_DEBUG, test $enable_debug = yes)
AM_CONDITIONAL(HAVE_THREADS, test $have_threads = yes)
AM_CONDITIONAL(ENABLE_EDITING, test $enable_editing = no)

# Check for DOxygen and enable its features

# See /usr/share/aclocal/ax_prog_doxygen.m4 and
# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html#doxygenSupport

DX_DOXYGEN_FEATURE(ON)
DX_DOT_FEATURE(ON)
DX_HTML_FEATURE(OFF)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(ON)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([${PACKAGE_NAME}])
AM_CONDITIONAL(ENABLE_DOXYGEN,[test "x${DX_FLAG_doc}" = x1])

AC_CONFIG_FILES([Makefile include/Makefile libemf/Makefile \
src/Makefile tests/Makefile])

AC_OUTPUT