1*0a6a1f1dSLionel Sambuc#! /bin/sh 2*0a6a1f1dSLionel Sambuc 3*0a6a1f1dSLionel Sambuc# $NetBSD: configure,v 1.1 2014/03/09 00:15:45 agc Exp $ 4*0a6a1f1dSLionel Sambuc 5*0a6a1f1dSLionel Sambuc# Copyright (c) 2013 Alistair Crooks <agc@NetBSD.org> 6*0a6a1f1dSLionel Sambuc# All rights reserved. 7*0a6a1f1dSLionel Sambuc# 8*0a6a1f1dSLionel Sambuc# Redistribution and use in source and binary forms, with or without 9*0a6a1f1dSLionel Sambuc# modification, are permitted provided that the following conditions 10*0a6a1f1dSLionel Sambuc# are met: 11*0a6a1f1dSLionel Sambuc# 1. Redistributions of source code must retain the above copyright 12*0a6a1f1dSLionel Sambuc# notice, this list of conditions and the following disclaimer. 13*0a6a1f1dSLionel Sambuc# 2. Redistributions in binary form must reproduce the above copyright 14*0a6a1f1dSLionel Sambuc# notice, this list of conditions and the following disclaimer in the 15*0a6a1f1dSLionel Sambuc# documentation and/or other materials provided with the distribution. 16*0a6a1f1dSLionel Sambuc# 17*0a6a1f1dSLionel Sambuc# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18*0a6a1f1dSLionel Sambuc# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19*0a6a1f1dSLionel Sambuc# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20*0a6a1f1dSLionel Sambuc# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21*0a6a1f1dSLionel Sambuc# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22*0a6a1f1dSLionel Sambuc# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23*0a6a1f1dSLionel Sambuc# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24*0a6a1f1dSLionel Sambuc# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25*0a6a1f1dSLionel Sambuc# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26*0a6a1f1dSLionel Sambuc# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27*0a6a1f1dSLionel Sambuc# 28*0a6a1f1dSLionel Sambuc 29*0a6a1f1dSLionel Sambuc# set up defs and paths, etc 30*0a6a1f1dSLionel Sambucprefix=/usr/local 31*0a6a1f1dSLionel Sambucmandir=${prefix}/man 32*0a6a1f1dSLionel Sambucwhile [ $# -gt 0 ]; do 33*0a6a1f1dSLionel Sambuc case "$1" in 34*0a6a1f1dSLionel Sambuc --prefix=*) prefix=$(echo "$1" | sed -e 's|--prefix=||') ;; 35*0a6a1f1dSLionel Sambuc --mandir=*) mandir=$(echo "$1" | sed -e 's|--mandir=||') ;; 36*0a6a1f1dSLionel Sambuc --build=*|--host=*|--infodir=*) ;; 37*0a6a1f1dSLionel Sambuc *) break ;; 38*0a6a1f1dSLionel Sambuc esac 39*0a6a1f1dSLionel Sambuc shift 40*0a6a1f1dSLionel Sambucdone 41*0a6a1f1dSLionel Sambuc 42*0a6a1f1dSLionel Sambucrm -f config.h 43*0a6a1f1dSLionel Sambucecho "#ifndef CONFIG_H_" > config.h 44*0a6a1f1dSLionel Sambucecho "#define CONFIG_H_ $(date '+%Y%m%d')" >> config.h 45*0a6a1f1dSLionel Sambucecho "" >> config.h 46*0a6a1f1dSLionel Sambuc 47*0a6a1f1dSLionel Sambuc# portability macros 48*0a6a1f1dSLionel Sambucecho "#ifndef __UNCONST" >> config.h 49*0a6a1f1dSLionel Sambucecho "#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))" >> config.h 50*0a6a1f1dSLionel Sambucecho "#endif /* __UNCONST */" >> config.h 51*0a6a1f1dSLionel Sambucecho "" >> config.h 52*0a6a1f1dSLionel Sambucecho "#ifndef USE_ARG" >> config.h 53*0a6a1f1dSLionel Sambucecho "#define USE_ARG(x) /*LINTED*/(void)&(x)" >> config.h 54*0a6a1f1dSLionel Sambucecho "#endif /* USE_ARG */" >> config.h 55*0a6a1f1dSLionel Sambuc 56*0a6a1f1dSLionel Sambucecho "" >> config.h 57*0a6a1f1dSLionel Sambucecho "#endif /* CONFIG_H_ */" >> config.h 58*0a6a1f1dSLionel Sambuc 59*0a6a1f1dSLionel Sambucfor f in Makefile.in; do 60*0a6a1f1dSLionel Sambuc sed -e 's|@PREFIX@|'${prefix}'|g' \ 61*0a6a1f1dSLionel Sambuc -e 's|@MANDIR@|'${mandir}'|g' $f > $(basename $f .in) 62*0a6a1f1dSLionel Sambucdone 63*0a6a1f1dSLionel Sambuc 64*0a6a1f1dSLionel Sambucexit 0 65