~ubuntu-branches/ubuntu/trusty/libsdl2-gfx/trusty

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2014-01-14 11:35:40 UTC
  • Revision ID: package-import@ubuntu.com-20140114113540-8khnbce2a39os4ca
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script.
 
2
AC_INIT(README)
 
3
 
 
4
dnl Set various version strings - taken gratefully from the GTk sources
 
5
 
 
6
# Making releases:
 
7
#   MICRO_VERSION += 1;
 
8
#   INTERFACE_AGE += 1;
 
9
#   BINARY_AGE += 1;
 
10
# if any functions have been added, set INTERFACE_AGE to 0.
 
11
# if backwards compatibility has been broken,
 
12
# set BINARY_AGE and INTERFACE_AGE to 0.
 
13
 
 
14
MAJOR_VERSION=1
 
15
MINOR_VERSION=0
 
16
MICRO_VERSION=0
 
17
INTERFACE_AGE=0
 
18
BINARY_AGE=0
 
19
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
20
 
 
21
AC_SUBST(MAJOR_VERSION)
 
22
AC_SUBST(MINOR_VERSION)
 
23
AC_SUBST(MICRO_VERSION)
 
24
AC_SUBST(INTERFACE_AGE)
 
25
AC_SUBST(BINARY_AGE)
 
26
AC_SUBST(VERSION)
 
27
 
 
28
# libtool versioning
 
29
LT_INIT([win32-dll])
 
30
 
 
31
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
 
32
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
 
33
LT_REVISION=$INTERFACE_AGE
 
34
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
 
35
 
 
36
AC_SUBST(LT_RELEASE)
 
37
AC_SUBST(LT_CURRENT)
 
38
AC_SUBST(LT_REVISION)
 
39
AC_SUBST(LT_AGE)
 
40
 
 
41
dnl Detect the canonical build and host environments
 
42
AC_CANONICAL_HOST
 
43
 
 
44
dnl Setup for automake
 
45
AM_INIT_AUTOMAKE(SDL2_gfx, $VERSION)
 
46
 
 
47
dnl Check for tools
 
48
AC_PROG_LIBTOOL
 
49
AC_PROG_CC
 
50
AC_PROG_OBJC
 
51
AC_C_INLINE
 
52
AC_PROG_INSTALL
 
53
AC_PROG_MAKE_SET
 
54
if test -z "$host_alias"; then
 
55
    hostaliaswindres=
 
56
else
 
57
    hostaliaswindres="$host_alias-windres"
 
58
fi
 
59
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
 
60
 
 
61
case "$host" in
 
62
    *-*-beos*)
 
63
        ac_default_prefix=/boot/develop/tools/gnupro
 
64
        ;;
 
65
    *-*-cygwin* | *-*-mingw32*)
 
66
        if test "$build" != "$host"; then # cross-compiling
 
67
            # Default cross-compile location
 
68
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32
 
69
        else
 
70
            # Look for the location of the tools and install there
 
71
            if test "$BUILD_PREFIX" != ""; then
 
72
                ac_default_prefix=$BUILD_PREFIX
 
73
            fi
 
74
        fi
 
75
        if test x$WINDRES != x; then
 
76
            use_version_rc=true
 
77
        fi
 
78
        ;;
 
79
    *-*-darwin*)
 
80
        AC_ARG_ENABLE([imageio], [AC_HELP_STRING([--enable-imageio], [use native Mac OS X frameworks for loading images [default=yes]])],
 
81
                      [], [enable_imageio=yes])
 
82
        if test x$enable_imageio = xyes; then
 
83
            IMG_LIBS="-Wl,-framework,ApplicationServices $IMG_LIBS"
 
84
        else
 
85
            CFLAGS="$CFLAGS -DSDL_IMAGE_USE_COMMON_BACKEND"
 
86
        fi
 
87
        ;;
 
88
esac
 
89
 
 
90
dnl set this to use on systems that use lib64 instead of lib
 
91
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
 
92
 
 
93
dnl Function to find a library in the compiler search path
 
94
find_lib()
 
95
{
 
96
    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
 
97
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
 
98
    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
 
99
    if test "$cross_compiling" = yes; then
 
100
        host_lib_path=""
 
101
    else
 
102
        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
 
103
    fi
 
104
    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
 
105
        lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
 
106
        if test x$lib != x; then
 
107
            echo $lib
 
108
            return
 
109
        fi
 
110
    done
 
111
}
 
112
 
 
113
dnl Check for NASM (for x86 assembly blit routines)
 
114
AC_ARG_ENABLE(mmx,[  --enable-mmx            use mmx assembly on x86 [default=yes], disable this on non-x86 platforms],, enable_mmx=yes)
 
115
 
 
116
if test x$enable_mmx = xyes; then
 
117
  CFLAGS="$CFLAGS -O -DUSE_MMX"
 
118
  dnl MMX enabled by default in GCC on x86_64, but not i386:
 
119
  AC_CHECK_SIZEOF([long])
 
120
  if test "$ac_cv_sizeof_long" = "4"; then
 
121
          CFLAGS="$CFLAGS -mmmx"
 
122
  fi
 
123
fi
 
124
 
 
125
dnl Check for SDL
 
126
SDL_VERSION=2.0.0
 
127
AC_SUBST(SDL_VERSION)
 
128
AM_PATH_SDL2($SDL_VERSION,
 
129
            :,
 
130
           AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
 
131
)
 
132
CFLAGS="$CFLAGS $SDL_CFLAGS"
 
133
LIBS="$LIBS $SDL_LIBS"
 
134
saved_LIBS="$LIBS"
 
135
 
 
136
AC_SUBST([WINDRES])
 
137
 
 
138
OBJCFLAGS=$CFLAGS
 
139
 
 
140
# Finally create all the generated files
 
141
AC_OUTPUT([
 
142
Makefile
 
143
])
 
144
 
 
145
echo
 
146
echo "Options summary:"
 
147
echo "* --enable-mmx: $enable_mmx"