Skip to content

Commit 7882c9b

Browse files
committed
Standardize configure options to --with-X[=DIR]
1 parent ea3e48f commit 7882c9b

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

.github/workflows/makefile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: ./autogen.sh
2222

2323
- name: configure
24-
run: ./configure --enable-python
24+
run: ./configure --with-python
2525

2626
- name: build
2727
run: make

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN apk update && apk add --no-cache \
1010
WORKDIR /app
1111
COPY . .
1212
RUN ./autogen.sh && \
13-
./configure --enable-python && \
13+
./configure --with-python && \
1414
make
1515

1616
FROM alpine:latest

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Requirements: autoconf, automake, make, a C compiler (gcc or clang), flex, bison
8282
```
8383
./autogen.sh
8484
./configure # Minimal build (includes JSON support)
85-
./configure --enable-python # With optional Python support
85+
./configure --with-python # With optional Python support
8686
./configure --with-openssl # Use OpenSSL for hardware-accelerated HMAC-SHA256
8787
make
8888
make install
@@ -111,7 +111,7 @@ mysqldump mydb | tee >(myanon -f myanon.cfg | gzip > mydb_anon.sql.gz) | gpg -e
111111

112112
## Python support
113113

114-
When Python support is enabled (`--enable-python`), custom anonymization functions can be defined in Python scripts. These scripts have access to a `myanon_utils` module that provides utility functions:
114+
When Python support is enabled (`--with-python`), custom anonymization functions can be defined in Python scripts. These scripts have access to a `myanon_utils` module that provides utility functions:
115115

116116
- `get_secret()`: Returns the HMAC secret defined in the configuration file
117117
- `escape_sql_string(str)`: Escapes a string for safe SQL insertion
@@ -237,7 +237,7 @@ export LDFLAGS=-L/opt/homebrew/lib
237237
```
238238
./autogen.sh
239239
./configure # Minimal build (includes JSON support)
240-
./configure --enable-python # With optional python support
240+
./configure --with-python # With optional python support
241241
./configure --with-openssl # Use OpenSSL for hardware-accelerated HMAC-SHA256
242242
make
243243
make install

configure.ac

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ AM_PROG_AR
1313
AC_PROG_RANLIB
1414

1515
# Arguments
16-
AC_ARG_ENABLE([python],
17-
[AS_HELP_STRING([--enable-python],
18-
[enable @<:@default=no@:>@ Python support @<:@default=no@:>@])],
19-
[enable_python=$enableval],
20-
[enable_python="no"])
16+
AC_ARG_WITH([python],
17+
[AS_HELP_STRING([--with-python@<:@=DIR@:>@],
18+
[enable Python support @<:@default=no@:>@, optionally specify python install prefix])],
19+
[with_python=$withval],
20+
[with_python="no"])
2121

2222
# Legacy jq option (deprecated)
2323
AC_ARG_ENABLE([jq],
@@ -26,17 +26,20 @@ AC_ARG_ENABLE([jq],
2626
[AC_MSG_WARN([--enable-jq is deprecated and has no effect. JSON support is now built-in without external dependencies.])])
2727

2828
AC_ARG_WITH([openssl],
29-
[AS_HELP_STRING([--with-openssl],
30-
[use OpenSSL for HMAC-SHA256 instead of bundled implementation])],
29+
[AS_HELP_STRING([--with-openssl@<:@=DIR@:>@],
30+
[use OpenSSL for HMAC-SHA256 instead of bundled implementation, optionally specify install prefix])],
3131
[with_openssl=$withval],
3232
[with_openssl="no"])
3333

34-
if test "$with_openssl" = "yes"; then
34+
if test "$with_openssl" != "no"; then
35+
if test "$with_openssl" != "yes"; then
36+
export PKG_CONFIG_PATH="$with_openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
37+
fi
3538
PKG_CHECK_MODULES([OPENSSL], [libcrypto], [],
3639
[AC_MSG_ERROR([OpenSSL libcrypto not found])])
3740
AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if using OpenSSL for HMAC.])
3841
fi
39-
AM_CONDITIONAL([USE_OPENSSL], [test "$with_openssl" = "yes"])
42+
AM_CONDITIONAL([USE_OPENSSL], [test "$with_openssl" != "no"])
4043

4144
# Checks flex/bison version
4245
AC_PATH_PROG([FLEX],[flex])
@@ -57,7 +60,10 @@ AC_CHECK_HEADERS(getopt.h, ,[AC_MSG_ERROR([Cannot find getopt.h header])])
5760
AC_CHECK_HEADERS(sys/time.h, ,[AC_MSG_ERROR([Cannot find sys/time.h header])])
5861

5962
# Check python dependencies
60-
if test "$enable_python" = "yes"; then
63+
if test "$with_python" != "no"; then
64+
if test "$with_python" != "yes"; then
65+
export PATH="$with_python/bin:$PATH"
66+
fi
6167
AM_PATH_PYTHON([3])
6268
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
6369
AC_ARG_VAR([PYTHON_LIBS], [ldflags flags for python, bypassing python-config])
@@ -79,7 +85,7 @@ if test "$enable_python" = "yes"; then
7985
LDFLAGS="$LDFLAGS $PYTHON_LIBS"
8086

8187
AC_DEFINE([HAVE_PYTHON], ["yes"], [Define to "yes" if Python support is enabled.])
82-
AC_SUBST([PYTHON_SUPPORT], [$enable_python])
88+
AC_SUBST([PYTHON_SUPPORT], [yes])
8389
fi
8490

8591

debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
override_dh_auto_configure:
66
dh_auto_configure -- \
7-
--enable-python
7+
--with-python
88

99
override_dh_installexamples:
1010
dh_installexamples main/myanon-sample.conf

0 commit comments

Comments
 (0)