8000 libmtp configure putting UDEV files in the wrong location #271 by JoesCat · Pull Request #283 · libmtp/libmtp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

libmtp configure putting UDEV files in the wrong location #271 #283

New issue < 8000 details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast overflow-auto" aria-label="Sign up for GitHub">

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ if USE_LINUX
MTP_HOTPLUG = util/mtp-hotplug

udevrules_DATA=@UDEV_RULES@
udevrulesdir = $(datadir)
udevrulesdir = $(TARGET_UDEV)/rules.d
hwdb_DATA=69-libmtp.hwdb
hwdbdir = $(datadir)
@UDEVdata_SNIPPET@
hwdbdir = $(TARGET_UDEV)/hwdb.d

GENERATED = 69-libmtp.hwdb $(UDEV_RULES)

Expand Down
81 changes: 43 additions & 38 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,28 @@ AC_PROG_LIBTOOL
AM_ICONV

# Optionally set install location of udev
# set default UDEV=/usr/lib/udev and not UDEV=/usr/local/lib/udev
# but we'll also need {$prefix} for 'make check', 'make distcheck'
# 'rpmbuild -ba', 'mock', and other automated installers/checkers.
UDEV=/usr/lib/udev
udevdir=${UDEV}
if test "$prefix" = "/usr/local" || test "$prefix" = "NONE" ;
then
UDEV=\${prefix}/../lib/udev
else
UDEV=\${prefix}/lib/udev
udevdir=${prefix}/lib/udev
fi
AC_ARG_WITH(udev,
AS_HELP_STRING([--with-udev=DIR],
[directory where udev is installed [default=/usr/lib/udev]]),
[UDEV="${withval}"], [])
AC_DEFINE_UNQUOTED([UDEV_DIR], ["${UDEV}/"], [where mtp-probe is installed, default=/usr/lib/udev/])
[UDEV="${withval}"
udevdir="${withval}"
], [])
AC_DEFINE_UNQUOTED([UDEV_DIR], ["$udevdir/"], [where mtp-probe is installed, default=/usr/lib/udev/])
dnl to allow for crossbuilding we define $host seeing $UDEV, but
dnl we install into $TARGET_UDEV (go see --enable-crossbuilddir)
AC_SUBST(UDEV)
dnl NOTE: Since the (default) UDEV directory is not part of libmtp,
dnl we cannot do a 'make distcheck' with it as non-root user, this
dnl is because 'make distcheck' uses $prefix to create a build dir.
dnl We default to using '$(libdir)/udev/' as user, so that we can
dnl run 'make distcheck' as well as run 'rpmbuild -ba' too. Do this
dnl here since automake can't process 'if/else/endif in Makefile.am
UDEVdata_SNIPPET='
noinst_DATA="libmtp.fdi libmtp.usermap"
ifeq ($(shell id -u),0)
udevrulesdir=$(UDEV)/rules.d
hwdbdir=$(UDEV)/hwdb.d
ifdef ENABLE_CROSSBUILD
udevrulesdir=$(TARGET_UDEV)/rules.d
hwdbdir=$(TARGET_UDEV)/hwdb.d
endif
else
udevrulesdir=$(libdir)/udev/rules.d
hwdbdir=$(libdir)/udev/hwdb.d
endif
'
AC_SUBST([UDEVdata_SNIPPET])
AM_SUBST_NOTMAKE([UDEVdata_SNIPPET])
UDEVbin_SNIPPET='
ifeq ($(shell id -u),0)
mtp_probedir=$(UDEV)
ifdef ENABLE_CROSSBUILD
mtp_probedir=$(TARGET_UDEV)
endif
else
mtp_probedir=$(libdir)/udev
endif
'
AC_SUBST([UDEVbin_SNIPPET])
AM_SUBST_NOTMAKE([UDEVbin_SNIPPET])

# Optionally set name of udev rules file, default
# priority is 69, to appear before 70-acl.rules which handles
Expand Down Expand Up @@ -125,6 +106,7 @@ AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
# be binary equivalent with host CPU. 69-libmtp.hwdb and
# @UDEV_RULES@ should also get installed in target udev too.
#
TARGET_UDEV=${UDEV}
crossbuilddir=off
AC_ARG_ENABLE(crossbuilddir,
AS_HELP_STRING([--enable-crossbuilddir], [crossbuild libmtp (this is step 2of3) [default=off]]),
Expand All @@ -133,10 +115,10 @@ if test "$crossbuilddir" != off; then
if test x"${HOST_MTP_HOTPLUG}" = "x:"; then
AC_MSG_ERROR([Error: Host PC 'mtp-hotplug' not found! Please install 'libmtp' on host PC before doing crossbuild!])
fi
TARGET_UDEV=${crossbuilddir}
fi
AM_CONDITIONAL(ENABLE_CROSSBUILD,[test "$crossbuilddir" != off])
TARGET_UDEV=${crossbuilddir}
AC_SUBST(TARGET_UDEV)
AC_SUBST(TARGET_UDEV) dnl NOTE: this is either default UDEV or new target crossbuilddir

# Check for Darwin
AC_MSG_CHECKING([if the host operating system is Darwin])
Expand Down Expand Up @@ -302,3 +284,26 @@ AC_CONFIG_FILES([src/libmtp.h doc/Doxyfile Makefile doc/Makefile src/Makefile
examples/Makefile util/Makefile libmtp.sh hotplug.sh libmtp.pc])
AC_OUTPUT
chmod +x hotplug.sh

AC_MSG_NOTICE([

Configuration:
Compiler ${CC}
Include MTPZ ${use_mtpz}
Source code location ${srcdir}
Build code location ${builddir}
Destination \${prefix} ${prefix}
Libmtp Destination ${libdir}

Setup UDEV utilities: ${USE_LINUX}
\$UDEV working dir ${UDEV}
compiled udev dir ${udevdir}
\$UDEV rules file ${UDEV_RULES}
group ${UDEV_GROUP}
mode ${UDEV_MODE}

Cross-build target dir: ${crossbuilddir}

Documentation:
enable/use doxygen ${HAVE_DOXYGEN}
])
9 changes: 5 additions & 4 deletions util/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
if USE_LINUX
bin_PROGRAMS=mtp-hotplug
mtp_hotplug_SOURCES=mtp-hotplug.c
bin_PROGRAMS = mtp-hotplug
mtp_hotplug_SOURCES = mtp-hotplug.c

mtp_probe_SOURCES = mtp-probe.c
mtp_probe_PROGRAMS = mtp-probe
mtp_probedir = $(bindir)
@UDEVbin_SNIPPET@
mtp_probedir = $(TARGET_UDEV)
else
EXTRA_DIST = mtp-hotplug.c mtp-probe.c
endif

AM_CPPFLAGS=-I$(top_builddir)/src
Expand Down
Loading
0