Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 224907
Collapse All | Expand All

(-)zaptel-1.4.11-original/Makefile (-21 / +30 lines)
Lines 66-85 Link Here
66
# Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support
66
# Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support
67
# if it is enabled in the kernel.
67
# if it is enabled in the kernel.
68
ifeq ($(BUILDVER),linux26)
68
ifeq ($(BUILDVER),linux26)
69
  ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d))
69
#  ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d))
70
    DYNFS=yes
70
#    DYNFS=yes
71
    UDEVRULES=yes
71
#    UDEVRULES=yes
72
  endif
72
#  endif
73
  ifeq (yes,$(HAS_KSRC))
73
  ifeq (yes,$(HAS_KSRC))
74
    HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi)
74
    HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi)
75
  endif
75
  endif
76
endif
76
endif
77
77
78
ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m))
78
#ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m))
79
  DYNFS=yes
79
#  DYNFS=yes
80
  HAS_DEVFS=yes
80
#  HAS_DEVFS=yes
81
#endif
82
83
# This is not related to the version that we build. Rather, to the 
84
# version that we runs. If we build for 2.4 using 2.4 headers on a 2.6
85
# system with udev mounted on /dev , no point in installing files to /dev
86
# because they'll be wiped at next reboot. XXX: should this be a use-flag? Perhaps: noudev?
87
DYNFS:=$(shell ps ax | grep -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
88
89
# Check for udev rules directories
90
ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d))
91
  UDEVRULES=yes
81
endif
92
endif
82
93
94
83
# If the file .zaptel.makeopts is present in your home directory, you can
95
# If the file .zaptel.makeopts is present in your home directory, you can
84
# include all of your favorite menuselect options so that every time you download
96
# include all of your favorite menuselect options so that every time you download
85
# a new version of Asterisk, you don't have to run menuselect to set them.
97
# a new version of Asterisk, you don't have to run menuselect to set them.
Lines 153-159 Link Here
153
  ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp)
165
  ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp)
154
endif
166
endif
155
167
156
OPTFLAG=-O2
168
OPTFLAGS?=-O2
157
CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
169
CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
158
ifneq (,$(findstring ppc,$(UNAME_M)))
170
ifneq (,$(findstring ppc,$(UNAME_M)))
159
CFLAGS_PPC:=-fsigned-char
171
CFLAGS_PPC:=-fsigned-char
Lines 162-168 Link Here
162
CFLAGS_x86_64:=-m64
174
CFLAGS_x86_64:=-m64
163
endif
175
endif
164
CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_x86_64)
176
CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_x86_64)
165
KFLAGS=-I$(KINCLUDES) -O6
177
KFLAGS=-I$(KINCLUDES) -O2
166
KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
178
KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
167
	-Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net
179
	-Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net
168
ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h))
180
ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h))
Lines 425-431 Link Here
425
$(UTILSO): %.o: %.c
437
$(UTILSO): %.o: %.c
426
	$(CC) $(CFLAGS) -o $@ -c $<
438
	$(CC) $(CFLAGS) -o $@ -c $<
427
439
428
install: all devices install-modules install-programs install-firmware
440
install: devices install-modules install-programs install-firmware
429
	@echo "###################################################"
441
	@echo "###################################################"
430
	@echo "###"
442
	@echo "###"
431
	@echo "### Zaptel installed successfully."
443
	@echo "### Zaptel installed successfully."
Lines 450-459 Link Here
450
462
451
# Pushing those two to a separate target that is not used by default:
463
# Pushing those two to a separate target that is not used by default:
452
install-modconf:
464
install-modconf:
453
	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
465
	install -d -m 755 $(DESTDIR)/etc/modules.d
454
	@if [ -d /etc/modutils ]; then \
466
	build_tools/genmodconf $(BUILDVER) "$(DESTDIR)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
455
		/sbin/update-modules ; \
456
	fi
457
467
458
install-firmware:
468
install-firmware:
459
ifeq ($(HOTPLUG_FIRMWARE),yes)
469
ifeq ($(HOTPLUG_FIRMWARE),yes)
Lines 463-473 Link Here
463
install-libs: libs
473
install-libs: libs
464
	$(INSTALL) -D -m 755 $(LTZ_A) $(DESTDIR)$(LIB_DIR)/$(LTZ_A)
474
	$(INSTALL) -D -m 755 $(LTZ_A) $(DESTDIR)$(LIB_DIR)/$(LTZ_A)
