File: configure.ac

package info (click to toggle)
gputils 0.13.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,620 kB
  • ctags: 3,066
  • sloc: pascal: 191,182; ansic: 18,644; sh: 3,391; makefile: 1,293; lex: 991; yacc: 917
file content (158 lines) | stat: -rw-r--r-- 4,144 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT([gputils],[0.13.4], [<URL:http://gputils.sourceforge.net/>])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE

# Determine the host and build type. The target is always a PIC.
AC_CANONICAL_BUILD
AC_CANONICAL_HOST

# Defaults
GPUTILS_HEADER_PATH="\$(datadir)/gputils/header"
GPUTILS_LKR_PATH="\$(datadir)/gputils/lkr"
GPUTILS_LIB_PATH="\$(datadir)/gputils/lib"
LIBGPUTILS=libgputils/libgputils.a
LIBIBERTY=libiberty/libiberty.a
MAKE_SUBDIRS="libgputils libiberty gpasm gplink gputils header lkr doc man"

# Check for additional parameters
AC_ARG_ENABLE(debug, 
  [  --enable-debug          enable gputils debug features],
  [enable_gputils_debug=yes])    

AC_ARG_ENABLE(path,
  [  --disable-path          disable adding default search paths],
  [], [enable_gputils_path=yes])

# Checks for programs.
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LEX
set `$LEX -V`
if test "${3}" != "2.5.4"; then
  AC_MSG_WARN(gputils supports flex version 2.5.4)
fi
AC_PROG_INSTALL

# append the host alias to the tools for cross compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar, :)

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([libintl.h malloc.h stddef.h stdlib.h string.h strings.h unistd.h windows.h])

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

# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([memmove mempcpy memset strcasecmp strchr strdup strerror stricmp strrchr strtol strtoul])

# Check for functions to compile into libiberty (getopt is always compiled).
IBERTYOBJS=
AC_CHECK_FUNC(bzero, , [IBERTYOBJS="$IBERTYOBJS bzero.o"])
AC_CHECK_FUNC(vsnprintf, , [IBERTYOBJS="$IBERTYOBJS vasprintf.o vsnprintf.o"])
AC_CHECK_FUNC(snprintf, , [IBERTYOBJS="$IBERTYOBJS snprintf.o"])

AM_CFLAGS=
AM_LDFLAGS=

# Options for the system on which the package will run
case "${host}" in
  *cygwin* )
    if test "x$GCC" = "xyes"; then
      AM_CFLAGS="-Wall -pedantic"
      AM_LDFLAGS="-Wl,-warn-common -Wl,-warn-once"
    fi
    ;;
  *linux* )
    if test "x$GCC" = "xyes"; then
      AM_CFLAGS="-Wall -pedantic"
      AM_LDFLAGS="-Wl,-warn-common -Wl,-warn-once"
    fi
    ;;
  *sun* )
    # sunos cc needs the -xCC flag for // comments
    if test "x$GCC" != "xyes"; then
      AM_CFLAGS="-xCC" 
    fi
    ;;
  *mingw* )
    ;;
  *-pc-os2_emx | *-pc-os2-emx )
    EXEEXT=".exe"
    if test "x$GCC" = "xyes"; then
      AM_CFLAGS="-Zcrtdll"
    fi
    ;;
esac

# Host filesystem options
case "${host}" in
  *mingw* | *-pc-os2_emx | *-pc-os2-emx | *djgpp* )
    AC_DEFINE(HAVE_DOS_BASED_FILE_SYSTEM, 1, 
      [Define if your host uses a DOS based file system. ])
    ;;
esac

# Process the options
if test x$enable_gputils_debug = xyes; then
  AC_DEFINE(GPUTILS_DEBUG, 1, 
    [Define if you want to enable GPUTILS debug features. ])
fi

if test x$enable_gputils_path = xyes; then
  AC_DEFINE(USE_DEFAULT_PATHS, 1, 
    [Define if you want to add default search paths. ])
fi

# Substitute configuration variables
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(GPUTILS_HEADER_PATH)
AC_SUBST(GPUTILS_LKR_PATH)
AC_SUBST(GPUTILS_LIB_PATH)
AC_SUBST(IBERTYOBJS)
AC_SUBST(LIBGPUTILS)
AC_SUBST(LIBIBERTY)
AC_SUBST(MAKE_SUBDIRS)

# Generate Makefiles
AC_CONFIG_FILES([Makefile 
                 doc/Makefile 
                 gpasm/Makefile 
                 gplink/Makefile 
                 gputils/Makefile 
                 header/Makefile 
                 libgputils/Makefile 
                 libiberty/Makefile 
                 lkr/Makefile
                 man/Makefile 
                 man/fr/Makefile 
                 gputils.spec])

AC_OUTPUT

AC_MSG_RESULT([

gputils-$PACKAGE_VERSION is now configured for $canonical_host_type

  Build:                $build
  Host:                 $host
  Source directory:     $srcdir
  Installation prefix:  $prefix
  C compiler:           $CC $CFLAGS

])