libgrapheme

unicode string library
git clone git://git.suckless.org/libgrapheme
Log | Files | Refs | README | LICENSE

configure (1370B)


      1 #!/bin/sh
      2 # See LICENSE file for copyright and license details.
      3 
      4 replace_line()
      5 {
      6 	VAR=$1
      7 	ALIGNMENT=$2
      8 	VALUE=$3
      9 	awk "/^${VAR}[ ]*=/ { print \"${VAR}${ALIGNMENT} = ${VALUE}\"; next }; { print; }" config.mk > config.mk.tmp
     10 	mv config.mk.tmp config.mk
     11 }
     12 
     13 case $(uname) in
     14 	DragonFly|FreeBSD|Linux|MidnightBSD|NetBSD)
     15 		# the default
     16 		replace_line 'SOFLAGS'   '  '  '-shared -nostdlib -Wl,--soname=libgrapheme.so.$(VERSION_MAJOR).$(VERSION_MINOR)'
     17 		replace_line 'SONAME'    '   ' 'libgrapheme.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)'
     18 		replace_line 'SOSYMLINK' ''    'true'
     19 		replace_line 'LDCONFIG'  ''    'ldconfig'
     20 		;;
     21 	OpenBSD)
     22 		replace_line 'SOFLAGS'   '  '  '-shared -nostdlib'
     23 		replace_line 'SONAME'    '   ' 'libgrapheme.so.$(VERSION_MAJOR).$(VERSION_MINOR)'
     24 		replace_line 'SOSYMLINK' ''    'false'
     25 		replace_line 'LDCONFIG'  ''    ''
     26 		;;
     27 	Darwin)
     28 		replace_line 'SOFLAGS'   '  '  '-dynamiclib -install_name libgrapheme.$(VERSION_MAJOR).dylib -current_version $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) -compatibility_version $(VERSION_MAJOR).$(VERSION_MINOR).0'
     29 		replace_line 'SONAME'    '   ' 'libgrapheme.$(VERSION_MAJOR).dylib'
     30 		replace_line 'SOSYMLINK' ''    'false'
     31 		replace_line 'LDCONFIG'  ''    ''
     32 		;;
     33 	*)
     34 		echo "Your system does not have a preset. Edit config.mk and send a patch please! :)"
     35 		exit 1
     36 		;;
     37 esac
     38 
     39 exit 0