From: Marcela Mašláňová Date: Thu, 12 Feb 2009 13:32:59 +0000 (+0100) Subject: Cronie could be build as Position Independent Executable when the X-Git-Tag: cronie1.3~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8652811e2edf8db31f7561666b44b957da77976a;p=cronie Cronie could be build as Position Independent Executable when the configure is executed with --enable-pie. Erased commented unused stuff from configure. --- diff --git a/configure.ac b/configure.ac index 148f0e6..9babd7a 100644 --- a/configure.ac +++ b/configure.ac @@ -123,24 +123,6 @@ AC_ARG_WITH(daemon_groupname, ) AC_SUBST(DAEMON_GROUPNAME) -# Check whether user wants sysconfig file -#AC_ARG_WITH(config, -# [AS_HELP_STRING([--with-sysconf], [Enable sysconfig file])], -# [ if test "x$withval" != "xno" ; then -# configdir=${sysconfdir}/sysconfig/ -# AC_SUBST(configdir) -# fi ] -#) - -# Check whether user wants init file -#AC_ARG_WITH(init, -# [AS_HELP_STRING([--with-initfile], [Enable init file])], -# [ if test "x$withval" != "xno" ; then -# initdir=${initrddir} -# AC_SUBST(initdir) -# fi ] -#) - # Check whether inotify is accepted AC_ARG_WITH(inotify, [AS_HELP_STRING([--with-inotify], [ Enable inotify support])], @@ -151,6 +133,21 @@ AC_ARG_WITH(inotify, fi ] ) + +AC_ARG_ENABLE(pie,CRONIE_HELP_STRING(--enable-pie,Build cronie as a Position Independent Executable)) +if test "x$enable_pie" = xyes; then + save_CFLAGS="$CFLAGS" + save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie -fpie" + AC_CACHE_CHECK([whether compiler accepts -pie -fpie], ac_cv_pie_fpie, + [AC_TRY_LINK([], [], + ac_cv_pie_fpie=yes, ac_cv_pie_fpie=no)]) + if test $ac_cv_pie_fpie = no; then + CFLAGS="$save_CFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi # Check whether user wants SELinux support SELINUX_MSG="no" @@ -211,10 +208,6 @@ AC_DEFINE(SYSLOG,1,[Using syslog for log messages.]) AC_DEFINE(CAPITALIZE_FOR_PS, 1, [if you have a tm_gmtoff member in struct tm]) -##AC_DEFINE(LOGIN_CAP, 1, [if your OS supports BSD authentication]) - -##AC_DEFINE(CRON_GROUP,"crontab",[crontab]) - # Check whether user wants Linux audit support AC_ARG_WITH(audit, [AS_HELP_STRING([--with-audit], [Enable audit trails])], @@ -228,9 +221,6 @@ AC_ARG_WITH(audit, fi ] ) -dnl AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Turn on debugging])]) -dnl AM_CONDITIONAL(DEBUG, test "$enable_debug" = true) - AC_CONFIG_FILES([Makefile src/Makefile man/Makefile]) AC_OUTPUT