From 9ac0d543d32f5cda0659a4932d0ed1c9f577e507 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Apr 23 2015 21:36:18 +0000 Subject: Start switching to popt Start working up changes to use popt instead of getopt() for parsing command line arguments. It's preferable to dragging along a copy of getopt_long() everywhere, I think. This is just the autoconf tests and additions to the build requirements in the RPM .spec file. --- diff --git a/certmonger.spec b/certmonger.spec index caf487e..081098b 100644 --- a/certmonger.spec +++ b/certmonger.spec @@ -73,6 +73,8 @@ BuildRequires: /usr/bin/unix2dos BuildRequires: /usr/bin/which # for dbus tests BuildRequires: dbus-python +# for popt or popt-devel, depending on the build environment +BuildRequires: /usr/include/popt.h # we need a running system bus Requires: dbus diff --git a/configure.ac b/configure.ac index 1d6a6ad..83ac8e9 100644 --- a/configure.ac +++ b/configure.ac @@ -760,6 +760,13 @@ if ! ${configure_dist_target_only:-false} ; then AM_CONDITIONAL(HAVE_UUID,test x$uuid = xyes) AC_SUBST(UUID_CFLAGS) AC_SUBST(UUID_LIBS) + LIBSsave="$LIBS" + AC_CHECK_HEADERS(popt.h) + AC_CHECK_FUNC(poptGetContext,,AC_CHECK_LIB(popt,poptGetContext)) + POPT_LIBS="$LIBS" + LIBS="$LIBSsave" + AC_SUBST(POPT_CFLAGS) + AC_SUBST(POPT_LIBS) else AM_CONDITIONAL(HAVE_OPENSSL,false) AM_CONDITIONAL(HAVE_NSS,false) diff --git a/src/Makefile.am b/src/Makefile.am index 589e0f2..7472833 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS = $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) $(DBUS_CFLAGS) $(KRB5_CFLAGS) \ - $(XMLRPC_CFLAGS) $(IDN_CFLAGS) $(UUID_CFLAGS) $(LDAP_CFLAGS) + $(XMLRPC_CFLAGS) $(IDN_CFLAGS) $(UUID_CFLAGS) $(LDAP_CFLAGS) \ + $(POPT_CFLAGS) LDFLAGS = if PIE CFLAGS += -fPIC