buildsys  Check-in [5695217e58]

Overview
Comment:Make a distinction between plugins and bundles
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5695217e58e9abf93c8869e73f24b146542e598ab0506ceb39b114f876d2cae4
User & Date: js on 2024-05-05 00:15:35
Other Links: manifest | tags
Context
2024-05-05
00:40
Update autogen.sh check-in: e98b322ac4 user: js tags: trunk
00:15
Make a distinction between plugins and bundles check-in: 5695217e58 user: js tags: trunk
2023-09-10
23:30
Create .frameworks for macOS and iOS differently check-in: 5abbdc7a0a user: js tags: trunk
Changes

Modified build-aux/m4/buildsys.m4 from [8bcbdfb241] to [2df76d7ffd].

1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







dnl
dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017,
dnl               2018, 2020, 2021, 2022, 2023
dnl               2018, 2020, 2021, 2022, 2023, 2024
dnl   Jonathan Schleifer <js@nil.im>
dnl
dnl https://fossil.nil.im/buildsys
dnl
dnl Permission to use, copy, modify, and/or distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above
dnl copyright notice and this permission notice is present in all copies.
340
341
342
343
344
345
346
347
348


349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388















389
390


391



392
340
341
342
343
344
345
346


347
348







349
350
351
352
353
354



355
356
357
358
359
360



361
362
363
364
365
366



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387


388
389

390
391
392
393







-
-
+
+
-
-
-
-
-
-
-






-
-
-






-
-
-






-
-
-






+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+

	AC_REQUIRE([BUILDSYS_CHECK_IOS])
	AC_MSG_CHECKING(for plugin type)

	case "$host" in
	*-*-darwin*)
		AC_MSG_RESULT(Darwin)
		PLUGIN_CFLAGS='-fPIC -DPIC'
		PLUGIN_LDFLAGS='-bundle ${PLUGIN_LDFLAGS_BUNDLE_LOADER}'
		PLUGIN_SUFFIX='.bundle'
		PLUGIN_LDFLAGS='-bundle'
		PLUGIN_SUFFIX='.dylib'
		AS_IF([test x"$host_is_ios" = x"yes"], [
			LINK_PLUGIN='rm -fr $$out && ${MKDIR_P} $$out && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Info.plist; fi && ${LD} -o $$out/$${out%${PLUGIN_SUFFIX}} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} $$out'
		], [
			LINK_PLUGIN='rm -fr $$out && ${MKDIR_P} $$out/Contents/MacOS && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Contents/Info.plist; fi && ${LD} -o $$out/Contents/MacOS/$${out%${PLUGIN_SUFFIX}} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} $$out'
		])
		INSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i && cp -R $$i ${DESTDIR}${plugindir}/'
		UNINSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i'
		;;
	*-*-mingw* | *-*-cygwin*)
		AC_MSG_RESULT(MinGW / Cygwin)
		PLUGIN_CFLAGS=''
		PLUGIN_LDFLAGS='-shared -Wl,--export-all-symbols'
		PLUGIN_SUFFIX='.dll'
		LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}'
		INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i'
		UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i'
		;;
	hppa*-*-hpux*)
		AC_MSG_RESULT([HP-UX (PA-RISC)])
		PLUGIN_CFLAGS='-fPIC -DPIC'
		PLUGIN_LDFLAGS='-shared'
		PLUGIN_SUFFIX='.sl'
		LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}'
		INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i'
		UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i'
		;;
	*)
		AC_MSG_RESULT(ELF)
		PLUGIN_CFLAGS='-fPIC -DPIC'
		PLUGIN_LDFLAGS='-shared'
		PLUGIN_SUFFIX='.so'
		LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}'
		INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i'
		UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i'
		;;
	esac

	AC_SUBST(PLUGIN_CFLAGS)
	AC_SUBST(PLUGIN_LDFLAGS)
	AC_SUBST(PLUGIN_SUFFIX)
])

AC_DEFUN([BUILDSYS_BUNDLE], [
	AC_REQUIRE([AC_CANONICAL_HOST])
	AC_REQUIRE([BUILDSYS_CHECK_IOS])
	AC_REQUIRE([BUILDSYS_PLUGIN])

	case "$host_os" in
	darwin*)
		AS_IF([test x"$host_is_ios" = x"yes"], [
			LINK_BUNDLE='${MKDIR_P} $$out && ${INSTALL} -m 644 Info.plist $$out/Info.plist && ${LD} -o $$out/$${out%.bundle} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}'
		], [
			LINK_BUNDLE='${MKDIR_P} $$out/Contents/MacOS && ${INSTALL} -m 644 Info.plist $$out/Contents/Info.plist && ${LD} -o $$out/Contents/MacOS/$${out%.bundle} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}'
		])

	AC_SUBST(LINK_PLUGIN)
	AC_SUBST(INSTALL_PLUGIN)
		AC_SUBST(LINK_BUNDLE)

	AC_SUBST(UNINSTALL_PLUGIN)
		$1
		;;
	esac
])

