aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/Makefile35
-rw-r--r--modules/mount_autofs.c4
-rw-r--r--modules/mount_ext2.c6
-rw-r--r--modules/mount_generic.c4
-rw-r--r--modules/mount_nfs.c4
-rw-r--r--modules/mount_smbfs.c4
6 files changed, 33 insertions, 24 deletions
diff --git a/modules/Makefile b/modules/Makefile
index 7d6634c..3c1ddc8 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -3,29 +3,38 @@
# Makefile for autofs
#
+include ../Makefile.conf
include ../Makefile.rules
-SRCS = lookup_yp.c lookup_file.c lookup_program.c \
+SRCS := lookup_yp.c lookup_file.c lookup_program.c \
parse_sun.c \
- mount_generic.c mount_ext2.c mount_nfs.c mount_smbfs.c \
- mount_afs.c mount_autofs.c
+ mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c
-MODS = lookup_yp.so lookup_file.so lookup_program.so \
+MODS := lookup_yp.so lookup_file.so lookup_program.so \
parse_sun.so \
- mount_generic.so mount_ext2.so mount_nfs.so mount_smbfs.so \
- mount_afs.so mount_autofs.so
+ mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so
-ifdef HESIOD
+ifeq ($(EXT2FS), 1)
+ SRCS += mount_ext2.c
+ MODS += mount_ext2.so
+endif
+
+ifeq ($(SMBFS), 1)
+ SRCS += mount_smbfs.c
+ MODS += mount_smbfs.so
+endif
+
+ifeq ($(HESIOD), 1)
SRCS += lookup_hesiod.c parse_hesiod.c
MODS += lookup_hesiod.so parse_hesiod.so
endif
-ifdef NISPLUS
+ifeq ($(NISPLUS), 1)
SRCS += lookup_nisplus.c
MODS += lookup_nisplus.so
endif
-CFLAGS += -I../include -fpic -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
+CFLAGS += -I../include -fpic -DAUTOFS_LIB_DIR=\"$(autofslibdir)\" -DPATH_AUTOMOUNT=\"$(sbindir)/automount\"
all: $(MODS)
@@ -33,8 +42,8 @@ clean:
rm -f *.o *.s *.so
install: all
- install -d -m 755 $(autofslibdir)
- install -c $(MODS) -m 644 -o root $(autofslibdir)
+ install -d -m 755 $(INSTALLROOT)$(autofslibdir)
+ install -c $(MODS) -m 644 $(INSTALLROOT)$(autofslibdir)
#
# Ad hoc compilation rules for modules which need auxilliary libraries
@@ -49,6 +58,6 @@ lookup_nisplus.so: lookup_nisplus.c
$(STRIP) lookup_nisplus.so
lookup_hesiod.so: lookup_hesiod.c
- $(CC) $(SOLDFLAGS) $(CFLAGS) -I$(HESIOD)/include -o lookup_hesiod.so \
- lookup_hesiod.c $(HESIOD_LIBS)
+ $(CC) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \
+ lookup_hesiod.c $(LIBHESIOD)
$(STRIP) lookup_hesiod.so
diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c
index ed9f2e9..239fa73 100644
--- a/modules/mount_autofs.c
+++ b/modules/mount_autofs.c
@@ -76,7 +76,7 @@ int mount_mount(const char *root, const char *name, int name_len,
argv = (char **) alloca((argc+1) * sizeof(char *));
argc = 0;
- argv[argc++] = _PATH_AUTOMOUNT;
+ argv[argc++] = PATH_AUTOMOUNT;
argv[argc++] = "--submount";
argv[argc++] = fullpath;
argv[argc++] = strcpy(alloca(strlen(what)+1), what);
@@ -104,7 +104,7 @@ int mount_mount(const char *root, const char *name, int name_len,
goto error;
} else if ( slave == 0 ) {
/* Slave process */
- execv(_PATH_AUTOMOUNT, argv);
+ execv(PATH_AUTOMOUNT, argv);
_exit(255);
}
diff --git a/modules/mount_ext2.c b/modules/mount_ext2.c
index dec22d5..7b4e643 100644
--- a/modules/mount_ext2.c
+++ b/modules/mount_ext2.c
@@ -58,7 +58,7 @@ int mount_mount(const char *root, const char *name, int name_len,
}
syslog(LOG_DEBUG, MODPREFIX "calling fsck.ext2 -p %s", what);
- err = spawnl(LOG_DEBUG, _PATH_E2FSCK, _PATH_E2FSCK, "-p", what, NULL);
+ err = spawnl(LOG_DEBUG, PATH_E2FSCK, PATH_E2FSCK, "-p", what, NULL);
if ( err & ~7 ) {
syslog(LOG_ERR, MODPREFIX "%s: filesystem needs repair, won't mount",
what);
@@ -68,12 +68,12 @@ int mount_mount(const char *root, const char *name, int name_len,
if ( options ) {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s -o %s %s %s",
fstype, options, what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", fstype,
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
"-o", options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s %s %s",
fstype, what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", fstype,
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
what, fullpath, NULL);
}
if ( err ) {
diff --git a/modules/mount_generic.c b/modules/mount_generic.c
index 0c46805..8b7ce41 100644
--- a/modules/mount_generic.c
+++ b/modules/mount_generic.c
@@ -60,12 +60,12 @@ int mount_mount(const char *root, const char *name, int name_len,
if ( options ) {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s -o %s %s %s",
fstype, options, what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", fstype,
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
"-o", options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t %s %s %s",
fstype, what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", fstype,
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", fstype,
what, fullpath, NULL);
}
if ( err ) {
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
index c64af9e..a556841 100644
--- a/modules/mount_nfs.c
+++ b/modules/mount_nfs.c
@@ -147,11 +147,11 @@ int mount_mount(const char *root, const char *name, int name_len,
if ( options ) {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t nfs -o %s %s %s",
options, what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", "nfs", "-o",
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", "nfs", "-o",
options, what, fullpath, NULL);
} else {
syslog(LOG_DEBUG, MODPREFIX "calling mount -t nfs %s %s", what, fullpath);
- err = spawnl(LOG_NOTICE, _PATH_MOUNT, _PATH_MOUNT, "-t", "nfs",
+ err = spawnl(LOG_NOTICE, PATH_MOUNT, PATH_MOUNT, "-t", "nfs",
what, fullpath, NULL);
}
if ( err ) {
diff --git a/modules/mount_smbfs.c b/modules/mount_smbfs.c
index 7aec92d..811fe8d 100644
--- a/modules/mount_smbfs.c
+++ b/modules/mount_smbfs.c
@@ -151,7 +151,7 @@ int mount_mount(const char *root, const char *name, int name_len,
syslog(LOG_ERR, MODPREFIX "alloca: %m");
return 1;
}
- argv[0] = _PATH_SMBMOUNT;
+ argv[0] = PATH_SMBMOUNT;
argv[1] = what;
argv[2] = fullpath;
memcpy(optcopy, options, optsize);
@@ -163,7 +163,7 @@ int mount_mount(const char *root, const char *name, int name_len,
return 1;
}
- err = spawnv(LOG_NOTICE, _PATH_SMBMOUNT, argv);
+ err = spawnv(LOG_NOTICE, PATH_SMBMOUNT, argv);
if ( err ) {
rmdir(fullpath);