1 AC_INIT([libhybris], [0.1.0])
2 AC_CONFIG_SRCDIR([Makefile.am])
3 AC_CONFIG_HEADERS(config.h)
4 AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
5 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
7 # If library source has changed since last release, increment revision
8 # If public symbols have been added, removed or changed since last release,
9 # increment current and set revision to 0
10 # If public symbols have been added since last release, increment age
11 # If public symbols have been removed since last release, set age to 0
12 m4_define([hybris_lt_current], [1])
13 m4_define([hybris_lt_revision], [0])
14 m4_define([hybris_lt_age], [0])
29 LT_CURRENT=hybris_lt_current
30 LT_REVISION=hybris_lt_revision
32 AC_SUBST([LT_CURRENT])
33 AC_SUBST([LT_REVISION])
36 AC_CHECK_LIB(dl, dlopen, dummy=yes, AC_MSG_ERROR(dynamic linking loader is required))
37 AC_CHECK_LIB(rt, clock_gettime, dummy=yes, AC_MSG_ERROR(librt is required))
40 [ --enable-debug Enable debug build (default=disabled)],
43 AM_CONDITIONAL( [WANT_DEBUG], [test x"$debug" = x"yes"])
46 [ --enable-trace Enable TRACE statements (default=disabled)],
49 AM_CONDITIONAL( [WANT_TRACE], [test x"$trace" = x"yes"])
52 [ --enable-mesa Enable mesa headers (default=disabled)],
55 AM_CONDITIONAL( [WANT_MESA], [test x"$mesa" = x"yes"])
57 AC_ARG_ENABLE(wayland,
58 [ --enable-wayland Enable wayland support (default=disabled)],
60 PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client,, exit)
61 PKG_CHECK_MODULES(WAYLAND_SERVER, wayland-server,, exit)
62 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
64 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
65 AC_DEFINE(WANT_WAYLAND, [], [We want Wayland support])
68 AM_CONDITIONAL( [WANT_WAYLAND], [test x"$wayland" = x"yes"])
72 [ --enable-arch[=arch] Compile specific CPU target(default=arm)
74 x86: Compile for x86],
75 [ if test "x$enableval" = "xarm" ; then
77 elif test "x$enableval" = "xx86" ; then
82 echo "Unknown architecture' type"
88 AM_CONDITIONAL([WANT_ARCH_ARM], [test x$arch = xarm])
89 AM_CONDITIONAL([WANT_ARCH_X86], [test x$arch = xx86])
91 DEFAULT_EGL_PLATFORM="null"
92 AC_ARG_WITH(default-egl-platform,
93 [ --with-default-egl-platform=NAME Use NAME as default EGL platform if not specified by environment ],
94 [ DEFAULT_EGL_PLATFORM="$withval" ],
96 AC_SUBST(DEFAULT_EGL_PLATFORM)
98 DEFAULT_HYBRIS_LD_LIBRARY_PATH="/vendor/lib:/system/lib"
99 AC_ARG_WITH(default-hybris-ld-library-path,
100 [ --with-default-hybris-ld-library-path=PATH1:PATH2:... Use PATH1:PATH2 for default HYBRIS_LD_LIBRARY_PATH if not specified by environment ],
101 [ DEFAULT_HYBRIS_LD_LIBRARY_PATH="$withval" ],
103 AC_SUBST(DEFAULT_HYBRIS_LD_LIBRARY_PATH)
106 android_headers_path=""
107 AC_ARG_WITH(android-headers,
108 [ --with-android-headers=DIR Use android headers available in DIR. See utils/extract-headers.sh ],
110 if [ ! test -e $withval/android-version.h ]; then
111 echo "Error! missing android-version.h in android header path"
114 rm -f include/android
115 ln -sf $withval include/android
116 android_headers_path="$withval"
118 # According to http://en.wikipedia.org/wiki/Android_version_history#Version_history_by_API_level
119 android_headers_major=`grep -E "define ANDROID_VERSION_MAJOR " $android_headers_path/android-version.h | sed "s|^\#define ANDROID_VERSION_MAJOR \(.*\)$|\1|g"`
121 android_headers_minor=`grep -E "define ANDROID_VERSION_MINOR " $android_headers_path/android-version.h | sed "s|^\#define ANDROID_VERSION_MINOR \(.*\)$|\1|g"`
123 android_headers_patch=`grep -E "define ANDROID_VERSION_PATCH " $android_headers_path/android-version.h | sed "s|^\#define ANDROID_VERSION_PATCH \(.*\)$|\1|g"`
125 if [ test "x$android_headers_major" = x ]; then
126 echo "Error! Was unable to locate define ANDROID_VERSION_MAJOR in $android_headers_path/android-version.h"
129 AC_SUBST(ANDROID_VERSION_MAJOR, [$android_headers_major])
130 AC_SUBST(ANDROID_VERSION_MINOR, [$android_headers_minor])
131 AC_SUBST(ANDROID_VERSION_PATCH, [$android_headers_patch])
133 echo "Android headers version is $android_headers_major.$android_headers_minor.$android_headers_patch"
136 echo "Error! need to provide path to Android headers --with-android-headers=DIR. See utils/extract-headers.sh"
141 # Add automake tests for version/API needs here that you need in code, including test .am's
143 AM_CONDITIONAL([HAS_ANDROID_4_2_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 2 ])
144 AM_CONDITIONAL([HAS_ANDROID_4_1_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 1 ])
145 AM_CONDITIONAL([HAS_ANDROID_4_0_0], [test $android_headers_major -ge 4 -a $android_headers_minor -ge 0 ])
146 AM_CONDITIONAL([HAS_ANDROID_2_3_0], [test $android_headers_major -ge 2 -a $android_headers_minor -ge 3 ])
148 AM_CONDITIONAL([HAS_LIBNFC_NXP_HEADERS], [test -f ${android_headers_path}/libnfc-nxp/phLibNfc.h])
153 properties/libandroid-properties.pc
155 common/gingerbread/Makefile
160 egl/platforms/Makefile
161 egl/platforms/common/Makefile
162 egl/platforms/common/hybris-egl-platform.pc
163 egl/platforms/null/Makefile
164 egl/platforms/fbdev/Makefile
165 egl/platforms/wayland/Makefile
166 egl/platforms/hwcomposer/Makefile
167 egl/platforms/hwcomposer/hwcomposer-egl.pc
173 hardware/libhardware.pc
175 libnfc_nxp/libnfc_nxp.pc
176 libnfc_ndef_nxp/Makefile
177 libnfc_ndef_nxp/libnfc_ndef_nxp.pc
192 AM_COND_IF([WANT_WAYLAND], [AC_CONFIG_FILES([egl/platforms/common/wayland-egl.pc])])
196 echo "------------------------------------------------------------------------"
197 echo "$PACKAGE_NAME $PACKAGE_VERSION"
198 echo "------------------------------------------------------------------------"
200 echo "Configuration Options:"
202 echo " debug build.............: $debug"
204 echo " trace...................: $trace"
206 echo " prefix..................: $prefix"
208 echo " arch ..................: $arch"
210 echo " headers path ...........: $android_headers_path"
212 echo " default egl platform ...: $DEFAULT_EGL_PLATFORM"
214 echo " default ld_library_path.: $DEFAULT_HYBRIS_LD_LIBRARY_PATH"
216 echo "------------------------------------------------------------------------"
218 echo "Now type 'make' to compile and 'make install' to install this package."