xref: /aosp_15_r20/external/libcups/scripts/makecups (revision 5e7646d21f1134fb0638875d812ef646c12ab91e)
1*5e7646d2SAndroid Build Coastguard Worker#!/bin/sh
2*5e7646d2SAndroid Build Coastguard Worker#
3*5e7646d2SAndroid Build Coastguard Worker# Script to configure and make CUPS with the standard build options.  When no
4*5e7646d2SAndroid Build Coastguard Worker# targets are specified, the "clean" and "check" targets are used.
5*5e7646d2SAndroid Build Coastguard Worker#
6*5e7646d2SAndroid Build Coastguard Worker# Usage:
7*5e7646d2SAndroid Build Coastguard Worker#
8*5e7646d2SAndroid Build Coastguard Worker#   scripts/makecups [configure option(s)] [make target(s)]
9*5e7646d2SAndroid Build Coastguard Worker#
10*5e7646d2SAndroid Build Coastguard Worker
11*5e7646d2SAndroid Build Coastguard Worker# Scan the command-line arguments...
12*5e7646d2SAndroid Build Coastguard Workerconfopts="--enable-debug --enable-debug-guards --enable-debug-printfs --enable-sanitizer --enable-unit-tests"
13*5e7646d2SAndroid Build Coastguard Workermakeopts=""
14*5e7646d2SAndroid Build Coastguard Worker
15*5e7646d2SAndroid Build Coastguard Workerwhile test $# -gt 0; do
16*5e7646d2SAndroid Build Coastguard Worker	opt="$1"
17*5e7646d2SAndroid Build Coastguard Worker	shift
18*5e7646d2SAndroid Build Coastguard Worker
19*5e7646d2SAndroid Build Coastguard Worker	case "$opt" in
20*5e7646d2SAndroid Build Coastguard Worker		-*)
21*5e7646d2SAndroid Build Coastguard Worker			confopts="$confopts $opt"
22*5e7646d2SAndroid Build Coastguard Worker			;;
23*5e7646d2SAndroid Build Coastguard Worker		*)
24*5e7646d2SAndroid Build Coastguard Worker			makeopts="$makeopts $opt"
25*5e7646d2SAndroid Build Coastguard Worker			;;
26*5e7646d2SAndroid Build Coastguard Worker	esac
27*5e7646d2SAndroid Build Coastguard Workerdone
28*5e7646d2SAndroid Build Coastguard Worker
29*5e7646d2SAndroid Build Coastguard Workerif test "x$makeopts" = x; then
30*5e7646d2SAndroid Build Coastguard Worker	makeopts="clean check"
31*5e7646d2SAndroid Build Coastguard Workerfi
32*5e7646d2SAndroid Build Coastguard Worker
33*5e7646d2SAndroid Build Coastguard Workercase "`uname`" in
34*5e7646d2SAndroid Build Coastguard Worker	Darwin)
35*5e7646d2SAndroid Build Coastguard Worker		makeopts="-j`sysctl -n hw.activecpu` $makeopts"
36*5e7646d2SAndroid Build Coastguard Worker		;;
37*5e7646d2SAndroid Build Coastguard Worker	Linux*)
38*5e7646d2SAndroid Build Coastguard Worker		ASAN_OPTIONS="leak_check_at_exit=false"; export ASAN_OPTIONS
39*5e7646d2SAndroid Build Coastguard Worker		;;
40*5e7646d2SAndroid Build Coastguard Workeresac
41*5e7646d2SAndroid Build Coastguard Worker
42*5e7646d2SAndroid Build Coastguard Worker# Run the configure script...
43*5e7646d2SAndroid Build Coastguard Workerecho ./configure $confopts
44*5e7646d2SAndroid Build Coastguard Worker./configure $confopts || exit 1
45*5e7646d2SAndroid Build Coastguard Worker
46*5e7646d2SAndroid Build Coastguard Worker# Build the software...
47*5e7646d2SAndroid Build Coastguard Workerecho make $makeopts
48*5e7646d2SAndroid Build Coastguard Workermake $makeopts
49