"Fossies" - the Fresh Open Source Software Archive

Member "mrouted-3.9.8/configure" (1 Jan 2017, 4298 Bytes) of package /linux/misc/mrouted-3.9.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure": 3.9.7_vs_3.9.8.

    1 #!/bin/sh
    2 #
    3 
    4 OS=`uname`
    5 CFG=config.mk
    6 TMP=`mktemp`
    7 
    8 heading()
    9 {
   10         echo "# This makefile snippet is generated by the mrouted configure script." > $CFG
   11         echo >> $CFG
   12         echo "# Initial definitions ..." >> $CFG
   13         echo "# -D_GNU_SOURCE Use GNU extensions, where possible" >> $CFG
   14         echo "# -D_BSD_SOURCE Use functions derived from 4.3 BSD Unix rather than POSIX.1" >> $CFG
   15         echo "#               In GLIBC >= v2.20 this is replaced with -D_DEFAULT_SOURCE  " >> $CFG
   16         echo "DEFS          = -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE" >> $CFG
   17         echo "# EXTRA_OBJS  = For locally provided objects missing on some platforms, e.g., strlcpy.o"  >> $CFG
   18         echo "# EXTRA_LIBS  = For platform specific libraries, e.g., -lutil" >> $CFG
   19         echo >> $CFG
   20         echo "# $OS specific settings ..." >> $CFG
   21 }
   22 
   23 usage()
   24 {
   25         echo "Run this script to configure mrouted for your operating system."
   26         echo
   27         echo "Usage: $0 [ARG]"
   28         echo
   29         echo "  --enable-rsrr          Routing Support for Resource Reservations, for RSVP."
   30         echo "  --with-includes=PATH   Use this if the multicast header files are not in the"
   31         echo "                         standard location on your system. E.g., /sys"
   32         echo
   33         echo "Report any bugs to https://github.com/troglobit/mrouted/issues"
   34         echo
   35 
   36         exit 1
   37 }
   38 
   39 echo > $TMP
   40 echo "# Enabled features ..." >> $TMP
   41 
   42 while [ "$*" != "" ]; do
   43         opt=`expr "$1" : "--\([^=]*\)=.*"`
   44         arg=`expr "$1" : "--[^=]*=\(.*\)"`
   45         if [ -z "$opt" ]; then
   46                 opt=`expr "$1" : "--\(.*\)"`
   47         fi
   48         shift
   49 
   50         case $opt in
   51                 enable-rsrr)
   52                         echo "DEFS         += -DRSRR" >> $TMP
   53                         echo "RSRR_OBJS     = rsrr.o" >> $TMP
   54                         ;;
   55 
   56                 with-includes)
   57                         echo "INCLUDES     += -I$arg" >> $TMP
   58                         ;;
   59 
   60                 help)
   61                         usage
   62                         ;;
   63 
   64                 *)
   65                         echo "Unknown option: $opt"
   66                         usage
   67                         ;;
   68         esac
   69 done
   70 
   71 ## BSDI     -D__bsdi__ is defined by the OS
   72 #INCLUDES     =
   73 #DEFS        +=
   74 #EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o
   75 
   76 ## SunOS, OSF1, gcc
   77 #INCLUDES     =
   78 #DEFS        += -DSunOS=43
   79 #EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o
   80 
   81 ## SunOS, OSF1, cc
   82 #INCLUDES     =
   83 #DEFS        += -DSunOS=43
   84 #EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o
   85 
   86 ## IRIX
   87 #INCLUDES     =
   88 #DEFS        += -D_BSD_SIGNALS -DIRIX
   89 #EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o
   90 
   91 ## Solaris 2.5, gcc
   92 #INCLUDES     =
   93 #DEFS        += -DSUNOS5 -DSunOS=55
   94 ## Solaris 2.5, cc
   95 #INCLUDES     =
   96 #DEFS        += -DSUNOS5 -DSunOS=55
   97 ## Solaris 2.6
   98 #INCLUDES     =
   99 #DEFS        += -DSUNOS5 -DSunOS=56
  100 ## Solaris 2.x
  101 #EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o
  102 #EXTRA_LIBS   = -L/usr/ucblib -lucb -L/usr/lib -lsocket -lnsl
  103 
  104 # For uClibc based Linux systems, add -DHAVE_STRLCPY to DEFS
  105 case $OS in
  106         Linux)
  107                 heading
  108             echo "INCLUDES     =" >> $CFG
  109             echo "DEFS        += -DIOCTL_OK_ON_RAW_SOCKET" >> $CFG
  110             echo "EXTRA_OBJS   = strlcpy.o pidfile.o strtonum.o" >> $CFG
  111             echo "EXTRA_LIBS   =" >> $CFG
  112             ;;
  113 
  114         FreeBSD)
  115                 heading
  116             echo "INCLUDES     =" >> $CFG
  117             echo "DEFS        += -DHAVE_STRTONUM -DHAVE_STRLCPY" >> $CFG
  118             echo "EXTRA_OBJS   = pidfile.o" >> $CFG
  119             echo "EXTRA_LIBS   =" >> $CFG
  120             ;;
  121 
  122         NetBSD)
  123                 heading
  124             echo "INCLUDES     =" >> $CFG
  125             echo "DEFS        += -DHAVE_STRLCPY -DHAVE_PIDFILE" >> $CFG
  126             echo "EXTRA_OBJS   = strtonum.o" >> $CFG
  127             echo "EXTRA_LIBS   = -lutil" >> $CFG
  128             ;;
  129 
  130         OpenBSD)
  131                 heading
  132             echo "INCLUDES     =" >> $CFG
  133             echo "DEFS        += -DHAVE_STRTONUM -DHAVE_STRLCPY -DHAVE_PIDFILE" >> $CFG
  134             echo "EXTRA_OBJS   =" >> $CFG
  135             echo "EXTRA_LIBS   = -lutil" >> $CFG
  136             ;;
  137 
  138         *)
  139             rm $CFG
  140             echo "$OS is currently unsupported.  Help out at https://github.com/troglobit/mrouted/"
  141             exit 1
  142             ;;
  143 esac
  144 
  145 cat $TMP >> $CFG
  146 rm $TMP
  147 
  148 exit 0
  149