Skip to content

Commit

Permalink
should compile now
Browse files Browse the repository at this point in the history
  • Loading branch information
vvaltman committed May 13, 2015
1 parent c7fb3c0 commit d3680da
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
22 changes: 15 additions & 7 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ DIR_LIST=${DEP} ${AUTO} ${EXE} ${OBJ} ${LIB} ${DEP}/auto ${OBJ}/auto

LIB_LIST=${LIB}/libtgl.a ${LIB}/libtgl.so

TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/mtproto-utils.o ${OBJ}/queries.o ${OBJ}/structures.o ${OBJ}/binlog.o ${OBJ}/auto/auto.o ${OBJ}/tgl.o ${OBJ}/updates.o ${OBJ}/tg-mime-types.o @EXTRA_OBJECTS@
TGL_OBJECTS=${OBJ}/mtproto-common.o ${OBJ}/mtproto-client.o ${OBJ}/queries.o ${OBJ}/structures.o ${OBJ}/binlog.o ${OBJ}/tgl.o ${OBJ}/updates.o ${OBJ}/tg-mime-types.o ${OBJ}/mtproto-utils.o @EXTRA_OBJECTS@
TGL_OBJECTS_AUTO=${OBJ}/auto/auto-skip.o ${OBJ}/auto/auto-fetch.o ${OBJ}/auto/auto-store.o ${OBJ}/auto/auto-autocomplete.o ${OBJ}/auto/auto-types.o ${OBJ}/auto/auto-fetch-ds.o ${OBJ}/auto/auto-free-ds.o ${OBJ}/auto/auto-store-ds.o ${OBJ}/auto/auto-print-ds.o
TLD_OBJECTS=${OBJ}/dump-tl-file.o
GENERATE_OBJECTS=${OBJ}/generate.o
COMMON_OBJECTS=${OBJ}/tools.o
Expand All @@ -36,7 +37,7 @@ CC=@CC@
.SUFFIXES: .c .h .o

all: ${LIB_LIST}
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto.c ${AUTO}/auto-header.h ${AUTO}/constants.h
create_dirs_and_headers: ${DIR_LIST} ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h
create_dirs: ${DIR_LIST}
dump-tl: ${EXE}/dump-tl-file

Expand All @@ -47,15 +48,18 @@ ${DIR_LIST}:

-include ${DEPENDENCE_LIST}

${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-header.h
${TGL_OBJECTS}: ${AUTO}/constants.h ${AUTO}/auto-skip.h ${AUTO}/auto-fetch.h ${AUTO}/auto-store.h ${AUTO}/auto-autocomplete.h ${AUTO}/auto-types.h ${AUTO}/auto-fetch-ds.h ${AUTO}/auto-free-ds.h ${AUTO}/auto-store-ds.h ${AUTO}/auto-print-ds.h

${OBJ_C}: ${OBJ}/%.o: ${srcdir}/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

${LIB}/libtgl.a: ${TGL_OBJECTS} ${COMMON_OBJECTS}
${TGL_OBJECTS_AUTO}: ${OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/$*.d -MQ ${OBJ}/$*.o -o $@ $<

${LIB}/libtgl.a: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
ar ruv $@ ${TGL_OBJECTS} ${COMMON_OBJECTS}

${LIB}/libtgl.so: ${TGL_OBJECTS} ${COMMON_OBJECTS}
${LIB}/libtgl.so: ${TGL_OBJECTS} ${COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
${CC} -shared -o $@ ${TGL_OBJECTS} ${COMMON_OBJECTS} ${LINK_FLAGS}

${EXE}/generate: ${GENERATE_OBJECTS} ${COMMON_OBJECTS}
Expand All @@ -73,8 +77,12 @@ ${AUTO}/scheme2.tl: ${AUTO}/scheme.tl ${EXE}/tl-parser
${AUTO}/auto.c: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate ${AUTO}/scheme.tlo > $@

${AUTO}/auto-header.h: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate -H ${AUTO}/scheme.tlo > $@
${AUTO}/auto-%.c: ${AUTO}/scheme.tlo ${EXE}/generate auto/constants.h ${AUTO}/auto-%.h | create_dirs_and_headers
${EXE}/generate -g $(patsubst ${AUTO}/auto-%.c,%,$@) ${AUTO}/scheme.tlo > $@ || rm $@

${AUTO}/auto-%.h: ${AUTO}/scheme.tlo ${EXE}/generate
${EXE}/generate -g $(patsubst ${AUTO}/auto-%.h,%-header,$@) ${AUTO}/scheme.tlo > $@ || rm $@


${AUTO}/constants.h: ${AUTO}/scheme2.tl ${srcdir}/gen_constants_h.awk
awk -f ${srcdir}/gen_constants_h.awk < $< > $@
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

/* fixed for correct valgrind work */
#undef VALGRIND_FIXES

/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t

Expand Down
21 changes: 20 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ with_openssl
with_zlib
enable_extf
enable_libevent
enable_valgrind
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1302,7 +1303,8 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
enables extended queries system
include libevent-based net and timers
--enable-libevent include libevent-based net and timers
fixes for correct valgrind work
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
Expand Down Expand Up @@ -4078,6 +4080,23 @@ fi
fi


# Check whether --enable-valgrind was given.
if test "${enable_valgrind+set}" = set; then :
enableval=$enable_valgrind;
if test "x$enableval" = "xyes" ; then
ac_fn_c_check_header_mongrel "$LINENO" "valgrind/memcheck.h" "ac_cv_header_valgrind_memcheck_h" "$ac_includes_default"
if test "x$ac_cv_header_valgrind_memcheck_h" = xyes; then :

$as_echo "#define VALGRIND_FIXES 1" >>confdefs.h

fi


fi

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 :
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AC_ARG_ENABLE(extf,[enables extended queries system],
],[
])

AC_ARG_ENABLE(libevent,[include libevent-based net and timers],
AC_ARG_ENABLE(libevent,[--enable-libevent include libevent-based net and timers],
[
if test "x$enableval" = "xyes" ; then
AC_CHECK_LIB([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
Expand Down

0 comments on commit d3680da

Please sign in to comment.