Skip to content

Commit

Permalink
Portability/cross-compile fixes from Chris G. Demetriou
Browse files Browse the repository at this point in the history
  • Loading branch information
philb committed Aug 26, 1999
1 parent 9c98aff commit 07e941d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand All @@ -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
Expand All @@ -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


Expand Down
14 changes: 11 additions & 3 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Configure.sh Generates interactively a config.h from config.in
#
Expand Down Expand Up @@ -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.
#
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<
Expand Down
1 change: 1 addition & 0 deletions slattach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 07e941d

Please sign in to comment.