]> granicus.if.org Git - cronie/commitdiff
Cronie could be build as Position Independent Executable when the
authorMarcela Mašláňová <mmaslano@redhat.com>
Thu, 12 Feb 2009 13:32:59 +0000 (14:32 +0100)
committerMarcela Mašláňová <mmaslano@redhat.com>
Thu, 12 Feb 2009 13:32:59 +0000 (14:32 +0100)
configure is executed with --enable-pie.
Erased commented unused stuff from configure.

configure.ac

index 148f0e6a25e29dc5234d0300f4647c2fb263e72a..9babd7a1ff323685b39b96654bfefe5a2c8e3a0f 100644 (file)
@@ -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