465
	$(INSTALL) -D -m 755 $(LTZ_SO) $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
475
	$(INSTALL) -D -m 755 $(LTZ_SO) $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
466
ifeq (,$(DESTDIR))
467
	if [ `id -u` = 0 ]; then \
476
	if [ `id -u` = 0 ]; then \
468
		/sbin/ldconfig || : ;\
477
		/sbin/ldconfig -n $(DESTDIR)$(LIB_DIR) || : ;\
469
	fi
478
	fi
470
endif
471
	rm -f $(DESTDIR)$(LIB_DIR)$(LTZ_SO)
479
	rm -f $(DESTDIR)$(LIB_DIR)$(LTZ_SO)
472
	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
480
	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
473
		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER)
481
		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER)
Lines 516-522 Link Here
516
	@echo "**** Dynamic filesystem detected -- not creating device nodes"
524
	@echo "**** Dynamic filesystem detected -- not creating device nodes"
517
  else # UDEVRULES
525
  else # UDEVRULES
518
	install -d $(DESTDIR)/etc/udev/rules.d
526
	install -d $(DESTDIR)/etc/udev/rules.d
519
	build_tools/genudevrules > $(DESTDIR)/etc/udev/rules.d/zaptel.rules
527
	build_tools/genudevrules > zaptel.rules
528
	install -D -m 644 zaptel.rules $(DESTDIR)/etc/udev/rules.d/10-zaptel.rules
520
  endif
529
  endif
521
endif
530
endif
522
531
Lines 531-544 Link Here
531
endif
540
endif
532
541
533
ifeq ($(BUILDVER),linux24)
542
ifeq ($(BUILDVER),linux24)
534
install-modules: $(INSTALL_MODULES) uninstall-modules
543
install-modules: $(INSTALL_MODULES)
535
	$(INSTALL) -d $(DESTDIR)$(MOD_DIR)
544
	$(INSTALL) -d $(DESTDIR)$(MOD_DIR)
536
	$(INSTALL) -m 644 $(INSTALL_MODULES) $(DESTDIR)$(MOD_DIR)
545
	$(INSTALL) -m 644 $(INSTALL_MODULES) $(DESTDIR)$(MOD_DIR)
537
else
546
else
538
install-modules: uninstall-modules
547
install-modules:
539
	$(KMAKE_INST)
548
	$(KMAKE_INST)
540
endif
549
endif
541
	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
550
	[ -z "$(DESTDIR)" -a `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
542
551
543
config:
552
config:
544
ifneq (,$(COPY_INITD))
553
ifneq (,$(COPY_INITD))
(-)zaptel-1.4.11-original/build_tools/genmodconf (-14 lines)
Lines 79-98 Link Here
79
79
80
echo Building ${target}...
80
echo Building ${target}...
81
81
82
if [ "${1}" = "linux24" ]; then
83
    for mod in ${3}; do
84
	if ! grep -q "post-install ${mod} " ${target}; then
85
	    echo "post-install ${mod} /sbin/ztcfg" >> ${target}
86
	fi
87
    done
88
elif [ "${1}" = "linux26" ]; then
89
    for mod in ${3}; do
90
	if ! grep -q "install ${mod} " ${target}; then
91
	    echo "install ${mod} /sbin/modprobe --ignore-install ${mod} ${cmdopts} && /sbin/ztcfg" >> ${target}
92
	fi
93
    done
94
fi
95
96
if [ -z "${combined}" ]; then
82
if [ -z "${combined}" ]; then
97
    echo "***"
83
    echo "***"
98
    echo "*** WARNING:"
84
    echo "*** WARNING:"
(-)zaptel-1.4.11-original/build_tools/genudevrules (-1 / +1 lines)
Lines 31-35 Link Here
31
KERNEL${match}"zap[0-9]*", NAME="zap/%n"
31
KERNEL${match}"zap[0-9]*", NAME="zap/%n"
32
32
33
# zaptel devices with ownership/permissions for running as non-root
33
# zaptel devices with ownership/permissions for running as non-root
34
SUBSYSTEM${match}"zaptel",  OWNER="asterisk", GROUP="asterisk", MODE="0660"
34
SUBSYSTEM${match}"zaptel",  OWNER="asterisk", GROUP="dialout", MODE="0660"
35
EOF
35
EOF

Return to bug 224907