Modified buildsys.mk.in from [2c79875d24] to [78915595d6].

1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







#
#  Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
#                2017, 2018, 2020, 2021, 2022, 2023
#                2017, 2018, 2020, 2021, 2022, 2023, 2024
#    Jonathan Schleifer <js@nil.im>
#
#  https://fossil.nil.im/buildsys
#
#  Permission to use, copy, modify, and/or distribute this software for any
#  purpose with or without fee is hereby granted, provided that the above
#  copyright notice and this permission notice is present in all copies.
85
86
87
88
89
90
91

92
93
94
95
96
97
98
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99







+







BUILD_AND_HOST_ARE_DARWIN = @BUILD_AND_HOST_ARE_DARWIN@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
amigalibdir ?= ${prefix}/libs
plugindir ?= ${libdir}/${PACKAGE_NAME}
bundledir ?= ${prefix}/Library/PlugIns/${PACKAGE_NAME}
datarootdir = @datarootdir@
datadir = @datadir@
includedir = @includedir@
includesubdir ?= ${PACKAGE_NAME}
INSTALL_INCLUDES ?= yes
localedir = @localedir@
localename ?= ${PACKAGE_NAME}
139
140
141
142
143
144
145

146
147
148
149
150
151
152
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154







+







	    ${STATIC_LIB} ${STATIC_LIB_NOINST}			\
	    ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST}		\
	    ${STATIC_AMIGA_LIB}${STATIC_AMIGA_LIB_NOINST}	\
	    ${SHARED_LIB} ${SHARED_LIB_NOINST}			\
	    ${FRAMEWORK} ${FRAMEWORK_NOINST}			\
	    ${AMIGA_LIB} ${AMIGA_LIB_NOINST}			\
	    ${PLUGIN} ${PLUGIN_NOINST}				\
	    ${BUNDLE} ${BUNDLE_NOINST}				\
	    ${PROG} ${PROG_NOINST}				\
	    ${JARFILE} locales
	${MAKE} @MAKEFLAGS_SILENT@ subdirs-after
	${MAKE} @MAKEFLAGS_SILENT@ post-all

pre-all post-all:

210
211
212
213
214
215
216
217
218

219
220
221
222
223
224
225
226
212
213
214
215
216
217
218


219

220
221
222
223
224
225
226







-
-
+
-







	out="$@"; \
	if test x"@HOST_IS_IOS@" = x"yes"; then \
		if rm -fr $@ && \
		    ${MAKE} @MAKEFLAGS_SILENT@ \
			COPY_HEADERS_IF_SUBDIR=${includesubdir} \
			COPY_HEADERS_DESTINATION=$$PWD/$@/Headers \
			copy-headers-into-framework && \
		    if test -f Info.plist; then \
			    ${INSTALL} -m 644 Info.plist $@/Info.plist; \
		    ${INSTALL} -m 644 Info.plist $@/Info.plist && \
		    fi && \
		    if test -f module.modulemap; then \
			    ${MKDIR_P} $@/Modules && \
			    ${INSTALL} -m 644 module.modulemap \
				$@/Modules/module.modulemap; \
		    fi && \
		    ${LD} -o $@/$${out%.framework} \
			${LIB_OBJS} ${LIB_OBJS_EXTRA} ${FRAMEWORK_LDFLAGS} \
295
296
297
298
299
300
301
302

303
304






305





306
307
308
309
310
311
312
295
296
297
298
299
300
301

302
303
304
305
306
307
308
309
310

311
312
313
314
315
316
317
318
319
320
321
322







-
+


+
+
+
+
+
+
-
+
+
+
+
+







	    ${AMIGA_LIB_OBJS_EXTRA} ${AMIGA_LIB_LDFLAGS} \
	    ${AMIGA_LIB_LIBS}; then \
		${LINK_OK}; \
	else \
		${LINK_FAILED}; \
	fi

