ObjFW  Check-in [15dc72eb33]

Overview
Comment:configure: Use awk to find strings in binaries

QNX's grep doesn't support searching in binary files.

BusyBox's tr doesn't support -dc '[:print:]' to remove non-printable
characters from a binary.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 15dc72eb3379493266a5f5680f4ea695e94563cc77f6e362588de8f0beb46726
User & Date: js on 2024-04-14 21:28:02
Other Links: manifest | tags
Context
2024-04-14
22:59
configure: Use sed | grep instead of awk check-in: 22b11fa7e8 user: js tags: trunk
21:28
configure: Use awk to find strings in binaries check-in: 15dc72eb33 user: js tags: trunk
18:55
OFFileIRIHandler: Fix missing variable on Haiku check-in: 51dfaf9042 user: js tags: trunk
Changes

Modified configure.ac from [ddd2b4c359] to [38175aae93].

149
150
151
152
153
154
155

156
157
158
159
160
161
162
*)
	potential_compilers="clang egcc gcc"
	;;
esac
AC_PROG_OBJC($potential_compilers)
AC_PROG_OBJCPP
AC_PROG_EGREP

AC_PROG_LN_S

BUILDSYS_CHECK_IOS

AC_ARG_WITH(wii,
	AS_HELP_STRING([--with-wii], [build for Wii]))
AS_IF([test x"$with_wii" = x"yes"], [







>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
*)
	potential_compilers="clang egcc gcc"
	;;
esac
AC_PROG_OBJC($potential_compilers)
AC_PROG_OBJCPP
AC_PROG_EGREP
AC_PROG_AWK
AC_PROG_LN_S

BUILDSYS_CHECK_IOS

AC_ARG_WITH(wii,
	AS_HELP_STRING([--with-wii], [build for Wii]))
AS_IF([test x"$with_wii" = x"yes"], [
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
			@try {
				foo();
			} @finally {
				foo();
			}
		])
	], [
		AS_IF([tr -dc "[[:print:]]" <conftest.$ac_objext | \
		    $EGREP __gnu_objc_personality_v0 >/dev/null], [
			exception_type="DWARF"
		])
		AS_IF([tr -dc "[[:print:]]" <conftest.$ac_objext | \
		    $EGREP __gnu_objc_personality_sj0 >/dev/null], [
			exception_type="SjLj"
		])
		AS_IF([tr -dc "[[:print:]]" <conftest.$ac_objext | \
		    $EGREP __gnu_objc_personality_seh0 >/dev/null], [
			exception_type="SEH"
		])

		case "$exception_type" in
		DWARF)
			AC_DEFINE(HAVE_DWARF_EXCEPTIONS, 1,
				[Whether DWARF exceptions are used])
			raise_exception="_Unwind_RaiseException"
			;;







<
<
|
<
<
|
|
<
<
|
|
<







595
596
597
598
599
600
601


602


603
604


605
606

607
608
609
610
611
612
613
			@try {
				foo();
			} @finally {
				foo();
			}
		])
	], [


		exception_type="$($AWK '


		    /__gnu_objc_personality_v0/ { print "DWARF" }
		    /__gnu_objc_personality_sj0/ { print "SjLj" }


		    /__gnu_objc_personality_seh0/ { print "SEH" }' \
		    conftest.$ac_objext)"


		case "$exception_type" in
		DWARF)
			AC_DEFINE(HAVE_DWARF_EXCEPTIONS, 1,
				[Whether DWARF exceptions are used])
			raise_exception="_Unwind_RaiseException"
			;;
807
808
809
810
811
812
813
814
815
816
817
818
819
820


821
822


823
824

825
826
827
828


829
830
831


832
833
834
835
836
837
838
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AS_IF([test x"$ac_cv_sizeof_float" != x"4" -o x"$ac_cv_sizeof_double" != x"8"],
	[AC_MSG_ERROR(
		[Floating point implementation does not conform to IEEE 754!])])

AC_MSG_CHECKING(for floating point endianess)
fp_endianess="unknown"
AS_IF([test x"$ac_cv_c_bigendian" != x"universal"], [
	AC_COMPILE_IFELSE([
		AC_LANG_SOURCE([
			double endianess = 2.993700760838795055656993580068609688772747263874402942272934826871811872228512759832626847251963763755836687759498519784550143745834860002945223766052808125982053455555265216112722718870586961456110693379343178124592311441022662940307099598578775368547768968914916965731708568179631324904813506101190853720749196062963892799499230635163056742330563321122389331703618066046034494287335316842529021563862331183541255013987734473643350285400060357711238514186776429325214739886098119655678483017894951556639821088508565036657794343031121375178126860889964700274558728491825977274341798997758923017217660272136611938897932105874133412726223468780517578125e-259;
		])
	], [


		AS_IF([tr -dc "[[:print:]]" <conftest.$ac_objext | \
		    $EGREP BigEnd >/dev/null], [


			AC_DEFINE(OF_FLOAT_BIG_ENDIAN, 1,
				[Whether floats are big endian])

			fp_endianess="big endian"
		], [
			AS_IF([tr -dc "[[:print:]]" <conftest.$ac_objext | \
			    $EGREP dnEgiB >/dev/null], [


				fp_endianess="little endian"
			])
		])


	])
], [
	fp_endianess="universal"
])
AC_MSG_RESULT($fp_endianess)
AS_IF([test x"$fp_endianess" = x"unknown"], [
	AC_MSG_ERROR(







<






>
>
|
|
>
>


>
|
<
<
<
>
>
|
<
<
>
>







801
802
803
804
805
806
807

808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823



824
825
826


827
828
829
830
831
832
833
834
835
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AS_IF([test x"$ac_cv_sizeof_float" != x"4" -o x"$ac_cv_sizeof_double" != x"8"],
	[AC_MSG_ERROR(
		[Floating point implementation does not conform to IEEE 754!])])

AC_MSG_CHECKING(for floating point endianess)

AS_IF([test x"$ac_cv_c_bigendian" != x"universal"], [
	AC_COMPILE_IFELSE([
		AC_LANG_SOURCE([
			double endianess = 2.993700760838795055656993580068609688772747263874402942272934826871811872228512759832626847251963763755836687759498519784550143745834860002945223766052808125982053455555265216112722718870586961456110693379343178124592311441022662940307099598578775368547768968914916965731708568179631324904813506101190853720749196062963892799499230635163056742330563321122389331703618066046034494287335316842529021563862331183541255013987734473643350285400060357711238514186776429325214739886098119655678483017894951556639821088508565036657794343031121375178126860889964700274558728491825977274341798997758923017217660272136611938897932105874133412726223468780517578125e-259;
		])
	], [
		fp_endianess="$($AWK '
		    /BigEnd/ { print "big endian" }
		    /dnEgiB/ { print "little endian" }' conftest.$ac_objext)"

		case "$fp_endianess" in
		"big endian")
			AC_DEFINE(OF_FLOAT_BIG_ENDIAN, 1,
				[Whether floats are big endian])
			;;
		"little endian")



			;;
		*)
			fp_endianess="unknown";


			;;
		esac
	])
], [
	fp_endianess="universal"
])
AC_MSG_RESULT($fp_endianess)
AS_IF([test x"$fp_endianess" = x"unknown"], [
	AC_MSG_ERROR(