aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile16
-rwxr-xr-xconfigure.sh14
-rw-r--r--lib/Makefile2
-rw-r--r--slattach.c1
4 files changed, 23 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 40b0862..808b018 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,9 @@ endif
# Compiler and Linker Options
# You may need to uncomment and edit these if you are using libc5 and IPv6.
COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
+ifeq ($(origin LOPTS), undefined)
LOPTS =
+endif
RESLIB = # -L/usr/inet6/lib -linet6
ifeq ($(HAVE_AFDECnet),1)
@@ -113,8 +115,10 @@ LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
SUBDIRS = man/ $(NET_LIB_PATH)/
+ifeq ($(origin CC), undefined)
CC = gcc
-LD = gcc
+endif
+LD = $(CC)
NLIB = -l$(NET_LIB_NAME)
@@ -136,15 +140,15 @@ mostlyclean:
clean: mostlyclean
rm -f $(PROGS)
- @for i in $(SUBDIRS); do (cd $$i && make clean) ; done
- @cd po && make clean
+ @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) ; done
+ @cd po && $(MAKE) clean
cleanconfig:
rm -f config.h
clobber: clean
rm -f $(PROGS) config.h version.h config.status
- @for i in $(SUBDIRS); do (cd $$i && make clobber) ; done
+ @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clobber) ; done
dist: clobber
@@ -155,8 +159,8 @@ dist: clobber
config.h: config.in Makefile
@echo "Configuring the Linux net-tools (NET-3 Base Utilities)..." ; echo
@if [ config.status -nt config.in ]; \
- then ./configure.sh <config.status; \
- else ./configure.sh <config.in; \
+ then ./configure.sh config.status; \
+ else ./configure.sh config.in; \
fi
diff --git a/configure.sh b/configure.sh
index 07e5d9e..9859b59 100755
--- a/configure.sh
+++ b/configure.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Configure.sh Generates interactively a config.h from config.in
#
@@ -43,6 +43,14 @@ MAKECONFIG=config.make
# Enable function cacheing.
set -f -h
+# set up reading of config file
+if [ "$#" != "1" ] || [ ! -f "$1" ]; then
+ echo "usage: $0 configfile" 1>&2
+ exit 1
+fi
+exec 7<$1
+config_fd_redir='<&7'
+
#
# readln reads a line into $ans.
#
@@ -51,7 +59,7 @@ set -f -h
function readln()
{
echo -n "$1"
- IFS='@' read ans </dev/tty || exit 1
+ IFS='@' read ans || exit 1
[ -z "$ans" ] && ans=$2
}
@@ -107,7 +115,7 @@ function int()
stack=''
branch='t'
- while IFS='@' read raw_input_line
+ while IFS='@' eval read raw_input_line ${config_fd_redir}
do
# Slimy hack to get bash to rescan a line.
read cmd rest <<-END_OF_COMMAND
diff --git a/lib/Makefile b/lib/Makefile
index 71daf13..39c6724 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -39,7 +39,7 @@ all: lib$(NET_LIB_NAME).a # lib$(NET_LIB_NAME).so
lib$(NET_LIB_NAME).a: Makefile $(TOPDIR)/config.h $(OBJS)
@echo Building $@
@rm -f $@
- @ar rcs $@ $(OBJS)
+ @$(AR) rcs $@ $(OBJS)
.a.so:;
$(CC) -o $@ -shared -Wl,--whole-archive -Wl,--soname -Wl,$(SONAME) -nostdlib -nostartfiles $<
diff --git a/slattach.c b/slattach.c
index 1ba2cd9..8be6907 100644
--- a/slattach.c
+++ b/slattach.c
@@ -28,6 +28,7 @@
* Foundation; either version 2 of the License, or (at
* your option) any later version.
*/
+#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>