${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS}
${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA}
	${LINK_STATUS}
	out="$@"; \
	if ${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \
		${LINK_OK}; \
	else \
		rm -fr $$out; false; \
		${LINK_FAILED}; \
	fi
	if @LINK_PLUGIN@; then \

${BUNDLE} ${BUNDLE_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA}
	${LINK_STATUS}
	out="$@"; \
	if rm -fr $$out && @LINK_BUNDLE@ && ${CODESIGN} -fs ${CODESIGN_IDENTITY} $$out; then \
		${LINK_OK}; \
	else \
		rm -fr $$out; false; \
		${LINK_FAILED}; \
	fi

${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA}
805
806
807
808
809
810
811


















812


813
814
815
816
817
818
819
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839

840
841
842
843
844
845
846
847
848







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+







			${INSTALL_FAILED}; \
		fi \
	done

	for i in "" ${PLUGIN}; do \
		test x"$$i" = x"" && continue; \
		${INSTALL_STATUS}; \
		if ${MKDIR_P} ${DESTDIR}${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i; then \
			${INSTALL_OK}; \
		else \
			${INSTALL_FAILED}; \
		fi \
	done

	for i in "" ${BUNDLE}; do \
		if ${MKDIR_P} ${DESTDIR}${bundledir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bundledir}/$$i; then \
			${INSTALL_OK}; \
		else \
			${INSTALL_FAILED}; \
		fi \
	done
	for i in "" ${BUNDLE}; do \
		test x"$$i" = x"" && continue; \
		${INSTALL_STATUS}; \
		rm -fr ${DESTDIR}${bundledir}/$$i; \
		if ${MKDIR_P} ${DESTDIR}${plugindir} @INSTALL_PLUGIN@; then \
		if ${MKDIR_P} ${DESTDIR}${bundledir} && \
		    cp -R $$i ${DESTDIR}${bundledir}/; then \
			${INSTALL_OK}; \
		else \
			${INSTALL_FAILED}; \
		fi \
	done

	for i in "" ${DATA}; do \
926
927
928
929
930
931
932
933

934
935
936
937
938
939
940
941














942
943
944
945
946
947
948
955
956
957
958
959
960
961

962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991







-
+








+
+
+
+
+
+
+
+
+
+
+
+
+
+







			fi \
		fi \
	done

	for i in "" ${PLUGIN}; do \
		test x"$$i" = x"" && continue; \
		if test -e ${DESTDIR}${plugindir}/$$i; then \
			if : @UNINSTALL_PLUGIN@; then \
			if rm -f ${DESTDIR}${plugindir}/$$i; then \
				${DELETE_OK}; \
			else \
				${DELETE_FAILED}; \
			fi \
		fi \
	done
	rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 || true

	for i in "" ${BUNDLE}; do \
		test x"$$i" = x"" && continue; \
		if test -d ${DESTDIR}${bundledir}/$$i; then \
			if rm -fr ${DESTDIR}${bundledir}/$$i; \
			then \
				${DELETE_OK}; \
			else \
				${DELETE_FAILED}; \
			fi \
		fi \
	done
	rmdir ${DESTDIR}${bundledir} >/dev/null 2>&1 || true
	rmdir ${DESTDIR}${prefix}/Library >/dev/null 2>&1 || true

	for i in "" ${DATA}; do \
		test x"$$i" = x"" && continue; \
		if test -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \
			if rm -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; \
			then \
				${DELETE_OK}; \
			else \
1018
1019
1020
1021
1022
1023
1024
1025


1026
1027
1028
1029
1030
1031
1032
1061
1062
1063
1064
1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
1075
1076







-
+
+








	for i in "" ${DEPS} ${OBJS} ${OBJS_EXTRA} ${LIB_OBJS} \
	    ${LIB_OBJS_EXTRA} ${AMIGA_LIB_OBJS} ${AMIGA_LIB_OBJS_START} \
	    ${AMIGA_LIB_OBJS_EXTRA} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} \
	    ${SHARED_LIB} ${SHARED_LIB_NOINST} ${AMIGA_LIB} \
	    ${AMIGA_LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} \
	    ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${STATIC_AMIGA_LIB} \
	    ${STATIC_AMIGA_LIB_NOINST} ${FRAMEWORK} ${PLUGIN} ${PLUGIN_NOINST} \
	    ${STATIC_AMIGA_LIB_NOINST} ${FRAMEWORK} ${FRAMEWORK_NOINST} \
	    ${PLUGIN} ${PLUGIN_NOINST} ${BUNDLE} ${BUNDLE_NOINST} \
	    ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \
		test x"$$i" = x"" && continue; \
		if test -f $$i -o -d $$i; then \
			if rm -fr $$i; then \
				${DELETE_OK}; \
			else \
				${DELETE_FAILED}; \