diff --git a/Makefile b/Makefile index 1c4c05c..014677c 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ srcdir=. -CFLAGS=-g -O2 -I/usr/include/lua5.2 +CFLAGS=-g -O2 LDFLAGS= CPPFLAGS= DEFS=-DHAVE_CONFIG_H COMPILE_FLAGS=${CFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -EXTRA_LIBS= -lreadline -lrt -lconfig -llua5.2 -ldl -LOCAL_LDFLAGS=-lm -lcrypto -lz -lssl -rdynamic -ggdb ${EXTRA_LIBS} +EXTRA_LIBS=-lconfig -lcrypto -lz -lrt -lm -lreadline -llua +LOCAL_LDFLAGS=-rdynamic -ggdb ${EXTRA_LIBS} LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS} HEADERS= ${srcdir}/constants.h ${srcdir}/include.h ${srcdir}/interface.h ${srcdir}/LICENSE.h ${srcdir}/loop.h ${srcdir}/mtproto-client.h ${srcdir}/mtproto-common.h ${srcdir}/net.h ${srcdir}/no-preview.h ${srcdir}/queries.h ${srcdir}/structures.h ${srcdir}/telegram.h ${srcdir}/tree.h ${srcdir}/config.h ${srcdir}/binlog.h ${srcdir}/tools.h ${srcdir}/lua-tg.h diff --git a/config.h b/config.h index bed34d6..5f54b0c 100644 --- a/config.h +++ b/config.h @@ -141,6 +141,9 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "0.1" +/* Use custom prog name */ +/* #undef PROG_NAME */ + /* Use libedit */ /* #undef READLINE_EDIT */ diff --git a/config.h.in b/config.h.in index f67b9cb..1a20b5b 100644 --- a/config.h.in +++ b/config.h.in @@ -140,6 +140,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Use custom prog name */ +#undef PROG_NAME + /* Use libedit */ #undef READLINE_EDIT diff --git a/configure b/configure index 8861a5a..dd2e8ef 100755 --- a/configure +++ b/configure @@ -687,6 +687,7 @@ ac_user_opts=' enable_option_checking enable_libconfig enable_liblua +with_progname ' ac_precious_vars='build_alias host_alias @@ -1312,6 +1313,11 @@ Optional Features: --enable-libconfig/--disable-libconfig --enable-liblua/--disable-liblua +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +--with-progname= + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -5363,6 +5369,35 @@ fi fi +#check for custom prog name + +# Check whether --with-progname was given. +if test "${with_progname+set}" = set; then : + withval=$with_progname; + if test "x$with_progname" = "xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } + elif test "x$with_progname" = "xyes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_progname\"" >&5 +$as_echo "\"$with_progname\"" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PROG_NAME "$with_progname" +_ACEOF + + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } + +fi + + # Checks for header files. for ac_header in execinfo.h fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h do : diff --git a/configure.ac b/configure.ac index 8780f33..f17039d 100644 --- a/configure.ac +++ b/configure.ac @@ -75,6 +75,21 @@ AC_ARG_ENABLE(liblua,[--enable-liblua/--disable-liblua], AC_MSG_ERROR([No lua found. Try --disable-liblua]) ]) ]) + +#check for custom prog name +AC_ARG_WITH(progname,[--with-progname=], + [ + if test "x$with_progname" = "xno" ; then + AC_MSG_RESULT([default]) + elif test "x$with_progname" = "xyes" ; then + AC_MSG_RESULT([default]) + else + AC_MSG_RESULT(["$with_progname"]) + AC_DEFINE_UNQUOTED([PROG_NAME], ["$with_progname"], [Use custom prog name]) + fi + ],[ + AC_MSG_RESULT([default]) + ]) # Checks for header files. AC_CHECK_HEADERS([execinfo.h fcntl.h malloc.h netdb.h stdlib.h string.h unistd.h arpa/inet.h mach/mach.h netinet/in.h sys/file.h sys/socket.h termios.h])