# HG changeset patch # User Mychaela Falconia # Date 1716253420 0 # Node ID 2c022e0334c469d9b91858da74e08c8c5c6a9bf1 # Parent b6331ae4eea920d001132d67735c9f5a12c145e1 convert to new ThemWi configure and build system diff -r b6331ae4eea9 -r 2c022e0334c4 .hgignore --- a/.hgignore Mon Feb 22 02:19:43 2021 +0000 +++ b/.hgignore Tue May 21 01:03:40 2024 +0000 @@ -1,6 +1,7 @@ syntax: regexp \.[oa]$ +^config\.defs$ ^gen/ota-set-msisdn$ diff -r b6331ae4eea9 -r 2c022e0334c4 Makefile --- a/Makefile Mon Feb 22 02:19:43 2021 +0000 +++ b/Makefile Tue May 21 01:03:40 2024 +0000 @@ -1,6 +1,7 @@ PROGDIR=gen smswrap test LIBDIR= libutil SUBDIR= ${PROGDIR} ${LIBDIR} +DESTDIR= all: ${SUBDIR} @@ -8,14 +9,19 @@ smswrap: libutil test: libutil -${SUBDIR}: FRC +${SUBDIR}: FRC config.defs cd $@; ${MAKE} ${MFLAGS} +config.defs: + @echo 'You must run ./configure before make' + @false + clean: FRC rm -f a.out core errs for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done install: FRC - for i in ${PROGDIR}; do (cd $$i; ${MAKE} ${MFLAGS} install); done + for i in ${PROGDIR}; do (cd $$i; ${MAKE} ${MFLAGS} \ + DESTDIR=${DESTDIR} install); done FRC: diff -r b6331ae4eea9 -r 2c022e0334c4 configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure Tue May 21 01:03:40 2024 +0000 @@ -0,0 +1,68 @@ +#!/bin/sh +# This configure script is custom and hand-coded; +# it is NOT a product of GNU Autoconf or any other such tools! + +set -e + +if [ ! -f configure ] +then + echo "This script needs to be run from the top of the source tree" 1>&2 + exit 1 +fi + +# defaults that can be overridden +CC=gcc +CFLAGS=-O2 +prefix=/usr/local +exec_prefix= +bindir= + +while [ $# != 0 ] +do + case "$1" in + --prefix=*) + prefix=`echo $1 | cut -c 10-` + ;; + --exec-prefix=*) + exec_prefix=`echo $1 | cut -c 15-` + ;; + --bindir=*) + bindir=`echo $1 | cut -c 10-` + ;; + CC=*) + CC=`echo $1 | cut -c 4-` + ;; + CFLAGS=*) + CFLAGS=`echo $1 | cut -c 8-` + ;; + *) + echo "error: non-understood option $1" 1>&2 + exit 1; + ;; + esac + shift +done + +# inheritance rules for install directories + +if [ -z "$exec_prefix" ] +then + exec_prefix="$prefix" +fi +if [ -z "$bindir" ] +then + bindir="$exec_prefix/bin" +fi + +# report the final configuration + +echo "C code will be compiled with:" +echo " CC=$CC" +echo " CFLAGS=$CFLAGS" +echo "Installation directory:" +echo " bindir=$bindir" + +# emit the Makefile include fragment +echo "CC=$CC" > config.defs +echo "CFLAGS=$CFLAGS" >> config.defs +echo "bindir=$bindir" >> config.defs diff -r b6331ae4eea9 -r 2c022e0334c4 gen/Makefile --- a/gen/Makefile Mon Feb 22 02:19:43 2021 +0000 +++ b/gen/Makefile Tue May 21 01:03:40 2024 +0000 @@ -1,8 +1,7 @@ -CC= gcc -CFLAGS= -O2 PROGS= ota-set-msisdn LIBS= ../libutil/libutil.a -INSTBIN=/opt/freecalypso/bin + +include ../config.defs all: ${PROGS} @@ -10,8 +9,8 @@ ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} install: - mkdir -p ${INSTBIN} - install -c ${PROGS} ${INSTBIN} + mkdir -p ${DESTDIR}${bindir} + install -c ${PROGS} ${DESTDIR}${bindir} clean: rm -f ${PROGS} *.o diff -r b6331ae4eea9 -r 2c022e0334c4 libutil/Makefile --- a/libutil/Makefile Mon Feb 22 02:19:43 2021 +0000 +++ b/libutil/Makefile Tue May 21 01:03:40 2024 +0000 @@ -1,8 +1,8 @@ -CC= gcc -CFLAGS= -O2 OBJS= gsm7_encode.o gsm7_encode_table.o hexstdin.o hexstr.o number_encode.o LIB= libutil.a +include ../config.defs + all: ${LIB} ${LIB}: ${OBJS} diff -r b6331ae4eea9 -r 2c022e0334c4 smswrap/Makefile --- a/smswrap/Makefile Mon Feb 22 02:19:43 2021 +0000 +++ b/smswrap/Makefile Tue May 21 01:03:40 2024 +0000 @@ -1,8 +1,7 @@ -CC= gcc -CFLAGS= -O2 PROGS= ota-smswrap-sjs1 LIBS= ../libutil/libutil.a -INSTBIN=/opt/freecalypso/bin + +include ../config.defs all: ${PROGS} @@ -10,8 +9,8 @@ ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} -lcrypto install: - mkdir -p ${INSTBIN} - install -c ${PROGS} ${INSTBIN} + mkdir -p ${DESTDIR}${bindir} + install -c ${PROGS} ${DESTDIR}${bindir} clean: rm -f ${PROGS} *.o diff -r b6331ae4eea9 -r 2c022e0334c4 test/Makefile --- a/test/Makefile Mon Feb 22 02:19:43 2021 +0000 +++ b/test/Makefile Tue May 21 01:03:40 2024 +0000 @@ -1,8 +1,7 @@ -CC= gcc -CFLAGS= -O2 PROGS= ota-smspp-envelope LIBS= ../libutil/libutil.a -INSTBIN=/opt/freecalypso/bin + +include ../config.defs all: ${PROGS} @@ -10,8 +9,8 @@ ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} install: - mkdir -p ${INSTBIN} - install -c ${PROGS} ${INSTBIN} + mkdir -p ${DESTDIR}${bindir} + install -c ${PROGS} ${DESTDIR}${bindir} clean: rm -f ${PROGS} *.o