From patchwork Tue Oct 20 18:11:28 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Spencer Norton X-Patchwork-Id: 10415 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4j8L8V538Wz3yfG for ; Tue, 20 Oct 2026 18:11:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bit raw public key) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "YE2" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4j8L8T69RYz7G1 for ; Tue, 20 Oct 2026 18:11:37 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4j8L8S4dQQz36Vb for ; Tue, 20 Oct 2026 18:11:36 +0000 (UTC) X-Original-To: location@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4j8L8R6lXVz2xLw for ; Tue, 20 Oct 2026 18:11:35 +0000 (UTC) Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazlp170120007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c101::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.protection.outlook.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4j8L8P4gFLz46Q for ; Tue, 20 Oct 2026 18:11:33 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=norvitech.onmicrosoft.com header.s=selector1-norvitech-onmicrosoft-com header.b="ck/pWhu/"; spf=pass (mail01.ipfire.org: domain of spencer.norton@norvi.tech designates 2a01:111:f403:c101::7 as permitted sender) smtp.mailfrom=spencer.norton@norvi.tech; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=norvi.tech ARC-Seal: i=2; a=rsa-sha256; d=lists.ipfire.org; s=202003rsa; cv=pass; t=1792519894; b=i7a43e/brc0giam2vKhtSk1aUmx+33T0PjLGRDPWhj1G6EaqFhk+gmF35DHCPUKnMqXvFy JzB8ENLTvLQyCtS+zbsUCVrqom30J1tNJ7SlnN4BghK0wuM9fCuENynma31ffRyJ+EJpZ3 +QMSVDRbKNs1no6BIiaJDdvkiQzENaNpZsiXq+lnsNtz2BcAD272ApW+Wa6RWPNDKeJMSU mGiJuOTtK2l1TTQNaJ8cVVdIpXuNvT+BkyeD31Yy+ZbUl8Erksk6RtZoBJPNZuTAo1ryS4 CPkpTS9XY1V7jkirj1ByPyOczi1Z12ovJnDOYSc8us131cHBWA1aT1CvyavXOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1792519894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=L4ymJ5gcGrAvaBXcSRo5TeXzbVPLzXFqAMP+kIuRyT8=; b=oTWffZDEWrASHHJR+Rljknkbcnm+IctZzvkOinkowcTAf7SilxJmv+OZe82iSeuETm4nrS MiLoQ8fxv1BMD/p6FsSBpQcMiHLi5lhBaQsd1zu+2KiudBCh0aHGCG+xgEoxC8bbtJWz+e nBS1hjqZAAw3MPj6m6rdT4Nb3jedyAIWBZi9bBxda5AMpetHlBjB894JPnlPzOpERluzZQ OUTV+3gH1PvIaoDbUrMIITcwVnvcPU1R/7kEadY6D98Rl8HtnAIMQmcFxWtS0hdnYctI01 jWz8GA6C5sG+9zzQR7RxF3u46pjRj5FHLRM9ziQ4BqR0oU1o531NlMsoUCOcIQ== ARC-Authentication-Results: i=2; mail01.ipfire.org; dkim=pass header.d=norvitech.onmicrosoft.com header.s=selector1-norvitech-onmicrosoft-com header.b="ck/pWhu/"; spf=pass (mail01.ipfire.org: domain of spencer.norton@norvi.tech designates 2a01:111:f403:c101::7 as permitted sender) smtp.mailfrom=spencer.norton@norvi.tech; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=norvi.tech ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TMNZi0b5EyLIuE1YlKlLQ4MwqGDXCF+VU7hA27B2h6yhghA0B3vhl/sLZMs5mu5X/dfvftOBskzDaJDmmjLOJWWGWX/SUUJwzQi068Cl5yEbAjf/LNdv2JUoVdscBGRHTDVRDFjB+lbpBsZ2zyRPV4oDl35qyKEutwAeoRMCIdotaO2tjYoXyYMKtkjOl1UK3UtCIcM3F5qydqN6lk8PUi6ezrlgtRabugCGXs2V0NRwFxxA3TayrhDndWmMStNTRGGA29/r+cZ8fARXtEvNixZsFG6NdN2E8MDS/MBcZpcP3CdKlTCbVs8WyyDK8V1jzmmx/8VVQxy8NDhPseruwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L4ymJ5gcGrAvaBXcSRo5TeXzbVPLzXFqAMP+kIuRyT8=; b=YGVP2LLao7AlnP1PZf6WdDhilr/OWZbTzk0XYzmF6/lK+8rzopoUE0ha1wRe0FQDt5qpFfBpLKlv+IALHftFWowpVc+WQtf9u/7ozl3iEGL0wzBOBilXx2htfo9CD1941J8B90fkl2B8wh3LuQlIVwAm9V972xdR5R47eIs2tfGpVzLWeLvmGsDRptLGp6vOqh1PCR/hYNtADbUrUy7JcFoGVUsRR6jMumW9sQmFxkr2vWq9ooQhlx2ks5/Td/dlw0dbAzk2uepQzmckPDDumZ2YK5XQM64vXhS/OlFR2ySvEInTGb6IpD8qNw83H7TpX1ZMbt4dyD5sc5Crk0GWDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=norvi.tech; dmarc=pass action=none header.from=norvi.tech; dkim=pass header.d=norvi.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norvitech.onmicrosoft.com; s=selector1-norvitech-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L4ymJ5gcGrAvaBXcSRo5TeXzbVPLzXFqAMP+kIuRyT8=; b=ck/pWhu/8W5j1XUOgjf2LLbZ5UPYCaqgfhr+ote1LPgNUdD9KAbklAeObO7MWVwrGJTDAHMKYi7fTaOO9hlpZPqM3i9u7Dvi3aO+2b6RZ+OrCyqhVVnMRSPfE3qPItd1acDHNaVyrvUnLpR+nB0H+jIEUxngmepjaWDm5xNImV8= Received: from LV9PR18MB927615.namprd18.prod.outlook.com (2603:10b6:408:373::24) by DS6PR18MB186898.namprd18.prod.outlook.com (2603:10b6:8:414::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.522.12; Tue, 20 Oct 2026 18:11:28 +0000 Received: from LV9PR18MB927615.namprd18.prod.outlook.com ([fe80::28f3:a326:e7b:8044]) by LV9PR18MB927615.namprd18.prod.outlook.com ([fe80::28f3:a326:e7b:8044%6]) with mapi id 15.21.0522.017; Tue, 20 Oct 2026 18:11:28 +0000 From: Spencer Norton To: "location@lists.ipfire.org" CC: Michael Tremer Subject: [PATCH] Fix building and running the test suite on macOS Thread-Topic: [PATCH] Fix building and running the test suite on macOS Thread-Index: AQHdYL5t85VnhmCP7EWvTA5uZMM6Uw== Date: Tue, 20 Oct 2026 18:11:28 +0000 Message-ID: <179251988825.9611.6228224260624404977@norvi.tech> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.50.1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV9PR18MB927615:EE_|DS6PR18MB186898:EE_ x-ms-office365-filtering-correlation-id: 8d523a06-ef0e-4fe7-b2a4-08df2ed58fc7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|38070700021|56012099006|5023799004|261009223027099003|10067099003|18002099003|6133799003; x-microsoft-antispam-message-info: xiQJuYie8kdwmHqZRABLSZNCsw+AR65dyp/Ba44PBxEaJU03M3R9kXP09h2L36ePMhA7Y6jSAkxrlAm3oHkXKqW+aKueqKna7n2AZTCWYxwP097E4WW9Z2XyQNwsFz9Fie7kQhMhUnEMQdEeKLEy/GCSQVFyxKiEknMA+YYCrzbcVc5f9Fzl52aE4ZJC1OVJgnU5rxVLk0H/WYQhV4VhilvabPzwc8ek7ePIJM47hUNG6O+4zgOipyl2AuUOGtib6FDExCZvKPS3dlJqAean822Y5PaWm+xZ7Nmq1aYHuKUFIy8t483Zqiftwsd28vWxV6ClTpVEPHxsB36s4+MJnQCYRTgtDqeWuH5uckd5W2bouFkuQH0MgNurkPK9rDOzJYV9g9D19PdGKxoYM+nn+TP8cQJoiqglagNv9jmj8gn8g6rsA4i6t8CnTM2mPEq0CUgOXMCXKUNwGZ90qdrF9qDQUCfz3/3bbVpzgFULliLISkNdoTmyDuwjIzTFje1u4xyZ1xGIgFNk7IH7aYUiyquhoZOwqsR9f7ceCApJicUJ9bmpSGEYTUSp3xxMGVRojbQDjsRRvbQSlseUqw3csxMP61jhD0pn1tr4WGS2Wz5gpLm7cbMD8y0ZOng3Exp52myKRrJM7b4vBWlHsIcu57fhw5XqUv3VhC8XTAu3D56O37xJso+Rs2oSa7rE8E1nPXxTghfx8LdHfQMvHRlzfn5pmVhtDRXPWdSxPJcQScs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV9PR18MB927615.namprd18.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(38070700021)(56012099006)(5023799004)(261009223027099003)(10067099003)(18002099003)(6133799003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?abZaO7xv+QLg1Od9lu4bWZ2UKVmk?= =?utf-8?q?ND79BEU2pVK9M9k71vJoB5dNdf9Le5s/CLujFpCO8hiuPyB5V7e7YhMHaoLnghblj?= =?utf-8?q?8EIsvN6rRMunJqupIlYzfK5EtggXLTTUZBgYFbUnblw2BeFm7ITiuR3cQyvN0NdFw?= =?utf-8?q?mHPV9xv8H6xWqdFcb5ivgEvHMGNFVjYYJ3j1dMIOiNhoslahwPogWDZGxIB0ca4Sm?= =?utf-8?q?PcxcPHeCDjv40rUDWUSkQPRudM8B5hTxJrUZbvTAE8R/xxLEPe/O107MOdMJ9fNvL?= =?utf-8?q?sapg3cI5NqTAKY4cmR7qkOJs9LJhzaqcPxd3d8KKqmkrEosEs7vJLJFQNh+/NYQFc?= =?utf-8?q?BLhzzwHHNJAWfMEBnyf4vUofjVQpPEm1gl6uwFx3NTtM1bmevZtlk+mqAq+S8RXRO?= =?utf-8?q?Xrd4jcJxGmgVt2HnI52A7lSTklYriw/ZoiteJ8QCisfPs98sHKqBA1fZ9HEqX2r4A?= =?utf-8?q?Qe+7kRmUia1G4uHAxU3cnm4UEhKS/vFjD2T7THVtOM98ETUK3K7SMb9nnEZlbF7Zf?= =?utf-8?q?wPiFAldEQmo5U6ys5pJEr8QfkwD5nbG0FBZmHg/GVyWXWaFf+q1zCKCPvrG9VH6gv?= =?utf-8?q?+S33oZHVHZJJ29BPJ07rtv9hK1zhwW6v5jjb5c5MEnbzakVIyN26VhApl9pMOzIph?= =?utf-8?q?yq6+eLcrHifLMNNlnXgu5drck+N0zZbEybOrcTrrmyOcKQs0pihO4/3bxscrF7cp7?= =?utf-8?q?5qSiGhZclsUJkSH2wOprS4x4+oBUEO/TvQMvLCv5XrqidHFlc8A1jgdf14F/eq3JY?= =?utf-8?q?INRbpZ4Vo9trh2si96RbgWd77U3XeqD+bjxfswxntOfdX6LPA5Vx0fzPCxQ3acGFp?= =?utf-8?q?rgxf0Cn28Sl4kq4hQwhTtpjolxnQzyRdgwEgjM+zAToadXo/Zk4J63lVJWYwlZP6l?= =?utf-8?q?Se+CtL9RU6F1iYr19p64XdKzS/39UkER0ScjUSo+rYw4pE82YreBSaZ9FZ3jtI9/Y?= =?utf-8?q?X0KzRGzhIP1kJhYbNG6QGVNPp3swgRRHkW7XSGD3DQQsU35Gse0rTjFhyyUFYAsoi?= =?utf-8?q?SFheyK9C+w8KtmVzHfUThji3powal1uXyijujK415xjT/JWSMTa7gKqCk6YTNnAlS?= =?utf-8?q?0guE2ZI9q47FS0JhHOKfSAQhFPxe2Fkn+gdsX7zPEQgYkQwmWHFh/ieySFIx/xAZF?= =?utf-8?q?i1/1jWdTfjWksDOh4Ycz73S7XiahsVEK8E+6To1KDTb0MwqUxy9H3kNKf9ZDWLmSt?= =?utf-8?q?Vn9IRLJ9ClqVkcd7ysjhYixwLR0oM3bZFqTEy7FZBDoeDzDXAnbajNO1BYLETHC3q?= =?utf-8?q?C1UHkC1+uK5EWvpv+5kSKRmrAWFgvyDkU1rjeLepPnyH/z5ZTBuW7SbWSzmovOB4K?= =?utf-8?q?bSWRO70Cf81VdSFxNmX/y997z0ZArs2DIJSOuchQpqKhTOy1kPMbcUPXWH1t2HggJ?= =?utf-8?q?n21ZOcTzV0+ig+4BnDSPC+OoB+N82U7RtV9FisNPMiqXNUd3DVe818MDALdknNQGc?= =?utf-8?q?pnMtKhdiJrtCltgdvCzP2nl8Nb/i017dLwCWZ8RK85Ih/50IOWjKYSmgHsSTmV9Z3?= =?utf-8?q?n2SG4ZQKUrB5VjX0l/EmMuUte0z+szptuOqVFDY1fUnH9KTNib8naTzTphZVEHFyO?= =?utf-8?q?ZJlVFAPFRCpoWh8+ivfyXe0DjK42sGgktGD/a6kk6j6jqbHJvQSSsNlGVGcLVmgp/?= =?utf-8?q?RttLY+5zrxYQLrQb6EF+jchcnWYEm/OfV00N6JsBrB8Rc0QuEPuNs=3D?= Content-ID: <5A5A0F5BA6B46447BC05B7A0F479FDF2@namprd18.prod.outlook.com> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 X-OriginatorOrg: norvi.tech X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV9PR18MB927615.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d523a06-ef0e-4fe7-b2a4-08df2ed58fc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Oct 2026 18:11:28.4961 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f3f6170-3a3a-4e18-817e-166067666706 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1OanlFHXvc7LxMc6B3yZp54QRvuY5D473PJO3bE4sNmjOuL1Vj6OgveVAxoKNFVeze9e8TirJJ7aKirw326Qt0S1w6e75gkfl4GSIroWLYU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS6PR18MB186898 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.73 / 11.00]; BAYES_HAM(-3.00)[100.00%]; SPF_REPUTATION_SPAM(2.50)[0.83280138427954]; R_DKIM_ALLOW(-1.53)[norvitech.onmicrosoft.com:s=selector1-norvitech-onmicrosoft-com]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector10001:i=1]; MIME_BASE64_TEXT_BOGUS(1.00)[]; DKIM_REPUTATION(-0.90)[-0.89924558703329]; DMARC_POLICY_ALLOW(-0.50)[norvi.tech,reject]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f403:c000::/51]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.10)[norvi-tech.mail.protection.outlook.com]; MIME_BASE64_TEXT(0.10)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[norvitech.onmicrosoft.com:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_REPUTATION_SPAM(0.00)[asn: 8075(0.26), country: US(-0.01), ip: 2a01:111:f403:c101::(0.00)]; RCVD_IN_DNSWL_NONE(0.00)[2a01:111:f403:c101::7:from] X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4j8L8P4gFLz46Q Restore building libloc, its man pages, and its C, Python, Lua, and Perl test suites on macOS (Darwin), including with --enable-asan and --enable-ubsan: - src/libloc/compat.h: Map st_mtim to st_mtimespec on Apple platforms if not already defined, matching the switch to sub-second mtime comparison in loc_database_reload(). Also parenthesize (nmemb) * (size) in the fallback reallocarray() macro so additive expressions such as list->data_size + size do not under-allocate due to operator precedence. - configure.ac, m4/attributes.m4: Pass -Wl,-not_for_dyld_shared_cache on Darwin when supported by the linker so Apple's ld does not reject the default /usr/lib install_name on libloc.dylib when linking with -undefined dynamic_lookup or non-system libraries such as Homebrew OpenSSL. Wrap the CC_CHECK_LDFLAGS test body in AC_LANG_SOURCE. Pass [no-xml] to IT_PROG_INTLTOOL so configure does not require the unused XML::Parser Perl module. Quote '${prefix}' in the pkg-config calls for LUA_INSTALL_LMOD and LUA_INSTALL_CMOD so running configure without --prefix defers expansion to Make instead of expanding prefix=NONE. Under --enable-asan on Darwin, preload libloc.dylib via DYLD_INSERT_LIBRARIES for binding tests. - Makefile.am: Replace GNU-specific 'ln -s --relative' and brace expansion in build-perl with $(MKDIR_P) and a POSIX loop using $(abs_srcdir). Pass LD_LIBRARY_PATH and DYLD_LIBRARY_PATH after 'env' in PY_LOG_COMPILER, LUA_LOG_COMPILER, testdata.db, and check-perl (via single-quoted FULLPERLRUN) so macOS SIP does not strip DYLD_* variables across /bin/sh. Invoke $(LUA) explicitly in LUA_LOG_COMPILER instead of relying on the #!/usr/bin/lua@LUA_VERSION@ shebang, omit unsupported detect_leaks=1 from ASAN_OPTIONS on Darwin, remove libloc*.dylib and Location.bundle on uninstall, and include /opt/homebrew/etc/xml/catalog in XML_CATALOG_FILES on Darwin for Apple Silicon Homebrew installations. - autogen.sh: Silence clang's unsupported '-print-multi-os-directory' stderr message when computing default libdir. Fixes: #12400 - Package does not compile on OS X any more Signed-off-by: Spencer Norton --- Makefile.am | 34 ++++++++++++++++++---------------- autogen.sh | 2 +- configure.ac | 20 +++++++++++++++----- m4/attributes.m4 | 2 +- src/libloc/compat.h | 6 +++++- 5 files changed, 40 insertions(+), 24 deletions(-) -- 2.50.1 diff --git a/Makefile.am b/Makefile.am index aa0f23b..fa862bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -318,13 +318,10 @@ EXTRA_DIST += \ src/perl/typemap build-perl: src/libloc.la - @mkdir -p $(builddir)/src/perl/{lib,t} - @test -e $(builddir)/src/perl/Location.xs || ln -s --relative $(srcdir)/src/perl/Location.xs $(builddir)/src/perl/ - @test -e $(builddir)/src/perl/MANIFEST || ln -s --relative $(srcdir)/src/perl/MANIFEST $(builddir)/src/perl/ - @test -e $(builddir)/src/perl/Makefile.PL || ln -s --relative $(srcdir)/src/perl/Makefile.PL $(builddir)/src/perl/ - @test -e $(builddir)/src/perl/lib/Location.pm || ln -s --relative $(srcdir)/src/perl/lib/Location.pm $(builddir)/src/perl/lib/ - @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/ - @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/ + @$(MKDIR_P) $(builddir)/src/perl/lib $(builddir)/src/perl/t + @for file in Location.xs MANIFEST Makefile.PL lib/Location.pm t/Location.t typemap; do \ + test -e $(builddir)/src/perl/$$file || ln -s $(abs_srcdir)/src/perl/$$file $(builddir)/src/perl/$$file; \ + done cd $(builddir)/src/perl && $(PERL) Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 \ INSTALLDIRS=vendor \ @@ -334,8 +331,8 @@ build-perl: src/libloc.la .PHONY: check-perl check-perl: testdata.db build-perl - cd $(builddir)/src/perl && env $(BINDINGS_TEST_ENV) \ - $(MAKE) LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" test \ + cd $(builddir)/src/perl && \ + $(MAKE) FULLPERLRUN='env $(BINDINGS_TEST_ENV) "$(PERL)"' test \ database="../../$<" keyfile="$(abs_srcdir)/examples/public-key.pem" .PHONY: install-perl @@ -352,6 +349,7 @@ uninstall-perl: rm -vf \ $(DESTDIR)/@PERL_MODPATH@/Location.pm \ $(DESTDIR)/@PERL_MODPATH@/auto/Location/Location.so \ + $(DESTDIR)/@PERL_MODPATH@/auto/Location/Location.bundle \ $(DESTDIR)/@PERL_MANPATH@/Location.3pm -rmdir $(DESTDIR)/@PERL_MODPATH@/auto/Location @@ -384,7 +382,7 @@ install-exec-hook: # libtool needs those files to find what it has installed, so that # we have to remove the libraries and modules ourselves. uninstall-hook: - rm -f "$(DESTDIR)$(libdir)"/libloc.so* + rm -f "$(DESTDIR)$(libdir)"/libloc.so* "$(DESTDIR)$(libdir)"/libloc*.dylib rm -f "$(DESTDIR)$(pyexecdir)/_location.so" if ENABLE_LUA rm -f "$(DESTDIR)$(luaexecdir)/location.so" @@ -466,10 +464,10 @@ TESTS_ENVIRONMENT = \ ABS_BUILDDIR="$(abs_builddir)" \ ABS_SRCDIR="$(abs_srcdir)" -# Make the address sanitizer fail any test that leaks memory -# and use libunwind for better stack traces +# Make the address sanitizer fail any test that leaks memory (except on Darwin +# where LeakSanitizer is not supported) and use libunwind for better stack traces TESTS_ENVIRONMENT += \ - ASAN_OPTIONS=detect_leaks=1:fast_unwind_on_malloc=0 + ASAN_OPTIONS=$(if $(filter Darwin,$(OS)),,detect_leaks=1:)fast_unwind_on_malloc=0 TESTS = \ $(check_PROGRAMS) \ @@ -479,14 +477,18 @@ TESTS = \ # Run the tests of the bindings with whatever environment their interpreter needs TEST_EXTENSIONS = .py .lua +BINDINGS_TEST_ENV = \ + LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" \ + DYLD_LIBRARY_PATH="$(abs_builddir)/src/.libs" \ + @BINDINGS_TEST_ENV@ + PY_LOG_COMPILER = env $(BINDINGS_TEST_ENV) $(PYTHON) -LUA_LOG_COMPILER = env $(BINDINGS_TEST_ENV) +LUA_LOG_COMPILER = env $(BINDINGS_TEST_ENV) $(LUA) CLEANFILES += \ testdata.db testdata.db: examples/python/create-database.py src/python/_location.la - LD_LIBRARY_PATH="$(abs_builddir)/src/.libs" \ PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \ ABS_SRCDIR="$(abs_srcdir)" \ env $(BINDINGS_TEST_ENV) $(PYTHON) $< $@ @@ -1076,7 +1078,7 @@ XSLTPROC_COMMAND_MAN = \ # Let XSLT find its source on Mac OS X ifeq ($(OS),Darwin) -export XML_CATALOG_FILES = /usr/local/etc/xml/catalog +export XML_CATALOG_FILES ?= $(firstword $(wildcard /usr/local/etc/xml/catalog /opt/homebrew/etc/xml/catalog)) endif man/%.xml: man/%.txt man/asciidoc.conf diff --git a/autogen.sh b/autogen.sh index 578c52f..6bab7ba 100755 --- a/autogen.sh +++ b/autogen.sh @@ -16,7 +16,7 @@ autoreconf --force --install --symlink intltoolize --force --automake libdir() { - echo $(cd $1/$(gcc -print-multi-os-directory); pwd) + echo $(cd $1/$(gcc -print-multi-os-directory 2>/dev/null); pwd) } args="--prefix=/usr \ diff --git a/configure.ac b/configure.ac index 5c4323f..942d584 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ gl_LD_VERSION_SCRIPT AM_GNU_GETTEXT_VERSION(0.21) AM_GNU_GETTEXT([external]) -IT_PROG_INTLTOOL([0.40.0]) +IT_PROG_INTLTOOL([0.40.0], [no-xml]) # Interpret embedded Python in HTML files XGETTEXT="${XGETTEXT} -L Python --keyword=_:1,2 --keyword=N_:1,2 --no-location" @@ -213,8 +213,13 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ # --as-needed / --gc-sections are GNU ld flags. Apple's ld ignores them with a # warning, which the link probe can't detect, so only offer them off-Darwin. +# On Darwin, opt out of the dyld shared cache so ld permits a /usr/lib +# install_name to link with -undefined dynamic_lookup or non-system libraries. AS_CASE([$host_os], - [darwin*], [], + [darwin*], [ + CC_CHECK_LDFLAGS([-Wl,-not_for_dyld_shared_cache], + [with_ldflags="$with_ldflags -Wl,-not_for_dyld_shared_cache"]) + ], [ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ -Wl,--as-needed \ @@ -277,7 +282,12 @@ if test "x${enable_asan}" = "xyes"; then asan_runtime="$(${CC} -print-file-name=libclang_rt.asan-$(uname -m).so)" ]) - bindings_test_env="LD_PRELOAD=${asan_runtime} ASAN_OPTIONS=detect_leaks=0" + AS_CASE([$host_os], + [darwin*], [ + bindings_test_env='DYLD_INSERT_LIBRARIES="$(abs_builddir)/src/.libs/libloc.dylib" ASAN_OPTIONS=detect_leaks=0' + ], + [bindings_test_env="LD_PRELOAD=${asan_runtime} ASAN_OPTIONS=detect_leaks=0"] + ) fi AC_SUBST([BINDINGS_TEST_ENV], ${bindings_test_env}) @@ -363,13 +373,13 @@ AS_IF( AC_SUBST(LUA_VERSION) - LUA_INSTALL_LMOD=$($PKG_CONFIG --define-variable=prefix=${prefix} --variable=INSTALL_LMOD ${lua}) + LUA_INSTALL_LMOD=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=INSTALL_LMOD ${lua}) if test -z "${LUA_INSTALL_LMOD}"; then LUA_INSTALL_LMOD="${datadir}/lua/${LUA_VERSION}" fi AC_SUBST(LUA_INSTALL_LMOD) - LUA_INSTALL_CMOD=$($PKG_CONFIG --define-variable=prefix=${prefix} --variable=INSTALL_CMOD ${lua}) + LUA_INSTALL_CMOD=$($PKG_CONFIG --define-variable=prefix='${prefix}' --variable=INSTALL_CMOD ${lua}) if test -z "${LUA_INSTALL_CMOD}"; then LUA_INSTALL_CMOD="${libdir}/lua/${LUA_VERSION}" fi diff --git a/m4/attributes.m4 b/m4/attributes.m4 index 72db816..6518f12 100644 --- a/m4/attributes.m4 +++ b/m4/attributes.m4 @@ -64,7 +64,7 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [ AS_TR_SH([cc_cv_ldflags_$1]), [ac_save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $1" - AC_LINK_IFELSE([int main() { return 1; }], + AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return 1; }])], [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) LDFLAGS="$ac_save_LDFLAGS" diff --git a/src/libloc/compat.h b/src/libloc/compat.h index cd16a24..1060b63 100644 --- a/src/libloc/compat.h +++ b/src/libloc/compat.h @@ -45,7 +45,11 @@ #endif #ifndef reallocarray -# define reallocarray(ptr, nmemb, size) realloc(ptr, nmemb * size) +# define reallocarray(ptr, nmemb, size) realloc(ptr, (nmemb) * (size)) +#endif + +#ifndef st_mtim +# define st_mtim st_mtimespec #endif #endif