Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ time_daemon_LDADD = $(requiredlibs)
time_daemon_LDFLAGS = -lpthread @GLIB_LIBS@

# Systemd service file installation
if HAVE_SYSTEMD
systemdsystemunit_DATA = time-daemon.service
endif
7 changes: 6 additions & 1 deletion build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ echo "Running configure.."
echo "Running make.."
make || { echo "make failed"; exit 1; }

make install || { echo "make install failed"; exit 1; }
# Use sudo only if not running as root
if [ "$(id -u)" -eq 0 ]; then
make install || { echo "make install failed"; exit 1; }
else
sudo make install || { echo "make install failed"; exit 1; }
fi

FILES_TO_CLEAN=(
aclocal.m4 configure ar-lib config.h config.h.in config.log config.status libtool
Expand Down
27 changes: 8 additions & 19 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

# Requires autoconf tool later than 2.61
AC_PREREQ(2.61)
# Initialize the qmi-framework package version 1.0.0
AC_INIT([time-services],1.0.0)
# Initialize the qmi-framework package version 0.1.1
AC_INIT([time-services],0.1.1)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
Expand Down Expand Up @@ -41,25 +41,14 @@ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, AC_MSG_ERROR(GLib >= 2.16 i
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
AC_SUBST(GLIB_LIBS)

# Check for systemd
# Systemd service file installation directory (no systemd dependency required)
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],
[],
[with_systemdsystemunitdir=auto])
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
[Directory for systemd service files (default: ${prefix}/lib/systemd/system)])],
[systemdsystemunitdir=$withval],
[systemdsystemunitdir='${prefix}/lib/systemd/system'])

AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)

AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])

AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])

AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
AC_SUBST([systemdsystemunitdir])

AC_CONFIG_FILES([ \
Makefile \
Expand Down
Loading