# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([initrd-recovery], [2.1.1], [walyong.cho@samsung.com]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_PREFIX_DEFAULT([/usr]) AM_INIT_AUTOMAKE([foreign subdir-objects]) LT_PREREQ(2.2) LT_INIT([disable-static]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_MKDIR_P AC_PATH_PROG([M4], [m4]) # Checks for libraries. # Checks for header files. AC_CHECK_HEADERS([fcntl.h limits.h mntent.h stdint.h stdlib.h string.h sys/ioctl.h sys/mount.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER_STDBOOL AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UINT32_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_GETMNTENT AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([dup2 getmntent memset munmap strcasecmp strchr strdup strerror strrchr strstr]) # ------------------------------------------------------------------------------ our_cflags=" \ -g -O2 \ -Werror \ -fpie" our_ldflags=" \ -Wl,--as-needed \ -Wl,--no-undefined \ -Wl,--gc-sections \ -Wl,-z,relro \ -Wl,-z,now \ -pie" AC_SUBST([OUR_CFLAGS], "$our_cflags") AC_SUBST([OUR_LDFLAGS], "$our_ldflags") M4_DEFINES= # ------------------------------------------------------------------------------ AC_ARG_ENABLE([recovery-gui], AS_HELP_STRING([--disable-recovery-gui], [disable recovery gui mode]), [case "${enableval}" in yes) enable_recovery_gui=yes ;; no) enable_recovery_gui=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --disable-recovery-gui) ;; esac], enable_recovery_gui=yes) if test "x$enable_recovery_gui" == "xyes"; then M4_DEFINES="$M4_DEFINES -DRECOVERY_GUI" AC_SUBST([OUR_CFLAGS], "$OUR_CFLAGS -DRECOVERY_GUI") PKG_CHECK_MODULES(LIBPNG, [libpng]) PKG_CHECK_MODULES(VCONF_INTERNAL_KEYS, [vconf-internal-keys]) RECOVERY_GUI="GUI" else RECOVERY_GUI="NO" fi AC_SUBST([RECOVERY_GUI]) AM_CONDITIONAL([RECOVERY_GUI], [test "x$enable_recovery_gui" != "xno"]) # ------------------------------------------------------------------------------ AC_SUBST(M4_DEFINES) # ------------------------------------------------------------------------------ AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_MSG_RESULT([ $PACKAGE_NAME $VERSION prefix: ${prefix} recovery gui mode: ${enable_recovery_gui} OUR CFLAGS: ${OUR_CFLAGS} ${CFLAGS} ])