2 srcversion='1.2 (Alpha)'
4 # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5 # 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019
6 # mirabilos <m@mirbsd.org>
7 # Copyright (c) 2018, 2019
8 # mirabilos <t.glaser@tarent.de>
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions
13 # 1. Redistributions of source code must retain the above copyright
14 # notice, this list of conditions and the following disclaimer.
15 # 2. Redistributions in binary form must reproduce the above copyright
16 # notice, this list of conditions and the following disclaimer in the
17 # documentation and/or other materials provided with the distribution.
18 # 3. Neither the name of the project nor the names of its contributors
19 # may be used to endorse or promote products derived from this software
20 # without specific prior written permission.
22 # THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS “AS IS” AND
23 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 # ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
26 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 # This script is also available under The MirOS Licence.
36 # People analysing the output must whitelist conftest.c for any kind
37 # of compiler warning checks (mirtoconf is by design not quiet).
39 # Used environment documentation is at the end of this file.
42 export LC_ALL; unset LANGUAGE
44 case $ZSH_VERSION:$VERSION in
45 :zsh*) ZSH_VERSION=2 ;;
48 if test -n "${ZSH_VERSION+x}" && (emulate sh) >/dev/null 2>&1; then
53 if test -d /usr/xpg4/bin/. >/dev/null 2>&1; then
54 # Solaris: some of the tools have weird behaviour, use portable ones
55 PATH=/usr/xpg4/bin:$PATH
62 safeIFS=" $safeIFS$nl"
64 allu=QWERTYUIOPASDFGHJKLZXCVBNM
65 alll=qwertyuiopasdfghjklzxcvbnm
67 alls=______________________________________________________________
69 case `echo a | tr '\201' X` in
79 echo "For the build logs, demonstrate that /dev/null and /dev/tty exist:"
80 ls -l /dev/null /dev/tty
91 eval "$@" >vv.out 2>&1
92 sed "s
\a^
\a${_c}
\a" <vv.out
102 mgp.1|mgp.c|mgp.h) ;;
124 echo :"$@" | sed 's/^://' | tr $alll $allu
127 # clean up after ac_testrun()
131 test 0 = $fv || fr=yes
132 $e "$bi==> $fd...$ao $ui$fr$ao$fx"
136 # ac_cache label: sets f, fu, fv?=0
151 # ac_testinit label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput
152 # returns 1 if value was cached/implied, 0 otherwise: call ac_testdone
155 test x"$2" = x"!" && shift
156 test x"$2" = x"" || shift
162 if test x"$2" = x""; then
165 if test x"$2" = x"!"; then
169 eval ft=\$HAVE_`upper $2`
173 if test $fc = "$ft"; then
183 # pipe .c | ac_test[n] [!] label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput
185 if test x"$1" = x"!"; then
191 ac_testinit "$@" || return 1
193 vv ']' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN conftest.c $LIBS $ccpr"
194 test $tcfn = no && test -f a.out && tcfn=a.out
195 test $tcfn = no && test -f a.exe && tcfn=a.exe
196 test $tcfn = no && test -f conftest.exe && tcfn=conftest.exe
197 test $tcfn = no && test -f conftest && tcfn=conftest
198 if test -f $tcfn; then
204 if test $phase = u; then
205 test $ct = gcc && vscan='unrecogni[sz]ed'
206 test $ct = hpcc && vscan='unsupported'
207 test $ct = pcc && vscan='unsupported'
208 test $ct = sunpro && vscan='-e ignored -e turned.off'
210 test -n "$vscan" && grep $vscan vv.out >/dev/null 2>&1 && fv=$fr
214 ac_testnnd "$@" || return
215 rmf conftest.c conftest.o ${tcfn}* vv.out
219 # ac_ifcpp cppexpr [!] label [!] checkif[!]0 [setlabelifcheckis[!]0] useroutput
224 extern int thiswillneverbedefinedIhope(void);
225 int main(void) { return (dup(0) +
229 /* force a failure: expr is false */
230 thiswillneverbedefinedIhope()
234 test x"$1" = x"!" && shift
242 CPPFLAGS="$CPPFLAGS $*"
246 test x"$1" = x"" || fu=$1
248 test x"$2" = x"" && eval fv=\$HAVE_$fu
249 add_cppflags -DHAVE_$fu=$fv
257 # ac_flags [-] add varname cflags [text] [ldflags]
259 if test x"$1" = x"-"; then
270 test x"$ft" = x"" && ft="if $f can be used"
273 if test -n "$fl"; then
274 save_LDFLAGS=$LDFLAGS
275 LDFLAGS="$LDFLAGS $fl"
277 if test 1 = $hf; then
278 ac_testn can_$vn '' "$ft"
280 ac_testn can_$vn '' "$ft" <<-'EOF'
281 /* evil apo'stroph in comment test */
283 int main(void) { return (dup(0)); }
287 eval fv=\$HAVE_CAN_`upper $vn`
288 if test -n "$fl"; then
289 test 11 = $fa$fv || LDFLAGS=$save_LDFLAGS
291 test 11 = $fa$fv || CFLAGS=$save_CFLAGS
294 # ac_header [!] header [prereq ...]
296 if test x"$1" = x"!"; then
303 hv=`echo "$hf" | tr -d "$lfcr" | tr -c $alll$allu$alln $alls`
304 echo "/* NeXTstep bug workaround */" >x
309 echo '#if HAVE_BOTH_TIME_H' >>x
310 echo '#include <sys/time.h>' >>x
311 echo '#include <time.h>' >>x
312 echo '#elif HAVE_SYS_TIME_H' >>x
313 echo '#include <sys/time.h>' >>x
314 echo '#elif HAVE_TIME_H' >>x
315 echo '#include <time.h>' >>x
319 echo "#include <$i>" >>x
323 echo "#include <$hf>" >>x
324 echo '#include <unistd.h>' >>x
325 echo 'int main(void) { return (dup(0)); }' >>x
326 ac_testn "$hv" "" "<$hf>" <x
328 test 1 = $na || ac_cppflags
332 curdir=`pwd` srcdir=`dirname "$0" 2>/dev/null`
338 echo >&2 Source directory should not contain space or tab or newline.
339 echo >&2 Errors may occur.
342 echo Source directory must not contain single quotes.
346 CFLAGS="-DMCCF $CFLAGS"
347 add_cppflags '-Dmgp_version='\''"$(mgpversion)"'\'' -DMCPPF'
352 pkgs='imlib2 libbsd-overlay xft'
362 # checker, debug, valgrind build
364 CFLAGS="$CFLAGS -g3 -fno-builtin"
373 echo "Build.sh for MagicPoint $srcversion"
377 echo "$me: Unknown option '$i'!" >&2
381 echo "$me: Unknown option -'$last' '$i'!" >&2
388 if test -d $tfn || test -d $tfn.exe; then
389 echo "$me: Error: ./$tfn is a directory!" >&2
392 rmf a.exe* a.out* conftest.c conftest.exe* *core core.* ${tfn}* *.bc *.dbg \
393 *.ll *.o lft no x vv.out *~
395 if test -n "$CPPFLAGS"; then
396 CPPFLAGS="-I. $CPPFLAGS"
400 test -n "$LDSTATIC" && if test -n "$LDFLAGS"; then
401 LDFLAGS="$LDFLAGS $LDSTATIC"
406 if test -z "$TARGET_OS"; then
407 x=`uname -s 2>/dev/null || uname`
408 test x"$x" = x"`uname -n 2>/dev/null`" || TARGET_OS=$x
410 if test -z "$TARGET_OS"; then
411 echo "$me: Set TARGET_OS, your uname is broken!" >&2
418 ccpr='|| for _f in ${tcfn}*; do case $_f in mgp.1|mgp.c|mgp.h) ;; *) rm -f "$_f" ;; esac; done'
421 if test x"$TARGET_OS" = x"Android"; then
426 if test x"$TARGET_OS" = x"Minix"; then
428 WARNING: additional checks before running Build.sh required!
429 You can avoid these by calling Build.sh correctly, see below.
431 cat >conftest.c <<'EOF'
432 #include <sys/types.h>
434 #ifdef _NETBSD_SOURCE
442 vv ']' "${CC-cc} -E $CFLAGS $CPPFLAGS $NOWARN conftest.c | grep ct= | tr -d \\\\015 >x"
449 Warning: you set TARGET_OS to $TARGET_OS but that is ambiguous.
450 Please set it to either Minix3 or Ninix3, whereas the latter is
451 all versions of Minix with even partial NetBSD(R) userland. The
452 value determined from your compiler for the current compilation
453 (which may be wrong) is: $ct
459 Warning: you set TARGET_OS to $TARGET_OS but that is ambiguous.
460 Please set it to either Minix3 or Ninix3, whereas the latter is
461 all versions of Minix with even partial NetBSD(R) userland. The
462 proper value couldn't be determined, continue at your own risk.
468 # Configuration depending on OS revision, on OSes that need them
471 test x"$TARGET_OSREV" = x"" && TARGET_OSREV=`uname -r`
475 # Configuration depending on OS name
478 oswarn="; it is untested"
479 add_cppflags -D_ALL_SOURCE
482 oswarn="; it is untested"
483 add_cppflags -D_DARWIN_C_SOURCE
486 oswarn="; it is untested"
487 add_cppflags -D_GNU_SOURCE
490 oswarn="; it is untested"
493 *) add_cppflags -D_GNU_SOURCE ;;
497 oswarn="; it is untested"
500 *) add_cppflags -D_GNU_SOURCE ;;
504 oswarn="; it is untested"
507 add_cppflags -D_ALL_SOURCE
512 *) add_cppflags -D_GNU_SOURCE ;;
516 oswarn="; it is untested"
517 add_cppflags -D_GNU_SOURCE
520 oswarn="; it is untested"
521 add_cppflags -D_WITH_DPRINTF
522 add_cppflags -DUT_NAMESIZE=32
525 add_cppflags -D_ALL_SOURCE
528 oswarn="; it is untested"
529 # broken on this OE (from ir0nh34d)
530 : "${HAVE_STDINT_H=0}"
533 oswarn="; it is untested"
534 add_cppflags -D_NETBSD_SOURCE
535 add_cppflags -D_OPENBSD_SOURCE
538 oswarn="; it is untested"
539 add_cppflags -D_NEXT_SOURCE
540 add_cppflags -D_POSIX_SOURCE
544 oswarn="; it is untested"
546 add_cppflags -D_ALL_SOURCE
549 oswarn="; it is untested"
550 add_cppflags -D_OSF_SOURCE
551 add_cppflags -D_POSIX_C_SOURCE=200112L
552 add_cppflags -D_XOPEN_SOURCE=600
553 add_cppflags -D_XOPEN_SOURCE_EXTENDED
556 oswarn="; it is untested"
557 add_cppflags -D__NO_EXT_QNX
558 add_cppflags -D__EXT_UNIX_MISC
561 oswarn="; it is untested"
562 add_cppflags -D_BSD_SOURCE
563 add_cppflags -D__EXTENSIONS__
566 oswarn="; it is untested"
567 add_cppflags -D_GNU_SOURCE
570 oswarn="; it is untested"
572 add_cppflags -DMKSH_TYPEDEF_SSIZE_T=int
575 oswarn="; it is untested"
581 oswarn='; it may or may not work'
582 test x"$TARGET_OSREV" = x"" && TARGET_OSREV=`uname -r`
588 # this aids me in tracing FTBFSen without access to the buildd
589 $e "Hi from$ao ${bi}mgp Build.sh $srcversion$ao on:"
593 vv '|' "uname -a >&2"
596 vv '|' "hwprefs machine_type os_type os_class >&2"
598 vv '|' "system_profiler -detailLevel mini SPSoftwareDataType SPHardwareDataType >&2"
599 vv '|' "/bin/sh --version >&2"
600 vv '|' "xcodebuild -version >&2"
601 vv '|' "uname -a >&2"
602 vv '|' "sysctl kern.version hw.machine hw.model hw.memsize hw.availcpu hw.ncpu hw.cpufrequency hw.byteorder hw.cpu64bit_capable >&2"
603 vv '|' "sysctl hw.cpufrequency hw.byteorder hw.cpu64bit_capable hw.ncpu >&2"
606 vv '|' "uname -a >&2"
610 vv '|' "uname -a >&2"
611 vv '|' "/usr/sbin/sizer -v >&2"
613 SCO_SV|UnixWare|UNIX_SV)
614 vv '|' "uname -a >&2"
615 vv '|' "uname -X >&2"
618 vv '|' "uname -a >&2"
621 test -z "$oswarn" || echo >&2 "
622 Warning: MagicPoint has not yet been ported to or tested on your
623 operating system '$TARGET_OS'$oswarn. If you can provide
624 a shell account to the developer, this may improve; please
625 drop us a success or failure notice or even send in diffs,
626 at the very least, complete logs (Build.sh + make) will help.
628 $e "$bi$me: Building MagicPoint$ao ${ui}mgp $srcversion$ao on $TARGET_OS ${TARGET_OSREV}..."
631 # Start of mirtoconf checks
633 $e $bi$me: Scanning for functions... please ignore any errors.$ao
636 # Compiler: which one?
639 # - ICC defines __GNUC__ too
640 # - GCC defines __hpux too
641 # - LLVM+clang defines __GNUC__ too
642 # - nwcc defines __GNUC__ too
644 $e ... which compiler type seems to be used
645 cat >conftest.c <<'EOF'
647 #if defined(__ICC) || defined(__INTEL_COMPILER)
649 #elif defined(__xlC__) || defined(__IBMC__)
651 #elif defined(__SUNPRO_C)
653 #elif defined(__ACK__)
655 #elif defined(__BORLANDC__)
657 #elif defined(__WATCOMC__)
659 #elif defined(__MWERKS__)
661 #elif defined(__HP_cc)
663 #elif defined(__DECC) || (defined(__osf__) && !defined(__GNUC__))
667 #elif defined(__DMC__)
669 #elif defined(_MSC_VER)
671 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
673 #elif defined(__IAR_SYSTEMS_ICC__)
677 #elif defined(__PCC__)
679 #elif defined(__TenDRA__)
681 #elif defined(__TINYC__)
683 #elif defined(__llvm__) && defined(__clang__)
685 #elif defined(__NWCC__)
687 #elif defined(__GNUC__)
689 #elif defined(_COMPILER_VERSION)
693 #elif defined(__hpux) || defined(__hpua)
695 #elif defined(__ultrix)
697 #elif defined(__USLC__)
699 #elif defined(__LCC__)
701 #elif defined(MKSH_MAYBE_KENCC)
702 /* and none of the above matches */
709 #if defined(__KLIBC__) && !defined(__OS2__)
718 vv ']' "$CPP $CFLAGS $CPPFLAGS $NOWARN conftest.c | \
719 sed -n '/^ *[ce]t *= */s/^ *\([ce]t\) *= */\1=/p' | tr -d \\\\015 >x"
723 cat >conftest.c <<'EOF'
725 int main(void) { return (dup(0)); }
729 # work around "the famous ACK const bug"
730 CPPFLAGS="-Dconst= $CPPFLAGS"
733 echo >&2 'Warning: Analog Devices C++ compiler for Blackfin, TigerSHARC
734 and SHARC (21000) DSPs detected. This compiler has not yet
735 been tested for compatibility with mgp. Continue at your
736 own risk, please report success/failure to the developers.'
739 echo >&2 "Warning: Borland C++ Builder detected. This compiler might
740 produce broken executables. Continue at your own risk,
741 please report success/failure to the developers."
744 # does not work with current "ccc" compiler driver
745 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -version"
746 # one of these two works, for now
747 vv '|' "${CLANG-clang} -version"
748 vv '|' "${CLANG-clang} --version"
749 # ensure compiler and linker are in sync unless overridden
750 case $CCC_CC:$CCC_LD in
752 *:) CCC_LD=$CCC_CC; export CCC_LD ;;
756 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V"
757 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -Wl,-V conftest.c $LIBS"
760 echo >&2 "Warning: Digital Mars Compiler detected. When running under"
761 echo >&2 " UWIN, mksh tends to be unstable due to the limitations"
762 echo >&2 " of this platform. Continue at your own risk,"
763 echo >&2 " please report success/failure to the developers."
766 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
767 vv '|' 'eval echo "\`$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -dumpmachine\`" \
768 "gcc\`$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -dumpversion\`"'
771 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
774 echo >&2 'Warning: IAR Systems (http://www.iar.com) compiler for embedded
775 systems detected. This unsupported compiler has not yet
776 been tested for compatibility with mgp. Continue at your
777 own risk, please report success/failure to the developers.'
780 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V"
783 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
786 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
787 add_cppflags -D__inline__=__inline
790 echo >&2 'Warning: Metrowerks C compiler detected. This has not yet
791 been tested for compatibility with mgp. Continue at your
792 own risk, please report success/failure to the developers.'
795 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -version"
798 ccpr= # errorlevels are not reliable
801 if [[ -n $C89_COMPILER ]]; then
802 C89_COMPILER=`ntpath2posix -c "$C89_COMPILER"`
806 if [[ -n $C89_LINKER ]]; then
807 C89_LINKER=`ntpath2posix -c "$C89_LINKER"`
811 vv '|' "$C89_COMPILER /HELP >&2"
812 vv '|' "$C89_LINKER /LINK >&2"
817 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -version"
820 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -v"
823 echo >&2 'Warning: PGI detected. This unknown compiler has not yet
824 been tested for compatibility with mgp. Continue at your
825 own risk, please report success/failure to the developers.'
828 echo >&2 'Warning: sdcc (http://sdcc.sourceforge.net), the small devices
829 C compiler for embedded systems detected. This has not yet
830 been tested for compatibility with mgp. Continue at your
831 own risk, please report success/failure to the developers.'
834 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
837 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -v"
840 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V 2>&1 | \
841 grep -F -i -e version -e release"
844 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -V"
845 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -Wl,-V conftest.c $LIBS"
848 case $TARGET_OS:$TARGET_OSREV in
852 : "${HAVE_CAN_OTWO=0}${HAVE_CAN_OPTIMISE=0}"
855 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
858 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
861 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -qversion"
862 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN $LIBS -qversion=verbose"
866 test x"$ct" = x"untested" && $e "!!! detecting preprocessor failed"
869 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -v conftest.c $LIBS"
870 vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
878 # nothing special detected, don’t worry
885 $e "$bi==> which compiler type seems to be used...$ao $ui$ct$etd$ao"
886 rmf conftest.c conftest.o conftest a.out* a.exe* conftest.exe* vv.out
889 # Compiler: works as-is, with -Wno-error and -Werror
894 ac_flags 0 compiler_works '' 'if the compiler works'
895 test 1 = $HAVE_CAN_COMPILER_WORKS || exit 1
896 HAVE_COMPILER_KNOWN=0
897 test $ct = unknown || HAVE_COMPILER_KNOWN=1
898 if ac_ifcpp 'if 0' compiler_fails '' \
899 'if the compiler does not fail correctly'; then
901 : "${HAVE_CAN_DELEXE=x}"
904 CFLAGS="$CFLAGS ${ccpl}-non_shared"
905 ac_testn can_delexe compiler_fails 0 'for the -non_shared linker option' <<-'EOF'
907 int main(void) { return (dup(0)); }
911 CFLAGS="$CFLAGS ${ccpl}/DELEXECUTABLE"
912 ac_testn can_delexe compiler_fails 0 'for the /DELEXECUTABLE linker option' <<-'EOF'
914 int main(void) { return (dup(0)); }
921 test 1 = $HAVE_CAN_DELEXE || CFLAGS=$save_CFLAGS
922 ac_ifcpp 'if 0' compiler_still_fails \
923 'if the compiler still does not fail correctly' && exit 1
925 if ac_ifcpp 'ifdef __TINYC__' couldbe_tcc '!' compiler_known 0 \
926 'if this could be tcc'; then
928 CPP='cpp -D__TINYC__'
929 HAVE_COMPILER_KNOWN=1
934 save_NOWARN="${ccpc}-w"
938 # -msg_* flags not used yet, or is -w2 correct?
941 save_NOWARN="${ccpc}-w"
954 DOWARN="-diag_error 1-10000"
957 save_NOWARN="${ccpc}/w"
961 test x"$save_NOWARN" = x"" && save_NOWARN='-errwarn=%none'
962 ac_flags 0 errwarnnone "$save_NOWARN"
963 test 1 = $HAVE_CAN_ERRWARNNONE || save_NOWARN=
964 ac_flags 0 errwarnall "-errwarn=%all"
965 test 1 = $HAVE_CAN_ERRWARNALL && DOWARN="-errwarn=%all"
985 save_NOWARN=-qflag=i:e
991 test x"$save_NOWARN" = x"" && save_NOWARN=-Wno-error
992 ac_flags 0 wnoerror "$save_NOWARN"
993 test 1 = $HAVE_CAN_WNOERROR || save_NOWARN=
994 ac_flags 0 werror -Werror
995 test 1 = $HAVE_CAN_WERROR && DOWARN=-Werror
996 test $ct = icc && DOWARN="$DOWARN -wd1419"
1002 # Compiler: extra flags (-O2 -f* -W* etc.)
1004 i=`echo :"$orig_CFLAGS" | sed 's/^://' | tr -c -d $alll$allu$alln`
1005 # optimisation: only if orig_CFLAGS is empty
1006 test x"$i" = x"" && case $ct in
1013 # no special optimisation
1018 int main(void) { return (dup(0)); }
1019 #define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
1020 #define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
1021 #define pad void __IDSTRING_EXPAND(__LINE__,x)(void) { }
1023 yes pad | head -n 256 >>x
1024 ac_flags - 1 otwo -xO2 <x
1028 ac_flags 1 othree "-O3 -qstrict"
1029 test 1 = $HAVE_CAN_OTHREE || ac_flags 1 otwo -O2
1033 test 1 = $HAVE_CAN_OTWO || ac_flags 1 optimise -O
1036 # other flags: just add them if they are supported
1040 ac_flags 1 strpool "${ccpc}-d" 'if string pooling can be enabled'
1046 ac_flags 0 verb -verbose
1047 ac_flags 1 rodata -readonly_strings
1050 ac_flags 1 decl "${ccpc}-r" 'for strict prototype checks'
1051 ac_flags 1 schk "${ccpc}-s" 'for stack overflow checking'
1054 # The following tests run with -Werror (gcc only) if possible
1055 NOWARN=$DOWARN; phase=u
1056 # MagicPoint is not written in CFrustFrust!
1057 ac_flags 1 no_eh_frame -fno-asynchronous-unwind-tables
1058 ac_flags 1 fnostrictaliasing -fno-strict-aliasing
1059 ac_flags 1 fstackprotectorstrong -fstack-protector-strong
1060 test 1 = $HAVE_CAN_FSTACKPROTECTORSTRONG || \
1061 ac_flags 1 fstackprotectorall -fstack-protector-all
1062 ac_flags 1 data_abi_align -malign-data=abi
1067 # probably not needed
1068 #ac_flags 1 agcc -Agcc 'for support of GCC extensions'
1072 ac_flags 1 fnobuiltinsetmode -fno-builtin-setmode
1073 ac_flags 1 fnostrictaliasing -fno-strict-aliasing
1074 ac_flags 1 fstacksecuritycheck -fstack-security-check
1078 ac_flags 1 fullwarn -fullwarn 'for remark output support'
1081 ac_flags 1 strpool "${ccpc}/GF" 'if string pooling can be enabled'
1082 echo 'int main(void) { char test[64] = ""; return (*test); }' >x
1083 ac_flags - 1 stackon "${ccpc}/GZ" 'if stack checks can be enabled' <x
1084 ac_flags - 1 stckall "${ccpc}/Ge" 'stack checks for all functions' <x
1085 ac_flags - 1 secuchk "${ccpc}/GS" 'for compiler security checks' <x
1087 ac_flags 1 wall "${ccpc}/Wall" 'to enable all warnings'
1088 ac_flags 1 wp64 "${ccpc}/Wp64" 'to enable 64-bit warnings'
1091 #broken# ac_flags 1 ssp -stackprotect
1095 ac_flags 1 fstackprotectorall -fstack-protector-all
1101 ac_flags 1 ipo -xipo 'for cross-module optimisation'
1105 : #broken# ac_flags 1 boundschk -b
1108 ac_flags 0 ysystem -Ysystem
1109 test 1 = $HAVE_CAN_YSYSTEM && CPPFLAGS="-Ysystem $CPPFLAGS"
1110 ac_flags 1 extansi -Xa
1115 # On IBM z/OS, the following are warnings by default:
1116 # CCN3296: #include file <foo.h> not found.
1117 # CCN3944: Attribute "__foo__" is not supported and is ignored.
1118 # CCN3963: The attribute "foo" is not a valid variable attribute and is ignored.
1119 ac_flags 1 halton '-qhaltonmsg=CCN3296 -qhaltonmsg=CCN3944 -qhaltonmsg=CCN3963'
1120 # CCN3290: Unknown macro name FOO on #undef directive.
1121 # CCN4108: The use of keyword '__attribute__' is non-portable.
1122 ac_flags 1 supprss '-qsuppress=CCN3290 -qsuppress=CCN4108'
1125 ac_flags 1 rodata '-qro -qroconst -qroptr'
1126 ac_flags 1 rtcheck -qcheck=all
1127 #ac_flags 1 rtchkc -qextchk # reported broken
1128 ac_flags 1 wformat '-qformat=all -qformat=nozln'
1131 #ac_flags 1 wp64 -qwarn64 # too verbose for now
1134 # flags common to a subset of compilers (run with -Werror on gcc)
1135 if test 1 = $i; then
1136 ac_flags 1 wall -Wall
1137 ac_flags 1 fwrapv -fwrapv
1139 ac_flags 1 wformat -Wformat
1140 ac_flags 1 wextra -Wextra # temporarily
1141 ac_flags 1 woldstyledecl -Wold-style-declaration
1142 ac_flags 1 woldstyledefn -Wold-style-definition
1143 ac_flags 1 wmissingdecl -Wmissing-declarations
1144 ac_flags 1 wmissingproto -Wmissing-prototypes
1146 ac_flags 1 wnosigncompare -Wno-sign-compare
1147 # see comment in draw.c:epstoimage()
1148 ac_flags 1 wnoclobbered -Wno-clobbered
1152 # The following tests run with -Werror or similar (all compilers) if possible
1154 test $ct = pcc && phase=u
1157 # Compiler: check for stuff that only generates warnings
1159 ac_test attribute_bounded '' 'for __attribute__((__bounded__))' <<-'EOF'
1160 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1161 extern int thiswillneverbedefinedIhope(void);
1162 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1163 int main(void) { return (thiswillneverbedefinedIhope()); }
1166 #undef __attribute__
1167 int xcopy(const void *, void *, size_t)
1168 __attribute__((__bounded__(__buffer__, 1, 3)))
1169 __attribute__((__bounded__(__buffer__, 2, 3)));
1170 int main(int ac, char *av[]) { return (xcopy(av[0], av[--ac], 1)); }
1171 int xcopy(const void *s, void *d, size_t n) {
1173 * if memmove does not exist, we are not on a system
1174 * with GCC with __bounded__ attribute either so poo
1176 memmove(d, s, n); return ((int)n);
1180 ac_test attribute_format '' 'for __attribute__((__format__))' <<-'EOF'
1181 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1182 extern int thiswillneverbedefinedIhope(void);
1183 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1184 int main(void) { return (thiswillneverbedefinedIhope()); }
1186 #define fprintf printfoo
1188 #undef __attribute__
1190 extern int fprintf(FILE *, const char *format, ...)
1191 __attribute__((__format__(__printf__, 2, 3)));
1192 int main(int ac, char *av[]) { return (fprintf(stderr, "%s%d", *av, ac)); }
1195 ac_test attribute_nonnull '' 'for __attribute__((__nonnull__))' <<-'EOF'
1196 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1197 extern int thiswillneverbedefinedIhope(void);
1198 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1199 int main(void) { return (thiswillneverbedefinedIhope()); }
1202 #undef __attribute__
1203 int fnord(const char *) __attribute__((__nonnull__(1)));
1204 int main(void) { return (fnord("x")); }
1205 int fnord(const char *x) { return (fputc(*x, stderr)); }
1208 ac_test attribute_noreturn '' 'for __attribute__((__noreturn__))' <<-'EOF'
1209 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1210 extern int thiswillneverbedefinedIhope(void);
1211 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1212 int main(void) { return (thiswillneverbedefinedIhope()); }
1215 #undef __attribute__
1216 void fnord(void) __attribute__((__noreturn__));
1217 int main(void) { fnord(); }
1218 void fnord(void) { exit(0); }
1221 ac_test attribute_pure '' 'for __attribute__((__pure__))' <<-'EOF'
1222 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1223 extern int thiswillneverbedefinedIhope(void);
1224 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1225 int main(void) { return (thiswillneverbedefinedIhope()); }
1228 #undef __attribute__
1229 int foo(const char *) __attribute__((__pure__));
1230 int main(int ac, char *av[]) { return (foo(av[ac - 1]) + dup(0)); }
1231 int foo(const char *s) { return ((int)s[0]); }
1234 ac_test attribute_unused '' 'for __attribute__((__unused__))' <<-'EOF'
1235 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1236 extern int thiswillneverbedefinedIhope(void);
1237 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1238 int main(void) { return (thiswillneverbedefinedIhope()); }
1241 #undef __attribute__
1242 int main(int ac __attribute__((__unused__)), char *av[]
1243 __attribute__((__unused__))) { return (dup(0)); }
1246 ac_test attribute_used '' 'for __attribute__((__used__))' <<-'EOF'
1247 #if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
1248 extern int thiswillneverbedefinedIhope(void);
1249 /* force a failure: TenDRA and gcc 1.42 have false positive here */
1250 int main(void) { return (thiswillneverbedefinedIhope()); }
1253 #undef __attribute__
1254 static const char fnord[] __attribute__((__used__)) = "42";
1255 int main(void) { return (dup(0)); }
1259 # End of tests run with -Werror
1263 add_cppflags -DNeedFunctionPrototypes
1266 # Environment: headers
1268 ac_header sys/time.h sys/types.h
1269 ac_header time.h sys/types.h
1270 test "11" = "$HAVE_SYS_TIME_H$HAVE_TIME_H" || HAVE_BOTH_TIME_H=0
1271 ac_test both_time_h '' 'whether <sys/time.h> and <time.h> can both be included' <<-'EOF'
1272 #include <sys/types.h>
1273 #include <sys/time.h>
1276 int main(void) { struct tm tm; return ((int)sizeof(tm) + dup(0)); }
1278 ac_header sys/wait.h sys/types.h
1286 # Environment: definitions
1288 echo '#include <sys/types.h>
1291 /* check that off_t can represent 2^63-1 correctly, thx FSF */
1292 #define LARGE_OFF_T ((((off_t)1 << 31) << 31) - 1 + (((off_t)1 << 31) << 31))
1293 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
1294 LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
1295 int main(void) { return (dup(0)); }' >lft.c
1296 ac_testn can_lfs '' "for large file support" <lft.c
1297 save_CPPFLAGS=$CPPFLAGS
1298 add_cppflags -D_FILE_OFFSET_BITS=64
1299 ac_testn can_lfs_sus '!' can_lfs 0 "... with -D_FILE_OFFSET_BITS=64" <lft.c
1300 if test 0 = $HAVE_CAN_LFS_SUS; then
1301 CPPFLAGS=$save_CPPFLAGS
1302 add_cppflags -D_LARGE_FILES=1
1303 ac_testn can_lfs_aix '!' can_lfs 0 "... with -D_LARGE_FILES=1" <lft.c
1304 test 1 = $HAVE_CAN_LFS_AIX || CPPFLAGS=$save_CPPFLAGS
1307 rmf lft* # end of large file support test
1311 for pkg in $pkgs; do
1312 $e Running pkg-config for $pkg...
1313 PK_DEFS="$PK_DEFS `pkg-config --cflags $pkg`"
1314 PK_LIBS="$PK_LIBS `pkg-config --libs $pkg`"
1318 # Environment: types
1320 ac_test can_uchar '' "for u_char" <<-'EOF'
1321 #include <sys/types.h>
1323 int main(int ac, char *av[]) { return ((u_char)(unsigned char)av[ac - 1][0]); }
1325 ac_test can_ushort '' "for u_short" <<-'EOF'
1326 #include <sys/types.h>
1328 int main(int ac, char *av[]) { return ((u_short)(unsigned char)av[ac - 1][0]); }
1330 ac_test can_uint '' "for u_int" <<-'EOF'
1331 #include <sys/types.h>
1333 int main(int ac, char *av[]) { return ((u_int)(unsigned char)av[ac - 1][0]); }
1335 ac_test can_ulong '' "for u_long" <<-'EOF'
1336 #include <sys/types.h>
1338 int main(int ac, char *av[]) { return ((u_long)(size_t)av[ac]); }
1342 # check whether the final link ought to succeed
1345 save_CPPFLAGS=$CPPFLAGS
1347 CPPFLAGS="-I$srcdir $CPPFLAGS $PK_DEFS -DBUILDSH_LINKTEST"
1348 LIBS="$LIBS $PK_LIBS"
1349 ac_testinit link_works '' 'checking if the final link command may succeed'
1351 cat >conftest.c <<-EOF
1358 #include <termios.h>
1361 int main(void) { printf("Hello, World!\\n"); return (dup(0)); }
1363 v "$CC $CFLAGS $CPPFLAGS $NOWARN -c conftest.c" || fv=0
1364 test $fv = 0 || v "$CC $CFLAGS $LDFLAGS -o $tcfn conftest.o $LIBS $ccpr"
1365 test -f $tcfn || fv=0
1367 test $fv = 1 || exit 1
1369 CPPFLAGS=$save_CPPFLAGS
1372 # Environment: library functions
1380 int main(int ac, char *av[]) {
1382 char *srcp = av[1], *dstp = av[2];
1383 size_t ilen = strlen(srcp), olen = ac;
1385 if ((cd = iconv_open("dst", "src")) == (iconv_t)-1)
1387 if (iconv(cd, &srcp, &ilen, &dstp, &olen) == (size_t)-1)
1389 return (iconv_close(cd) != 0);
1392 ac_testn iconv '' 'iconv (no extra libraries)' <lft.c
1394 if test 0 = $HAVE_ICONV; then
1396 LIBS="$LIBS -liconv"
1398 ac_testn iconv '' 'iconv (with libiconv)' <lft.c
1399 if test 1 = $HAVE_ICONV; then
1408 ac_test setlocale_ctype locale_h 0 'setlocale(LC_CTYPE, "")' <<-'EOF'
1411 int main(void) { return ((int)(size_t)(void *)setlocale(LC_CTYPE, "")); }
1414 ac_test setreuid '' 'for setreuid and setregid' <<-'EOF'
1415 #include <sys/types.h>
1417 int main(void) { return (setreuid(0,0) + setregid(0,0)); }
1422 ac_test uu_lock <<-'EOF'
1423 #include <sys/types.h>
1427 int main(int ac, char *av[]) { return (uu_lock(av[ac - 1])); }
1430 if test 0 = $HAVE_UU_LOCK; then
1439 # check headers for declarations
1447 # End of mirtoconf checks
1452 test 1 = "$HAVE_CAN_VERB" && CFLAGS="$CFLAGS -verbose"
1454 $e $bi$me: Finished configuration testing, now producing output.$ao
1465 cat >Makefile~ <<\EOF
1466 # Makefile for building MagicPoint
1467 # generated, do not edit; re-run Build.sh if necessary!
1469 # feel free to override those
1479 # used for installing
1481 PERL= /usr/bin/env perl
1485 BINDIR= $(PREFIX)/bin
1486 MANDIR= $(PREFIX)/share/man
1487 DOCDIR= $(PREFIX)/share/doc/mgp
1488 EMACSDIR= $(PREFIX)/share/emacs/site-lisp/mgp
1489 MGPELDIR= $(DOCDIR)/contrib/mgp-el
1490 #SAMPLEDIR= $(DOCDIR)/examples
1491 SAMPLEDIR= $(PREFIX)/share/examples/mgp
1492 RCDIR= $(SYSCONFDIR)/mgp
1494 # set to empty to not install (Debian)
1495 INST_LICENCE= LICENCE
1496 INST_RELNOTES= RELNOTES
1498 # or /usr/ucb/install
1506 INSTALL_DIR= $(INSTALL) -d -m $(DIRMODE)
1507 INSTALL_PROGRAM=$(INSTALL) $(INSTALL_COPY) $(INSTALL_STRIP) -m $(BINMODE)
1508 INSTALL_SCRIPT= $(INSTALL) $(INSTALL_COPY) -m $(BINMODE)
1509 INSTALL_DATA= $(INSTALL) $(INSTALL_COPY) -m $(NONBINMODE)
1510 INSTALL_CONF= $(INSTALL) $(INSTALL_COPY) -m $(CONFMODE)
1512 # do NOT override these, re-run Build.sh if necessary!
1514 sed 's/#/\\&/g' >>Makefile~ <<EOF
1528 mgpversion= $srcversion
1530 cat >>Makefile~ <<\EOF
1533 MAN1= $(SRCDIR)/contrib/xmindpath/xmindpath.1 \
1534 $(SRCDIR)/contrib/xwintoppm/xwintoppm.1 \
1535 $(SRCDIR)/contrib/eqn2eps.1 \
1536 $(SRCDIR)/contrib/mgp2html.1 \
1537 $(SRCDIR)/contrib/mgpnet.1 \
1538 $(SRCDIR)/mgp.1 $(SRCDIR)/mgp2ps.1
1539 MAN1LINKS= 'eqn2eps.1 latex2eps.1' \
1540 'eqn2eps.1 tex2eps.1' \
1541 'mgp2html.1 mgp2latex.1'
1543 xmp_DEFS= -I$(SRCDIR)/contrib/xmindpath
1544 xmp_OBJS= main.o $(uulock_O)
1545 xmp_LIBS= -lXtst -lX11 $(uulock_L)
1547 xwp_DEFS= -I$(SRCDIR)/contrib/xwintoppm
1548 xwp_OBJS= dsimple.o list.o multiVis.o xwintoppm.o
1549 xwp_LIBS= -lXmu -lXt -lX11
1551 mgp_DEFS= -I$(SRCDIR) -DMGPLIBDIR=\"$(RCDIR)\" $(PK_DEFS)
1552 mgp_LIBS= -L. -lmgpcommon $(PK_LIBS) $(iconv_L) -lX11 -lm
1554 lib_DEFS= $(mgp_DEFS) -I$(SRCDIR)/image
1555 lib_OBJS= ctlwords.o \
1556 dither.o halftone.o imagetypes.o imlib_loader.o \
1557 misc.o new.o path.o reduce.o send.o value.o zoom.o \
1558 background.o draw.o globals.o y.tab.o parse.o \
1559 plist.o postscript.o lex.yy.o unimap.o
1561 mgp_OBJS= mgp.o x11.o
1562 mps_OBJS= print.o x11dummy.o
1564 all: mgp$E mgp2ps$E xmindpath$E xwintoppm$E mgp2html mgp2latex mgpnet
1566 # also builds ctlwords.h and ctlwords.pl
1567 ctlwords.c: $(SRCDIR)/ctlwords.sh
1568 $(SH) $(SRCDIR)/ctlwords.sh
1570 mgp2html: ctlwords.c $(SRCDIR)/contrib/mgp2html.pl.in
1571 echo '#!$(PERL)' | cat >$@ - ctlwords.pl \
1572 $(SRCDIR)/contrib/mgp2html.pl.in
1574 mgp2latex: ctlwords.c $(SRCDIR)/contrib/mgp2latex.pl.in
1575 echo '#!$(PERL)' | cat >$@ - ctlwords.pl \
1576 $(SRCDIR)/contrib/mgp2latex.pl.in
1578 mgpnet: ctlwords.c $(SRCDIR)/contrib/mgpnet.in
1579 echo '#!$(PERL)' | cat >$@ - ctlwords.pl \
1580 $(SRCDIR)/contrib/mgpnet.in
1582 xmindpath$E: $(xmp_OBJS)
1583 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(xmp_OBJS) $(LIBS) $(xmp_LIBS)
1585 xwintoppm$E: $(xwp_OBJS)
1586 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(xwp_OBJS) $(LIBS) $(xwp_LIBS)
1588 mgp$E: $(mgp_OBJS) libmgpcommon.a
1589 $(CC) $(CFLAGS) $(mgp_DEFS) $(LDFLAGS) -o $@ \
1590 $(mgp_OBJS) $(LIBS) $(mgp_LIBS)
1592 mgp2ps$E: $(mps_OBJS) libmgpcommon.a
1593 $(CC) $(CFLAGS) $(mgp_DEFS) $(LDFLAGS) -o $@ \
1594 $(mps_OBJS) $(LIBS) $(mgp_LIBS)
1596 libmgpcommon.a: $(lib_OBJS)
1598 $(AR_CREATE) $@ $(lib_OBJS)
1601 # also builds y.tab.h
1602 y.tab.c: $(SRCDIR)/grammar.y
1603 $(YACC) -d $(SRCDIR)/grammar.y
1605 lex.yy.c: $(SRCDIR)/scanner.l
1606 $(LEX) $(SRCDIR)/scanner.l
1610 dstbn=`basename "$1" | sed 's/\.[^.]*$//'`
1613 while test -n "$1"; do
1614 if test -f "$srcdir/$1"; then
1620 if test -n "$srcf"; then
1627 cat >>Makefile~ <<EOF
1629 \$(CC) \$(CPPFLAGS) \$(CFLAGS) $defs -c $srcf
1633 xlih="image/xloadimage.h image/image.h"
1634 mgph="mgp.h $xlih ctlwords.c" # ctlwords.h but that breaks parallel gmake
1636 dofile contrib/xmindpath/main.c
1637 dofile contrib/xmindpath/uucplock.c contrib/xmindpath/pathnames.h
1639 dofile contrib/xwintoppm/dsimple.c contrib/xwintoppm/dsimple.h
1640 dofile contrib/xwintoppm/list.c contrib/xwintoppm/list.h
1641 dofile contrib/xwintoppm/multiVis.c contrib/xwintoppm/list.h \
1642 contrib/xwintoppm/wsutils.h contrib/xwintoppm/multiVis.h
1643 dofile contrib/xwintoppm/xwintoppm.c contrib/xwintoppm/dsimple.h \
1644 contrib/xwintoppm/list.h \
1645 contrib/xwintoppm/wsutils.h contrib/xwintoppm/multiVis.h
1649 dofile image/dither.c image/image.h
1650 dofile image/halftone.c image/image.h
1651 dofile image/imagetypes.c $xlih
1652 dofile image/imlib_loader.c $xlih
1653 dofile image/misc.c image/image.h
1654 dofile image/new.c image/image.h
1655 dofile image/path.c $xlih
1656 dofile image/reduce.c image/image.h
1657 dofile image/send.c $mgph
1658 dofile image/value.c image/image.h
1659 dofile image/zoom.c image/image.h
1661 dofile background.c $mgph
1663 dofile globals.c $mgph
1664 dofile y.tab.c $mgph
1665 dofile parse.c $mgph
1666 dofile plist.c $mgph
1667 dofile postscript.c $mgph
1668 dofile lex.yy.c $mgph y.tab.c # y.tab.h but that breaks parallel gmake
1669 dofile unimap.c $mgph
1672 dofile print.c $mgph
1673 dofile x11dummy.c $mgph
1674 cat >>Makefile~ <<\EOF
1675 INSTALL_SYSCONFIG=install-sysconfig
1676 install: install-program $(INSTALL_SYSCONFIG)
1678 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
1679 $(INSTALL_PROGRAM) mgp $(DESTDIR)$(BINDIR)/
1680 $(INSTALL_PROGRAM) mgp2ps $(DESTDIR)$(BINDIR)/
1681 $(INSTALL_PROGRAM) xmindpath $(DESTDIR)$(BINDIR)/
1682 $(INSTALL_PROGRAM) xwintoppm $(DESTDIR)$(BINDIR)/
1683 $(INSTALL_SCRIPT) $(SRCDIR)/contrib/eqn2eps.sh \
1684 $(DESTDIR)$(BINDIR)/eqn2eps
1685 $(INSTALL_SCRIPT) $(SRCDIR)/contrib/latex2eps.sh \
1686 $(DESTDIR)$(BINDIR)/latex2eps
1687 $(INSTALL_SCRIPT) mgp2html $(DESTDIR)$(BINDIR)/
1688 $(INSTALL_SCRIPT) mgp2latex $(DESTDIR)$(BINDIR)/
1689 $(INSTALL_SCRIPT) mgpnet $(DESTDIR)$(BINDIR)/
1690 $(INSTALL_SCRIPT) $(SRCDIR)/contrib/tex2eps.sh \
1691 $(DESTDIR)$(BINDIR)/tex2eps
1692 $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1
1693 $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MANDIR)/man1/
1694 cd $(DESTDIR)$(MANDIR)/man1/ && for link in $(MAN1LINKS); do \
1695 $(LINKMANPAGE) $$link || exit 1; \
1697 $(INSTALL_DIR) $(DESTDIR)$(EMACSDIR)
1698 cd $(SRCDIR)/contrib && $(INSTALL_DATA) \
1699 mgp-el/mgp.el mgp-mode-cd.el mgp-mode.el mgp-mode20.el \
1700 $(DESTDIR)$(EMACSDIR)/
1701 $(INSTALL_DIR) $(DESTDIR)$(MGPELDIR)
1702 cd $(SRCDIR)/contrib/mgp-el && $(INSTALL_DATA) \
1703 README mgp.sty $(DESTDIR)$(MGPELDIR)/
1704 $(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
1705 cd $(SRCDIR) && $(INSTALL_DATA) FAQ README README.fonts README.lang \
1706 README.xft SYNTAX TODO.jp USAGE USAGE.jp $(INST_LICENCE) \
1707 $(INST_RELNOTES) $(DESTDIR)$(DOCDIR)/
1708 $(INSTALL_DIR) $(DESTDIR)$(SAMPLEDIR)
1709 cd $(SRCDIR)/sample && $(INSTALL_DATA) \
1710 README README.jp cloud.jpg dad.eps dad.jpg default.mgp \
1711 gradation-jp.mgp gradation.mgp mgp-old1.jpg mgp-old2.jpg \
1712 mgp-old3.jpg mgp-print6 mgp1.jpg mgp2.jpg mgp3.jpg mgp3.xbm \
1713 multilingual.mgp sample-fr.mgp sample-jp-xft.mgp sample-jp.mgp \
1714 sample.mgp sendmail6-jp.mgp sendmail6.mgp tutorial-jp.mgp \
1715 tutorial.mgp utf8test.mgp v6-jp.mgp v6.mgp v6header.* \
1716 $(DESTDIR)$(SAMPLEDIR)/
1719 $(INSTALL_DIR) $(DESTDIR)$(RCDIR)
1720 $(INSTALL_CONF) $(SRCDIR)/sample/default.mgp $(DESTDIR)$(RCDIR)/
1723 rm -f *~ *.a *.o ctlwords.c ctlwords.h ctlwords.pl lex.yy.c y.tab.* \
1724 mgp$E mgp2ps$E xmindpath$E xwintoppm$E mgp2html mgp2latex mgpnet \
1727 mv Makefile~ Makefile || exit 1
1729 $e Generated Makefile successfully.
1731 You can now use make(1) to compile MagicPoint.
1739 -P list: set list of pkg-config query targets,
1740 default: imlib2 libbsd-overlay xft
1742 === Environment used ===
1744 ==== Makefile variables ====
1745 AR_CREATE default: $(AR) cq; AR=ar
1746 RANLIB default: ranlib; could be :
1749 SH POSIX shell to use during build
1750 DESTDIR prefix to use while installing
1751 PERL written to shebang
1752 PREFIX default: /usr
1753 SYSCONFDIR default: /etc
1754 INSTALL_STRIP default: -s
1755 mgpversion may be overridden with package version
1757 ==== build environment ====
1759 CFLAGS if empty, defaults to -xO2 or +O2
1760 or -O3 -qstrict or -O2, per compiler
1761 CPPFLAGS default empty
1762 LDFLAGS default empty; added before sources
1763 LDSTATIC set this to '-static'; default unset
1764 LIBS default empty; added after sources
1765 NOWARN -Wno-error or similar
1766 TARGET_OS default: $(uname -s || uname)
1767 TARGET_OSREV [SCO] default: $(uname -r)
1769 ===== general format =====
1771 HAVE_STRING_H ac_header
1772 HAVE_CAN_FSTACKPROTECTORALL ac_flags
1774 ==== cpp definitions ====
1775 MKSH_TYPEDEF_SSIZE_T define to e.g. 'long' if your OS has no ssize_t
1777 === generic installation instructions ===
1779 Set CC and possibly CFLAGS, CPPFLAGS, LDFLAGS, LIBS. If cross-compiling,
1780 also set TARGET_OS. To disable tests, set e.g. HAVE_STRLCPY=0; to enable
1781 them, set to a value other than 0 or 1 (e.g. to x).
1783 Normally, the following command is what you want to run, then:
1784 $ (sh Build.sh && make && sudo make install) 2>&1 | tee log