Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
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
10 changes: 5 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

QMIF_CPPFLAGS = @QMIF_CFLAGS@
QMIF_LDADD = @QMIF_LIBS@

AM_CFLAGS = -Wundef \
-Wstrict-prototypes \
-Wno-trigraphs \
-g -O0 \
-fno-inline \
-fno-short-enums \
-fpic \
$(QMIF_CFLAGS) \
$(QMIF_CPPFLAGS) \
-I.

h_sources = ./time_service_v01.h \
./localdefs.h \
./time_genoff_i.h

requiredlibs = $(QMIF_LIBS) -lqcci -lqcsi -lqencdec -lqmi_common
requiredlibs = $(QMIF_LDADD)

bin_PROGRAMS = time_daemon
time_daemon_SOURCES = time_daemon.c time_service_v01.c
time_daemon_LDADD = $(requiredlibs)
time_daemon_LDFLAGS = -lpthread @GLIB_LIBS@

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

echo "Running configure.."
./configure --host=$HOST_ARCH --with-qmif-prefix=$QMI_PREFIX --prefix=$(pwd)/install || { echo "configure failed"; exit 1; }
if [ -n "$QMI_PREFIX" ]; then
export PKG_CONFIG_PATH="${QMI_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
./configure --host=$HOST_ARCH --with-qmi-prefix=$QMI_PREFIX --prefix=$(pwd)/install || { echo "configure failed"; exit 1; }
else
./configure --host=$HOST_ARCH --prefix=$(pwd)/install || { echo "configure failed"; exit 1; }
fi

echo "Running make.."
make || { echo "make failed"; exit 1; }
Expand Down
23 changes: 10 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG

# Checks for libraries with user.
AC_ARG_WITH([qmif-prefix],
[AS_HELP_STRING([--with-qmif-prefix=PATH], [Path to qmi-framework installation])],
[QMIF=$withval], [QMIF=/usr/local])
QMIF_CFLAGS="-I ${QMIF}/include/qmi_framework"
QMIF_LIBS="-L${QMIF}/lib/"
AC_ARG_WITH([qmi-prefix],
[AS_HELP_STRING([--with-qmi-prefix=PATH],
[Fallback path to qmi-framework if pkg-config cannot find it])],
[QMIF_PREFIX=$withval], [QMIF_PREFIX=])
PKG_CHECK_MODULES([QMIF], [qmi-framework],
[QMIF_CFLAGS="-I`$PKG_CONFIG --variable=prefix qmi-framework`/include/qmi_framework"],
[AS_IF([test -n "$QMIF_PREFIX"],
[QMIF_CFLAGS="-I${QMIF_PREFIX}/include/qmi_framework"
QMIF_LIBS="-L${QMIF_PREFIX}/lib -lqcci -lqcsi -lqencdec -lqmi_common"],
[AC_MSG_ERROR([qmi-framework not found via pkg-config and --with-qmi-prefix not specified])])])
AC_SUBST([QMIF_CFLAGS])
AC_SUBST([QMIF_LIBS])
CFLAGS="$CFLAGS -DSYSLOG_ENABLE"
Expand All @@ -41,14 +46,6 @@ 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)

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

AC_SUBST([systemdsystemunitdir])

AC_CONFIG_FILES([ \
Makefile \
Expand Down
Loading